IDE: macro loop marker

git-svn-id: trunk@44091 -
This commit is contained in:
mattias 2014-02-16 01:34:41 +00:00
parent c0c6cfb914
commit ee2a512b9b
2 changed files with 21 additions and 19 deletions

View File

@ -1919,7 +1919,8 @@ var
OutFilename: String;
begin
Result:=TargetFilename;
IDEMacros.SubstituteMacros(Result);
if not IDEMacros.SubstituteMacros(Result) then
exit;
if (Result<>'') and FilenameIsAbsolute(Result) then begin
// fully specified target filename
end else if Result<>'' then begin

View File

@ -311,33 +311,34 @@ begin
inc(InUse);
if InUse>MaxUsePerMacro then begin
// cycle detected
MacroStr:='<CYCLE:'+MacroName+'>';
Result:=false;
exit;
Handled:=true;
MacroStr:='<MACRO-CYCLE:'+MacroName+'>';
end;
end;
end;
end;
if fBusy=nil then fBusy:=TStringList.Create;
try
fBusy.Add(MacroName);
if MacroParam<>'' then begin
// substitute param
if not SubstituteStr(MacroParam,Data,Depth+1) then begin
if not Handled then begin
if fBusy=nil then fBusy:=TStringList.Create;
try
fBusy.Add(MacroName);
if MacroParam<>'' 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;
exit;
end;
finally
fBusy.Delete(fBusy.Count-1);
end;
// find macro and get value
ExecuteMacro(MacroName,MacroParam,Data,Handled,Abort,Depth+1);
if Abort then begin
Result:=false;
exit;
end;
finally
fBusy.Delete(fBusy.Count-1);
MacroStr:=MacroParam;
end;
MacroStr:=MacroParam;
// mark unhandled macros
if not Handled and MarkUnhandledMacros then begin
MacroStr:=Format(lisTMunknownMacro, [MacroStr]);