Browse Source

* Last field before end does not need a semicolon

git-svn-id: trunk@47496 -
michael 4 years ago
parent
commit
185048c631
2 changed files with 2 additions and 1 deletions
  1. 2 0
      packages/fcl-passrc/src/pparser.pp
  2. 0 1
      packages/fcl-passrc/tests/tcclasstype.pas

+ 2 - 0
packages/fcl-passrc/src/pparser.pp

@@ -7308,6 +7308,8 @@ begin
           if not (AType.ObjKind in okWithFields) then
           if not (AType.ObjKind in okWithFields) then
             ParseExc(nParserNoFieldsAllowed,SParserNoFieldsAllowedInX,[ObjKindNames[AType.ObjKind]]);
             ParseExc(nParserNoFieldsAllowed,SParserNoFieldsAllowedInX,[ObjKindNames[AType.ObjKind]]);
           ParseClassFields(AType,CurVisibility,CurSection=stClassVar);
           ParseClassFields(AType,CurVisibility,CurSection=stClassVar);
+          if Curtoken=tkEnd then // case Ta = Class x : String end;
+            UngetToken;
           HaveClass:=False;
           HaveClass:=False;
           end;
           end;
         stClassVar:
         stClassVar:

+ 0 - 1
packages/fcl-passrc/tests/tcclasstype.pas

@@ -981,7 +981,6 @@ end;
 procedure TTestClassType.TestNoSemicolon;
 procedure TTestClassType.TestNoSemicolon;
 begin
 begin
   StartClass;
   StartClass;
-  fDecl.Add('X : Integer;');
   fDecl.Add('Y : String');
   fDecl.Add('Y : String');
   ParseClass;
   ParseClass;
 end;
 end;