-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ternary requires even more space now #1507
Comments
Is this necessarily a bug? I guess it is technically a regression but I don't know that it was ever officially supported. |
it's documented here Line 108 in bec932c
|
We could add a compiler flag to disable symbol shorthand. |
The example I gave is not ambiguous because it currently doesn't parse, and there's really only one way to parse it. But if we support parsing that, then we need to decide whether |
Thanks for finding this! Given the greedy nature of the parser, it's pretty annoying to fix this, unless we
Probably worth seeing how much JS code has a space before but not after a colon in a ternary. |
Another thing we could try is maybe add snug ternaries as well like a?b:c But it may require another parser flag to correctly handle complex cases even still. |
by parser flag, do you mean like a config or parser internal state? |
In this case, I meant "parser internal state". Sorry for the ambiguity. It sounds like there might be interest in pursuing this. Snug ternaries would be nice to allow... |
a ?b :c
used to work, with #1498, it no longer parse, have to doa ?b : c
nowThe text was updated successfully, but these errors were encountered: