ソースを参照

* patch by Sven Barth, handle idtoken correctly in the token recorder, resolves #19277

git-svn-id: trunk@17506 -
florian 14 年 前
コミット
41c18adaf4
4 ファイル変更19 行追加3 行削除
  1. 1 0
      .gitattributes
  2. 1 1
      compiler/ppu.pas
  3. 2 2
      compiler/scanner.pas
  4. 15 0
      tests/webtbs/tw19277.pp

+ 1 - 0
.gitattributes

@@ -11496,6 +11496,7 @@ tests/webtbs/tw1917.pp svneol=native#text/plain
 tests/webtbs/tw1920.pp svneol=native#text/plain
 tests/webtbs/tw19201.pp svneol=native#text/pascal
 tests/webtbs/tw1923.pp svneol=native#text/plain
+tests/webtbs/tw19277.pp svneol=native#text/pascal
 tests/webtbs/tw1930.pp svneol=native#text/plain
 tests/webtbs/tw1931.pp svneol=native#text/plain
 tests/webtbs/tw1932.pp svneol=native#text/plain

+ 1 - 1
compiler/ppu.pas

@@ -43,7 +43,7 @@ type
 {$endif Test_Double_checksum}
 
 const
-  CurrentPPUVersion = 128;
+  CurrentPPUVersion = 129;
 
 { buffer sizes }
   maxentrysize = 1024;

+ 2 - 2
compiler/scanner.pas

@@ -2104,7 +2104,7 @@ In case not, the value returned can be arbitrary.
           end;
 
         recordtokenbuf.write(token,SizeOf(token));
-        if token=_ID then
+        if token<>_GENERICSPECIALTOKEN then
           recordtokenbuf.write(idtoken,SizeOf(idtoken));
         case token of
           _CWCHAR,
@@ -2185,7 +2185,7 @@ In case not, the value returned can be arbitrary.
         repeat
           { load token from the buffer }
           replaytokenbuf.read(token,SizeOf(token));
-          if token=_ID then
+          if token<>_GENERICSPECIALTOKEN then
             replaytokenbuf.read(idtoken,SizeOf(idtoken))
           else
             idtoken:=_NOID;

+ 15 - 0
tests/webtbs/tw19277.pp

@@ -0,0 +1,15 @@
+program TNP;
+{$mode objfpc}{$H+}
+{$modeswitch nestedprocvars}
+type
+  generic GenericA<T>=class
+   private
+    type
+      TIteratorfunction = procedure (const x:T) is nested;
+      // Fatal: Syntax error, ";" expected but "is" found
+   var private
+  end;
+  TSpec=specialize GenericA<integer>;
+
+begin
+end.