While I am not particularly leaning to either side on the "deprecated"
discussion, I found another "oddity" due to the single lookahead scenario
"strict" is allowed as identifier. the following does compile
var
strict: Integer;
BUT, because now e can have "strict private"; the following does NOT
compile:
type
TForm1 = class(TForm)
private
strict: Integer;
Even though I would think it to be correct code? (There probably exists
a wiki explaining it?)
Martin
On 29/04/2010 13:35, ik wrote:
On Thu, Apr 29, 2010 at 13:39, Jonas Maebe <jonas.ma...@elis.ugent.be
<mailto:jonas.ma...@elis.ugent.be>> wrote:
On 29 Apr 2010, at 12:00, Graeme Geldenhuys wrote:
Michael Van Canneyt het geskryf:
Consider the following - what you propose - statements:
Var
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 type.
Var
A : Integer; deprecated;
This is *not* ambiguous at all,
It is ambiguous to the compiler, as is explained in one of the
links I posted previously:
http://wiki.freepascal.org/User_Changes_2.4.0#Order_of_field_and_method.2Fproperty_declarations
"The above code was ambiguous to the compiler, because when it
finished parsing the property, it could not decide based on seeing
the default token whether this meant that the property was a
default property, or whether a field coming after the property was
called "default". It did find this out after it had parsed the
default token (because the next token was a ":" rather than a
";"), but by then it was too late."
The compiler uses only a single lookahead token, while
disambiguating your example would require two.
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal