Mercurial > archived > louis > epitech > mq > rathaxes
comparison rathaxes_compiler_passes_correctly_resolve_chunk_args_subidentifiers.patch @ 123:3816844250ff
WIP, one more fix from David
author | Louis Opter <louis@lse.epita.fr> |
---|---|
date | Sat, 03 Aug 2013 17:34:38 -0700 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
122:52402232483f | 123:3816844250ff |
---|---|
1 # HG changeset patch | |
2 # User David Pineau <dav.pineau@gmail.com>, Louis Opter <louis@lse.epita.fr> | |
3 # Parent 924908351b124b3fd1180f27880d36ea64e7c01c | |
4 rathaxes: correctly resolve the type of chunk arguments subidentifiers | |
5 | |
6 diff --git a/rathaxes/compiler/passes/back/rtxIntrospect.inc.cws b/rathaxes/compiler/passes/back/rtxIntrospect.inc.cws | |
7 --- a/rathaxes/compiler/passes/back/rtxIntrospect.inc.cws | |
8 +++ b/rathaxes/compiler/passes/back/rtxIntrospect.inc.cws | |
9 @@ -744,17 +744,18 @@ | |
10 if (!existVariable(param.rtype)) | |
11 { | |
12 localref theVar = param.identifiers#[0]; | |
13 + local theType; | |
14 if (theVar.name == "local") | |
15 { | |
16 ref theVar = param.identifiers#[1]; | |
17 } | |
18 - local theType; | |
19 if (findElement(theVar.name, theChunk.type_map)) | |
20 ref theType = theChunk.type_map[theVar.name]; | |
21 else if (findElement(theVar.name, theChunk.variables)) | |
22 ref theType = theChunk.variables[theVar.name].type_node; | |
23 insert param.rtype; | |
24 - if (getArraySize(param.identifiers) > 2) | |
25 + if ((param.identifiers#[0].name != "local" && getArraySize(param.identifiers) > 1) | |
26 + || getArraySize(param.identifiers) > 2) | |
27 { | |
28 local subType; | |
29 local fieldList; | |
30 @@ -763,7 +764,8 @@ | |
31 pushItem fieldList; | |
32 fieldList#back = field.name; | |
33 } | |
34 - removeFirstElement(fieldList); | |
35 + if (param.identifiers#[0].name == "local") | |
36 + removeFirstElement(fieldList); | |
37 removeFirstElement(fieldList); | |
38 if (rtxTypingLookup_ResolveTypeFields(theType, fieldList, theChunk, theChunk#root /* XXX dummy */, subType) == false) | |
39 { |