<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
While I am not particularly leaning to either side on the "deprecated"
discussion, I found another "oddity" due to the single lookahead
scenario<br>
<br>
"strict" is allowed as identifier. the following does compile <br>
var<br>
strict: Integer;<br>
<br>
BUT, because now e can have "strict private"; the following does NOT
compile:<br>
type<br>
TForm1 = class(TForm)<br>
private<br>
strict: Integer;<br>
<br>
Even though I would think it to be correct code? (There probably exists
a wiki explaining it?)<br>
<br>
Martin<br>
<br>
On 29/04/2010 13:35, ik wrote:
<blockquote
cite="mid:u2rdc42cb951004290535l11cee2c0yd05116391966e4d@mail.gmail.com"
type="cite">
<div dir="ltr">On Thu, Apr 29, 2010 at 13:39, Jonas Maebe <span
dir="ltr"><<a moz-do-not-send="true"
href="mailto:jonas.maebe@elis.ugent.be">jonas.maebe@elis.ugent.be</a>></span>
wrote:<br>
<div class="gmail_quote">
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im"><br>
On 29 Apr 2010, at 12:00, Graeme Geldenhuys wrote:<br>
<br>
</div>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">Michael Van Canneyt het geskryf:<br>
</div>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Consider
the following - what you propose - statements:
<div class="im"><br>
<br>
Var<br>
A : Integer;<br>
deprecated : Boolean;<br>
<br>
The compiler cannot decide whether the 'deprecated' is a modifier or the<br>
</div>
</blockquote>
<div class="im"><br>
Yes it can, because in your example 'deprecated' is followed by a colon
and<br>
a type.<br>
<br>
Var<br>
A : Integer; deprecated;<br>
<br>
This is *not* ambiguous at all,<br>
</div>
</blockquote>
<br>
It is ambiguous to the compiler, as is explained in one of the links I
posted previously: <a moz-do-not-send="true"
href="http://wiki.freepascal.org/User_Changes_2.4.0#Order_of_field_and_method.2Fproperty_declarations"
target="_blank">http://wiki.freepascal.org/User_Changes_2.4.0#Order_of_field_and_method.2Fproperty_declarations</a><br>
<br>
"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."<br>
<br>
The compiler uses only a single lookahead token, while disambiguating
your example would require two.<br>
</blockquote>
<br>
</div>
</div>
</blockquote>
<br>
</body>
</html>