changeset 763:f26f13b5a3a3

Fixed code in scanSpecialTokenSequence().
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Sat, 16 Feb 2008 01:47:39 +0100
parents c909a3d3fa52
children 4579e8505d5e
files trunk/src/cmd/Generate.d trunk/src/dil/lexer/Lexer.d
diffstat 2 files changed, 6 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/trunk/src/cmd/Generate.d	Sat Feb 16 00:52:43 2008 +0100
+++ b/trunk/src/cmd/Generate.d	Sat Feb 16 01:47:39 2008 +0100
@@ -410,20 +410,14 @@
     }
 
     // Print whitespace between #line and number.
-    auto ptr = token.start;
-    printWS(ptr, num.start); // Prints "#line" as well.
-    printToken(num, tags, print2);
+    printWS(token.start, num.start); // Prints "#line" as well.
+    printToken(num, tags, print2); // Print the number.
 
     if (auto filespec = token.tokLineFilespec)
     { // Print whitespace between number and filespec.
       printWS(num.end, filespec.start);
       print2.format(tags.Filespec, xml_escape(filespec.srcText));
-      ptr = filespec.end;
     }
-    else
-      ptr = num.end;
-    // Print remaining whitespace
-    printWS(ptr, token.end);
     // Finally print the whole token.
     print.format(formatStr, cast(char[])buffer.slice());
     break;
--- a/trunk/src/dil/lexer/Lexer.d	Sat Feb 16 00:52:43 2008 +0100
+++ b/trunk/src/dil/lexer/Lexer.d	Sat Feb 16 01:47:39 2008 +0100
@@ -2273,14 +2273,15 @@
 
     MID mid;
     char* errorAtColumn = p;
+    char* tokenEnd = ++p;
 
-    ++p;
     if (!(p[0] == 'l' && p[1] == 'i' && p[2] == 'n' && p[3] == 'e'))
     {
       mid = MID.ExpectedIdentifierSTLine;
       goto Lerr;
     }
     p += 3;
+    tokenEnd = p + 1;
 
     // TODO: #line58"path/file" is legal. Require spaces?
     //       State.Space could be used for that purpose.
@@ -2288,7 +2289,7 @@
     { /+Space,+/ Integer, Filespec, End }
 
     State state = State.Integer;
-    char* tokenEnd = p + 1;
+
     while (!isEndOfLine(++p))
     {
       if (isspace(*p))
@@ -2314,7 +2315,7 @@
         state = State.Filespec;
       }
       else if (state == State.Filespec && *p == '"')
-      { // MID.ExpectedFilespec is eprecated.
+      { // MID.ExpectedFilespec is deprecated.
         // if (*p != '"')
         // {
         //   errorAtColumn = p;