-
Notifications
You must be signed in to change notification settings - Fork 428
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
Improved BuckleScript method call syntax #941
base: master
Are you sure you want to change the base?
Conversation
Context: we're sticking with cc spam @bsansouci @Schmavery @jordwalke @yunxing, adding a space after
I don't think @bobzhang made such thing work. This compiles to something weird: https://bloomberg.github.io/bucklescript/js-demo/?gist=0d4169c80f571302b5a163ee01556a7e |
@jordwalke mentioned a better form: |
That'd be a bit more tedious than |
It requires also some more work, so let's keep it as is. |
@chenglou your example probably is a bug on BuckleScript, it should fail with a nice error msg |
How about using '.=' instead of '#=' |
@bobzhang could easily be added (did a quick experiment). |
preview##style##border#=( | ||
Js.string "1px black dashed" | ||
); | ||
preview."style"."border"#= ( |
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.
Something goes wrong here.
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.
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.
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.
What's wrong exactly?
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.
Nevermind, I was looking wrong.
Adding a space (before and) after #= shouldn't result in any parsing issues. In fact, it should fix #856 |
Added support for |
Is this ready? |
Yes, ready for review |
this is good, would you do a sanity check on your side that no |
Updated with extra check for hash within method name. |
The parser && printer part looks good to me. @chenglou Feel free to merge this if the syntax also looks good to you. |
This PR works but completely wrecks editor highlighting. I can fix this for atom (and I guess vscode by extension), @jordwalke what about vim? cc @yunxing for emacs |
Will work on making the highlighting work then merge this tomorrow. |
#849
Changes
Foo##bar
intoFoo."bar"
Note that
##
still needs to used for scenario's like:Foo##(something."else").
Also
#=
has gotten an extra post space during printing as it otherwise will fail to be idempotent.