Closed lydell closed 10 years ago
Looks like the the Travis build fails on Node 0.11—sigh—do you understand why?
Thanks, this is great progress.
Looks like the the Travis build fails on Node 0.11—sigh—do you understand why?
Don't worry about it. It's currently broken due to https://github.com/michaelficarra/CoffeeScriptRedux/issues/319
common bug that bit me was [...]
jashkenas/coffeescript interface takes an options object as its second parameter, which may have a locals
member (called inScope
in CSR because we don't strive for interface parity) that lists names that should be considered already in scope. Ask the plugin maintainer to start using that.
A short digression.
I'm not sure what the ultimate goal is with this conversion, but one could also just strip the grammar of actions, and with the help of https://github.com/andreineculau/pegjs-override-action consolidate the actions in a standalone module.
@michaelficarra could you please have a look at the latest commit. It is a big improvement.
@michaelficarra Can we try to get this merged? Any change to the grammar is either blocked by this, or requires this PR to be updated.
I think this is a good start, but there are some things I don’t really like:
@var
for “global” variables. Might be better to just do it like in plain JavaScript.a:Foo? { a ?= []; @rp a}
. coffee-script then complains “Error on line 1: the variable "a" can't be assigned with ?= because it has not been declared before”. Rewriting it toa:Foo? { a = [] unless a?; @rp a}
doesn’t work either, because that addsvar a;
at the top of the function, shadowing the “a” label. In such cases I usedb:Foo? { a = if b? then b else []; @rp a}
. This could be solved by adding all labels as parameters in the added wrapper function, but I’m not sure that is easy to retrieve for plugins.Still, this is a step in the right direction. I just don’t feel like forking both the plugin and pegjs to improve them too right now—to tired from this conversion and tricky debugging ....