Andrei Alexandrescu wrote:
Rainer Deyke wrote:
Andrei Alexandrescu wrote:
Now there are several problems with this. All of the following compile:
Possible solution: treat all sequences as dots as part of the same
token, always.
0.....wyda
0....wyda
0.... wyda
0... .wyda
0.. .wyda
0. ....wyda
All rejected by the lexer.
No. Actually, some, yes :o).
I think he meant those /could/ be made to be rejected by the lexer. At
least rejecting more than three consecutive dots leaves you with:
0... .wyda
0.. .wyda
which are ok. Also "0." and the like should be rejected.
0. .. .wyda
0. ...wyda
Legal and unambiguous.
And throroughly confusing, which was my point.
The ".name" syntax and the "number." are the things that are confusing,
not the inclusive/exclusive ranges.