Browse Source

* updated ppudump for latest ppu format changes

git-svn-id: trunk@17509 -
florian 14 years ago
parent
commit
e29d8df95c
1 changed files with 24 additions and 5 deletions
  1. 24 5
      compiler/utils/ppudump.pp

+ 24 - 5
compiler/utils/ppudump.pp

@@ -965,10 +965,28 @@ var
   first  : boolean;
   tokenbufsize : longint;
   tokenbuf : pbyte;
+  idtoken,
   token : ttoken;
   len : sizeint;
   wstring : widestring;
   astring : ansistring;
+
+  function readtoken: ttoken;
+    var
+      b,b2 : byte;
+    begin
+      b:=tokenbuf[i];
+      inc(i);
+      if (b and $80)<>0 then
+        begin
+          b2:=tokenbuf[i];
+          inc(i);
+          result:=ttoken(((b and $7f) shl 8) or b2);
+        end
+      else
+        result:=ttoken(b);
+    end;
+
 begin
   writeln(space,'** Definition Id ',ppufile.getlongint,' **');
   writeln(space,s);
@@ -996,7 +1014,7 @@ begin
   if defstates<>[] then
     begin
       first:=true;
-      for i:=1to high(defstate) do
+      for i:=1 to high(defstate) do
        if (defstate[i].mask in defstates) then
         begin
           if first then
@@ -1018,10 +1036,12 @@ begin
       write(space,' Tokens: ');
       while i<tokenbufsize do
         begin
-          token:=ptoken(@tokenbuf[i])^;
+          token:=readtoken;
           if token<>_GENERICSPECIALTOKEN then
-            write(arraytokeninfo[token].str);
-          inc(i,SizeOf(token));
+            begin
+              write(arraytokeninfo[token].str);
+              idtoken:=readtoken;
+            end;
           case token of
             _CWCHAR,
             _CWSTRING :
@@ -1051,7 +1071,6 @@ begin
               end;
             _ID :
               begin
-                inc(i,SizeOf(ttoken)); // idtoken
                 write(' ',pshortstring(@tokenbuf[i])^);
                 inc(i,tokenbuf[i]+1);
               {