mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 20:39:14 +02:00
IDE: macro loop marker
git-svn-id: trunk@44091 -
This commit is contained in:
parent
c0c6cfb914
commit
ee2a512b9b
@ -1919,7 +1919,8 @@ var
|
|||||||
OutFilename: String;
|
OutFilename: String;
|
||||||
begin
|
begin
|
||||||
Result:=TargetFilename;
|
Result:=TargetFilename;
|
||||||
IDEMacros.SubstituteMacros(Result);
|
if not IDEMacros.SubstituteMacros(Result) then
|
||||||
|
exit;
|
||||||
if (Result<>'') and FilenameIsAbsolute(Result) then begin
|
if (Result<>'') and FilenameIsAbsolute(Result) then begin
|
||||||
// fully specified target filename
|
// fully specified target filename
|
||||||
end else if Result<>'' then begin
|
end else if Result<>'' then begin
|
||||||
|
@ -311,33 +311,34 @@ begin
|
|||||||
inc(InUse);
|
inc(InUse);
|
||||||
if InUse>MaxUsePerMacro then begin
|
if InUse>MaxUsePerMacro then begin
|
||||||
// cycle detected
|
// cycle detected
|
||||||
MacroStr:='<CYCLE:'+MacroName+'>';
|
Handled:=true;
|
||||||
Result:=false;
|
MacroStr:='<MACRO-CYCLE:'+MacroName+'>';
|
||||||
exit;
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
if fBusy=nil then fBusy:=TStringList.Create;
|
if not Handled then begin
|
||||||
try
|
if fBusy=nil then fBusy:=TStringList.Create;
|
||||||
fBusy.Add(MacroName);
|
try
|
||||||
if MacroParam<>'' then begin
|
fBusy.Add(MacroName);
|
||||||
// substitute param
|
if MacroParam<>'' then begin
|
||||||
if not SubstituteStr(MacroParam,Data,Depth+1) then begin
|
// substitute param
|
||||||
|
if not SubstituteStr(MacroParam,Data,Depth+1) then begin
|
||||||
|
Result:=false;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
// find macro and get value
|
||||||
|
ExecuteMacro(MacroName,MacroParam,Data,Handled,Abort,Depth+1);
|
||||||
|
if Abort then begin
|
||||||
Result:=false;
|
Result:=false;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
finally
|
||||||
|
fBusy.Delete(fBusy.Count-1);
|
||||||
end;
|
end;
|
||||||
// find macro and get value
|
MacroStr:=MacroParam;
|
||||||
ExecuteMacro(MacroName,MacroParam,Data,Handled,Abort,Depth+1);
|
|
||||||
if Abort then begin
|
|
||||||
Result:=false;
|
|
||||||
exit;
|
|
||||||
end;
|
|
||||||
finally
|
|
||||||
fBusy.Delete(fBusy.Count-1);
|
|
||||||
end;
|
end;
|
||||||
MacroStr:=MacroParam;
|
|
||||||
// mark unhandled macros
|
// mark unhandled macros
|
||||||
if not Handled and MarkUnhandledMacros then begin
|
if not Handled and MarkUnhandledMacros then begin
|
||||||
MacroStr:=Format(lisTMunknownMacro, [MacroStr]);
|
MacroStr:=Format(lisTMunknownMacro, [MacroStr]);
|
||||||
|
Loading…
Reference in New Issue
Block a user