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

H. S. Teoh hsteoh at quickfur.ath.cx
Sat Jul 7 15:04:07 PDT 2012


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

-- 
They say that "guns don't kill people, people kill people." Well I think
the gun helps. If you just stood there and yelled BANG, I don't think
you'd kill too many people. -- Eddie Izzard, Dressed to Kill


More information about the Digitalmars-d mailing list