Mercurial > projects > dil
comparison trunk/src/dil/Lexer.d @ 514:6ddff941862a
Added new error classes.
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Fri, 14 Dec 2007 19:32:07 +0100 |
parents | dd3ce87b3569 |
children | 9ebc799c7dc5 |
comparison
equal
deleted
inserted
replaced
513:6160ab7b1816 | 514:6ddff941862a |
---|---|
33 char[] filePath; /// Path to the source text. | 33 char[] filePath; /// Path to the source text. |
34 char* p; /// Points to the current character in the source text. | 34 char* p; /// Points to the current character in the source text. |
35 char* end; /// Points one character past the end of the source text. | 35 char* end; /// Points one character past the end of the source text. |
36 | 36 |
37 // Members used for error messages: | 37 // Members used for error messages: |
38 Information[] errors; | 38 LexerError[] errors; |
39 /// Always points to the beginning of the current line. | 39 /// Always points to the beginning of the current line. |
40 char* lineBegin; | 40 char* lineBegin; |
41 // Token* newline; /// Current newline token. | 41 // Token* newline; /// Current newline token. |
42 uint lineNum = 1; /// Current, actual source text line number. | 42 uint lineNum = 1; /// Current, actual source text line number. |
43 uint lineNum_hline; /// Line number set by #line. | 43 uint lineNum_hline; /// Line number set by #line. |
2383 TypeInfo[] _arguments, void* _argptr) | 2383 TypeInfo[] _arguments, void* _argptr) |
2384 { | 2384 { |
2385 lineNum = this.errorLineNumber(lineNum); | 2385 lineNum = this.errorLineNumber(lineNum); |
2386 auto location = new Location(errorPath, lineNum, lineBegin, columnPos); | 2386 auto location = new Location(errorPath, lineNum, lineBegin, columnPos); |
2387 auto msg = Format(_arguments, _argptr, GetMsg(mid)); | 2387 auto msg = Format(_arguments, _argptr, GetMsg(mid)); |
2388 errors ~= new Information(InfoType.Lexer, mid, location, msg); | 2388 errors ~= new LexerError(location, msg); |
2389 } | 2389 } |
2390 | 2390 |
2391 Token* getTokens() | 2391 Token* getTokens() |
2392 { | 2392 { |
2393 while (nextToken() != TOK.EOF) | 2393 while (nextToken() != TOK.EOF) |