nitc: support for native_arg[cv] as intern
authorAlexis Laferrière <alexis.laf@xymus.net>
Tue, 30 Jul 2013 14:37:13 +0000 (10:37 -0400)
committerJean Privat <jean@pryen.org>
Thu, 1 Aug 2013 19:10:26 +0000 (15:10 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

src/compiling/compiling_icode.nit

index 26c8f43..ccccb08 100644 (file)
@@ -874,6 +874,10 @@ redef class INative
                else if c == once "Sys".to_symbol then
                        if n == once "force_garbage_collection".to_symbol then
                                s = "Nit_gc_force_garbage_collection()"
+                       else if n == once "native_argc".to_symbol then
+                               s = "TAG_Int(glob_argc)"
+                       else if n == once "native_argv".to_symbol then
+                               s = "BOX_NativeString(glob_argv[UNTAG_Int({regs[1]})])"
                        end
                else if n == once "object_id".to_symbol then
                        s = "TAG_Int((bigint)((obj_t){regs[0]})[1].object_id)"