comparison dmd/ArrayLiteralExp.d @ 135:af1bebfd96a4 dmd2037

dmd 2.038
author Eldar Insafutdinov <e.insafutdinov@gmail.com>
date Mon, 13 Sep 2010 22:19:42 +0100
parents 60bb0fe4563e
children 438eaa11eed4
comparison
equal deleted inserted replaced
134:4251f96733f4 135:af1bebfd96a4
211 { 211 {
212 Expression ex; 212 Expression ex;
213 213
214 ex = e.interpret(istate); 214 ex = e.interpret(istate);
215 if (ex is EXP_CANT_INTERPRET) 215 if (ex is EXP_CANT_INTERPRET)
216 { 216 goto Lerror;
217 delete expsx;
218 return EXP_CANT_INTERPRET;
219 }
220 217
221 /* If any changes, do Copy On Write 218 /* If any changes, do Copy On Write
222 */ 219 */
223 if (ex != e) 220 if (ex != e)
224 { 221 {
237 } 234 }
238 if (elements && expsx) 235 if (elements && expsx)
239 { 236 {
240 expandTuples(expsx); 237 expandTuples(expsx);
241 if (expsx.dim != elements.dim) 238 if (expsx.dim != elements.dim)
242 { 239 goto Lerror;
243 delete expsx;
244 return EXP_CANT_INTERPRET;
245 }
246 240
247 ArrayLiteralExp ae = new ArrayLiteralExp(loc, expsx); 241 ArrayLiteralExp ae = new ArrayLiteralExp(loc, expsx);
248 ae.type = type; 242 ae.type = type;
249 243
250 return ae; 244 return ae;
251 } 245 }
252 return this; 246 return this;
247
248 Lerror:
249 if (expsx)
250 delete expsx;
251 error("cannot interpret array literal");
252 return EXP_CANT_INTERPRET;
253 } 253 }
254 254
255 override MATCH implicitConvTo(Type t) 255 override MATCH implicitConvTo(Type t)
256 { 256 {
257 MATCH result = MATCHexact; 257 MATCH result = MATCHexact;