2
0
Эх сурвалжийг харах

* Issue file change before line and column change in token writes to allow for better display in ppudump utility

git-svn-id: trunk@42601 -
pierre 6 жил өмнө
parent
commit
70b2904c48
1 өөрчлөгдсөн 10 нэмэгдсэн , 8 устгасан
  1. 10 8
      compiler/scanner.pas

+ 10 - 8
compiler/scanner.pas

@@ -3229,6 +3229,15 @@ type
           end;
 
         { file pos changes? }
+        if current_tokenpos.fileindex<>last_filepos.fileindex then
+          begin
+            s:=ST_FILEINDEX;
+            writetoken(t);
+            recordtokenbuf.write(s,1);
+            tokenwriteword(current_tokenpos.fileindex);
+            last_filepos.fileindex:=current_tokenpos.fileindex;
+            last_filepos.line:=0;
+          end;
         if current_tokenpos.line<>last_filepos.line then
           begin
             s:=ST_LINE;
@@ -3236,6 +3245,7 @@ type
             recordtokenbuf.write(s,1);
             tokenwritelongint(current_tokenpos.line);
             last_filepos.line:=current_tokenpos.line;
+            last_filepos.column:=0;
           end;
         if current_tokenpos.column<>last_filepos.column then
           begin
@@ -3254,14 +3264,6 @@ type
               end;
             last_filepos.column:=current_tokenpos.column;
           end;
-        if current_tokenpos.fileindex<>last_filepos.fileindex then
-          begin
-            s:=ST_FILEINDEX;
-            writetoken(t);
-            recordtokenbuf.write(s,1);
-            tokenwriteword(current_tokenpos.fileindex);
-            last_filepos.fileindex:=current_tokenpos.fileindex;
-          end;
 
         writetoken(token);
         if token<>_GENERICSPECIALTOKEN then