diff lexer/Lexer.d @ 186:e1e170c2cd44

Fixed a error in the test program.
author Anders Johnsen <skabet@gmail.com>
date Fri, 25 Jul 2008 12:50:09 +0200
parents dc9bf56b7ace
children 75d0544ddc45
line wrap: on
line diff
--- a/lexer/Lexer.d	Fri Jul 25 12:18:05 2008 +0200
+++ b/lexer/Lexer.d	Fri Jul 25 12:50:09 2008 +0200
@@ -227,6 +227,7 @@
     }
     Token slash()
     {
+        int p = position;
         switch(source[position])
         {
             case '=':
@@ -250,7 +251,7 @@
                             return this.next;
                         }
                 }
-                messages.report(UnexpectedEOFBlock,Loc(position)).fatal(ExitLevel.Lexer);
+                messages.report(UnexpectedEOFBlock,Loc(p)).fatal(ExitLevel.Lexer);
 
             case '+':
                 position += 2;
@@ -277,7 +278,7 @@
                 }
                 messages.report(
                         UnexpectedEOFBlock,
-                        Loc(position)).fatal(ExitLevel.Lexer);
+                        Loc(p)).fatal(ExitLevel.Lexer);
 
             default:
                 return Token(Tok.Slash, Loc(position - 1), 1);