-
Notifications
You must be signed in to change notification settings - Fork 29
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
Arrow functions and parentheticals on their own line #272
Comments
A simple-ish fix would be to add a look-ahead in
Before the |
Probably create and use an |
This approach works pretty well, though there are some issues:
For the second issue in particular, I wonder about doing this in a second pass. Maybe a |
Good points. Maybe it would make more sense to do this in |
If we want a quick hacky solution for the meantime:
|
Fair enough. Tomorrow I can submit a PR for the hacky solution I put together. |
Fixes #272. Adds some extra semicolons, as it is based on input instead of generated code.
The following input transpiles to itself:
But JavaScript has trouble with it, trying to parse it as a function call
x(z)
and then failing withSyntaxError: Malformed arrow function parameter list
.Perhaps even grosser is that the following gets treated like a function call, but I don't think it should.
Perhaps we can automatically add semicolons in these cases?
The text was updated successfully, but these errors were encountered: