Node: external as a weak keyword, Next: forward near far, Previous: attribute as a weak keyword, Up: Parsing keywords
external
as a weak keywordThe situation about external
is similar to attribute
.
However, on the positive side, we don't have to worry about
constants which cannot be external – by definition, since
initialization and external declaration contradict each other.
The new problems are that an external
directive can be
followed by ;
, name
and by many more tokens if GPC
will support a BP compatible external
libname where
libname can be a string constant expression.
So we have to consider the problem from the other side. In an
id_list
of a variable declaration (which is the only
conflict, given the notes about attribute, attribute as a weak keyword.), an identifier can be followed only by ,
and
:
. These two tokens cannot follow an external
directive (not even in external
libname).
However, in other contexts, identifiers can be followed by other
tokens (even in an id_list
, e.g. procedure Foo (var
External; i: Integer);
), so we accept p_external
as a
new_identifier
everywhere except in variable declarations
(new_identifier_limited
id_list_limited
).
fjf793*.pas
are test programs for external
.
(Basically the same applies to the deprecated asmname
.)