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