codetools: add Default compiler magic

git-svn-id: trunk@51353 -
This commit is contained in:
ondrej 2016-01-20 13:50:12 +00:00
parent 7c9c153453
commit 696ae12a21
3 changed files with 7 additions and 2 deletions

View File

@ -9470,8 +9470,10 @@ begin
exit;
ParamList:=CreateParamExprListFromStatement(CurPos.StartPos,Params);
if (CompareIdentifiers(IdentPos,'PREC')=0)
or (CompareIdentifiers(IdentPos,'SUCC')=0) then begin
// the PREC and SUCC of a expression has the same type as the expression
or (CompareIdentifiers(IdentPos,'SUCC')=0)
or (CompareIdentifiers(IdentPos,'DEFAULT')=0)
then begin
// the DEFAULT, PREC and SUCC of a expression has the same type as the expression
if ParamList.Count<>1 then exit;
Result:=ParamList.Items[0];
end

View File

@ -1383,6 +1383,7 @@ begin
AddCompilerProcedure('Continue','');
AddCompilerFunction('Copy','const S:String;FromPosition,Count:Integer', 'String');
AddCompilerProcedure('Dec','var X:Ordinal;N:Integer=1');
AddCompilerFunction('Default','T:Type','const');
AddCompilerProcedure('Dispose','var X:Pointer');
AddCompilerProcedure('Exclude','var S:Set;X:Ordinal');
AddCompilerProcedure('Exit','');
@ -2911,6 +2912,7 @@ var
AddCompilerProc('Concat','S1:String;S2:String[...;Sn:String]', 'String');
AddCompilerProc('Copy','const S:String;FromPosition,Count:Integer', 'String');
AddCompilerProc('Dec','var X:Ordinal;N:Integer=1');
AddCompilerProc('Default','T:Type','const');
AddCompilerProc('Dispose','var X:Pointer');
AddCompilerProc('Exclude','var S:Set;X:Ordinal');
AddCompilerProc('Exit','ResultValue:Ordinal=Result');

View File

@ -1245,6 +1245,7 @@ begin
Add('SETLENGTH' ,{$ifdef FPC}@{$endif}AllwaysTrue);
Add('INC' ,{$ifdef FPC}@{$endif}AllwaysTrue);
Add('DEC' ,{$ifdef FPC}@{$endif}AllwaysTrue);
Add('DEFAULT' ,{$ifdef FPC}@{$endif}AllwaysTrue);
Add('INITIALIZE' ,{$ifdef FPC}@{$endif}AllwaysTrue);
Add('FINALIZE' ,{$ifdef FPC}@{$endif}AllwaysTrue);
Add('COPY' ,{$ifdef FPC}@{$endif}AllwaysTrue);