[fpc-pascal] deprecated syntax is inconsistent.
graemeg.lists at gmail.com
Thu Apr 29 12:00:44 CEST 2010
Michael Van Canneyt het geskryf:
> Jonas tried to explain that this is not possible.
Yes, but it is still very easy to detect the difference... I'll use your
> Consider the following - what you propose - statements:
> A : Integer;
> deprecated : Boolean;
> The compiler cannot decide whether the 'deprecated' is a modifier or the
Yes it can, because in your example 'deprecated' is followed by a colon and
A : Integer; deprecated;
This is *not* ambiguous at all, because the hint directive is immediately
followed by a semicolon. That is not the case in a type declaration like
you showed. A pretty clear difference.
> A : Integer deprecated;
> Deprecated : Boolean;
My suggestion could still work...
A: Integer; deprecated;
One is a hint directive because it follows a (type with) semicolon and is
immediately followed by another semicolon. The type declaration is
followed by a colon and a type. This looks pretty clear to me, and not
ambiguous at all.
- Graeme -
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
More information about the fpc-pascal