php-parser
php-parser copied to clipboard
pretty printer: group operations by precedence
[*binary.Mul]
"Left":
[*binary.Plus]
"Left":
[*expr.Variable]
"VarName":
[*node.Identifier]
"Value": a;
"Right":
[*expr.Variable]
"VarName":
[*node.Identifier]
"Value": b;
"Right":
[*expr.Variable]
"VarName":
[*node.Identifier]
"Value": c;
Currently, above AST is printed incorrectly: $a + $b * $c
.
It must group Plus
expression and print ($a + $b) * $c