mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 06:49:13 +02:00
* Handle consts in records
git-svn-id: trunk@31229 -
This commit is contained in:
parent
07c26c1754
commit
66f4d0bc4e
@ -64,6 +64,7 @@ resourcestring
|
|||||||
SParserNoConstructorAllowed = 'Constructors or Destructors are not allowed in Interfaces or Record helpers';
|
SParserNoConstructorAllowed = 'Constructors or Destructors are not allowed in Interfaces or Record helpers';
|
||||||
SParserNoFieldsAllowed = 'Fields are not allowed in Interfaces';
|
SParserNoFieldsAllowed = 'Fields are not allowed in Interfaces';
|
||||||
SParserInvalidRecordVisibility = 'Records can only have public and (strict) private as visibility specifiers';
|
SParserInvalidRecordVisibility = 'Records can only have public and (strict) private as visibility specifiers';
|
||||||
|
SErrRecordConstantsNotAllowed = 'Record constants not allowed at this location.';
|
||||||
SErrRecordMethodsNotAllowed = 'Record methods not allowed at this location.';
|
SErrRecordMethodsNotAllowed = 'Record methods not allowed at this location.';
|
||||||
SErrRecordPropertiesNotAllowed = 'Record properties not allowed at this location.';
|
SErrRecordPropertiesNotAllowed = 'Record properties not allowed at this location.';
|
||||||
SErrRecordVisibilityNotAllowed = 'Record visibilities not allowed at this location.';
|
SErrRecordVisibilityNotAllowed = 'Record visibilities not allowed at this location.';
|
||||||
@ -3804,6 +3805,7 @@ Var
|
|||||||
Proc: TPasProcedure;
|
Proc: TPasProcedure;
|
||||||
ProcType: TProcType;
|
ProcType: TProcType;
|
||||||
Prop : TPasProperty;
|
Prop : TPasProperty;
|
||||||
|
Cons : TPasConst;
|
||||||
isClass : Boolean;
|
isClass : Boolean;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
@ -3813,6 +3815,14 @@ begin
|
|||||||
begin
|
begin
|
||||||
SaveComments;
|
SaveComments;
|
||||||
Case CurToken of
|
Case CurToken of
|
||||||
|
tkConst:
|
||||||
|
begin
|
||||||
|
if Not AllowMethods then
|
||||||
|
ParseExc(SErrRecordConstantsNotAllowed);
|
||||||
|
ExpectToken(tkIdentifier);
|
||||||
|
Cons:=ParseConstDecl(ARec);
|
||||||
|
ARec.members.Add(Cons);
|
||||||
|
end;
|
||||||
tkClass:
|
tkClass:
|
||||||
begin
|
begin
|
||||||
if Not AllowMethods then
|
if Not AllowMethods then
|
||||||
|
Loading…
Reference in New Issue
Block a user