Differences From Artifact [94ac916389440918]:
- File
polemy/valueconv.d
- 2010-11-23 18:28:47 - part of checkin [ba11f1d551] on branch trunk - fixed the macro scoping rules concerning non-macro let (user: kinaba) [annotate]
To Artifact [bca45e855c0f4664]:
- File
polemy/valueconv.d
- 2010-11-24 11:20:42 - part of checkin [153a14cec0] on branch trunk - if-then-else without {}s. some cosmetic changes (user: kinaba) [annotate]
65 LexPosition pos = extractPos(t); 65 LexPosition pos = extractPos(t);
66 66
67 StrValue typ = cast(StrValue) t.access!StrValue(ValueLay 67 StrValue typ = cast(StrValue) t.access!StrValue(ValueLay
68 if( typ is null ) 68 if( typ is null )
69 throw genex!RuntimeException(callpos, text(`Inva 69 throw genex!RuntimeException(callpos, text(`Inva
70 70
71 foreach(AT; ListOfASTTypes) 71 foreach(AT; ListOfASTTypes)
72 if(typ.data == typeid(AT).name.split(".")[$-1].t | 72 if(typ.data == typeid(AT).name.split(".")[$-1])
73 { 73 {
74 typeof(AT.tupleof) mems; 74 typeof(AT.tupleof) mems;
75 foreach(i,m; mems) 75 foreach(i,m; mems)
76 { 76 {
77 string name = AT.tupleof[i].stri 77 string name = AT.tupleof[i].stri
78 Value vm = t.access!Value(ValueL 78 Value vm = t.access!Value(ValueL
79 if( vm is null ) 79 if( vm is null )
................................................................................................................................................................................
142 } 142 }
143 else 143 else
144 static if(is(T : AST)) 144 static if(is(T : AST))
145 { 145 {
146 assert( typeid(e) == typeid(T), text("abstracted: ", typeid(e), 146 assert( typeid(e) == typeid(T), text("abstracted: ", typeid(e),
147 auto t = new Table; 147 auto t = new Table;
148 t.set("pos", ValueLayer, ast2table(e.pos,rec)); 148 t.set("pos", ValueLayer, ast2table(e.pos,rec));
149 t.set("is" , ValueLayer, new StrValue(typeid(e).name.split(".")[ | 149 t.set("is" , ValueLayer, new StrValue(typeid(e).name.split(".")[
150 foreach(i,m; e.tupleof) 150 foreach(i,m; e.tupleof)
151 static if(is(typeof(m) : AST)) 151 static if(is(typeof(m) : AST))
152 t.set(e.tupleof[i].stringof.split(".")[$-1], Val 152 t.set(e.tupleof[i].stringof.split(".")[$-1], Val
153 else 153 else
154 t.set(e.tupleof[i].stringof.split(".")[$-1], Val 154 t.set(e.tupleof[i].stringof.split(".")[$-1], Val
155 return t; 155 return t;
156 } 156 }