annotate dmd/ForeachRangeStatement.d @ 93:df6d0f967680

implemented a whole bunch of methods to make phobos 2.035 compile and some additional ones I came across
author Trass3r
date Mon, 30 Aug 2010 22:50:30 +0200
parents 2e2a5c3f943a
children e28b18c23469
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
1 module dmd.ForeachRangeStatement;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
2
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
3 import dmd.Statement;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
4 import dmd.TOK;
93
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
5 import dmd.Token;
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
6 import dmd.Argument;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
7 import dmd.Expression;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
8 import dmd.Statement;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
9 import dmd.VarDeclaration;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
10 import dmd.Scope;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
11 import dmd.ExpInitializer;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
12 import dmd.Identifier;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
13 import dmd.Lexer;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
14 import dmd.ArrayTypes;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
15 import dmd.DeclarationStatement;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
16 import dmd.CompoundDeclarationStatement;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
17 import dmd.DeclarationExp;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
18 import dmd.PostExp;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
19 import dmd.VarExp;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
20 import dmd.ForStatement;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
21 import dmd.IntegerExp;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
22 import dmd.AddAssignExp;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
23 import dmd.CmpExp;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
24 import dmd.IRState;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
25 import dmd.InterState;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
26 import dmd.OutBuffer;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
27 import dmd.AddExp;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
28 import dmd.WANT;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
29 import dmd.ScopeDsymbol;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
30 import dmd.HdrGenState;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
31 import dmd.InlineScanState;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
32 import dmd.Loc;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
33 import dmd.BE;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
34
93
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
35 version(DMDV2)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
36 class ForeachRangeStatement : Statement
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
37 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
38 TOK op; // TOK.TOKforeach or TOK.TOKforeach_reverse
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
39 Argument arg; // loop index variable
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
40 Expression lwr;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
41 Expression upr;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
42 Statement body_;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
43
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
44 VarDeclaration key = null;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
45
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
46 this(Loc loc, TOK op, Argument arg, Expression lwr, Expression upr, Statement body_)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
47 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
48 super(loc);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
49 this.op = op;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
50 this.arg = arg;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
51 this.lwr = lwr;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
52 this.upr = upr;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
53 this.body_ = body_;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
54 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
55
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
56 override Statement syntaxCopy()
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
57 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
58 ForeachRangeStatement s = new ForeachRangeStatement(loc, op,
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
59 arg.syntaxCopy(),
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
60 lwr.syntaxCopy(),
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
61 upr.syntaxCopy(),
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
62 body_ ? body_.syntaxCopy() : null);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
63
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
64 return s;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
65 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
66
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
67 override Statement semantic(Scope sc)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
68 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
69 //printf("ForeachRangeStatement.semantic() %p\n", this);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
70 ScopeDsymbol sym;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
71 Statement s = this;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
72
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
73 lwr = lwr.semantic(sc);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
74 lwr = resolveProperties(sc, lwr);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
75 lwr = lwr.optimize(WANTvalue);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
76 if (!lwr.type)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
77 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
78 error("invalid range lower bound %s", lwr.toChars());
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
79 return this;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
80 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
81
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
82 upr = upr.semantic(sc);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
83 upr = resolveProperties(sc, upr);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
84 upr = upr.optimize(WANTvalue);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
85 if (!upr.type)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
86 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
87 error("invalid range upper bound %s", upr.toChars());
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
88 return this;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
89 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
90
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
91 if (arg.type)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
92 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
93 arg.type = arg.type.semantic(loc, sc);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
94 lwr = lwr.implicitCastTo(sc, arg.type);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
95 upr = upr.implicitCastTo(sc, arg.type);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
96 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
97 else
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
98 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
99 /* Must infer types from lwr and upr
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
100 */
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
101 scope AddExp ea = new AddExp(loc, lwr, upr);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
102 ea.typeCombine(sc);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
103 arg.type = ea.type.mutableOf();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
104 lwr = ea.e1;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
105 upr = ea.e2;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
106 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
107 static if (true) {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
108 /* Convert to a for loop:
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
109 * foreach (key; lwr .. upr) =>
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
110 * for (auto key = lwr, auto tmp = upr; key < tmp; ++key)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
111 *
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
112 * foreach_reverse (key; lwr .. upr) =>
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
113 * for (auto tmp = lwr, auto key = upr; key-- > tmp;)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
114 */
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
115
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
116 ExpInitializer ie = new ExpInitializer(loc, (op == TOKforeach) ? lwr : upr);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
117 key = new VarDeclaration(loc, arg.type, arg.ident, ie);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
118
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
119 Identifier id = Lexer.uniqueId("__limit");
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
120 ie = new ExpInitializer(loc, (op == TOKforeach) ? upr : lwr);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
121 VarDeclaration tmp = new VarDeclaration(loc, arg.type, id, ie);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
122
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
123 Statements cs = new Statements();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
124 // Keep order of evaluation as lwr, then upr
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
125 if (op == TOKforeach)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
126 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
127 cs.push(cast(void*)new DeclarationStatement(loc, new DeclarationExp(loc, key)));
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
128 cs.push(cast(void*)new DeclarationStatement(loc, new DeclarationExp(loc, tmp)));
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
129 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
130 else
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
131 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
132 cs.push(cast(void*)new DeclarationStatement(loc, new DeclarationExp(loc, tmp)));
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
133 cs.push(cast(void*)new DeclarationStatement(loc, new DeclarationExp(loc, key)));
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
134 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
135 Statement forinit = new CompoundDeclarationStatement(loc, cs);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
136
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
137 Expression cond;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
138 if (op == TOKforeach_reverse)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
139 { // key-- > tmp
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
140 cond = new PostExp(TOKminusminus, loc, new VarExp(loc, key));
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
141 cond = new CmpExp(TOKgt, loc, cond, new VarExp(loc, tmp));
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
142 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
143 else
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
144 // key < tmp
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
145 cond = new CmpExp(TOKlt, loc, new VarExp(loc, key), new VarExp(loc, tmp));
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
146
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
147 Expression increment = null;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
148 if (op == TOKforeach)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
149 // key += 1
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
150 increment = new AddAssignExp(loc, new VarExp(loc, key), new IntegerExp(1));
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
151
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
152 ForStatement fs = new ForStatement(loc, forinit, cond, increment, body_);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
153 s = fs.semantic(sc);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
154 return s;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
155 } else {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
156 if (!arg.type.isscalar())
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
157 error("%s is not a scalar type", arg.type.toChars());
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
158
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
159 sym = new ScopeDsymbol();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
160 sym.parent = sc.scopesym;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
161 sc = sc.push(sym);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
162
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
163 sc.noctor++;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
164
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
165 key = new VarDeclaration(loc, arg.type, arg.ident, null);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
166 DeclarationExp de = new DeclarationExp(loc, key);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
167 de.semantic(sc);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
168
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
169 if (key.storage_class)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
170 error("foreach range: key cannot have storage class");
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
171
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
172 sc.sbreak = this;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
173 sc.scontinue = this;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
174 body_ = body_.semantic(sc);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
175
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
176 sc.noctor--;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
177 sc.pop();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
178 return s;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
179 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
180 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
181
93
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
182 override bool hasBreak()
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
183 {
93
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
184 return true;
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
185 }
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
186
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
187 override bool hasContinue()
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
188 {
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
189 return true;
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
190 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
191
93
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
192 override bool usesEH()
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
193 {
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
194 assert(false); // from dmd
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
195 return body_.usesEH();
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
196 }
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
197
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
198 override BE blockExit()
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
199 {
93
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
200 assert(false); // from dmd
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
201 BE result = BE.BEfallthru;
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
202
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
203 if (lwr && lwr.canThrow())
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
204 result |= BE.BEthrow;
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
205 else if (upr && upr.canThrow())
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
206 result |= BE.BEthrow;
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
207
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
208 if (body_)
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
209 {
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
210 result |= body_.blockExit() & ~(BE.BEbreak | BE.BEcontinue);
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
211 }
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
212 return result;
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
213 }
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
214
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
215 override bool comeFrom()
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
216 {
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
217 assert(false); // from dmd
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
218 if (body_)
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
219 return body_.comeFrom();
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
220 return false;
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
221 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
222
93
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
223 override Expression interpret(InterState istate)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
224 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
225 assert(false);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
226 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
227
93
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
228 override void toCBuffer(OutBuffer buf, HdrGenState* hgs)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
229 {
93
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
230 buf.writestring(Token.toChars(op));
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
231 buf.writestring(" (");
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
232
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
233 if (arg.type)
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
234 arg.type.toCBuffer(buf, arg.ident, hgs);
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
235 else
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
236 buf.writestring(arg.ident.toChars());
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
237
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
238 buf.writestring("; ");
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
239 lwr.toCBuffer(buf, hgs);
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
240 buf.writestring(" .. ");
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
241 upr.toCBuffer(buf, hgs);
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
242 buf.writebyte(')');
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
243 buf.writenl();
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
244 buf.writebyte('{');
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
245 buf.writenl();
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
246 if (body_)
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
247 body_.toCBuffer(buf, hgs);
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
248 buf.writebyte('}');
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
249 buf.writenl();
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
250 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
251
93
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
252 override Statement inlineScan(InlineScanState* iss)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
253 {
93
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
254 lwr = lwr.inlineScan(iss);
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
255 upr = upr.inlineScan(iss);
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
256 if (body_)
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
257 body_ = body_.inlineScan(iss);
df6d0f967680 implemented a whole bunch of methods to make phobos 2.035 compile
Trass3r
parents: 72
diff changeset
258 return this;
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
259 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
260
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
261 override void toIR(IRState* irs)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
262 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
263 assert(false);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
264 }
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 63
diff changeset
265 }