Browse Source

fcl-passrc: parser: clean up

git-svn-id: trunk@36126 -
Mattias Gaertner 8 years ago
parent
commit
76734070c4
1 changed files with 7 additions and 7 deletions
  1. 7 7
      packages/fcl-passrc/src/pparser.pp

+ 7 - 7
packages/fcl-passrc/src/pparser.pp

@@ -1184,7 +1184,7 @@ begin
       K:=stkAlias
     else if (CurToken=tkSquaredBraceOpen) then
       begin
-      if LowerCase(Name)='string' then // Type A = String[12];
+      if LowerCase(Name)='string' then // Type A = String[12]; shortstring
         K:=stkString
       else
         ParseExcSyntaxError;
@@ -3798,18 +3798,17 @@ procedure TPasParser.ParseProcedureOrFunctionHeader(Parent: TPasElement;
     CT : TPasClassType;
 
   begin
-    // ToDo: add an event for the resolver to use a faster lookup
     I:=ASection.Functions.Count-1;
     While (I>=0) and (CompareText(TPasElement(ASection.Functions[I]).Name,AName)<>0) do
       Dec(I);
     Result:=I<>-1;
     I:=Pos('.',AName);
-    if (Not Result) and (I<>0) then
+    if (Not Result) and (I>0) then
       begin
       CN:=Copy(AName,1,I-1);
-      FN:=Aname;
+      FN:=AName;
       Delete(FN,1,I);
-      I:=Asection.Classes.Count-1;
+      I:=ASection.Classes.Count-1;
       While Not Result and (I>=0) do
         begin
         CT:=TPasClassType(ASection.Classes[i]);
@@ -3819,6 +3818,7 @@ procedure TPasParser.ParseProcedureOrFunctionHeader(Parent: TPasElement;
         end;
       end;
   end;
+
   procedure ConsumeSemi;
   begin
     NextToken;
@@ -3826,7 +3826,6 @@ procedure TPasParser.ParseProcedureOrFunctionHeader(Parent: TPasElement;
       UngetToken;
   end;
 
-
 Var
   Tok : String;
   CC : TCallingConvention;
@@ -3852,7 +3851,8 @@ begin
         ResultEl:=TPasFunctionType(Element).ResultEl;
         ResultEl.ResultType := ParseType(ResultEl,Scanner.CurSourcePos);
         end
-      // In Delphi mode, the implementation in the implementation section can be without result as it was declared
+      // In Delphi mode, the implementation in the implementation section can be
+      // without result as it was declared
       // We actually check if the function exists in the interface section.
       else if (msDelphi in CurrentModeswitches) and
               (Assigned(CurModule.ImplementationSection) or