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