nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added 'create_thread' function to enable thread creation after a exit.
[nit.git]
/
src
/
naive_interpreter.nit
diff --git
a/src/naive_interpreter.nit
b/src/naive_interpreter.nit
index
e9d0a97
..
7f8d5ee
100644
(file)
--- a/
src/naive_interpreter.nit
+++ b/
src/naive_interpreter.nit
@@
-794,6
+794,9
@@
redef class AMethPropdef
return v.bool_instance(args[0].to_f.is_inf != 0)
end
else if cname == "NativeString" then
return v.bool_instance(args[0].to_f.is_inf != 0)
end
else if cname == "NativeString" then
+ if pname == "init" then
+ return v.native_string_instance("!" * args[1].to_i)
+ end
var recvval = args.first.val.as(Buffer)
if pname == "[]" then
var arg1 = args[1].to_i
var recvval = args.first.val.as(Buffer)
if pname == "[]" then
var arg1 = args[1].to_i
@@
-852,6
+855,10
@@
redef class AMethPropdef
else if pname == "calloc_string" then
return v.native_string_instance("!" * args[1].to_i)
else if cname == "NativeArray" then
else if pname == "calloc_string" then
return v.native_string_instance("!" * args[1].to_i)
else if cname == "NativeArray" then
+ if pname == "init" then
+ var val = new Array[Instance].filled_with(v.null_instance, args[1].to_i)
+ return new PrimitiveInstance[Array[Instance]](args[0].mtype, val)
+ end
var recvval = args.first.val.as(Array[Instance])
if pname == "[]" then
if args[1].to_i >= recvval.length or args[1].to_i < 0 then
var recvval = args.first.val.as(Array[Instance])
if pname == "[]" then
if args[1].to_i >= recvval.length or args[1].to_i < 0 then