mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 16:34:47 +01:00
Add support for Python 3.8 star expressions in yield statement
This commit is contained in:
parent
fb664b3456
commit
5d64139b8f
2 changed files with 16 additions and 0 deletions
|
@ -1560,6 +1560,14 @@ def test_yield_x_y():
|
|||
check_stmts("yield x, y", False)
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
VER_MAJOR_MINOR < (3, 8),
|
||||
reason="Python 3.8 feature"
|
||||
)
|
||||
def test_return_x_starexpr():
|
||||
check_stmts("yield x, *[y, z]", False)
|
||||
|
||||
|
||||
def test_yield_from_x():
|
||||
check_stmts("yield from x", False)
|
||||
|
||||
|
|
|
@ -429,3 +429,11 @@ class Parser(ThreeSixParser):
|
|||
lineno=p1.lineno,
|
||||
col_offset=p1.lexpos,
|
||||
)
|
||||
|
||||
def p_yield_arg_testlist(self, p):
|
||||
# remove pre 3.8 grammar
|
||||
pass
|
||||
|
||||
def p_yield_arg_testlist_star_expr(self, p):
|
||||
"""yield_arg : testlist_star_expr"""
|
||||
p[0] = {"from": False, "val": p[1][0]}
|
||||
|
|
Loading…
Add table
Reference in a new issue