codetools: param specifier out only if modeswitch out is on

git-svn-id: trunk@32062 -
This commit is contained in:
mattias 2011-08-26 11:38:37 +00:00
parent 1ce3fe06e4
commit 76ed2c599f
6 changed files with 8 additions and 7 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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

View File

@ -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