summaryrefslogtreecommitdiff
path: root/Zend/zend_language_parser.y
diff options
context:
space:
mode:
authorIgor Wiedler <igor@wiedler.ch>2013-11-08 19:14:58 -0500
committerIgor Wiedler <igor@wiedler.ch>2013-11-08 19:14:58 -0500
commit24e0b9910302f7828d1373a1f653f0358e05ff59 (patch)
tree000b2af213559fbc8140ca00753e2eb324c44472 /Zend/zend_language_parser.y
parent602fef0e52caacf754eacfb96e9342ce32d29a37 (diff)
parent0e5c5072e698438ee9857979cf8418805865518a (diff)
downloadphp-git-24e0b9910302f7828d1373a1f653f0358e05ff59.tar.gz
Merge remote-tracking branch 'upstream/PHP-5.6' into use-function
* upstream/PHP-5.6: (399 commits) Fixed issue #115 (path issue when using phar). Fixed issue #149 (Phar mount points not working with OPcache enabled). Added tests for PHAR/OPCahce incompatibilities Update NEWS Fixed bug #65947 (basename is no more working after fgetcsv in certain situation) Update NEWS Fixed Bug #66043 (Segfault calling bind_param() on mysqli) NEWS entry NEWS entry Fix bug #65946 - pdo_sql_parser.c permanently converts values bound to strings bump API versions Add a couple more test cases to parse_url() tests fix missing change from 'tcp_socket' to the more common 'server' fix many parallel test issues Cleanup temp test file Revert "Fixed issue #115 (path issue when using phar)." Update LiteSpeed SAPI code to V6.4 Fixed typo in Makefile.frag updated NEWS Remove outdate codes, make it clearer, although just a bit.. Update NEWS ... Conflicts: Zend/zend_compile.h
Diffstat (limited to 'Zend/zend_language_parser.y')
-rw-r--r--Zend/zend_language_parser.y34
1 files changed, 20 insertions, 14 deletions
diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y
index 7cfab914de..7f46663c39 100644
--- a/Zend/zend_language_parser.y
+++ b/Zend/zend_language_parser.y
@@ -212,6 +212,7 @@ static YYSIZE_T zend_yytnamerr(char*, const char*);
%token T_NS_C "__NAMESPACE__ (T_NS_C)"
%token T_DIR "__DIR__ (T_DIR)"
%token T_NS_SEPARATOR "\\ (T_NS_SEPARATOR)"
+%token T_ELLIPSIS "... (T_ELLIPSIS)"
%% /* Rules */
@@ -296,7 +297,7 @@ inner_statement:
statement
| function_declaration_statement
| class_declaration_statement
- | T_HALT_COMPILER '(' ')' ';' { zend_error(E_COMPILE_ERROR, "__HALT_COMPILER() can only be used from the outermost scope"); }
+ | T_HALT_COMPILER '(' ')' ';' { zend_error_noreturn(E_COMPILE_ERROR, "__HALT_COMPILER() can only be used from the outermost scope"); }
;
@@ -397,10 +398,14 @@ class_declaration_statement:
;
is_reference:
- /* empty */ { $$.op_type = ZEND_RETURN_VAL; }
- | '&' { $$.op_type = ZEND_RETURN_REF; }
+ /* empty */ { $$.op_type = 0; }
+ | '&' { $$.op_type = 1; }
;
+is_variadic:
+ /* empty */ { $$.op_type = 0; }
+ | T_ELLIPSIS { $$.op_type = 1; }
+;
unticked_function_declaration_statement:
function is_reference T_STRING { zend_do_begin_function_declaration(&$1, &$3, 0, $2.op_type, NULL TSRMLS_CC); }
@@ -549,14 +554,15 @@ parameter_list:
non_empty_parameter_list:
- optional_class_type T_VARIABLE { $$.op_type = IS_UNUSED; $$.u.op.num=1; zend_do_receive_arg(ZEND_RECV, &$2, &$$, NULL, &$1, 0 TSRMLS_CC); }
- | optional_class_type '&' T_VARIABLE { $$.op_type = IS_UNUSED; $$.u.op.num=1; zend_do_receive_arg(ZEND_RECV, &$3, &$$, NULL, &$1, 1 TSRMLS_CC); }
- | optional_class_type '&' T_VARIABLE '=' static_scalar { $$.op_type = IS_UNUSED; $$.u.op.num=1; zend_do_receive_arg(ZEND_RECV_INIT, &$3, &$$, &$5, &$1, 1 TSRMLS_CC); }
- | optional_class_type T_VARIABLE '=' static_scalar { $$.op_type = IS_UNUSED; $$.u.op.num=1; zend_do_receive_arg(ZEND_RECV_INIT, &$2, &$$, &$4, &$1, 0 TSRMLS_CC); }
- | non_empty_parameter_list ',' optional_class_type T_VARIABLE { $$=$1; $$.u.op.num++; zend_do_receive_arg(ZEND_RECV, &$4, &$$, NULL, &$3, 0 TSRMLS_CC); }
- | non_empty_parameter_list ',' optional_class_type '&' T_VARIABLE { $$=$1; $$.u.op.num++; zend_do_receive_arg(ZEND_RECV, &$5, &$$, NULL, &$3, 1 TSRMLS_CC); }
- | non_empty_parameter_list ',' optional_class_type '&' T_VARIABLE '=' static_scalar { $$=$1; $$.u.op.num++; zend_do_receive_arg(ZEND_RECV_INIT, &$5, &$$, &$7, &$3, 1 TSRMLS_CC); }
- | non_empty_parameter_list ',' optional_class_type T_VARIABLE '=' static_scalar { $$=$1; $$.u.op.num++; zend_do_receive_arg(ZEND_RECV_INIT, &$4, &$$, &$6, &$3, 0 TSRMLS_CC); }
+ parameter
+ | non_empty_parameter_list ',' parameter
+;
+
+parameter:
+ optional_class_type is_reference is_variadic T_VARIABLE
+ { zend_do_receive_param(ZEND_RECV, &$4, NULL, &$1, $2.op_type, $3.op_type TSRMLS_CC); }
+ | optional_class_type is_reference is_variadic T_VARIABLE '=' static_scalar
+ { zend_do_receive_param(ZEND_RECV_INIT, &$4, &$6, &$1, $2.op_type, $3.op_type TSRMLS_CC); }
;
@@ -655,8 +661,8 @@ trait_precedence:
;
trait_reference_list:
- fully_qualified_class_name { zend_resolve_class_name(&$1, ZEND_FETCH_CLASS_GLOBAL, 1 TSRMLS_CC); zend_init_list(&$$.u.op.ptr, Z_STRVAL($1.u.constant) TSRMLS_CC); }
- | trait_reference_list ',' fully_qualified_class_name { zend_resolve_class_name(&$3, ZEND_FETCH_CLASS_GLOBAL, 1 TSRMLS_CC); zend_add_to_list(&$1.u.op.ptr, Z_STRVAL($3.u.constant) TSRMLS_CC); $$ = $1; }
+ fully_qualified_class_name { zend_resolve_class_name(&$1 TSRMLS_CC); zend_init_list(&$$.u.op.ptr, Z_STRVAL($1.u.constant) TSRMLS_CC); }
+ | trait_reference_list ',' fully_qualified_class_name { zend_resolve_class_name(&$3 TSRMLS_CC); zend_add_to_list(&$1.u.op.ptr, Z_STRVAL($3.u.constant) TSRMLS_CC); $$ = $1; }
;
trait_method_reference:
@@ -1222,7 +1228,7 @@ isset_variables:
isset_variable:
variable { zend_do_isset_or_isempty(ZEND_ISSET, &$$, &$1 TSRMLS_CC); }
- | expr_without_variable { zend_error(E_COMPILE_ERROR, "Cannot use isset() on the result of an expression (you can use \"null !== expression\" instead)"); }
+ | expr_without_variable { zend_error_noreturn(E_COMPILE_ERROR, "Cannot use isset() on the result of an expression (you can use \"null !== expression\" instead)"); }
;
class_constant: