Mercurial > projects > ddmd
comparison dmd/TemplateMixin.d @ 170:96c0fff6897d
more global state cleanup
author | korDen |
---|---|
date | Thu, 30 Sep 2010 14:09:50 +0400 |
parents | e28b18c23469 |
children | e3afd1303184 |
comparison
equal
deleted
inserted
replaced
169:e7769d53e750 | 170:96c0fff6897d |
---|---|
297 } | 297 } |
298 Scope sc2; | 298 Scope sc2; |
299 sc2 = argscope.push(this); | 299 sc2 = argscope.push(this); |
300 sc2.offset = sc.offset; | 300 sc2.offset = sc.offset; |
301 | 301 |
302 | 302 //printf("%d\n", global.nest); |
303 static int nest; | 303 if (++global.nest > 500) |
304 //printf("%d\n", nest); | |
305 if (++nest > 500) | |
306 { | 304 { |
307 global.gag = 0; // ensure error message gets printed | 305 global.gag = 0; // ensure error message gets printed |
308 error("recursive expansion"); | 306 error("recursive expansion"); |
309 fatal(); | 307 fatal(); |
310 } | 308 } |
311 | 309 |
312 foreach(Dsymbol s; members) | 310 foreach(Dsymbol s; members) |
313 s.semantic(sc2); | 311 s.semantic(sc2); |
314 | 312 |
315 nest--; | 313 global.nest--; |
316 | 314 |
317 sc.offset = sc2.offset; | 315 sc.offset = sc2.offset; |
318 | 316 |
319 /* The problem is when to parse the initializer for a variable. | 317 /* The problem is when to parse the initializer for a variable. |
320 * Perhaps VarDeclaration.semantic() should do it like it does | 318 * Perhaps VarDeclaration.semantic() should do it like it does |