A lexical change (a breaking change, but trivial to fix)

deadalnix deadalnix at gmail.com
Sat Jul 7 18:29:37 PDT 2012


On 08/07/2012 00:04, H. S. Teoh wrote:
> On Sat, Jul 07, 2012 at 11:41:43PM +0200, Alex Rønne Petersen wrote:
>> On 07-07-2012 23:39, Mehrdad wrote:
>>> This might sound silly, but how about if D stopped allowing 0..2  as a
>>> range, and instead just said "invalid floating-point number"?
> [...]
>> ... why is this even done at the lexical stage? It should be done at
>> the parsing stage if anything.
> [...]
>
> This is because the lexer can mistakenly identify it as "0." followed by
> ".2" instead of "0" followed by ".." followed by "2".
>
> IMAO, this problem is caused by floating point notational stupidities
> like 0. and .1, especially the former. Get rid of the former (and
> optionally the latter) will fix a whole bunch of lexer pain in D.
>
>
> T
>

0. should be banned because of UFCS anyway.


More information about the Digitalmars-d mailing list