Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

And sadly x-----y won't parse :(


It's been a while I used C, but I for one am kind of glad that doesn't parse. If you need to do this, you can use parentheses:

    x - (--y)
or

    (x--) - y


All parse fine, and unambiguously, due to the maximal munch rule.

x---y is (x--)-y, which is semantically valid.

x-----y is ((x--)--)-y - but it's a semantic error, as x-- is not an lvalue.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: