view rathaxes_compiler_passes_fix_local_variable_resolution_on_method_call.patch @ 128:0fdaa93ed62b

Start to clean up new compiler patch
author Louis Opter <louis@lse.epita.fr>
date Mon, 26 Aug 2013 22:53:34 -0700
parents 6e142648b2fe
children
line wrap: on
line source

# HG changeset patch
# Parent 1b62d6a6307fbfe6ad9ae7137d189f48b7ceb1fb
rathaxes: fix resolution of local variables on method call

Fix ${local.skb.init()} crazyness.

diff --git a/rathaxes/compiler/passes/common/rtxResolve.inc.cws b/rathaxes/compiler/passes/common/rtxResolve.inc.cws
--- a/rathaxes/compiler/passes/common/rtxResolve.inc.cws
+++ b/rathaxes/compiler/passes/common/rtxResolve.inc.cws
@@ -388,7 +388,20 @@
                 // Argument comes from the Chunk, so we retrieve the *real* type
                 // That will be resolved after the "local" resolution.
 
-                rtxResolve_BuildLocalSelf(subResVal, theChunk, placeHolder, subidentifiers);
+                if (subidentifiers#front == "local")
+                    rtxResolve_BuildLocalSelf(subResVal, theChunk, placeHolder, subidentifiers);
+                else
+                {
+                    local src_arg;
+                    local src_type;
+                    local src_value;
+                    rtxNodeArgs_GetArgByName(src_resVals, "self", src_arg);
+                    if (rtxNodeArg_getRType(src_arg, src_type) == false)
+                        return false;
+                    if (rtxNodeArg_getValue(src_arg, src_value) == false)
+                        return false;
+                    rtxNodeArgs_AppendArg(subResVal, "self", src_type, src_value);
+                }
                 local local_self;
                 rtxNodeArgs_GetArgByName(subResVal, "self", local_self);
                 local local_type;