diff options
author | Nikita Popov <nikic@php.net> | 2012-05-30 02:44:06 +0200 |
---|---|---|
committer | Nikita Popov <nikic@php.net> | 2012-05-30 02:44:06 +0200 |
commit | bc08c2cf9485e20fea0eef7ab149cefdf9a3662e (patch) | |
tree | 902abf875287ba8842600cc5e84557ee30bfc2f4 /Zend/zend_compile.h | |
parent | 72a91d08e7d70d5524feb6cc7c8e32b3bd68f1df (diff) | |
download | php-git-bc08c2cf9485e20fea0eef7ab149cefdf9a3662e.tar.gz |
Add support for yielding keys
Keys are yielded using the
yield $key => $value
syntax. Currently this is implemented as a statement only and not as an
expression, because conflicts arise considering nesting and use in arrays:
yield yield $a => $b;
// could be either
yield (yield $a) => $b;
// or
yield (yield $a => $b);
Once I find some way to resolve these conflicts this should be available
as an expression too.
Also the key yielding code is rather copy-and-past-y for the value yielding
code, so that should be factored out.
Diffstat (limited to 'Zend/zend_compile.h')
-rw-r--r-- | Zend/zend_compile.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index 953a9f1df0..ec86ed86de 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -490,7 +490,7 @@ void zend_do_build_full_name(znode *result, znode *prefix, znode *name, int is_c int zend_do_begin_class_member_function_call(znode *class_name, znode *method_name TSRMLS_DC); void zend_do_end_function_call(znode *function_name, znode *result, const znode *argument_list, int is_method, int is_dynamic_fcall TSRMLS_DC); void zend_do_return(znode *expr, int do_end_vparse TSRMLS_DC); -void zend_do_yield(znode *result, const znode *expr TSRMLS_DC); +void zend_do_yield(znode *result, const znode *value, const znode *key TSRMLS_DC); void zend_do_suspend_if_generator(TSRMLS_D); void zend_do_handle_exception(TSRMLS_D); |