3 ms·
"1+2" is a valid expression consisting of the three tokens "1", "+", and "2". It's permitted to omit whitespace between those tokens. The question is whether "
by _kst_ 5y ago
"1+2" is a valid expression consisting of the three tokens "1", "+", and "2". It's permitted to omit whitespace between those tokens.
The question is whether "0xfor" is a valid way to represent the two tokens "0xf", "or". My reading of the rules is that it isn't, and that whitespace is required.
- _kst_ 5y agoI read the rules incorrectly. It appears that "0xfor" is a valid way to represent the two tokens "0xf" and "or". The rule, which I initially misinterpreted, is: > Whitespace is needed between two tokens only if their concatenation could otherwise be interpreted as a different token (e.g., ab is one token, but a b is two tokens). Since "0xfor" cannot be interpreted as a different (single) token, whitespace is not needed. (I'm not a fan of this particular consequence of that rule, and I suspect it was not intended, but it says what it says.)