Mercurial > projects > dil
diff trunk/src/dil/Parser.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 | 39b497c76e2b |
line wrap: on
line diff
--- a/trunk/src/dil/Parser.d Sat Dec 15 19:00:23 2007 +0100 +++ b/trunk/src/dil/Parser.d Sat Dec 15 22:25:18 2007 +0100 @@ -27,6 +27,7 @@ Token* token; /// Current non-whitespace token. Token* prevToken; /// Previous non-whitespace token. + InformationManager infoMan; ParserError[] errors; ImportDeclaration[] imports; /// ImportDeclarations in the source text. @@ -47,7 +48,8 @@ +/ this(char[] srcText, string filePath, InformationManager infoMan = null) { - lx = new Lexer(srcText, filePath); + this.infoMan = infoMan; + lx = new Lexer(srcText, filePath, infoMan); } protected void init() @@ -4437,7 +4439,10 @@ } auto location = token.getLocation(); auto msg = Format(_arguments, _argptr, formatMsg); - errors ~= new ParserError(location, msg); + auto error = new ParserError(location, msg); + errors ~= error; + if (infoMan !is null) + infoMan ~= error; } /// Collection of error messages with no MID yet.