This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Created attachment 159806 [details] yield syntax error Not sure, what the problem is, maybe it expects parens? See screenshot and also bug #262141 https://netbeans.org/bugzilla/show_bug.cgi?id=262141
The problem is that out parser does not expect "yield ..." after "=" (the same applies for "yield from ..."). Again, current limitations of our PHP support internals. We are trying to fix it but it is not easy, sorry. Thanks.
I'll do it. Thanks.
Created attachment 162844 [details] screenshot Do you have other cases? If you have them, please let us know. Thanks! yield; (yield); yield yield; (yield yield); yield yield 2; (yield yield 2); yield $i; (yield $i); yield $key => $value; (yield $key => $value); $a = yield; $a = (yield); $a = yield yield; $a = (yield yield); $a = yield yield 2; $a = (yield yield 2); $a = yield $i; $a = (yield $i); $a = yield $key => $value; $a = (yield $key => $value); $a = $b = yield $key => $value; $a = $b = (yield $key => $value); $a = ($b = (yield $key => $value)); ($a = yield); $a = yield $test->foo->{"bar"}->baz(); yield yield from from(); yield from $from; (yield from $from); yield from from(); (yield from from()); yield from new ArrayIterator([2, 3, 4]); (yield from new ArrayIterator([2, 3, 4])); $c = yield from $from; $c = (yield from $from); $c = yield from from(); $c = (yield from from()); $c = yield from new ArrayIterator([2, 3, 4]); $c = (yield from new ArrayIterator([2, 3, 4])); $c = $d = yield from from(); $c = $d = (yield from from()); $c = ($d = (yield from from())); ($c = ($d = (yield from from()))); return yield from from(); return (yield from from());
Fixed. http://hg.netbeans.org/web-main/rev/ad833dc403d5 I hope that there isn't anything missing/wrong fix... Added expr_with_yields to restrict yield expressions to only equal assignments in the CUP file. If we don't want to restrict to it, add yield_expr and yield_from_expr to expr_without_variable_and_class_instance, then replace expr_with_yields to expr, remove expr_with_yields. Thanks!
Thanks a lot, Junichi! Great job!
You are welcome :)
Integrated into 'main-silver', will be available in build *201611120001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/ad833dc403d5 User: Junichi Yamamoto <junichi11@netbeans.org> Log: #262144 - [PHP7] Syntax error with yield Added expr_with_yields to restrict yield expressions to only equal assignments in the CUP.