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.
Summary: | [PHP7] Syntax error with yield | ||
---|---|---|---|
Product: | php | Reporter: | m6w6 |
Component: | Editor | Assignee: | junichi11 |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | junichi11, tmysik |
Priority: | P3 | ||
Version: | 8.2 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: |
yield syntax error
screenshot |
Description
m6w6
2016-05-18 18:20:13 UTC
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. |