compiler: global property can't be a class property

git-svn-id: trunk@20441 -
This commit is contained in:
paul 2012-02-29 02:31:03 +00:00
parent 9e091cc15f
commit d59c0237b2
2 changed files with 9 additions and 11 deletions

View File

@ -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;

View File

@ -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;