mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 15:20:49 +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;
|
procedure TBuildParseTree.RecogniseFormalParam;
|
||||||
const
|
const
|
||||||
PARAM_PREFIXES: TTokenTypeSet = [ttVar, ttConst];
|
PARAM_PREFIXES: TTokenTypeSet = [ttVar, ttConst, ttConstRef];
|
||||||
begin
|
begin
|
||||||
PushNode(nFormalParam);
|
PushNode(nFormalParam);
|
||||||
|
|
||||||
if (fcTokenList.FirstSolidTokenType = ttOpenSquareBracket) then
|
if (fcTokenList.FirstSolidTokenType = ttOpenSquareBracket) then
|
||||||
RecogniseAttributes;
|
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
|
'out' is different as it is also a param name so this is legal
|
||||||
procedure Foo(out out: integer);
|
procedure Foo(out out: integer);
|
||||||
@ -4479,8 +4479,8 @@ begin
|
|||||||
|
|
||||||
Recognise(ttOpenSquareBracket);
|
Recognise(ttOpenSquareBracket);
|
||||||
repeat
|
repeat
|
||||||
if (fcTokenList.FirstSolidTokenType in [ttConst, ttVar, ttOut]) then
|
if (fcTokenList.FirstSolidTokenType in [ttConst, ttConstref, ttVar, ttOut]) then
|
||||||
Recognise([ttConst, ttVar, ttOut]);
|
Recognise([ttConst, ttConstref, ttVar, ttOut]);
|
||||||
|
|
||||||
RecogniseIdentList(False);
|
RecogniseIdentList(False);
|
||||||
Recognise(ttColon);
|
Recognise(ttColon);
|
||||||
|
@ -93,6 +93,7 @@ type
|
|||||||
ttCase,
|
ttCase,
|
||||||
ttClass,
|
ttClass,
|
||||||
ttConst,
|
ttConst,
|
||||||
|
ttConstref,
|
||||||
ttContains,
|
ttContains,
|
||||||
ttConstructor,
|
ttConstructor,
|
||||||
ttDestructor,
|
ttDestructor,
|
||||||
@ -322,7 +323,7 @@ const
|
|||||||
Declarations: TTokenTypeSet =
|
Declarations: TTokenTypeSet =
|
||||||
[ttConst, ttResourceString, ttVar, ttThreadVar, ttType, ttLabel, ttExports];
|
[ttConst, ttResourceString, ttVar, ttThreadVar, ttType, ttLabel, ttExports];
|
||||||
|
|
||||||
ParamTypes: TTokenTypeSet = [ttVar, ttConst, ttOut];
|
ParamTypes: TTokenTypeSet = [ttVar, ttConst, ttConstref, ttOut];
|
||||||
|
|
||||||
BlockOutdentWords: TTokenTypeSet =
|
BlockOutdentWords: TTokenTypeSet =
|
||||||
[ttVar, ttThreadVar, ttConst, ttResourceString, ttType, ttLabel,
|
[ttVar, ttThreadVar, ttConst, ttResourceString, ttType, ttLabel,
|
||||||
@ -581,6 +582,7 @@ begin
|
|||||||
AddKeyword('case', wtReservedWord, ttCase);
|
AddKeyword('case', wtReservedWord, ttCase);
|
||||||
AddKeyword('class', wtReservedWord, ttClass);
|
AddKeyword('class', wtReservedWord, ttClass);
|
||||||
AddKeyword('const', wtReservedWord, ttConst);
|
AddKeyword('const', wtReservedWord, ttConst);
|
||||||
|
AddKeyword('constref', wtReservedWordDirective, ttConstref);
|
||||||
AddKeyword('constructor', wtReservedWord, ttConstructor);
|
AddKeyword('constructor', wtReservedWord, ttConstructor);
|
||||||
|
|
||||||
AddKeyword('destructor', wtReservedWord, ttDestructor);
|
AddKeyword('destructor', wtReservedWord, ttDestructor);
|
||||||
|
Loading…
Reference in New Issue
Block a user