<div dir="ltr">On Thu, Apr 29, 2010 at 13:39, Jonas Maebe <span dir="ltr"><<a 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="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); 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="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">
Michael Van Canneyt het geskryf:<br>
</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); 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 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><div><br>I probably missing something here but how does the compiler knows about override, cdecl etc... directives in one pass ?<br>
</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><font color="#888888">
<br>
<br>
Jonas</font><div><div></div><div class="h5"><br>
<br>
_______________________________________________<br>
fpc-pascal maillist - <a href="mailto:fpc-pascal@lists.freepascal.org" target="_blank">fpc-pascal@lists.freepascal.org</a><br>
<a href="http://lists.freepascal.org/mailman/listinfo/fpc-pascal" target="_blank">http://lists.freepascal.org/mailman/listinfo/fpc-pascal</a><br>
</div></div></blockquote></div><br>Ido<br></div>