Mercurial > projects > ddmd
annotate dmd/InlineDoState.d @ 192:eb38fdcb3e62 default tip
updated to compile with dmd2.062
author | korDen |
---|---|
date | Sat, 02 Mar 2013 01:25:52 -0800 |
parents | e3afd1303184 |
children |
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 | |
178 | 10 import dmd.TObject; |
11 | |
12 class InlineDoState : TObject | |
0 | 13 { |
14 VarDeclaration vthis; | |
15 Array from; // old Dsymbols | |
16 Array to; // parallel array of new Dsymbols | |
17 Dsymbol parent; // new parent | |
18 | |
19 this() | |
20 { | |
178 | 21 register(); |
0 | 22 from = new Array(); |
23 to = new Array(); | |
24 } | |
25 } | |
26 | |
27 /****************************** | |
28 * Perform doInline() on an array of Expressions. | |
29 */ | |
30 | |
31 Expressions arrayExpressiondoInline(Expressions a, InlineDoState ids) | |
32 { | |
33 Expressions newa = null; | |
34 | |
35 if (a) | |
36 { | |
37 newa = new Expressions(); | |
38 newa.setDim(a.dim); | |
39 | |
90
39648eb578f6
more Expressions work
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
84
diff
changeset
|
40 foreach (size_t i, Expression e; a) |
0 | 41 { |
42 if (e) | |
43 { | |
44 e = e.doInline(ids); | |
84
be2ab491772e
Expressions -> Vector!Expression
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
0
diff
changeset
|
45 newa[i] = e; |
0 | 46 } |
47 } | |
48 } | |
49 return newa; | |
50 } |