mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 07:39:26 +02:00
JCF2: Support constref keyword. Issue #27677, patch from Julian Puhl.
git-svn-id: trunk@48401 -
This commit is contained in:
parent
308ceaa44c
commit
d75669f8f9
@ -3842,14 +3842,14 @@ end;
|
||||
|
||||
procedure TBuildParseTree.RecogniseFormalParam;
|
||||
const
|
||||
PARAM_PREFIXES: TTokenTypeSet = [ttVar, ttConst];
|
||||
PARAM_PREFIXES: TTokenTypeSet = [ttVar, ttConst, ttConstRef];
|
||||
begin
|
||||
PushNode(nFormalParam);
|
||||
|
||||
if (fcTokenList.FirstSolidTokenType = ttOpenSquareBracket) then
|
||||
RecogniseAttributes;
|
||||
|
||||
{ FormalParm -> [VAR | CONST | OUT] Parameter
|
||||
{ FormalParm -> [VAR | CONST | CONSTREF | OUT] Parameter
|
||||
|
||||
'out' is different as it is also a param name so this is legal
|
||||
procedure Foo(out out: integer);
|
||||
@ -4479,8 +4479,8 @@ begin
|
||||
|
||||
Recognise(ttOpenSquareBracket);
|
||||
repeat
|
||||
if (fcTokenList.FirstSolidTokenType in [ttConst, ttVar, ttOut]) then
|
||||
Recognise([ttConst, ttVar, ttOut]);
|
||||
if (fcTokenList.FirstSolidTokenType in [ttConst, ttConstref, ttVar, ttOut]) then
|
||||
Recognise([ttConst, ttConstref, ttVar, ttOut]);
|
||||
|
||||
RecogniseIdentList(False);
|
||||
Recognise(ttColon);
|
||||
|
@ -93,6 +93,7 @@ type
|
||||
ttCase,
|
||||
ttClass,
|
||||
ttConst,
|
||||
ttConstref,
|
||||
ttContains,
|
||||
ttConstructor,
|
||||
ttDestructor,
|
||||
@ -322,7 +323,7 @@ const
|
||||
Declarations: TTokenTypeSet =
|
||||
[ttConst, ttResourceString, ttVar, ttThreadVar, ttType, ttLabel, ttExports];
|
||||
|
||||
ParamTypes: TTokenTypeSet = [ttVar, ttConst, ttOut];
|
||||
ParamTypes: TTokenTypeSet = [ttVar, ttConst, ttConstref, ttOut];
|
||||
|
||||
BlockOutdentWords: TTokenTypeSet =
|
||||
[ttVar, ttThreadVar, ttConst, ttResourceString, ttType, ttLabel,
|
||||
@ -581,6 +582,7 @@ begin
|
||||
AddKeyword('case', wtReservedWord, ttCase);
|
||||
AddKeyword('class', wtReservedWord, ttClass);
|
||||
AddKeyword('const', wtReservedWord, ttConst);
|
||||
AddKeyword('constref', wtReservedWordDirective, ttConstref);
|
||||
AddKeyword('constructor', wtReservedWord, ttConstructor);
|
||||
|
||||
AddKeyword('destructor', wtReservedWord, ttDestructor);
|
||||
|
Loading…
Reference in New Issue
Block a user