Blueberry
Blueberry copied to clipboard
Lack of support for arbitrary lvalues, no `foo.bar` or `foo[bar]`
foo[:bar] = 3
doesn't work, nor does foo.bar
. Also, no nesting is possible, so foo.bar[:bang].boo
doesn't work, which also doesn't work on the right-hand side, too.
Looks like assignment rule is not defined for arrays! Interesting.
You seemed to have deliberately commented out the test for that:
https://github.com/gosukiwi/Blueberry/blob/master/tests/test.js#L151
And if you're going to fix the nesting thing, you should do that by making the rule recursive.
Well there are several things to fix on the grammar I think, mostly for expressions. If I make chaining work, it will be with recursion :smile:
Right now you can do myVar = a.b.c().d
I just have to put array expressions into the mix.
One fun thing is that PHP 5 (unlike PHP 7) doesn't have arbitrarily-nestable lvalues or rvalues... so some things that Blueberry supports might not be supported in PHP 5 without adding brackets or temporary variables ^^
I worked on this in 2ef5eed87f8f68a881e319353e5ac74cacc06bce I don't think it's finished but it's a start :smile:
RHS values are still limited though, for example, you can't do f()[1]
(you can't do it in PHP 5 either)
I think PHP 5.6 (or was it 5.4?) fixed that one.