This might sound silly, but how about if D stopped allowing 0..2 as a range, and instead just said "invalid floating-point number"?

Fixing it en masse would be pretty trivial... just run a regex to replace
        "\b(\d+)\.\."
with
        "\1 .. "
and you're good to go.

(Or if you want more accuracy, just take the compiler output and feed it back with a fix -- that would work too.)

The benefit, though, is that now you can do maximal munch without worrying about this edge case... which sure makes it easier to make a lexer.

Thoughts?

Reply via email to