mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 09:09:30 +02:00
compiler: global property can't be a class property
git-svn-id: trunk@20441 -
This commit is contained in:
parent
9e091cc15f
commit
d59c0237b2
@ -44,7 +44,7 @@ interface
|
||||
procedure types_dec(in_structure: boolean);
|
||||
procedure var_dec;
|
||||
procedure threadvar_dec;
|
||||
procedure property_dec(is_classpropery: boolean);
|
||||
procedure property_dec;
|
||||
procedure resourcestring_dec;
|
||||
|
||||
implementation
|
||||
@ -773,9 +773,10 @@ implementation
|
||||
end;
|
||||
|
||||
|
||||
procedure property_dec(is_classpropery: boolean);
|
||||
procedure property_dec;
|
||||
{ parses a global property (fpc mode feature) }
|
||||
var
|
||||
old_block_type : tblock_type;
|
||||
old_block_type: tblock_type;
|
||||
begin
|
||||
consume(_PROPERTY);
|
||||
if not(symtablestack.top.symtabletype in [staticsymtable,globalsymtable]) then
|
||||
@ -783,7 +784,7 @@ implementation
|
||||
old_block_type:=block_type;
|
||||
block_type:=bt_const;
|
||||
repeat
|
||||
read_property_dec(is_classpropery, nil);
|
||||
read_property_dec(false, nil);
|
||||
consume(_SEMICOLON);
|
||||
until token<>_ID;
|
||||
block_type:=old_block_type;
|
||||
|
@ -1840,8 +1840,8 @@ implementation
|
||||
if try_to_consume(_CLASS) then
|
||||
begin
|
||||
{ class modifier is only allowed for procedures, functions, }
|
||||
{ constructors, destructors, fields and properties }
|
||||
if not(token in [_FUNCTION,_PROCEDURE,_PROPERTY,_VAR,_CONSTRUCTOR,_DESTRUCTOR,_OPERATOR]) and
|
||||
{ constructors, destructors }
|
||||
if not(token in [_FUNCTION,_PROCEDURE,_CONSTRUCTOR,_DESTRUCTOR,_OPERATOR]) and
|
||||
not((token=_ID) and (idtoken=_OPERATOR)) then
|
||||
Message(parser_e_procedure_or_function_expected);
|
||||
|
||||
@ -1902,10 +1902,7 @@ implementation
|
||||
_PROPERTY:
|
||||
begin
|
||||
if (m_fpc in current_settings.modeswitches) then
|
||||
begin
|
||||
property_dec(is_classdef);
|
||||
is_classdef:=false;
|
||||
end
|
||||
property_dec
|
||||
else
|
||||
break;
|
||||
end;
|
||||
@ -1947,7 +1944,7 @@ implementation
|
||||
_PROPERTY:
|
||||
begin
|
||||
if (m_fpc in current_settings.modeswitches) then
|
||||
property_dec(false)
|
||||
property_dec
|
||||
else
|
||||
break;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user