Browse Source

* fixed most remaining "deprecated" problems for procedure/methods and class blocks
(mantis 16342), only CONST x= 1 deprecated; remaining from this bugreport.

git-svn-id: trunk@15705 -

marco 15 years ago
parent
commit
348301c511
1 changed files with 14 additions and 6 deletions
  1. 14 6
      packages/fcl-passrc/src/pparser.pp

+ 14 - 6
packages/fcl-passrc/src/pparser.pp

@@ -1183,7 +1183,7 @@ begin
       Engine.Package.Modules.Add(Module);
       Engine.Package.Modules.Add(Module);
     end;
     end;
     CheckHint(Module,True);
     CheckHint(Module,True);
-    ExpectToken(tkSemicolon);
+//    ExpectToken(tkSemicolon);
     ExpectToken(tkInterface);
     ExpectToken(tkInterface);
     ParseInterface;
     ParseInterface;
   finally
   finally
@@ -2060,6 +2060,15 @@ end;
 // will get the token after the final ";" as next token.
 // will get the token after the final ";" as next token.
 procedure TPasParser.ParseProcedureOrFunctionHeader(Parent: TPasElement;
 procedure TPasParser.ParseProcedureOrFunctionHeader(Parent: TPasElement;
   Element: TPasProcedureType; ProcType: TProcType; OfObjectPossible: Boolean);
   Element: TPasProcedureType; ProcType: TProcType; OfObjectPossible: Boolean);
+
+procedure ConsumeSemi;
+var bl : TPasMemberHint;
+begin
+  NextToken;
+  if (CurToken <> tksemicolon) and ishint(curtokenstring,bl) then
+    ungettoken;
+end;
+
 Var
 Var
   Tok : String;
   Tok : String;
   i: Integer;
   i: Integer;
@@ -2143,12 +2152,11 @@ begin
     UngetToken;
     UngetToken;
 
 
   ExpectToken(tkSemicolon);
   ExpectToken(tkSemicolon);
-
   while True do
   while True do
     begin
     begin
     // CheckHint(Element,False);
     // CheckHint(Element,False);
     NextToken;
     NextToken;
-    if (CurToken = tkIdentifier) then
+    if (CurToken = tkIdentifier) or (CurToken=tklibrary) then // library is a token and a directive.
       begin
       begin
       Tok:=UpperCase(CurTokenString);
       Tok:=UpperCase(CurTokenString);
       If (Tok='CDECL') then
       If (Tok='CDECL') then
@@ -2218,17 +2226,17 @@ begin
       else if (tok='DEPRECATED') then
       else if (tok='DEPRECATED') then
         begin
         begin
         element.hints:=element.hints+[hDeprecated];
         element.hints:=element.hints+[hDeprecated];
-        ExpectToken(tkSemicolon);
+        consumesemi;
         end
         end
       else if (tok='PLATFORM') then
       else if (tok='PLATFORM') then
         begin
         begin
         element.hints:=element.hints+[hPlatform];
         element.hints:=element.hints+[hPlatform];
-        ExpectToken(tkSemicolon);
+        consumesemi;
         end
         end
       else if (tok='LIBRARY') then
       else if (tok='LIBRARY') then
         begin
         begin
         element.hints:=element.hints+[hLibrary];
         element.hints:=element.hints+[hLibrary];
-        ExpectToken(tkSemicolon);
+        consumesemi;
         end
         end
       else if (tok='OVERLOAD') then
       else if (tok='OVERLOAD') then
         begin
         begin