syntax: better location for local variable declarations
authorJean Privat <jean@pryen.org>
Thu, 6 Aug 2009 14:52:29 +0000 (10:52 -0400)
committerJean Privat <jean@pryen.org>
Thu, 6 Aug 2009 15:29:30 +0000 (11:29 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

src/syntax/mmbuilder.nit
src/syntax/typing.nit

index c079443..3b7951f 100644 (file)
@@ -1176,7 +1176,7 @@ redef class AParam
        do
                super
                _position = v.signature_builder.params.length
-               _variable = new ParamVariable(n_id.to_symbol, self)
+               _variable = new ParamVariable(n_id.to_symbol, n_id)
                v.signature_builder.params.add(self)
                v.signature_builder.untyped_params.add(self)
                if n_type != null then
@@ -1242,7 +1242,7 @@ redef class AClosureDecl
                v.signature_builder = old_signature_builder
                _position = old_signature_builder.closure_decls.length
                old_signature_builder.closure_decls.add(self)
-               _variable = new ClosureVariable(n_id.to_symbol, self, clos)
+               _variable = new ClosureVariable(n_id.to_symbol, n_id, clos)
        end
 end
 
index 13737aa..98da175 100644 (file)
@@ -350,7 +350,7 @@ redef class AVardeclExpr
 
        redef fun after_typing(v)
        do
-               var va = new VarVariable(n_id.to_symbol, self)
+               var va = new VarVariable(n_id.to_symbol, n_id)
                _variable = va
                v.variable_ctx.add(va)
                if n_expr != null then v.variable_ctx.mark_is_set(va)
@@ -589,7 +589,7 @@ redef class AForExpr
                var old_base_var_ctx = v.base_variable_ctx
                v.base_variable_ctx = v.variable_ctx
                v.variable_ctx = v.variable_ctx.sub(self)
-               var va = new AutoVariable(n_id.to_symbol, self)
+               var va = new AutoVariable(n_id.to_symbol, n_id)
                _variable = va
                v.variable_ctx.add(va)
 
@@ -1647,7 +1647,7 @@ redef class AClosureDef
                v.variable_ctx = v.variable_ctx.sub(self)
                variables = new Array[AutoVariable]
                for i in [0..n_ids.length[ do
-                       var va = new AutoVariable(n_ids[i].to_symbol, self)
+                       var va = new AutoVariable(n_ids[i].to_symbol, n_ids[i])
                        variables.add(va)
                        va.stype = sig[i]
                        v.variable_ctx.add(va)