mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 16:39:16 +02:00
compiler: simplify _CLASS token handling in object declarations by Sven Barth (issue #18425)
git-svn-id: trunk@16733 -
This commit is contained in:
parent
b49b3ecc61
commit
d37fde7302
@ -805,20 +805,18 @@ implementation
|
|||||||
_CLASS:
|
_CLASS:
|
||||||
begin
|
begin
|
||||||
is_classdef:=false;
|
is_classdef:=false;
|
||||||
{ read class method }
|
{ read class method/field/property }
|
||||||
if try_to_consume(_CLASS) then
|
consume(_CLASS);
|
||||||
begin
|
{ class modifier is only allowed for procedures, functions, }
|
||||||
{ class modifier is only allowed for procedures, functions, }
|
{ constructors, destructors, fields and properties }
|
||||||
{ constructors, destructors, fields and properties }
|
if not(token in [_FUNCTION,_PROCEDURE,_PROPERTY,_VAR,_CONSTRUCTOR,_DESTRUCTOR]) then
|
||||||
if not(token in [_FUNCTION,_PROCEDURE,_PROPERTY,_VAR,_CONSTRUCTOR,_DESTRUCTOR]) then
|
Message(parser_e_procedure_or_function_expected);
|
||||||
Message(parser_e_procedure_or_function_expected);
|
|
||||||
|
|
||||||
if is_interface(current_structdef) then
|
if is_interface(current_structdef) then
|
||||||
Message(parser_e_no_static_method_in_interfaces)
|
Message(parser_e_no_static_method_in_interfaces)
|
||||||
else
|
else
|
||||||
{ class methods are also allowed for Objective-C protocols }
|
{ class methods are also allowed for Objective-C protocols }
|
||||||
is_classdef:=true;
|
is_classdef:=true;
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
_PROCEDURE,
|
_PROCEDURE,
|
||||||
_FUNCTION:
|
_FUNCTION:
|
||||||
|
Loading…
Reference in New Issue
Block a user