php-parser
Advanced tools
Comparing version 2.0.5 to 2.0.6
{ | ||
"name": "php-parser", | ||
"version": "2.0.5", | ||
"version": "2.0.6", | ||
"description": "Parse PHP code and returns its AST", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
# Releases | ||
## 2.0.5 : (2017-07-16) | ||
## 2.0.6 : (2017-07-16) | ||
- Fix precedence between bin, retif, unary | ||
- Fix precedence with assign | ||
@@ -7,0 +8,0 @@ ## 2.0.4 : (2017-07-09) |
@@ -134,3 +134,3 @@ /*! | ||
['and'], | ||
// TODO: assignment / not sure that PHP allows this with expressions | ||
['='], | ||
['?'], | ||
@@ -214,2 +214,15 @@ ['??'], | ||
} | ||
} else if (result.kind === 'assign') { | ||
// https://github.com/glayzzle/php-parser/issues/81 | ||
if (result.right && result.right.kind === 'bin') { | ||
var lLevel = AST.precedence['=']; | ||
var rLevel = AST.precedence[result.right.type]; | ||
// only shifts with and, xor, or | ||
if (lLevel && rLevel && rLevel < lLevel) { | ||
buffer = result.right; | ||
result.right = result.right.left; | ||
buffer.left = result; | ||
result = buffer; | ||
} | ||
} | ||
} | ||
@@ -216,0 +229,0 @@ return result; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2258595
16748