summary refs log tree commit diff stats
path: root/nim/paslex.pas
diff options
context:
space:
mode:
Diffstat (limited to 'nim/paslex.pas')
-rw-r--r--nim/paslex.pas10
1 files changed, 8 insertions, 2 deletions
diff --git a/nim/paslex.pas b/nim/paslex.pas
index da9283163..f3d8daaeb 100644
--- a/nim/paslex.pas
+++ b/nim/paslex.pas
@@ -1,7 +1,7 @@
 //
 //
 //           The Nimrod Compiler
-//        (c) Copyright 2008 Andreas Rumpf
+//        (c) Copyright 2009 Andreas Rumpf
 //
 //    See the file "copying.txt", included in this
 //    distribution, for details about the copyright.
@@ -529,6 +529,7 @@ begin
       addChar(tok.literal, buf[pos]); inc(pos);
     end;
     pos := handleCRLF(L, pos);
+    buf := L.buf;
     indent := 0;
     while buf[pos] = ' ' do begin inc(pos); inc(indent) end;
     if (col = indent) and (buf[pos] = '/') and (buf[pos+1] = '/') then
@@ -552,6 +553,7 @@ begin
     case buf[pos] of
       CR, LF: begin
         pos := HandleCRLF(L, pos);
+        buf := L.buf;
         tok.literal := tok.literal +{&} nl + '#';
       end;
       '}': begin inc(pos); break end;
@@ -578,6 +580,7 @@ begin
     case buf[pos] of
       CR, LF: begin
         pos := HandleCRLF(L, pos);
+        buf := L.buf;
         tok.literal := tok.literal +{&} nl + '#';
       end;
       '*': begin
@@ -606,7 +609,10 @@ begin
     case buf[pos] of
       ' ', Tabulator: Inc(pos);
       // newline is special:
-      CR, LF: pos := HandleCRLF(L, pos);
+      CR, LF: begin
+        pos := HandleCRLF(L, pos);
+        buf := L.buf;
+      end
       else break // EndOfFile also leaves the loop
     end
   until false;