mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-09 20:59:32 +01:00
method resolution clause, class ancestor find declaration, 1.1. makros
git-svn-id: trunk@3716 -
This commit is contained in:
parent
306c9673f8
commit
f8329f9fc6
@ -147,7 +147,7 @@ ResourceString
|
|||||||
// definetemplates
|
// definetemplates
|
||||||
ctsUnknownFunction = 'Unknown function %s';
|
ctsUnknownFunction = 'Unknown function %s';
|
||||||
ctsSyntaxErrorInExpr = 'Syntax Error in expression "%s"';
|
ctsSyntaxErrorInExpr = 'Syntax Error in expression "%s"';
|
||||||
ctsDefaultppc386Macro = 'Default ppc386 macro';
|
ctsDefaultppc386Symbol = 'Default ppc386 symbol';
|
||||||
ctsDefaultppc386TargetOperatingSystem = 'Default ppc386 target Operating System';
|
ctsDefaultppc386TargetOperatingSystem = 'Default ppc386 target Operating System';
|
||||||
ctsDefaultppc386SourceOperatingSystem = 'Default ppc386 source Operating System';
|
ctsDefaultppc386SourceOperatingSystem = 'Default ppc386 source Operating System';
|
||||||
ctsDefaultppc386TargetProcessor = 'Default ppc386 target processor';
|
ctsDefaultppc386TargetProcessor = 'Default ppc386 target processor';
|
||||||
|
|||||||
@ -81,6 +81,7 @@ const
|
|||||||
ctnClassGUID = 35;
|
ctnClassGUID = 35;
|
||||||
|
|
||||||
ctnProperty = 40;
|
ctnProperty = 40;
|
||||||
|
ctnMethodMap = 41;
|
||||||
|
|
||||||
ctnProcedure = 50;
|
ctnProcedure = 50;
|
||||||
ctnProcedureHead = 51;
|
ctnProcedureHead = 51;
|
||||||
@ -300,6 +301,7 @@ begin
|
|||||||
ctnConstDefinition: Result:='Const';
|
ctnConstDefinition: Result:='Const';
|
||||||
|
|
||||||
ctnProperty: Result:='Property';
|
ctnProperty: Result:='Property';
|
||||||
|
ctnMethodMap: Result:='Method Map';
|
||||||
|
|
||||||
ctnIdentifier: Result:='Identifier';
|
ctnIdentifier: Result:='Identifier';
|
||||||
ctnArrayType: Result:='Array Type';
|
ctnArrayType: Result:='Array Type';
|
||||||
|
|||||||
@ -134,14 +134,7 @@ type
|
|||||||
Action: TDefineAction;
|
Action: TDefineAction;
|
||||||
Flags: TDefineTemplateFlags;
|
Flags: TDefineTemplateFlags;
|
||||||
function Level: integer;
|
function Level: integer;
|
||||||
property ChildCount: integer read FChildCount;
|
function GetFirstSibling: TDefineTemplate;
|
||||||
property Parent: TDefineTemplate read FParent;
|
|
||||||
property Next: TDefineTemplate read FNext;
|
|
||||||
property Prior: TDefineTemplate read FPrior;
|
|
||||||
property FirstChild: TDefineTemplate read FFirstChild;
|
|
||||||
property LastChild: TDefineTemplate read FLastChild;
|
|
||||||
property Marked: boolean read FMarked write FMarked;
|
|
||||||
|
|
||||||
procedure AddChild(ADefineTemplate: TDefineTemplate);
|
procedure AddChild(ADefineTemplate: TDefineTemplate);
|
||||||
procedure InsertBehind(APrior: TDefineTemplate);
|
procedure InsertBehind(APrior: TDefineTemplate);
|
||||||
procedure InsertInFront(ANext: TDefineTemplate);
|
procedure InsertInFront(ANext: TDefineTemplate);
|
||||||
@ -179,6 +172,14 @@ type
|
|||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
function ConsistencyCheck: integer; // 0 = ok
|
function ConsistencyCheck: integer; // 0 = ok
|
||||||
procedure WriteDebugReport;
|
procedure WriteDebugReport;
|
||||||
|
public
|
||||||
|
property ChildCount: integer read FChildCount;
|
||||||
|
property Parent: TDefineTemplate read FParent;
|
||||||
|
property Next: TDefineTemplate read FNext;
|
||||||
|
property Prior: TDefineTemplate read FPrior;
|
||||||
|
property FirstChild: TDefineTemplate read FFirstChild;
|
||||||
|
property LastChild: TDefineTemplate read FLastChild;
|
||||||
|
property Marked: boolean read FMarked write FMarked;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
@ -253,6 +254,9 @@ type
|
|||||||
procedure RemoveNonAutoCreated;
|
procedure RemoveNonAutoCreated;
|
||||||
function GetIncludePathForDirectory(const Directory: string): string;
|
function GetIncludePathForDirectory(const Directory: string): string;
|
||||||
function GetSrcPathForDirectory(const Directory: string): string;
|
function GetSrcPathForDirectory(const Directory: string): string;
|
||||||
|
function GetPPUSrcPathForDirectory(const Directory: string): string;
|
||||||
|
function GetPPWSrcPathForDirectory(const Directory: string): string;
|
||||||
|
function GetDCUSrcPathForDirectory(const Directory: string): string;
|
||||||
constructor Create;
|
constructor Create;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
function ConsistencyCheck: integer; // 0 = ok
|
function ConsistencyCheck: integer; // 0 = ok
|
||||||
@ -275,7 +279,7 @@ type
|
|||||||
procedure Move(SrcIndex, DestIndex: integer);
|
procedure Move(SrcIndex, DestIndex: integer);
|
||||||
property EnglishErrorMsgFilename: string
|
property EnglishErrorMsgFilename: string
|
||||||
read FEnglishErrorMsgFilename write SetEnglishErrorMsgFilename;
|
read FEnglishErrorMsgFilename write SetEnglishErrorMsgFilename;
|
||||||
function CreateFPCTemplate(const PPC386Path: string;
|
function CreateFPCTemplate(const PPC386Path, TestPascalFile: string;
|
||||||
var UnitSearchPath: string): TDefineTemplate;
|
var UnitSearchPath: string): TDefineTemplate;
|
||||||
function CreateFPCSrcTemplate(const FPCSrcDir,
|
function CreateFPCSrcTemplate(const FPCSrcDir,
|
||||||
UnitSearchPath: string;
|
UnitSearchPath: string;
|
||||||
@ -1035,6 +1039,12 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TDefineTemplate.GetFirstSibling: TDefineTemplate;
|
||||||
|
begin
|
||||||
|
Result:=Self;
|
||||||
|
while Result.Prior<>nil do Result:=Result.Prior;
|
||||||
|
end;
|
||||||
|
|
||||||
function TDefineTemplate.SelfOrParentContainsFlag(
|
function TDefineTemplate.SelfOrParentContainsFlag(
|
||||||
AFlag: TDefineTemplateFlag): boolean;
|
AFlag: TDefineTemplateFlag): boolean;
|
||||||
var Node: TDefineTemplate;
|
var Node: TDefineTemplate;
|
||||||
@ -1248,6 +1258,42 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TDefineTree.GetPPUSrcPathForDirectory(const Directory: string
|
||||||
|
): string;
|
||||||
|
var ExprEval: TExpressionEvaluator;
|
||||||
|
begin
|
||||||
|
ExprEval:=GetDefinesForDirectory(Directory);
|
||||||
|
if ExprEval<>nil then begin
|
||||||
|
Result:=ExprEval.Variables[ExternalMacroStart+'PPUSrcPath'];
|
||||||
|
end else begin
|
||||||
|
Result:='';
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TDefineTree.GetPPWSrcPathForDirectory(const Directory: string
|
||||||
|
): string;
|
||||||
|
var ExprEval: TExpressionEvaluator;
|
||||||
|
begin
|
||||||
|
ExprEval:=GetDefinesForDirectory(Directory);
|
||||||
|
if ExprEval<>nil then begin
|
||||||
|
Result:=ExprEval.Variables[ExternalMacroStart+'PPWSrcPath'];
|
||||||
|
end else begin
|
||||||
|
Result:='';
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TDefineTree.GetDCUSrcPathForDirectory(const Directory: string
|
||||||
|
): string;
|
||||||
|
var ExprEval: TExpressionEvaluator;
|
||||||
|
begin
|
||||||
|
ExprEval:=GetDefinesForDirectory(Directory);
|
||||||
|
if ExprEval<>nil then begin
|
||||||
|
Result:=ExprEval.Variables[ExternalMacroStart+'DCUSrcPath'];
|
||||||
|
end else begin
|
||||||
|
Result:='';
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
function TDefineTree.GetDefinesForDirectory(
|
function TDefineTree.GetDefinesForDirectory(
|
||||||
const Path: string): TExpressionEvaluator;
|
const Path: string): TExpressionEvaluator;
|
||||||
var ExpPath: string;
|
var ExpPath: string;
|
||||||
@ -1759,63 +1805,108 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TDefinePool.CreateFPCTemplate(
|
function TDefinePool.CreateFPCTemplate(
|
||||||
const PPC386Path: string;
|
const PPC386Path, TestPascalFile: string;
|
||||||
var UnitSearchPath: string): TDefineTemplate;
|
var UnitSearchPath: string): TDefineTemplate;
|
||||||
// create makro definitions for the freepascal compiler
|
// create symbol definitions for the freepascal compiler
|
||||||
// To get reliable values the compiler itself is asked for
|
// To get reliable values the compiler itself is asked for
|
||||||
|
var
|
||||||
|
LastDefTempl: TDefineTemplate;
|
||||||
|
ShortTestFile: string;
|
||||||
|
|
||||||
procedure ProcessOutputLine(var LastDefTempl: TDefineTemplate; Line: string);
|
procedure AddTemplate(NewDefTempl: TDefineTemplate);
|
||||||
|
begin
|
||||||
|
if NewDefTempl=nil then exit;
|
||||||
|
if LastDefTempl<>nil then
|
||||||
|
NewDefTempl.InsertBehind(LastDefTempl);
|
||||||
|
LastDefTempl:=NewDefTempl;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function FindSymbol(const SymbolName: string): TDefineTemplate;
|
||||||
|
begin
|
||||||
|
Result:=LastDefTempl;
|
||||||
|
while (Result<>nil)
|
||||||
|
and (AnsiComparetext(Result.Variable,SymbolName)<>0) do
|
||||||
|
Result:=Result.Prior;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure DefineSymbol(const SymbolName, SymbolValue: string);
|
||||||
var NewDefTempl: TDefineTemplate;
|
var NewDefTempl: TDefineTemplate;
|
||||||
MacroName, MacroValue, UpLine: string;
|
begin
|
||||||
|
NewDefTempl:=FindSymbol(SymbolName);
|
||||||
|
if NewDefTempl=nil then begin
|
||||||
|
NewDefTempl:=TDefineTemplate.Create('Define '+SymbolName,
|
||||||
|
ctsDefaultppc386Symbol,SymbolName,'',da_DefineRecurse);
|
||||||
|
AddTemplate(NewDefTempl);
|
||||||
|
end else begin
|
||||||
|
NewDefTempl.Value:=SymbolValue;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure UndefineSymbol(const SymbolName: string);
|
||||||
|
var
|
||||||
|
ADefTempl: TDefineTemplate;
|
||||||
|
begin
|
||||||
|
ADefTempl:=FindSymbol(SymbolName);
|
||||||
|
if ADefTempl=nil then exit;
|
||||||
|
if LastDefTempl=ADefTempl then LastDefTempl:=ADefTempl.Prior;
|
||||||
|
ADefTempl.Free;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure ProcessOutputLine(var Line: string);
|
||||||
|
var
|
||||||
|
SymbolName, SymbolValue, UpLine: string;
|
||||||
i: integer;
|
i: integer;
|
||||||
begin
|
begin
|
||||||
NewDefTempl:=nil;
|
|
||||||
UpLine:=UpperCaseStr(Line);
|
UpLine:=UpperCaseStr(Line);
|
||||||
|
i:=length(ShortTestFile);
|
||||||
|
if (length(Line)>i)
|
||||||
|
and (AnsiCompareText(LeftStr(Line,i),ShortTestFile)=0)
|
||||||
|
and (Line[i+1]='(') then begin
|
||||||
|
inc(i);
|
||||||
|
while (i<length(Line)) and (Line[i]<>')') do inc(i);
|
||||||
|
inc(i);
|
||||||
|
while (i<length(Line)) and (Line[i]=' ') do inc(i);
|
||||||
|
if (i<=length(Line)) then begin
|
||||||
|
System.Delete(Line,1,i-1);
|
||||||
|
System.Delete(UpLine,1,i-1);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
if copy(UpLine,1,15)='MACRO DEFINED: ' then begin
|
if copy(UpLine,1,15)='MACRO DEFINED: ' then begin
|
||||||
MacroName:=copy(UpLine,16,length(Line)-15);
|
SymbolName:=copy(UpLine,16,length(Line)-15);
|
||||||
NewDefTempl:=TDefineTemplate.Create('Define '+MacroName,
|
DefineSymbol(SymbolName,'');
|
||||||
ctsDefaultppc386Macro,MacroName,'',da_DefineRecurse);
|
end else if copy(UpLine,1,17)='MACRO UNDEFINED: ' then begin
|
||||||
end else if copy(UpLine,1,15)='MACRO UNDEFINED: ' then begin
|
SymbolName:=copy(UpLine,18,length(Line)-17);
|
||||||
MacroName:=copy(UpLine,16,length(Line)-15);
|
UndefineSymbol(SymbolName);
|
||||||
|
|
||||||
// ToDo: delete macro definition
|
|
||||||
|
|
||||||
end else if copy(UpLine,1,6)='MACRO ' then begin
|
end else if copy(UpLine,1,6)='MACRO ' then begin
|
||||||
System.Delete(Line,1,6);
|
System.Delete(Line,1,6);
|
||||||
System.Delete(UpLine,1,6);
|
System.Delete(UpLine,1,6);
|
||||||
i:=1;
|
i:=1;
|
||||||
while (i<=length(Line)) and (Line[i]<>' ') do inc(i);
|
while (i<=length(Line)) and (Line[i]<>' ') do inc(i);
|
||||||
MacroName:=copy(UpLine,1,i-1);
|
SymbolName:=copy(UpLine,1,i-1);
|
||||||
inc(i);
|
inc(i); // skip '='
|
||||||
System.Delete(Line,1,i-1);
|
System.Delete(Line,1,i-1);
|
||||||
System.Delete(UpLine,1,i-1);
|
System.Delete(UpLine,1,i-1);
|
||||||
if copy(UpLine,1,7)='SET TO ' then begin
|
if copy(UpLine,1,7)='SET TO ' then begin
|
||||||
MacroValue:=copy(Line,8,length(Line)-7);
|
SymbolValue:=copy(Line,8,length(Line)-7);
|
||||||
NewDefTempl:=TDefineTemplate.Create('Define '+MacroName,
|
DefineSymbol(SymbolName,SymbolValue);
|
||||||
ctsDefaultppc386Macro,MacroName,MacroValue,da_DefineRecurse);
|
|
||||||
end;
|
end;
|
||||||
end else if copy(UpLine,1,17)='USING UNIT PATH: ' then begin
|
end else if copy(UpLine,1,17)='USING UNIT PATH: ' then begin
|
||||||
UnitSearchPath:=UnitSearchPath+copy(Line,18,length(Line)-17)+#13;
|
UnitSearchPath:=UnitSearchPath+copy(Line,18,length(Line)-17)+#13;
|
||||||
end;
|
end;
|
||||||
if NewDefTempl<>nil then begin
|
|
||||||
if LastDefTempl<>nil then
|
|
||||||
NewDefTempl.InsertBehind(LastDefTempl);
|
|
||||||
LastDefTempl:=NewDefTempl;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// function TDefinePool.CreateFPCTemplate(
|
// function TDefinePool.CreateFPCTemplate(
|
||||||
// const PPC386Path: string): TDefineTemplate;
|
// const PPC386Path: string): TDefineTemplate;
|
||||||
var CmdLine, BogusFilename: string;
|
var CmdLine: string;
|
||||||
i, OutLen, LineStart: integer;
|
i, OutLen, LineStart: integer;
|
||||||
TheProcess : TProcess;
|
TheProcess : TProcess;
|
||||||
OutputLine, Buf, TargetOS, SrcOS, TargetProcessor: String;
|
OutputLine, Buf, TargetOS, SrcOS, TargetProcessor: String;
|
||||||
DefTempl, NewDefTempl: TDefineTemplate;
|
NewDefTempl: TDefineTemplate;
|
||||||
begin
|
begin
|
||||||
Result:=nil;
|
Result:=nil;
|
||||||
UnitSearchPath:='';
|
UnitSearchPath:='';
|
||||||
if (PPC386Path='') or (not FileIsExecutable(PPC386Path)) then exit;
|
if (PPC386Path='') or (not FileIsExecutable(PPC386Path)) then exit;
|
||||||
DefTempl:=nil;
|
LastDefTempl:=nil;
|
||||||
// find all initial compiler macros and all unit paths
|
// find all initial compiler macros and all unit paths
|
||||||
// -> ask compiler with the -va switch
|
// -> ask compiler with the -va switch
|
||||||
SetLength(Buf,1024);
|
SetLength(Buf,1024);
|
||||||
@ -1823,11 +1914,8 @@ begin
|
|||||||
CmdLine:=PPC386Path+' -va ';
|
CmdLine:=PPC386Path+' -va ';
|
||||||
if FileExists(EnglishErrorMsgFilename) then
|
if FileExists(EnglishErrorMsgFilename) then
|
||||||
CmdLine:=CmdLine+'-Fr'+EnglishErrorMsgFilename+' ';
|
CmdLine:=CmdLine+'-Fr'+EnglishErrorMsgFilename+' ';
|
||||||
// give compiler a not existing file, so that it will return quickly
|
CmdLine:=CmdLine+TestPascalFile;
|
||||||
BogusFilename:='bogus';
|
ShortTestFile:=ExtractFileName(TestPascalFile);
|
||||||
i:=1;
|
|
||||||
while FileExists(BogusFilename+IntToStr(i)+'.pp') do inc(i);
|
|
||||||
CmdLine:=CmdLine+BogusFilename+'.pp';
|
|
||||||
|
|
||||||
TheProcess := TProcess.Create(nil);
|
TheProcess := TProcess.Create(nil);
|
||||||
TheProcess.CommandLine := CmdLine;
|
TheProcess.CommandLine := CmdLine;
|
||||||
@ -1846,7 +1934,7 @@ begin
|
|||||||
while i<=OutLen do begin
|
while i<=OutLen do begin
|
||||||
if Buf[i] in [#10,#13] then begin
|
if Buf[i] in [#10,#13] then begin
|
||||||
OutputLine:=OutputLine+copy(Buf,LineStart,i-LineStart);
|
OutputLine:=OutputLine+copy(Buf,LineStart,i-LineStart);
|
||||||
ProcessOutputLine(DefTempl,OutputLine);
|
ProcessOutputLine(OutputLine);
|
||||||
OutputLine:='';
|
OutputLine:='';
|
||||||
if (i<OutLen) and (Buf[i+1] in [#10,#13]) and (Buf[i]<>Buf[i+1])
|
if (i<OutLen) and (Buf[i+1] in [#10,#13]) and (Buf[i]<>Buf[i+1])
|
||||||
then
|
then
|
||||||
@ -1882,9 +1970,7 @@ begin
|
|||||||
NewDefTempl:=TDefineTemplate.Create('Define TargetOS',
|
NewDefTempl:=TDefineTemplate.Create('Define TargetOS',
|
||||||
ctsDefaultppc386TargetOperatingSystem,
|
ctsDefaultppc386TargetOperatingSystem,
|
||||||
ExternalMacroStart+'TargetOS',TargetOS,da_DefineRecurse);
|
ExternalMacroStart+'TargetOS',TargetOS,da_DefineRecurse);
|
||||||
if DefTempl<>nil then
|
AddTemplate(NewDefTempl);
|
||||||
NewDefTempl.InsertBehind(DefTempl);
|
|
||||||
DefTempl:=NewDefTempl;
|
|
||||||
if TargetOS='linux' then
|
if TargetOS='linux' then
|
||||||
SrcOS:='unix'
|
SrcOS:='unix'
|
||||||
else
|
else
|
||||||
@ -1892,9 +1978,7 @@ begin
|
|||||||
NewDefTempl:=TDefineTemplate.Create('Define SrcOS',
|
NewDefTempl:=TDefineTemplate.Create('Define SrcOS',
|
||||||
ctsDefaultppc386SourceOperatingSystem,
|
ctsDefaultppc386SourceOperatingSystem,
|
||||||
ExternalMacroStart+'SrcOS',SrcOS,da_DefineRecurse);
|
ExternalMacroStart+'SrcOS',SrcOS,da_DefineRecurse);
|
||||||
if DefTempl<>nil then
|
AddTemplate(NewDefTempl);
|
||||||
NewDefTempl.InsertBehind(DefTempl);
|
|
||||||
DefTempl:=NewDefTempl;
|
|
||||||
break;
|
break;
|
||||||
end;
|
end;
|
||||||
inc(i);
|
inc(i);
|
||||||
@ -1923,9 +2007,7 @@ begin
|
|||||||
ctsDefaultppc386TargetProcessor,
|
ctsDefaultppc386TargetProcessor,
|
||||||
ExternalMacroStart+'TargetProcessor',TargetProcessor,
|
ExternalMacroStart+'TargetProcessor',TargetProcessor,
|
||||||
da_DefineRecurse);
|
da_DefineRecurse);
|
||||||
if DefTempl<>nil then
|
AddTemplate(NewDefTempl);
|
||||||
NewDefTempl.InsertBehind(DefTempl);
|
|
||||||
DefTempl:=NewDefTempl;
|
|
||||||
break;
|
break;
|
||||||
end;
|
end;
|
||||||
inc(i);
|
inc(i);
|
||||||
@ -1936,14 +2018,16 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
// add
|
// add
|
||||||
if (DefTempl<>nil) then begin
|
if (LastDefTempl<>nil) then begin
|
||||||
while (DefTempl.Prior<>nil) do DefTempl:=DefTempl.Prior;
|
|
||||||
Result:=TDefineTemplate.Create('Free Pascal Compiler',
|
Result:=TDefineTemplate.Create('Free Pascal Compiler',
|
||||||
ctsFreePascalCompilerInitialMacros,'','',da_Block);
|
ctsFreePascalCompilerInitialMacros,'','',da_Block);
|
||||||
Result.AddChild(DefTempl);
|
Result.AddChild(LastDefTempl.GetFirstSibling);
|
||||||
Result.Flags:=[dtfAutoGenerated];
|
Result.Flags:=[dtfAutoGenerated];
|
||||||
end;
|
end;
|
||||||
except
|
except
|
||||||
|
on E: Exception do begin
|
||||||
|
writeln('ERROR: TDefinePool.CreateFPCTemplate: ',E.Message);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
@ -800,6 +800,7 @@ var CleanCursorPos: integer;
|
|||||||
if (CursorNode.Desc=ctnClass)
|
if (CursorNode.Desc=ctnClass)
|
||||||
and (CleanCursorPos<ClassNode.FirstChild.StartPos) then begin
|
and (CleanCursorPos<ClassNode.FirstChild.StartPos) then begin
|
||||||
// identifier is an ancestor/interface identifier
|
// identifier is an ancestor/interface identifier
|
||||||
|
CursorNode:=CursorNode.Parent;
|
||||||
DirectSearch:=true;
|
DirectSearch:=true;
|
||||||
SkipChecks:=true;
|
SkipChecks:=true;
|
||||||
end;
|
end;
|
||||||
|
|||||||
@ -8,6 +8,9 @@ parser_m_macro_undefined=03102_M_Macro undefined: $1
|
|||||||
parser_m_macro_set_to=03103_M_Macro $1 set to $2
|
parser_m_macro_set_to=03103_M_Macro $1 set to $2
|
||||||
% When \var{-vm} is used, the compiler tells you what values macros get.
|
% When \var{-vm} is used, the compiler tells you what values macros get.
|
||||||
|
|
||||||
|
general_d_defining_symbol=11037_D_Defining symbol: $1
|
||||||
|
general_d_undefining_symbol=11038_D_Undefining symbol: $1
|
||||||
|
|
||||||
general_t_exepath=01003_T_Using executable path: $1
|
general_t_exepath=01003_T_Using executable path: $1
|
||||||
% When the \var{-vt} switch is used, this line tells you where the compiler
|
% When the \var{-vt} switch is used, this line tells you where the compiler
|
||||||
% looks for it's binaries.
|
% looks for it's binaries.
|
||||||
@ -26,5 +29,6 @@ general_t_objectpath=01007_T_Using object path: $1
|
|||||||
% looks for object files you link in (files used in \var{\{\$L xxx\}} statements).
|
% looks for object files you link in (files used in \var{\{\$L xxx\}} statements).
|
||||||
% You can set this path with the \var{-Fo} option.
|
% You can set this path with the \var{-Fo} option.
|
||||||
|
|
||||||
|
|
||||||
# end.
|
# end.
|
||||||
|
|
||||||
|
|||||||
@ -911,6 +911,7 @@ function TPascalParserTool.KeyWordFuncClassMethod: boolean;
|
|||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
class function X: integer;
|
class function X: integer;
|
||||||
static function X: integer;
|
static function X: integer;
|
||||||
|
function Intf.Method = ImplementingMethodName;
|
||||||
|
|
||||||
proc specifiers without parameters:
|
proc specifiers without parameters:
|
||||||
stdcall, virtual, abstract, dynamic, overload, override, cdecl, inline
|
stdcall, virtual, abstract, dynamic, overload, override, cdecl, inline
|
||||||
@ -942,20 +943,30 @@ begin
|
|||||||
CurNode.Desc:=ctnProcedureHead;
|
CurNode.Desc:=ctnProcedureHead;
|
||||||
CurNode.SubDesc:=ctnsNeedJITParsing;
|
CurNode.SubDesc:=ctnsNeedJITParsing;
|
||||||
ReadNextAtom;
|
ReadNextAtom;
|
||||||
if (CurPos.Flag=cafPoint) then begin
|
if (CurPos.Flag<>cafPoint) then begin
|
||||||
// first identifier was interface name
|
|
||||||
ReadNextAtom;
|
|
||||||
AtomIsIdentifier(true);
|
|
||||||
ReadNextAtom;
|
|
||||||
end;
|
|
||||||
// read rest
|
// read rest
|
||||||
ParseAttr:=[pphIsMethod];
|
ParseAttr:=[pphIsMethod];
|
||||||
if IsFunction then Include(ParseAttr,pphIsFunction);
|
if IsFunction then Include(ParseAttr,pphIsFunction);
|
||||||
ReadTilProcedureHeadEnd(ParseAttr,HasForwardModifier);
|
ReadTilProcedureHeadEnd(ParseAttr,HasForwardModifier);
|
||||||
|
end else begin
|
||||||
|
// Method resolution clause (e.g. function Intf.Method = MethodName)
|
||||||
|
CurNode.Parent.Desc:=ctnMethodMap;
|
||||||
|
// read Method name of interface
|
||||||
|
ReadNextAtom;
|
||||||
|
AtomIsIdentifier(true);
|
||||||
|
// read '='
|
||||||
|
ReadNextAtomIsChar('=');
|
||||||
|
// read implementing method name
|
||||||
|
ReadNextAtom;
|
||||||
|
AtomIsIdentifier(true);
|
||||||
|
ReadNextAtom;
|
||||||
|
if CurPos.Flag<>cafSemicolon then
|
||||||
|
UndoReadNextAtom;
|
||||||
|
end;
|
||||||
// close procedure header
|
// close procedure header
|
||||||
CurNode.EndPos:=CurPos.EndPos;
|
CurNode.EndPos:=CurPos.EndPos;
|
||||||
EndChildNode;
|
EndChildNode;
|
||||||
// close procedure
|
// close procedure / method map
|
||||||
CurNode.EndPos:=CurPos.EndPos;
|
CurNode.EndPos:=CurPos.EndPos;
|
||||||
EndChildNode;
|
EndChildNode;
|
||||||
Result:=true;
|
Result:=true;
|
||||||
@ -1189,6 +1200,7 @@ function TPascalParserTool.ReadTilProcedureHeadEnd(
|
|||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
class function X: integer;
|
class function X: integer;
|
||||||
function QWidget_mouseGrabber(): QWidgetH; cdecl;
|
function QWidget_mouseGrabber(): QWidgetH; cdecl;
|
||||||
|
procedure Intf.Method = ImplementingMethodName;
|
||||||
|
|
||||||
proc specifiers without parameters:
|
proc specifiers without parameters:
|
||||||
stdcall, virtual, abstract, dynamic, overload, override, cdecl, inline
|
stdcall, virtual, abstract, dynamic, overload, override, cdecl, inline
|
||||||
|
|||||||
@ -47,7 +47,7 @@ uses
|
|||||||
Classes, SysUtils, LCLLinux, Forms, Controls, Buttons, StdCtrls, ComCtrls,
|
Classes, SysUtils, LCLLinux, Forms, Controls, Buttons, StdCtrls, ComCtrls,
|
||||||
ExtCtrls, Menus, LResources, Graphics, Dialogs, ImgList, SynEdit, Laz_XMLCfg,
|
ExtCtrls, Menus, LResources, Graphics, Dialogs, ImgList, SynEdit, Laz_XMLCfg,
|
||||||
DefineTemplates, CodeToolManager, CodeToolsOptions, CodeToolsDefPreview,
|
DefineTemplates, CodeToolManager, CodeToolsOptions, CodeToolsDefPreview,
|
||||||
TransferMacros, InputFileDialog, IDEOptionDefs;
|
TransferMacros, InputFileDialog, IDEOptionDefs, LazConf;
|
||||||
|
|
||||||
type
|
type
|
||||||
TCodeToolsDefinesEditor = class(TForm)
|
TCodeToolsDefinesEditor = class(TForm)
|
||||||
@ -707,7 +707,7 @@ procedure TCodeToolsDefinesEditor.InsertFPCProjectDefinesTemplateMenuItemClick(
|
|||||||
Sender: TObject);
|
Sender: TObject);
|
||||||
var InputFileDlg: TInputFileDialog;
|
var InputFileDlg: TInputFileDialog;
|
||||||
UnitSearchPath, UnitLinkList, DefaultFPCSrcDir, DefaultCompiler,
|
UnitSearchPath, UnitLinkList, DefaultFPCSrcDir, DefaultCompiler,
|
||||||
CompilerPath, FPCSrcDIr: string;
|
CompilerPath, FPCSrcDir: string;
|
||||||
DirTemplate, FPCTemplate, FPCSrcTemplate: TDefineTemplate;
|
DirTemplate, FPCTemplate, FPCSrcTemplate: TDefineTemplate;
|
||||||
begin
|
begin
|
||||||
InputFileDlg:=GetInputFileDialog;
|
InputFileDlg:=GetInputFileDialog;
|
||||||
@ -752,7 +752,7 @@ begin
|
|||||||
writeln(' CompilerPath="',CompilerPath,'"');
|
writeln(' CompilerPath="',CompilerPath,'"');
|
||||||
if (CompilerPath<>'') and (CompilerPath<>DefaultCompiler) then
|
if (CompilerPath<>'') and (CompilerPath<>DefaultCompiler) then
|
||||||
FPCTemplate:=Boss.DefinePool.CreateFPCTemplate(CompilerPath,
|
FPCTemplate:=Boss.DefinePool.CreateFPCTemplate(CompilerPath,
|
||||||
UnitSearchPath)
|
CreateCompilerTestPascalFilename,UnitSearchPath)
|
||||||
else
|
else
|
||||||
FPCTemplate:=nil;
|
FPCTemplate:=nil;
|
||||||
|
|
||||||
@ -822,7 +822,8 @@ begin
|
|||||||
if Macros<>nil then Macros.SubstituteStr(CompilerPath);
|
if Macros<>nil then Macros.SubstituteStr(CompilerPath);
|
||||||
writeln(' CompilerPath="',CompilerPath,'"');
|
writeln(' CompilerPath="',CompilerPath,'"');
|
||||||
|
|
||||||
FPCTemplate:=Boss.DefinePool.CreateFPCTemplate(CompilerPath,s);
|
FPCTemplate:=Boss.DefinePool.CreateFPCTemplate(CompilerPath,
|
||||||
|
CreateCompilerTestPascalFilename,s);
|
||||||
if FPCTemplate=nil then exit;
|
if FPCTemplate=nil then exit;
|
||||||
FPCTemplate.Name:='Free Pascal Compiler ('+CompilerPath+')';
|
FPCTemplate.Name:='Free Pascal Compiler ('+CompilerPath+')';
|
||||||
InsertTemplate(FPCTemplate);
|
InsertTemplate(FPCTemplate);
|
||||||
@ -865,7 +866,8 @@ begin
|
|||||||
if Macros<>nil then Macros.SubstituteStr(CompilerPath);
|
if Macros<>nil then Macros.SubstituteStr(CompilerPath);
|
||||||
writeln(' CompilerPath="',CompilerPath,'"');
|
writeln(' CompilerPath="',CompilerPath,'"');
|
||||||
|
|
||||||
FPCTemplate:=Boss.DefinePool.CreateFPCTemplate(CompilerPath,UnitSearchPath);
|
FPCTemplate:=Boss.DefinePool.CreateFPCTemplate(CompilerPath,
|
||||||
|
CreateCompilerTestPascalFilename,UnitSearchPath);
|
||||||
if FPCTemplate=nil then begin
|
if FPCTemplate=nil then begin
|
||||||
writeln('ERROR: unable to get FPC Compiler Macros from "',CompilerPath,'"');
|
writeln('ERROR: unable to get FPC Compiler Macros from "',CompilerPath,'"');
|
||||||
exit;
|
exit;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user