nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge: Sys is top
[nit.git]
/
src
/
interpreter
/
naive_interpreter.nit
diff --git
a/src/interpreter/naive_interpreter.nit
b/src/interpreter/naive_interpreter.nit
index
21118ab
..
4cab2e5
100644
(file)
--- a/
src/interpreter/naive_interpreter.nit
+++ b/
src/interpreter/naive_interpreter.nit
@@
-1001,11
+1001,11
@@
redef class AMethPropdef
else if pname == "file_exists" then
return v.bool_instance(recvval.to_s.file_exists)
else if pname == "file_mkdir" then
else if pname == "file_exists" then
return v.bool_instance(recvval.to_s.file_exists)
else if pname == "file_mkdir" then
- recvval.to_s.mkdir
- return null
+ var res = recvval.to_s.mkdir
+ return v.bool_instance(res == null)
else if pname == "file_chdir" then
else if pname == "file_chdir" then
- recvval.to_s.chdir
- return null
+ var res = recvval.to_s.chdir
+ return v.bool_instance(res == null)
else if pname == "file_realpath" then
return v.native_string_instance(recvval.to_s.realpath)
else if pname == "get_environ" then
else if pname == "file_realpath" then
return v.native_string_instance(recvval.to_s.realpath)
else if pname == "get_environ" then
@@
-1016,6
+1016,9
@@
redef class AMethPropdef
return v.int_instance(res)
else if pname == "atof" then
return v.float_instance(recvval.to_f)
return v.int_instance(res)
else if pname == "atof" then
return v.float_instance(recvval.to_f)
+ else if pname == "fast_cstring" then
+ var ns = recvval.to_cstring.to_s.substring_from(args[1].to_i)
+ return v.native_string_instance(ns)
end
else if cname == "String" then
var cs = v.send(v.force_get_primitive_method("to_cstring", args.first.mtype), [args.first])
end
else if cname == "String" then
var cs = v.send(v.force_get_primitive_method("to_cstring", args.first.mtype), [args.first])
@@
-1320,6
+1323,14
@@
redef class ASelfExpr
end
end
end
end
+redef class AImplicitSelfExpr
+ redef fun expr(v)
+ do
+ if not is_sys then return super
+ return v.mainobj
+ end
+end
+
redef class AEscapeExpr
redef fun stmt(v)
do
redef class AEscapeExpr
redef fun stmt(v)
do