-
Notifications
You must be signed in to change notification settings - Fork 47
Partial ES 6 & 7. #64
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
Conversation
I'll leave this PR open so everyone can help me. :) |
dda848a
to
b9b83dd
Compare
b9b83dd
to
f8a0aea
Compare
f8a0aea
to
98935c7
Compare
testStmt "if (1) {}" `shouldBe` "Right (JSAstStatement (JSIf (JSDecimal '1') (JSStatementBlock [])))" | ||
-- fix: fix ambiguity with block and object literal on if block position | ||
-- testStmt "if (1) {x}" `shouldBe` "Right (JSAstStatement (JSIf (JSDecimal '1') (JSStatementBlock [JSIdentifier 'x'])))" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@erikd I need some help with this. I still can't figure it out a way to disambiguiate block and object on a if statement
. The minified version would print something like:
if(a){{x}}...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The inner {}
is the object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably this happens because it will try ObjectLiteral first (?).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with minor sensible changes to the tests as needed.
I am in need of arrow functions support, is there anything I can do to move help move this forward? |
@pedrofurla Sure. If you can make progress with this PR...please. I didn't have much time to finish it. I wrote language-js just for what I needed, but I hope this one can be finished as well. |
To be honest I am happy with its current state, but I will give it a go tomorrow and see what I can do. I make not promises. :) |
@diasbruno, thank you so much for looking into this! I tried pulling this branch to build my project, and I'm getting this error:
Looks like the |
hjsmin / language-javascript don't yet support ES 6/7, so had to remove all "arrow functions" Related: erikd/language-javascript#64
@dcastro I've implemented just the 'parser' part and few things just to compile/run tests. |
@diasbruno Do you think it would be better to split off the unimplemented features into a separate effort and get this PR into a merge-able state? Partial support of new features is definitely better than no support. |
I'd be find with partial support. |
That would be great. I was begin to worry about not getting time to finish this. Thank you all for the help. |
I would like to do a really through review of this before merging. Hopefully get around to this on the weekend. |
Going to have to revert this from the Will look at this myself today. |
This implements features for es 6 & 7.
Issue #59.