diff options
20 files changed, 2317 insertions, 1102 deletions
diff --git a/Zend/tests/generators/basic_yield_from_exception_handling.phpt b/Zend/tests/generators/basic_yield_from_exception_handling.phpt new file mode 100644 index 0000000000..180cbee9dd --- /dev/null +++ b/Zend/tests/generators/basic_yield_from_exception_handling.phpt @@ -0,0 +1,59 @@ +--TEST-- +Exceptions in linear yield from setup +--FILE-- +<?php +function from($off) { + try { + yield $off + 1; + } catch (Exception $e) { print "catch in from()\n$e\n"; } + yield $off + 2; +} + +function gen() { + try { + yield "gen" => 0; + } catch (Exception $e) { print "catch in gen()\n$e\n"; } + try { + yield from from(0); + } catch (Exception $e) { print "catch in gen()\n$e\n"; } + yield from from(2); +} + +$i = 0; +try { + for ($gen = gen(); $gen->valid(); $gen->throw(new Exception((string) $i++))) { + var_dump($gen->current()); + } +} catch (Exception $e) { print "catch in {main}\n$e\n"; } + +var_dump($gen->valid()); + +?> +--EXPECTF-- +int(0) +catch in gen() +exception 'Exception' with message '0' in %s:%d +Stack trace: +#0 {main} +int(1) +catch in from() +exception 'Exception' with message '1' in %s:%d +Stack trace: +#0 {main} +int(2) +catch in gen() +exception 'Exception' with message '2' in %s:%d +Stack trace: +#0 {main} +int(3) +catch in from() +exception 'Exception' with message '3' in %s:%d +Stack trace: +#0 {main} +int(4) +catch in {main} +exception 'Exception' with message '4' in %s:%d +Stack trace: +#0 {main} +bool(false) + diff --git a/Zend/tests/generators/basic_yield_from_proxying.phpt b/Zend/tests/generators/basic_yield_from_proxying.phpt new file mode 100644 index 0000000000..74ffc5da80 --- /dev/null +++ b/Zend/tests/generators/basic_yield_from_proxying.phpt @@ -0,0 +1,42 @@ +--TEST-- +Basic test if yield from works +--FILE-- +<?php +function from() { + yield "from" => 1; + yield 2; +} + +function gen() { + yield "gen" => 0; + yield from from(); + yield 3; +} + +/* foreach API */ +foreach (gen() as $k => $v) { + var_dump($k, $v); +} + +/* iterator API */ +for ($gen = gen(); $gen->valid(); $gen->next()) { + var_dump($gen->key(), $gen->current()); +} +?> +--EXPECT-- +string(3) "gen" +int(0) +string(4) "from" +int(1) +int(0) +int(2) +int(0) +int(3) +string(3) "gen" +int(0) +string(4) "from" +int(1) +int(0) +int(2) +int(0) +int(3) diff --git a/Zend/tests/generators/multiple_yield_from_on_same_generator.phpt b/Zend/tests/generators/multiple_yield_from_on_same_generator.phpt new file mode 100644 index 0000000000..198377f8a1 --- /dev/null +++ b/Zend/tests/generators/multiple_yield_from_on_same_generator.phpt @@ -0,0 +1,41 @@ +--TEST-- +Multiple yield from on a same Generator instance +--FILE-- +<?php + +function gen($a = 0) { + yield 1 + $a; + if ($a < 1) { + var_dump(yield from gen($a + 1)); + } + yield 3 + $a; + return 5 + $a; +} + +function bar($gen) { + var_dump(yield from $gen); +} + +/* Twice a Generator from bar() using yield from on $gen */ +$gen = gen(); +$gens[] = bar($gen); +$gens[] = bar($gen); + +do { + foreach ($gens as $g) { + var_dump($g->current()); + $g->next(); + } +} while($gens[0]->valid()); +var_dump($gens[1]->valid()); + +?> +--EXPECT-- +int(1) +int(2) +int(4) +int(6) +int(3) +int(5) +bool(false) + diff --git a/Zend/tests/generators/mutli_yield_from_with_exception.phpt b/Zend/tests/generators/mutli_yield_from_with_exception.phpt new file mode 100644 index 0000000000..5180caa328 --- /dev/null +++ b/Zend/tests/generators/mutli_yield_from_with_exception.phpt @@ -0,0 +1,50 @@ +--TEST-- +Multiple yield from on a same Generator throwing an Exception +--FILE-- +<?php +function from() { + yield 1; + throw new Exception(); +} + +function gen($gen) { + try { + var_dump(yield from $gen); + } catch (Exception $e) { print "Caught exception!\n$e\n"; } +} + +$gen = from(); +$gens[] = gen($gen); +$gens[] = gen($gen); + +foreach ($gens as $g) { + $g->current(); // init. +} + +do { + foreach ($gens as $i => $g) { + print "Generator $i\n"; + var_dump($g->current()); + $g->next(); + } +} while($gens[0]->valid()); +?> +--EXPECTF-- +Generator 0 +int(1) +Caught exception! +exception 'Exception' in %s:%d +Stack trace: +#0 %s(%d): from() +#1 [internal function]: gen(Object(Generator)) +#2 %s(%d): Generator->next() +#3 {main} +Generator 1 + +Fatal error: Uncaught exception 'ClosedGeneratorException' with message 'Generator yielded from aborted, no return value available' in %s:%d +Stack trace: +#0 [internal function]: gen(Object(Generator)) +#1 %s(%d): Generator->current() +#2 {main} + thrown in %s on line %d + diff --git a/Zend/tests/generators/recursive_yield_from.phpt b/Zend/tests/generators/recursive_yield_from.phpt new file mode 100644 index 0000000000..dbf2c948ea --- /dev/null +++ b/Zend/tests/generators/recursive_yield_from.phpt @@ -0,0 +1,34 @@ +--TEST-- +Check if recursion with yield from works +--FILE-- +<?php + +function from($a = 0) { + yield 1 + $a; + if ($a <= 3) { + yield from from($a + 3); + yield from from($a + 6); + } + yield 2 + $a; +} + +function gen() { + yield from from(); +} + +foreach(gen() as $v) { + var_dump($v); +} +?> +--EXPECT-- +int(1) +int(4) +int(7) +int(8) +int(10) +int(11) +int(5) +int(7) +int(8) +int(2) + diff --git a/Zend/tests/generators/yield_from_array.phpt b/Zend/tests/generators/yield_from_array.phpt new file mode 100644 index 0000000000..1652ab2236 --- /dev/null +++ b/Zend/tests/generators/yield_from_array.phpt @@ -0,0 +1,22 @@ +--TEST-- +yielding values from an array +--FILE-- +<?php +function from() { + yield 0; + yield from []; // must not yield anything + yield from [1,2]; +} + +function gen() { + yield from from(); +} + +foreach(gen() as $v) { + var_dump($v); +} +?> +--EXPECT-- +int(0) +int(1) +int(2) diff --git a/Zend/tests/generators/yield_from_backtrace.phpt b/Zend/tests/generators/yield_from_backtrace.phpt new file mode 100644 index 0000000000..18781e7551 --- /dev/null +++ b/Zend/tests/generators/yield_from_backtrace.phpt @@ -0,0 +1,49 @@ +--TEST-- +Exceptions in linear yield from setup +--FILE-- +<?php +function from($off) { + debug_print_backtrace(); + yield $off + 1; +} + +function gen() { + yield 1; + debug_print_backtrace(); + yield 2; + yield from from(2); + debug_print_backtrace(); +} + +print "\nImplicit foreach:\n"; +foreach (gen() as $v) { + var_dump($v); +} + +print "\nExplicit iterator:\n"; +for ($gen = gen(); $gen->valid(); $gen->next()) { + var_dump($gen->current()); +} +?> +--EXPECTF-- +Implicit foreach: +int(1) +#0 gen() called at [%s:%d] +int(2) +#0 from(2) called at [%s:%d] +#1 gen() called at [%s:%d] +int(3) +#0 gen() called at [%s:%d] + +Explicit iterator: +int(1) +#0 gen() +#1 Generator->next() called at [%s:%d] +int(2) +#0 from(2) called at [%s:%d] +#1 gen() +#2 Generator->next() called at [%s:%d] +int(3) +#0 gen() +#1 Generator->next() called at [%s:%d] + diff --git a/Zend/tests/generators/yield_from_deep_recursion.phpt b/Zend/tests/generators/yield_from_deep_recursion.phpt new file mode 100644 index 0000000000..48dafcaf95 --- /dev/null +++ b/Zend/tests/generators/yield_from_deep_recursion.phpt @@ -0,0 +1,26 @@ +--TEST-- +Deep recursion with yield from +--FILE-- +<?php +ini_set("memory_limit", "60G"); + +function from($i) { + yield $i; +} + +function gen($i = 0) { + if ($i < 1000) { + yield from gen(++$i); + } else { + yield $i; + yield from from(++$i); + } +} + +foreach (gen() as $v) { + var_dump($v); +} +?> +--EXPECT-- +int(1000) +int(1001) diff --git a/Zend/tests/generators/yield_from_multi_tree.phpt b/Zend/tests/generators/yield_from_multi_tree.phpt new file mode 100644 index 0000000000..91ae80e909 --- /dev/null +++ b/Zend/tests/generators/yield_from_multi_tree.phpt @@ -0,0 +1,332 @@ +--TEST-- +yield from on multiple trees needing merge +--FILE-- +<?php + +function from($levels) { + foreach (range(0, 2 << $levels) as $v) { + yield $v; + } +} + +function gen($gen, $level) { + if ($level % 2) { + yield $gen->current(); + } + yield from $gen; +} + +foreach (range(0, 6) as $levels) { + print "$levels level".($levels == 1 ? "" : "s")."\n\n"; + + $all = array(); + $all[] = $gens[0][0] = from($levels); + + for ($level = 1; $level < $levels; $level++) { + for ($i = 0; $i < (1 << $level); $i++) { + $all[] = $gens[$level][$i] = gen($gens[$level-1][$i >> 1], $level); + } + } + + while (1) { + foreach ($all as $gen) { + var_dump($gen->current()); + $gen->next(); + if (!$gen->valid()) { + break 2; + } + } + } + + print "\n\n"; +} +?> +--EXPECT-- +0 levels + +int(0) +int(1) +int(2) + + +1 level + +int(0) +int(1) +int(2) +int(3) +int(4) + + +2 levels + +int(0) +int(1) +int(2) +int(3) +int(4) +int(5) +int(6) +int(7) +int(8) + + +3 levels + +int(0) +int(1) +int(2) +int(3) +int(4) +int(5) +int(6) +int(7) +int(8) +int(9) +int(10) +int(11) +int(12) +int(13) +int(14) +int(15) +int(16) + + +4 levels + +int(0) +int(1) +int(2) +int(3) +int(4) +int(5) +int(6) +int(7) +int(8) +int(9) +int(10) +int(11) +int(12) +int(13) +int(14) +int(15) +int(16) +int(17) +int(18) +int(19) +int(20) +int(21) +int(22) +int(23) +int(24) +int(25) +int(26) +int(27) +int(28) +int(29) +int(30) +int(31) +int(32) + + +5 levels + +int(0) +int(1) +int(2) +int(3) +int(4) +int(5) +int(6) +int(7) +int(8) +int(9) +int(10) +int(11) +int(12) +int(13) +int(14) +int(15) +int(16) +int(17) +int(18) +int(19) +int(20) +int(21) +int(22) +int(23) +int(24) +int(25) +int(26) +int(27) +int(28) +int(29) +int(30) +int(31) +int(32) +int(33) +int(34) +int(35) +int(36) +int(37) +int(38) +int(39) +int(40) +int(41) +int(42) +int(43) +int(44) +int(45) +int(46) +int(47) +int(48) +int(49) +int(50) +int(51) +int(52) +int(53) +int(54) +int(55) +int(56) +int(57) +int(58) +int(59) +int(60) +int(61) +int(62) +int(63) +int(64) + + +6 levels + +int(0) +int(1) +int(2) +int(3) +int(4) +int(5) +int(6) +int(7) +int(8) +int(9) +int(10) +int(11) +int(12) +int(13) +int(14) +int(15) +int(16) +int(17) +int(18) +int(19) +int(20) +int(21) +int(22) +int(23) +int(24) +int(25) +int(26) +int(27) +int(28) +int(29) +int(30) +int(31) +int(32) +int(33) +int(34) +int(35) +int(36) +int(37) +int(38) +int(39) +int(40) +int(41) +int(42) +int(43) +int(44) +int(45) +int(46) +int(47) +int(48) +int(49) +int(50) +int(51) +int(52) +int(53) +int(54) +int(55) +int(56) +int(57) +int(58) +int(59) +int(60) +int(61) +int(62) +int(63) +int(64) +int(65) +int(66) +int(67) +int(68) +int(69) +int(70) +int(71) +int(72) +int(73) +int(74) +int(75) +int(76) +int(77) +int(78) +int(79) +int(80) +int(81) +int(82) +int(83) +int(84) +int(85) +int(86) +int(87) +int(88) +int(89) +int(90) +int(91) +int(92) +int(93) +int(94) +int(95) +int(96) +int(97) +int(98) +int(99) +int(100) +int(101) +int(102) +int(103) +int(104) +int(105) +int(106) +int(107) +int(108) +int(109) +int(110) +int(111) +int(112) +int(113) +int(114) +int(115) +int(116) +int(117) +int(118) +int(119) +int(120) +int(121) +int(122) +int(123) +int(124) +int(125) +int(126) +int(127) +int(128) + diff --git a/Zend/tests/generators/yield_from_multi_tree_exception.phpt b/Zend/tests/generators/yield_from_multi_tree_exception.phpt new file mode 100644 index 0000000000..b250a744df --- /dev/null +++ b/Zend/tests/generators/yield_from_multi_tree_exception.phpt @@ -0,0 +1,78 @@ +--TEST-- +yield from on multiple trees needing merge +--FILE-- +<?php + +function from($levels) { + foreach (range(0, 2 << $levels) as $v) { + yield $v; + if ($v == (1 << ($levels - 1)) - 2) { + throw new Exception(); + } + } +} + +function gen($gen, $level) { + yield from $gen; +} + +$levels = 5; + +print "$levels levels\n\n"; + +$all = array(); +$all[] = $gens[0][0] = from($levels); + +for ($level = 1; $level < $levels; $level++) { + for ($i = 0; $i < (1 << $level); $i++) { + $all[] = $gens[$level][$i] = gen($gens[$level-1][$i >> 1], $level); + } +} + +for ($i = 0; $i < 2; $i++) { + try { + foreach ($all as $gen) { + var_dump($gen->current()); + $gen->next(); + if (!$gen->valid()) { + break; + } + } + } catch(Exception $e) { + print "$e\n"; + unset($all[array_search($gen, $all)]); + } +} +?> +--EXPECTF-- +5 levels + +int(0) +int(1) +int(2) +int(3) +int(4) +int(5) +int(6) +int(7) +int(8) +int(9) +int(10) +int(11) +int(12) +int(13) +int(14) +exception 'Exception' in %s:%d +Stack trace: +#0 %s(%d): from(5) +#1 %s(%d): gen(Object(Generator), 1) +#2 %s(%d): gen(Object(Generator), 2) +#3 [internal function]: gen(Object(Generator), 3) +#4 %s(%d): Generator->next() +#5 {main} +exception 'ClosedGeneratorException' with message 'Generator yielded from aborted, no return value available' in %s:%d +Stack trace: +#0 [internal function]: gen(Object(Generator), 1) +#1 %s(%d): Generator->current() +#2 {main} + diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index da90e4c98d..99908c11b1 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -27,6 +27,7 @@ #include "zend_exceptions.h" #include "zend_extensions.h" #include "zend_closures.h" +#include "zend_generators.h" #undef ZEND_TEST_EXCEPTIONS @@ -2249,6 +2250,8 @@ ZEND_FUNCTION(debug_print_backtrace) call_type = NULL; ZVAL_UNDEF(&arg_array); + ptr = zend_generator_check_placeholder_frame(ptr); + skip = ptr; /* skip internal handler */ if ((!skip->func || !ZEND_USER_CODE(skip->func->common.type)) && @@ -2444,6 +2447,8 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int frameno++; array_init(&stack_frame); + ptr = zend_generator_check_placeholder_frame(ptr); + skip = ptr; /* skip internal handler */ if ((!skip->func || !ZEND_USER_CODE(skip->func->common.type)) && diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index e42952ee91..e73bfab9fd 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -2028,7 +2028,7 @@ static zend_always_inline zend_generator *zend_get_running_generator(zend_execut zend_generator *generator = (zend_generator *) EX(return_value); /* However control may currently be delegated to another generator. * That's the one we're interested in. */ - return generator->current_generator; + return generator; } /* }}} */ diff --git a/Zend/zend_generators.c b/Zend/zend_generators.c index 8421d1fc7c..dba88cd57a 100644 --- a/Zend/zend_generators.c +++ b/Zend/zend_generators.c @@ -13,6 +13,7 @@ | license@zend.com so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Nikita Popov <nikic@php.net> | + | Bob Weinand <bobwei9@hotmail.com> | +----------------------------------------------------------------------+ */ @@ -25,6 +26,7 @@ #include "zend_generators.h" ZEND_API zend_class_entry *zend_ce_generator; +ZEND_API zend_class_entry *zend_ce_ClosedGeneratorException; static zend_object_handlers zend_generator_handlers; static zend_object *zend_generator_create(zend_class_entry *class_type); @@ -195,6 +197,10 @@ static void zend_generator_free_storage(zend_object *object) /* {{{ */ zval_ptr_dtor(&generator->retval); } + if (generator->node.children > 4) { + zend_hash_destroy(&generator->node.child.ht); + } + zend_object_std_dtor(&generator->std); if (generator->iterator) { @@ -216,7 +222,10 @@ static zend_object *zend_generator_create(zend_class_entry *class_type) /* {{{ * ZVAL_UNDEF(&generator->retval); ZVAL_UNDEF(&generator->values); - zend_ptr_stack_init(&generator->generator_stack); + /* By default we have a tree of only one node */ + generator->node.parent = NULL; + generator->node.children = 0; + generator->node.ptr.root = generator; zend_object_std_init(&generator->std, class_type); generator->std.handlers = &zend_generator_handlers; @@ -283,7 +292,6 @@ ZEND_API void zend_generator_create_zval(zend_execute_data *call, zend_op_array /* Save execution context in generator object. */ generator = (zend_generator *) Z_OBJ_P(return_value); - execute_data->prev_execute_data = NULL; generator->execute_data = execute_data; generator->stack = EG(vm_stack); generator->stack->top = EG(vm_stack_top); @@ -291,11 +299,11 @@ ZEND_API void zend_generator_create_zval(zend_execute_data *call, zend_op_array EG(vm_stack_end) = current_stack->end; EG(vm_stack) = current_stack; - /* By default we obviously execute the generator itself. */ - generator->current_generator = generator; - /* EX(return_value) keeps pointer to zend_object (not a real zval) */ execute_data->return_value = (zval*)generator; + + memset(&generator->execute_fake, 0, sizeof(zend_execute_data)); + Z_OBJ(generator->execute_fake.This) = (zend_object *) generator; } /* }}} */ @@ -307,6 +315,261 @@ static zend_function *zend_generator_get_constructor(zend_object *object) /* {{{ } /* }}} */ +ZEND_API zend_execute_data *zend_generator_check_placeholder_frame(zend_execute_data *ptr) +{ + if (!ptr->func && ptr->prev_execute_data && Z_OBJ(ptr->This)) { + if (Z_OBJCE(ptr->This) == zend_ce_generator) { + zend_generator *generator = (zend_generator *) Z_OBJ(ptr->This); + zend_generator *root = (generator->node.children < 1 ? generator : generator->node.ptr.leaf)->node.ptr.root; + zend_execute_data *prev = ptr->prev_execute_data; + if (generator->node.parent != root) { + do { + generator->execute_data->prev_execute_data = prev; + prev = generator->execute_data; + generator = generator->node.parent; + } while (generator->node.parent != root); + } + generator->execute_data->prev_execute_data = prev; + ptr = generator->execute_data; + } + } + return ptr; +} + +static void zend_generator_throw_exception(zend_generator *generator, zval *exception) +{ + /* Throw the exception in the context of the generator */ + zend_execute_data *original_execute_data = EG(current_execute_data); + EG(current_execute_data) = generator->execute_data; + if (exception) { + zend_throw_exception_object(exception); + } else { + zend_throw_exception_internal(NULL); + } + EG(current_execute_data) = original_execute_data; +} + +static zend_generator *zend_generator_get_child(zend_generator_node *node, zend_generator *leaf) +{ + switch (node->children) { + case 0: + return NULL; + case 1: + return node->child.array[0].child; + +#define ZEND_GEN_GET_CHILD(x) \ + if (node->child.array[x].leaf == leaf) { \ + return node->child.array[x].child; \ + } + case 4: + ZEND_GEN_GET_CHILD(3) + case 3: + ZEND_GEN_GET_CHILD(2) + case 2: + ZEND_GEN_GET_CHILD(1) + ZEND_GEN_GET_CHILD(0) + ZEND_ASSERT(0); // we never should have no matching child + } + + return zend_hash_index_find_ptr(&node->child.ht, (zend_ulong) leaf); +} + +static zend_generator_node *zend_generator_search_multi_children_node(zend_generator_node *node) +{ + while (node->children == 1) { + node = &node->child.array[0].child->node; + } + return node->children > 1 ? node : NULL; +} + +static void zend_generator_add_single_child(zend_generator_node *node, zend_generator *child, zend_generator *leaf) +{ + if (node->children < 4) { + node->child.array[node->children].leaf = leaf; + node->child.array[node->children].child = child; + } else if (node->children > 4) { + zend_hash_index_add_ptr(&node->child.ht, (zend_ulong) leaf, child); + } else { + struct { + zend_generator *leaf; + zend_generator *child; + } array[4]; + int i; + + memcpy(&array, &node->child.array, sizeof(array)); + zend_hash_init(&node->child.ht, 5, sigh, NULL, 0); + for (i = 0; i < 4; i++) { + zend_hash_index_add_ptr(&node->child.ht, (zend_ulong) array[i].leaf, array[i].child); + } + zend_hash_index_add_ptr(&node->child.ht, (zend_ulong) leaf, child); + } + + node->children++; +} + +static void zend_generator_merge_child_nodes(zend_generator_node *dest, zend_generator_node *src, zend_generator *child) +{ + if (src->children <= 4) { + int i = src->children; + while (i--) { + zend_generator_add_single_child(dest, child, src->child.array[i].leaf); + } + } else { + zend_ulong leaf; + ZEND_HASH_FOREACH_NUM_KEY(&src->child.ht, leaf) { + zend_generator_add_single_child(dest, child, (zend_generator *) leaf); + } ZEND_HASH_FOREACH_END(); + } +} + +static void zend_generator_add_child(zend_generator *generator, zend_generator *child) +{ + zend_generator *leaf = child->node.children ? child->node.ptr.leaf : child; + zend_generator_node *multi_children_node; + zend_bool was_leaf = generator->node.children == 0; + + if (was_leaf) { + zend_generator *next = generator->node.parent; + leaf->node.ptr.root = generator->node.ptr.root; + generator->node.ptr.leaf = leaf; + + while (next) { + if (next->node.children > 1) { + if (next->node.children > 4) { + zend_generator *child = zend_hash_index_find_ptr(&next->node.child.ht, (zend_ulong) generator); + zend_hash_index_del(&next->node.child.ht, (zend_ulong) generator); + zend_hash_index_add_ptr(&next->node.child.ht, (zend_ulong) leaf, child); + } else { + switch (next->node.children) { +#define ZEND_GEN_UPDATE_CHILD(x) \ + if (next->node.child.array[x].leaf == generator) { \ + next->node.child.array[x].leaf = leaf; \ + break; \ + } + case 4: + ZEND_GEN_UPDATE_CHILD(3) + case 3: + ZEND_GEN_UPDATE_CHILD(2) + case 2: + ZEND_GEN_UPDATE_CHILD(1) + ZEND_GEN_UPDATE_CHILD(0) + ZEND_ASSERT(0); // we never should have no matching child + } + } + } + + next->node.ptr.leaf = leaf; + next = next->node.parent; + } + + zend_generator_add_single_child(&generator->node, child, leaf); + } else if (generator->node.children == 1) { + multi_children_node = zend_generator_search_multi_children_node(&generator->node); + if (multi_children_node) { + generator->node.children = 0; + zend_generator_merge_child_nodes(&generator->node, multi_children_node, generator->node.child.array[0].child); + } + } + + if (!was_leaf) { + multi_children_node = zend_generator_search_multi_children_node(&child->node); + } else { + multi_children_node = (zend_generator_node *) 0x1; + } + + { + zend_generator *parent = generator->node.parent, *cur = generator; + + if (multi_children_node > (zend_generator_node *) 0x1) { + zend_generator_merge_child_nodes(&generator->node, multi_children_node, child); + } else { + zend_generator_add_single_child(&generator->node, child, leaf); + } + while (parent) { + if (parent->node.children > 1) { + if (multi_children_node == (zend_generator_node *) 0x1) { + multi_children_node = zend_generator_search_multi_children_node(&child->node); + } + if (multi_children_node) { + zend_generator_merge_child_nodes(&parent->node, multi_children_node, cur); + } else { + zend_generator_add_single_child(&parent->node, cur, leaf); + } + } + cur = parent; + parent = parent->node.parent; + } + } +} + +void zend_generator_yield_from(zend_generator *this, zend_generator *from) +{ + zend_generator_add_child(from, this); + + this->node.parent = from; +} + +ZEND_API zend_generator *zend_generator_get_current(zend_generator *generator) +{ + zend_generator *leaf; + zend_generator *root; + + if (generator->node.parent == NULL) { + /* we're not in yield from mode */ + return generator; + } + + leaf = generator->node.children ? generator->node.ptr.leaf : generator; + root = leaf->node.ptr.root; + + if (root->execute_data && root->node.parent == NULL) { + /* generator still running */ + return root; + } + + while (!root->execute_data && root != generator) { + /* generator at the root had stopped */ + root = zend_generator_get_child(&root->node, leaf); + } + + if (root->node.parent) { + if (root->node.parent->execute_data == NULL) { + if (EXPECTED(EG(exception) == NULL)) { + zend_op *yield_from = (zend_op *) root->execute_data->opline - 1; + + if (yield_from->opcode == ZEND_YIELD_FROM && !(yield_from->result_type & EXT_TYPE_UNUSED)) { + if (Z_ISUNDEF(root->node.parent->retval)) { + /* Throw the exception in the context of the generator */ + zend_execute_data *original_execute_data = EG(current_execute_data); + EG(current_execute_data) = root->execute_data; + + if (root == generator) { + root->execute_data->prev_execute_data = original_execute_data; + } else { + root->execute_data->prev_execute_data = &generator->execute_fake; + generator->execute_fake.prev_execute_data = original_execute_data; + } + + zend_throw_exception(zend_ce_ClosedGeneratorException, "Generator yielded from aborted, no return value available", 0); + + EG(current_execute_data) = original_execute_data; + } else { + ZVAL_COPY(ZEND_CALL_VAR(root->execute_data, yield_from->result.var), &root->node.parent->retval); + } + } + } + + root->node.parent = NULL; + } else { + do { + root = root->node.parent; + } while (root->node.parent); + } + } + + return leaf->node.ptr.root = root; +} + static int zend_generator_get_next_delegated_value(zend_generator *generator) /* {{{ */ { zval *value; @@ -383,29 +646,37 @@ failure: } /* }}} */ -ZEND_API void zend_generator_resume(zend_generator *generator) /* {{{ */ +ZEND_API void zend_generator_resume(zend_generator *orig_generator) /* {{{ */ { + zend_generator *generator; + /* The generator is already closed, thus can't resume */ - if (!generator->execute_data) { + if (!orig_generator->execute_data) { return; } + generator = zend_generator_get_current(orig_generator); + +try_again: if (generator->flags & ZEND_GENERATOR_CURRENTLY_RUNNING) { zend_error(E_ERROR, "Cannot resume an already running generator"); } -try_again: if (!Z_ISUNDEF(generator->values)) { if (zend_generator_get_next_delegated_value(generator) == SUCCESS) { return; } /* If there are no more deletegated values, resume the generator - * at the "yield *" expression. */ - // TODO: Handle exceptions + * after the "yield from" expression. */ + } + + if ((orig_generator->flags & ZEND_GENERATOR_DO_INIT) && !Z_ISUNDEF(generator->value)) { + /* We must not advance Generator if we yield from a Generator being currently run */ + return; } /* Drop the AT_FIRST_YIELD flag */ - generator->flags &= ~ZEND_GENERATOR_AT_FIRST_YIELD; + orig_generator->flags &= ~ZEND_GENERATOR_AT_FIRST_YIELD; { /* Backup executor globals */ @@ -424,7 +695,14 @@ try_again: /* We want the backtrace to look as if the generator function was * called from whatever method we are current running (e.g. next()). * So we have to link generator call frame with caller call frame. */ - generator->execute_data->prev_execute_data = original_execute_data; + if (generator == orig_generator) { + generator->execute_data->prev_execute_data = original_execute_data; + } else { + /* We need some execute_data placeholder in stacktrace to be replaced + * by the real stack trace when needed */ + generator->execute_data->prev_execute_data = &orig_generator->execute_fake; + orig_generator->execute_fake.prev_execute_data = original_execute_data; + } /* Resume execution */ generator->flags |= ZEND_GENERATOR_CURRENTLY_RUNNING; @@ -435,7 +713,6 @@ try_again: if (generator->execute_data) { generator->stack = EG(vm_stack); generator->stack->top = EG(vm_stack_top); - generator->execute_data->prev_execute_data = NULL; } /* Restore executor globals */ @@ -446,13 +723,24 @@ try_again: EG(vm_stack) = original_stack; /* If an exception was thrown in the generator we have to internally - * rethrow it in the parent scope. */ + * rethrow it in the parent scope. + * In case we did yield from, the Exception must be rethrown into + * its calling frame (see above in if (check_yield_from). */ if (UNEXPECTED(EG(exception) != NULL)) { - zend_throw_exception_internal(NULL); + zend_generator_close(generator, 0); + + if (generator == orig_generator) { + zend_throw_exception_internal(NULL); + } else { + generator = zend_generator_get_current(orig_generator); + zend_generator_throw_exception(generator, NULL); + goto try_again; + } } - /* Yield-from was used, try another resume. */ - if (!Z_ISUNDEF(generator->values)) { + /* yield from was used, try another resume. */ + if ((generator != orig_generator && !Z_ISUNDEF(generator->retval)) || (generator->execute_data && (generator->execute_data->opline - 1)->opcode == ZEND_YIELD_FROM)) { + generator = zend_generator_get_current(orig_generator); goto try_again; } } @@ -461,8 +749,10 @@ try_again: static void zend_generator_ensure_initialized(zend_generator *generator) /* {{{ */ { - if (generator->execute_data && Z_TYPE(generator->value) == IS_UNDEF) { + if (generator->execute_data && Z_TYPE(generator->value) == IS_UNDEF && generator->node.parent == NULL) { + generator->flags |= ZEND_GENERATOR_DO_INIT; zend_generator_resume(generator); + generator->flags &= ~ZEND_GENERATOR_DO_INIT; generator->flags |= ZEND_GENERATOR_AT_FIRST_YIELD; } } @@ -508,7 +798,9 @@ ZEND_METHOD(Generator, valid) zend_generator_ensure_initialized(generator); - RETURN_BOOL(Z_TYPE(generator->value) != IS_UNDEF); + zend_generator_get_current(generator); + + RETURN_BOOL(Z_TYPE(generator->value) != IS_UNDEF || generator->node.parent != NULL); } /* }}} */ @@ -516,7 +808,7 @@ ZEND_METHOD(Generator, valid) * Get the current value */ ZEND_METHOD(Generator, current) { - zend_generator *generator; + zend_generator *generator, *root; if (zend_parse_parameters_none() == FAILURE) { return; @@ -526,8 +818,9 @@ ZEND_METHOD(Generator, current) zend_generator_ensure_initialized(generator); - if (Z_TYPE(generator->value) != IS_UNDEF) { - RETURN_ZVAL_FAST(&generator->value); + root = zend_generator_get_current(generator); + if (Z_TYPE(root->value) != IS_UNDEF) { + RETURN_ZVAL_FAST(&root->value); } } /* }}} */ @@ -536,7 +829,7 @@ ZEND_METHOD(Generator, current) * Get the current key */ ZEND_METHOD(Generator, key) { - zend_generator *generator; + zend_generator *generator, *root; if (zend_parse_parameters_none() == FAILURE) { return; @@ -546,8 +839,9 @@ ZEND_METHOD(Generator, key) zend_generator_ensure_initialized(generator); - if (Z_TYPE(generator->key) != IS_UNDEF) { - RETURN_ZVAL_FAST(&generator->key); + root = zend_generator_get_current(generator); + if (Z_TYPE(root->key) != IS_UNDEF) { + RETURN_ZVAL_FAST(&root->key); } } /* }}} */ @@ -575,7 +869,7 @@ ZEND_METHOD(Generator, next) ZEND_METHOD(Generator, send) { zval *value; - zend_generator *generator; + zend_generator *generator, *root; if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &value) == FAILURE) { return; @@ -590,16 +884,18 @@ ZEND_METHOD(Generator, send) return; } + root = zend_generator_get_current(generator); /* Put sent value in the target VAR slot, if it is used */ - if (generator->send_target) { - if (Z_REFCOUNTED_P(generator->send_target)) Z_DELREF_P(generator->send_target); - ZVAL_COPY(generator->send_target, value); + if (root->send_target) { + if (Z_REFCOUNTED_P(root->send_target)) Z_DELREF_P(root->send_target); + ZVAL_COPY(root->send_target, value); } zend_generator_resume(generator); - if (Z_TYPE(generator->value) != IS_UNDEF) { - RETURN_ZVAL_FAST(&generator->value); + root = zend_generator_get_current(generator); + if (Z_TYPE(root->value) != IS_UNDEF) { + RETURN_ZVAL_FAST(&root->value); } } /* }}} */ @@ -622,18 +918,15 @@ ZEND_METHOD(Generator, throw) zend_generator_ensure_initialized(generator); if (generator->execute_data) { - /* Throw the exception in the context of the generator */ - zend_execute_data *current_execute_data = EG(current_execute_data); - EG(current_execute_data) = generator->execute_data; - - zend_throw_exception_object(&exception_copy); + zend_generator *root = zend_generator_get_current(generator); - EG(current_execute_data) = current_execute_data; + zend_generator_throw_exception(root, &exception_copy); zend_generator_resume(generator); - if (Z_TYPE(generator->value) != IS_UNDEF) { - RETURN_ZVAL_FAST(&generator->value); + root = zend_generator_get_current(generator); + if (Z_TYPE(root->value) != IS_UNDEF) { + RETURN_ZVAL_FAST(&root->value); } } else { /* If the generator is already closed throw the exception in the @@ -704,28 +997,34 @@ static int zend_generator_iterator_valid(zend_object_iterator *iterator) /* {{{ zend_generator_ensure_initialized(generator); - return Z_TYPE(generator->value) != IS_UNDEF ? SUCCESS : FAILURE; + zend_generator_get_current(generator); + + return Z_TYPE(generator->value) != IS_UNDEF || generator->node.parent != NULL ? SUCCESS : FAILURE; } /* }}} */ static zval *zend_generator_iterator_get_data(zend_object_iterator *iterator) /* {{{ */ { - zend_generator *generator = (zend_generator*)Z_OBJ(iterator->data); + zend_generator *generator = (zend_generator*)Z_OBJ(iterator->data), *root; zend_generator_ensure_initialized(generator); - return &generator->value; + root = zend_generator_get_current(generator); + + return &root->value; } /* }}} */ static void zend_generator_iterator_get_key(zend_object_iterator *iterator, zval *key) /* {{{ */ { - zend_generator *generator = (zend_generator*)Z_OBJ(iterator->data); + zend_generator *generator = (zend_generator*)Z_OBJ(iterator->data), *root; zend_generator_ensure_initialized(generator); - if (Z_TYPE(generator->key) != IS_UNDEF) { - ZVAL_ZVAL(key, &generator->key, 1, 0); + root = zend_generator_get_current(generator); + + if (Z_TYPE(root->key) != IS_UNDEF) { + ZVAL_ZVAL(key, &root->key, 1, 0); } else { ZVAL_NULL(key); } @@ -830,6 +1129,9 @@ void zend_register_generator_ce(void) /* {{{ */ zend_generator_handlers.dtor_obj = zend_generator_dtor_storage; zend_generator_handlers.clone_obj = NULL; zend_generator_handlers.get_constructor = zend_generator_get_constructor; + + INIT_CLASS_ENTRY(ce, "ClosedGeneratorException", NULL); + zend_ce_ClosedGeneratorException = zend_register_internal_class_ex(&ce, zend_exception_get_default()); } /* }}} */ diff --git a/Zend/zend_generators.h b/Zend/zend_generators.h index 42f890e78f..be960483fb 100644 --- a/Zend/zend_generators.h +++ b/Zend/zend_generators.h @@ -13,6 +13,7 @@ | license@zend.com so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Nikita Popov <nikic@php.net> | + | Bob Weinand <bobwei9@hotmail.com> | +----------------------------------------------------------------------+ */ @@ -24,8 +25,28 @@ BEGIN_EXTERN_C() extern ZEND_API zend_class_entry *zend_ce_generator; - -typedef struct _zend_generator { +extern ZEND_API zend_class_entry *zend_ce_ClosedGeneratorException; + +typedef struct _zend_generator_node zend_generator_node; +typedef struct _zend_generator zend_generator; + +struct _zend_generator_node { + zend_generator *parent; /* NULL for root */ + uint32_t children; + union { + HashTable ht; /* if > 4 children */ + struct { + zend_generator *leaf; + zend_generator *child; + } array[4]; /* if <= 4 children */ + } child; + union { + zend_generator *leaf; /* if > 0 children */ + zend_generator *root; /* if 0 children */ + } ptr; +}; + +struct _zend_generator { zend_object std; zend_object_iterator *iterator; @@ -48,33 +69,37 @@ typedef struct _zend_generator { /* Largest used integer key for auto-incrementing keys */ zend_long largest_used_integer_key; - /* Values specified by "yield *" to yield from this generator. + /* Values specified by "yield from" to yield from this generator. * This is only used for arrays or non-generator Traversables. * This zval also uses the u2 structure in the same way as * by-value foreach. */ zval values; - /* Generator that is currently yielding values. This will differ - * from the surrounding structure if "yield *" is used on a generator. */ - struct _zend_generator *current_generator; - - /* Stack of waiting generators when multiple "yield *" expressions + /* Node of waiting generators when multiple "yield *" expressions * are nested. */ - zend_ptr_stack generator_stack; + zend_generator_node node; + + /* Fake execute_data for stacktraces */ + zend_execute_data execute_fake; /* ZEND_GENERATOR_* flags */ zend_uchar flags; -} zend_generator; +}; static const zend_uchar ZEND_GENERATOR_CURRENTLY_RUNNING = 0x1; static const zend_uchar ZEND_GENERATOR_FORCED_CLOSE = 0x2; static const zend_uchar ZEND_GENERATOR_AT_FIRST_YIELD = 0x4; +static const zend_uchar ZEND_GENERATOR_DO_INIT = 0x8; void zend_register_generator_ce(void); ZEND_API void zend_generator_create_zval(zend_execute_data *call, zend_op_array *op_array, zval *return_value); ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished_execution); ZEND_API void zend_generator_resume(zend_generator *generator); +void zend_generator_yield_from(zend_generator *this, zend_generator *from); +ZEND_API zend_generator *zend_generator_get_current(zend_generator *generator); +ZEND_API zend_execute_data *zend_generator_check_placeholder_frame(zend_execute_data *ptr); + END_EXTERN_C() #endif diff --git a/Zend/zend_hash.h b/Zend/zend_hash.h index afa3602fae..6e349cd283 100644 --- a/Zend/zend_hash.h +++ b/Zend/zend_hash.h @@ -545,6 +545,15 @@ static zend_always_inline void *zend_hash_str_update_mem(HashTable *ht, const ch return zend_hash_str_update_ptr(ht, str, len, p); } +static zend_always_inline void *zend_hash_index_add_ptr(HashTable *ht, zend_ulong h, void *pData) +{ + zval tmp, *zv; + + ZVAL_PTR(&tmp, pData); + zv = zend_hash_index_add(ht, h, &tmp); + return zv ? Z_PTR_P(zv) : NULL; +} + static zend_always_inline void *zend_hash_index_update_ptr(HashTable *ht, zend_ulong h, void *pData) { zval tmp, *zv; diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y index 65ccbab3bb..6f83b79812 100644 --- a/Zend/zend_language_parser.y +++ b/Zend/zend_language_parser.y @@ -67,6 +67,7 @@ static YYSIZE_T zend_yytnamerr(char*, const char*); %right T_PRINT %right T_YIELD %right T_DOUBLE_ARROW +%right T_YIELD_FROM %left '=' T_PLUS_EQUAL T_MINUS_EQUAL T_MUL_EQUAL T_DIV_EQUAL T_CONCAT_EQUAL T_MOD_EQUAL T_AND_EQUAL T_OR_EQUAL T_XOR_EQUAL T_SL_EQUAL T_SR_EQUAL T_POW_EQUAL %left '?' ':' %right T_COALESCE @@ -112,6 +113,7 @@ static YYSIZE_T zend_yytnamerr(char*, const char*); %token T_LOGICAL_AND "and (T_LOGICAL_AND)" %token T_PRINT "print (T_PRINT)" %token T_YIELD "yield (T_YIELD)" +%token T_YIELD_FROM "yield from (T_YIELD_FROM)" %token T_PLUS_EQUAL "+= (T_PLUS_EQUAL)" %token T_MINUS_EQUAL "-= (T_MINUS_EQUAL)" %token T_MUL_EQUAL "*= (T_MUL_EQUAL)" @@ -872,7 +874,7 @@ expr_without_variable: | T_YIELD { $$ = zend_ast_create(ZEND_AST_YIELD, NULL, NULL); } | T_YIELD expr { $$ = zend_ast_create(ZEND_AST_YIELD, $2, NULL); } | T_YIELD expr T_DOUBLE_ARROW expr { $$ = zend_ast_create(ZEND_AST_YIELD, $4, $2); } - | T_YIELD '*' expr { $$ = zend_ast_create(ZEND_AST_YIELD_FROM, $3); } + | T_YIELD_FROM expr { $$ = zend_ast_create(ZEND_AST_YIELD_FROM, $2); } | function returns_ref '(' parameter_list ')' lexical_vars return_type backup_doc_comment '{' inner_statement_list '}' { $$ = zend_ast_create_decl(ZEND_AST_CLOSURE, $2, $1, $8, diff --git a/Zend/zend_language_scanner.c b/Zend/zend_language_scanner.c index 99c2555487..74aaf892ac 100644 --- a/Zend/zend_language_scanner.c +++ b/Zend/zend_language_scanner.c @@ -1139,7 +1139,7 @@ yyc_INITIAL: yy3: YYDEBUG(3, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1766 "Zend/zend_language_scanner.l" +#line 1770 "Zend/zend_language_scanner.l" { if (YYCURSOR > YYLIMIT) { return 0; @@ -1202,7 +1202,7 @@ yy5: yy6: YYDEBUG(6, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1757 "Zend/zend_language_scanner.l" +#line 1761 "Zend/zend_language_scanner.l" { if (CG(short_tags)) { BEGIN(ST_IN_SCRIPTING); @@ -1217,7 +1217,7 @@ yy7: ++YYCURSOR; YYDEBUG(8, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1744 "Zend/zend_language_scanner.l" +#line 1748 "Zend/zend_language_scanner.l" { BEGIN(ST_IN_SCRIPTING); return T_OPEN_TAG_WITH_ECHO; @@ -1253,7 +1253,7 @@ yy13: yy14: YYDEBUG(14, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1750 "Zend/zend_language_scanner.l" +#line 1754 "Zend/zend_language_scanner.l" { HANDLE_NEWLINE(yytext[yyleng-1]); BEGIN(ST_IN_SCRIPTING); @@ -1329,7 +1329,7 @@ yyc_ST_BACKQUOTE: yy19: YYDEBUG(19, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2176 "Zend/zend_language_scanner.l" +#line 2180 "Zend/zend_language_scanner.l" { if (YYCURSOR > YYLIMIT) { return 0; @@ -1381,7 +1381,7 @@ yy21: ++YYCURSOR; YYDEBUG(22, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2120 "Zend/zend_language_scanner.l" +#line 2124 "Zend/zend_language_scanner.l" { BEGIN(ST_IN_SCRIPTING); return '`'; @@ -1396,7 +1396,7 @@ yy24: ++YYCURSOR; YYDEBUG(25, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2107 "Zend/zend_language_scanner.l" +#line 2111 "Zend/zend_language_scanner.l" { Z_LVAL_P(zendlval) = (zend_long) '{'; yy_push_state(ST_IN_SCRIPTING); @@ -1419,7 +1419,7 @@ yy26: yy28: YYDEBUG(28, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1831 "Zend/zend_language_scanner.l" +#line 1835 "Zend/zend_language_scanner.l" { zend_copy_value(zendlval, (yytext+1), (yyleng-1)); return T_VARIABLE; @@ -1430,7 +1430,7 @@ yy29: ++YYCURSOR; YYDEBUG(30, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1555 "Zend/zend_language_scanner.l" +#line 1559 "Zend/zend_language_scanner.l" { yy_push_state(ST_LOOKING_FOR_VARNAME); return T_DOLLAR_OPEN_CURLY_BRACES; @@ -1449,7 +1449,7 @@ yy33: ++YYCURSOR; YYDEBUG(34, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1824 "Zend/zend_language_scanner.l" +#line 1828 "Zend/zend_language_scanner.l" { yyless(yyleng - 1); yy_push_state(ST_VAR_OFFSET); @@ -1474,7 +1474,7 @@ yy36: ++YYCURSOR; YYDEBUG(37, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1815 "Zend/zend_language_scanner.l" +#line 1819 "Zend/zend_language_scanner.l" { yyless(yyleng - 3); yy_push_state(ST_LOOKING_FOR_PROPERTY); @@ -1549,7 +1549,7 @@ yy40: yy41: YYDEBUG(41, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2126 "Zend/zend_language_scanner.l" +#line 2130 "Zend/zend_language_scanner.l" { if (GET_DOUBLE_QUOTES_SCANNED_LENGTH()) { YYCURSOR += GET_DOUBLE_QUOTES_SCANNED_LENGTH() - 1; @@ -1609,7 +1609,7 @@ yy43: ++YYCURSOR; YYDEBUG(44, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2115 "Zend/zend_language_scanner.l" +#line 2119 "Zend/zend_language_scanner.l" { BEGIN(ST_IN_SCRIPTING); return '"'; @@ -1624,7 +1624,7 @@ yy46: ++YYCURSOR; YYDEBUG(47, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2107 "Zend/zend_language_scanner.l" +#line 2111 "Zend/zend_language_scanner.l" { Z_LVAL_P(zendlval) = (zend_long) '{'; yy_push_state(ST_IN_SCRIPTING); @@ -1647,7 +1647,7 @@ yy48: yy50: YYDEBUG(50, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1831 "Zend/zend_language_scanner.l" +#line 1835 "Zend/zend_language_scanner.l" { zend_copy_value(zendlval, (yytext+1), (yyleng-1)); return T_VARIABLE; @@ -1658,7 +1658,7 @@ yy51: ++YYCURSOR; YYDEBUG(52, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1555 "Zend/zend_language_scanner.l" +#line 1559 "Zend/zend_language_scanner.l" { yy_push_state(ST_LOOKING_FOR_VARNAME); return T_DOLLAR_OPEN_CURLY_BRACES; @@ -1677,7 +1677,7 @@ yy55: ++YYCURSOR; YYDEBUG(56, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1824 "Zend/zend_language_scanner.l" +#line 1828 "Zend/zend_language_scanner.l" { yyless(yyleng - 1); yy_push_state(ST_VAR_OFFSET); @@ -1702,7 +1702,7 @@ yy58: ++YYCURSOR; YYDEBUG(59, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1815 "Zend/zend_language_scanner.l" +#line 1819 "Zend/zend_language_scanner.l" { yyless(yyleng - 3); yy_push_state(ST_LOOKING_FOR_PROPERTY); @@ -1720,7 +1720,7 @@ yyc_ST_END_HEREDOC: ++YYCURSOR; YYDEBUG(63, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2093 "Zend/zend_language_scanner.l" +#line 2097 "Zend/zend_language_scanner.l" { zend_heredoc_label *heredoc_label = zend_ptr_stack_pop(&SCNG(heredoc_label_stack)); @@ -1795,7 +1795,7 @@ yy66: yy67: YYDEBUG(67, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2218 "Zend/zend_language_scanner.l" +#line 2222 "Zend/zend_language_scanner.l" { int newline = 0; @@ -1883,7 +1883,7 @@ yy70: ++YYCURSOR; YYDEBUG(71, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2107 "Zend/zend_language_scanner.l" +#line 2111 "Zend/zend_language_scanner.l" { Z_LVAL_P(zendlval) = (zend_long) '{'; yy_push_state(ST_IN_SCRIPTING); @@ -1906,7 +1906,7 @@ yy72: yy74: YYDEBUG(74, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1831 "Zend/zend_language_scanner.l" +#line 1835 "Zend/zend_language_scanner.l" { zend_copy_value(zendlval, (yytext+1), (yyleng-1)); return T_VARIABLE; @@ -1917,7 +1917,7 @@ yy75: ++YYCURSOR; YYDEBUG(76, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1555 "Zend/zend_language_scanner.l" +#line 1559 "Zend/zend_language_scanner.l" { yy_push_state(ST_LOOKING_FOR_VARNAME); return T_DOLLAR_OPEN_CURLY_BRACES; @@ -1936,7 +1936,7 @@ yy79: ++YYCURSOR; YYDEBUG(80, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1824 "Zend/zend_language_scanner.l" +#line 1828 "Zend/zend_language_scanner.l" { yyless(yyleng - 1); yy_push_state(ST_VAR_OFFSET); @@ -1961,7 +1961,7 @@ yy82: ++YYCURSOR; YYDEBUG(83, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1815 "Zend/zend_language_scanner.l" +#line 1819 "Zend/zend_language_scanner.l" { yyless(yyleng - 3); yy_push_state(ST_LOOKING_FOR_PROPERTY); @@ -2135,23 +2135,23 @@ yy86: YYDEBUG(-1, yych); switch ((yych = *YYCURSOR)) { case 'C': - case 'c': goto yy695; + case 'c': goto yy702; case 'L': - case 'l': goto yy696; + case 'l': goto yy703; case 'M': - case 'm': goto yy697; + case 'm': goto yy704; case 'N': - case 'n': goto yy698; + case 'n': goto yy705; case 'V': - case 'v': goto yy699; + case 'v': goto yy706; case 'X': - case 'x': goto yy700; + case 'x': goto yy707; default: goto yy150; } yy87: YYDEBUG(87, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1854 "Zend/zend_language_scanner.l" +#line 1858 "Zend/zend_language_scanner.l" { zend_copy_value(zendlval, yytext, yyleng); return T_STRING; @@ -2162,20 +2162,20 @@ yy88: yych = *++YYCURSOR; if (yych <= 'O') { if (yych <= 'H') { - if (yych == 'E') goto yy677; + if (yych == 'E') goto yy684; goto yy150; } else { - if (yych <= 'I') goto yy678; + if (yych <= 'I') goto yy685; if (yych <= 'N') goto yy150; - goto yy679; + goto yy686; } } else { if (yych <= 'h') { - if (yych == 'e') goto yy677; + if (yych == 'e') goto yy684; goto yy150; } else { - if (yych <= 'i') goto yy678; - if (yych == 'o') goto yy679; + if (yych <= 'i') goto yy685; + if (yych == 'o') goto yy686; goto yy150; } } @@ -2184,20 +2184,20 @@ yy89: yych = *++YYCURSOR; if (yych <= 'U') { if (yych <= 'N') { - if (yych == 'I') goto yy653; + if (yych == 'I') goto yy660; goto yy150; } else { - if (yych <= 'O') goto yy654; + if (yych <= 'O') goto yy661; if (yych <= 'T') goto yy150; - goto yy655; + goto yy662; } } else { if (yych <= 'n') { - if (yych == 'i') goto yy653; + if (yych == 'i') goto yy660; goto yy150; } else { - if (yych <= 'o') goto yy654; - if (yych == 'u') goto yy655; + if (yych <= 'o') goto yy661; + if (yych == 'u') goto yy662; goto yy150; } } @@ -2206,28 +2206,28 @@ yy90: yych = *++YYCURSOR; if (yych <= 'O') { if (yych <= 'K') { - if (yych == 'A') goto yy618; + if (yych == 'A') goto yy625; goto yy150; } else { - if (yych <= 'L') goto yy619; + if (yych <= 'L') goto yy626; if (yych <= 'N') goto yy150; - goto yy620; + goto yy627; } } else { if (yych <= 'k') { - if (yych == 'a') goto yy618; + if (yych == 'a') goto yy625; goto yy150; } else { - if (yych <= 'l') goto yy619; - if (yych == 'o') goto yy620; + if (yych <= 'l') goto yy626; + if (yych == 'o') goto yy627; goto yy150; } } yy91: YYDEBUG(91, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy600; - if (yych == 'e') goto yy600; + if (yych == 'E') goto yy607; + if (yych == 'e') goto yy607; goto yy150; yy92: YYDEBUG(92, *YYCURSOR); @@ -2388,7 +2388,7 @@ yy101: yy102: YYDEBUG(102, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1544 "Zend/zend_language_scanner.l" +#line 1548 "Zend/zend_language_scanner.l" { return yytext[0]; } @@ -2401,7 +2401,7 @@ yy103: yy104: YYDEBUG(104, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1263 "Zend/zend_language_scanner.l" +#line 1267 "Zend/zend_language_scanner.l" { HANDLE_NEWLINES(yytext, yyleng); return T_WHITESPACE; @@ -2417,7 +2417,7 @@ yy106: ++YYCURSOR; YYDEBUG(107, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1288 "Zend/zend_language_scanner.l" +#line 1292 "Zend/zend_language_scanner.l" { return T_NS_SEPARATOR; } @@ -2650,7 +2650,7 @@ yy131: ++YYCURSOR; YYDEBUG(132, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1549 "Zend/zend_language_scanner.l" +#line 1553 "Zend/zend_language_scanner.l" { yy_push_state(ST_IN_SCRIPTING); return '{'; @@ -2661,7 +2661,7 @@ yy133: ++YYCURSOR; YYDEBUG(134, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1561 "Zend/zend_language_scanner.l" +#line 1565 "Zend/zend_language_scanner.l" { RESET_DOC_COMMENT(); if (!zend_stack_is_empty(&SCNG(state_stack))) { @@ -2697,7 +2697,7 @@ yy135: yy136: YYDEBUG(136, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1614 "Zend/zend_language_scanner.l" +#line 1618 "Zend/zend_language_scanner.l" { char *end; if (yyleng < MAX_LENGTH_OF_LONG - 1) { /* Won't overflow */ @@ -2764,7 +2764,7 @@ yy139: yy140: YYDEBUG(140, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1860 "Zend/zend_language_scanner.l" +#line 1864 "Zend/zend_language_scanner.l" { while (YYCURSOR < YYLIMIT) { switch (*YYCURSOR++) { @@ -2800,7 +2800,7 @@ yy141: yy142: YYDEBUG(142, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1928 "Zend/zend_language_scanner.l" +#line 1932 "Zend/zend_language_scanner.l" { register char *s, *t; char *end; @@ -2875,7 +2875,7 @@ yy143: yy144: YYDEBUG(144, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1997 "Zend/zend_language_scanner.l" +#line 2001 "Zend/zend_language_scanner.l" { int bprefix = (yytext[0] != '"') ? 1 : 0; @@ -2922,7 +2922,7 @@ yy145: ++YYCURSOR; YYDEBUG(146, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2087 "Zend/zend_language_scanner.l" +#line 2091 "Zend/zend_language_scanner.l" { BEGIN(ST_BACKQUOTE); return '`'; @@ -2933,7 +2933,7 @@ yy147: ++YYCURSOR; YYDEBUG(148, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2349 "Zend/zend_language_scanner.l" +#line 2353 "Zend/zend_language_scanner.l" { if (YYCURSOR > YYLIMIT) { return 0; @@ -2969,7 +2969,7 @@ yy151: yy153: YYDEBUG(153, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1702 "Zend/zend_language_scanner.l" +#line 1706 "Zend/zend_language_scanner.l" { const char *end; @@ -3010,7 +3010,7 @@ yy156: yy157: YYDEBUG(157, *YYCURSOR); YYCURSOR = YYMARKER; - if (yyaccept <= 2) { + if (yyaccept <= 3) { if (yyaccept <= 1) { if (yyaccept <= 0) { goto yy87; @@ -3018,17 +3018,21 @@ yy157: goto yy102; } } else { - goto yy136; + if (yyaccept <= 2) { + goto yy136; + } else { + goto yy153; + } } } else { - if (yyaccept <= 4) { - if (yyaccept <= 3) { - goto yy153; - } else { + if (yyaccept <= 5) { + if (yyaccept <= 4) { goto yy190; + } else { + goto yy210; } } else { - goto yy210; + goto yy599; } } yy158: @@ -3070,7 +3074,7 @@ yy163: } YYDEBUG(165, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1586 "Zend/zend_language_scanner.l" +#line 1590 "Zend/zend_language_scanner.l" { char *bin = yytext + 2; /* Skip "0b" */ int len = yyleng - 2; @@ -3098,7 +3102,7 @@ yy163: return T_DNUMBER; } } -#line 3102 "Zend/zend_language_scanner.c" +#line 3106 "Zend/zend_language_scanner.c" yy166: YYDEBUG(166, *YYCURSOR); ++YYCURSOR; @@ -3110,7 +3114,7 @@ yy166: } YYDEBUG(168, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1653 "Zend/zend_language_scanner.l" +#line 1657 "Zend/zend_language_scanner.l" { char *hex = yytext + 2; /* Skip "0x" */ int len = yyleng - 2; @@ -3138,7 +3142,7 @@ yy166: return T_DNUMBER; } } -#line 3142 "Zend/zend_language_scanner.c" +#line 3146 "Zend/zend_language_scanner.c" yy169: YYDEBUG(169, *YYCURSOR); ++YYCURSOR; @@ -3163,12 +3167,12 @@ yy169: yy171: YYDEBUG(171, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1831 "Zend/zend_language_scanner.l" +#line 1835 "Zend/zend_language_scanner.l" { zend_copy_value(zendlval, (yytext+1), (yyleng-1)); return T_VARIABLE; } -#line 3172 "Zend/zend_language_scanner.c" +#line 3176 "Zend/zend_language_scanner.c" yy172: YYDEBUG(172, *YYCURSOR); yych = *++YYCURSOR; @@ -3182,11 +3186,11 @@ yy173: } YYDEBUG(174, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1532 "Zend/zend_language_scanner.l" +#line 1536 "Zend/zend_language_scanner.l" { return T_LOGICAL_XOR; } -#line 3190 "Zend/zend_language_scanner.c" +#line 3194 "Zend/zend_language_scanner.c" yy175: YYDEBUG(175, *YYCURSOR); ++YYCURSOR; @@ -3195,71 +3199,71 @@ yy175: } YYDEBUG(176, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1524 "Zend/zend_language_scanner.l" +#line 1528 "Zend/zend_language_scanner.l" { return T_LOGICAL_OR; } -#line 3203 "Zend/zend_language_scanner.c" +#line 3207 "Zend/zend_language_scanner.c" yy177: YYDEBUG(177, *YYCURSOR); ++YYCURSOR; YYDEBUG(178, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1512 "Zend/zend_language_scanner.l" +#line 1516 "Zend/zend_language_scanner.l" { return T_XOR_EQUAL; } -#line 3213 "Zend/zend_language_scanner.c" +#line 3217 "Zend/zend_language_scanner.c" yy179: YYDEBUG(179, *YYCURSOR); ++YYCURSOR; YYDEBUG(180, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1516 "Zend/zend_language_scanner.l" +#line 1520 "Zend/zend_language_scanner.l" { return T_BOOLEAN_OR; } -#line 3223 "Zend/zend_language_scanner.c" +#line 3227 "Zend/zend_language_scanner.c" yy181: YYDEBUG(181, *YYCURSOR); ++YYCURSOR; YYDEBUG(182, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1508 "Zend/zend_language_scanner.l" +#line 1512 "Zend/zend_language_scanner.l" { return T_OR_EQUAL; } -#line 3233 "Zend/zend_language_scanner.c" +#line 3237 "Zend/zend_language_scanner.c" yy183: YYDEBUG(183, *YYCURSOR); ++YYCURSOR; YYDEBUG(184, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1520 "Zend/zend_language_scanner.l" +#line 1524 "Zend/zend_language_scanner.l" { return T_BOOLEAN_AND; } -#line 3243 "Zend/zend_language_scanner.c" +#line 3247 "Zend/zend_language_scanner.c" yy185: YYDEBUG(185, *YYCURSOR); ++YYCURSOR; YYDEBUG(186, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1504 "Zend/zend_language_scanner.l" +#line 1508 "Zend/zend_language_scanner.l" { return T_AND_EQUAL; } -#line 3253 "Zend/zend_language_scanner.c" +#line 3257 "Zend/zend_language_scanner.c" yy187: YYDEBUG(187, *YYCURSOR); ++YYCURSOR; YYDEBUG(188, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1492 "Zend/zend_language_scanner.l" +#line 1496 "Zend/zend_language_scanner.l" { return T_MOD_EQUAL; } -#line 3263 "Zend/zend_language_scanner.c" +#line 3267 "Zend/zend_language_scanner.c" yy189: YYDEBUG(189, *YYCURSOR); yyaccept = 4; @@ -3268,7 +3272,7 @@ yy189: yy190: YYDEBUG(190, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1889 "Zend/zend_language_scanner.l" +#line 1893 "Zend/zend_language_scanner.l" { int doc_com; @@ -3301,7 +3305,7 @@ yy190: return T_COMMENT; } -#line 3305 "Zend/zend_language_scanner.c" +#line 3309 "Zend/zend_language_scanner.c" yy191: YYDEBUG(191, *YYCURSOR); yych = *++YYCURSOR; @@ -3311,11 +3315,11 @@ yy192: ++YYCURSOR; YYDEBUG(193, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1484 "Zend/zend_language_scanner.l" +#line 1488 "Zend/zend_language_scanner.l" { return T_DIV_EQUAL; } -#line 3319 "Zend/zend_language_scanner.c" +#line 3323 "Zend/zend_language_scanner.c" yy194: YYDEBUG(194, *YYCURSOR); yych = *++YYCURSOR; @@ -3339,62 +3343,62 @@ yy197: if ((yych = *YYCURSOR) == '=') goto yy201; YYDEBUG(198, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1476 "Zend/zend_language_scanner.l" +#line 1480 "Zend/zend_language_scanner.l" { return T_POW; } -#line 3347 "Zend/zend_language_scanner.c" +#line 3351 "Zend/zend_language_scanner.c" yy199: YYDEBUG(199, *YYCURSOR); ++YYCURSOR; YYDEBUG(200, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1472 "Zend/zend_language_scanner.l" +#line 1476 "Zend/zend_language_scanner.l" { return T_MUL_EQUAL; } -#line 3357 "Zend/zend_language_scanner.c" +#line 3361 "Zend/zend_language_scanner.c" yy201: YYDEBUG(201, *YYCURSOR); ++YYCURSOR; YYDEBUG(202, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1480 "Zend/zend_language_scanner.l" +#line 1484 "Zend/zend_language_scanner.l" { return T_POW_EQUAL; } -#line 3367 "Zend/zend_language_scanner.c" +#line 3371 "Zend/zend_language_scanner.c" yy203: YYDEBUG(203, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) == '=') goto yy207; YYDEBUG(204, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1540 "Zend/zend_language_scanner.l" +#line 1544 "Zend/zend_language_scanner.l" { return T_SR; } -#line 3378 "Zend/zend_language_scanner.c" +#line 3382 "Zend/zend_language_scanner.c" yy205: YYDEBUG(205, *YYCURSOR); ++YYCURSOR; YYDEBUG(206, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1460 "Zend/zend_language_scanner.l" +#line 1464 "Zend/zend_language_scanner.l" { return T_IS_GREATER_OR_EQUAL; } -#line 3388 "Zend/zend_language_scanner.c" +#line 3392 "Zend/zend_language_scanner.c" yy207: YYDEBUG(207, *YYCURSOR); ++YYCURSOR; YYDEBUG(208, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1500 "Zend/zend_language_scanner.l" +#line 1504 "Zend/zend_language_scanner.l" { return T_SR_EQUAL; } -#line 3398 "Zend/zend_language_scanner.c" +#line 3402 "Zend/zend_language_scanner.c" yy209: YYDEBUG(209, *YYCURSOR); yyaccept = 5; @@ -3405,42 +3409,42 @@ yy209: yy210: YYDEBUG(210, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1536 "Zend/zend_language_scanner.l" +#line 1540 "Zend/zend_language_scanner.l" { return T_SL; } -#line 3413 "Zend/zend_language_scanner.c" +#line 3417 "Zend/zend_language_scanner.c" yy211: YYDEBUG(211, *YYCURSOR); ++YYCURSOR; YYDEBUG(212, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1456 "Zend/zend_language_scanner.l" +#line 1460 "Zend/zend_language_scanner.l" { return T_IS_SMALLER_OR_EQUAL; } -#line 3423 "Zend/zend_language_scanner.c" +#line 3427 "Zend/zend_language_scanner.c" yy213: YYDEBUG(213, *YYCURSOR); ++YYCURSOR; yy214: YYDEBUG(214, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1452 "Zend/zend_language_scanner.l" +#line 1456 "Zend/zend_language_scanner.l" { return T_IS_NOT_EQUAL; } -#line 3434 "Zend/zend_language_scanner.c" +#line 3438 "Zend/zend_language_scanner.c" yy215: YYDEBUG(215, *YYCURSOR); ++YYCURSOR; YYDEBUG(216, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1496 "Zend/zend_language_scanner.l" +#line 1500 "Zend/zend_language_scanner.l" { return T_SL_EQUAL; } -#line 3444 "Zend/zend_language_scanner.c" +#line 3448 "Zend/zend_language_scanner.c" yy217: YYDEBUG(217, *YYCURSOR); ++YYCURSOR; @@ -3545,7 +3549,7 @@ yy226: yy227: YYDEBUG(227, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2039 "Zend/zend_language_scanner.l" +#line 2043 "Zend/zend_language_scanner.l" { char *s; int bprefix = (yytext[0] != '<') ? 1 : 0; @@ -3592,7 +3596,7 @@ yy227: return T_START_HEREDOC; } -#line 3596 "Zend/zend_language_scanner.c" +#line 3600 "Zend/zend_language_scanner.c" yy228: YYDEBUG(228, *YYCURSOR); yych = *++YYCURSOR; @@ -3632,31 +3636,31 @@ yy231: ++YYCURSOR; YYDEBUG(233, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1444 "Zend/zend_language_scanner.l" +#line 1448 "Zend/zend_language_scanner.l" { return T_IS_NOT_IDENTICAL; } -#line 3640 "Zend/zend_language_scanner.c" +#line 3644 "Zend/zend_language_scanner.c" yy234: YYDEBUG(234, *YYCURSOR); ++YYCURSOR; YYDEBUG(235, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1464 "Zend/zend_language_scanner.l" +#line 1468 "Zend/zend_language_scanner.l" { return T_PLUS_EQUAL; } -#line 3650 "Zend/zend_language_scanner.c" +#line 3654 "Zend/zend_language_scanner.c" yy236: YYDEBUG(236, *YYCURSOR); ++YYCURSOR; YYDEBUG(237, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1432 "Zend/zend_language_scanner.l" +#line 1436 "Zend/zend_language_scanner.l" { return T_INC; } -#line 3660 "Zend/zend_language_scanner.c" +#line 3664 "Zend/zend_language_scanner.c" yy238: YYDEBUG(238, *YYCURSOR); yych = *++YYCURSOR; @@ -3675,42 +3679,42 @@ yy240: } YYDEBUG(241, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1420 "Zend/zend_language_scanner.l" +#line 1424 "Zend/zend_language_scanner.l" { return T_LIST; } -#line 3683 "Zend/zend_language_scanner.c" +#line 3687 "Zend/zend_language_scanner.c" yy242: YYDEBUG(242, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) == '=') goto yy246; YYDEBUG(243, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1448 "Zend/zend_language_scanner.l" +#line 1452 "Zend/zend_language_scanner.l" { return T_IS_EQUAL; } -#line 3694 "Zend/zend_language_scanner.c" +#line 3698 "Zend/zend_language_scanner.c" yy244: YYDEBUG(244, *YYCURSOR); ++YYCURSOR; YYDEBUG(245, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1416 "Zend/zend_language_scanner.l" +#line 1420 "Zend/zend_language_scanner.l" { return T_DOUBLE_ARROW; } -#line 3704 "Zend/zend_language_scanner.c" +#line 3708 "Zend/zend_language_scanner.c" yy246: YYDEBUG(246, *YYCURSOR); ++YYCURSOR; YYDEBUG(247, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1440 "Zend/zend_language_scanner.l" +#line 1444 "Zend/zend_language_scanner.l" { return T_IS_IDENTICAL; } -#line 3714 "Zend/zend_language_scanner.c" +#line 3718 "Zend/zend_language_scanner.c" yy248: YYDEBUG(248, *YYCURSOR); yych = *++YYCURSOR; @@ -3840,11 +3844,11 @@ yy264: } YYDEBUG(267, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1739 "Zend/zend_language_scanner.l" +#line 1743 "Zend/zend_language_scanner.l" { return T_NS_C; } -#line 3848 "Zend/zend_language_scanner.c" +#line 3852 "Zend/zend_language_scanner.c" yy268: YYDEBUG(268, *YYCURSOR); yych = *++YYCURSOR; @@ -3864,11 +3868,11 @@ yy269: } YYDEBUG(272, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1735 "Zend/zend_language_scanner.l" +#line 1739 "Zend/zend_language_scanner.l" { return T_DIR; } -#line 3872 "Zend/zend_language_scanner.c" +#line 3876 "Zend/zend_language_scanner.c" yy273: YYDEBUG(273, *YYCURSOR); yych = *++YYCURSOR; @@ -3893,11 +3897,11 @@ yy275: } YYDEBUG(278, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1727 "Zend/zend_language_scanner.l" +#line 1731 "Zend/zend_language_scanner.l" { return T_LINE; } -#line 3901 "Zend/zend_language_scanner.c" +#line 3905 "Zend/zend_language_scanner.c" yy279: YYDEBUG(279, *YYCURSOR); yych = *++YYCURSOR; @@ -3932,11 +3936,11 @@ yy283: } YYDEBUG(286, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1723 "Zend/zend_language_scanner.l" +#line 1727 "Zend/zend_language_scanner.l" { return T_METHOD_C; } -#line 3940 "Zend/zend_language_scanner.c" +#line 3944 "Zend/zend_language_scanner.c" yy287: YYDEBUG(287, *YYCURSOR); yych = *++YYCURSOR; @@ -3987,11 +3991,11 @@ yy294: } YYDEBUG(297, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1719 "Zend/zend_language_scanner.l" +#line 1723 "Zend/zend_language_scanner.l" { return T_FUNC_C; } -#line 3995 "Zend/zend_language_scanner.c" +#line 3999 "Zend/zend_language_scanner.c" yy298: YYDEBUG(298, *YYCURSOR); yych = *++YYCURSOR; @@ -4011,11 +4015,11 @@ yy299: } YYDEBUG(302, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1731 "Zend/zend_language_scanner.l" +#line 1735 "Zend/zend_language_scanner.l" { return T_FILE; } -#line 4019 "Zend/zend_language_scanner.c" +#line 4023 "Zend/zend_language_scanner.c" yy303: YYDEBUG(303, *YYCURSOR); yych = *++YYCURSOR; @@ -4045,11 +4049,11 @@ yy306: } YYDEBUG(309, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1715 "Zend/zend_language_scanner.l" +#line 1719 "Zend/zend_language_scanner.l" { return T_TRAIT_C; } -#line 4053 "Zend/zend_language_scanner.c" +#line 4057 "Zend/zend_language_scanner.c" yy310: YYDEBUG(310, *YYCURSOR); yych = *++YYCURSOR; @@ -4079,11 +4083,11 @@ yy313: } YYDEBUG(316, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1711 "Zend/zend_language_scanner.l" +#line 1715 "Zend/zend_language_scanner.l" { return T_CLASS_C; } -#line 4087 "Zend/zend_language_scanner.c" +#line 4091 "Zend/zend_language_scanner.c" yy317: YYDEBUG(317, *YYCURSOR); yych = *++YYCURSOR; @@ -4145,11 +4149,11 @@ yy328: } YYDEBUG(329, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1384 "Zend/zend_language_scanner.l" +#line 1388 "Zend/zend_language_scanner.l" { return T_HALT_COMPILER; } -#line 4153 "Zend/zend_language_scanner.c" +#line 4157 "Zend/zend_language_scanner.c" yy330: YYDEBUG(330, *YYCURSOR); yych = *++YYCURSOR; @@ -4169,11 +4173,11 @@ yy332: } YYDEBUG(333, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1364 "Zend/zend_language_scanner.l" +#line 1368 "Zend/zend_language_scanner.l" { return T_USE; } -#line 4177 "Zend/zend_language_scanner.c" +#line 4181 "Zend/zend_language_scanner.c" yy334: YYDEBUG(334, *YYCURSOR); yych = *++YYCURSOR; @@ -4192,11 +4196,11 @@ yy336: } YYDEBUG(337, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1412 "Zend/zend_language_scanner.l" +#line 1416 "Zend/zend_language_scanner.l" { return T_UNSET; } -#line 4200 "Zend/zend_language_scanner.c" +#line 4204 "Zend/zend_language_scanner.c" yy338: YYDEBUG(338, *YYCURSOR); ++YYCURSOR; @@ -4368,11 +4372,11 @@ yy353: ++YYCURSOR; YYDEBUG(355, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1312 "Zend/zend_language_scanner.l" +#line 1316 "Zend/zend_language_scanner.l" { return T_INT_CAST; } -#line 4376 "Zend/zend_language_scanner.c" +#line 4380 "Zend/zend_language_scanner.c" yy356: YYDEBUG(356, *YYCURSOR); yych = *++YYCURSOR; @@ -4416,11 +4420,11 @@ yy361: ++YYCURSOR; YYDEBUG(364, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1316 "Zend/zend_language_scanner.l" +#line 1320 "Zend/zend_language_scanner.l" { return T_DOUBLE_CAST; } -#line 4424 "Zend/zend_language_scanner.c" +#line 4428 "Zend/zend_language_scanner.c" yy365: YYDEBUG(365, *YYCURSOR); yych = *++YYCURSOR; @@ -4490,11 +4494,11 @@ yy375: ++YYCURSOR; YYDEBUG(378, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1320 "Zend/zend_language_scanner.l" +#line 1324 "Zend/zend_language_scanner.l" { return T_STRING_CAST; } -#line 4498 "Zend/zend_language_scanner.c" +#line 4502 "Zend/zend_language_scanner.c" yy379: YYDEBUG(379, *YYCURSOR); yych = *++YYCURSOR; @@ -4527,11 +4531,11 @@ yy382: ++YYCURSOR; YYDEBUG(385, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1324 "Zend/zend_language_scanner.l" +#line 1328 "Zend/zend_language_scanner.l" { return T_ARRAY_CAST; } -#line 4535 "Zend/zend_language_scanner.c" +#line 4539 "Zend/zend_language_scanner.c" yy386: YYDEBUG(386, *YYCURSOR); yych = *++YYCURSOR; @@ -4569,11 +4573,11 @@ yy390: ++YYCURSOR; YYDEBUG(393, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1328 "Zend/zend_language_scanner.l" +#line 1332 "Zend/zend_language_scanner.l" { return T_OBJECT_CAST; } -#line 4577 "Zend/zend_language_scanner.c" +#line 4581 "Zend/zend_language_scanner.c" yy394: YYDEBUG(394, *YYCURSOR); yych = *++YYCURSOR; @@ -4614,11 +4618,11 @@ yy399: ++YYCURSOR; YYDEBUG(401, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1332 "Zend/zend_language_scanner.l" +#line 1336 "Zend/zend_language_scanner.l" { return T_BOOL_CAST; } -#line 4622 "Zend/zend_language_scanner.c" +#line 4626 "Zend/zend_language_scanner.c" yy402: YYDEBUG(402, *YYCURSOR); yych = *++YYCURSOR; @@ -4678,11 +4682,11 @@ yy410: ++YYCURSOR; YYDEBUG(413, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1336 "Zend/zend_language_scanner.l" +#line 1340 "Zend/zend_language_scanner.l" { return T_UNSET_CAST; } -#line 4686 "Zend/zend_language_scanner.c" +#line 4690 "Zend/zend_language_scanner.c" yy414: YYDEBUG(414, *YYCURSOR); yych = *++YYCURSOR; @@ -4696,11 +4700,11 @@ yy415: } YYDEBUG(416, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1308 "Zend/zend_language_scanner.l" +#line 1312 "Zend/zend_language_scanner.l" { return T_VAR; } -#line 4704 "Zend/zend_language_scanner.c" +#line 4708 "Zend/zend_language_scanner.c" yy417: YYDEBUG(417, *YYCURSOR); yych = *++YYCURSOR; @@ -4720,11 +4724,11 @@ yy419: } YYDEBUG(420, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1300 "Zend/zend_language_scanner.l" +#line 1304 "Zend/zend_language_scanner.l" { return T_NEW; } -#line 4728 "Zend/zend_language_scanner.c" +#line 4732 "Zend/zend_language_scanner.c" yy421: YYDEBUG(421, *YYCURSOR); yych = *++YYCURSOR; @@ -4763,11 +4767,11 @@ yy427: } YYDEBUG(428, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1360 "Zend/zend_language_scanner.l" +#line 1364 "Zend/zend_language_scanner.l" { return T_NAMESPACE; } -#line 4771 "Zend/zend_language_scanner.c" +#line 4775 "Zend/zend_language_scanner.c" yy429: YYDEBUG(429, *YYCURSOR); ++YYCURSOR; @@ -4776,22 +4780,22 @@ yy429: yy430: YYDEBUG(430, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1922 "Zend/zend_language_scanner.l" +#line 1926 "Zend/zend_language_scanner.l" { BEGIN(INITIAL); return T_CLOSE_TAG; /* implicit ';' at php-end tag */ } -#line 4785 "Zend/zend_language_scanner.c" +#line 4789 "Zend/zend_language_scanner.c" yy431: YYDEBUG(431, *YYCURSOR); ++YYCURSOR; YYDEBUG(432, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1296 "Zend/zend_language_scanner.l" +#line 1300 "Zend/zend_language_scanner.l" { return T_COALESCE; } -#line 4795 "Zend/zend_language_scanner.c" +#line 4799 "Zend/zend_language_scanner.c" yy433: YYDEBUG(433, *YYCURSOR); yych = *++YYCURSOR; @@ -4822,11 +4826,11 @@ yy437: ++YYCURSOR; YYDEBUG(438, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1488 "Zend/zend_language_scanner.l" +#line 1492 "Zend/zend_language_scanner.l" { return T_CONCAT_EQUAL; } -#line 4830 "Zend/zend_language_scanner.c" +#line 4834 "Zend/zend_language_scanner.c" yy439: YYDEBUG(439, *YYCURSOR); yych = *++YYCURSOR; @@ -4835,21 +4839,21 @@ yy439: ++YYCURSOR; YYDEBUG(441, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1292 "Zend/zend_language_scanner.l" +#line 1296 "Zend/zend_language_scanner.l" { return T_ELLIPSIS; } -#line 4843 "Zend/zend_language_scanner.c" +#line 4847 "Zend/zend_language_scanner.c" yy442: YYDEBUG(442, *YYCURSOR); ++YYCURSOR; YYDEBUG(443, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1284 "Zend/zend_language_scanner.l" +#line 1288 "Zend/zend_language_scanner.l" { return T_PAAMAYIM_NEKUDOTAYIM; } -#line 4853 "Zend/zend_language_scanner.c" +#line 4857 "Zend/zend_language_scanner.c" yy444: YYDEBUG(444, *YYCURSOR); ++YYCURSOR; @@ -4871,32 +4875,32 @@ yy446: ++YYCURSOR; YYDEBUG(447, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1468 "Zend/zend_language_scanner.l" +#line 1472 "Zend/zend_language_scanner.l" { return T_MINUS_EQUAL; } -#line 4879 "Zend/zend_language_scanner.c" +#line 4883 "Zend/zend_language_scanner.c" yy448: YYDEBUG(448, *YYCURSOR); ++YYCURSOR; YYDEBUG(449, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1436 "Zend/zend_language_scanner.l" +#line 1440 "Zend/zend_language_scanner.l" { return T_DEC; } -#line 4889 "Zend/zend_language_scanner.c" +#line 4893 "Zend/zend_language_scanner.c" yy450: YYDEBUG(450, *YYCURSOR); ++YYCURSOR; YYDEBUG(451, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1258 "Zend/zend_language_scanner.l" +#line 1262 "Zend/zend_language_scanner.l" { yy_push_state(ST_LOOKING_FOR_PROPERTY); return T_OBJECT_OPERATOR; } -#line 4900 "Zend/zend_language_scanner.c" +#line 4904 "Zend/zend_language_scanner.c" yy452: YYDEBUG(452, *YYCURSOR); yych = *++YYCURSOR; @@ -4941,11 +4945,11 @@ yy457: } YYDEBUG(458, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1408 "Zend/zend_language_scanner.l" +#line 1412 "Zend/zend_language_scanner.l" { return T_PUBLIC; } -#line 4949 "Zend/zend_language_scanner.c" +#line 4953 "Zend/zend_language_scanner.c" yy459: YYDEBUG(459, *YYCURSOR); yych = *++YYCURSOR; @@ -5000,11 +5004,11 @@ yy466: } YYDEBUG(467, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1404 "Zend/zend_language_scanner.l" +#line 1408 "Zend/zend_language_scanner.l" { return T_PROTECTED; } -#line 5008 "Zend/zend_language_scanner.c" +#line 5012 "Zend/zend_language_scanner.c" yy468: YYDEBUG(468, *YYCURSOR); yych = *++YYCURSOR; @@ -5034,11 +5038,11 @@ yy472: } YYDEBUG(473, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1400 "Zend/zend_language_scanner.l" +#line 1404 "Zend/zend_language_scanner.l" { return T_PRIVATE; } -#line 5042 "Zend/zend_language_scanner.c" +#line 5046 "Zend/zend_language_scanner.c" yy474: YYDEBUG(474, *YYCURSOR); ++YYCURSOR; @@ -5047,11 +5051,11 @@ yy474: } YYDEBUG(475, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1234 "Zend/zend_language_scanner.l" +#line 1238 "Zend/zend_language_scanner.l" { return T_PRINT; } -#line 5055 "Zend/zend_language_scanner.c" +#line 5059 "Zend/zend_language_scanner.c" yy476: YYDEBUG(476, *YYCURSOR); yych = *++YYCURSOR; @@ -5076,11 +5080,11 @@ yy479: } YYDEBUG(480, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1226 "Zend/zend_language_scanner.l" +#line 1230 "Zend/zend_language_scanner.l" { return T_GOTO; } -#line 5084 "Zend/zend_language_scanner.c" +#line 5088 "Zend/zend_language_scanner.c" yy481: YYDEBUG(481, *YYCURSOR); yych = *++YYCURSOR; @@ -5104,11 +5108,11 @@ yy484: } YYDEBUG(485, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1372 "Zend/zend_language_scanner.l" +#line 1376 "Zend/zend_language_scanner.l" { return T_GLOBAL; } -#line 5112 "Zend/zend_language_scanner.c" +#line 5116 "Zend/zend_language_scanner.c" yy486: YYDEBUG(486, *YYCURSOR); yych = *++YYCURSOR; @@ -5145,11 +5149,11 @@ yy492: } YYDEBUG(493, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1218 "Zend/zend_language_scanner.l" +#line 1222 "Zend/zend_language_scanner.l" { return T_BREAK; } -#line 5153 "Zend/zend_language_scanner.c" +#line 5157 "Zend/zend_language_scanner.c" yy494: YYDEBUG(494, *YYCURSOR); yych = *++YYCURSOR; @@ -5189,11 +5193,11 @@ yy500: } YYDEBUG(501, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1202 "Zend/zend_language_scanner.l" +#line 1206 "Zend/zend_language_scanner.l" { return T_SWITCH; } -#line 5197 "Zend/zend_language_scanner.c" +#line 5201 "Zend/zend_language_scanner.c" yy502: YYDEBUG(502, *YYCURSOR); yych = *++YYCURSOR; @@ -5217,11 +5221,11 @@ yy505: } YYDEBUG(506, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1388 "Zend/zend_language_scanner.l" +#line 1392 "Zend/zend_language_scanner.l" { return T_STATIC; } -#line 5225 "Zend/zend_language_scanner.c" +#line 5229 "Zend/zend_language_scanner.c" yy507: YYDEBUG(507, *YYCURSOR); yych = *++YYCURSOR; @@ -5248,11 +5252,11 @@ yy510: } YYDEBUG(511, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1198 "Zend/zend_language_scanner.l" +#line 1202 "Zend/zend_language_scanner.l" { return T_AS; } -#line 5256 "Zend/zend_language_scanner.c" +#line 5260 "Zend/zend_language_scanner.c" yy512: YYDEBUG(512, *YYCURSOR); yych = *++YYCURSOR; @@ -5271,11 +5275,11 @@ yy514: } YYDEBUG(515, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1424 "Zend/zend_language_scanner.l" +#line 1428 "Zend/zend_language_scanner.l" { return T_ARRAY; } -#line 5279 "Zend/zend_language_scanner.c" +#line 5283 "Zend/zend_language_scanner.c" yy516: YYDEBUG(516, *YYCURSOR); ++YYCURSOR; @@ -5284,11 +5288,11 @@ yy516: } YYDEBUG(517, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1528 "Zend/zend_language_scanner.l" +#line 1532 "Zend/zend_language_scanner.l" { return T_LOGICAL_AND; } -#line 5292 "Zend/zend_language_scanner.c" +#line 5296 "Zend/zend_language_scanner.c" yy518: YYDEBUG(518, *YYCURSOR); yych = *++YYCURSOR; @@ -5322,11 +5326,11 @@ yy523: } YYDEBUG(524, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1392 "Zend/zend_language_scanner.l" +#line 1396 "Zend/zend_language_scanner.l" { return T_ABSTRACT; } -#line 5330 "Zend/zend_language_scanner.c" +#line 5334 "Zend/zend_language_scanner.c" yy525: YYDEBUG(525, *YYCURSOR); yych = *++YYCURSOR; @@ -5350,11 +5354,11 @@ yy528: } YYDEBUG(529, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1158 "Zend/zend_language_scanner.l" +#line 1162 "Zend/zend_language_scanner.l" { return T_WHILE; } -#line 5358 "Zend/zend_language_scanner.c" +#line 5362 "Zend/zend_language_scanner.c" yy530: YYDEBUG(530, *YYCURSOR); ++YYCURSOR; @@ -5363,11 +5367,11 @@ yy530: } YYDEBUG(531, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1142 "Zend/zend_language_scanner.l" +#line 1146 "Zend/zend_language_scanner.l" { return T_IF; } -#line 5371 "Zend/zend_language_scanner.c" +#line 5375 "Zend/zend_language_scanner.c" yy532: YYDEBUG(532, *YYCURSOR); yych = *++YYCURSOR; @@ -5419,11 +5423,11 @@ yy537: } YYDEBUG(538, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1376 "Zend/zend_language_scanner.l" +#line 1380 "Zend/zend_language_scanner.l" { return T_ISSET; } -#line 5427 "Zend/zend_language_scanner.c" +#line 5431 "Zend/zend_language_scanner.c" yy539: YYDEBUG(539, *YYCURSOR); yych = *++YYCURSOR; @@ -5477,11 +5481,11 @@ yy545: yy546: YYDEBUG(546, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1344 "Zend/zend_language_scanner.l" +#line 1348 "Zend/zend_language_scanner.l" { return T_INCLUDE; } -#line 5485 "Zend/zend_language_scanner.c" +#line 5489 "Zend/zend_language_scanner.c" yy547: YYDEBUG(547, *YYCURSOR); yych = *++YYCURSOR; @@ -5510,11 +5514,11 @@ yy551: } YYDEBUG(552, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1348 "Zend/zend_language_scanner.l" +#line 1352 "Zend/zend_language_scanner.l" { return T_INCLUDE_ONCE; } -#line 5518 "Zend/zend_language_scanner.c" +#line 5522 "Zend/zend_language_scanner.c" yy553: YYDEBUG(553, *YYCURSOR); yych = *++YYCURSOR; @@ -5548,11 +5552,11 @@ yy558: } YYDEBUG(559, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1242 "Zend/zend_language_scanner.l" +#line 1246 "Zend/zend_language_scanner.l" { return T_INTERFACE; } -#line 5556 "Zend/zend_language_scanner.c" +#line 5560 "Zend/zend_language_scanner.c" yy560: YYDEBUG(560, *YYCURSOR); yych = *++YYCURSOR; @@ -5602,11 +5606,11 @@ yy566: } YYDEBUG(567, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1368 "Zend/zend_language_scanner.l" +#line 1372 "Zend/zend_language_scanner.l" { return T_INSTEADOF; } -#line 5610 "Zend/zend_language_scanner.c" +#line 5614 "Zend/zend_language_scanner.c" yy568: YYDEBUG(568, *YYCURSOR); yych = *++YYCURSOR; @@ -5635,11 +5639,11 @@ yy572: } YYDEBUG(573, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1194 "Zend/zend_language_scanner.l" +#line 1198 "Zend/zend_language_scanner.l" { return T_INSTANCEOF; } -#line 5643 "Zend/zend_language_scanner.c" +#line 5647 "Zend/zend_language_scanner.c" yy574: YYDEBUG(574, *YYCURSOR); yych = *++YYCURSOR; @@ -5683,11 +5687,11 @@ yy581: } YYDEBUG(582, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1254 "Zend/zend_language_scanner.l" +#line 1258 "Zend/zend_language_scanner.l" { return T_IMPLEMENTS; } -#line 5691 "Zend/zend_language_scanner.c" +#line 5695 "Zend/zend_language_scanner.c" yy583: YYDEBUG(583, *YYCURSOR); yych = *++YYCURSOR; @@ -5715,11 +5719,11 @@ yy584: } YYDEBUG(586, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1126 "Zend/zend_language_scanner.l" +#line 1130 "Zend/zend_language_scanner.l" { return T_TRY; } -#line 5723 "Zend/zend_language_scanner.c" +#line 5727 "Zend/zend_language_scanner.c" yy587: YYDEBUG(587, *YYCURSOR); yych = *++YYCURSOR; @@ -5738,11 +5742,11 @@ yy589: } YYDEBUG(590, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1246 "Zend/zend_language_scanner.l" +#line 1250 "Zend/zend_language_scanner.l" { return T_TRAIT; } -#line 5746 "Zend/zend_language_scanner.c" +#line 5750 "Zend/zend_language_scanner.c" yy591: YYDEBUG(591, *YYCURSOR); yych = *++YYCURSOR; @@ -5761,11 +5765,11 @@ yy593: } YYDEBUG(594, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1138 "Zend/zend_language_scanner.l" +#line 1142 "Zend/zend_language_scanner.l" { return T_THROW; } -#line 5769 "Zend/zend_language_scanner.c" +#line 5773 "Zend/zend_language_scanner.c" yy595: YYDEBUG(595, *YYCURSOR); yych = *++YYCURSOR; @@ -5783,1081 +5787,1136 @@ yy597: if (yych != 'd') goto yy150; yy598: YYDEBUG(598, *YYCURSOR); - ++YYCURSOR; - if (yybm[0+(yych = *YYCURSOR)] & 4) { + yyaccept = 6; + yych = *(YYMARKER = ++YYCURSOR); + if (yybm[0+yych] & 4) { goto yy149; } + if (yych <= '\f') { + if (yych <= 0x08) goto yy599; + if (yych <= '\n') goto yy600; + } else { + if (yych <= '\r') goto yy600; + if (yych == ' ') goto yy600; + } +yy599: YYDEBUG(599, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1122 "Zend/zend_language_scanner.l" +#line 1126 "Zend/zend_language_scanner.l" { return T_YIELD; } -#line 5797 "Zend/zend_language_scanner.c" +#line 5810 "Zend/zend_language_scanner.c" yy600: YYDEBUG(600, *YYCURSOR); + ++YYCURSOR; + YYFILL(4); + yych = *YYCURSOR; + YYDEBUG(601, *YYCURSOR); + if (yych <= 0x1F) { + if (yych <= '\n') { + if (yych <= 0x08) goto yy157; + goto yy600; + } else { + if (yych == '\r') goto yy600; + goto yy157; + } + } else { + if (yych <= 'F') { + if (yych <= ' ') goto yy600; + if (yych <= 'E') goto yy157; + } else { + if (yych != 'f') goto yy157; + } + } + YYDEBUG(602, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'R') goto yy603; + if (yych != 'r') goto yy157; +yy603: + YYDEBUG(603, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'O') goto yy604; + if (yych != 'o') goto yy157; +yy604: + YYDEBUG(604, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'M') goto yy605; + if (yych != 'm') goto yy157; +yy605: + YYDEBUG(605, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(606, *YYCURSOR); + yyleng = YYCURSOR - SCNG(yy_text); +#line 1122 "Zend/zend_language_scanner.l" + { + return T_YIELD_FROM; +} +#line 5856 "Zend/zend_language_scanner.c" +yy607: + YYDEBUG(607, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'T') { - if (yych == 'Q') goto yy602; + if (yych == 'Q') goto yy609; if (yych <= 'S') goto yy150; } else { if (yych <= 'q') { if (yych <= 'p') goto yy150; - goto yy602; + goto yy609; } else { if (yych != 't') goto yy150; } } - YYDEBUG(601, *YYCURSOR); + YYDEBUG(608, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'U') goto yy614; - if (yych == 'u') goto yy614; + if (yych == 'U') goto yy621; + if (yych == 'u') goto yy621; goto yy150; -yy602: - YYDEBUG(602, *YYCURSOR); +yy609: + YYDEBUG(609, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'U') goto yy603; + if (yych == 'U') goto yy610; if (yych != 'u') goto yy150; -yy603: - YYDEBUG(603, *YYCURSOR); +yy610: + YYDEBUG(610, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy604; + if (yych == 'I') goto yy611; if (yych != 'i') goto yy150; -yy604: - YYDEBUG(604, *YYCURSOR); +yy611: + YYDEBUG(611, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy605; + if (yych == 'R') goto yy612; if (yych != 'r') goto yy150; -yy605: - YYDEBUG(605, *YYCURSOR); +yy612: + YYDEBUG(612, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy606; + if (yych == 'E') goto yy613; if (yych != 'e') goto yy150; -yy606: - YYDEBUG(606, *YYCURSOR); +yy613: + YYDEBUG(613, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= '^') { if (yych <= '9') { if (yych >= '0') goto yy149; } else { - if (yych <= '@') goto yy607; + if (yych <= '@') goto yy614; if (yych <= 'Z') goto yy149; } } else { if (yych <= '`') { - if (yych <= '_') goto yy608; + if (yych <= '_') goto yy615; } else { if (yych <= 'z') goto yy149; if (yych >= 0x7F) goto yy149; } } -yy607: - YYDEBUG(607, *YYCURSOR); +yy614: + YYDEBUG(614, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1352 "Zend/zend_language_scanner.l" +#line 1356 "Zend/zend_language_scanner.l" { return T_REQUIRE; } -#line 5862 "Zend/zend_language_scanner.c" -yy608: - YYDEBUG(608, *YYCURSOR); +#line 5921 "Zend/zend_language_scanner.c" +yy615: + YYDEBUG(615, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy609; + if (yych == 'O') goto yy616; if (yych != 'o') goto yy150; -yy609: - YYDEBUG(609, *YYCURSOR); +yy616: + YYDEBUG(616, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy610; + if (yych == 'N') goto yy617; if (yych != 'n') goto yy150; -yy610: - YYDEBUG(610, *YYCURSOR); +yy617: + YYDEBUG(617, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy611; + if (yych == 'C') goto yy618; if (yych != 'c') goto yy150; -yy611: - YYDEBUG(611, *YYCURSOR); +yy618: + YYDEBUG(618, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy612; + if (yych == 'E') goto yy619; if (yych != 'e') goto yy150; -yy612: - YYDEBUG(612, *YYCURSOR); +yy619: + YYDEBUG(619, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy149; } - YYDEBUG(613, *YYCURSOR); + YYDEBUG(620, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1356 "Zend/zend_language_scanner.l" +#line 1360 "Zend/zend_language_scanner.l" { return T_REQUIRE_ONCE; } -#line 5895 "Zend/zend_language_scanner.c" -yy614: - YYDEBUG(614, *YYCURSOR); +#line 5954 "Zend/zend_language_scanner.c" +yy621: + YYDEBUG(621, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy615; + if (yych == 'R') goto yy622; if (yych != 'r') goto yy150; -yy615: - YYDEBUG(615, *YYCURSOR); +yy622: + YYDEBUG(622, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy616; + if (yych == 'N') goto yy623; if (yych != 'n') goto yy150; -yy616: - YYDEBUG(616, *YYCURSOR); +yy623: + YYDEBUG(623, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy149; } - YYDEBUG(617, *YYCURSOR); + YYDEBUG(624, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1118 "Zend/zend_language_scanner.l" { return T_RETURN; } -#line 5918 "Zend/zend_language_scanner.c" -yy618: - YYDEBUG(618, *YYCURSOR); +#line 5977 "Zend/zend_language_scanner.c" +yy625: + YYDEBUG(625, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'T') { if (yych <= 'L') { if (yych <= 'K') goto yy150; - goto yy641; + goto yy648; } else { if (yych <= 'R') goto yy150; - if (yych <= 'S') goto yy640; - goto yy639; + if (yych <= 'S') goto yy647; + goto yy646; } } else { if (yych <= 'r') { - if (yych == 'l') goto yy641; + if (yych == 'l') goto yy648; goto yy150; } else { - if (yych <= 's') goto yy640; - if (yych <= 't') goto yy639; + if (yych <= 's') goto yy647; + if (yych <= 't') goto yy646; goto yy150; } } -yy619: - YYDEBUG(619, *YYCURSOR); +yy626: + YYDEBUG(626, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'O') { - if (yych == 'A') goto yy631; + if (yych == 'A') goto yy638; if (yych <= 'N') goto yy150; - goto yy632; + goto yy639; } else { if (yych <= 'a') { if (yych <= '`') goto yy150; - goto yy631; + goto yy638; } else { - if (yych == 'o') goto yy632; + if (yych == 'o') goto yy639; goto yy150; } } -yy620: - YYDEBUG(620, *YYCURSOR); +yy627: + YYDEBUG(627, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy621; + if (yych == 'N') goto yy628; if (yych != 'n') goto yy150; -yy621: - YYDEBUG(621, *YYCURSOR); +yy628: + YYDEBUG(628, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'T') { if (yych <= 'R') goto yy150; - if (yych >= 'T') goto yy623; + if (yych >= 'T') goto yy630; } else { if (yych <= 'r') goto yy150; - if (yych <= 's') goto yy622; - if (yych <= 't') goto yy623; + if (yych <= 's') goto yy629; + if (yych <= 't') goto yy630; goto yy150; } -yy622: - YYDEBUG(622, *YYCURSOR); +yy629: + YYDEBUG(629, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy629; - if (yych == 't') goto yy629; + if (yych == 'T') goto yy636; + if (yych == 't') goto yy636; goto yy150; -yy623: - YYDEBUG(623, *YYCURSOR); +yy630: + YYDEBUG(630, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy624; + if (yych == 'I') goto yy631; if (yych != 'i') goto yy150; -yy624: - YYDEBUG(624, *YYCURSOR); +yy631: + YYDEBUG(631, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy625; + if (yych == 'N') goto yy632; if (yych != 'n') goto yy150; -yy625: - YYDEBUG(625, *YYCURSOR); +yy632: + YYDEBUG(632, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'U') goto yy626; + if (yych == 'U') goto yy633; if (yych != 'u') goto yy150; -yy626: - YYDEBUG(626, *YYCURSOR); +yy633: + YYDEBUG(633, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy627; + if (yych == 'E') goto yy634; if (yych != 'e') goto yy150; -yy627: - YYDEBUG(627, *YYCURSOR); +yy634: + YYDEBUG(634, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy149; } - YYDEBUG(628, *YYCURSOR); + YYDEBUG(635, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1222 "Zend/zend_language_scanner.l" +#line 1226 "Zend/zend_language_scanner.l" { return T_CONTINUE; } -#line 6012 "Zend/zend_language_scanner.c" -yy629: - YYDEBUG(629, *YYCURSOR); +#line 6071 "Zend/zend_language_scanner.c" +yy636: + YYDEBUG(636, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy149; } - YYDEBUG(630, *YYCURSOR); + YYDEBUG(637, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1114 "Zend/zend_language_scanner.l" { return T_CONST; } -#line 6025 "Zend/zend_language_scanner.c" -yy631: - YYDEBUG(631, *YYCURSOR); +#line 6084 "Zend/zend_language_scanner.c" +yy638: + YYDEBUG(638, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'S') goto yy636; - if (yych == 's') goto yy636; + if (yych == 'S') goto yy643; + if (yych == 's') goto yy643; goto yy150; -yy632: - YYDEBUG(632, *YYCURSOR); +yy639: + YYDEBUG(639, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy633; + if (yych == 'N') goto yy640; if (yych != 'n') goto yy150; -yy633: - YYDEBUG(633, *YYCURSOR); +yy640: + YYDEBUG(640, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy634; + if (yych == 'E') goto yy641; if (yych != 'e') goto yy150; -yy634: - YYDEBUG(634, *YYCURSOR); +yy641: + YYDEBUG(641, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy149; } - YYDEBUG(635, *YYCURSOR); + YYDEBUG(642, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1304 "Zend/zend_language_scanner.l" +#line 1308 "Zend/zend_language_scanner.l" { return T_CLONE; } -#line 6054 "Zend/zend_language_scanner.c" -yy636: - YYDEBUG(636, *YYCURSOR); +#line 6113 "Zend/zend_language_scanner.c" +yy643: + YYDEBUG(643, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'S') goto yy637; + if (yych == 'S') goto yy644; if (yych != 's') goto yy150; -yy637: - YYDEBUG(637, *YYCURSOR); +yy644: + YYDEBUG(644, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy149; } - YYDEBUG(638, *YYCURSOR); + YYDEBUG(645, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1238 "Zend/zend_language_scanner.l" +#line 1242 "Zend/zend_language_scanner.l" { return T_CLASS; } -#line 6072 "Zend/zend_language_scanner.c" -yy639: - YYDEBUG(639, *YYCURSOR); +#line 6131 "Zend/zend_language_scanner.c" +yy646: + YYDEBUG(646, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy650; - if (yych == 'c') goto yy650; + if (yych == 'C') goto yy657; + if (yych == 'c') goto yy657; goto yy150; -yy640: - YYDEBUG(640, *YYCURSOR); +yy647: + YYDEBUG(647, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy648; - if (yych == 'e') goto yy648; + if (yych == 'E') goto yy655; + if (yych == 'e') goto yy655; goto yy150; -yy641: - YYDEBUG(641, *YYCURSOR); +yy648: + YYDEBUG(648, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy642; + if (yych == 'L') goto yy649; if (yych != 'l') goto yy150; -yy642: - YYDEBUG(642, *YYCURSOR); +yy649: + YYDEBUG(649, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy643; + if (yych == 'A') goto yy650; if (yych != 'a') goto yy150; -yy643: - YYDEBUG(643, *YYCURSOR); +yy650: + YYDEBUG(650, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'B') goto yy644; + if (yych == 'B') goto yy651; if (yych != 'b') goto yy150; -yy644: - YYDEBUG(644, *YYCURSOR); +yy651: + YYDEBUG(651, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy645; + if (yych == 'L') goto yy652; if (yych != 'l') goto yy150; -yy645: - YYDEBUG(645, *YYCURSOR); +yy652: + YYDEBUG(652, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy646; + if (yych == 'E') goto yy653; if (yych != 'e') goto yy150; -yy646: - YYDEBUG(646, *YYCURSOR); +yy653: + YYDEBUG(653, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy149; } - YYDEBUG(647, *YYCURSOR); + YYDEBUG(654, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1428 "Zend/zend_language_scanner.l" +#line 1432 "Zend/zend_language_scanner.l" { return T_CALLABLE; } -#line 6122 "Zend/zend_language_scanner.c" -yy648: - YYDEBUG(648, *YYCURSOR); +#line 6181 "Zend/zend_language_scanner.c" +yy655: + YYDEBUG(655, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy149; } - YYDEBUG(649, *YYCURSOR); + YYDEBUG(656, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1210 "Zend/zend_language_scanner.l" +#line 1214 "Zend/zend_language_scanner.l" { return T_CASE; } -#line 6135 "Zend/zend_language_scanner.c" -yy650: - YYDEBUG(650, *YYCURSOR); +#line 6194 "Zend/zend_language_scanner.c" +yy657: + YYDEBUG(657, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'H') goto yy651; + if (yych == 'H') goto yy658; if (yych != 'h') goto yy150; -yy651: - YYDEBUG(651, *YYCURSOR); +yy658: + YYDEBUG(658, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy149; } - YYDEBUG(652, *YYCURSOR); + YYDEBUG(659, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1130 "Zend/zend_language_scanner.l" +#line 1134 "Zend/zend_language_scanner.l" { return T_CATCH; } -#line 6153 "Zend/zend_language_scanner.c" -yy653: - YYDEBUG(653, *YYCURSOR); +#line 6212 "Zend/zend_language_scanner.c" +yy660: + YYDEBUG(660, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy670; - if (yych == 'n') goto yy670; + if (yych == 'N') goto yy677; + if (yych == 'n') goto yy677; goto yy150; -yy654: - YYDEBUG(654, *YYCURSOR); +yy661: + YYDEBUG(661, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy663; - if (yych == 'r') goto yy663; + if (yych == 'R') goto yy670; + if (yych == 'r') goto yy670; goto yy150; -yy655: - YYDEBUG(655, *YYCURSOR); +yy662: + YYDEBUG(662, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy656; + if (yych == 'N') goto yy663; if (yych != 'n') goto yy150; -yy656: - YYDEBUG(656, *YYCURSOR); +yy663: + YYDEBUG(663, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy657; + if (yych == 'C') goto yy664; if (yych != 'c') goto yy150; -yy657: - YYDEBUG(657, *YYCURSOR); +yy664: + YYDEBUG(664, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy658; + if (yych == 'T') goto yy665; if (yych != 't') goto yy150; -yy658: - YYDEBUG(658, *YYCURSOR); +yy665: + YYDEBUG(665, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy659; + if (yych == 'I') goto yy666; if (yych != 'i') goto yy150; -yy659: - YYDEBUG(659, *YYCURSOR); +yy666: + YYDEBUG(666, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy660; + if (yych == 'O') goto yy667; if (yych != 'o') goto yy150; -yy660: - YYDEBUG(660, *YYCURSOR); +yy667: + YYDEBUG(667, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy661; + if (yych == 'N') goto yy668; if (yych != 'n') goto yy150; -yy661: - YYDEBUG(661, *YYCURSOR); +yy668: + YYDEBUG(668, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy149; } - YYDEBUG(662, *YYCURSOR); + YYDEBUG(669, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1110 "Zend/zend_language_scanner.l" { return T_FUNCTION; } -#line 6208 "Zend/zend_language_scanner.c" -yy663: - YYDEBUG(663, *YYCURSOR); +#line 6267 "Zend/zend_language_scanner.c" +yy670: + YYDEBUG(670, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= '^') { if (yych <= '@') { - if (yych <= '/') goto yy664; + if (yych <= '/') goto yy671; if (yych <= '9') goto yy149; } else { - if (yych == 'E') goto yy665; + if (yych == 'E') goto yy672; if (yych <= 'Z') goto yy149; } } else { if (yych <= 'd') { if (yych != '`') goto yy149; } else { - if (yych <= 'e') goto yy665; + if (yych <= 'e') goto yy672; if (yych <= 'z') goto yy149; if (yych >= 0x7F) goto yy149; } } -yy664: - YYDEBUG(664, *YYCURSOR); +yy671: + YYDEBUG(671, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1170 "Zend/zend_language_scanner.l" +#line 1174 "Zend/zend_language_scanner.l" { return T_FOR; } -#line 6236 "Zend/zend_language_scanner.c" -yy665: - YYDEBUG(665, *YYCURSOR); +#line 6295 "Zend/zend_language_scanner.c" +yy672: + YYDEBUG(672, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy666; + if (yych == 'A') goto yy673; if (yych != 'a') goto yy150; -yy666: - YYDEBUG(666, *YYCURSOR); +yy673: + YYDEBUG(673, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy667; + if (yych == 'C') goto yy674; if (yych != 'c') goto yy150; -yy667: - YYDEBUG(667, *YYCURSOR); +yy674: + YYDEBUG(674, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'H') goto yy668; + if (yych == 'H') goto yy675; if (yych != 'h') goto yy150; -yy668: - YYDEBUG(668, *YYCURSOR); +yy675: + YYDEBUG(675, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy149; } - YYDEBUG(669, *YYCURSOR); + YYDEBUG(676, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1178 "Zend/zend_language_scanner.l" +#line 1182 "Zend/zend_language_scanner.l" { return T_FOREACH; } -#line 6264 "Zend/zend_language_scanner.c" -yy670: - YYDEBUG(670, *YYCURSOR); +#line 6323 "Zend/zend_language_scanner.c" +yy677: + YYDEBUG(677, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy671; + if (yych == 'A') goto yy678; if (yych != 'a') goto yy150; -yy671: - YYDEBUG(671, *YYCURSOR); +yy678: + YYDEBUG(678, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy672; + if (yych == 'L') goto yy679; if (yych != 'l') goto yy150; -yy672: - YYDEBUG(672, *YYCURSOR); +yy679: + YYDEBUG(679, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= '^') { if (yych <= '@') { - if (yych <= '/') goto yy673; + if (yych <= '/') goto yy680; if (yych <= '9') goto yy149; } else { - if (yych == 'L') goto yy674; + if (yych == 'L') goto yy681; if (yych <= 'Z') goto yy149; } } else { if (yych <= 'k') { if (yych != '`') goto yy149; } else { - if (yych <= 'l') goto yy674; + if (yych <= 'l') goto yy681; if (yych <= 'z') goto yy149; if (yych >= 0x7F) goto yy149; } } -yy673: - YYDEBUG(673, *YYCURSOR); +yy680: + YYDEBUG(680, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1396 "Zend/zend_language_scanner.l" +#line 1400 "Zend/zend_language_scanner.l" { return T_FINAL; } -#line 6302 "Zend/zend_language_scanner.c" -yy674: - YYDEBUG(674, *YYCURSOR); +#line 6361 "Zend/zend_language_scanner.c" +yy681: + YYDEBUG(681, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'Y') goto yy675; + if (yych == 'Y') goto yy682; if (yych != 'y') goto yy150; -yy675: - YYDEBUG(675, *YYCURSOR); +yy682: + YYDEBUG(682, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy149; } - YYDEBUG(676, *YYCURSOR); + YYDEBUG(683, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1134 "Zend/zend_language_scanner.l" +#line 1138 "Zend/zend_language_scanner.l" { return T_FINALLY; } -#line 6320 "Zend/zend_language_scanner.c" -yy677: - YYDEBUG(677, *YYCURSOR); +#line 6379 "Zend/zend_language_scanner.c" +yy684: + YYDEBUG(684, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'F') { - if (yych == 'C') goto yy683; + if (yych == 'C') goto yy690; if (yych <= 'E') goto yy150; - goto yy684; + goto yy691; } else { if (yych <= 'c') { if (yych <= 'b') goto yy150; - goto yy683; + goto yy690; } else { - if (yych == 'f') goto yy684; + if (yych == 'f') goto yy691; goto yy150; } } -yy678: - YYDEBUG(678, *YYCURSOR); +yy685: + YYDEBUG(685, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy681; - if (yych == 'e') goto yy681; + if (yych == 'E') goto yy688; + if (yych == 'e') goto yy688; goto yy150; -yy679: - YYDEBUG(679, *YYCURSOR); +yy686: + YYDEBUG(686, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy149; } - YYDEBUG(680, *YYCURSOR); + YYDEBUG(687, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1166 "Zend/zend_language_scanner.l" +#line 1170 "Zend/zend_language_scanner.l" { return T_DO; } -#line 6355 "Zend/zend_language_scanner.c" -yy681: - YYDEBUG(681, *YYCURSOR); +#line 6414 "Zend/zend_language_scanner.c" +yy688: + YYDEBUG(688, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy149; } - YYDEBUG(682, *YYCURSOR); + YYDEBUG(689, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1106 "Zend/zend_language_scanner.l" { return T_EXIT; } -#line 6368 "Zend/zend_language_scanner.c" -yy683: - YYDEBUG(683, *YYCURSOR); +#line 6427 "Zend/zend_language_scanner.c" +yy690: + YYDEBUG(690, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy690; - if (yych == 'l') goto yy690; + if (yych == 'L') goto yy697; + if (yych == 'l') goto yy697; goto yy150; -yy684: - YYDEBUG(684, *YYCURSOR); +yy691: + YYDEBUG(691, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy685; + if (yych == 'A') goto yy692; if (yych != 'a') goto yy150; -yy685: - YYDEBUG(685, *YYCURSOR); +yy692: + YYDEBUG(692, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'U') goto yy686; + if (yych == 'U') goto yy693; if (yych != 'u') goto yy150; -yy686: - YYDEBUG(686, *YYCURSOR); +yy693: + YYDEBUG(693, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy687; + if (yych == 'L') goto yy694; if (yych != 'l') goto yy150; -yy687: - YYDEBUG(687, *YYCURSOR); +yy694: + YYDEBUG(694, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy688; + if (yych == 'T') goto yy695; if (yych != 't') goto yy150; -yy688: - YYDEBUG(688, *YYCURSOR); +yy695: + YYDEBUG(695, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy149; } - YYDEBUG(689, *YYCURSOR); + YYDEBUG(696, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1214 "Zend/zend_language_scanner.l" +#line 1218 "Zend/zend_language_scanner.l" { return T_DEFAULT; } -#line 6407 "Zend/zend_language_scanner.c" -yy690: - YYDEBUG(690, *YYCURSOR); +#line 6466 "Zend/zend_language_scanner.c" +yy697: + YYDEBUG(697, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy691; + if (yych == 'A') goto yy698; if (yych != 'a') goto yy150; -yy691: - YYDEBUG(691, *YYCURSOR); +yy698: + YYDEBUG(698, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy692; + if (yych == 'R') goto yy699; if (yych != 'r') goto yy150; -yy692: - YYDEBUG(692, *YYCURSOR); +yy699: + YYDEBUG(699, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy693; + if (yych == 'E') goto yy700; if (yych != 'e') goto yy150; -yy693: - YYDEBUG(693, *YYCURSOR); +yy700: + YYDEBUG(700, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy149; } - YYDEBUG(694, *YYCURSOR); + YYDEBUG(701, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1186 "Zend/zend_language_scanner.l" +#line 1190 "Zend/zend_language_scanner.l" { return T_DECLARE; } -#line 6435 "Zend/zend_language_scanner.c" -yy695: - YYDEBUG(695, *YYCURSOR); +#line 6494 "Zend/zend_language_scanner.c" +yy702: + YYDEBUG(702, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'H') goto yy757; - if (yych == 'h') goto yy757; + if (yych == 'H') goto yy764; + if (yych == 'h') goto yy764; goto yy150; -yy696: - YYDEBUG(696, *YYCURSOR); +yy703: + YYDEBUG(703, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'S') goto yy751; - if (yych == 's') goto yy751; + if (yych == 'S') goto yy758; + if (yych == 's') goto yy758; goto yy150; -yy697: - YYDEBUG(697, *YYCURSOR); +yy704: + YYDEBUG(704, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'P') goto yy747; - if (yych == 'p') goto yy747; + if (yych == 'P') goto yy754; + if (yych == 'p') goto yy754; goto yy150; -yy698: - YYDEBUG(698, *YYCURSOR); +yy705: + YYDEBUG(705, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'D') goto yy713; - if (yych == 'd') goto yy713; + if (yych == 'D') goto yy720; + if (yych == 'd') goto yy720; goto yy150; -yy699: - YYDEBUG(699, *YYCURSOR); +yy706: + YYDEBUG(706, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy710; - if (yych == 'a') goto yy710; + if (yych == 'A') goto yy717; + if (yych == 'a') goto yy717; goto yy150; -yy700: - YYDEBUG(700, *YYCURSOR); +yy707: + YYDEBUG(707, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'T') { - if (yych == 'I') goto yy701; + if (yych == 'I') goto yy708; if (yych <= 'S') goto yy150; - goto yy702; + goto yy709; } else { if (yych <= 'i') { if (yych <= 'h') goto yy150; } else { - if (yych == 't') goto yy702; + if (yych == 't') goto yy709; goto yy150; } } -yy701: - YYDEBUG(701, *YYCURSOR); +yy708: + YYDEBUG(708, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy708; - if (yych == 't') goto yy708; + if (yych == 'T') goto yy715; + if (yych == 't') goto yy715; goto yy150; -yy702: - YYDEBUG(702, *YYCURSOR); +yy709: + YYDEBUG(709, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy703; + if (yych == 'E') goto yy710; if (yych != 'e') goto yy150; -yy703: - YYDEBUG(703, *YYCURSOR); +yy710: + YYDEBUG(710, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy704; + if (yych == 'N') goto yy711; if (yych != 'n') goto yy150; -yy704: - YYDEBUG(704, *YYCURSOR); +yy711: + YYDEBUG(711, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'D') goto yy705; + if (yych == 'D') goto yy712; if (yych != 'd') goto yy150; -yy705: - YYDEBUG(705, *YYCURSOR); +yy712: + YYDEBUG(712, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'S') goto yy706; + if (yych == 'S') goto yy713; if (yych != 's') goto yy150; -yy706: - YYDEBUG(706, *YYCURSOR); +yy713: + YYDEBUG(713, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy149; } - YYDEBUG(707, *YYCURSOR); + YYDEBUG(714, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1250 "Zend/zend_language_scanner.l" +#line 1254 "Zend/zend_language_scanner.l" { return T_EXTENDS; } -#line 6519 "Zend/zend_language_scanner.c" -yy708: - YYDEBUG(708, *YYCURSOR); +#line 6578 "Zend/zend_language_scanner.c" +yy715: + YYDEBUG(715, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy149; } - YYDEBUG(709, *YYCURSOR); + YYDEBUG(716, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1102 "Zend/zend_language_scanner.l" { return T_EXIT; } -#line 6532 "Zend/zend_language_scanner.c" -yy710: - YYDEBUG(710, *YYCURSOR); +#line 6591 "Zend/zend_language_scanner.c" +yy717: + YYDEBUG(717, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy711; + if (yych == 'L') goto yy718; if (yych != 'l') goto yy150; -yy711: - YYDEBUG(711, *YYCURSOR); +yy718: + YYDEBUG(718, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy149; } - YYDEBUG(712, *YYCURSOR); + YYDEBUG(719, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1340 "Zend/zend_language_scanner.l" +#line 1344 "Zend/zend_language_scanner.l" { return T_EVAL; } -#line 6550 "Zend/zend_language_scanner.c" -yy713: - YYDEBUG(713, *YYCURSOR); +#line 6609 "Zend/zend_language_scanner.c" +yy720: + YYDEBUG(720, *YYCURSOR); yych = *++YYCURSOR; YYDEBUG(-1, yych); switch (yych) { case 'D': - case 'd': goto yy714; + case 'd': goto yy721; case 'F': - case 'f': goto yy715; + case 'f': goto yy722; case 'I': - case 'i': goto yy716; + case 'i': goto yy723; case 'S': - case 's': goto yy717; + case 's': goto yy724; case 'W': - case 'w': goto yy718; + case 'w': goto yy725; default: goto yy150; } -yy714: - YYDEBUG(714, *YYCURSOR); +yy721: + YYDEBUG(721, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy740; - if (yych == 'e') goto yy740; + if (yych == 'E') goto yy747; + if (yych == 'e') goto yy747; goto yy150; -yy715: - YYDEBUG(715, *YYCURSOR); +yy722: + YYDEBUG(722, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy732; - if (yych == 'o') goto yy732; + if (yych == 'O') goto yy739; + if (yych == 'o') goto yy739; goto yy150; -yy716: - YYDEBUG(716, *YYCURSOR); +yy723: + YYDEBUG(723, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'F') goto yy730; - if (yych == 'f') goto yy730; + if (yych == 'F') goto yy737; + if (yych == 'f') goto yy737; goto yy150; -yy717: - YYDEBUG(717, *YYCURSOR); +yy724: + YYDEBUG(724, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'W') goto yy724; - if (yych == 'w') goto yy724; + if (yych == 'W') goto yy731; + if (yych == 'w') goto yy731; goto yy150; -yy718: - YYDEBUG(718, *YYCURSOR); +yy725: + YYDEBUG(725, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'H') goto yy719; + if (yych == 'H') goto yy726; if (yych != 'h') goto yy150; -yy719: - YYDEBUG(719, *YYCURSOR); +yy726: + YYDEBUG(726, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy720; + if (yych == 'I') goto yy727; if (yych != 'i') goto yy150; -yy720: - YYDEBUG(720, *YYCURSOR); +yy727: + YYDEBUG(727, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy721; + if (yych == 'L') goto yy728; if (yych != 'l') goto yy150; -yy721: - YYDEBUG(721, *YYCURSOR); +yy728: + YYDEBUG(728, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy722; + if (yych == 'E') goto yy729; if (yych != 'e') goto yy150; -yy722: - YYDEBUG(722, *YYCURSOR); +yy729: + YYDEBUG(729, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy149; } - YYDEBUG(723, *YYCURSOR); + YYDEBUG(730, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1162 "Zend/zend_language_scanner.l" +#line 1166 "Zend/zend_language_scanner.l" { return T_ENDWHILE; } -#line 6624 "Zend/zend_language_scanner.c" -yy724: - YYDEBUG(724, *YYCURSOR); +#line 6683 "Zend/zend_language_scanner.c" +yy731: + YYDEBUG(731, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy725; + if (yych == 'I') goto yy732; if (yych != 'i') goto yy150; -yy725: - YYDEBUG(725, *YYCURSOR); +yy732: + YYDEBUG(732, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy726; + if (yych == 'T') goto yy733; if (yych != 't') goto yy150; -yy726: - YYDEBUG(726, *YYCURSOR); +yy733: + YYDEBUG(733, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy727; + if (yych == 'C') goto yy734; if (yych != 'c') goto yy150; -yy727: - YYDEBUG(727, *YYCURSOR); +yy734: + YYDEBUG(734, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'H') goto yy728; + if (yych == 'H') goto yy735; if (yych != 'h') goto yy150; -yy728: - YYDEBUG(728, *YYCURSOR); +yy735: + YYDEBUG(735, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy149; } - YYDEBUG(729, *YYCURSOR); + YYDEBUG(736, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1206 "Zend/zend_language_scanner.l" +#line 1210 "Zend/zend_language_scanner.l" { return T_ENDSWITCH; } -#line 6657 "Zend/zend_language_scanner.c" -yy730: - YYDEBUG(730, *YYCURSOR); +#line 6716 "Zend/zend_language_scanner.c" +yy737: + YYDEBUG(737, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy149; } - YYDEBUG(731, *YYCURSOR); + YYDEBUG(738, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1150 "Zend/zend_language_scanner.l" +#line 1154 "Zend/zend_language_scanner.l" { return T_ENDIF; } -#line 6670 "Zend/zend_language_scanner.c" -yy732: - YYDEBUG(732, *YYCURSOR); +#line 6729 "Zend/zend_language_scanner.c" +yy739: + YYDEBUG(739, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy733; + if (yych == 'R') goto yy740; if (yych != 'r') goto yy150; -yy733: - YYDEBUG(733, *YYCURSOR); +yy740: + YYDEBUG(740, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= '^') { if (yych <= '@') { - if (yych <= '/') goto yy734; + if (yych <= '/') goto yy741; if (yych <= '9') goto yy149; } else { - if (yych == 'E') goto yy735; + if (yych == 'E') goto yy742; if (yych <= 'Z') goto yy149; } } else { if (yych <= 'd') { if (yych != '`') goto yy149; } else { - if (yych <= 'e') goto yy735; + if (yych <= 'e') goto yy742; if (yych <= 'z') goto yy149; if (yych >= 0x7F) goto yy149; } } -yy734: - YYDEBUG(734, *YYCURSOR); +yy741: + YYDEBUG(741, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1174 "Zend/zend_language_scanner.l" +#line 1178 "Zend/zend_language_scanner.l" { return T_ENDFOR; } -#line 6703 "Zend/zend_language_scanner.c" -yy735: - YYDEBUG(735, *YYCURSOR); +#line 6762 "Zend/zend_language_scanner.c" +yy742: + YYDEBUG(742, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy736; + if (yych == 'A') goto yy743; if (yych != 'a') goto yy150; -yy736: - YYDEBUG(736, *YYCURSOR); +yy743: + YYDEBUG(743, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy737; + if (yych == 'C') goto yy744; if (yych != 'c') goto yy150; -yy737: - YYDEBUG(737, *YYCURSOR); +yy744: + YYDEBUG(744, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'H') goto yy738; + if (yych == 'H') goto yy745; if (yych != 'h') goto yy150; -yy738: - YYDEBUG(738, *YYCURSOR); +yy745: + YYDEBUG(745, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy149; } - YYDEBUG(739, *YYCURSOR); + YYDEBUG(746, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1182 "Zend/zend_language_scanner.l" +#line 1186 "Zend/zend_language_scanner.l" { return T_ENDFOREACH; } -#line 6731 "Zend/zend_language_scanner.c" -yy740: - YYDEBUG(740, *YYCURSOR); +#line 6790 "Zend/zend_language_scanner.c" +yy747: + YYDEBUG(747, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy741; + if (yych == 'C') goto yy748; if (yych != 'c') goto yy150; -yy741: - YYDEBUG(741, *YYCURSOR); +yy748: + YYDEBUG(748, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy742; + if (yych == 'L') goto yy749; if (yych != 'l') goto yy150; -yy742: - YYDEBUG(742, *YYCURSOR); +yy749: + YYDEBUG(749, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy743; + if (yych == 'A') goto yy750; if (yych != 'a') goto yy150; -yy743: - YYDEBUG(743, *YYCURSOR); +yy750: + YYDEBUG(750, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy744; + if (yych == 'R') goto yy751; if (yych != 'r') goto yy150; -yy744: - YYDEBUG(744, *YYCURSOR); +yy751: + YYDEBUG(751, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy745; + if (yych == 'E') goto yy752; if (yych != 'e') goto yy150; -yy745: - YYDEBUG(745, *YYCURSOR); +yy752: + YYDEBUG(752, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy149; } - YYDEBUG(746, *YYCURSOR); + YYDEBUG(753, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1190 "Zend/zend_language_scanner.l" +#line 1194 "Zend/zend_language_scanner.l" { return T_ENDDECLARE; } -#line 6769 "Zend/zend_language_scanner.c" -yy747: - YYDEBUG(747, *YYCURSOR); +#line 6828 "Zend/zend_language_scanner.c" +yy754: + YYDEBUG(754, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy748; + if (yych == 'T') goto yy755; if (yych != 't') goto yy150; -yy748: - YYDEBUG(748, *YYCURSOR); +yy755: + YYDEBUG(755, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'Y') goto yy749; + if (yych == 'Y') goto yy756; if (yych != 'y') goto yy150; -yy749: - YYDEBUG(749, *YYCURSOR); +yy756: + YYDEBUG(756, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy149; } - YYDEBUG(750, *YYCURSOR); + YYDEBUG(757, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1380 "Zend/zend_language_scanner.l" +#line 1384 "Zend/zend_language_scanner.l" { return T_EMPTY; } -#line 6792 "Zend/zend_language_scanner.c" -yy751: - YYDEBUG(751, *YYCURSOR); +#line 6851 "Zend/zend_language_scanner.c" +yy758: + YYDEBUG(758, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy752; + if (yych == 'E') goto yy759; if (yych != 'e') goto yy150; -yy752: - YYDEBUG(752, *YYCURSOR); +yy759: + YYDEBUG(759, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= '^') { if (yych <= '@') { - if (yych <= '/') goto yy753; + if (yych <= '/') goto yy760; if (yych <= '9') goto yy149; } else { - if (yych == 'I') goto yy754; + if (yych == 'I') goto yy761; if (yych <= 'Z') goto yy149; } } else { if (yych <= 'h') { if (yych != '`') goto yy149; } else { - if (yych <= 'i') goto yy754; + if (yych <= 'i') goto yy761; if (yych <= 'z') goto yy149; if (yych >= 0x7F) goto yy149; } } -yy753: - YYDEBUG(753, *YYCURSOR); +yy760: + YYDEBUG(760, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1154 "Zend/zend_language_scanner.l" +#line 1158 "Zend/zend_language_scanner.l" { return T_ELSE; } -#line 6825 "Zend/zend_language_scanner.c" -yy754: - YYDEBUG(754, *YYCURSOR); +#line 6884 "Zend/zend_language_scanner.c" +yy761: + YYDEBUG(761, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'F') goto yy755; + if (yych == 'F') goto yy762; if (yych != 'f') goto yy150; -yy755: - YYDEBUG(755, *YYCURSOR); +yy762: + YYDEBUG(762, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy149; } - YYDEBUG(756, *YYCURSOR); + YYDEBUG(763, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1146 "Zend/zend_language_scanner.l" +#line 1150 "Zend/zend_language_scanner.l" { return T_ELSEIF; } -#line 6843 "Zend/zend_language_scanner.c" -yy757: - YYDEBUG(757, *YYCURSOR); +#line 6902 "Zend/zend_language_scanner.c" +yy764: + YYDEBUG(764, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy758; + if (yych == 'O') goto yy765; if (yych != 'o') goto yy150; -yy758: - YYDEBUG(758, *YYCURSOR); +yy765: + YYDEBUG(765, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy149; } - YYDEBUG(759, *YYCURSOR); + YYDEBUG(766, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1230 "Zend/zend_language_scanner.l" +#line 1234 "Zend/zend_language_scanner.l" { return T_ECHO; } -#line 6861 "Zend/zend_language_scanner.c" +#line 6920 "Zend/zend_language_scanner.c" } /* *********************************** */ yyc_ST_LOOKING_FOR_PROPERTY: @@ -6896,111 +6955,111 @@ yyc_ST_LOOKING_FOR_PROPERTY: 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, }; - YYDEBUG(760, *YYCURSOR); + YYDEBUG(767, *YYCURSOR); YYFILL(2); yych = *YYCURSOR; if (yych <= '-') { if (yych <= '\r') { - if (yych <= 0x08) goto yy768; - if (yych <= '\n') goto yy762; - if (yych <= '\f') goto yy768; + if (yych <= 0x08) goto yy775; + if (yych <= '\n') goto yy769; + if (yych <= '\f') goto yy775; } else { - if (yych == ' ') goto yy762; - if (yych <= ',') goto yy768; - goto yy764; + if (yych == ' ') goto yy769; + if (yych <= ',') goto yy775; + goto yy771; } } else { if (yych <= '_') { - if (yych <= '@') goto yy768; - if (yych <= 'Z') goto yy766; - if (yych <= '^') goto yy768; - goto yy766; + if (yych <= '@') goto yy775; + if (yych <= 'Z') goto yy773; + if (yych <= '^') goto yy775; + goto yy773; } else { - if (yych <= '`') goto yy768; - if (yych <= 'z') goto yy766; - if (yych <= '~') goto yy768; - goto yy766; + if (yych <= '`') goto yy775; + if (yych <= 'z') goto yy773; + if (yych <= '~') goto yy775; + goto yy773; } } -yy762: - YYDEBUG(762, *YYCURSOR); +yy769: + YYDEBUG(769, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; - goto yy774; -yy763: - YYDEBUG(763, *YYCURSOR); + goto yy781; +yy770: + YYDEBUG(770, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1263 "Zend/zend_language_scanner.l" +#line 1267 "Zend/zend_language_scanner.l" { HANDLE_NEWLINES(yytext, yyleng); return T_WHITESPACE; } -#line 6939 "Zend/zend_language_scanner.c" -yy764: - YYDEBUG(764, *YYCURSOR); +#line 6998 "Zend/zend_language_scanner.c" +yy771: + YYDEBUG(771, *YYCURSOR); ++YYCURSOR; - if ((yych = *YYCURSOR) == '>') goto yy771; -yy765: - YYDEBUG(765, *YYCURSOR); + if ((yych = *YYCURSOR) == '>') goto yy778; +yy772: + YYDEBUG(772, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1278 "Zend/zend_language_scanner.l" +#line 1282 "Zend/zend_language_scanner.l" { yyless(0); yy_pop_state(); goto restart; } -#line 6953 "Zend/zend_language_scanner.c" -yy766: - YYDEBUG(766, *YYCURSOR); +#line 7012 "Zend/zend_language_scanner.c" +yy773: + YYDEBUG(773, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; - goto yy770; -yy767: - YYDEBUG(767, *YYCURSOR); + goto yy777; +yy774: + YYDEBUG(774, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1272 "Zend/zend_language_scanner.l" +#line 1276 "Zend/zend_language_scanner.l" { yy_pop_state(); zend_copy_value(zendlval, yytext, yyleng); return T_STRING; } -#line 6968 "Zend/zend_language_scanner.c" -yy768: - YYDEBUG(768, *YYCURSOR); +#line 7027 "Zend/zend_language_scanner.c" +yy775: + YYDEBUG(775, *YYCURSOR); yych = *++YYCURSOR; - goto yy765; -yy769: - YYDEBUG(769, *YYCURSOR); + goto yy772; +yy776: + YYDEBUG(776, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy770: - YYDEBUG(770, *YYCURSOR); +yy777: + YYDEBUG(777, *YYCURSOR); if (yybm[0+yych] & 64) { - goto yy769; + goto yy776; } - goto yy767; -yy771: - YYDEBUG(771, *YYCURSOR); + goto yy774; +yy778: + YYDEBUG(778, *YYCURSOR); ++YYCURSOR; - YYDEBUG(772, *YYCURSOR); + YYDEBUG(779, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1268 "Zend/zend_language_scanner.l" +#line 1272 "Zend/zend_language_scanner.l" { return T_OBJECT_OPERATOR; } -#line 6993 "Zend/zend_language_scanner.c" -yy773: - YYDEBUG(773, *YYCURSOR); +#line 7052 "Zend/zend_language_scanner.c" +yy780: + YYDEBUG(780, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy774: - YYDEBUG(774, *YYCURSOR); +yy781: + YYDEBUG(781, *YYCURSOR); if (yybm[0+yych] & 128) { - goto yy773; + goto yy780; } - goto yy763; + goto yy770; } /* *********************************** */ yyc_ST_LOOKING_FOR_VARNAME: @@ -7039,74 +7098,74 @@ yyc_ST_LOOKING_FOR_VARNAME: 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, }; - YYDEBUG(775, *YYCURSOR); + YYDEBUG(782, *YYCURSOR); YYFILL(2); yych = *YYCURSOR; if (yych <= '_') { - if (yych <= '@') goto yy779; - if (yych <= 'Z') goto yy777; - if (yych <= '^') goto yy779; + if (yych <= '@') goto yy786; + if (yych <= 'Z') goto yy784; + if (yych <= '^') goto yy786; } else { - if (yych <= '`') goto yy779; - if (yych <= 'z') goto yy777; - if (yych <= '~') goto yy779; + if (yych <= '`') goto yy786; + if (yych <= 'z') goto yy784; + if (yych <= '~') goto yy786; } -yy777: - YYDEBUG(777, *YYCURSOR); +yy784: + YYDEBUG(784, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '_') { if (yych <= '@') { - if (yych <= '/') goto yy778; - if (yych <= '9') goto yy781; + if (yych <= '/') goto yy785; + if (yych <= '9') goto yy788; } else { - if (yych <= '[') goto yy781; - if (yych >= '_') goto yy781; + if (yych <= '[') goto yy788; + if (yych >= '_') goto yy788; } } else { if (yych <= '|') { - if (yych <= '`') goto yy778; - if (yych <= 'z') goto yy781; + if (yych <= '`') goto yy785; + if (yych <= 'z') goto yy788; } else { - if (yych != '~') goto yy781; + if (yych != '~') goto yy788; } } -yy778: - YYDEBUG(778, *YYCURSOR); +yy785: + YYDEBUG(785, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1579 "Zend/zend_language_scanner.l" +#line 1583 "Zend/zend_language_scanner.l" { yyless(0); yy_pop_state(); yy_push_state(ST_IN_SCRIPTING); goto restart; } -#line 7085 "Zend/zend_language_scanner.c" -yy779: - YYDEBUG(779, *YYCURSOR); +#line 7144 "Zend/zend_language_scanner.c" +yy786: + YYDEBUG(786, *YYCURSOR); yych = *++YYCURSOR; - goto yy778; -yy780: - YYDEBUG(780, *YYCURSOR); + goto yy785; +yy787: + YYDEBUG(787, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy781: - YYDEBUG(781, *YYCURSOR); +yy788: + YYDEBUG(788, *YYCURSOR); if (yybm[0+yych] & 128) { - goto yy780; + goto yy787; } - if (yych == '[') goto yy783; - if (yych == '}') goto yy783; - YYDEBUG(782, *YYCURSOR); + if (yych == '[') goto yy790; + if (yych == '}') goto yy790; + YYDEBUG(789, *YYCURSOR); YYCURSOR = YYMARKER; - goto yy778; -yy783: - YYDEBUG(783, *YYCURSOR); + goto yy785; +yy790: + YYDEBUG(790, *YYCURSOR); ++YYCURSOR; - YYDEBUG(784, *YYCURSOR); + YYDEBUG(791, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1570 "Zend/zend_language_scanner.l" +#line 1574 "Zend/zend_language_scanner.l" { yyless(yyleng - 1); zend_copy_value(zendlval, yytext, yyleng); @@ -7114,18 +7173,18 @@ yy783: yy_push_state(ST_IN_SCRIPTING); return T_STRING_VARNAME; } -#line 7118 "Zend/zend_language_scanner.c" +#line 7177 "Zend/zend_language_scanner.c" } /* *********************************** */ yyc_ST_NOWDOC: - YYDEBUG(785, *YYCURSOR); + YYDEBUG(792, *YYCURSOR); YYFILL(1); yych = *YYCURSOR; - YYDEBUG(787, *YYCURSOR); + YYDEBUG(794, *YYCURSOR); ++YYCURSOR; - YYDEBUG(788, *YYCURSOR); + YYDEBUG(795, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2292 "Zend/zend_language_scanner.l" +#line 2296 "Zend/zend_language_scanner.l" { int newline = 0; @@ -7181,7 +7240,7 @@ nowdoc_scan_done: HANDLE_NEWLINES(yytext, yyleng - newline); return T_ENCAPSED_AND_WHITESPACE; } -#line 7185 "Zend/zend_language_scanner.c" +#line 7244 "Zend/zend_language_scanner.c" /* *********************************** */ yyc_ST_VAR_OFFSET: { @@ -7219,76 +7278,76 @@ yyc_ST_VAR_OFFSET: 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, }; - YYDEBUG(789, *YYCURSOR); + YYDEBUG(796, *YYCURSOR); YYFILL(3); yych = *YYCURSOR; if (yych <= '/') { if (yych <= ' ') { if (yych <= '\f') { - if (yych <= 0x08) goto yy803; - if (yych <= '\n') goto yy799; - goto yy803; + if (yych <= 0x08) goto yy810; + if (yych <= '\n') goto yy806; + goto yy810; } else { - if (yych <= '\r') goto yy799; - if (yych <= 0x1F) goto yy803; - goto yy799; + if (yych <= '\r') goto yy806; + if (yych <= 0x1F) goto yy810; + goto yy806; } } else { if (yych <= '$') { - if (yych <= '"') goto yy798; - if (yych <= '#') goto yy799; - goto yy794; + if (yych <= '"') goto yy805; + if (yych <= '#') goto yy806; + goto yy801; } else { - if (yych == '\'') goto yy799; - goto yy798; + if (yych == '\'') goto yy806; + goto yy805; } } } else { if (yych <= '\\') { if (yych <= '@') { - if (yych <= '0') goto yy791; - if (yych <= '9') goto yy793; - goto yy798; + if (yych <= '0') goto yy798; + if (yych <= '9') goto yy800; + goto yy805; } else { - if (yych <= 'Z') goto yy801; - if (yych <= '[') goto yy798; - goto yy799; + if (yych <= 'Z') goto yy808; + if (yych <= '[') goto yy805; + goto yy806; } } else { if (yych <= '_') { - if (yych <= ']') goto yy796; - if (yych <= '^') goto yy798; - goto yy801; + if (yych <= ']') goto yy803; + if (yych <= '^') goto yy805; + goto yy808; } else { - if (yych <= '`') goto yy798; - if (yych <= 'z') goto yy801; - if (yych <= '~') goto yy798; - goto yy801; + if (yych <= '`') goto yy805; + if (yych <= 'z') goto yy808; + if (yych <= '~') goto yy805; + goto yy808; } } } -yy791: - YYDEBUG(791, *YYCURSOR); +yy798: + YYDEBUG(798, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'W') { if (yych <= '9') { - if (yych >= '0') goto yy815; + if (yych >= '0') goto yy822; } else { - if (yych == 'B') goto yy812; + if (yych == 'B') goto yy819; } } else { if (yych <= 'b') { - if (yych <= 'X') goto yy814; - if (yych >= 'b') goto yy812; + if (yych <= 'X') goto yy821; + if (yych >= 'b') goto yy819; } else { - if (yych == 'x') goto yy814; + if (yych == 'x') goto yy821; } } -yy792: - YYDEBUG(792, *YYCURSOR); +yy799: + YYDEBUG(799, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1681 "Zend/zend_language_scanner.l" +#line 1685 "Zend/zend_language_scanner.l" { /* Offset could be treated as a long */ if (yyleng < MAX_LENGTH_OF_LONG - 1 || (yyleng == MAX_LENGTH_OF_LONG - 1 && strcmp(yytext, long_min_digits) < 0)) { char *end; @@ -7304,53 +7363,53 @@ string: } return T_NUM_STRING; } -#line 7308 "Zend/zend_language_scanner.c" -yy793: - YYDEBUG(793, *YYCURSOR); +#line 7367 "Zend/zend_language_scanner.c" +yy800: + YYDEBUG(800, *YYCURSOR); yych = *++YYCURSOR; - goto yy811; -yy794: - YYDEBUG(794, *YYCURSOR); + goto yy818; +yy801: + YYDEBUG(801, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= '_') { - if (yych <= '@') goto yy795; - if (yych <= 'Z') goto yy807; - if (yych >= '_') goto yy807; + if (yych <= '@') goto yy802; + if (yych <= 'Z') goto yy814; + if (yych >= '_') goto yy814; } else { - if (yych <= '`') goto yy795; - if (yych <= 'z') goto yy807; - if (yych >= 0x7F) goto yy807; + if (yych <= '`') goto yy802; + if (yych <= 'z') goto yy814; + if (yych >= 0x7F) goto yy814; } -yy795: - YYDEBUG(795, *YYCURSOR); +yy802: + YYDEBUG(802, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1841 "Zend/zend_language_scanner.l" +#line 1845 "Zend/zend_language_scanner.l" { /* Only '[' can be valid, but returning other tokens will allow a more explicit parse error */ return yytext[0]; } -#line 7333 "Zend/zend_language_scanner.c" -yy796: - YYDEBUG(796, *YYCURSOR); +#line 7392 "Zend/zend_language_scanner.c" +yy803: + YYDEBUG(803, *YYCURSOR); ++YYCURSOR; - YYDEBUG(797, *YYCURSOR); + YYDEBUG(804, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1836 "Zend/zend_language_scanner.l" +#line 1840 "Zend/zend_language_scanner.l" { yy_pop_state(); return ']'; } -#line 7344 "Zend/zend_language_scanner.c" -yy798: - YYDEBUG(798, *YYCURSOR); +#line 7403 "Zend/zend_language_scanner.c" +yy805: + YYDEBUG(805, *YYCURSOR); yych = *++YYCURSOR; - goto yy795; -yy799: - YYDEBUG(799, *YYCURSOR); + goto yy802; +yy806: + YYDEBUG(806, *YYCURSOR); ++YYCURSOR; - YYDEBUG(800, *YYCURSOR); + YYDEBUG(807, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1846 "Zend/zend_language_scanner.l" +#line 1850 "Zend/zend_language_scanner.l" { /* Invalid rule to return a more explicit parse error with proper line number */ yyless(0); @@ -7358,27 +7417,27 @@ yy799: ZVAL_NULL(zendlval); return T_ENCAPSED_AND_WHITESPACE; } -#line 7362 "Zend/zend_language_scanner.c" -yy801: - YYDEBUG(801, *YYCURSOR); +#line 7421 "Zend/zend_language_scanner.c" +yy808: + YYDEBUG(808, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; - goto yy806; -yy802: - YYDEBUG(802, *YYCURSOR); + goto yy813; +yy809: + YYDEBUG(809, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1854 "Zend/zend_language_scanner.l" +#line 1858 "Zend/zend_language_scanner.l" { zend_copy_value(zendlval, yytext, yyleng); return T_STRING; } -#line 7376 "Zend/zend_language_scanner.c" -yy803: - YYDEBUG(803, *YYCURSOR); +#line 7435 "Zend/zend_language_scanner.c" +yy810: + YYDEBUG(810, *YYCURSOR); ++YYCURSOR; - YYDEBUG(804, *YYCURSOR); + YYDEBUG(811, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2349 "Zend/zend_language_scanner.l" +#line 2353 "Zend/zend_language_scanner.l" { if (YYCURSOR > YYLIMIT) { return 0; @@ -7387,115 +7446,115 @@ yy803: zend_error(E_COMPILE_WARNING,"Unexpected character in input: '%c' (ASCII=%d) state=%d", yytext[0], yytext[0], YYSTATE); goto restart; } -#line 7391 "Zend/zend_language_scanner.c" -yy805: - YYDEBUG(805, *YYCURSOR); +#line 7450 "Zend/zend_language_scanner.c" +yy812: + YYDEBUG(812, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy806: - YYDEBUG(806, *YYCURSOR); +yy813: + YYDEBUG(813, *YYCURSOR); if (yybm[0+yych] & 16) { - goto yy805; + goto yy812; } - goto yy802; -yy807: - YYDEBUG(807, *YYCURSOR); + goto yy809; +yy814: + YYDEBUG(814, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(808, *YYCURSOR); + YYDEBUG(815, *YYCURSOR); if (yych <= '^') { if (yych <= '9') { - if (yych >= '0') goto yy807; + if (yych >= '0') goto yy814; } else { - if (yych <= '@') goto yy809; - if (yych <= 'Z') goto yy807; + if (yych <= '@') goto yy816; + if (yych <= 'Z') goto yy814; } } else { if (yych <= '`') { - if (yych <= '_') goto yy807; + if (yych <= '_') goto yy814; } else { - if (yych <= 'z') goto yy807; - if (yych >= 0x7F) goto yy807; + if (yych <= 'z') goto yy814; + if (yych >= 0x7F) goto yy814; } } -yy809: - YYDEBUG(809, *YYCURSOR); +yy816: + YYDEBUG(816, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1831 "Zend/zend_language_scanner.l" +#line 1835 "Zend/zend_language_scanner.l" { zend_copy_value(zendlval, (yytext+1), (yyleng-1)); return T_VARIABLE; } -#line 7432 "Zend/zend_language_scanner.c" -yy810: - YYDEBUG(810, *YYCURSOR); +#line 7491 "Zend/zend_language_scanner.c" +yy817: + YYDEBUG(817, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy811: - YYDEBUG(811, *YYCURSOR); +yy818: + YYDEBUG(818, *YYCURSOR); if (yybm[0+yych] & 32) { - goto yy810; + goto yy817; } - goto yy792; -yy812: - YYDEBUG(812, *YYCURSOR); + goto yy799; +yy819: + YYDEBUG(819, *YYCURSOR); yych = *++YYCURSOR; if (yybm[0+yych] & 128) { - goto yy820; + goto yy827; } -yy813: - YYDEBUG(813, *YYCURSOR); +yy820: + YYDEBUG(820, *YYCURSOR); YYCURSOR = YYMARKER; - goto yy792; -yy814: - YYDEBUG(814, *YYCURSOR); + goto yy799; +yy821: + YYDEBUG(821, *YYCURSOR); yych = *++YYCURSOR; if (yybm[0+yych] & 64) { - goto yy818; + goto yy825; } - goto yy813; -yy815: - YYDEBUG(815, *YYCURSOR); + goto yy820; +yy822: + YYDEBUG(822, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(816, *YYCURSOR); - if (yych <= '/') goto yy817; - if (yych <= '9') goto yy815; -yy817: - YYDEBUG(817, *YYCURSOR); + YYDEBUG(823, *YYCURSOR); + if (yych <= '/') goto yy824; + if (yych <= '9') goto yy822; +yy824: + YYDEBUG(824, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1697 "Zend/zend_language_scanner.l" +#line 1701 "Zend/zend_language_scanner.l" { /* Offset must be treated as a string */ ZVAL_STRINGL(zendlval, yytext, yyleng); return T_NUM_STRING; } -#line 7477 "Zend/zend_language_scanner.c" -yy818: - YYDEBUG(818, *YYCURSOR); +#line 7536 "Zend/zend_language_scanner.c" +yy825: + YYDEBUG(825, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(819, *YYCURSOR); + YYDEBUG(826, *YYCURSOR); if (yybm[0+yych] & 64) { - goto yy818; + goto yy825; } - goto yy817; -yy820: - YYDEBUG(820, *YYCURSOR); + goto yy824; +yy827: + YYDEBUG(827, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(821, *YYCURSOR); + YYDEBUG(828, *YYCURSOR); if (yybm[0+yych] & 128) { - goto yy820; + goto yy827; } - goto yy817; + goto yy824; } } -#line 2358 "Zend/zend_language_scanner.l" +#line 2362 "Zend/zend_language_scanner.l" } diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l index 0081192d40..e4b4fc089c 100644 --- a/Zend/zend_language_scanner.l +++ b/Zend/zend_language_scanner.l @@ -1119,6 +1119,10 @@ NEWLINE ("\r"|"\n"|"\r\n") return T_RETURN; } +<ST_IN_SCRIPTING>"yield"{WHITESPACE}"from" { + return T_YIELD_FROM; +} + <ST_IN_SCRIPTING>"yield" { return T_YIELD; } diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 62ac7641ce..53cb3db128 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -6392,13 +6392,27 @@ ZEND_VM_HANDLER(170, ZEND_YIELD_FROM, CONST|TMP|VAR|CV, ANY) if (ce == zend_ce_generator) { zend_generator *new_gen = (zend_generator *) Z_OBJ_P(val); - zend_ptr_stack_push(&generator->generator_stack, generator->current_generator); - generator->current_generator = new_gen; - if (OP1_TYPE != IS_TMP_VAR) { Z_ADDREF_P(val); } FREE_OP1_IF_VAR(); + + if (Z_ISUNDEF(new_gen->retval)) { + zend_generator_yield_from(generator, new_gen); + } else if (new_gen->execute_data == NULL) { + // TODO: Should be an engine exception + zend_error(E_RECOVERABLE_ERROR, "Generator passed to yield from was aborted without proper return and is unable to continue"); + + CHECK_EXCEPTION(); + ZEND_VM_NEXT_OPCODE(); + } else { + if (RETURN_VALUE_USED(opline)) { + ZVAL_COPY(EX_VAR(opline->result.var), &new_gen->retval); + } + + CHECK_EXCEPTION(); + ZEND_VM_NEXT_OPCODE(); + } } else { zend_object_iterator *iter = ce->get_iterator(ce, val, 0); FREE_OP1(); @@ -6425,12 +6439,13 @@ ZEND_VM_HANDLER(170, ZEND_YIELD_FROM, CONST|TMP|VAR|CV, ANY) } } else { // TODO: Should be an engine exception - zend_throw_exception(NULL, "Can use \"yield *\" only with arrays and Traversables", 0); + zend_throw_exception(NULL, "Can use \"yield from\" only with arrays and Traversables", 0); HANDLE_EXCEPTION(); } + /* This is the default return value + * when the expression is a Generator, it will be overwritten in zend_generator_resume() */ if (RETURN_VALUE_USED(opline)) { - // TODO ZVAL_NULL(EX_VAR(opline->result.var)); } diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index db617a6bd8..f7f5cb4f24 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -1384,8 +1384,7 @@ static int ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[catch_op_num]); ZEND_VM_CONTINUE(); } else if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_GENERATOR) != 0)) { - /* The generator object is stored in EX(return_value) */ - zend_generator *generator = (zend_generator *) EX(return_value); + zend_generator *generator = zend_get_running_generator(execute_data); zend_generator_close(generator, 1); ZEND_VM_RETURN(); } else { @@ -1418,8 +1417,7 @@ static int ZEND_FASTCALL ZEND_USER_OPCODE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS ZEND_VM_CONTINUE(); case ZEND_USER_OPCODE_RETURN: if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_GENERATOR) != 0)) { - /* The generator object is stored in EX(return_value) */ - zend_generator *generator = (zend_generator *) EX(return_value); + zend_generator *generator = zend_get_running_generator(execute_data); zend_generator_close(generator, 1); ZEND_VM_RETURN(); } else { @@ -1496,8 +1494,7 @@ static int ZEND_FASTCALL ZEND_FAST_RET_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->op2.opline_num]); ZEND_VM_CONTINUE(); } else if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_GENERATOR) != 0)) { - /* The generator object is stored in EX(return_value) */ - zend_generator *generator = (zend_generator *) EX(return_value); + zend_generator *generator = zend_get_running_generator(execute_data); zend_generator_close(generator, 1); ZEND_VM_RETURN(); } else { @@ -2611,8 +2608,7 @@ static int ZEND_FASTCALL ZEND_GENERATOR_RETURN_SPEC_CONST_HANDLER(ZEND_OPCODE_H zval *retval; - /* The generator object is stored in EX(return_value) */ - zend_generator *generator = (zend_generator *) EX(return_value); + zend_generator *generator = zend_get_running_generator(execute_data); SAVE_OPLINE(); retval = EX_CONSTANT(opline->op1); @@ -3507,7 +3503,28 @@ static int ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER } else if (IS_CONST != IS_CONST && Z_TYPE_P(val) == IS_OBJECT && Z_OBJCE_P(val)->get_iterator) { zend_class_entry *ce = Z_OBJCE_P(val); if (ce == zend_ce_generator) { + zend_generator *new_gen = (zend_generator *) Z_OBJ_P(val); + + if (IS_CONST != IS_TMP_VAR) { + Z_ADDREF_P(val); + } + + if (Z_ISUNDEF(new_gen->retval)) { + zend_generator_yield_from(generator, new_gen); + } else if (new_gen->execute_data == NULL) { + // TODO: Should be an engine exception + zend_error(E_RECOVERABLE_ERROR, "Generator passed to yield from was aborted without proper return and is unable to continue"); + + CHECK_EXCEPTION(); + ZEND_VM_NEXT_OPCODE(); + } else { + if (RETURN_VALUE_USED(opline)) { + ZVAL_COPY(EX_VAR(opline->result.var), &new_gen->retval); + } + CHECK_EXCEPTION(); + ZEND_VM_NEXT_OPCODE(); + } } else { zend_object_iterator *iter = ce->get_iterator(ce, val, 0); @@ -3533,10 +3550,12 @@ static int ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER } } else { // TODO: Should be an engine exception - zend_throw_exception(NULL, "Can use \"yield *\" only with arrays and Traversables", 0); + zend_throw_exception(NULL, "Can use \"yield from\" only with arrays and Traversables", 0); HANDLE_EXCEPTION(); } + /* This is the default return value + * when the expression is a Generator, it will be overwritten in zend_generator_resume() */ if (RETURN_VALUE_USED(opline)) { ZVAL_NULL(EX_VAR(opline->result.var)); } @@ -5149,8 +5168,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLE { USE_OPLINE - /* The generator object is stored in EX(return_value) */ - zend_generator *generator = (zend_generator *) EX(return_value); + zend_generator *generator = zend_get_running_generator(execute_data); if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) { zend_error_noreturn(E_ERROR, "Cannot yield from finally in a force-closed generator"); @@ -5326,8 +5344,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ { USE_OPLINE - /* The generator object is stored in EX(return_value) */ - zend_generator *generator = (zend_generator *) EX(return_value); + zend_generator *generator = zend_get_running_generator(execute_data); if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) { zend_error_noreturn(E_ERROR, "Cannot yield from finally in a force-closed generator"); @@ -5834,8 +5851,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ { USE_OPLINE - /* The generator object is stored in EX(return_value) */ - zend_generator *generator = (zend_generator *) EX(return_value); + zend_generator *generator = zend_get_running_generator(execute_data); if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) { zend_error_noreturn(E_ERROR, "Cannot yield from finally in a force-closed generator"); @@ -6633,8 +6649,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDL { USE_OPLINE - /* The generator object is stored in EX(return_value) */ - zend_generator *generator = (zend_generator *) EX(return_value); + zend_generator *generator = zend_get_running_generator(execute_data); if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) { zend_error_noreturn(E_ERROR, "Cannot yield from finally in a force-closed generator"); @@ -7785,8 +7800,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_A { USE_OPLINE - /* The generator object is stored in EX(return_value) */ - zend_generator *generator = (zend_generator *) EX(return_value); + zend_generator *generator = zend_get_running_generator(execute_data); if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) { zend_error_noreturn(E_ERROR, "Cannot yield from finally in a force-closed generator"); @@ -8985,8 +8999,7 @@ static int ZEND_FASTCALL ZEND_GENERATOR_RETURN_SPEC_TMP_HANDLER(ZEND_OPCODE_HAN zval *retval; zend_free_op free_op1; - /* The generator object is stored in EX(return_value) */ - zend_generator *generator = (zend_generator *) EX(return_value); + zend_generator *generator = zend_get_running_generator(execute_data); SAVE_OPLINE(); retval = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1); @@ -9589,7 +9602,28 @@ static int ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_A } else if (IS_TMP_VAR != IS_CONST && Z_TYPE_P(val) == IS_OBJECT && Z_OBJCE_P(val)->get_iterator) { zend_class_entry *ce = Z_OBJCE_P(val); if (ce == zend_ce_generator) { + zend_generator *new_gen = (zend_generator *) Z_OBJ_P(val); + + if (IS_TMP_VAR != IS_TMP_VAR) { + Z_ADDREF_P(val); + } + + if (Z_ISUNDEF(new_gen->retval)) { + zend_generator_yield_from(generator, new_gen); + } else if (new_gen->execute_data == NULL) { + // TODO: Should be an engine exception + zend_error(E_RECOVERABLE_ERROR, "Generator passed to yield from was aborted without proper return and is unable to continue"); + + CHECK_EXCEPTION(); + ZEND_VM_NEXT_OPCODE(); + } else { + if (RETURN_VALUE_USED(opline)) { + ZVAL_COPY(EX_VAR(opline->result.var), &new_gen->retval); + } + CHECK_EXCEPTION(); + ZEND_VM_NEXT_OPCODE(); + } } else { zend_object_iterator *iter = ce->get_iterator(ce, val, 0); zval_ptr_dtor_nogc(free_op1); @@ -9616,10 +9650,12 @@ static int ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_A } } else { // TODO: Should be an engine exception - zend_throw_exception(NULL, "Can use \"yield *\" only with arrays and Traversables", 0); + zend_throw_exception(NULL, "Can use \"yield from\" only with arrays and Traversables", 0); HANDLE_EXCEPTION(); } + /* This is the default return value + * when the expression is a Generator, it will be overwritten in zend_generator_resume() */ if (RETURN_VALUE_USED(opline)) { ZVAL_NULL(EX_VAR(opline->result.var)); } @@ -10007,8 +10043,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ { USE_OPLINE - /* The generator object is stored in EX(return_value) */ - zend_generator *generator = (zend_generator *) EX(return_value); + zend_generator *generator = zend_get_running_generator(execute_data); if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) { zend_error_noreturn(E_ERROR, "Cannot yield from finally in a force-closed generator"); @@ -10169,8 +10204,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR { USE_OPLINE - /* The generator object is stored in EX(return_value) */ - zend_generator *generator = (zend_generator *) EX(return_value); + zend_generator *generator = zend_get_running_generator(execute_data); if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) { zend_error_noreturn(E_ERROR, "Cannot yield from finally in a force-closed generator"); @@ -10331,8 +10365,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR { USE_OPLINE - /* The generator object is stored in EX(return_value) */ - zend_generator *generator = (zend_generator *) EX(return_value); + zend_generator *generator = zend_get_running_generator(execute_data); if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) { zend_error_noreturn(E_ERROR, "Cannot yield from finally in a force-closed generator"); @@ -10635,8 +10668,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER { USE_OPLINE - /* The generator object is stored in EX(return_value) */ - zend_generator *generator = (zend_generator *) EX(return_value); + zend_generator *generator = zend_get_running_generator(execute_data); if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) { zend_error_noreturn(E_ERROR, "Cannot yield from finally in a force-closed generator"); @@ -11089,8 +11121,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG { USE_OPLINE - /* The generator object is stored in EX(return_value) */ - zend_generator *generator = (zend_generator *) EX(return_value); + zend_generator *generator = zend_get_running_generator(execute_data); if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) { zend_error_noreturn(E_ERROR, "Cannot yield from finally in a force-closed generator"); @@ -11767,8 +11798,7 @@ static int ZEND_FASTCALL ZEND_GENERATOR_RETURN_SPEC_VAR_HANDLER(ZEND_OPCODE_HAN zval *retval; zend_free_op free_op1; - /* The generator object is stored in EX(return_value) */ - zend_generator *generator = (zend_generator *) EX(return_value); + zend_generator *generator = zend_get_running_generator(execute_data); SAVE_OPLINE(); retval = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1); @@ -12926,7 +12956,29 @@ static int ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_A } else if (IS_VAR != IS_CONST && Z_TYPE_P(val) == IS_OBJECT && Z_OBJCE_P(val)->get_iterator) { zend_class_entry *ce = Z_OBJCE_P(val); if (ce == zend_ce_generator) { + zend_generator *new_gen = (zend_generator *) Z_OBJ_P(val); + + if (IS_VAR != IS_TMP_VAR) { + Z_ADDREF_P(val); + } + zval_ptr_dtor_nogc(free_op1); + if (Z_ISUNDEF(new_gen->retval)) { + zend_generator_yield_from(generator, new_gen); + } else if (new_gen->execute_data == NULL) { + // TODO: Should be an engine exception + zend_error(E_RECOVERABLE_ERROR, "Generator passed to yield from was aborted without proper return and is unable to continue"); + + CHECK_EXCEPTION(); + ZEND_VM_NEXT_OPCODE(); + } else { + if (RETURN_VALUE_USED(opline)) { + ZVAL_COPY(EX_VAR(opline->result.var), &new_gen->retval); + } + + CHECK_EXCEPTION(); + ZEND_VM_NEXT_OPCODE(); + } } else { zend_object_iterator *iter = ce->get_iterator(ce, val, 0); zval_ptr_dtor_nogc(free_op1); @@ -12953,10 +13005,12 @@ static int ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_A } } else { // TODO: Should be an engine exception - zend_throw_exception(NULL, "Can use \"yield *\" only with arrays and Traversables", 0); + zend_throw_exception(NULL, "Can use \"yield from\" only with arrays and Traversables", 0); HANDLE_EXCEPTION(); } + /* This is the default return value + * when the expression is a Generator, it will be overwritten in zend_generator_resume() */ if (RETURN_VALUE_USED(opline)) { ZVAL_NULL(EX_VAR(opline->result.var)); } @@ -14479,8 +14533,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ { USE_OPLINE - /* The generator object is stored in EX(return_value) */ - zend_generator *generator = (zend_generator *) EX(return_value); + zend_generator *generator = zend_get_running_generator(execute_data); if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) { zend_error_noreturn(E_ERROR, "Cannot yield from finally in a force-closed generator"); @@ -14679,8 +14732,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR { USE_OPLINE - /* The generator object is stored in EX(return_value) */ - zend_generator *generator = (zend_generator *) EX(return_value); + zend_generator *generator = zend_get_running_generator(execute_data); if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) { zend_error_noreturn(E_ERROR, "Cannot yield from finally in a force-closed generator"); @@ -14930,8 +14982,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR { USE_OPLINE - /* The generator object is stored in EX(return_value) */ - zend_generator *generator = (zend_generator *) EX(return_value); + zend_generator *generator = zend_get_running_generator(execute_data); if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) { zend_error_noreturn(E_ERROR, "Cannot yield from finally in a force-closed generator"); @@ -15772,8 +15823,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER { USE_OPLINE - /* The generator object is stored in EX(return_value) */ - zend_generator *generator = (zend_generator *) EX(return_value); + zend_generator *generator = zend_get_running_generator(execute_data); if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) { zend_error_noreturn(E_ERROR, "Cannot yield from finally in a force-closed generator"); @@ -17316,8 +17366,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG { USE_OPLINE - /* The generator object is stored in EX(return_value) */ - zend_generator *generator = (zend_generator *) EX(return_value); + zend_generator *generator = zend_get_running_generator(execute_data); if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) { zend_error_noreturn(E_ERROR, "Cannot yield from finally in a force-closed generator"); @@ -20205,8 +20254,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDL { USE_OPLINE - /* The generator object is stored in EX(return_value) */ - zend_generator *generator = (zend_generator *) EX(return_value); + zend_generator *generator = zend_get_running_generator(execute_data); if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) { zend_error_noreturn(E_ERROR, "Cannot yield from finally in a force-closed generator"); @@ -20336,8 +20384,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER { USE_OPLINE - /* The generator object is stored in EX(return_value) */ - zend_generator *generator = (zend_generator *) EX(return_value); + zend_generator *generator = zend_get_running_generator(execute_data); if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) { zend_error_noreturn(E_ERROR, "Cannot yield from finally in a force-closed generator"); @@ -20467,8 +20514,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER { USE_OPLINE - /* The generator object is stored in EX(return_value) */ - zend_generator *generator = (zend_generator *) EX(return_value); + zend_generator *generator = zend_get_running_generator(execute_data); if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) { zend_error_noreturn(E_ERROR, "Cannot yield from finally in a force-closed generator"); @@ -20929,8 +20975,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HAND { USE_OPLINE - /* The generator object is stored in EX(return_value) */ - zend_generator *generator = (zend_generator *) EX(return_value); + zend_generator *generator = zend_get_running_generator(execute_data); if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) { zend_error_noreturn(E_ERROR, "Cannot yield from finally in a force-closed generator"); @@ -22313,8 +22358,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ { USE_OPLINE - /* The generator object is stored in EX(return_value) */ - zend_generator *generator = (zend_generator *) EX(return_value); + zend_generator *generator = zend_get_running_generator(execute_data); if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) { zend_error_noreturn(E_ERROR, "Cannot yield from finally in a force-closed generator"); @@ -24192,8 +24236,7 @@ static int ZEND_FASTCALL ZEND_GENERATOR_RETURN_SPEC_CV_HANDLER(ZEND_OPCODE_HAND zval *retval; - /* The generator object is stored in EX(return_value) */ - zend_generator *generator = (zend_generator *) EX(return_value); + zend_generator *generator = zend_get_running_generator(execute_data); SAVE_OPLINE(); retval = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var); @@ -25176,7 +25219,28 @@ static int ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_AR } else if (IS_CV != IS_CONST && Z_TYPE_P(val) == IS_OBJECT && Z_OBJCE_P(val)->get_iterator) { zend_class_entry *ce = Z_OBJCE_P(val); if (ce == zend_ce_generator) { + zend_generator *new_gen = (zend_generator *) Z_OBJ_P(val); + + if (IS_CV != IS_TMP_VAR) { + Z_ADDREF_P(val); + } + + if (Z_ISUNDEF(new_gen->retval)) { + zend_generator_yield_from(generator, new_gen); + } else if (new_gen->execute_data == NULL) { + // TODO: Should be an engine exception + zend_error(E_RECOVERABLE_ERROR, "Generator passed to yield from was aborted without proper return and is unable to continue"); + + CHECK_EXCEPTION(); + ZEND_VM_NEXT_OPCODE(); + } else { + if (RETURN_VALUE_USED(opline)) { + ZVAL_COPY(EX_VAR(opline->result.var), &new_gen->retval); + } + CHECK_EXCEPTION(); + ZEND_VM_NEXT_OPCODE(); + } } else { zend_object_iterator *iter = ce->get_iterator(ce, val, 0); @@ -25202,10 +25266,12 @@ static int ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_AR } } else { // TODO: Should be an engine exception - zend_throw_exception(NULL, "Can use \"yield *\" only with arrays and Traversables", 0); + zend_throw_exception(NULL, "Can use \"yield from\" only with arrays and Traversables", 0); HANDLE_EXCEPTION(); } + /* This is the default return value + * when the expression is a Generator, it will be overwritten in zend_generator_resume() */ if (RETURN_VALUE_USED(opline)) { ZVAL_NULL(EX_VAR(opline->result.var)); } @@ -27601,8 +27667,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_A { USE_OPLINE - /* The generator object is stored in EX(return_value) */ - zend_generator *generator = (zend_generator *) EX(return_value); + zend_generator *generator = zend_get_running_generator(execute_data); if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) { zend_error_noreturn(E_ERROR, "Cannot yield from finally in a force-closed generator"); @@ -27871,8 +27936,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG { USE_OPLINE - /* The generator object is stored in EX(return_value) */ - zend_generator *generator = (zend_generator *) EX(return_value); + zend_generator *generator = zend_get_running_generator(execute_data); if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) { zend_error_noreturn(E_ERROR, "Cannot yield from finally in a force-closed generator"); @@ -28509,8 +28573,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG { USE_OPLINE - /* The generator object is stored in EX(return_value) */ - zend_generator *generator = (zend_generator *) EX(return_value); + zend_generator *generator = zend_get_running_generator(execute_data); if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) { zend_error_noreturn(E_ERROR, "Cannot yield from finally in a force-closed generator"); @@ -29554,8 +29617,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ { USE_OPLINE - /* The generator object is stored in EX(return_value) */ - zend_generator *generator = (zend_generator *) EX(return_value); + zend_generator *generator = zend_get_running_generator(execute_data); if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) { zend_error_noreturn(E_ERROR, "Cannot yield from finally in a force-closed generator"); @@ -31597,8 +31659,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS { USE_OPLINE - /* The generator object is stored in EX(return_value) */ - zend_generator *generator = (zend_generator *) EX(return_value); + zend_generator *generator = zend_get_running_generator(execute_data); if (generator->flags & ZEND_GENERATOR_FORCED_CLOSE) { zend_error_noreturn(E_ERROR, "Cannot yield from finally in a force-closed generator"); |