Number literals (Was: Re: Case Range Statement ..)

Rainer Deyke rainerd at eldwood.com
Wed Jul 8 00:50:55 PDT 2009


Walter Bright wrote:
> Back in the 80's, there was some n.g. discussion about what x++++y meant
> and how it was lexed and parsed. The best answer was:
> 
> "Here a plus, there a plus, everywhere a plus plus."

What I'd really like to see is a lexer that parses operators by rules
rather than lists.  If '+' is a token and '++' is a single token, then
'+++' and '++++++++++' should also be recognized as tokens (which aren't
used by the language).

The only actual effect would be to would turn currently legal
expressions like 'a+++++b' (and '5....a') into syntax errors.


-- 
Rainer Deyke - rainerd at eldwood.com



More information about the Digitalmars-d mailing list