mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-13 17:03:01 +02:00
IDEIntf: added TLazCompilationToolOptions.Parsers
git-svn-id: trunk@60844 -
This commit is contained in:
parent
31b4c73132
commit
db219396ae
@ -125,17 +125,24 @@ type
|
||||
FOwner: TLazCompilerOptions;
|
||||
FCommand: string;
|
||||
protected
|
||||
FParsers: TStrings;
|
||||
FCompileReasons: TCompileReasons;
|
||||
function GetHasParser(aParserName: string): boolean; virtual;
|
||||
procedure SetHasParser(aParserName: string; const AValue: boolean); virtual;
|
||||
procedure SetParsers(const AValue: TStrings); virtual;
|
||||
procedure SetCommand(AValue: string); virtual;
|
||||
procedure SetCompileReasons(const {%H-}AValue: TCompileReasons); virtual;
|
||||
public
|
||||
constructor Create(TheOwner: TLazCompilerOptions); virtual;
|
||||
destructor Destroy; override;
|
||||
procedure Clear; virtual;
|
||||
procedure Assign(Src: TLazCompilationToolOptions); virtual;
|
||||
public
|
||||
property Owner: TLazCompilerOptions read FOwner;
|
||||
property Command: string read FCommand write SetCommand;
|
||||
property CompileReasons: TCompileReasons read FCompileReasons write SetCompileReasons;
|
||||
property Parsers: TStrings read FParsers write SetParsers;
|
||||
property HasParser[aParserName: string]: boolean read GetHasParser write SetHasParser;
|
||||
end;
|
||||
|
||||
TLazCompilationToolClass = class of TLazCompilationToolOptions;
|
||||
@ -472,12 +479,20 @@ constructor TLazCompilationToolOptions.Create(TheOwner: TLazCompilerOptions);
|
||||
begin
|
||||
FOwner:=TheOwner;
|
||||
FCompileReasons:=crAll; // This default can be used in some comparisons.
|
||||
FParsers:=TStringList.Create;
|
||||
end;
|
||||
|
||||
destructor TLazCompilationToolOptions.Destroy;
|
||||
begin
|
||||
FreeAndNil(FParsers);
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
procedure TLazCompilationToolOptions.Clear;
|
||||
begin
|
||||
Command:='';
|
||||
FCompileReasons := crAll;
|
||||
FParsers.Clear;
|
||||
end;
|
||||
|
||||
procedure TLazCompilationToolOptions.Assign(Src: TLazCompilationToolOptions);
|
||||
@ -486,6 +501,37 @@ begin
|
||||
FCompileReasons := Src.CompileReasons;
|
||||
end;
|
||||
|
||||
function TLazCompilationToolOptions.GetHasParser(aParserName: string): boolean;
|
||||
begin
|
||||
Result:=FParsers.IndexOf(aParserName)>=0;
|
||||
end;
|
||||
|
||||
procedure TLazCompilationToolOptions.SetHasParser(aParserName: string;
|
||||
const AValue: boolean);
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
i:=FParsers.IndexOf(aParserName);
|
||||
if i>=0 then begin
|
||||
if AValue then exit;
|
||||
FParsers.Delete(i);
|
||||
end else begin
|
||||
if not AValue then exit;
|
||||
FParsers.Add(aParserName);
|
||||
end;
|
||||
Owner.IncreaseChangeStamp;
|
||||
end;
|
||||
|
||||
procedure TLazCompilationToolOptions.SetParsers(const AValue: TStrings);
|
||||
begin
|
||||
if FParsers.Equals(AValue) then Exit;
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TCompilationToolOptions.SetParsers ',AValue.Text]);
|
||||
{$ENDIF}
|
||||
FParsers.Assign(AValue);
|
||||
Owner.IncreaseChangeStamp;
|
||||
end;
|
||||
|
||||
procedure TLazCompilationToolOptions.SetCommand(AValue: string);
|
||||
begin
|
||||
if FCommand=AValue then exit;
|
||||
|
@ -335,19 +335,12 @@ type
|
||||
|
||||
TCompilationToolOptions = class(TLazCompilationToolOptions)
|
||||
private
|
||||
FParsers: TStrings;
|
||||
FParsedCommandStamp: integer;
|
||||
FParsedCommand: string;
|
||||
function GetHasParser(aParserName: string): boolean;
|
||||
procedure SetHasParser(aParserName: string; const AValue: boolean);
|
||||
procedure SetParsers(const AValue: TStrings);
|
||||
protected
|
||||
procedure SetCommand(AValue: string); override;
|
||||
procedure SubstituteMacros(var s: string); virtual;
|
||||
public
|
||||
constructor Create(TheOwner: TLazCompilerOptions); override;
|
||||
destructor Destroy; override;
|
||||
procedure Clear; override;
|
||||
function CreateDiff(CompOpts: TCompilationToolOptions;
|
||||
Tool: TCompilerDiffTool = nil): boolean; virtual;
|
||||
procedure Assign(Src: TLazCompilationToolOptions); override;
|
||||
@ -359,9 +352,6 @@ type
|
||||
function CreateExtTool(const WorkingDir, ToolTitle, CompileHint: string): TAbstractExternalTool;
|
||||
function GetParsedCommand: string; // resolved macros
|
||||
function HasCommands: boolean; // true if there is something to execute
|
||||
public
|
||||
property Parsers: TStrings read FParsers write SetParsers;
|
||||
property HasParser[aParserName: string]: boolean read GetHasParser write SetHasParser;
|
||||
end;
|
||||
|
||||
TCompilerMsgIdFlag = record
|
||||
@ -4206,37 +4196,6 @@ end;
|
||||
|
||||
{ TCompilationToolOptions }
|
||||
|
||||
function TCompilationToolOptions.GetHasParser(aParserName: string): boolean;
|
||||
begin
|
||||
Result:=FParsers.IndexOf(aParserName)>=0;
|
||||
end;
|
||||
|
||||
procedure TCompilationToolOptions.SetHasParser(aParserName: string;
|
||||
const AValue: boolean);
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
i:=FParsers.IndexOf(aParserName);
|
||||
if i>=0 then begin
|
||||
if AValue then exit;
|
||||
FParsers.Delete(i);
|
||||
end else begin
|
||||
if not AValue then exit;
|
||||
FParsers.Add(aParserName);
|
||||
end;
|
||||
Owner.IncreaseChangeStamp;
|
||||
end;
|
||||
|
||||
procedure TCompilationToolOptions.SetParsers(const AValue: TStrings);
|
||||
begin
|
||||
if FParsers.Equals(AValue) then Exit;
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TCompilationToolOptions.SetParsers ',AValue.Text]);
|
||||
{$ENDIF}
|
||||
FParsers.Assign(AValue);
|
||||
Owner.IncreaseChangeStamp;
|
||||
end;
|
||||
|
||||
procedure TCompilationToolOptions.SetCommand(AValue: string);
|
||||
begin
|
||||
inherited SetCommand(AValue);
|
||||
@ -4248,24 +4207,6 @@ begin
|
||||
IDEMacros.SubstituteMacros(s);
|
||||
end;
|
||||
|
||||
constructor TCompilationToolOptions.Create(TheOwner: TLazCompilerOptions);
|
||||
begin
|
||||
inherited Create(TheOwner);
|
||||
FParsers:=TStringList.Create;
|
||||
end;
|
||||
|
||||
destructor TCompilationToolOptions.Destroy;
|
||||
begin
|
||||
FreeAndNil(FParsers);
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
procedure TCompilationToolOptions.Clear;
|
||||
begin
|
||||
inherited Clear;
|
||||
Parsers.Clear;
|
||||
end;
|
||||
|
||||
procedure TCompilationToolOptions.Assign(Src: TLazCompilationToolOptions);
|
||||
begin
|
||||
inherited Assign(Src);
|
||||
|
Loading…
Reference in New Issue
Block a user