瀏覽代碼

* Last field before end does not need a semicolon

git-svn-id: trunk@47496 -
michael 4 年之前
父節點
當前提交
185048c631
共有 2 個文件被更改,包括 2 次插入1 次删除
  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
             ParseExc(nParserNoFieldsAllowed,SParserNoFieldsAllowedInX,[ObjKindNames[AType.ObjKind]]);
           ParseClassFields(AType,CurVisibility,CurSection=stClassVar);
+          if Curtoken=tkEnd then // case Ta = Class x : String end;
+            UngetToken;
           HaveClass:=False;
           end;
         stClassVar:

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

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