diff trunk/src/dil/LexerFuncs.d @ 496:5a607597dc22

Improved error recovery in the Parser. The Parser skips to the next valid token if an illegal Declaration, Statement or AsmInstruction was found. Refactored a few things in Lexer.d and LexerFuncs.d.
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Sun, 09 Dec 2007 13:04:15 +0100
parents 9a7ca8c56e59
children 2a8d0ed0d71e
line wrap: on
line diff
--- a/trunk/src/dil/LexerFuncs.d	Sat Dec 08 22:20:34 2007 +0100
+++ b/trunk/src/dil/LexerFuncs.d	Sun Dec 09 13:04:15 2007 +0100
@@ -34,12 +34,21 @@
 }
 
 /++
+  Returns true if p points to an EOF character.
+  EOF: 0 | _Z_
++/
+bool isEOF(dchar c)
+{
+  return c == 0 || c == _Z_;
+}
+
+/++
   Returns true if p points to the first character of an EndOfLine.
-  EndOfLine: Newline | 0 | _Z_
+  EndOfLine: Newline | EOF
 +/
 bool isEndOfLine(char* p)
 {
-  return isNewline(p) || *p == 0 || *p == _Z_;
+  return isNewline(p) || isEOF(*p);
 }
 
 /++