compile: promote add_assignment and out_contexts
authorJean Privat <jean@pryen.org>
Wed, 15 Jul 2009 15:28:30 +0000 (11:28 -0400)
committerJean Privat <jean@pryen.org>
Wed, 15 Jul 2009 16:19:41 +0000 (12:19 -0400)
Move them from compiling_methods to compiling_base.

Signed-off-by: Jean Privat <jean@pryen.org>

src/compiling/compiling_base.nit
src/compiling/compiling_methods.nit

index 4debc4f..f92e00b 100644 (file)
@@ -56,6 +56,17 @@ class CompilerVisitor
                end
        end
 
+       # Add a assignment between a variable and an expression
+       fun add_assignment(v: String, s: String)
+       do
+               if v != s then
+                       add_instr("{v} = {s};")
+               end
+       end
+
+       # C outputs written outside the current C function.
+       readable writable var _out_contexts: Array[CContext] = new Array[CContext]
+
        # Return a unique new number for the instance
        fun new_number: Int
        do
index cf8b748..4233c68 100644 (file)
@@ -59,21 +59,10 @@ redef class CompilerVisitor
                return v
        end
 
-       # Add a assignment between a variable and an expression
-       fun add_assignment(v: String, s: String)
-       do
-               if v != s then
-                       add_instr("{v} = {s};")
-               end
-       end
-
        readable writable var _cfc: nullable CFunctionContext
 
        readable writable var _nmc: nullable NitMethodContext
 
-       # C outputs written outside the current C function.
-       readable writable var _out_contexts: Array[CContext] = new Array[CContext]
-
        # Generate an fprintf to display an error location
        fun printf_locate_error(node: PNode): String
        do