* Fixed parsing of constref and one more case of deprecated hint

git-svn-id: trunk@21850 -
This commit is contained in:
michael 2012-07-10 15:14:14 +00:00
parent c04bfe02e3
commit f8e6cfc6b8
3 changed files with 16 additions and 2 deletions

View File

@ -496,7 +496,7 @@ type
TArgumentAccess = (argDefault, argConst, argVar, argOut); TArgumentAccess = (argDefault, argConst, argVar, argOut, argConstRef);
{ TPasArgument } { TPasArgument }
@ -1032,7 +1032,7 @@ type
end; end;
const const
AccessNames: array[TArgumentAccess] of string[6] = ('', 'const ', 'var ', 'out '); AccessNames: array[TArgumentAccess] of string[9] = ('', 'const ', 'var ', 'out ','constref ');
AllVisibilities: TPasMemberVisibilities = AllVisibilities: TPasMemberVisibilities =
[visDefault, visPrivate, visProtected, visPublic, [visDefault, visPrivate, visProtected, visPublic,
visPublished, visAutomated]; visPublished, visAutomated];

View File

@ -2357,6 +2357,10 @@ begin
begin begin
Access := argConst; Access := argConst;
Name := ExpectIdentifier; Name := ExpectIdentifier;
end else if CurToken = tkConstRef then
begin
Access := argConstref;
Name := ExpectIdentifier;
end else if CurToken = tkVar then end else if CurToken = tkVar then
begin begin
Access := ArgVar; Access := ArgVar;
@ -2597,6 +2601,14 @@ begin
if IsCurTokenHint(ahint) then // deprecated,platform,experimental,library, unimplemented etc if IsCurTokenHint(ahint) then // deprecated,platform,experimental,library, unimplemented etc
begin begin
element.hints:=element.hints+[ahint]; element.hints:=element.hints+[ahint];
if aHint=hDeprecated then
begin
nextToken;
if (CurToken<>tkString) then
UnGetToken
else
element.HintMessage:=curtokenstring;
end;
consumesemi; consumesemi;
end end
else if (tok = 'PUBLIC') then else if (tok = 'PUBLIC') then

View File

@ -87,6 +87,7 @@ type
tkcase, tkcase,
tkclass, tkclass,
tkconst, tkconst,
tkconstref,
tkconstructor, tkconstructor,
tkdestructor, tkdestructor,
tkdiv, tkdiv,
@ -412,6 +413,7 @@ const
'case', 'case',
'class', 'class',
'const', 'const',
'constref',
'constructor', 'constructor',
'destructor', 'destructor',
'div', 'div',