Skip to content

Commit a504083

Browse files
committed
Generic/LowerCaseKeyword: add extra tests with "yield from"
... to safeguard that a "yield from" keyword split into multiple tokens is still handled correctly.
1 parent 007267c commit a504083

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,12 @@ if (ISSET($a) && !Empty($a)) { UnSeT($a); }
5353
eval('foo');
5454
eVaL('foo');
5555

56+
$c = function() {
57+
Yield /*comment*/ From fun();
58+
YIELD
59+
/*comment*/
60+
FROM fun();
61+
}
62+
5663
__HALT_COMPILER(); // An exception due to phar support.
5764
function

src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc.fixed

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,12 @@ if (isset($a) && !empty($a)) { unset($a); }
5353
eval('foo');
5454
eval('foo');
5555

56+
$c = function() {
57+
yield /*comment*/ from fun();
58+
yield
59+
/*comment*/
60+
from fun();
61+
}
62+
5663
__HALT_COMPILER(); // An exception due to phar support.
5764
function

src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ public function getErrorList()
5252
48 => 1,
5353
52 => 3,
5454
54 => 1,
55+
57 => 2,
56+
58 => 1,
57+
60 => 1,
5558
];
5659

5760
}//end getErrorList()

0 commit comments

Comments
 (0)