mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-24 04:39:10 +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';
|
||||
SParserNoFieldsAllowed = 'Fields are not allowed in Interfaces';
|
||||
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.';
|
||||
SErrRecordPropertiesNotAllowed = 'Record properties not allowed at this location.';
|
||||
SErrRecordVisibilityNotAllowed = 'Record visibilities not allowed at this location.';
|
||||
@ -3804,6 +3805,7 @@ Var
|
||||
Proc: TPasProcedure;
|
||||
ProcType: TProcType;
|
||||
Prop : TPasProperty;
|
||||
Cons : TPasConst;
|
||||
isClass : Boolean;
|
||||
|
||||
begin
|
||||
@ -3813,6 +3815,14 @@ begin
|
||||
begin
|
||||
SaveComments;
|
||||
Case CurToken of
|
||||
tkConst:
|
||||
begin
|
||||
if Not AllowMethods then
|
||||
ParseExc(SErrRecordConstantsNotAllowed);
|
||||
ExpectToken(tkIdentifier);
|
||||
Cons:=ParseConstDecl(ARec);
|
||||
ARec.members.Add(Cons);
|
||||
end;
|
||||
tkClass:
|
||||
begin
|
||||
if Not AllowMethods then
|
||||
|
Loading…
Reference in New Issue
Block a user