Improved BuckleScript method call syntax#941
Improved BuckleScript method call syntax#941SanderSpies wants to merge 3 commits intoreasonml:masterfrom SanderSpies:bucklescript_method
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.
Something goes wrong here.
There was a problem hiding this comment.
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##barintoFoo."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.