changeset 190:85e492318bb6

Can parse empty file again.
author Anders Johnsen <skabet@gmail.com>
date Fri, 25 Jul 2008 13:59:21 +0200
parents 75d0544ddc45
children e799db8d9cb0
files lexer/Lexer.d parser/Parser.d
diffstat 2 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lexer/Lexer.d	Fri Jul 25 13:50:01 2008 +0200
+++ b/lexer/Lexer.d	Fri Jul 25 13:59:21 2008 +0200
@@ -70,6 +70,8 @@
         symbolFunctions['&'] = &and;
         symbolFunctions['"'] = &string;
         symbolFunctions['`'] = &string;
+
+        last = Token(Tok.EOF, SLoc() + 1, 0);
     }
 
     /**
--- a/parser/Parser.d	Fri Jul 25 13:50:01 2008 +0200
+++ b/parser/Parser.d	Fri Jul 25 13:59:21 2008 +0200
@@ -35,7 +35,7 @@
         this.action = act;
 
         Module m;
-        if ( isa(Tok.Module) )
+        if (peek.type == Tok.Module)
         {
             Token _module = next();
             ModuleName name = parseModuleName();