Mercurial > projects > ddmd
comparison dmd/TypeStruct.d @ 84:be2ab491772e
Expressions -> Vector!Expression
author | Eldar Insafutdinov <e.insafutdinov@gmail.com> |
---|---|
date | Mon, 30 Aug 2010 16:12:19 +0100 |
parents | 43073c7c7769 |
children | 8e69d041a99d |
comparison
equal
deleted
inserted
replaced
83:ee670dd808a8 | 84:be2ab491772e |
---|---|
179 { | 179 { |
180 /* Create a TupleExp out of the fields of the struct e: | 180 /* Create a TupleExp out of the fields of the struct e: |
181 * (e.field0, e.field1, e.field2, ...) | 181 * (e.field0, e.field1, e.field2, ...) |
182 */ | 182 */ |
183 e = e.semantic(sc); // do this before turning on noaccesscheck | 183 e = e.semantic(sc); // do this before turning on noaccesscheck |
184 Expressions exps = new Expressions; | 184 auto exps = new Expressions; |
185 exps.reserve(sym.fields.dim); | 185 exps.reserve(sym.fields.dim); |
186 for (size_t i = 0; i < sym.fields.dim; i++) | 186 for (size_t i = 0; i < sym.fields.dim; i++) |
187 { | 187 { |
188 VarDeclaration v2 = cast(VarDeclaration)sym.fields[i]; | 188 VarDeclaration v2 = cast(VarDeclaration)sym.fields[i]; |
189 Expression fe = new DotVarExp(e.loc, e, v2); | 189 Expression fe = new DotVarExp(e.loc, e, v2); |
190 exps.push(cast(void*)fe); | 190 exps.push(fe); |
191 } | 191 } |
192 e = new TupleExp(e.loc, exps); | 192 e = new TupleExp(e.loc, exps); |
193 sc = sc.push(); | 193 sc = sc.push(); |
194 sc.noaccesscheck = 1; | 194 sc.noaccesscheck = 1; |
195 e = e.semantic(sc); | 195 e = e.semantic(sc); |