mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 01:19:37 +02:00
codetools: param specifier out only if modeswitch out is on
git-svn-id: trunk@32062 -
This commit is contained in:
parent
1ce3fe06e4
commit
76ed2c599f
@ -314,7 +314,7 @@ var
|
||||
begin
|
||||
// read parameter prefix modifier
|
||||
if UpAtomIs('VAR') or UpAtomIs('CONST') or UpAtomIs('CONSTREF')
|
||||
or (UpAtomIs('OUT') and (Scanner.CompilerMode in [cmOBJFPC,cmDELPHI,cmFPC]))
|
||||
or (UpAtomIs('OUT') and (cmsOut in Scanner.CompilerModeSwitches))
|
||||
then begin
|
||||
CurParam.Modifier:=CurPos;
|
||||
ReadNextAtom;
|
||||
|
@ -1630,7 +1630,7 @@ var
|
||||
ParameterType:=ptConst
|
||||
else if UpAtomIs('VAR') then
|
||||
ParameterType:=ptVar
|
||||
else if UpAtomIs('OUT') then
|
||||
else if UpAtomIs('OUT') and (cmsOut in Scanner.CompilerModeSwitches) then
|
||||
ParameterType:=ptOut
|
||||
else
|
||||
ParameterType:=ptNoSpecifier;
|
||||
|
@ -7939,7 +7939,8 @@ begin
|
||||
if (ParamCompatibility=tcIncompatible)
|
||||
or ((ParamCompatibility=tcCompatible)
|
||||
and MoveCursorToParameterSpecifier(ParamNode)
|
||||
and (UpAtomIs('VAR') or UpAtomIs('OUT') or UpAtomIs('CONSTREF')))
|
||||
and (UpAtomIs('VAR') or UpAtomIs('CONSTREF')
|
||||
or (UpAtomIs('OUT') and (cmsOut in Scanner.CompilerModeSwitches))))
|
||||
then begin
|
||||
Result:=tcIncompatible;
|
||||
exit;
|
||||
|
@ -998,7 +998,7 @@ begin
|
||||
KeyWordLists.Add(WordIsKeyWord);
|
||||
with WordIsKeyWord do begin
|
||||
//Add('ON',{$ifdef FPC}@{$endif}AllwaysTrue); // not for Delphi
|
||||
Add('OUT',{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
//Add('OUT',{$ifdef FPC}@{$endif}AllwaysTrue); only if modeswitch out+
|
||||
Add('AND',{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('ARRAY',{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
Add('AS',{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||
|
@ -173,14 +173,14 @@ const
|
||||
[cmsResult,cmsProperty,cmsNested_comment,cmsCvar_support],
|
||||
// cmDELPHI
|
||||
[cmsDefault_ansistring,cmsResult,cmsAdvancedRecords,cmsProperty,
|
||||
cmsCvar_support],
|
||||
cmsCvar_support,cmsOut],
|
||||
// cmGPC
|
||||
[],
|
||||
// cmTP
|
||||
[cmsResult,cmsTp_procvar],
|
||||
// cmOBJFPC
|
||||
[cmsDefault_ansistring,cmsResult,cmsProperty,cmsNested_comment,
|
||||
cmsCvar_support],
|
||||
cmsCvar_support,cmsOut],
|
||||
// cmMacPas
|
||||
[cmsMac_procvar,cmsProperty],
|
||||
// cmISO
|
||||
|
@ -1172,7 +1172,7 @@ var CloseBracket: char;
|
||||
begin
|
||||
// read parameter prefix modifier
|
||||
if UpAtomIs('VAR') or UpAtomIs('CONST') or UpAtomIs('CONSTREF')
|
||||
or (UpAtomIs('OUT') and (Scanner.CompilerMode in [cmOBJFPC,cmDELPHI,cmFPC]))
|
||||
or (UpAtomIs('OUT') and (cmsOut in Scanner.CompilerModeSwitches))
|
||||
then begin
|
||||
if not Extract then
|
||||
ReadNextAtom
|
||||
|
Loading…
Reference in New Issue
Block a user