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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
1 module dmd.InlineDoState;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
2
114
e28b18c23469 added a module dmd.common for commonly used stuff
Trass3r
parents: 90
diff changeset
3 import dmd.common;
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
4 import dmd.Array;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
5 import dmd.Dsymbol;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
6 import dmd.VarDeclaration;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
7 import dmd.Expression;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
8 import dmd.ArrayTypes;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
9
178
e3afd1303184 Many small bugs fixed
korDen
parents: 114
diff changeset
10 import dmd.TObject;
e3afd1303184 Many small bugs fixed
korDen
parents: 114
diff changeset
11
e3afd1303184 Many small bugs fixed
korDen
parents: 114
diff changeset
12 class InlineDoState : TObject
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
13 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
14 VarDeclaration vthis;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
15 Array from; // old Dsymbols
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
16 Array to; // parallel array of new Dsymbols
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
17 Dsymbol parent; // new parent
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
18
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
19 this()
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
20 {
178
e3afd1303184 Many small bugs fixed
korDen
parents: 114
diff changeset
21 register();
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
22 from = new Array();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
23 to = new Array();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
24 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
25 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
26
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
27 /******************************
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
28 * Perform doInline() on an array of Expressions.
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
29 */
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
30
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
31 Expressions arrayExpressiondoInline(Expressions a, InlineDoState ids)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
32 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
33 Expressions newa = null;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
34
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
35 if (a)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
36 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
37 newa = new Expressions();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
38 newa.setDim(a.dim);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
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
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
41 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
42 if (e)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
43 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
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
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
46 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
47 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
48 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
49 return newa;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
50 }