diff --git a/components/codetools/finddeclarationtool.pas b/components/codetools/finddeclarationtool.pas index 8e8ac3c8cb..128f401ff0 100644 --- a/components/codetools/finddeclarationtool.pas +++ b/components/codetools/finddeclarationtool.pas @@ -9527,6 +9527,11 @@ begin if ParamList.Count<>1 then exit; Result:=ParamList.Items[0]; end + else if (CompareIdentifiers(IdentPos,'IFTHEN')=0) then + begin + if ParamList.Count<>3 then exit; + Result:=ParamList.Items[1]; // ifthen sets the result based on the second parameter + end else if (CompareIdentifiers(IdentPos,'LOW')=0) or (CompareIdentifiers(IdentPos,'HIGH')=0) then begin diff --git a/components/codetools/identcompletiontool.pas b/components/codetools/identcompletiontool.pas index 42dd566397..5671b1c16a 100644 --- a/components/codetools/identcompletiontool.pas +++ b/components/codetools/identcompletiontool.pas @@ -1398,6 +1398,7 @@ begin AddCompilerProcedure('Finalize','var X'); AddCompilerFunction('get_frame','','Pointer'); AddCompilerFunction('High','Arg:TypeOrVariable','Ordinal'); + AddCompilerFunction('IfThen','Condition:Boolean;ThenExpr,ElseExpr:T','T'); AddCompilerProcedure('Inc','var X:Ordinal;N:Integer=1'); AddCompilerProcedure('Include','var S:Set;X:Ordinal'); AddCompilerProcedure('Initialize','var X'); @@ -2940,6 +2941,7 @@ var AddCompilerProc('Finalize','var X'); AddCompilerProc('get_frame','','Pointer'); AddCompilerProc('High','Arg:TypeOrVariable','Ordinal'); + AddCompilerProc('IfThen','Condition:Boolean;ThenExpr,ElseExpr:T','T'); AddCompilerProc('Inc','var X:Ordinal;N:Integer=1'); AddCompilerProc('Include','var S:Set;X:Ordinal'); AddCompilerProc('Initialize','var X'); diff --git a/components/codetools/keywordfunclists.pas b/components/codetools/keywordfunclists.pas index 6fb64b9c2f..42ff87694e 100644 --- a/components/codetools/keywordfunclists.pas +++ b/components/codetools/keywordfunclists.pas @@ -1246,6 +1246,7 @@ begin Add('INC' ,{$ifdef FPC}@{$endif}AllwaysTrue); Add('DEC' ,{$ifdef FPC}@{$endif}AllwaysTrue); Add('DEFAULT' ,{$ifdef FPC}@{$endif}AllwaysTrue); + Add('IFTHEN' ,{$ifdef FPC}@{$endif}AllwaysTrue); Add('INITIALIZE' ,{$ifdef FPC}@{$endif}AllwaysTrue); Add('FINALIZE' ,{$ifdef FPC}@{$endif}AllwaysTrue); Add('COPY' ,{$ifdef FPC}@{$endif}AllwaysTrue);