Skip to content
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.

Lack of support for arbitrary lvalues, no foo.bar or foo[bar] #26

Open
hikari-no-yume opened this issue Nov 17, 2014 · 6 comments
Open
Assignees

Comments

@hikari-no-yume
Copy link
Contributor

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.

@gosukiwi
Copy link
Owner

Looks like assignment rule is not defined for arrays! Interesting.

@gosukiwi gosukiwi self-assigned this Nov 17, 2014
@hikari-no-yume
Copy link
Contributor Author

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.

@gosukiwi
Copy link
Owner

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 😄

Right now you can do myVar = a.b.c().d I just have to put array expressions into the mix.

@hikari-no-yume
Copy link
Contributor Author

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 ^^

@gosukiwi
Copy link
Owner

I worked on this in 2ef5eed
I don't think it's finished but it's a start 😄

RHS values are still limited though, for example, you can't do f()[1] (you can't do it in PHP 5 either)

@hikari-no-yume
Copy link
Contributor Author

I think PHP 5.6 (or was it 5.4?) fixed that one.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants