com php-src: Change the precedence of concatenation: Zend/zend_ast.c Zend/zend_language_parser.y
| From: | Bob Weinand | Date: | Thu, 28 Mar 2019 12:42:09 +0000 |
| Subject: | com php-src: Change the precedence of concatenation: Zend/zend_ast.c Zend/zend_language_parser.y | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-106217@lists.php.net to get a copy of this message | ||
Commit: 61ee86992120c6c160fa7637316e59397497be0d
Author: Bob Weinand <bobwei9@hotmail.com> Thu, 28 Mar 2019 13:42:09 +0100
Parents: a3b2425f3826c5cb2d72728d864fdea57dcdca79
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=61ee86992120c6c160fa7637316e59397497be0d
Log:
Change the precedence of concatenation
This implements RFC https://wiki.php.net/rfc/concatenation_precedence
Changed paths:
M Zend/zend_ast.c
M Zend/zend_language_parser.y
Diff:
diff --git a/Zend/zend_ast.c b/Zend/zend_ast.c
index 2cacd53..beeb376 100644
--- a/Zend/zend_ast.c
+++ b/Zend/zend_ast.c
@@ -871,8 +871,9 @@ ZEND_API void zend_ast_apply(zend_ast *ast, zend_ast_apply_func fn) {
* 160 left &
* 170 non-associative == != === !==
* 180 non-associative < <= > >= <=>
+ * 185 left .
* 190 left << >>
- * 200 left + - .
+ * 200 left + -
* 210 left * / %
* 220 right !
* 230 non-associative instanceof
@@ -1682,7 +1683,7 @@ simple_list:
case ZEND_MOD: BINARY_OP(" % ", 210, 210, 211);
case ZEND_SL: BINARY_OP(" << ", 190, 190, 191);
case ZEND_SR: BINARY_OP(" >> ", 190, 190, 191);
- case ZEND_CONCAT: BINARY_OP(" . ", 200, 200, 201);
+ case ZEND_CONCAT: BINARY_OP(" . ", 185, 185, 186);
case ZEND_BW_OR: BINARY_OP(" | ", 140, 140, 141);
case ZEND_BW_AND: BINARY_OP(" & ", 160, 160, 161);
case ZEND_BW_XOR: BINARY_OP(" ^ ", 150, 150, 151);
diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y
index af5ce87..e00ba0e 100644
--- a/Zend/zend_language_parser.y
+++ b/Zend/zend_language_parser.y
@@ -69,8 +69,9 @@ static YYSIZE_T zend_yytnamerr(char*, const char*);
%left '&'
%nonassoc T_IS_EQUAL T_IS_NOT_EQUAL T_IS_IDENTICAL T_IS_NOT_IDENTICAL T_SPACESHIP
%nonassoc '<' T_IS_SMALLER_OR_EQUAL '>' T_IS_GREATER_OR_EQUAL
+%left '.'
%left T_SL T_SR
-%left '+' '-' '.'
+%left '+' '-'
%left '*' '/' '%'
%precedence '!'
%precedence T_INSTANCEOF