com php-src: Add "yield from" support to ast pretty printer: Zend/tests/assert/expect_015.phpt Zend/zend_ast .c

From: Date: Tue, 14 Apr 2015 17:15:40 +0000
Subject: com php-src: Add "yield from" support to ast pretty printer: Zend/tests/assert/expect_015.phpt Zend/zend_ast .c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-86243@lists.php.net to get a copy of this message
Commit: acd61be98539c2f2a33bf2e0ce8c3987002d318b Author: Nikita Popov <nikic@php.net> Tue, 14 Apr 2015 19:15:40 +0200 Parents: 7bf5b341e473d7b81ee6e87a0aa1988dbb128402 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=acd61be98539c2f2a33bf2e0ce8c3987002d318b Log: Add "yield from" support to ast pretty printer Changed paths: M Zend/tests/assert/expect_015.phpt M Zend/zend_ast.c Diff: diff --git a/Zend/tests/assert/expect_015.phpt b/Zend/tests/assert/expect_015.phpt index c2ce1f7..80f1bd8 100644 --- a/Zend/tests/assert/expect_015.phpt +++ b/Zend/tests/assert/expect_015.phpt @@ -17,6 +17,7 @@ assert(0 && ($a = function () { @foo(); $y = clone $x; yield 1 => 2; + yield from $x; })); assert(0 && ($a = function &(array &$a, X $b = null) use ($c,&$d) : X { @@ -163,6 +164,7 @@ Warning: assert(): assert(0 && ($a = function () { @foo(); $y = clone $x; yield 1 => 2; + yield from $x; })) failed in %sexpect_015.php on line %d Warning: assert(): assert(0 && ($a = function &(array &$a, X $b = null) use($c, &$d): X { diff --git a/Zend/zend_ast.c b/Zend/zend_ast.c index d538a21...ef6da97 100644 --- a/Zend/zend_ast.c +++ b/Zend/zend_ast.c @@ -522,6 +522,7 @@ ZEND_API void zend_ast_apply(zend_ast *ast, zend_ast_apply_func fn) { * 60 right print * 70 right yield * 80 right => + * 85 right yield from * 90 right = += -= *= /= .= %= &= |= ^= <<= >>= **= * 100 left ? : * 110 right ?? @@ -1350,6 +1351,8 @@ simple_list: } if (priority > 70) smart_str_appendc(str, ')'); break; + case ZEND_AST_YIELD_FROM: + PREFIX_OP("yield from ", 85, 86); case ZEND_AST_COALESCE: BINARY_OP(" ?? ", 110, 111, 110); case ZEND_AST_STATIC: smart_str_appends(str, "static $");

« previous php.cvs (#86243) next »