Mercurial > projects > dil
comparison trunk/src/dil/semantic/Pass2.d @ 755:90668b83ae5e
Introduced new module dil.SourceText and class SourceText.
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Wed, 13 Feb 2008 20:21:25 +0100 |
parents | 4f971f6382c7 |
children | c24be8d4f6ab |
comparison
equal
deleted
inserted
replaced
754:c7a5499faa77 | 755:90668b83ae5e |
---|---|
18 dil.semantic.Scope, | 18 dil.semantic.Scope, |
19 dil.semantic.Module, | 19 dil.semantic.Module, |
20 dil.semantic.Analysis, | 20 dil.semantic.Analysis, |
21 dil.semantic.Interpreter; | 21 dil.semantic.Interpreter; |
22 import dil.parser.Parser; | 22 import dil.parser.Parser; |
23 import dil.SourceText; | |
23 import dil.Location; | 24 import dil.Location; |
24 import dil.Information; | 25 import dil.Information; |
25 import dil.Messages; | 26 import dil.Messages; |
26 import dil.Enums; | 27 import dil.Enums; |
27 import dil.CompilerInfo; | 28 import dil.CompilerInfo; |
137 } | 138 } |
138 else | 139 else |
139 { // Parse the declarations in the string. | 140 { // Parse the declarations in the string. |
140 auto loc = md.begin.getErrorLocation(); | 141 auto loc = md.begin.getErrorLocation(); |
141 auto filePath = loc.filePath; | 142 auto filePath = loc.filePath; |
142 auto parser = new Parser(stringExpr.getString(), filePath, modul.infoMan); | 143 auto sourceText = new SourceText(filePath, stringExpr.getString()); |
144 auto parser = new Parser(sourceText, modul.infoMan); | |
143 md.decls = parser.start(); | 145 md.decls = parser.start(); |
144 } | 146 } |
145 } | 147 } |
146 else | 148 else |
147 { | 149 { |
318 error(me.begin, MSG.MixinArgumentMustBeString); | 320 error(me.begin, MSG.MixinArgumentMustBeString); |
319 else | 321 else |
320 { | 322 { |
321 auto loc = me.begin.getErrorLocation(); | 323 auto loc = me.begin.getErrorLocation(); |
322 auto filePath = loc.filePath; | 324 auto filePath = loc.filePath; |
323 auto parser = new Parser(stringExpr.getString(), filePath, modul.infoMan); | 325 auto sourceText = new SourceText(filePath, stringExpr.getString()); |
326 auto parser = new Parser(sourceText, modul.infoMan); | |
324 expr = parser.start2(); | 327 expr = parser.start2(); |
325 expr = visitE(expr); // Check expression. | 328 expr = visitE(expr); // Check expression. |
326 } | 329 } |
327 me.expr = expr; | 330 me.expr = expr; |
328 me.type = expr.type; | 331 me.type = expr.type; |