Mercurial > projects > ddmd
annotate dmd/InlineDoState.d @ 132:c494af1dba80
Fixes for dmd 2.037
author | Eldar Insafutdinov <e.insafutdinov@gmail.com> |
---|---|
date | Fri, 10 Sep 2010 19:14:09 +0100 |
parents | e28b18c23469 |
children | e3afd1303184 |
rev | line source |
---|---|
0 | 1 module dmd.InlineDoState; |
2 | |
114 | 3 import dmd.common; |
0 | 4 import dmd.Array; |
5 import dmd.Dsymbol; | |
6 import dmd.VarDeclaration; | |
7 import dmd.Expression; | |
8 import dmd.ArrayTypes; | |
9 | |
10 class InlineDoState | |
11 { | |
12 VarDeclaration vthis; | |
13 Array from; // old Dsymbols | |
14 Array to; // parallel array of new Dsymbols | |
15 Dsymbol parent; // new parent | |
16 | |
17 this() | |
18 { | |
19 from = new Array(); | |
20 to = new Array(); | |
21 } | |
22 } | |
23 | |
24 /****************************** | |
25 * Perform doInline() on an array of Expressions. | |
26 */ | |
27 | |
28 Expressions arrayExpressiondoInline(Expressions a, InlineDoState ids) | |
29 { | |
30 Expressions newa = null; | |
31 | |
32 if (a) | |
33 { | |
34 newa = new Expressions(); | |
35 newa.setDim(a.dim); | |
36 | |
90
39648eb578f6
more Expressions work
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
84
diff
changeset
|
37 foreach (size_t i, Expression e; a) |
0 | 38 { |
39 if (e) | |
40 { | |
41 e = e.doInline(ids); | |
84
be2ab491772e
Expressions -> Vector!Expression
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
0
diff
changeset
|
42 newa[i] = e; |
0 | 43 } |
44 } | |
45 } | |
46 return newa; | |
47 } |