Mercurial > projects > dil
diff trunk/src/dil/Lexer.d @ 520:f203c5248d0b
Added 'compile' command.
Fixes in config.d: changed 'auto' to 'var'; fixed format argument indices.
dil.Lexer and dil.Parser add their errors to infoMan.
Fix in enum TOK: Cent belongs to sublist of integral types.
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Sat, 15 Dec 2007 22:25:18 +0100 |
parents | 9ebc799c7dc5 |
children | 50e64bab9c7a |
line wrap: on
line diff
--- a/trunk/src/dil/Lexer.d Sat Dec 15 19:00:23 2007 +0100 +++ b/trunk/src/dil/Lexer.d Sat Dec 15 22:25:18 2007 +0100 @@ -35,6 +35,7 @@ char* end; /// Points one character past the end of the source text. // Members used for error messages: + InformationManager infoMan; LexerError[] errors; /// Always points to the beginning of the current line. char* lineBegin; @@ -50,9 +51,10 @@ text = the UTF-8 source code. filePath = the path to the source code; used for error messages. +/ - this(string text, string filePath) + this(string text, string filePath, InformationManager infoMan = null) { this.filePath = this.errorPath = filePath; + this.infoMan = infoMan; this.text = text; if (text.length == 0 || text[$-1] != 0) @@ -2385,7 +2387,10 @@ lineNum = this.errorLineNumber(lineNum); auto location = new Location(errorPath, lineNum, lineBegin, columnPos); auto msg = Format(_arguments, _argptr, GetMsg(mid)); - errors ~= new LexerError(location, msg); + auto error = new LexerError(location, msg); + errors ~= error; + if (infoMan !is null) + infoMan ~= error; } Token* getTokens()