Преглед изворни кода

* Initial support for inline comment documentation

git-svn-id: trunk@29615 -
michael пре 10 година
родитељ
комит
c754846815

+ 4 - 2
packages/fcl-passrc/src/pastree.pp

@@ -105,6 +105,7 @@ type
   TPasElement = class(TPasElementBase)
   TPasElement = class(TPasElementBase)
   private
   private
     FData: TObject;
     FData: TObject;
+    FDocComment: String;
     FRefCount: LongWord;
     FRefCount: LongWord;
     FName: string;
     FName: string;
     FParent: TPasElement;
     FParent: TPasElement;
@@ -133,6 +134,7 @@ type
     Property Hints : TPasMemberHints Read FHints Write FHints;
     Property Hints : TPasMemberHints Read FHints Write FHints;
     Property CustomData : TObject Read FData Write FData;
     Property CustomData : TObject Read FData Write FData;
     Property HintMessage : String Read FHintMessage Write FHintMessage;
     Property HintMessage : String Read FHintMessage Write FHintMessage;
+    Property DocComment : String Read FDocComment Write FDocComment;
   end;
   end;
 
 
   TPasExprKind = (pekIdent, pekNumber, pekString, pekSet, pekNil, pekBoolConst, pekRange,
   TPasExprKind = (pekIdent, pekNumber, pekString, pekSet, pekNil, pekBoolConst, pekRange,
@@ -1306,7 +1308,7 @@ end;
 
 
 function TPasElement.ElementTypeName: string; begin Result := SPasTreeElement end;
 function TPasElement.ElementTypeName: string; begin Result := SPasTreeElement end;
 
 
-function TPasElement.HintsString: String;
+Function TPasElement.HintsString: String;
 
 
 Var
 Var
   H : TPasmemberHint;
   H : TPasmemberHint;
@@ -1567,7 +1569,7 @@ begin
   end;
   end;
 end;
 end;
 
 
-function TPasElement.GetDeclaration (full : boolean): string;
+function TPasElement.GetDeclaration(full: Boolean): string;
 
 
 begin
 begin
   if Full then
   if Full then

+ 131 - 28
packages/fcl-passrc/src/pparser.pp

@@ -68,11 +68,14 @@ type
   TPasParserLogHandler = Procedure (Sender : TObject; Const Msg : String) of object;
   TPasParserLogHandler = Procedure (Sender : TObject; Const Msg : String) of object;
   TPParserLogEvent = (pleInterface,pleImplementation);
   TPParserLogEvent = (pleInterface,pleImplementation);
   TPParserLogEvents = set of TPParserLogEvent;
   TPParserLogEvents = set of TPParserLogEvent;
+  TPasParser = Class;
 
 
   { TPasTreeContainer }
   { TPasTreeContainer }
 
 
   TPasTreeContainer = class
   TPasTreeContainer = class
   private
   private
+    FCurrentParser: TPasParser;
+    FNeedComments: Boolean;
     FOnLog: TPasParserLogHandler;
     FOnLog: TPasParserLogHandler;
     FPParserLogEvents: TPParserLogEvents;
     FPParserLogEvents: TPParserLogEvents;
     FScannerLogEvents: TPScannerLogEvents;
     FScannerLogEvents: TPScannerLogEvents;
@@ -97,6 +100,8 @@ type
     Property ScannerLogEvents : TPScannerLogEvents Read FScannerLogEvents Write FScannerLogEvents;
     Property ScannerLogEvents : TPScannerLogEvents Read FScannerLogEvents Write FScannerLogEvents;
     Property ParserLogEvents : TPParserLogEvents Read FPParserLogEvents Write FPParserLogEvents;
     Property ParserLogEvents : TPParserLogEvents Read FPParserLogEvents Write FPParserLogEvents;
     Property OnLog : TPasParserLogHandler Read FOnLog Write FOnLog;
     Property OnLog : TPasParserLogHandler Read FOnLog Write FOnLog;
+    Property CurrentParser : TPasParser Read FCurrentParser;
+    Property NeedComments : Boolean Read FNeedComments Write FNeedComments;
   end;
   end;
 
 
   EParserError = class(Exception)
   EParserError = class(Exception)
@@ -131,9 +136,12 @@ type
     FEngine: TPasTreeContainer;
     FEngine: TPasTreeContainer;
     FCurToken: TToken;
     FCurToken: TToken;
     FCurTokenString: String;
     FCurTokenString: String;
+    FCurComments : TStrings;
+    FSavedComments : String;
     // UngetToken support:
     // UngetToken support:
     FTokenBuffer: array[0..1] of TToken;
     FTokenBuffer: array[0..1] of TToken;
     FTokenStringBuffer: array[0..1] of String;
     FTokenStringBuffer: array[0..1] of String;
+    FCommentsBuffer: array[0..1] of TStrings;
     FTokenBufferIndex: Integer; // current index in FTokenBuffer
     FTokenBufferIndex: Integer; // current index in FTokenBuffer
     FTokenBufferSize: Integer; // maximum valid index in FTokenBuffer
     FTokenBufferSize: Integer; // maximum valid index in FTokenBuffer
     FDumpIndent : String;
     FDumpIndent : String;
@@ -146,6 +154,8 @@ type
     procedure ParseClassLocalTypes(AType: TPasClassType; AVisibility: TPasMemberVisibility);
     procedure ParseClassLocalTypes(AType: TPasClassType; AVisibility: TPasMemberVisibility);
     procedure ParseVarList(Parent: TPasElement; VarList: TFPList; AVisibility: TPasMemberVisibility; Full: Boolean);
     procedure ParseVarList(Parent: TPasElement; VarList: TFPList; AVisibility: TPasMemberVisibility; Full: Boolean);
   protected
   protected
+    Function SaveComments : String;
+    Function SaveComments(Const AValue : String) : String;
     function LogEvent(E : TPParserLogEvent) : Boolean; inline;
     function LogEvent(E : TPParserLogEvent) : Boolean; inline;
     Procedure DoLog(Const Msg : String; SkipSourceInfo : Boolean = False);overload;
     Procedure DoLog(Const Msg : String; SkipSourceInfo : Boolean = False);overload;
     Procedure DoLog(Const Fmt : String; Args : Array of const;SkipSourceInfo : Boolean = False);overload;
     Procedure DoLog(Const Fmt : String; Args : Array of const;SkipSourceInfo : Boolean = False);overload;
@@ -182,9 +192,12 @@ type
     function  CheckIfOverloaded(AParent: TPasElement; const AName: String): TPasElement;
     function  CheckIfOverloaded(AParent: TPasElement; const AName: String): TPasElement;
   public
   public
     constructor Create(AScanner: TPascalScanner; AFileResolver: TBaseFileResolver;  AEngine: TPasTreeContainer);
     constructor Create(AScanner: TPascalScanner; AFileResolver: TBaseFileResolver;  AEngine: TPasTreeContainer);
+    Destructor Destroy; override;
     // General parsing routines
     // General parsing routines
     function CurTokenName: String;
     function CurTokenName: String;
     function CurTokenText: String;
     function CurTokenText: String;
+    Function CurComments : TStrings;
+    Function SavedComments : String;
     procedure NextToken; // read next non whitespace, non space
     procedure NextToken; // read next non whitespace, non space
     procedure UngetToken;
     procedure UngetToken;
     procedure CheckToken(tk: TToken);
     procedure CheckToken(tk: TToken);
@@ -539,6 +552,23 @@ begin
   FScanner := AScanner;
   FScanner := AScanner;
   FFileResolver := AFileResolver;
   FFileResolver := AFileResolver;
   FEngine := AEngine;
   FEngine := AEngine;
+  FCommentsBuffer[0]:=TStringList.Create;
+  FCommentsBuffer[1]:=TStringList.Create;
+  if Assigned(FEngine) then
+    begin
+    FEngine.FCurrentParser:=Self;
+    If FEngine.NeedComments then
+      FScanner.SkipComments:=Not FEngine.NeedComments;
+    end;
+end;
+
+Destructor TPasParser.Destroy;
+begin
+  FreeAndNil(FCommentsBuffer[0]);
+  FreeAndNil(FCommentsBuffer[1]);
+  if Assigned(FEngine) then
+    FEngine.FCurrentParser:=Nil;
+  inherited Destroy;
 end;
 end;
 
 
 function TPasParser.CurTokenName: String;
 function TPasParser.CurTokenName: String;
@@ -559,13 +589,27 @@ begin
   end;
   end;
 end;
 end;
 
 
+Function TPasParser.CurComments: TStrings;
+begin
+  Result:=FCurComments;
+end;
+
+Function TPasParser.SavedComments: String;
+begin
+  Result:=FSavedComments;
+end;
+
 procedure TPasParser.NextToken;
 procedure TPasParser.NextToken;
+
+Var
+  T : TStrings;
 begin
 begin
   if FTokenBufferIndex < FTokenBufferSize then
   if FTokenBufferIndex < FTokenBufferSize then
   begin
   begin
     // Get token from buffer
     // Get token from buffer
     FCurToken := FTokenBuffer[FTokenBufferIndex];
     FCurToken := FTokenBuffer[FTokenBufferIndex];
     FCurTokenString := FTokenStringBuffer[FTokenBufferIndex];
     FCurTokenString := FTokenStringBuffer[FTokenBufferIndex];
+    FCurComments:=FCommentsBuffer[FTokenBufferIndex];
     Inc(FTokenBufferIndex);
     Inc(FTokenBufferIndex);
     //writeln('TPasParser.NextToken From Buf ',CurTokenText,' id=',FTokenBufferIndex);
     //writeln('TPasParser.NextToken From Buf ',CurTokenText,' id=',FTokenBufferIndex);
   end else
   end else
@@ -573,16 +617,22 @@ begin
     { We have to fetch a new token. But first check, wether there is space left
     { We have to fetch a new token. But first check, wether there is space left
       in the token buffer.}
       in the token buffer.}
     if FTokenBufferSize = 2 then
     if FTokenBufferSize = 2 then
-    begin
+      begin
       FTokenBuffer[0] := FTokenBuffer[1];
       FTokenBuffer[0] := FTokenBuffer[1];
       FTokenStringBuffer[0] := FTokenStringBuffer[1];
       FTokenStringBuffer[0] := FTokenStringBuffer[1];
+      T:=FCommentsBuffer[0];
+      FCommentsBuffer[0]:=FCommentsBuffer[1];
+      FCommentsBuffer[1]:=T;
       Dec(FTokenBufferSize);
       Dec(FTokenBufferSize);
       Dec(FTokenBufferIndex);
       Dec(FTokenBufferIndex);
-    end;
+      end;
     // Fetch new token
     // Fetch new token
     try
     try
+      FCommentsBuffer[FTokenBufferSize].Clear;
       repeat
       repeat
         FCurToken := Scanner.FetchToken;
         FCurToken := Scanner.FetchToken;
+        if FCurToken=tkComment then
+          FCommentsBuffer[FTokenBufferSize].Add(Scanner.CurTokenString);
       until not (FCurToken in WhitespaceTokensToIgnore);
       until not (FCurToken in WhitespaceTokensToIgnore);
     except
     except
       on e: EScannerError do
       on e: EScannerError do
@@ -592,9 +642,10 @@ begin
     FCurTokenString := Scanner.CurTokenString;
     FCurTokenString := Scanner.CurTokenString;
     FTokenBuffer[FTokenBufferSize] := FCurToken;
     FTokenBuffer[FTokenBufferSize] := FCurToken;
     FTokenStringBuffer[FTokenBufferSize] := FCurTokenString;
     FTokenStringBuffer[FTokenBufferSize] := FCurTokenString;
+    FCurComments:=FCommentsBuffer[FTokenBufferSize];
     Inc(FTokenBufferSize);
     Inc(FTokenBufferSize);
     Inc(FTokenBufferIndex);
     Inc(FTokenBufferIndex);
-    //writeln('TPasParser.NextToken New ',CurTokenText,' id=',FTokenBufferIndex);
+  //  writeln('TPasParser.NextToken New ',CurTokenText,' id=',FTokenBufferIndex,' comments = ',FCurComments.text);
   end;
   end;
 end;
 end;
 
 
@@ -609,9 +660,11 @@ begin
     begin
     begin
       FCurToken := FTokenBuffer[FTokenBufferIndex-1];
       FCurToken := FTokenBuffer[FTokenBufferIndex-1];
       FCurTokenString := FTokenStringBuffer[FTokenBufferIndex-1];
       FCurTokenString := FTokenStringBuffer[FTokenBufferIndex-1];
+      FCurComments:=FCommentsBuffer[FTokenBufferIndex-1];
     end else begin
     end else begin
       FCurToken := tkWhitespace;
       FCurToken := tkWhitespace;
       FCurTokenString := '';
       FCurTokenString := '';
+      FCurComments.Clear;
     end;
     end;
     //writeln('TPasParser.UngetToken ',CurTokenText,' id=',FTokenBufferIndex);
     //writeln('TPasParser.UngetToken ',CurTokenText,' id=',FTokenBufferIndex);
   end;
   end;
@@ -636,7 +689,7 @@ begin
   Result := CurTokenString;
   Result := CurTokenString;
 end;
 end;
 
 
-function TPasParser.CurTokenIsIdentifier(Const S: String): Boolean;
+Function TPasParser.CurTokenIsIdentifier(Const S: String): Boolean;
 begin
 begin
   Result:=(Curtoken=tkidentifier) and (CompareText(S,CurtokenText)=0);
   Result:=(Curtoken=tkidentifier) and (CompareText(S,CurtokenText)=0);
 end;
 end;
@@ -658,13 +711,14 @@ begin
   Result:=IsCurTokenHint(dummy);
   Result:=IsCurTokenHint(dummy);
 end;
 end;
 
 
-function TPasParser.TokenIsCallingConvention(S: String;
-  out CC: TCallingConvention): Boolean;
+Function TPasParser.TokenIsCallingConvention(S: String; out
+  CC: TCallingConvention): Boolean;
 begin
 begin
   Result:=IsCallingConvention(S,CC);
   Result:=IsCallingConvention(S,CC);
 end;
 end;
 
 
-function TPasParser.TokenIsProcedureModifier(Parent : TPasElement; S: String; out Pm: TProcedureModifier): Boolean;
+Function TPasParser.TokenIsProcedureModifier(Parent: TPasElement; S: String;
+  Out Pm: TProcedureModifier): Boolean;
 begin
 begin
   Result:=IsModifier(S,PM);
   Result:=IsModifier(S,PM);
   if result and (pm in [pmPublic,pmForward]) then
   if result and (pm in [pmPublic,pmForward]) then
@@ -707,7 +761,7 @@ begin
     ExpectToken(tkSemiColon);
     ExpectToken(tkSemiColon);
 end;
 end;
 
 
-Function TPasParser.CheckPackMode :  TPackMode;
+function TPasParser.CheckPackMode: TPackMode;
 
 
 begin
 begin
   NextToken;
   NextToken;
@@ -750,7 +804,8 @@ begin
     AName:=SimpleTypeCaseNames[I];
     AName:=SimpleTypeCaseNames[I];
 end;
 end;
 
 
-function TPasParser.ParseStringType(Parent : TPasElement; Const TypeName : String) : TPasAliasType;
+function TPasParser.ParseStringType(Parent: TPasElement; const TypeName: String
+  ): TPasAliasType;
 
 
 Var
 Var
   S : String;
   S : String;
@@ -878,17 +933,20 @@ begin
   end;
   end;
 end;
 end;
 
 
-function TPasParser.ParseEnumType(Parent : TPasElement; Const TypeName : String) : TPasEnumType;
+function TPasParser.ParseEnumType(Parent: TPasElement; const TypeName: String
+  ): TPasEnumType;
 
 
 Var
 Var
   EnumValue: TPasEnumValue;
   EnumValue: TPasEnumValue;
 
 
 begin
 begin
+  Writeln('Current comments : ',SavedComments);
   Result := TPasEnumType(CreateElement(TPasEnumType, TypeName, Parent));
   Result := TPasEnumType(CreateElement(TPasEnumType, TypeName, Parent));
   try
   try
     while True do
     while True do
       begin
       begin
       NextToken;
       NextToken;
+      SaveComments;
       EnumValue := TPasEnumValue(CreateElement(TPasEnumValue, CurTokenString, Result));
       EnumValue := TPasEnumValue(CreateElement(TPasEnumValue, CurTokenString, Result));
       Result.Values.Add(EnumValue);
       Result.Values.Add(EnumValue);
       NextToken;
       NextToken;
@@ -913,7 +971,8 @@ begin
   end;
   end;
 end;
 end;
 
 
-function TPasParser.ParseSetType(Parent: TPasElement; Const TypeName : String): TPasSetType;
+function TPasParser.ParseSetType(Parent: TPasElement; const TypeName: String
+  ): TPasSetType;
 
 
 begin
 begin
   Result := TPasSetType(CreateElement(TPasSetType, TypeName, Parent));
   Result := TPasSetType(CreateElement(TPasSetType, TypeName, Parent));
@@ -1558,7 +1617,8 @@ begin
   end;
   end;
 end;
 end;
 
 
-Function TPasParser.CheckOverloadList(AList : TFPList; AName : String; Out OldMember : TPasElement) : TPasOverloadedProc;
+function TPasParser.CheckOverloadList(AList: TFPList; AName: String; out
+  OldMember: TPasElement): TPasOverloadedProc;
 
 
 Var
 Var
   I : Integer;
   I : Integer;
@@ -1578,6 +1638,8 @@ begin
         Result:=TPasOverloadedProc.Create(AName, OldMember.Parent);
         Result:=TPasOverloadedProc.Create(AName, OldMember.Parent);
         Result.Visibility:=OldMember.Visibility;
         Result.Visibility:=OldMember.Visibility;
         Result.Overloads.Add(OldMember);
         Result.Overloads.Add(OldMember);
+        Result.SourceFilename:=OldMember.SourceFilename;
+        Result.SourceLinenumber:=OldMember.SourceLinenumber;
         AList[i] := Result;
         AList[i] := Result;
         end;
         end;
       end;
       end;
@@ -1638,6 +1700,7 @@ procedure TPasParser.ParseMain(var Module: TPasModule);
 begin
 begin
   Module:=nil;
   Module:=nil;
   NextToken;
   NextToken;
+  SaveComments;
   case CurToken of
   case CurToken of
     tkUnit:
     tkUnit:
       ParseUnit(Module);
       ParseUnit(Module);
@@ -1836,7 +1899,8 @@ begin
   UngetToken;
   UngetToken;
 end;
 end;
 
 
-Function TPasParser.GetProcTypeFromToken(tk : TToken; IsClass : Boolean = False) : TProcType;
+function TPasParser.GetProcTypeFromToken(tk: TToken; IsClass: Boolean
+  ): TProcType;
 
 
 begin
 begin
   Case tk of
   Case tk of
@@ -1942,12 +2006,14 @@ begin
         CurBlock := declProperty;
         CurBlock := declProperty;
       tkProcedure, tkFunction, tkConstructor, tkDestructor,tkOperator:
       tkProcedure, tkFunction, tkConstructor, tkDestructor,tkOperator:
         begin
         begin
+        SaveComments;
         pt:=GetProcTypeFromToken(CurToken);
         pt:=GetProcTypeFromToken(CurToken);
         AddProcOrFunction(Declarations, ParseProcedureOrFunctionDecl(Declarations, pt));
         AddProcOrFunction(Declarations, ParseProcedureOrFunctionDecl(Declarations, pt));
         CurBlock := declNone;
         CurBlock := declNone;
         end;
         end;
       tkClass:
       tkClass:
         begin
         begin
+          SaveComments;
           NextToken;
           NextToken;
           If CurToken in [tkprocedure,tkFunction,tkConstructor, tkDestructor] then
           If CurToken in [tkprocedure,tkFunction,tkConstructor, tkDestructor] then
             begin
             begin
@@ -1960,6 +2026,7 @@ begin
         end;
         end;
       tkIdentifier:
       tkIdentifier:
         begin
         begin
+          SaveComments;
           case CurBlock of
           case CurBlock of
             declConst:
             declConst:
               begin
               begin
@@ -2153,6 +2220,7 @@ end;
 // Starts after the variable name
 // Starts after the variable name
 function TPasParser.ParseConstDecl(Parent: TPasElement): TPasConst;
 function TPasParser.ParseConstDecl(Parent: TPasElement): TPasConst;
 begin
 begin
+  SaveComments;
   Result := TPasConst(CreateElement(TPasConst, CurTokenString, Parent));
   Result := TPasConst(CreateElement(TPasConst, CurTokenString, Parent));
   try
   try
     NextToken;
     NextToken;
@@ -2174,6 +2242,7 @@ end;
 // Starts after the variable name
 // Starts after the variable name
 function TPasParser.ParseResourcestringDecl(Parent: TPasElement): TPasResString;
 function TPasParser.ParseResourcestringDecl(Parent: TPasElement): TPasResString;
 begin
 begin
+  SaveComments;
   Result := TPasResString(CreateElement(TPasResString, CurTokenString, Parent));
   Result := TPasResString(CreateElement(TPasResString, CurTokenString, Parent));
   try
   try
     ExpectToken(tkEqual);
     ExpectToken(tkEqual);
@@ -2205,7 +2274,8 @@ begin
 end;
 end;
 
 
 // Starts after the type name
 // Starts after the type name
-Function TPasParser.ParseRangeType(AParent : TPasElement; Const TypeName : String; Full : Boolean = True) : TPasRangeType;
+function TPasParser.ParseRangeType(AParent: TPasElement;
+  Const TypeName: String; Full: Boolean): TPasRangeType;
 
 
 Var
 Var
   PE : TPasExpr;
   PE : TPasExpr;
@@ -2259,7 +2329,8 @@ begin
   until (CurToken=tkSemicolon);
   until (CurToken=tkSemicolon);
 end;
 end;
 
 
-Function TPasParser.ParseSpecializeType(Parent : TPasElement; Const TypeName : String) : TPasClassType;
+function TPasParser.ParseSpecializeType(Parent: TPasElement;
+  Const TypeName: String): TPasClassType;
 
 
 begin
 begin
   Result := TPasClassType(Engine.CreateElement(TPasClassType, TypeName, Parent, Scanner.CurFilename, Scanner.CurRow));
   Result := TPasClassType(Engine.CreateElement(TPasClassType, TypeName, Parent, Scanner.CurFilename, Scanner.CurRow));
@@ -2274,7 +2345,8 @@ begin
   end;
   end;
 end;
 end;
 
 
-Function TPasParser.ParseProcedureType(Parent : TPasElement; Const TypeName : String; Const PT : TProcType) : TPasProcedureType;
+function TPasParser.ParseProcedureType(Parent: TPasElement;
+  const TypeName: String; const PT: TProcType): TPasProcedureType;
 
 
 begin
 begin
   if PT in [ptFunction,ptClassFunction] then
   if PT in [ptFunction,ptClassFunction] then
@@ -2299,7 +2371,8 @@ begin
   Result:=ParseType(Parent,TypeName,True);
   Result:=ParseType(Parent,TypeName,True);
 end;
 end;
 
 
-Function TPasParser.GetVariableValueAndLocation(Parent : TPasElement; out Value : TPasExpr; Out Location : String) : Boolean;
+function TPasParser.GetVariableValueAndLocation(Parent: TPasElement; Out
+  Value: TPasExpr; Out Location: String): Boolean;
 
 
 begin
 begin
   Value:=Nil;
   Value:=Nil;
@@ -2329,7 +2402,8 @@ begin
     UngetToken;
     UngetToken;
 end;
 end;
 
 
-Function TPasParser.GetVariableModifiers(Out Varmods : TVariableModifiers; Out Libname,ExportName : string) : string;
+function TPasParser.GetVariableModifiers(Out VarMods: TVariableModifiers; Out
+  Libname, ExportName: string): string;
 
 
 Var
 Var
   S : String;
   S : String;
@@ -2399,11 +2473,12 @@ var
   VarEl: TPasVariable;
   VarEl: TPasVariable;
   H : TPasMemberHints;
   H : TPasMemberHints;
   varmods: TVariableModifiers;
   varmods: TVariableModifiers;
-  Mods,Loc,alibname,aexpname : string;
+  D,Mods,Loc,alibname,aexpname : string;
 
 
 begin
 begin
   VarNames := TStringList.Create;
   VarNames := TStringList.Create;
   try
   try
+    D:=SaveComments; // This means we support only one comment per 'list'.
     Repeat
     Repeat
       VarNames.Add(CurTokenString);
       VarNames.Add(CurTokenString);
       NextToken;
       NextToken;
@@ -2425,6 +2500,7 @@ begin
       Mods:=GetVariableModifiers(varmods,alibname,aexpname)
       Mods:=GetVariableModifiers(varmods,alibname,aexpname)
     else
     else
       NextToken;
       NextToken;
+    SaveComments(D);
     for i := 0 to VarNames.Count - 1 do
     for i := 0 to VarNames.Count - 1 do
       begin
       begin
       VarEl:=TPasVariable(CreateElement(TPasVariable,VarNames[i],Parent,AVisibility));
       VarEl:=TPasVariable(CreateElement(TPasVariable,VarNames[i],Parent,AVisibility));
@@ -2450,12 +2526,25 @@ begin
   end;
   end;
 end;
 end;
 
 
+Function TPasParser.SaveComments: String;
+begin
+  if Engine.NeedComments then
+    FSavedComments:=CurComments.Text; // Expensive, so don't do unless needed.
+  Result:=FSavedComments;
+end;
+
+Function TPasParser.SaveComments(Const AValue: String): String;
+begin
+  FSavedComments:=AValue;
+  Result:=FSavedComments;
+end;
+
 function TPasParser.LogEvent(E: TPParserLogEvent): Boolean;
 function TPasParser.LogEvent(E: TPParserLogEvent): Boolean;
 begin
 begin
   Result:=E in FLogEvents;
   Result:=E in FLogEvents;
 end;
 end;
 
 
-procedure TPasParser.DoLog(const Msg: String; SkipSourceInfo: Boolean);
+Procedure TPasParser.DoLog(Const Msg: String; SkipSourceInfo: Boolean);
 begin
 begin
   If Assigned(FOnLog) then
   If Assigned(FOnLog) then
     if SkipSourceInfo or not assigned(scanner) then
     if SkipSourceInfo or not assigned(scanner) then
@@ -2464,7 +2553,7 @@ begin
       FOnLog(Self,Format('%s(%d) : %s',[Scanner.CurFilename,SCanner.CurRow,Msg]));
       FOnLog(Self,Format('%s(%d) : %s',[Scanner.CurFilename,SCanner.CurRow,Msg]));
 end;
 end;
 
 
-procedure TPasParser.DoLog(const Fmt: String; Args: array of const;
+Procedure TPasParser.DoLog(Const Fmt: String; Args: Array of const;
   SkipSourceInfo: Boolean);
   SkipSourceInfo: Boolean);
 begin
 begin
   DoLog(Format(Fmt,Args),SkipSourceInfo);
   DoLog(Format(Fmt,Args),SkipSourceInfo);
@@ -2595,7 +2684,8 @@ begin
 end;
 end;
 
 
 
 
-Function TPasParser.CheckProcedureArgs(Parent  : TPasElement; Args : TFPList; Mandatory : Boolean) : boolean;
+function TPasParser.CheckProcedureArgs(Parent: TPasElement; Args: TFPList;
+  Mandatory: Boolean): boolean;
 
 
 begin
 begin
   NextToken;
   NextToken;
@@ -3500,7 +3590,7 @@ begin
 end;
 end;
 
 
 // Starts after the "procedure" or "function" token
 // Starts after the "procedure" or "function" token
-Function TPasParser.GetProcedureClass(ProcType : TProcType) : TPTreeElement;
+function TPasParser.GetProcedureClass(ProcType: TProcType): TPTreeElement;
 
 
 begin
 begin
   Case ProcType of
   Case ProcType of
@@ -3567,7 +3657,8 @@ begin
 end;
 end;
 
 
 // Current token is the first token after tkOf
 // Current token is the first token after tkOf
-Procedure TPasParser.ParseRecordVariantParts(ARec : TPasRecordType; AEndToken: TToken);
+procedure TPasParser.ParseRecordVariantParts(ARec: TPasRecordType;
+  AEndToken: TToken);
 
 
 Var
 Var
   M : TPasRecordType;
   M : TPasRecordType;
@@ -3613,7 +3704,8 @@ begin
 end;
 end;
 
 
 // Starts on first token after Record or (. Ends on AEndToken
 // Starts on first token after Record or (. Ends on AEndToken
-Procedure TPasParser.ParseRecordFieldList(ARec : TPasRecordType; AEndToken : TToken; AllowMethods : Boolean);
+procedure TPasParser.ParseRecordFieldList(ARec: TPasRecordType;
+  AEndToken: TToken; AllowMethods: Boolean);
 
 
 Var
 Var
   VN : String;
   VN : String;
@@ -3626,6 +3718,7 @@ begin
   v:=visPublic;
   v:=visPublic;
   while CurToken<>AEndToken do
   while CurToken<>AEndToken do
     begin
     begin
+    SaveComments;
     Case CurToken of
     Case CurToken of
       tkProperty:
       tkProperty:
         begin
         begin
@@ -3722,7 +3815,8 @@ begin
     end;
     end;
 end;
 end;
 
 
-Function TPasParser.CheckVisibility(S : String; Var AVisibility :TPasMemberVisibility) : Boolean;
+function TPasParser.CheckVisibility(S: String;
+  var AVisibility: TPasMemberVisibility): Boolean;
 
 
 Var
 Var
   B : Boolean;
   B : Boolean;
@@ -3764,7 +3858,8 @@ begin
     AType.Members.Add(Proc);
     AType.Members.Add(Proc);
 end;
 end;
 
 
-procedure TPasParser.ParseClassFields(AType: TPasClassType; Const AVisibility : TPasMemberVisibility; IsClassField : Boolean);
+procedure TPasParser.ParseClassFields(AType: TPasClassType;
+  const AVisibility: TPasMemberVisibility; IsClassField: Boolean);
 
 
 Var
 Var
   VarList: TFPList;
   VarList: TFPList;
@@ -3839,11 +3934,13 @@ begin
       tkType:
       tkType:
         begin
         begin
         ExpectToken(tkIdentifier);
         ExpectToken(tkIdentifier);
+        SaveComments;
         ParseClassLocalTypes(AType,CurVisibility);
         ParseClassLocalTypes(AType,CurVisibility);
         end;
         end;
       tkConst:
       tkConst:
         begin
         begin
         ExpectToken(tkIdentifier);
         ExpectToken(tkIdentifier);
+        SaveComments;
         ParseClassLocalConsts(AType,CurVisibility);
         ParseClassLocalConsts(AType,CurVisibility);
         end;
         end;
       tkVar,
       tkVar,
@@ -3853,17 +3950,20 @@ begin
           ParseExc(SParserNoFieldsAllowed);
           ParseExc(SParserNoFieldsAllowed);
         if CurToken=tkVar then
         if CurToken=tkVar then
           ExpectToken(tkIdentifier);
           ExpectToken(tkIdentifier);
+        SaveComments;
         if Not CheckVisibility(CurtokenString,CurVisibility) then
         if Not CheckVisibility(CurtokenString,CurVisibility) then
           ParseClassFields(AType,CurVisibility,false);
           ParseClassFields(AType,CurVisibility,false);
         end;
         end;
       tkProcedure,tkFunction,tkConstructor,tkDestructor:
       tkProcedure,tkFunction,tkConstructor,tkDestructor:
         begin
         begin
+        SaveComments;
         if (Curtoken in [tkConstructor,tkDestructor]) and (AType.ObjKind in [okInterface,okRecordHelper]) then
         if (Curtoken in [tkConstructor,tkDestructor]) and (AType.ObjKind in [okInterface,okRecordHelper]) then
           ParseExc(SParserNoConstructorAllowed);
           ParseExc(SParserNoConstructorAllowed);
         ProcessMethod(AType,False,CurVisibility);
         ProcessMethod(AType,False,CurVisibility);
         end;
         end;
       tkclass:
       tkclass:
         begin
         begin
+         SaveComments;
          NextToken;
          NextToken;
          if CurToken in [tkConstructor,tkDestructor,tkprocedure,tkFunction] then
          if CurToken in [tkConstructor,tkDestructor,tkprocedure,tkFunction] then
            ProcessMethod(AType,True,CurVisibility)
            ProcessMethod(AType,True,CurVisibility)
@@ -3882,6 +3982,7 @@ begin
         end;
         end;
       tkProperty:
       tkProperty:
         begin
         begin
+        SaveComments;
         ExpectIdentifier;
         ExpectIdentifier;
         AType.Members.Add(ParseProperty(AType,CurtokenString,CurVisibility));
         AType.Members.Add(ParseProperty(AType,CurtokenString,CurVisibility));
         end;
         end;
@@ -3948,7 +4049,9 @@ begin
     end;
     end;
 end;
 end;
 
 
-function TPasParser.ParseClassDecl(Parent: TPasElement; const AClassName: String; AObjKind: TPasObjKind; PackMode : TPackMode= pmNone): TPasType;
+Function TPasParser.ParseClassDecl(Parent: TPasElement;
+  const AClassName: String; AObjKind: TPasObjKind; PackMode: TPackMode
+  ): TPasType;
 
 
 Var
 Var
   SourcefileName : string;
   SourcefileName : string;

+ 6 - 0
packages/fcl-passrc/tests/tcbaseparser.pas

@@ -77,6 +77,7 @@ Type
     Procedure HaveHint(AHint : TPasMemberHint; AHints : TPasMemberHints);
     Procedure HaveHint(AHint : TPasMemberHint; AHints : TPasMemberHints);
     Property Resolver : TStreamResolver Read FResolver;
     Property Resolver : TStreamResolver Read FResolver;
     Property Scanner : TPascalScanner Read FScanner;
     Property Scanner : TPascalScanner Read FScanner;
+    Property Engine : TTestEngine read FEngine;
     Property Parser : TTestPasParser read FParser ;
     Property Parser : TTestPasParser read FParser ;
     Property Source : TStrings Read FSource;
     Property Source : TStrings Read FSource;
     Property Module : TPasModule Read FModule;
     Property Module : TPasModule Read FModule;
@@ -108,6 +109,11 @@ begin
   Result.Visibility := AVisibility;
   Result.Visibility := AVisibility;
   Result.SourceFilename := ASourceFilename;
   Result.SourceFilename := ASourceFilename;
   Result.SourceLinenumber := ASourceLinenumber;
   Result.SourceLinenumber := ASourceLinenumber;
+  if NeedComments and Assigned(CurrentParser) then
+    begin
+//    Writeln('Saving comment : ',CurrentParser.SavedComments);
+    Result.DocComment:=CurrentParser.SavedComments;
+    end;
   If not Assigned(FList) then
   If not Assigned(FList) then
     FList:=TFPList.Create;
     FList:=TFPList.Create;
   FList.Add(Result);
   FList.Add(Result);

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

@@ -60,12 +60,14 @@ type
     Property Const2 : TPasConst Index 1 Read GetC;
     Property Const2 : TPasConst Index 1 Read GetC;
   published
   published
     procedure TestEmpty;
     procedure TestEmpty;
+    procedure TestEmptyComment;
     procedure TestEmptyDeprecated;
     procedure TestEmptyDeprecated;
     procedure TestEmptyEnd;
     procedure TestEmptyEnd;
     procedure TestEmptyEndNoParent;
     procedure TestEmptyEndNoParent;
     Procedure TestOneInterface;
     Procedure TestOneInterface;
     Procedure TestTwoInterfaces;
     Procedure TestTwoInterfaces;
     Procedure TestOneField;
     Procedure TestOneField;
+    Procedure TestOneFieldComment;
     Procedure TestOneVarField;
     Procedure TestOneVarField;
     Procedure TestOneClassField;
     Procedure TestOneClassField;
     Procedure TestOneFieldVisibility;
     Procedure TestOneFieldVisibility;
@@ -83,7 +85,9 @@ type
     procedure TestHintFieldLibraryError;
     procedure TestHintFieldLibraryError;
     procedure TestHintFieldUninmplemented;
     procedure TestHintFieldUninmplemented;
     Procedure TestMethodSimple;
     Procedure TestMethodSimple;
+    Procedure TestMethodSimpleComment;
     Procedure TestClassMethodSimple;
     Procedure TestClassMethodSimple;
+    Procedure TestClassMethodSimpleComment;
     Procedure TestConstructor;
     Procedure TestConstructor;
     Procedure TestClassConstructor;
     Procedure TestClassConstructor;
     Procedure TestDestructor;
     Procedure TestDestructor;
@@ -108,6 +112,7 @@ type
     Procedure Test2Methods;
     Procedure Test2Methods;
     Procedure Test2MethodsDifferentVisibility;
     Procedure Test2MethodsDifferentVisibility;
     Procedure TestPropertyRedeclare;
     Procedure TestPropertyRedeclare;
+    Procedure TestPropertyRedeclareComment;
     Procedure TestPropertyRedeclareDefault;
     Procedure TestPropertyRedeclareDefault;
     Procedure TestPropertyReadOnly;
     Procedure TestPropertyReadOnly;
     Procedure TestPropertyReadWrite;
     Procedure TestPropertyReadWrite;
@@ -306,11 +311,17 @@ Procedure TTestClassType.ParseClass;
 begin
 begin
   EndClass;
   EndClass;
   Add('Type');
   Add('Type');
+  if AddComment then
+    begin
+    Add('// A comment');
+    engine.NeedComments:=True;
+    end;
   Add('  '+TrimRight(FDecl.Text)+';');
   Add('  '+TrimRight(FDecl.Text)+';');
   ParseDeclarations;
   ParseDeclarations;
   AssertEquals('One class type definition',1,Declarations.Classes.Count);
   AssertEquals('One class type definition',1,Declarations.Classes.Count);
   AssertEquals('First declaration is type definition.',TPasClassType,TObject(Declarations.Classes[0]).ClassType);
   AssertEquals('First declaration is type definition.',TPasClassType,TObject(Declarations.Classes[0]).ClassType);
   FClass:=TObject(Declarations.Classes[0]) as TPasClassType;
   FClass:=TObject(Declarations.Classes[0]) as TPasClassType;
+  TheType:=FClass; // So assertcomment can get to it
   if (FParent<>'') then
   if (FParent<>'') then
      begin
      begin
      AssertNotNull('Have parent class',TheClass.AncestorType);
      AssertNotNull('Have parent class',TheClass.AncestorType);
@@ -323,6 +334,7 @@ begin
     AssertNull('No helperfortype if not helper',TheClass.HelperForType);
     AssertNull('No helperfortype if not helper',TheClass.HelperForType);
   if TheClass.Members.Count>0 then
   if TheClass.Members.Count>0 then
     FMember1:=TObject(TheClass.Members[0]) as TPaselement;
     FMember1:=TObject(TheClass.Members[0]) as TPaselement;
+
 end;
 end;
 
 
 procedure TTestClassType.SetUp;
 procedure TTestClassType.SetUp;
@@ -385,6 +397,13 @@ begin
   AssertEquals('No members',0,TheClass.Members.Count);
   AssertEquals('No members',0,TheClass.Members.Count);
 end;
 end;
 
 
+procedure TTestClassType.TestEmptyComment;
+begin
+  AddComment:=True;
+  TestEmpty;
+  AssertComment;
+end;
+
 procedure TTestClassType.TestEmptyDeprecated;
 procedure TTestClassType.TestEmptyDeprecated;
 begin
 begin
   EndClass('end deprecated');
   EndClass('end deprecated');
@@ -438,6 +457,16 @@ begin
   AssertVisibility;
   AssertVisibility;
 end;
 end;
 
 
+Procedure TTestClassType.TestOneFieldComment;
+begin
+  AddComment:=true;
+  AddMember('{c}a : integer');
+  ParseClass;
+  AssertNotNull('Have 1 field',Field1);
+  AssertEquals('field comment','c'+sLineBreak,Field1.DocComment);
+  AssertVisibility;
+end;
+
 Procedure TTestClassType.TestOneVarField;
 Procedure TTestClassType.TestOneVarField;
 begin
 begin
   StartVisibility(visPublished);
   StartVisibility(visPublished);
@@ -640,6 +669,18 @@ begin
   AssertEquals('No arguments',0,Method1.ProcType.Args.Count)
   AssertEquals('No arguments',0,Method1.ProcType.Args.Count)
 end;
 end;
 
 
+Procedure TTestClassType.TestMethodSimpleComment;
+begin
+  AddComment:=True;
+  AddMember('{c} Procedure DoSomething');
+  ParseClass;
+  AssertEquals('1 members',1,TheClass.members.Count);
+  AssertEquals('Default visibility',visDefault,Method1.Visibility);
+  AssertNotNull('Have method',Method1);
+  AssertMemberName('DoSomething');
+  AssertEquals('Comment','c'+sLineBreak,Method1.DocComment);
+end;
+
 Procedure TTestClassType.TestClassMethodSimple;
 Procedure TTestClassType.TestClassMethodSimple;
 begin
 begin
   AddMember('Class Procedure DoSomething');
   AddMember('Class Procedure DoSomething');
@@ -654,6 +695,14 @@ begin
   AssertEquals('No arguments',0,TPasClassProcedure(Members[0]).ProcType.Args.Count)
   AssertEquals('No arguments',0,TPasClassProcedure(Members[0]).ProcType.Args.Count)
 end;
 end;
 
 
+Procedure TTestClassType.TestClassMethodSimpleComment;
+begin
+  AddComment:=True;
+  AddMember('{c} Class Procedure DoSomething');
+  ParseClass;
+  AssertEquals('Comment','c'+sLineBreak,Members[0].DocComment);
+end;
+
 Procedure TTestClassType.TestConstructor;
 Procedure TTestClassType.TestConstructor;
 begin
 begin
   AddMember('Constructor Create');
   AddMember('Constructor Create');
@@ -967,6 +1016,16 @@ begin
   Assertequals('No default value','',Property1.DefaultValue);
   Assertequals('No default value','',Property1.DefaultValue);
 end;
 end;
 
 
+Procedure TTestClassType.TestPropertyRedeclareComment;
+begin
+  StartVisibility(visPublished);
+  AddComment:=True;
+  AddMember('{p} Property Something');
+  ParseClass;
+  AssertProperty(Property1,visPublished,'Something','','','','',0,False,False);
+  AssertEquals('comment','p'+sLineBreak,Property1.DocComment);
+end;
+
 Procedure TTestClassType.TestPropertyRedeclareDefault;
 Procedure TTestClassType.TestPropertyRedeclareDefault;
 begin
 begin
   StartVisibility(visPublic);
   StartVisibility(visPublic);

+ 124 - 89
packages/fcl-passrc/tests/tcprocfunc.pas

@@ -13,6 +13,7 @@ type
 
 
   TTestProcedureFunction= class(TTestParser)
   TTestProcedureFunction= class(TTestParser)
   private
   private
+    FAddComment: Boolean;
     FFunc: TPasFunction;
     FFunc: TPasFunction;
     FHint: String;
     FHint: String;
     FProc: TPasProcedure;
     FProc: TPasProcedure;
@@ -35,6 +36,8 @@ type
   protected
   protected
     procedure SetUp; override;
     procedure SetUp; override;
     procedure TearDown; override;
     procedure TearDown; override;
+    Procedure AssertComment;
+    Property AddComment : Boolean Read FAddComment Write FAddComment;
     Property Hint : String Read FHint Write FHint;
     Property Hint : String Read FHint Write FHint;
     Property Proc : TPasProcedure Read FProc;
     Property Proc : TPasProcedure Read FProc;
     Property ProcType : TPasProcedureType Read GetPT;
     Property ProcType : TPasProcedureType Read GetPT;
@@ -42,7 +45,9 @@ type
     Property FuncType : TPasFunctionType Read GetFT;
     Property FuncType : TPasFunctionType Read GetFT;
   published
   published
     procedure TestEmptyProcedure;
     procedure TestEmptyProcedure;
+    procedure TestEmptyProcedureComment;
     Procedure TestEmptyFunction;
     Procedure TestEmptyFunction;
+    Procedure TestEmptyFunctionComment;
     procedure TestEmptyProcedureDeprecated;
     procedure TestEmptyProcedureDeprecated;
     Procedure TestEmptyFunctionDeprecated;
     Procedure TestEmptyFunctionDeprecated;
     procedure TestEmptyProcedurePlatform;
     procedure TestEmptyProcedurePlatform;
@@ -156,7 +161,8 @@ type
 implementation
 implementation
 
 
 
 
-procedure TTestProcedureFunction.AddDeclaration(Const ASource : string; Const AHint : String = '');
+procedure TTestProcedureFunction.AddDeclaration(const ASource: string;
+  const AHint: String);
 
 
 Var
 Var
   D : String;
   D : String;
@@ -176,16 +182,24 @@ begin
   Result:=Proc.ProcType;
   Result:=Proc.ProcType;
 end;
 end;
 
 
-Function TTestProcedureFunction.ParseProcedure(Const ASource : string; Const AHint : String = '') : TPasProcedure;
+function TTestProcedureFunction.ParseProcedure(const ASource: string;
+  const AHint: String): TPasProcedure;
 
 
 
 
 begin
 begin
+  If AddComment then
+    begin
+    Add('// A comment');
+    Engine.NeedComments:=True;
+    end;
   AddDeclaration('procedure A '+ASource,AHint);
   AddDeclaration('procedure A '+ASource,AHint);
   Self.ParseProcedure;
   Self.ParseProcedure;
   Result:=Fproc;
   Result:=Fproc;
+  If AddComment then
+    AssertComment;
 end;
 end;
 
 
-procedure TTestProcedureFunction.ParseProcedure;
+Procedure TTestProcedureFunction.ParseProcedure;
 
 
 begin
 begin
   //  Writeln(source.text);
   //  Writeln(source.text);
@@ -216,7 +230,7 @@ begin
   AssertEquals('Correct function result type name',AResult,FuncType.ResultEl.ResultType.Name);
   AssertEquals('Correct function result type name',AResult,FuncType.ResultEl.ResultType.Name);
 end;
 end;
 
 
-procedure TTestProcedureFunction.ParseFunction;
+Procedure TTestProcedureFunction.ParseFunction;
 begin
 begin
   //  Writeln(source.text);
   //  Writeln(source.text);
   ParseDeclarations;
   ParseDeclarations;
@@ -261,7 +275,9 @@ begin
   AssertEquals('Not is nested',False,P.ProcType.IsNested);
   AssertEquals('Not is nested',False,P.ProcType.IsNested);
 end;
 end;
 
 
-Function TTestProcedureFunction.BaseAssertArg(ProcType : TPasProcedureType; AIndex : Integer; AName : String; AAccess : TArgumentAccess; AValue : String='') : TPasArgument;
+function TTestProcedureFunction.BaseAssertArg(ProcType: TPasProcedureType;
+  AIndex: Integer; AName: String; AAccess: TArgumentAccess; AValue: String
+  ): TPasArgument;
 
 
 Var
 Var
   A : TPasArgument;
   A : TPasArgument;
@@ -287,7 +303,9 @@ begin
   Result:=A;
   Result:=A;
 end;
 end;
 
 
-procedure TTestProcedureFunction.AssertArg(ProcType : TPasProcedureType; AIndex : Integer; AName : String; AAccess : TArgumentAccess; Const TypeName : String; AValue : String='');
+procedure TTestProcedureFunction.AssertArg(ProcType: TPasProcedureType;
+  AIndex: Integer; AName: String; AAccess: TArgumentAccess;
+  const TypeName: String; AValue: String);
 
 
 Var
 Var
   A : TPasArgument;
   A : TPasArgument;
@@ -343,19 +361,31 @@ begin
   AssertProc([],ccDefault,0);
   AssertProc([],ccDefault,0);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestEmptyFunction;
+procedure TTestProcedureFunction.TestEmptyProcedureComment;
+begin
+  AddComment:=True;
+  TestEmptyProcedure;
+end;
+
+Procedure TTestProcedureFunction.TestEmptyFunction;
 begin
 begin
   ParseFunction('');
   ParseFunction('');
   AssertFunc([],ccDefault,0);
   AssertFunc([],ccDefault,0);
 end;
 end;
 
 
+Procedure TTestProcedureFunction.TestEmptyFunctionComment;
+begin
+  AddComment:=True;
+  TestEmptyProcedure;
+end;
+
 procedure TTestProcedureFunction.TestEmptyProcedureDeprecated;
 procedure TTestProcedureFunction.TestEmptyProcedureDeprecated;
 begin
 begin
   ParseProcedure('','deprecated');
   ParseProcedure('','deprecated');
   AssertProc([],ccDefault,0);
   AssertProc([],ccDefault,0);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestEmptyFunctionDeprecated;
+Procedure TTestProcedureFunction.TestEmptyFunctionDeprecated;
 begin
 begin
   ParseFunction('','deprecated');
   ParseFunction('','deprecated');
   AssertFunc([],ccDefault,0);
   AssertFunc([],ccDefault,0);
@@ -367,7 +397,7 @@ begin
   AssertProc([],ccDefault,0);
   AssertProc([],ccDefault,0);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestEmptyFunctionPlatform;
+Procedure TTestProcedureFunction.TestEmptyFunctionPlatform;
 begin
 begin
   ParseFunction('','platform');
   ParseFunction('','platform');
   AssertFunc([],ccDefault,0);
   AssertFunc([],ccDefault,0);
@@ -379,7 +409,7 @@ begin
   AssertProc([],ccDefault,0);
   AssertProc([],ccDefault,0);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestEmptyFunctionExperimental;
+Procedure TTestProcedureFunction.TestEmptyFunctionExperimental;
 begin
 begin
   ParseFunction('','experimental');
   ParseFunction('','experimental');
   AssertFunc([],ccDefault,0);
   AssertFunc([],ccDefault,0);
@@ -391,7 +421,7 @@ begin
   AssertProc([],ccDefault,0);
   AssertProc([],ccDefault,0);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestEmptyFunctionUnimplemented;
+Procedure TTestProcedureFunction.TestEmptyFunctionUnimplemented;
 begin
 begin
   ParseFunction('','unimplemented');
   ParseFunction('','unimplemented');
   AssertFunc([],ccDefault,0);
   AssertFunc([],ccDefault,0);
@@ -407,7 +437,7 @@ begin
   AssertArg(ProcType,0,'B',argDefault,'Integer','');
   AssertArg(ProcType,0,'B',argDefault,'Integer','');
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionOneArg;
+Procedure TTestProcedureFunction.TestFunctionOneArg;
 begin
 begin
   ParseFunction('(B : Integer)');
   ParseFunction('(B : Integer)');
   AssertFunc([],ccDefault,1);
   AssertFunc([],ccDefault,1);
@@ -421,7 +451,7 @@ begin
   AssertArg(ProcType,0,'B',argVar,'Integer','');
   AssertArg(ProcType,0,'B',argVar,'Integer','');
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionOneVarArg;
+Procedure TTestProcedureFunction.TestFunctionOneVarArg;
 begin
 begin
   ParseFunction('(Var B : Integer)');
   ParseFunction('(Var B : Integer)');
   AssertFunc([],ccDefault,1);
   AssertFunc([],ccDefault,1);
@@ -435,7 +465,7 @@ begin
   AssertArg(ProcType,0,'B',argConst,'Integer','');
   AssertArg(ProcType,0,'B',argConst,'Integer','');
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionOneConstArg;
+Procedure TTestProcedureFunction.TestFunctionOneConstArg;
 begin
 begin
   ParseFunction('(Const B : Integer)');
   ParseFunction('(Const B : Integer)');
   AssertFunc([],ccDefault,1);
   AssertFunc([],ccDefault,1);
@@ -449,7 +479,7 @@ begin
   AssertArg(ProcType,0,'B',argOut,'Integer','');
   AssertArg(ProcType,0,'B',argOut,'Integer','');
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionOneOutArg;
+Procedure TTestProcedureFunction.TestFunctionOneOutArg;
 begin
 begin
   ParseFunction('(Out B : Integer)');
   ParseFunction('(Out B : Integer)');
   AssertFunc([],ccDefault,1);
   AssertFunc([],ccDefault,1);
@@ -463,7 +493,7 @@ begin
   AssertArg(ProcType,0,'B',argConstRef,'Integer','');
   AssertArg(ProcType,0,'B',argConstRef,'Integer','');
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionOneConstRefArg;
+Procedure TTestProcedureFunction.TestFunctionOneConstRefArg;
 begin
 begin
   ParseFunction('(ConstRef B : Integer)');
   ParseFunction('(ConstRef B : Integer)');
   AssertFunc([],ccDefault,1);
   AssertFunc([],ccDefault,1);
@@ -478,7 +508,7 @@ begin
   AssertArg(ProcType,1,'C',argDefault,'Integer','');
   AssertArg(ProcType,1,'C',argDefault,'Integer','');
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionTwoArgs;
+Procedure TTestProcedureFunction.TestFunctionTwoArgs;
 begin
 begin
   ParseFunction('(B,C : Integer)');
   ParseFunction('(B,C : Integer)');
   AssertFunc([],ccDefault,2);
   AssertFunc([],ccDefault,2);
@@ -494,7 +524,7 @@ begin
   AssertArg(ProcType,1,'C',argDefault,'Integer','');
   AssertArg(ProcType,1,'C',argDefault,'Integer','');
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionTwoArgsSeparate;
+Procedure TTestProcedureFunction.TestFunctionTwoArgsSeparate;
 begin
 begin
   ParseFunction('(B : Integer;C : Integer)');
   ParseFunction('(B : Integer;C : Integer)');
   AssertFunc([],ccDefault,2);
   AssertFunc([],ccDefault,2);
@@ -509,7 +539,7 @@ begin
   AssertArg(ProcType,0,'B',argDefault,'Integer','1');
   AssertArg(ProcType,0,'B',argDefault,'Integer','1');
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionOneArgDefault;
+Procedure TTestProcedureFunction.TestFunctionOneArgDefault;
 begin
 begin
   ParseFunction('(B : Integer = 1)');
   ParseFunction('(B : Integer = 1)');
   AssertFunc([],ccDefault,1);
   AssertFunc([],ccDefault,1);
@@ -523,7 +553,7 @@ begin
   AssertArg(ProcType,0,'B',argDefault,'MySet','[1, 2]');
   AssertArg(ProcType,0,'B',argDefault,'MySet','[1, 2]');
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionOneArgDefaultSet;
+Procedure TTestProcedureFunction.TestFunctionOneArgDefaultSet;
 begin
 begin
   ParseFunction('(B : MySet = [1,2])');
   ParseFunction('(B : MySet = [1,2])');
   AssertFunc([],ccDefault,1);
   AssertFunc([],ccDefault,1);
@@ -537,7 +567,7 @@ begin
   AssertArg(ProcType,0,'B',argDefault,'Integer','1 + 2');
   AssertArg(ProcType,0,'B',argDefault,'Integer','1 + 2');
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionOneArgDefaultExpr;
+Procedure TTestProcedureFunction.TestFunctionOneArgDefaultExpr;
 begin
 begin
   ParseFunction('(B : Integer = 1 + 2)');
   ParseFunction('(B : Integer = 1 + 2)');
   AssertFunc([],ccDefault,1);
   AssertFunc([],ccDefault,1);
@@ -552,7 +582,7 @@ begin
   AssertArg(ProcType,1,'C',argDefault,'Integer','2');
   AssertArg(ProcType,1,'C',argDefault,'Integer','2');
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionTwoArgsDefault;
+Procedure TTestProcedureFunction.TestFunctionTwoArgsDefault;
 begin
 begin
   ParseFunction('(B : Integer = 1; C : Integer = 2)');
   ParseFunction('(B : Integer = 1; C : Integer = 2)');
   AssertFunc([],ccDefault,2);
   AssertFunc([],ccDefault,2);
@@ -567,7 +597,7 @@ begin
   AssertArg(ProcType,0,'B',argVar,'','');
   AssertArg(ProcType,0,'B',argVar,'','');
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionOneUntypedVarArg;
+Procedure TTestProcedureFunction.TestFunctionOneUntypedVarArg;
 begin
 begin
   ParseFunction('(Var B)');
   ParseFunction('(Var B)');
   AssertFunc([],ccDefault,1);
   AssertFunc([],ccDefault,1);
@@ -582,7 +612,7 @@ begin
   AssertArg(ProcType,1,'C',argVar,'','');
   AssertArg(ProcType,1,'C',argVar,'','');
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionTwoUntypedVarArgs;
+Procedure TTestProcedureFunction.TestFunctionTwoUntypedVarArgs;
 begin
 begin
   ParseFunction('(Var B; Var C)');
   ParseFunction('(Var B; Var C)');
   AssertFunc([],ccDefault,2);
   AssertFunc([],ccDefault,2);
@@ -597,7 +627,7 @@ begin
   AssertArg(ProcType,0,'B',argConst,'','');
   AssertArg(ProcType,0,'B',argConst,'','');
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionOneUntypedConstArg;
+Procedure TTestProcedureFunction.TestFunctionOneUntypedConstArg;
 begin
 begin
   ParseFunction('(Const B)');
   ParseFunction('(Const B)');
   AssertFunc([],ccDefault,1);
   AssertFunc([],ccDefault,1);
@@ -612,7 +642,7 @@ begin
   AssertArg(ProcType,1,'C',argConst,'','');
   AssertArg(ProcType,1,'C',argConst,'','');
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionTwoUntypedConstArgs;
+Procedure TTestProcedureFunction.TestFunctionTwoUntypedConstArgs;
 begin
 begin
   ParseFunction('(Const B; Const C)');
   ParseFunction('(Const B; Const C)');
   AssertFunc([],ccDefault,2);
   AssertFunc([],ccDefault,2);
@@ -627,7 +657,7 @@ begin
   AssertArrayArg(ProcType,0,'B',argDefault,'Integer');
   AssertArrayArg(ProcType,0,'B',argDefault,'Integer');
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionOpenArrayArg;
+Procedure TTestProcedureFunction.TestFunctionOpenArrayArg;
 begin
 begin
   ParseFunction('(B : Array of Integer)');
   ParseFunction('(B : Array of Integer)');
   AssertFunc([],ccDefault,1);
   AssertFunc([],ccDefault,1);
@@ -642,7 +672,7 @@ begin
   AssertArrayArg(ProcType,1,'C',argDefault,'Integer');
   AssertArrayArg(ProcType,1,'C',argDefault,'Integer');
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionTwoOpenArrayArgs;
+Procedure TTestProcedureFunction.TestFunctionTwoOpenArrayArgs;
 begin
 begin
   ParseFunction('(B : Array of Integer;C : Array of Integer)');
   ParseFunction('(B : Array of Integer;C : Array of Integer)');
   AssertFunc([],ccDefault,2);
   AssertFunc([],ccDefault,2);
@@ -657,7 +687,7 @@ begin
   AssertArrayArg(ProcType,0,'B',argConst,'Integer');
   AssertArrayArg(ProcType,0,'B',argConst,'Integer');
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionConstOpenArrayArg;
+Procedure TTestProcedureFunction.TestFunctionConstOpenArrayArg;
 begin
 begin
   ParseFunction('(Const B : Array of Integer)');
   ParseFunction('(Const B : Array of Integer)');
   AssertFunc([],ccDefault,1);
   AssertFunc([],ccDefault,1);
@@ -671,7 +701,7 @@ begin
   AssertArrayArg(ProcType,0,'B',argVar,'Integer');
   AssertArrayArg(ProcType,0,'B',argVar,'Integer');
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionVarOpenArrayArg;
+Procedure TTestProcedureFunction.TestFunctionVarOpenArrayArg;
 begin
 begin
   ParseFunction('(Var B : Array of Integer)');
   ParseFunction('(Var B : Array of Integer)');
   AssertFunc([],ccDefault,1);
   AssertFunc([],ccDefault,1);
@@ -685,7 +715,7 @@ begin
   AssertArrayArg(ProcType,0,'B',argDefault,'');
   AssertArrayArg(ProcType,0,'B',argDefault,'');
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionArrayOfConstArg;
+Procedure TTestProcedureFunction.TestFunctionArrayOfConstArg;
 begin
 begin
   ParseFunction('(B : Array of Const)');
   ParseFunction('(B : Array of Const)');
   AssertFunc([],ccDefault,1);
   AssertFunc([],ccDefault,1);
@@ -699,100 +729,100 @@ begin
   AssertArrayArg(ProcType,0,'B',argConst,'');
   AssertArrayArg(ProcType,0,'B',argConst,'');
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionConstArrayOfConstArg;
+Procedure TTestProcedureFunction.TestFunctionConstArrayOfConstArg;
 begin
 begin
   ParseFunction('(Const B : Array of Const)');
   ParseFunction('(Const B : Array of Const)');
   AssertFunc([],ccDefault,1);
   AssertFunc([],ccDefault,1);
   AssertArrayArg(FuncType,0,'B',argConst,'');
   AssertArrayArg(FuncType,0,'B',argConst,'');
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestProcedureCdecl;
+Procedure TTestProcedureFunction.TestProcedureCdecl;
 begin
 begin
   ParseProcedure('; cdecl');
   ParseProcedure('; cdecl');
   AssertProc([],ccCdecl,0);
   AssertProc([],ccCdecl,0);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionCdecl;
+Procedure TTestProcedureFunction.TestFunctionCdecl;
 begin
 begin
   ParseFunction('','','',ccCdecl);
   ParseFunction('','','',ccCdecl);
   AssertFunc([],ccCdecl,0);
   AssertFunc([],ccCdecl,0);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestProcedureCdeclDeprecated;
+Procedure TTestProcedureFunction.TestProcedureCdeclDeprecated;
 begin
 begin
   ParseProcedure('; cdecl;','deprecated');
   ParseProcedure('; cdecl;','deprecated');
   AssertProc([],ccCdecl,0);
   AssertProc([],ccCdecl,0);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionCdeclDeprecated;
+Procedure TTestProcedureFunction.TestFunctionCdeclDeprecated;
 begin
 begin
   ParseFunction('','','deprecated',ccCdecl);
   ParseFunction('','','deprecated',ccCdecl);
   AssertFunc([],ccCdecl,0);
   AssertFunc([],ccCdecl,0);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestProcedureSafeCall;
+Procedure TTestProcedureFunction.TestProcedureSafeCall;
 begin
 begin
   ParseProcedure('; safecall;','');
   ParseProcedure('; safecall;','');
   AssertProc([],ccSafeCall,0);
   AssertProc([],ccSafeCall,0);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionSafeCall;
+Procedure TTestProcedureFunction.TestFunctionSafeCall;
 begin
 begin
   ParseFunction('','','',ccSafecall);
   ParseFunction('','','',ccSafecall);
   AssertFunc([],ccSafecall,0);
   AssertFunc([],ccSafecall,0);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestProcedurePascal;
+Procedure TTestProcedureFunction.TestProcedurePascal;
 begin
 begin
   ParseProcedure('; pascal;','');
   ParseProcedure('; pascal;','');
   AssertProc([],ccPascal,0);
   AssertProc([],ccPascal,0);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionPascal;
+Procedure TTestProcedureFunction.TestFunctionPascal;
 begin
 begin
   ParseFunction('','','',ccPascal);
   ParseFunction('','','',ccPascal);
   AssertFunc([],ccPascal,0);
   AssertFunc([],ccPascal,0);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestProcedureStdCall;
+Procedure TTestProcedureFunction.TestProcedureStdCall;
 begin
 begin
   ParseProcedure('; stdcall;','');
   ParseProcedure('; stdcall;','');
   AssertProc([],ccstdcall,0);
   AssertProc([],ccstdcall,0);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionStdCall;
+Procedure TTestProcedureFunction.TestFunctionStdCall;
 begin
 begin
   ParseFunction('','','',ccStdCall);
   ParseFunction('','','',ccStdCall);
   AssertFunc([],ccStdCall,0);
   AssertFunc([],ccStdCall,0);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestProcedureOldFPCCall;
+Procedure TTestProcedureFunction.TestProcedureOldFPCCall;
 begin
 begin
   ParseProcedure('; oldfpccall;','');
   ParseProcedure('; oldfpccall;','');
   AssertProc([],ccoldfpccall,0);
   AssertProc([],ccoldfpccall,0);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionOldFPCCall;
+Procedure TTestProcedureFunction.TestFunctionOldFPCCall;
 begin
 begin
   ParseFunction('','','',ccOldFPCCall);
   ParseFunction('','','',ccOldFPCCall);
   AssertFunc([],ccOldFPCCall,0);
   AssertFunc([],ccOldFPCCall,0);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestProcedurePublic;
+Procedure TTestProcedureFunction.TestProcedurePublic;
 begin
 begin
   ParseProcedure('; public name ''myfunc'';','');
   ParseProcedure('; public name ''myfunc'';','');
   AssertProc([pmPublic],ccDefault,0);
   AssertProc([pmPublic],ccDefault,0);
   AssertExpression('Public name',Proc.PublicName,pekString,'''myfunc''');
   AssertExpression('Public name',Proc.PublicName,pekString,'''myfunc''');
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestProcedurePublicIdent;
+Procedure TTestProcedureFunction.TestProcedurePublicIdent;
 begin
 begin
   ParseProcedure('; public name exportname;','');
   ParseProcedure('; public name exportname;','');
   AssertProc([pmPublic],ccDefault,0);
   AssertProc([pmPublic],ccDefault,0);
   AssertExpression('Public name',Proc.PublicName,pekIdent,'exportname');
   AssertExpression('Public name',Proc.PublicName,pekIdent,'exportname');
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionPublic;
+Procedure TTestProcedureFunction.TestFunctionPublic;
 begin
 begin
   AddDeclaration('function A : Integer; public name exportname');
   AddDeclaration('function A : Integer; public name exportname');
   ParseFunction;
   ParseFunction;
@@ -800,14 +830,14 @@ begin
   AssertExpression('Public name',Func.PublicName,pekIdent,'exportname');
   AssertExpression('Public name',Func.PublicName,pekIdent,'exportname');
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestProcedureCdeclPublic;
+Procedure TTestProcedureFunction.TestProcedureCdeclPublic;
 begin
 begin
   ParseProcedure('; cdecl; public name exportname;','');
   ParseProcedure('; cdecl; public name exportname;','');
   AssertProc([pmPublic],ccCDecl,0);
   AssertProc([pmPublic],ccCDecl,0);
   AssertExpression('Public name',Proc.PublicName,pekIdent,'exportname');
   AssertExpression('Public name',Proc.PublicName,pekIdent,'exportname');
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionCdeclPublic;
+Procedure TTestProcedureFunction.TestFunctionCdeclPublic;
 begin
 begin
   AddDeclaration('function A : Integer; cdecl; public name exportname');
   AddDeclaration('function A : Integer; cdecl; public name exportname');
   ParseFunction;
   ParseFunction;
@@ -815,58 +845,58 @@ begin
   AssertExpression('Public name',Func.PublicName,pekIdent,'exportname');
   AssertExpression('Public name',Func.PublicName,pekIdent,'exportname');
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestProcedureOverload;
+Procedure TTestProcedureFunction.TestProcedureOverload;
 begin
 begin
   ParseProcedure('; overload;','');
   ParseProcedure('; overload;','');
   AssertProc([pmOverload],ccDefault,0);
   AssertProc([pmOverload],ccDefault,0);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionOverload;
+Procedure TTestProcedureFunction.TestFunctionOverload;
 begin
 begin
   AddDeclaration('function A : Integer; overload');
   AddDeclaration('function A : Integer; overload');
   ParseFunction;
   ParseFunction;
   AssertFunc([pmOverload],ccDefault,0);
   AssertFunc([pmOverload],ccDefault,0);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestProcedureVarargs;
+Procedure TTestProcedureFunction.TestProcedureVarargs;
 begin
 begin
   ParseProcedure('; varargs;','');
   ParseProcedure('; varargs;','');
   AssertProc([pmVarArgs],ccDefault,0);
   AssertProc([pmVarArgs],ccDefault,0);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionVarArgs;
+Procedure TTestProcedureFunction.TestFunctionVarArgs;
 begin
 begin
   AddDeclaration('function A : Integer; varargs');
   AddDeclaration('function A : Integer; varargs');
   ParseFunction;
   ParseFunction;
   AssertFunc([pmVarArgs],ccDefault,0);
   AssertFunc([pmVarArgs],ccDefault,0);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestProcedureCDeclVarargs;
+Procedure TTestProcedureFunction.TestProcedureCDeclVarargs;
 begin
 begin
   ParseProcedure(';cdecl; varargs;','');
   ParseProcedure(';cdecl; varargs;','');
   AssertProc([pmVarArgs],ccCDecl,0);
   AssertProc([pmVarArgs],ccCDecl,0);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionCDeclVarArgs;
+Procedure TTestProcedureFunction.TestFunctionCDeclVarArgs;
 begin
 begin
   AddDeclaration('function A : Integer; cdecl; varargs');
   AddDeclaration('function A : Integer; cdecl; varargs');
   ParseFunction;
   ParseFunction;
   AssertFunc([pmVarArgs],ccCdecl,0);
   AssertFunc([pmVarArgs],ccCdecl,0);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestProcedureForwardInterface;
+Procedure TTestProcedureFunction.TestProcedureForwardInterface;
 begin
 begin
   AddDeclaration('procedure A; forward;');
   AddDeclaration('procedure A; forward;');
   AssertException(EParserError,@ParseProcedure);
   AssertException(EParserError,@ParseProcedure);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionForwardInterface;
+Procedure TTestProcedureFunction.TestFunctionForwardInterface;
 begin
 begin
   AddDeclaration('function A : integer; forward;');
   AddDeclaration('function A : integer; forward;');
   AssertException(EParserError,@ParseFunction);
   AssertException(EParserError,@ParseFunction);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestProcedureForward;
+Procedure TTestProcedureFunction.TestProcedureForward;
 begin
 begin
   UseImplementation:=True;
   UseImplementation:=True;
   AddDeclaration('procedure A; forward;');
   AddDeclaration('procedure A; forward;');
@@ -874,7 +904,7 @@ begin
   AssertProc([pmforward],ccDefault,0);
   AssertProc([pmforward],ccDefault,0);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionForward;
+Procedure TTestProcedureFunction.TestFunctionForward;
 begin
 begin
   UseImplementation:=True;
   UseImplementation:=True;
   AddDeclaration('function A : integer; forward;');
   AddDeclaration('function A : integer; forward;');
@@ -882,7 +912,7 @@ begin
   AssertFunc([pmforward],ccDefault,0);
   AssertFunc([pmforward],ccDefault,0);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestProcedureCdeclForward;
+Procedure TTestProcedureFunction.TestProcedureCdeclForward;
 begin
 begin
   UseImplementation:=True;
   UseImplementation:=True;
   AddDeclaration('procedure A; cdecl; forward;');
   AddDeclaration('procedure A; cdecl; forward;');
@@ -890,7 +920,7 @@ begin
   AssertProc([pmforward],ccCDecl,0);
   AssertProc([pmforward],ccCDecl,0);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionCDeclForward;
+Procedure TTestProcedureFunction.TestFunctionCDeclForward;
 begin
 begin
   UseImplementation:=True;
   UseImplementation:=True;
   AddDeclaration('function A : integer; cdecl; forward;');
   AddDeclaration('function A : integer; cdecl; forward;');
@@ -898,92 +928,92 @@ begin
   AssertFunc([pmforward],ccCDecl,0);
   AssertFunc([pmforward],ccCDecl,0);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestProcedureCompilerProc;
+Procedure TTestProcedureFunction.TestProcedureCompilerProc;
 begin
 begin
   ParseProcedure(';compilerproc;','');
   ParseProcedure(';compilerproc;','');
   AssertProc([pmCompilerProc],ccDefault,0);
   AssertProc([pmCompilerProc],ccDefault,0);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionCompilerProc;
+Procedure TTestProcedureFunction.TestFunctionCompilerProc;
 begin
 begin
   AddDeclaration('function A : Integer; compilerproc');
   AddDeclaration('function A : Integer; compilerproc');
   ParseFunction;
   ParseFunction;
   AssertFunc([pmCompilerProc],ccDefault,0);
   AssertFunc([pmCompilerProc],ccDefault,0);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestProcedureCDeclCompilerProc;
+Procedure TTestProcedureFunction.TestProcedureCDeclCompilerProc;
 begin
 begin
   ParseProcedure(';cdecl;compilerproc;','');
   ParseProcedure(';cdecl;compilerproc;','');
   AssertProc([pmCompilerProc],ccCDecl,0);
   AssertProc([pmCompilerProc],ccCDecl,0);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionCDeclCompilerProc;
+Procedure TTestProcedureFunction.TestFunctionCDeclCompilerProc;
 begin
 begin
   AddDeclaration('function A : Integer; cdecl; compilerproc');
   AddDeclaration('function A : Integer; cdecl; compilerproc');
   ParseFunction;
   ParseFunction;
   AssertFunc([pmCompilerProc],ccCDecl,0);
   AssertFunc([pmCompilerProc],ccCDecl,0);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestProcedureAssembler;
+Procedure TTestProcedureFunction.TestProcedureAssembler;
 begin
 begin
   ParseProcedure(';assembler;','');
   ParseProcedure(';assembler;','');
   AssertProc([pmAssembler],ccDefault,0);
   AssertProc([pmAssembler],ccDefault,0);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionAssembler;
+Procedure TTestProcedureFunction.TestFunctionAssembler;
 begin
 begin
   AddDeclaration('function A : Integer; assembler');
   AddDeclaration('function A : Integer; assembler');
   ParseFunction;
   ParseFunction;
   AssertFunc([pmAssembler],ccDefault,0);
   AssertFunc([pmAssembler],ccDefault,0);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestProcedureCDeclAssembler;
+Procedure TTestProcedureFunction.TestProcedureCDeclAssembler;
 begin
 begin
   ParseProcedure(';cdecl;assembler;','');
   ParseProcedure(';cdecl;assembler;','');
   AssertProc([pmAssembler],ccCDecl,0);
   AssertProc([pmAssembler],ccCDecl,0);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionCDeclAssembler;
+Procedure TTestProcedureFunction.TestFunctionCDeclAssembler;
 begin
 begin
   AddDeclaration('function A : Integer; cdecl; assembler');
   AddDeclaration('function A : Integer; cdecl; assembler');
   ParseFunction;
   ParseFunction;
   AssertFunc([pmAssembler],ccCDecl,0);
   AssertFunc([pmAssembler],ccCDecl,0);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestProcedureExport;
+Procedure TTestProcedureFunction.TestProcedureExport;
 begin
 begin
   ParseProcedure(';export;','');
   ParseProcedure(';export;','');
   AssertProc([pmExport],ccDefault,0);
   AssertProc([pmExport],ccDefault,0);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionExport;
+Procedure TTestProcedureFunction.TestFunctionExport;
 begin
 begin
   AddDeclaration('function A : Integer; export');
   AddDeclaration('function A : Integer; export');
   ParseFunction;
   ParseFunction;
   AssertFunc([pmExport],ccDefault,0);
   AssertFunc([pmExport],ccDefault,0);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestProcedureCDeclExport;
+Procedure TTestProcedureFunction.TestProcedureCDeclExport;
 begin
 begin
   ParseProcedure('cdecl;export;','');
   ParseProcedure('cdecl;export;','');
   AssertProc([pmExport],ccCDecl,0);
   AssertProc([pmExport],ccCDecl,0);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionCDeclExport;
+Procedure TTestProcedureFunction.TestFunctionCDeclExport;
 begin
 begin
   AddDeclaration('function A : Integer; cdecl; export');
   AddDeclaration('function A : Integer; cdecl; export');
   ParseFunction;
   ParseFunction;
   AssertFunc([pmExport],ccCDecl,0);
   AssertFunc([pmExport],ccCDecl,0);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestProcedureExternal;
+Procedure TTestProcedureFunction.TestProcedureExternal;
 begin
 begin
   ParseProcedure(';external','');
   ParseProcedure(';external','');
   AssertProc([pmExternal],ccDefault,0);
   AssertProc([pmExternal],ccDefault,0);
   AssertNull('No Library name expression',Proc.LibraryExpr);
   AssertNull('No Library name expression',Proc.LibraryExpr);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionExternal;
+Procedure TTestProcedureFunction.TestFunctionExternal;
 begin
 begin
   AddDeclaration('function A : Integer; external');
   AddDeclaration('function A : Integer; external');
   ParseFunction;
   ParseFunction;
@@ -991,14 +1021,14 @@ begin
   AssertNull('No Library name expression',Func.LibraryExpr);
   AssertNull('No Library name expression',Func.LibraryExpr);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestProcedureExternalLibName;
+Procedure TTestProcedureFunction.TestProcedureExternalLibName;
 begin
 begin
   ParseProcedure(';external ''libname''','');
   ParseProcedure(';external ''libname''','');
   AssertProc([pmExternal],ccDefault,0);
   AssertProc([pmExternal],ccDefault,0);
   AssertExpression('Library name expression',Proc.LibraryExpr,pekString,'''libname''');
   AssertExpression('Library name expression',Proc.LibraryExpr,pekString,'''libname''');
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionExternalLibName;
+Procedure TTestProcedureFunction.TestFunctionExternalLibName;
 begin
 begin
   AddDeclaration('function A : Integer; external ''libname''');
   AddDeclaration('function A : Integer; external ''libname''');
   ParseFunction;
   ParseFunction;
@@ -1006,7 +1036,7 @@ begin
   AssertExpression('Library name expression',Func.LibraryExpr,pekString,'''libname''');
   AssertExpression('Library name expression',Func.LibraryExpr,pekString,'''libname''');
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestProcedureExternalLibNameName;
+Procedure TTestProcedureFunction.TestProcedureExternalLibNameName;
 begin
 begin
   ParseProcedure(';external ''libname'' name ''symbolname''','');
   ParseProcedure(';external ''libname'' name ''symbolname''','');
   AssertProc([pmExternal],ccDefault,0);
   AssertProc([pmExternal],ccDefault,0);
@@ -1014,7 +1044,7 @@ begin
   AssertExpression('Library symbol expression',Proc.LibrarySymbolName,pekString,'''symbolname''');
   AssertExpression('Library symbol expression',Proc.LibrarySymbolName,pekString,'''symbolname''');
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionExternalLibNameName;
+Procedure TTestProcedureFunction.TestFunctionExternalLibNameName;
 begin
 begin
   AddDeclaration('function A : Integer; external ''libname'' name ''symbolname''');
   AddDeclaration('function A : Integer; external ''libname'' name ''symbolname''');
   ParseFunction;
   ParseFunction;
@@ -1023,7 +1053,7 @@ begin
   AssertExpression('Library symbol expression',Func.LibrarySymbolName,pekString,'''symbolname''');
   AssertExpression('Library symbol expression',Func.LibrarySymbolName,pekString,'''symbolname''');
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestProcedureExternalName;
+Procedure TTestProcedureFunction.TestProcedureExternalName;
 begin
 begin
   ParseProcedure(';external name ''symbolname''','');
   ParseProcedure(';external name ''symbolname''','');
   AssertProc([pmExternal],ccDefault,0);
   AssertProc([pmExternal],ccDefault,0);
@@ -1031,7 +1061,7 @@ begin
   AssertExpression('Library symbol expression',Proc.LibrarySymbolName,pekString,'''symbolname''');
   AssertExpression('Library symbol expression',Proc.LibrarySymbolName,pekString,'''symbolname''');
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionExternalName;
+Procedure TTestProcedureFunction.TestFunctionExternalName;
 begin
 begin
   AddDeclaration('function A : Integer; external name ''symbolname''');
   AddDeclaration('function A : Integer; external name ''symbolname''');
   ParseFunction;
   ParseFunction;
@@ -1040,14 +1070,14 @@ begin
   AssertExpression('Library symbol expression',Func.LibrarySymbolName,pekString,'''symbolname''');
   AssertExpression('Library symbol expression',Func.LibrarySymbolName,pekString,'''symbolname''');
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestProcedureCdeclExternal;
+Procedure TTestProcedureFunction.TestProcedureCdeclExternal;
 begin
 begin
   ParseProcedure('; cdecl; external','');
   ParseProcedure('; cdecl; external','');
   AssertProc([pmExternal],ccCdecl,0);
   AssertProc([pmExternal],ccCdecl,0);
   AssertNull('No Library name expression',Proc.LibraryExpr);
   AssertNull('No Library name expression',Proc.LibraryExpr);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionCdeclExternal;
+Procedure TTestProcedureFunction.TestFunctionCdeclExternal;
 begin
 begin
   AddDeclaration('function A : Integer; cdecl; external');
   AddDeclaration('function A : Integer; cdecl; external');
   ParseFunction;
   ParseFunction;
@@ -1055,14 +1085,14 @@ begin
   AssertNull('No Library name expression',Func.LibraryExpr);
   AssertNull('No Library name expression',Func.LibraryExpr);
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestProcedureCdeclExternalLibName;
+Procedure TTestProcedureFunction.TestProcedureCdeclExternalLibName;
 begin
 begin
   ParseProcedure('; cdecl; external ''libname''','');
   ParseProcedure('; cdecl; external ''libname''','');
   AssertProc([pmExternal],ccCdecl,0);
   AssertProc([pmExternal],ccCdecl,0);
   AssertExpression('Library name expression',Proc.LibraryExpr,pekString,'''libname''');
   AssertExpression('Library name expression',Proc.LibraryExpr,pekString,'''libname''');
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionCdeclExternalLibName;
+Procedure TTestProcedureFunction.TestFunctionCdeclExternalLibName;
 begin
 begin
   AddDeclaration('function A : Integer; cdecl; external ''libname''');
   AddDeclaration('function A : Integer; cdecl; external ''libname''');
   ParseFunction;
   ParseFunction;
@@ -1070,7 +1100,7 @@ begin
   AssertExpression('Library name expression',Func.LibraryExpr,pekString,'''libname''');
   AssertExpression('Library name expression',Func.LibraryExpr,pekString,'''libname''');
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestProcedureCdeclExternalLibNameName;
+Procedure TTestProcedureFunction.TestProcedureCdeclExternalLibNameName;
 begin
 begin
   ParseProcedure('; cdecl; external ''libname'' name ''symbolname''','');
   ParseProcedure('; cdecl; external ''libname'' name ''symbolname''','');
   AssertProc([pmExternal],ccCdecl,0);
   AssertProc([pmExternal],ccCdecl,0);
@@ -1078,7 +1108,7 @@ begin
   AssertExpression('Library symbol expression',Proc.LibrarySymbolName,pekString,'''symbolname''');
   AssertExpression('Library symbol expression',Proc.LibrarySymbolName,pekString,'''symbolname''');
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionCdeclExternalLibNameName;
+Procedure TTestProcedureFunction.TestFunctionCdeclExternalLibNameName;
 begin
 begin
   AddDeclaration('function A : Integer; cdecl; external ''libname'' name ''symbolname''');
   AddDeclaration('function A : Integer; cdecl; external ''libname'' name ''symbolname''');
   ParseFunction;
   ParseFunction;
@@ -1087,7 +1117,7 @@ begin
   AssertExpression('Library symbol expression',Func.LibrarySymbolName,pekString,'''symbolname''');
   AssertExpression('Library symbol expression',Func.LibrarySymbolName,pekString,'''symbolname''');
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestProcedureCdeclExternalName;
+Procedure TTestProcedureFunction.TestProcedureCdeclExternalName;
 begin
 begin
   ParseProcedure('; cdecl; external name ''symbolname''','');
   ParseProcedure('; cdecl; external name ''symbolname''','');
   AssertProc([pmExternal],ccCdecl,0);
   AssertProc([pmExternal],ccCdecl,0);
@@ -1095,7 +1125,7 @@ begin
   AssertExpression('Library symbol expression',Proc.LibrarySymbolName,pekString,'''symbolname''');
   AssertExpression('Library symbol expression',Proc.LibrarySymbolName,pekString,'''symbolname''');
 end;
 end;
 
 
-procedure TTestProcedureFunction.TestFunctionCdeclExternalName;
+Procedure TTestProcedureFunction.TestFunctionCdeclExternalName;
 begin
 begin
   AddDeclaration('function A : Integer; cdecl; external name ''symbolname''');
   AddDeclaration('function A : Integer; cdecl; external name ''symbolname''');
   ParseFunction;
   ParseFunction;
@@ -1114,6 +1144,11 @@ begin
    Inherited;
    Inherited;
 end;
 end;
 
 
+Procedure TTestProcedureFunction.AssertComment;
+begin
+  AssertEquals('Correct comment',' A comment'+sLineBreak,FProc.DocComment);
+end;
+
 initialization
 initialization
 
 
   RegisterTest(TTestProcedureFunction);
   RegisterTest(TTestProcedureFunction);

+ 116 - 67
packages/fcl-passrc/tests/tcstatements.pas

@@ -31,12 +31,15 @@ Type
     Procedure TestEmptyStatement;
     Procedure TestEmptyStatement;
     Procedure TestEmptyStatements;
     Procedure TestEmptyStatements;
     Procedure TestBlock;
     Procedure TestBlock;
+    Procedure TestBlockComment;
+    Procedure TestBlock2Comments;
     Procedure TestAssignment;
     Procedure TestAssignment;
     Procedure TestAssignmentAdd;
     Procedure TestAssignmentAdd;
     Procedure TestAssignmentMinus;
     Procedure TestAssignmentMinus;
     Procedure TestAssignmentMul;
     Procedure TestAssignmentMul;
     Procedure TestAssignmentDivision;
     Procedure TestAssignmentDivision;
     Procedure TestCall;
     Procedure TestCall;
+    Procedure TestCallComment;
     Procedure TestCallQualified;
     Procedure TestCallQualified;
     Procedure TestCallQualified2;
     Procedure TestCallQualified2;
     Procedure TestCallNoArgs;
     Procedure TestCallNoArgs;
@@ -95,19 +98,19 @@ implementation
 
 
 { TTestStatementParser }
 { TTestStatementParser }
 
 
-procedure TTestStatementParser.SetUp;
+Procedure TTestStatementParser.SetUp;
 begin
 begin
   inherited SetUp;
   inherited SetUp;
   FVariables:=TStringList.Create;
   FVariables:=TStringList.Create;
 end;
 end;
 
 
-procedure TTestStatementParser.TearDown;
+Procedure TTestStatementParser.TearDown;
 begin
 begin
   FreeAndNil(FVariables);
   FreeAndNil(FVariables);
   inherited TearDown;
   inherited TearDown;
 end;
 end;
 
 
-procedure TTestStatementParser.AddStatements(ASource: array of string);
+procedure TTestStatementParser.AddStatements(ASource: Array of string);
 
 
 Var
 Var
   I :Integer;
   I :Integer;
@@ -124,8 +127,8 @@ begin
     Add('  '+ASource[i]);
     Add('  '+ASource[i]);
 end;
 end;
 
 
-procedure TTestStatementParser.DeclareVar(const AVarType: String;
-  const AVarName: String);
+Procedure TTestStatementParser.DeclareVar(Const AVarType: String;
+  Const AVarName: String);
 begin
 begin
   FVariables.Add(AVarName+' : '+AVarType+';');
   FVariables.Add(AVarName+' : '+AVarType+';');
 end;
 end;
@@ -135,7 +138,8 @@ begin
   Result:=TestStatement([ASource]);
   Result:=TestStatement([ASource]);
 end;
 end;
 
 
-function TTestStatementParser.TestStatement(ASource: array of string): TPasImplElement;
+function TTestStatementParser.TestStatement(ASource: Array of string
+  ): TPasImplElement;
 
 
 
 
 begin
 begin
@@ -152,19 +156,19 @@ begin
   Result:=FStatement;
   Result:=FStatement;
 end;
 end;
 
 
-procedure TTestStatementParser.ExpectParserError(Const Msg : string);
+Procedure TTestStatementParser.ExpectParserError(Const Msg: string);
 begin
 begin
   AssertException(Msg,EParserError,@ParseModule);
   AssertException(Msg,EParserError,@ParseModule);
 end;
 end;
 
 
-procedure TTestStatementParser.ExpectParserError(const Msg: string;
-  ASource: array of string);
+Procedure TTestStatementParser.ExpectParserError(Const Msg: string;
+  ASource: Array of string);
 begin
 begin
   AddStatements(ASource);
   AddStatements(ASource);
   ExpectParserError(Msg);
   ExpectParserError(Msg);
 end;
 end;
 
 
-function TTestStatementParser.AssertStatement(Msg: String; AClass: TClass;
+Function TTestStatementParser.AssertStatement(Msg: String; AClass: TClass;
   AIndex: Integer): TPasImplBlock;
   AIndex: Integer): TPasImplBlock;
 begin
 begin
   if not (AIndex<PasProgram.InitializationSection.Elements.Count) then
   if not (AIndex<PasProgram.InitializationSection.Elements.Count) then
@@ -174,26 +178,26 @@ begin
   Result:=TObject(PasProgram.InitializationSection.Elements[AIndex]) as TPasImplBlock;
   Result:=TObject(PasProgram.InitializationSection.Elements[AIndex]) as TPasImplBlock;
 end;
 end;
 
 
-procedure TTestStatementParser.TestEmpty;
+Procedure TTestStatementParser.TestEmpty;
 begin
 begin
   //TestStatement(';');
   //TestStatement(';');
   TestStatement('');
   TestStatement('');
   AssertEquals('No statements',0,PasProgram.InitializationSection.Elements.Count);
   AssertEquals('No statements',0,PasProgram.InitializationSection.Elements.Count);
 end;
 end;
 
 
-procedure TTestStatementParser.TestEmptyStatement;
+Procedure TTestStatementParser.TestEmptyStatement;
 begin
 begin
   TestStatement(';');
   TestStatement(';');
   AssertEquals('0 statement',0,PasProgram.InitializationSection.Elements.Count);
   AssertEquals('0 statement',0,PasProgram.InitializationSection.Elements.Count);
 end;
 end;
 
 
-procedure TTestStatementParser.TestEmptyStatements;
+Procedure TTestStatementParser.TestEmptyStatements;
 begin
 begin
   TestStatement(';;');
   TestStatement(';;');
   AssertEquals('0 statement',0,PasProgram.InitializationSection.Elements.Count);
   AssertEquals('0 statement',0,PasProgram.InitializationSection.Elements.Count);
 end;
 end;
 
 
-procedure TTestStatementParser.TestBlock;
+Procedure TTestStatementParser.TestBlock;
 
 
 Var
 Var
   B : TPasImplBeginBlock;
   B : TPasImplBeginBlock;
@@ -207,7 +211,37 @@ begin
   AssertEquals('Empty block',0,B.Elements.Count);
   AssertEquals('Empty block',0,B.Elements.Count);
 end;
 end;
 
 
-procedure TTestStatementParser.TestAssignment;
+Procedure TTestStatementParser.TestBlockComment;
+Var
+  B : TPasImplBeginBlock;
+
+begin
+  Engine.NeedComments:=True;
+  TestStatement(['{ This is a comment }','begin','end']);
+  AssertEquals('1 statement',1,PasProgram.InitializationSection.Elements.Count);
+  AssertNotNull('Statement assigned',PasProgram.InitializationSection.Elements[0]);
+  AssertEquals('Block statement',TPasImplBeginBlock,Statement.ClassType);
+  B:= Statement as TPasImplBeginBlock;
+  AssertEquals('Empty block',0,B.Elements.Count);
+  AssertEquals('No DocComment','',B.DocComment);
+end;
+
+Procedure TTestStatementParser.TestBlock2Comments;
+Var
+  B : TPasImplBeginBlock;
+
+begin
+  Engine.NeedComments:=True;
+  TestStatement(['{ This is a comment }','// Another comment','begin','end']);
+  AssertEquals('1 statement',1,PasProgram.InitializationSection.Elements.Count);
+  AssertNotNull('Statement assigned',PasProgram.InitializationSection.Elements[0]);
+  AssertEquals('Block statement',TPasImplBeginBlock,Statement.ClassType);
+  B:= Statement as TPasImplBeginBlock;
+  AssertEquals('Empty block',0,B.Elements.Count);
+  AssertEquals('No DocComment','',B.DocComment);
+end;
+
+Procedure TTestStatementParser.TestAssignment;
 
 
 Var
 Var
   A : TPasImplAssign;
   A : TPasImplAssign;
@@ -223,7 +257,7 @@ begin
   AssertExpression('Left side is variable',A.Left,pekIdent,'a');
   AssertExpression('Left side is variable',A.Left,pekIdent,'a');
 end;
 end;
 
 
-procedure TTestStatementParser.TestAssignmentAdd;
+Procedure TTestStatementParser.TestAssignmentAdd;
 
 
 Var
 Var
   A : TPasImplAssign;
   A : TPasImplAssign;
@@ -240,7 +274,7 @@ begin
   AssertExpression('Left side is variable',A.Left,pekIdent,'a');
   AssertExpression('Left side is variable',A.Left,pekIdent,'a');
 end;
 end;
 
 
-procedure TTestStatementParser.TestAssignmentMinus;
+Procedure TTestStatementParser.TestAssignmentMinus;
 Var
 Var
   A : TPasImplAssign;
   A : TPasImplAssign;
 
 
@@ -256,7 +290,7 @@ begin
   AssertExpression('Left side is variable',A.Left,pekIdent,'a');
   AssertExpression('Left side is variable',A.Left,pekIdent,'a');
 end;
 end;
 
 
-procedure TTestStatementParser.TestAssignmentMul;
+Procedure TTestStatementParser.TestAssignmentMul;
 Var
 Var
   A : TPasImplAssign;
   A : TPasImplAssign;
 
 
@@ -272,7 +306,7 @@ begin
   AssertExpression('Left side is variable',A.Left,pekIdent,'a');
   AssertExpression('Left side is variable',A.Left,pekIdent,'a');
 end;
 end;
 
 
-procedure TTestStatementParser.TestAssignmentDivision;
+Procedure TTestStatementParser.TestAssignmentDivision;
 Var
 Var
   A : TPasImplAssign;
   A : TPasImplAssign;
 
 
@@ -288,7 +322,7 @@ begin
   AssertExpression('Left side is variable',A.Left,pekIdent,'a');
   AssertExpression('Left side is variable',A.Left,pekIdent,'a');
 end;
 end;
 
 
-procedure TTestStatementParser.TestCall;
+Procedure TTestStatementParser.TestCall;
 
 
 Var
 Var
   S : TPasImplSimple;
   S : TPasImplSimple;
@@ -301,7 +335,22 @@ begin
   AssertExpression('Doit call',S.Expr,pekIdent,'Doit');
   AssertExpression('Doit call',S.Expr,pekIdent,'Doit');
 end;
 end;
 
 
-procedure TTestStatementParser.TestCallQualified;
+Procedure TTestStatementParser.TestCallComment;
+
+Var
+  S : TPasImplSimple;
+begin
+  Engine.NeedComments:=True;
+  TestStatement(['//comment line','Doit;']);
+  AssertEquals('1 statement',1,PasProgram.InitializationSection.Elements.Count);
+  AssertEquals('Simple statement',TPasImplSimple,Statement.ClassType);
+  AssertEquals('1 statement',1,PasProgram.InitializationSection.Elements.Count);
+  S:=Statement as TPasImplSimple;
+  AssertExpression('Doit call',S.Expr,pekIdent,'Doit');
+  AssertEquals('No DocComment','',S.DocComment);
+end;
+
+Procedure TTestStatementParser.TestCallQualified;
 
 
 Var
 Var
   S : TPasImplSimple;
   S : TPasImplSimple;
@@ -319,7 +368,7 @@ begin
 
 
 end;
 end;
 
 
-procedure TTestStatementParser.TestCallQualified2;
+Procedure TTestStatementParser.TestCallQualified2;
 Var
 Var
   S : TPasImplSimple;
   S : TPasImplSimple;
   B : TBinaryExpr;
   B : TBinaryExpr;
@@ -338,7 +387,7 @@ begin
   AssertExpression('Doit call',B.Right,pekIdent,'Doit');
   AssertExpression('Doit call',B.Right,pekIdent,'Doit');
 end;
 end;
 
 
-procedure TTestStatementParser.TestCallNoArgs;
+Procedure TTestStatementParser.TestCallNoArgs;
 
 
 Var
 Var
   S : TPasImplSimple;
   S : TPasImplSimple;
@@ -355,7 +404,7 @@ begin
   AssertEquals('No params',0,Length(P.Params));
   AssertEquals('No params',0,Length(P.Params));
 end;
 end;
 
 
-procedure TTestStatementParser.TestCallOneArg;
+Procedure TTestStatementParser.TestCallOneArg;
 Var
 Var
   S : TPasImplSimple;
   S : TPasImplSimple;
   P : TParamsExpr;
   P : TParamsExpr;
@@ -372,7 +421,7 @@ begin
   AssertExpression('Parameter is constant',P.Params[0],pekNumber,'1');
   AssertExpression('Parameter is constant',P.Params[0],pekNumber,'1');
 end;
 end;
 
 
-procedure TTestStatementParser.TestIf;
+Procedure TTestStatementParser.TestIf;
 
 
 Var
 Var
   I : TPasImplIfElse;
   I : TPasImplIfElse;
@@ -386,7 +435,7 @@ begin
   AssertNull('No if branch',I.IfBranch);
   AssertNull('No if branch',I.IfBranch);
 end;
 end;
 
 
-procedure TTestStatementParser.TestIfBlock;
+Procedure TTestStatementParser.TestIfBlock;
 
 
 Var
 Var
   I : TPasImplIfElse;
   I : TPasImplIfElse;
@@ -401,7 +450,7 @@ begin
   AssertEquals('begin end block',TPasImplBeginBlock,I.ifBranch.ClassType);
   AssertEquals('begin end block',TPasImplBeginBlock,I.ifBranch.ClassType);
 end;
 end;
 
 
-procedure TTestStatementParser.TestIfAssignment;
+Procedure TTestStatementParser.TestIfAssignment;
 
 
 Var
 Var
   I : TPasImplIfElse;
   I : TPasImplIfElse;
@@ -416,7 +465,7 @@ begin
   AssertEquals('assignment statement',TPasImplAssign,I.ifBranch.ClassType);
   AssertEquals('assignment statement',TPasImplAssign,I.ifBranch.ClassType);
 end;
 end;
 
 
-procedure TTestStatementParser.TestIfElse;
+Procedure TTestStatementParser.TestIfElse;
 
 
 Var
 Var
   I : TPasImplIfElse;
   I : TPasImplIfElse;
@@ -431,7 +480,7 @@ begin
   AssertEquals('begin end block',TPasImplBeginBlock,I.ifBranch.ClassType);
   AssertEquals('begin end block',TPasImplBeginBlock,I.ifBranch.ClassType);
 end;
 end;
 
 
-procedure TTestStatementParser.TestIfElseBlock;
+Procedure TTestStatementParser.TestIfElseBlock;
 Var
 Var
   I : TPasImplIfElse;
   I : TPasImplIfElse;
 
 
@@ -446,14 +495,14 @@ begin
   AssertEquals('begin end block',TPasImplBeginBlock,I.ElseBranch.ClassType);
   AssertEquals('begin end block',TPasImplBeginBlock,I.ElseBranch.ClassType);
 end;
 end;
 
 
-procedure TTestStatementParser.TestIfSemiColonElseError;
+Procedure TTestStatementParser.TestIfSemiColonElseError;
 
 
 begin
 begin
   DeclareVar('boolean');
   DeclareVar('boolean');
   ExpectParserError('No semicolon before else',['if a then','  begin','  end;','else','  begin','  end']);
   ExpectParserError('No semicolon before else',['if a then','  begin','  end;','else','  begin','  end']);
 end;
 end;
 
 
-procedure TTestStatementParser.TestNestedIf;
+Procedure TTestStatementParser.TestNestedIf;
 Var
 Var
   I : TPasImplIfElse;
   I : TPasImplIfElse;
 begin
 begin
@@ -470,7 +519,7 @@ begin
 
 
 end;
 end;
 
 
-procedure TTestStatementParser.TestNestedIfElse;
+Procedure TTestStatementParser.TestNestedIfElse;
 
 
 Var
 Var
   I : TPasImplIfElse;
   I : TPasImplIfElse;
@@ -488,7 +537,7 @@ begin
   AssertEquals('begin end block',TPasImplBeginBlock,I.ElseBranch.ClassType);
   AssertEquals('begin end block',TPasImplBeginBlock,I.ElseBranch.ClassType);
 end;
 end;
 
 
-procedure TTestStatementParser.TestWhile;
+Procedure TTestStatementParser.TestWhile;
 
 
 Var
 Var
   W : TPasImplWhileDo;
   W : TPasImplWhileDo;
@@ -501,7 +550,7 @@ begin
   AssertNull('Empty body',W.Body);
   AssertNull('Empty body',W.Body);
 end;
 end;
 
 
-procedure TTestStatementParser.TestWhileBlock;
+Procedure TTestStatementParser.TestWhileBlock;
 Var
 Var
   W : TPasImplWhileDo;
   W : TPasImplWhileDo;
 
 
@@ -515,7 +564,7 @@ begin
   AssertEquals('Empty block',0,TPasImplBeginBlock(W.Body).ELements.Count);
   AssertEquals('Empty block',0,TPasImplBeginBlock(W.Body).ELements.Count);
 end;
 end;
 
 
-procedure TTestStatementParser.TestWhileNested;
+Procedure TTestStatementParser.TestWhileNested;
 
 
 Var
 Var
   W : TPasImplWhileDo;
   W : TPasImplWhileDo;
@@ -535,7 +584,7 @@ begin
   AssertEquals('Empty nested block',0,TPasImplBeginBlock(W.Body).ELements.Count);
   AssertEquals('Empty nested block',0,TPasImplBeginBlock(W.Body).ELements.Count);
 end;
 end;
 
 
-procedure TTestStatementParser.TestRepeat;
+Procedure TTestStatementParser.TestRepeat;
 
 
 Var
 Var
   R : TPasImplRepeatUntil;
   R : TPasImplRepeatUntil;
@@ -548,7 +597,7 @@ begin
   AssertEquals('Empty body',0,R.Elements.Count);
   AssertEquals('Empty body',0,R.Elements.Count);
 end;
 end;
 
 
-procedure TTestStatementParser.TestRepeatBlock;
+Procedure TTestStatementParser.TestRepeatBlock;
 
 
 Var
 Var
   R : TPasImplRepeatUntil;
   R : TPasImplRepeatUntil;
@@ -578,7 +627,7 @@ begin
   AssertEquals('Empty block',0,TPasImplBeginBlock(R.Elements[0]).ELements.Count);
   AssertEquals('Empty block',0,TPasImplBeginBlock(R.Elements[0]).ELements.Count);
 end;
 end;
 
 
-procedure TTestStatementParser.TestRepeatNested;
+Procedure TTestStatementParser.TestRepeatNested;
 
 
 Var
 Var
   R : TPasImplRepeatUntil;
   R : TPasImplRepeatUntil;
@@ -598,7 +647,7 @@ begin
   AssertEquals('Empty block',0,TPasImplBeginBlock(R.Elements[0]).ELements.Count);
   AssertEquals('Empty block',0,TPasImplBeginBlock(R.Elements[0]).ELements.Count);
 end;
 end;
 
 
-procedure TTestStatementParser.TestFor;
+Procedure TTestStatementParser.TestFor;
 
 
 Var
 Var
   F : TPasImplForLoop;
   F : TPasImplForLoop;
@@ -615,7 +664,7 @@ begin
   AssertNull('Empty body',F.Body);
   AssertNull('Empty body',F.Body);
 end;
 end;
 
 
-procedure TTestStatementParser.TestForIn;
+Procedure TTestStatementParser.TestForIn;
 
 
 Var
 Var
   F : TPasImplForLoop;
   F : TPasImplForLoop;
@@ -632,7 +681,7 @@ begin
   AssertNull('Empty body',F.Body);
   AssertNull('Empty body',F.Body);
 end;
 end;
 
 
-procedure TTestStatementParser.TestForExpr;
+Procedure TTestStatementParser.TestForExpr;
 Var
 Var
   F : TPasImplForLoop;
   F : TPasImplForLoop;
   B : TBinaryExpr;
   B : TBinaryExpr;
@@ -654,7 +703,7 @@ begin
   AssertNull('Empty body',F.Body);
   AssertNull('Empty body',F.Body);
 end;
 end;
 
 
-procedure TTestStatementParser.TestForBlock;
+Procedure TTestStatementParser.TestForBlock;
 
 
 Var
 Var
   F : TPasImplForLoop;
   F : TPasImplForLoop;
@@ -690,7 +739,7 @@ begin
   AssertEquals('Empty block',0,TPasImplBeginBlock(F.Body).ELements.Count);
   AssertEquals('Empty block',0,TPasImplBeginBlock(F.Body).ELements.Count);
 end;
 end;
 
 
-procedure TTestStatementParser.TestForNested;
+Procedure TTestStatementParser.TestForNested;
 Var
 Var
   F : TPasImplForLoop;
   F : TPasImplForLoop;
 
 
@@ -715,7 +764,7 @@ begin
   AssertEquals('Empty block',0,TPasImplBeginBlock(F.Body).ELements.Count);
   AssertEquals('Empty block',0,TPasImplBeginBlock(F.Body).ELements.Count);
 end;
 end;
 
 
-procedure TTestStatementParser.TestWith;
+Procedure TTestStatementParser.TestWith;
 
 
 Var
 Var
   W : TpasImplWithDo;
   W : TpasImplWithDo;
@@ -731,7 +780,7 @@ begin
   AssertEquals('Empty block',0,TPasImplBeginBlock(W.Body).ELements.Count);
   AssertEquals('Empty block',0,TPasImplBeginBlock(W.Body).ELements.Count);
 end;
 end;
 
 
-procedure TTestStatementParser.TestWithMultiple;
+Procedure TTestStatementParser.TestWithMultiple;
 Var
 Var
   W : TpasImplWithDo;
   W : TpasImplWithDo;
 
 
@@ -748,14 +797,14 @@ begin
   AssertEquals('Empty block',0,TPasImplBeginBlock(W.Body).ELements.Count);
   AssertEquals('Empty block',0,TPasImplBeginBlock(W.Body).ELements.Count);
 end;
 end;
 
 
-procedure TTestStatementParser.TestCaseEmpty;
+Procedure TTestStatementParser.TestCaseEmpty;
 begin
 begin
   DeclareVar('integer');
   DeclareVar('integer');
   AddStatements(['case a of','end;']);
   AddStatements(['case a of','end;']);
   ExpectParserError('Empty case not allowed');
   ExpectParserError('Empty case not allowed');
 end;
 end;
 
 
-procedure TTestStatementParser.TestCaseOneInteger;
+Procedure TTestStatementParser.TestCaseOneInteger;
 
 
 Var
 Var
   C : TPasImplCaseOf;
   C : TPasImplCaseOf;
@@ -777,7 +826,7 @@ begin
   AssertNull('Empty case label statement',S.Body);
   AssertNull('Empty case label statement',S.Body);
 end;
 end;
 
 
-procedure TTestStatementParser.TestCaseTwoIntegers;
+Procedure TTestStatementParser.TestCaseTwoIntegers;
 
 
 Var
 Var
   C : TPasImplCaseOf;
   C : TPasImplCaseOf;
@@ -800,7 +849,7 @@ begin
   AssertNull('Empty case label statement',S.Body);
   AssertNull('Empty case label statement',S.Body);
 end;
 end;
 
 
-procedure TTestStatementParser.TestCaseRange;
+Procedure TTestStatementParser.TestCaseRange;
 Var
 Var
   C : TPasImplCaseOf;
   C : TPasImplCaseOf;
   S : TPasImplCaseStatement;
   S : TPasImplCaseStatement;
@@ -821,7 +870,7 @@ begin
   AssertNull('Empty case label statement',S.Body);
   AssertNull('Empty case label statement',S.Body);
 end;
 end;
 
 
-procedure TTestStatementParser.TestCaseRangeSeparate;
+Procedure TTestStatementParser.TestCaseRangeSeparate;
 Var
 Var
   C : TPasImplCaseOf;
   C : TPasImplCaseOf;
   S : TPasImplCaseStatement;
   S : TPasImplCaseStatement;
@@ -843,7 +892,7 @@ begin
   AssertNull('Empty case label statement',S.Body);
   AssertNull('Empty case label statement',S.Body);
 end;
 end;
 
 
-procedure TTestStatementParser.TestCase2Cases;
+Procedure TTestStatementParser.TestCase2Cases;
 Var
 Var
   C : TPasImplCaseOf;
   C : TPasImplCaseOf;
   S : TPasImplCaseStatement;
   S : TPasImplCaseStatement;
@@ -871,7 +920,7 @@ begin
   AssertNull('Empty case label statement 2',S.Body);
   AssertNull('Empty case label statement 2',S.Body);
 end;
 end;
 
 
-procedure TTestStatementParser.TestCaseBlock;
+Procedure TTestStatementParser.TestCaseBlock;
 
 
 Var
 Var
   C : TPasImplCaseOf;
   C : TPasImplCaseOf;
@@ -897,7 +946,7 @@ begin
 
 
 end;
 end;
 
 
-procedure TTestStatementParser.TestCaseElseBlockEmpty;
+Procedure TTestStatementParser.TestCaseElseBlockEmpty;
 
 
 Var
 Var
   C : TPasImplCaseOf;
   C : TPasImplCaseOf;
@@ -924,7 +973,7 @@ begin
   AssertEquals('Zero statements ',0,TPasImplCaseElse(C.ElseBranch).Elements.Count);
   AssertEquals('Zero statements ',0,TPasImplCaseElse(C.ElseBranch).Elements.Count);
 end;
 end;
 
 
-procedure TTestStatementParser.TestCaseElseBlockAssignment;
+Procedure TTestStatementParser.TestCaseElseBlockAssignment;
 Var
 Var
   C : TPasImplCaseOf;
   C : TPasImplCaseOf;
   S : TPasImplCaseStatement;
   S : TPasImplCaseStatement;
@@ -950,7 +999,7 @@ begin
   AssertEquals('1 statement in else branch ',1,TPasImplCaseElse(C.ElseBranch).Elements.Count);
   AssertEquals('1 statement in else branch ',1,TPasImplCaseElse(C.ElseBranch).Elements.Count);
 end;
 end;
 
 
-procedure TTestStatementParser.TestCaseElseBlock2Assignments;
+Procedure TTestStatementParser.TestCaseElseBlock2Assignments;
 
 
 Var
 Var
   C : TPasImplCaseOf;
   C : TPasImplCaseOf;
@@ -977,7 +1026,7 @@ begin
   AssertEquals('2 statements in else branch ',2,TPasImplCaseElse(C.ElseBranch).Elements.Count);
   AssertEquals('2 statements in else branch ',2,TPasImplCaseElse(C.ElseBranch).Elements.Count);
 end;
 end;
 
 
-procedure TTestStatementParser.TestCaseIfCaseElse;
+Procedure TTestStatementParser.TestCaseIfCaseElse;
 
 
 Var
 Var
   C : TPasImplCaseOf;
   C : TPasImplCaseOf;
@@ -995,7 +1044,7 @@ begin
   AssertEquals('0 statement in else branch ',0,TPasImplCaseElse(C.ElseBranch).Elements.Count);
   AssertEquals('0 statement in else branch ',0,TPasImplCaseElse(C.ElseBranch).Elements.Count);
 end;
 end;
 
 
-procedure TTestStatementParser.TestCaseIfElse;
+Procedure TTestStatementParser.TestCaseIfElse;
 Var
 Var
   C : TPasImplCaseOf;
   C : TPasImplCaseOf;
   S : TPasImplCaseStatement;
   S : TPasImplCaseStatement;
@@ -1017,7 +1066,7 @@ begin
   AssertNotNull('If statement has else block',TPasImplIfElse(S.Elements[0]).ElseBranch);
   AssertNotNull('If statement has else block',TPasImplIfElse(S.Elements[0]).ElseBranch);
 end;
 end;
 
 
-procedure TTestStatementParser.TestRaise;
+Procedure TTestStatementParser.TestRaise;
 
 
 Var
 Var
   R : TPasImplRaise;
   R : TPasImplRaise;
@@ -1032,7 +1081,7 @@ begin
   AssertExpression('Expression object',R.ExceptObject,pekIdent,'A');
   AssertExpression('Expression object',R.ExceptObject,pekIdent,'A');
 end;
 end;
 
 
-procedure TTestStatementParser.TestRaiseEmpty;
+Procedure TTestStatementParser.TestRaiseEmpty;
 Var
 Var
   R : TPasImplRaise;
   R : TPasImplRaise;
 
 
@@ -1044,7 +1093,7 @@ begin
   AssertNull(R.ExceptAddr);
   AssertNull(R.ExceptAddr);
 end;
 end;
 
 
-procedure TTestStatementParser.TestRaiseAt;
+Procedure TTestStatementParser.TestRaiseAt;
 
 
 Var
 Var
   R : TPasImplRaise;
   R : TPasImplRaise;
@@ -1060,7 +1109,7 @@ begin
   AssertExpression('Expression object',R.ExceptAddr,pekIdent,'B');
   AssertExpression('Expression object',R.ExceptAddr,pekIdent,'B');
 end;
 end;
 
 
-procedure TTestStatementParser.TestTryFinally;
+Procedure TTestStatementParser.TestTryFinally;
 
 
 Var
 Var
   T : TPasImplTry;
   T : TPasImplTry;
@@ -1086,7 +1135,7 @@ begin
   AssertExpression('DoSomethingElse call',S.Expr,pekIdent,'DoSomethingElse');
   AssertExpression('DoSomethingElse call',S.Expr,pekIdent,'DoSomethingElse');
 end;
 end;
 
 
-procedure TTestStatementParser.TestTryFinallyEmpty;
+Procedure TTestStatementParser.TestTryFinallyEmpty;
 Var
 Var
   T : TPasImplTry;
   T : TPasImplTry;
   F : TPasImplTryFinally;
   F : TPasImplTryFinally;
@@ -1102,7 +1151,7 @@ begin
   AssertEquals(0,F.Elements.Count);
   AssertEquals(0,F.Elements.Count);
 end;
 end;
 
 
-procedure TTestStatementParser.TestTryFinallyNested;
+Procedure TTestStatementParser.TestTryFinallyNested;
 Var
 Var
   T : TPasImplTry;
   T : TPasImplTry;
   S : TPasImplSimple;
   S : TPasImplSimple;
@@ -1230,7 +1279,7 @@ begin
   AssertEquals(0,E.Elements.Count);
   AssertEquals(0,E.Elements.Count);
 end;
 end;
 
 
-procedure TTestStatementParser.TestTryExceptOn;
+Procedure TTestStatementParser.TestTryExceptOn;
 
 
 Var
 Var
   T : TPasImplTry;
   T : TPasImplTry;
@@ -1264,7 +1313,7 @@ begin
 
 
 end;
 end;
 
 
-procedure TTestStatementParser.TestTryExceptOn2;
+Procedure TTestStatementParser.TestTryExceptOn2;
 
 
 Var
 Var
   T : TPasImplTry;
   T : TPasImplTry;
@@ -1309,7 +1358,7 @@ begin
   AssertExpression('DoSomethingElse call',S.Expr,pekIdent,'DoSomethingElse2');
   AssertExpression('DoSomethingElse call',S.Expr,pekIdent,'DoSomethingElse2');
 end;
 end;
 
 
-procedure TTestStatementParser.TestTryExceptOnElse;
+Procedure TTestStatementParser.TestTryExceptOnElse;
 Var
 Var
   T : TPasImplTry;
   T : TPasImplTry;
   S : TPasImplSimple;
   S : TPasImplSimple;
@@ -1356,7 +1405,7 @@ begin
   AssertExpression('DoSomething call',S.Expr,pekIdent,'DoSomethingMore');
   AssertExpression('DoSomething call',S.Expr,pekIdent,'DoSomethingMore');
 end;
 end;
 
 
-procedure TTestStatementParser.TestTryExceptOnIfElse;
+Procedure TTestStatementParser.TestTryExceptOnIfElse;
 Var
 Var
   T : TPasImplTry;
   T : TPasImplTry;
   S : TPasImplSimple;
   S : TPasImplSimple;

Разлика између датотеке није приказан због своје велике величине
+ 174 - 152
packages/fcl-passrc/tests/tctypeparser.pas


+ 1 - 11
packages/fcl-passrc/tests/testpassrc.lpi

@@ -30,7 +30,7 @@
     <RunParams>
     <RunParams>
       <local>
       <local>
         <FormatVersion Value="1"/>
         <FormatVersion Value="1"/>
-        <CommandLineParams Value="--suite=TTestRecordTypeParser.TestVisibilityAndMethods"/>
+        <CommandLineParams Value="--suite=TTestStatementParser.TestCallComment"/>
       </local>
       </local>
     </RunParams>
     </RunParams>
     <RequiredPackages Count="1">
     <RequiredPackages Count="1">
@@ -42,7 +42,6 @@
       <Unit0>
       <Unit0>
         <Filename Value="testpassrc.lpr"/>
         <Filename Value="testpassrc.lpr"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
-        <UnitName Value="testpassrc"/>
       </Unit0>
       </Unit0>
       <Unit1>
       <Unit1>
         <Filename Value="tcscanner.pas"/>
         <Filename Value="tcscanner.pas"/>
@@ -67,17 +66,14 @@
       <Unit5>
       <Unit5>
         <Filename Value="tcmoduleparser.pas"/>
         <Filename Value="tcmoduleparser.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
-        <UnitName Value="tcmoduleparser"/>
       </Unit5>
       </Unit5>
       <Unit6>
       <Unit6>
         <Filename Value="tconstparser.pas"/>
         <Filename Value="tconstparser.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
-        <UnitName Value="tconstparser"/>
       </Unit6>
       </Unit6>
       <Unit7>
       <Unit7>
         <Filename Value="tcvarparser.pas"/>
         <Filename Value="tcvarparser.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
-        <UnitName Value="tcvarparser"/>
       </Unit7>
       </Unit7>
       <Unit8>
       <Unit8>
         <Filename Value="tcclasstype.pas"/>
         <Filename Value="tcclasstype.pas"/>
@@ -107,12 +103,6 @@
       <IncludeFiles Value="$(ProjOutDir)"/>
       <IncludeFiles Value="$(ProjOutDir)"/>
       <OtherUnitFiles Value="../src"/>
       <OtherUnitFiles Value="../src"/>
     </SearchPaths>
     </SearchPaths>
-    <Other>
-      <CompilerMessages>
-        <UseMsgFile Value="True"/>
-      </CompilerMessages>
-      <CompilerPath Value="$(CompPath)"/>
-    </Other>
   </CompilerOptions>
   </CompilerOptions>
   <Debugging>
   <Debugging>
     <Exceptions Count="3">
     <Exceptions Count="3">

Неке датотеке нису приказане због велике количине промена