mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 03:59:13 +02:00
IdeConfig: Fixes for checking the result of macro substitution
This commit is contained in:
parent
c9abc17db6
commit
30a7007a39
@ -365,7 +365,7 @@ begin
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
s:='';
|
s:='';
|
||||||
//IDEMessageDialog('Unknown Macro','Macro not defined: "'+s+'".',mtError,[mbAbort],0);
|
//IDEMessageDialog('Unknown Macro','Macro not defined: "'+s+'".',mtError,[mbAbort],0);
|
||||||
Handled:=true;
|
Handled:=false;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
@ -295,7 +295,10 @@ begin
|
|||||||
//debugln(['TTransferMacroList.SubstituteStr FUNC ',MacroName]);
|
//debugln(['TTransferMacroList.SubstituteStr FUNC ',MacroName]);
|
||||||
MacroEnd:=SearchBracketClose(MacroEnd)+1;
|
MacroEnd:=SearchBracketClose(MacroEnd)+1;
|
||||||
if MacroEnd>sLen+1 then
|
if MacroEnd>sLen+1 then
|
||||||
|
begin
|
||||||
|
result := false;
|
||||||
break; // missing closing bracket
|
break; // missing closing bracket
|
||||||
|
end;
|
||||||
OldMacroLen:=MacroEnd-MacroStart;
|
OldMacroLen:=MacroEnd-MacroStart;
|
||||||
MacroStr:=copy(s,MacroStart,OldMacroLen);
|
MacroStr:=copy(s,MacroStart,OldMacroLen);
|
||||||
// Macro found
|
// Macro found
|
||||||
@ -322,6 +325,8 @@ begin
|
|||||||
ExecuteMacro(MacroName,MacroParam,Data,Handled,Abort,Depth+1);
|
ExecuteMacro(MacroName,MacroParam,Data,Handled,Abort,Depth+1);
|
||||||
if Abort then
|
if Abort then
|
||||||
exit(false);
|
exit(false);
|
||||||
|
if not Handled then
|
||||||
|
result := false; // set error, but continue parsing
|
||||||
MacroStr:=MacroParam;
|
MacroStr:=MacroParam;
|
||||||
|
|
||||||
// substitute result
|
// substitute result
|
||||||
|
Loading…
Reference in New Issue
Block a user