comparison trunk/src/dil/semantic/Pass2.d @ 692:d33895f679eb

Tidied up the class Scope a bit.
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Tue, 22 Jan 2008 18:32:39 +0100
parents 10b314bf37e3
children 19a34b69cc7d
comparison
equal deleted inserted replaced
691:276e2866f5fd 692:d33895f679eb
39 /// Start semantic analysis. 39 /// Start semantic analysis.
40 void start() 40 void start()
41 { 41 {
42 assert(modul.root !is null); 42 assert(modul.root !is null);
43 // Create module scope. 43 // Create module scope.
44 scop = new Scope(); 44 scop = new Scope(null, modul);
45 scop.symbol = modul; // Set this module as the scope's symbol.
46 scop.infoMan = modul.infoMan;
47 visit(modul.root); 45 visit(modul.root);
48 } 46 }
49 47
50 void enterScope(ScopeSymbol s) 48 void enterScope(ScopeSymbol s)
51 { 49 {
100 this.expr = expr; 98 this.expr = expr;
101 this.type = expr.type; 99 this.type = expr.type;
102 return expr; 100 return expr;
103 +/ 101 +/
104 return md; 102 return md;
103 }
104
105 T visit(ArrayType t)
106 {
107 return t;
105 } 108 }
106 109
107 T visit(PointerType t) 110 T visit(PointerType t)
108 { 111 {
109 t.type = visitT(t.next).type.ptrTo(); 112 t.type = visitT(t.next).type.ptrTo();
259 error(me.begin, MSG.MixinArgumentMustBeString); 262 error(me.begin, MSG.MixinArgumentMustBeString);
260 else 263 else
261 { 264 {
262 auto loc = me.begin.getErrorLocation(); 265 auto loc = me.begin.getErrorLocation();
263 auto filePath = loc.filePath; 266 auto filePath = loc.filePath;
264 auto parser = new Parser(stringExpr.getString(), filePath, scop.infoMan); 267 auto parser = new Parser(stringExpr.getString(), filePath, modul.infoMan);
265 expr = parser.start2(); 268 expr = parser.start2();
266 expr = visitE(expr); // Check expression. 269 expr = visitE(expr); // Check expression.
267 } 270 }
268 me.expr = expr; 271 me.expr = expr;
269 me.type = expr.type; 272 me.type = expr.type;