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 65 LexPosition pos = extractPos(t);
66 66
67 67 StrValue typ = cast(StrValue) t.access!StrValue(ValueLayer, "is");
68 68 if( typ is null )
69 69 throw genex!RuntimeException(callpos, text(`Invalid AST (no "is" field): `, _v));
70 70
71 71 foreach(AT; ListOfASTTypes)
72 - if(typ.data == typeid(AT).name.split(".")[$-1].tolower())
72 + if(typ.data == typeid(AT).name.split(".")[$-1])
73 73 {
74 74 typeof(AT.tupleof) mems;
75 75 foreach(i,m; mems)
76 76 {
77 77 string name = AT.tupleof[i].stringof.split(".")[$-1];
78 78 Value vm = t.access!Value(ValueLayer, name);
79 79 if( vm is null )
................................................................................
142 142 }
143 143 else
144 144 static if(is(T : AST))
145 145 {
146 146 assert( typeid(e) == typeid(T), text("abstracted: ", typeid(e), " vs ", typeid(T)) );
147 147 auto t = new Table;
148 148 t.set("pos", ValueLayer, ast2table(e.pos,rec));
149 - t.set("is" , ValueLayer, new StrValue(typeid(e).name.split(".")[$-1].tolower()));
149 + t.set("is" , ValueLayer, new StrValue(typeid(e).name.split(".")[$-1]));
150 150 foreach(i,m; e.tupleof)
151 151 static if(is(typeof(m) : AST))
152 152 t.set(e.tupleof[i].stringof.split(".")[$-1], ValueLayer, rec(m));
153 153 else
154 154 t.set(e.tupleof[i].stringof.split(".")[$-1], ValueLayer, ast2table(m,rec));
155 155 return t;
156 156 }