view rathaxes_compiler_passes_look_for_locally_casted_variables_in_sequence_calls.patch @ 126:6e142648b2fe

Wip on compiler issues
author Louis Opter <louis@lse.epita.fr>
date Sun, 18 Aug 2013 12:51:47 -0700
parents 5a663f8f0e54
children
line wrap: on
line source

# HG changeset patch
# User David Pineau <dav.pineau@gmail.com>, Louis Opter <louis@lse.epita.fr>
# Parent 163975605ce8e4b9049deb60207358acc904f14c
rathaxes: correctly resolve locally casted variables during sequence calls

C variables declared locally and casted into Rathaxes types weren't
taken into account during sequence calls. This changeset fixes it.

diff --git a/rathaxes/compiler/passes/back/rtxIntrospect.inc.cws b/rathaxes/compiler/passes/back/rtxIntrospect.inc.cws
--- a/rathaxes/compiler/passes/back/rtxIntrospect.inc.cws
+++ b/rathaxes/compiler/passes/back/rtxIntrospect.inc.cws
@@ -751,6 +751,8 @@
             local theType;
             if (findElement(theVar.name, theChunk.type_map))
                 ref theType = theChunk.type_map[theVar.name];
+            else if (findElement(theVar.name, theChunk.variables))
+                ref theType = theChunk.variables[theVar.name].type_node;
             insert param.rtype;
             if (getArraySize(param.identifiers) > 2)
             {