Hacker News new | ask | show | jobs
by Jach 5694 days ago
The only weird thing to me is this:

> # There are 46,908 different valid characters that you can use in an identifier

And yet among all those characters I can't have a question mark at the end of a boolean variable or function name...

Anyway, weirdness is no excuse for not supporting a feature in a parser!

2 comments

That must be because of the ternary operator:

    condition ? result-if-true : result-if-false
although you're probably right that a smarter parser should be able to distinguish between both cases. But then the next guy comes along and complains that he can't use a colon as a valid character in his variable names...
Bear in mind that this parser's job is only for syntax highlighting and, later on, refactoring. Hmmm... maybe highlighting literals would be useful. I'll have to think on that.