[refactoring] update ast structure of "Assign" and "Binary" nodes

This commit is contained in:
Vadym Slizov 2020-12-04 10:40:48 +02:00
parent 5a6418e853
commit d19b3f609e
No known key found for this signature in database
GPG Key ID: AEA2A9388EF42A4A
5 changed files with 2653 additions and 2640 deletions

1651
internal/php5/php5.go generated

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

738
internal/php7/php7.go generated
View File

@ -5239,7 +5239,11 @@ yydefault:
yyDollar = yyS[yypt-6 : yypt+1] yyDollar = yyS[yypt-6 : yypt+1]
// line internal/php7/php7.y:2806 // line internal/php7/php7.y:2806
{ {
listNode := &ast.ExprList{ yyVAL.node = &ast.ExprAssign{
Node: ast.Node{
Position: position.NewTokenNodePosition(yyDollar[1].token, yyDollar[6].node),
},
Var: &ast.ExprList{
Node: ast.Node{ Node: ast.Node{
Position: position.NewTokensPosition(yyDollar[1].token, yyDollar[4].token), Position: position.NewTokensPosition(yyDollar[1].token, yyDollar[4].token),
}, },
@ -5248,20 +5252,20 @@ yydefault:
Items: yyDollar[3].node.(*ast.ParserSeparatedList).Items, Items: yyDollar[3].node.(*ast.ParserSeparatedList).Items,
SeparatorTkns: yyDollar[3].node.(*ast.ParserSeparatedList).SeparatorTkns, SeparatorTkns: yyDollar[3].node.(*ast.ParserSeparatedList).SeparatorTkns,
CloseBracketTkn: yyDollar[4].token, CloseBracketTkn: yyDollar[4].token,
},
EqualTkn: yyDollar[5].token,
Expr: yyDollar[6].node,
} }
yyVAL.node = &ast.ExprAssign{ast.Node{}, listNode, yyDollar[6].node}
// save position
yyVAL.node.GetNode().Position = position.NewTokenNodePosition(yyDollar[1].token, yyDollar[6].node)
// save comments
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Var, yyDollar[5].token.SkippedTokens)
} }
case 297: case 297:
yyDollar = yyS[yypt-5 : yypt+1] yyDollar = yyS[yypt-5 : yypt+1]
// line internal/php7/php7.y:2826 // line internal/php7/php7.y:2826
{ {
listNode := &ast.ExprList{ yyVAL.node = &ast.ExprAssign{
Node: ast.Node{
Position: position.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node),
},
Var: &ast.ExprList{
Node: ast.Node{ Node: ast.Node{
Position: position.NewTokensPosition(yyDollar[1].token, yyDollar[3].token), Position: position.NewTokensPosition(yyDollar[1].token, yyDollar[3].token),
}, },
@ -5269,41 +5273,37 @@ yydefault:
Items: yyDollar[2].node.(*ast.ParserSeparatedList).Items, Items: yyDollar[2].node.(*ast.ParserSeparatedList).Items,
SeparatorTkns: yyDollar[2].node.(*ast.ParserSeparatedList).SeparatorTkns, SeparatorTkns: yyDollar[2].node.(*ast.ParserSeparatedList).SeparatorTkns,
CloseBracketTkn: yyDollar[3].token, CloseBracketTkn: yyDollar[3].token,
},
EqualTkn: yyDollar[4].token,
Expr: yyDollar[5].node,
} }
yyVAL.node = &ast.ExprAssign{ast.Node{}, listNode, yyDollar[5].node}
// save position
yyVAL.node.GetNode().Position = position.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node)
// save comments
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Var, yyDollar[4].token.SkippedTokens)
} }
case 298: case 298:
yyDollar = yyS[yypt-3 : yypt+1] yyDollar = yyS[yypt-3 : yypt+1]
// line internal/php7/php7.y:2845 // line internal/php7/php7.y:2845
{ {
yyVAL.node = &ast.ExprAssign{ast.Node{}, yyDollar[1].node, yyDollar[3].node} yyVAL.node = &ast.ExprAssign{
Node: ast.Node{
// save position Position: position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node),
yyVAL.node.GetNode().Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node) },
Var: yyDollar[1].node,
// save comments EqualTkn: yyDollar[2].token,
yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) Expr: yyDollar[3].node,
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Var, yyDollar[2].token.SkippedTokens) }
} }
case 299: case 299:
yyDollar = yyS[yypt-4 : yypt+1] yyDollar = yyS[yypt-4 : yypt+1]
// line internal/php7/php7.y:2856 // line internal/php7/php7.y:2856
{ {
yyVAL.node = &ast.ExprAssignReference{ast.Node{}, yyDollar[1].node, yyDollar[4].node} yyVAL.node = &ast.ExprAssignReference{
Node: ast.Node{
// save position Position: position.NewNodesPosition(yyDollar[1].node, yyDollar[4].node),
yyVAL.node.GetNode().Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[4].node) },
Var: yyDollar[1].node,
// save comments EqualTkn: yyDollar[2].token,
yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) AmpersandTkn: yyDollar[3].token,
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Var, yyDollar[2].token.SkippedTokens) Expr: yyDollar[4].node,
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Equal, yyDollar[3].token.SkippedTokens) }
} }
case 300: case 300:
yyDollar = yyS[yypt-2 : yypt+1] yyDollar = yyS[yypt-2 : yypt+1]
@ -5321,170 +5321,170 @@ yydefault:
yyDollar = yyS[yypt-3 : yypt+1] yyDollar = yyS[yypt-3 : yypt+1]
// line internal/php7/php7.y:2878 // line internal/php7/php7.y:2878
{ {
yyVAL.node = &ast.ExprAssignPlus{ast.Node{}, yyDollar[1].node, yyDollar[3].node} yyVAL.node = &ast.ExprAssignPlus{
Node: ast.Node{
// save position Position: position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node),
yyVAL.node.GetNode().Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node) },
Var: yyDollar[1].node,
// save comments EqualTkn: yyDollar[2].token,
yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) Expr: yyDollar[3].node,
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Var, yyDollar[2].token.SkippedTokens) }
} }
case 302: case 302:
yyDollar = yyS[yypt-3 : yypt+1] yyDollar = yyS[yypt-3 : yypt+1]
// line internal/php7/php7.y:2889 // line internal/php7/php7.y:2889
{ {
yyVAL.node = &ast.ExprAssignMinus{ast.Node{}, yyDollar[1].node, yyDollar[3].node} yyVAL.node = &ast.ExprAssignMinus{
Node: ast.Node{
// save position Position: position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node),
yyVAL.node.GetNode().Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node) },
Var: yyDollar[1].node,
// save comments EqualTkn: yyDollar[2].token,
yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) Expr: yyDollar[3].node,
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Var, yyDollar[2].token.SkippedTokens) }
} }
case 303: case 303:
yyDollar = yyS[yypt-3 : yypt+1] yyDollar = yyS[yypt-3 : yypt+1]
// line internal/php7/php7.y:2900 // line internal/php7/php7.y:2900
{ {
yyVAL.node = &ast.ExprAssignMul{ast.Node{}, yyDollar[1].node, yyDollar[3].node} yyVAL.node = &ast.ExprAssignMul{
Node: ast.Node{
// save position Position: position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node),
yyVAL.node.GetNode().Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node) },
Var: yyDollar[1].node,
// save comments EqualTkn: yyDollar[2].token,
yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) Expr: yyDollar[3].node,
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Var, yyDollar[2].token.SkippedTokens) }
} }
case 304: case 304:
yyDollar = yyS[yypt-3 : yypt+1] yyDollar = yyS[yypt-3 : yypt+1]
// line internal/php7/php7.y:2911 // line internal/php7/php7.y:2911
{ {
yyVAL.node = &ast.ExprAssignPow{ast.Node{}, yyDollar[1].node, yyDollar[3].node} yyVAL.node = &ast.ExprAssignPow{
Node: ast.Node{
// save position Position: position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node),
yyVAL.node.GetNode().Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node) },
Var: yyDollar[1].node,
// save comments EqualTkn: yyDollar[2].token,
yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) Expr: yyDollar[3].node,
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Var, yyDollar[2].token.SkippedTokens) }
} }
case 305: case 305:
yyDollar = yyS[yypt-3 : yypt+1] yyDollar = yyS[yypt-3 : yypt+1]
// line internal/php7/php7.y:2922 // line internal/php7/php7.y:2922
{ {
yyVAL.node = &ast.ExprAssignDiv{ast.Node{}, yyDollar[1].node, yyDollar[3].node} yyVAL.node = &ast.ExprAssignDiv{
Node: ast.Node{
// save position Position: position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node),
yyVAL.node.GetNode().Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node) },
Var: yyDollar[1].node,
// save comments EqualTkn: yyDollar[2].token,
yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) Expr: yyDollar[3].node,
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Var, yyDollar[2].token.SkippedTokens) }
} }
case 306: case 306:
yyDollar = yyS[yypt-3 : yypt+1] yyDollar = yyS[yypt-3 : yypt+1]
// line internal/php7/php7.y:2933 // line internal/php7/php7.y:2933
{ {
yyVAL.node = &ast.ExprAssignConcat{ast.Node{}, yyDollar[1].node, yyDollar[3].node} yyVAL.node = &ast.ExprAssignConcat{
Node: ast.Node{
// save position Position: position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node),
yyVAL.node.GetNode().Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node) },
Var: yyDollar[1].node,
// save comments EqualTkn: yyDollar[2].token,
yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) Expr: yyDollar[3].node,
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Var, yyDollar[2].token.SkippedTokens) }
} }
case 307: case 307:
yyDollar = yyS[yypt-3 : yypt+1] yyDollar = yyS[yypt-3 : yypt+1]
// line internal/php7/php7.y:2944 // line internal/php7/php7.y:2944
{ {
yyVAL.node = &ast.ExprAssignMod{ast.Node{}, yyDollar[1].node, yyDollar[3].node} yyVAL.node = &ast.ExprAssignMod{
Node: ast.Node{
// save position Position: position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node),
yyVAL.node.GetNode().Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node) },
Var: yyDollar[1].node,
// save comments EqualTkn: yyDollar[2].token,
yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) Expr: yyDollar[3].node,
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Var, yyDollar[2].token.SkippedTokens) }
} }
case 308: case 308:
yyDollar = yyS[yypt-3 : yypt+1] yyDollar = yyS[yypt-3 : yypt+1]
// line internal/php7/php7.y:2955 // line internal/php7/php7.y:2955
{ {
yyVAL.node = &ast.ExprAssignBitwiseAnd{ast.Node{}, yyDollar[1].node, yyDollar[3].node} yyVAL.node = &ast.ExprAssignBitwiseAnd{
Node: ast.Node{
// save position Position: position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node),
yyVAL.node.GetNode().Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node) },
Var: yyDollar[1].node,
// save comments EqualTkn: yyDollar[2].token,
yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) Expr: yyDollar[3].node,
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Var, yyDollar[2].token.SkippedTokens) }
} }
case 309: case 309:
yyDollar = yyS[yypt-3 : yypt+1] yyDollar = yyS[yypt-3 : yypt+1]
// line internal/php7/php7.y:2966 // line internal/php7/php7.y:2966
{ {
yyVAL.node = &ast.ExprAssignBitwiseOr{ast.Node{}, yyDollar[1].node, yyDollar[3].node} yyVAL.node = &ast.ExprAssignBitwiseOr{
Node: ast.Node{
// save position Position: position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node),
yyVAL.node.GetNode().Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node) },
Var: yyDollar[1].node,
// save comments EqualTkn: yyDollar[2].token,
yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) Expr: yyDollar[3].node,
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Var, yyDollar[2].token.SkippedTokens) }
} }
case 310: case 310:
yyDollar = yyS[yypt-3 : yypt+1] yyDollar = yyS[yypt-3 : yypt+1]
// line internal/php7/php7.y:2977 // line internal/php7/php7.y:2977
{ {
yyVAL.node = &ast.ExprAssignBitwiseXor{ast.Node{}, yyDollar[1].node, yyDollar[3].node} yyVAL.node = &ast.ExprAssignBitwiseXor{
Node: ast.Node{
// save position Position: position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node),
yyVAL.node.GetNode().Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node) },
Var: yyDollar[1].node,
// save comments EqualTkn: yyDollar[2].token,
yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) Expr: yyDollar[3].node,
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Var, yyDollar[2].token.SkippedTokens) }
} }
case 311: case 311:
yyDollar = yyS[yypt-3 : yypt+1] yyDollar = yyS[yypt-3 : yypt+1]
// line internal/php7/php7.y:2988 // line internal/php7/php7.y:2988
{ {
yyVAL.node = &ast.ExprAssignShiftLeft{ast.Node{}, yyDollar[1].node, yyDollar[3].node} yyVAL.node = &ast.ExprAssignShiftLeft{
Node: ast.Node{
// save position Position: position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node),
yyVAL.node.GetNode().Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node) },
Var: yyDollar[1].node,
// save comments EqualTkn: yyDollar[2].token,
yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) Expr: yyDollar[3].node,
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Var, yyDollar[2].token.SkippedTokens) }
} }
case 312: case 312:
yyDollar = yyS[yypt-3 : yypt+1] yyDollar = yyS[yypt-3 : yypt+1]
// line internal/php7/php7.y:2999 // line internal/php7/php7.y:2999
{ {
yyVAL.node = &ast.ExprAssignShiftRight{ast.Node{}, yyDollar[1].node, yyDollar[3].node} yyVAL.node = &ast.ExprAssignShiftRight{
Node: ast.Node{
// save position Position: position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node),
yyVAL.node.GetNode().Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node) },
Var: yyDollar[1].node,
// save comments EqualTkn: yyDollar[2].token,
yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) Expr: yyDollar[3].node,
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Var, yyDollar[2].token.SkippedTokens) }
} }
case 313: case 313:
yyDollar = yyS[yypt-3 : yypt+1] yyDollar = yyS[yypt-3 : yypt+1]
// line internal/php7/php7.y:3010 // line internal/php7/php7.y:3010
{ {
yyVAL.node = &ast.ExprAssignCoalesce{ast.Node{}, yyDollar[1].node, yyDollar[3].node} yyVAL.node = &ast.ExprAssignCoalesce{
Node: ast.Node{
// save position Position: position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node),
yyVAL.node.GetNode().Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node) },
Var: yyDollar[1].node,
// save comments EqualTkn: yyDollar[2].token,
yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) Expr: yyDollar[3].node,
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Var, yyDollar[2].token.SkippedTokens) }
} }
case 314: case 314:
yyDollar = yyS[yypt-2 : yypt+1] yyDollar = yyS[yypt-2 : yypt+1]
@ -5538,225 +5538,226 @@ yydefault:
yyDollar = yyS[yypt-3 : yypt+1] yyDollar = yyS[yypt-3 : yypt+1]
// line internal/php7/php7.y:3061 // line internal/php7/php7.y:3061
{ {
yyVAL.node = &ast.ExprBinaryBooleanOr{ast.Node{}, yyDollar[1].node, yyDollar[3].node} yyVAL.node = &ast.ExprBinaryBooleanOr{
Node: ast.Node{
// save position Position: position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node),
yyVAL.node.GetNode().Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node) },
Left: yyDollar[1].node,
// save comments OpTkn: yyDollar[2].token,
yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) Right: yyDollar[3].node,
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Expr, yyDollar[2].token.SkippedTokens) }
} }
case 319: case 319:
yyDollar = yyS[yypt-3 : yypt+1] yyDollar = yyS[yypt-3 : yypt+1]
// line internal/php7/php7.y:3072 // line internal/php7/php7.y:3072
{ {
yyVAL.node = &ast.ExprBinaryBooleanAnd{ast.Node{}, yyDollar[1].node, yyDollar[3].node} yyVAL.node = &ast.ExprBinaryBooleanAnd{
Node: ast.Node{
// save position Position: position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node),
yyVAL.node.GetNode().Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node) },
Left: yyDollar[1].node,
// save comments OpTkn: yyDollar[2].token,
yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) Right: yyDollar[3].node,
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Expr, yyDollar[2].token.SkippedTokens) }
} }
case 320: case 320:
yyDollar = yyS[yypt-3 : yypt+1] yyDollar = yyS[yypt-3 : yypt+1]
// line internal/php7/php7.y:3083 // line internal/php7/php7.y:3083
{ {
yyVAL.node = &ast.ExprBinaryLogicalOr{ast.Node{}, yyDollar[1].node, yyDollar[3].node} yyVAL.node = &ast.ExprBinaryLogicalOr{
Node: ast.Node{
// save position Position: position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node),
yyVAL.node.GetNode().Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node) },
Left: yyDollar[1].node,
// save comments OpTkn: yyDollar[2].token,
yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) Right: yyDollar[3].node,
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Expr, yyDollar[2].token.SkippedTokens) }
} }
case 321: case 321:
yyDollar = yyS[yypt-3 : yypt+1] yyDollar = yyS[yypt-3 : yypt+1]
// line internal/php7/php7.y:3094 // line internal/php7/php7.y:3094
{ {
yyVAL.node = &ast.ExprBinaryLogicalAnd{ast.Node{}, yyDollar[1].node, yyDollar[3].node} yyVAL.node = &ast.ExprBinaryLogicalAnd{
Node: ast.Node{
// save position Position: position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node),
yyVAL.node.GetNode().Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node) },
Left: yyDollar[1].node,
// save comments OpTkn: yyDollar[2].token,
yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) Right: yyDollar[3].node,
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Expr, yyDollar[2].token.SkippedTokens) }
} }
case 322: case 322:
yyDollar = yyS[yypt-3 : yypt+1] yyDollar = yyS[yypt-3 : yypt+1]
// line internal/php7/php7.y:3105 // line internal/php7/php7.y:3105
{ {
yyVAL.node = &ast.ExprBinaryLogicalXor{ast.Node{}, yyDollar[1].node, yyDollar[3].node} yyVAL.node = &ast.ExprBinaryLogicalXor{
Node: ast.Node{
// save position Position: position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node),
yyVAL.node.GetNode().Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node) },
Left: yyDollar[1].node,
// save comments OpTkn: yyDollar[2].token,
yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) Right: yyDollar[3].node,
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Expr, yyDollar[2].token.SkippedTokens) }
} }
case 323: case 323:
yyDollar = yyS[yypt-3 : yypt+1] yyDollar = yyS[yypt-3 : yypt+1]
// line internal/php7/php7.y:3116 // line internal/php7/php7.y:3116
{ {
yyVAL.node = &ast.ExprBinaryBitwiseOr{ast.Node{}, yyDollar[1].node, yyDollar[3].node} yyVAL.node = &ast.ExprBinaryBitwiseOr{
Node: ast.Node{
// save position Position: position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node),
yyVAL.node.GetNode().Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node) },
Left: yyDollar[1].node,
// save comments OpTkn: yyDollar[2].token,
yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) Right: yyDollar[3].node,
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Expr, yyDollar[2].token.SkippedTokens) }
} }
case 324: case 324:
yyDollar = yyS[yypt-3 : yypt+1] yyDollar = yyS[yypt-3 : yypt+1]
// line internal/php7/php7.y:3127 // line internal/php7/php7.y:3127
{ {
yyVAL.node = &ast.ExprBinaryBitwiseAnd{ast.Node{}, yyDollar[1].node, yyDollar[3].node} yyVAL.node = &ast.ExprBinaryBitwiseAnd{
Node: ast.Node{
// save position Position: position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node),
yyVAL.node.GetNode().Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node) },
Left: yyDollar[1].node,
// save comments OpTkn: yyDollar[2].token,
yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) Right: yyDollar[3].node,
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Expr, yyDollar[2].token.SkippedTokens) }
} }
case 325: case 325:
yyDollar = yyS[yypt-3 : yypt+1] yyDollar = yyS[yypt-3 : yypt+1]
// line internal/php7/php7.y:3138 // line internal/php7/php7.y:3138
{ {
yyVAL.node = &ast.ExprBinaryBitwiseXor{ast.Node{}, yyDollar[1].node, yyDollar[3].node} yyVAL.node = &ast.ExprBinaryBitwiseXor{
Node: ast.Node{
// save position Position: position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node),
yyVAL.node.GetNode().Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node) },
Left: yyDollar[1].node,
// save comments OpTkn: yyDollar[2].token,
yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) Right: yyDollar[3].node,
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Expr, yyDollar[2].token.SkippedTokens) }
} }
case 326: case 326:
yyDollar = yyS[yypt-3 : yypt+1] yyDollar = yyS[yypt-3 : yypt+1]
// line internal/php7/php7.y:3149 // line internal/php7/php7.y:3149
{ {
yyVAL.node = &ast.ExprBinaryConcat{ast.Node{}, yyDollar[1].node, yyDollar[3].node} yyVAL.node = &ast.ExprBinaryConcat{
Node: ast.Node{
// save position Position: position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node),
yyVAL.node.GetNode().Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node) },
Left: yyDollar[1].node,
// save comments OpTkn: yyDollar[2].token,
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Expr, yyDollar[2].token.SkippedTokens) Right: yyDollar[3].node,
}
} }
case 327: case 327:
yyDollar = yyS[yypt-3 : yypt+1] yyDollar = yyS[yypt-3 : yypt+1]
// line internal/php7/php7.y:3159 // line internal/php7/php7.y:3160
{ {
yyVAL.node = &ast.ExprBinaryPlus{ast.Node{}, yyDollar[1].node, yyDollar[3].node} yyVAL.node = &ast.ExprBinaryPlus{
Node: ast.Node{
// save position Position: position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node),
yyVAL.node.GetNode().Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node) },
Left: yyDollar[1].node,
// save comments OpTkn: yyDollar[2].token,
yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) Right: yyDollar[3].node,
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Expr, yyDollar[2].token.SkippedTokens) }
} }
case 328: case 328:
yyDollar = yyS[yypt-3 : yypt+1] yyDollar = yyS[yypt-3 : yypt+1]
// line internal/php7/php7.y:3170 // line internal/php7/php7.y:3171
{ {
yyVAL.node = &ast.ExprBinaryMinus{ast.Node{}, yyDollar[1].node, yyDollar[3].node} yyVAL.node = &ast.ExprBinaryMinus{
Node: ast.Node{
// save position Position: position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node),
yyVAL.node.GetNode().Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node) },
Left: yyDollar[1].node,
// save comments OpTkn: yyDollar[2].token,
yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) Right: yyDollar[3].node,
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Expr, yyDollar[2].token.SkippedTokens) }
} }
case 329: case 329:
yyDollar = yyS[yypt-3 : yypt+1] yyDollar = yyS[yypt-3 : yypt+1]
// line internal/php7/php7.y:3181 // line internal/php7/php7.y:3182
{ {
yyVAL.node = &ast.ExprBinaryMul{ast.Node{}, yyDollar[1].node, yyDollar[3].node} yyVAL.node = &ast.ExprBinaryMul{
Node: ast.Node{
// save position Position: position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node),
yyVAL.node.GetNode().Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node) },
Left: yyDollar[1].node,
// save comments OpTkn: yyDollar[2].token,
yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) Right: yyDollar[3].node,
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Expr, yyDollar[2].token.SkippedTokens) }
} }
case 330: case 330:
yyDollar = yyS[yypt-3 : yypt+1] yyDollar = yyS[yypt-3 : yypt+1]
// line internal/php7/php7.y:3192 // line internal/php7/php7.y:3193
{ {
yyVAL.node = &ast.ExprBinaryPow{ast.Node{}, yyDollar[1].node, yyDollar[3].node} yyVAL.node = &ast.ExprBinaryPow{
Node: ast.Node{
// save position Position: position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node),
yyVAL.node.GetNode().Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node) },
Left: yyDollar[1].node,
// save comments OpTkn: yyDollar[2].token,
yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) Right: yyDollar[3].node,
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Expr, yyDollar[2].token.SkippedTokens) }
} }
case 331: case 331:
yyDollar = yyS[yypt-3 : yypt+1] yyDollar = yyS[yypt-3 : yypt+1]
// line internal/php7/php7.y:3203 // line internal/php7/php7.y:3204
{ {
yyVAL.node = &ast.ExprBinaryDiv{ast.Node{}, yyDollar[1].node, yyDollar[3].node} yyVAL.node = &ast.ExprBinaryDiv{
Node: ast.Node{
// save position Position: position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node),
yyVAL.node.GetNode().Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node) },
Left: yyDollar[1].node,
// save comments OpTkn: yyDollar[2].token,
yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) Right: yyDollar[3].node,
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Expr, yyDollar[2].token.SkippedTokens) }
} }
case 332: case 332:
yyDollar = yyS[yypt-3 : yypt+1] yyDollar = yyS[yypt-3 : yypt+1]
// line internal/php7/php7.y:3214 // line internal/php7/php7.y:3215
{ {
yyVAL.node = &ast.ExprBinaryMod{ast.Node{}, yyDollar[1].node, yyDollar[3].node} yyVAL.node = &ast.ExprBinaryMod{
Node: ast.Node{
// save position Position: position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node),
yyVAL.node.GetNode().Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node) },
Left: yyDollar[1].node,
// save comments OpTkn: yyDollar[2].token,
yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) Right: yyDollar[3].node,
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Expr, yyDollar[2].token.SkippedTokens) }
} }
case 333: case 333:
yyDollar = yyS[yypt-3 : yypt+1] yyDollar = yyS[yypt-3 : yypt+1]
// line internal/php7/php7.y:3225 // line internal/php7/php7.y:3226
{ {
yyVAL.node = &ast.ExprBinaryShiftLeft{ast.Node{}, yyDollar[1].node, yyDollar[3].node} yyVAL.node = &ast.ExprBinaryShiftLeft{
Node: ast.Node{
// save position Position: position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node),
yyVAL.node.GetNode().Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node) },
Left: yyDollar[1].node,
// save comments OpTkn: yyDollar[2].token,
yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) Right: yyDollar[3].node,
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Expr, yyDollar[2].token.SkippedTokens) }
} }
case 334: case 334:
yyDollar = yyS[yypt-3 : yypt+1] yyDollar = yyS[yypt-3 : yypt+1]
// line internal/php7/php7.y:3236 // line internal/php7/php7.y:3237
{ {
yyVAL.node = &ast.ExprBinaryShiftRight{ast.Node{}, yyDollar[1].node, yyDollar[3].node} yyVAL.node = &ast.ExprBinaryShiftRight{
Node: ast.Node{
// save position Position: position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node),
yyVAL.node.GetNode().Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node) },
Left: yyDollar[1].node,
// save comments OpTkn: yyDollar[2].token,
yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) Right: yyDollar[3].node,
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Expr, yyDollar[2].token.SkippedTokens) }
} }
case 335: case 335:
yyDollar = yyS[yypt-2 : yypt+1] yyDollar = yyS[yypt-2 : yypt+1]
// line internal/php7/php7.y:3247 // line internal/php7/php7.y:3248
{ {
yyVAL.node = &ast.ExprUnaryPlus{ yyVAL.node = &ast.ExprUnaryPlus{
Node: ast.Node{ Node: ast.Node{
@ -5768,7 +5769,7 @@ yydefault:
} }
case 336: case 336:
yyDollar = yyS[yypt-2 : yypt+1] yyDollar = yyS[yypt-2 : yypt+1]
// line internal/php7/php7.y:3257 // line internal/php7/php7.y:3258
{ {
yyVAL.node = &ast.ExprUnaryMinus{ yyVAL.node = &ast.ExprUnaryMinus{
Node: ast.Node{ Node: ast.Node{
@ -5780,7 +5781,7 @@ yydefault:
} }
case 337: case 337:
yyDollar = yyS[yypt-2 : yypt+1] yyDollar = yyS[yypt-2 : yypt+1]
// line internal/php7/php7.y:3267 // line internal/php7/php7.y:3268
{ {
yyVAL.node = &ast.ExprBooleanNot{ yyVAL.node = &ast.ExprBooleanNot{
Node: ast.Node{ Node: ast.Node{
@ -5792,7 +5793,7 @@ yydefault:
} }
case 338: case 338:
yyDollar = yyS[yypt-2 : yypt+1] yyDollar = yyS[yypt-2 : yypt+1]
// line internal/php7/php7.y:3277 // line internal/php7/php7.y:3278
{ {
yyVAL.node = &ast.ExprBitwiseNot{ yyVAL.node = &ast.ExprBitwiseNot{
Node: ast.Node{ Node: ast.Node{
@ -5804,121 +5805,120 @@ yydefault:
} }
case 339: case 339:
yyDollar = yyS[yypt-3 : yypt+1] yyDollar = yyS[yypt-3 : yypt+1]
// line internal/php7/php7.y:3287 // line internal/php7/php7.y:3288
{ {
yyVAL.node = &ast.ExprBinaryIdentical{ast.Node{}, yyDollar[1].node, yyDollar[3].node} yyVAL.node = &ast.ExprBinaryIdentical{
Node: ast.Node{
// save position Position: position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node),
yyVAL.node.GetNode().Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node) },
Left: yyDollar[1].node,
// save comments OpTkn: yyDollar[2].token,
yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) Right: yyDollar[3].node,
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Expr, yyDollar[2].token.SkippedTokens) }
} }
case 340: case 340:
yyDollar = yyS[yypt-3 : yypt+1] yyDollar = yyS[yypt-3 : yypt+1]
// line internal/php7/php7.y:3298 // line internal/php7/php7.y:3299
{ {
yyVAL.node = &ast.ExprBinaryNotIdentical{ast.Node{}, yyDollar[1].node, yyDollar[3].node} yyVAL.node = &ast.ExprBinaryNotIdentical{
Node: ast.Node{
// save position Position: position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node),
yyVAL.node.GetNode().Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node) },
Left: yyDollar[1].node,
// save comments OpTkn: yyDollar[2].token,
yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) Right: yyDollar[3].node,
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Expr, yyDollar[2].token.SkippedTokens) }
} }
case 341: case 341:
yyDollar = yyS[yypt-3 : yypt+1] yyDollar = yyS[yypt-3 : yypt+1]
// line internal/php7/php7.y:3309 // line internal/php7/php7.y:3310
{ {
yyVAL.node = &ast.ExprBinaryEqual{ast.Node{}, yyDollar[1].node, yyDollar[3].node} yyVAL.node = &ast.ExprBinaryEqual{
Node: ast.Node{
// save position Position: position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node),
yyVAL.node.GetNode().Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node) },
Left: yyDollar[1].node,
// save comments OpTkn: yyDollar[2].token,
yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) Right: yyDollar[3].node,
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Expr, yyDollar[2].token.SkippedTokens) }
} }
case 342: case 342:
yyDollar = yyS[yypt-3 : yypt+1] yyDollar = yyS[yypt-3 : yypt+1]
// line internal/php7/php7.y:3320 // line internal/php7/php7.y:3321
{ {
yyVAL.node = &ast.ExprBinaryNotEqual{ast.Node{}, yyDollar[1].node, yyDollar[3].node} yyVAL.node = &ast.ExprBinaryNotEqual{
Node: ast.Node{
// save position Position: position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node),
yyVAL.node.GetNode().Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node) },
Left: yyDollar[1].node,
// save comments OpTkn: yyDollar[2].token,
yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) Right: yyDollar[3].node,
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Expr, yyDollar[2].token.SkippedTokens) }
yylex.(*Parser).setToken(yyVAL.node, token.Equal, yyDollar[2].token.SkippedTokens)
} }
case 343: case 343:
yyDollar = yyS[yypt-3 : yypt+1] yyDollar = yyS[yypt-3 : yypt+1]
// line internal/php7/php7.y:3332 // line internal/php7/php7.y:3332
{ {
yyVAL.node = &ast.ExprBinarySmaller{ast.Node{}, yyDollar[1].node, yyDollar[3].node} yyVAL.node = &ast.ExprBinarySmaller{
Node: ast.Node{
// save position Position: position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node),
yyVAL.node.GetNode().Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node) },
Left: yyDollar[1].node,
// save comments OpTkn: yyDollar[2].token,
yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) Right: yyDollar[3].node,
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Expr, yyDollar[2].token.SkippedTokens) }
} }
case 344: case 344:
yyDollar = yyS[yypt-3 : yypt+1] yyDollar = yyS[yypt-3 : yypt+1]
// line internal/php7/php7.y:3343 // line internal/php7/php7.y:3343
{ {
yyVAL.node = &ast.ExprBinarySmallerOrEqual{ast.Node{}, yyDollar[1].node, yyDollar[3].node} yyVAL.node = &ast.ExprBinarySmallerOrEqual{
Node: ast.Node{
// save position Position: position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node),
yyVAL.node.GetNode().Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node) },
Left: yyDollar[1].node,
// save comments OpTkn: yyDollar[2].token,
yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) Right: yyDollar[3].node,
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Expr, yyDollar[2].token.SkippedTokens) }
} }
case 345: case 345:
yyDollar = yyS[yypt-3 : yypt+1] yyDollar = yyS[yypt-3 : yypt+1]
// line internal/php7/php7.y:3354 // line internal/php7/php7.y:3354
{ {
yyVAL.node = &ast.ExprBinaryGreater{ast.Node{}, yyDollar[1].node, yyDollar[3].node} yyVAL.node = &ast.ExprBinaryGreater{
Node: ast.Node{
// save position Position: position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node),
yyVAL.node.GetNode().Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node) },
Left: yyDollar[1].node,
// save comments OpTkn: yyDollar[2].token,
yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) Right: yyDollar[3].node,
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Expr, yyDollar[2].token.SkippedTokens) }
} }
case 346: case 346:
yyDollar = yyS[yypt-3 : yypt+1] yyDollar = yyS[yypt-3 : yypt+1]
// line internal/php7/php7.y:3365 // line internal/php7/php7.y:3365
{ {
yyVAL.node = &ast.ExprBinaryGreaterOrEqual{ast.Node{}, yyDollar[1].node, yyDollar[3].node} yyVAL.node = &ast.ExprBinaryGreaterOrEqual{
Node: ast.Node{
// save position Position: position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node),
yyVAL.node.GetNode().Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node) },
Left: yyDollar[1].node,
// save comments OpTkn: yyDollar[2].token,
yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) Right: yyDollar[3].node,
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Expr, yyDollar[2].token.SkippedTokens) }
} }
case 347: case 347:
yyDollar = yyS[yypt-3 : yypt+1] yyDollar = yyS[yypt-3 : yypt+1]
// line internal/php7/php7.y:3376 // line internal/php7/php7.y:3376
{ {
yyVAL.node = &ast.ExprBinarySpaceship{ast.Node{}, yyDollar[1].node, yyDollar[3].node} yyVAL.node = &ast.ExprBinarySpaceship{
Node: ast.Node{
// save position Position: position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node),
yyVAL.node.GetNode().Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node) },
Left: yyDollar[1].node,
// save comments OpTkn: yyDollar[2].token,
yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) Right: yyDollar[3].node,
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Expr, yyDollar[2].token.SkippedTokens) }
} }
case 348: case 348:
yyDollar = yyS[yypt-3 : yypt+1] yyDollar = yyS[yypt-3 : yypt+1]
@ -5989,14 +5989,14 @@ yydefault:
yyDollar = yyS[yypt-3 : yypt+1] yyDollar = yyS[yypt-3 : yypt+1]
// line internal/php7/php7.y:3442 // line internal/php7/php7.y:3442
{ {
yyVAL.node = &ast.ExprBinaryCoalesce{ast.Node{}, yyDollar[1].node, yyDollar[3].node} yyVAL.node = &ast.ExprBinaryCoalesce{
Node: ast.Node{
// save position Position: position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node),
yyVAL.node.GetNode().Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[3].node) },
Left: yyDollar[1].node,
// save comments OpTkn: yyDollar[2].token,
yylex.(*Parser).MoveFreeFloating(yyDollar[1].node, yyVAL.node) Right: yyDollar[3].node,
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Expr, yyDollar[2].token.SkippedTokens) }
} }
case 354: case 354:
yyDollar = yyS[yypt-1 : yypt+1] yyDollar = yyS[yypt-1 : yypt+1]

View File

@ -2804,7 +2804,11 @@ new_expr:
expr_without_variable: expr_without_variable:
T_LIST '(' array_pair_list ')' '=' expr T_LIST '(' array_pair_list ')' '=' expr
{ {
listNode := &ast.ExprList{ $$ = &ast.ExprAssign{
Node: ast.Node{
Position: position.NewTokenNodePosition($1, $6),
},
Var: &ast.ExprList{
Node: ast.Node{ Node: ast.Node{
Position: position.NewTokensPosition($1, $4), Position: position.NewTokensPosition($1, $4),
}, },
@ -2813,18 +2817,18 @@ expr_without_variable:
Items: $3.(*ast.ParserSeparatedList).Items, Items: $3.(*ast.ParserSeparatedList).Items,
SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns,
CloseBracketTkn: $4, CloseBracketTkn: $4,
},
EqualTkn: $5,
Expr: $6,
} }
$$ = &ast.ExprAssign{ast.Node{}, listNode, $6}
// save position
$$.GetNode().Position = position.NewTokenNodePosition($1, $6)
// save comments
yylex.(*Parser).setFreeFloating($$, token.Var, $5.SkippedTokens)
} }
| '[' array_pair_list ']' '=' expr | '[' array_pair_list ']' '=' expr
{ {
listNode := &ast.ExprList{ $$ = &ast.ExprAssign{
Node: ast.Node{
Position: position.NewTokenNodePosition($1, $5),
},
Var: &ast.ExprList{
Node: ast.Node{ Node: ast.Node{
Position: position.NewTokensPosition($1, $3), Position: position.NewTokensPosition($1, $3),
}, },
@ -2832,37 +2836,33 @@ expr_without_variable:
Items: $2.(*ast.ParserSeparatedList).Items, Items: $2.(*ast.ParserSeparatedList).Items,
SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns,
CloseBracketTkn: $3, CloseBracketTkn: $3,
},
EqualTkn: $4,
Expr: $5,
} }
$$ = &ast.ExprAssign{ast.Node{}, listNode, $5}
// save position
$$.GetNode().Position = position.NewTokenNodePosition($1, $5)
// save comments
yylex.(*Parser).setFreeFloating($$, token.Var, $4.SkippedTokens)
} }
| variable '=' expr | variable '=' expr
{ {
$$ = &ast.ExprAssign{ast.Node{}, $1, $3} $$ = &ast.ExprAssign{
Node: ast.Node{
// save position Position: position.NewNodesPosition($1, $3),
$$.GetNode().Position = position.NewNodesPosition($1, $3) },
Var: $1,
// save comments EqualTkn: $2,
yylex.(*Parser).MoveFreeFloating($1, $$) Expr: $3,
yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) }
} }
| variable '=' '&' expr | variable '=' '&' expr
{ {
$$ = &ast.ExprAssignReference{ast.Node{}, $1, $4} $$ = &ast.ExprAssignReference{
Node: ast.Node{
// save position Position: position.NewNodesPosition($1, $4),
$$.GetNode().Position = position.NewNodesPosition($1, $4) },
Var: $1,
// save comments EqualTkn: $2,
yylex.(*Parser).MoveFreeFloating($1, $$) AmpersandTkn: $3,
yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) Expr: $4,
yylex.(*Parser).setFreeFloating($$, token.Equal, $3.SkippedTokens) }
} }
| T_CLONE expr | T_CLONE expr
{ {
@ -2876,146 +2876,146 @@ expr_without_variable:
} }
| variable T_PLUS_EQUAL expr | variable T_PLUS_EQUAL expr
{ {
$$ = &ast.ExprAssignPlus{ast.Node{}, $1, $3} $$ = &ast.ExprAssignPlus{
Node: ast.Node{
// save position Position: position.NewNodesPosition($1, $3),
$$.GetNode().Position = position.NewNodesPosition($1, $3) },
Var: $1,
// save comments EqualTkn: $2,
yylex.(*Parser).MoveFreeFloating($1, $$) Expr: $3,
yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) }
} }
| variable T_MINUS_EQUAL expr | variable T_MINUS_EQUAL expr
{ {
$$ = &ast.ExprAssignMinus{ast.Node{}, $1, $3} $$ = &ast.ExprAssignMinus{
Node: ast.Node{
// save position Position: position.NewNodesPosition($1, $3),
$$.GetNode().Position = position.NewNodesPosition($1, $3) },
Var: $1,
// save comments EqualTkn: $2,
yylex.(*Parser).MoveFreeFloating($1, $$) Expr: $3,
yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) }
} }
| variable T_MUL_EQUAL expr | variable T_MUL_EQUAL expr
{ {
$$ = &ast.ExprAssignMul{ast.Node{}, $1, $3} $$ = &ast.ExprAssignMul{
Node: ast.Node{
// save position Position: position.NewNodesPosition($1, $3),
$$.GetNode().Position = position.NewNodesPosition($1, $3) },
Var: $1,
// save comments EqualTkn: $2,
yylex.(*Parser).MoveFreeFloating($1, $$) Expr: $3,
yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) }
} }
| variable T_POW_EQUAL expr | variable T_POW_EQUAL expr
{ {
$$ = &ast.ExprAssignPow{ast.Node{}, $1, $3} $$ = &ast.ExprAssignPow{
Node: ast.Node{
// save position Position: position.NewNodesPosition($1, $3),
$$.GetNode().Position = position.NewNodesPosition($1, $3) },
Var: $1,
// save comments EqualTkn: $2,
yylex.(*Parser).MoveFreeFloating($1, $$) Expr: $3,
yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) }
} }
| variable T_DIV_EQUAL expr | variable T_DIV_EQUAL expr
{ {
$$ = &ast.ExprAssignDiv{ast.Node{}, $1, $3} $$ = &ast.ExprAssignDiv{
Node: ast.Node{
// save position Position: position.NewNodesPosition($1, $3),
$$.GetNode().Position = position.NewNodesPosition($1, $3) },
Var: $1,
// save comments EqualTkn: $2,
yylex.(*Parser).MoveFreeFloating($1, $$) Expr: $3,
yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) }
} }
| variable T_CONCAT_EQUAL expr | variable T_CONCAT_EQUAL expr
{ {
$$ = &ast.ExprAssignConcat{ast.Node{}, $1, $3} $$ = &ast.ExprAssignConcat{
Node: ast.Node{
// save position Position: position.NewNodesPosition($1, $3),
$$.GetNode().Position = position.NewNodesPosition($1, $3) },
Var: $1,
// save comments EqualTkn: $2,
yylex.(*Parser).MoveFreeFloating($1, $$) Expr: $3,
yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) }
} }
| variable T_MOD_EQUAL expr | variable T_MOD_EQUAL expr
{ {
$$ = &ast.ExprAssignMod{ast.Node{}, $1, $3} $$ = &ast.ExprAssignMod{
Node: ast.Node{
// save position Position: position.NewNodesPosition($1, $3),
$$.GetNode().Position = position.NewNodesPosition($1, $3) },
Var: $1,
// save comments EqualTkn: $2,
yylex.(*Parser).MoveFreeFloating($1, $$) Expr: $3,
yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) }
} }
| variable T_AND_EQUAL expr | variable T_AND_EQUAL expr
{ {
$$ = &ast.ExprAssignBitwiseAnd{ast.Node{}, $1, $3} $$ = &ast.ExprAssignBitwiseAnd{
Node: ast.Node{
// save position Position: position.NewNodesPosition($1, $3),
$$.GetNode().Position = position.NewNodesPosition($1, $3) },
Var: $1,
// save comments EqualTkn: $2,
yylex.(*Parser).MoveFreeFloating($1, $$) Expr: $3,
yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) }
} }
| variable T_OR_EQUAL expr | variable T_OR_EQUAL expr
{ {
$$ = &ast.ExprAssignBitwiseOr{ast.Node{}, $1, $3} $$ = &ast.ExprAssignBitwiseOr{
Node: ast.Node{
// save position Position: position.NewNodesPosition($1, $3),
$$.GetNode().Position = position.NewNodesPosition($1, $3) },
Var: $1,
// save comments EqualTkn: $2,
yylex.(*Parser).MoveFreeFloating($1, $$) Expr: $3,
yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) }
} }
| variable T_XOR_EQUAL expr | variable T_XOR_EQUAL expr
{ {
$$ = &ast.ExprAssignBitwiseXor{ast.Node{}, $1, $3} $$ = &ast.ExprAssignBitwiseXor{
Node: ast.Node{
// save position Position: position.NewNodesPosition($1, $3),
$$.GetNode().Position = position.NewNodesPosition($1, $3) },
Var: $1,
// save comments EqualTkn: $2,
yylex.(*Parser).MoveFreeFloating($1, $$) Expr: $3,
yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) }
} }
| variable T_SL_EQUAL expr | variable T_SL_EQUAL expr
{ {
$$ = &ast.ExprAssignShiftLeft{ast.Node{}, $1, $3} $$ = &ast.ExprAssignShiftLeft{
Node: ast.Node{
// save position Position: position.NewNodesPosition($1, $3),
$$.GetNode().Position = position.NewNodesPosition($1, $3) },
Var: $1,
// save comments EqualTkn: $2,
yylex.(*Parser).MoveFreeFloating($1, $$) Expr: $3,
yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) }
} }
| variable T_SR_EQUAL expr | variable T_SR_EQUAL expr
{ {
$$ = &ast.ExprAssignShiftRight{ast.Node{}, $1, $3} $$ = &ast.ExprAssignShiftRight{
Node: ast.Node{
// save position Position: position.NewNodesPosition($1, $3),
$$.GetNode().Position = position.NewNodesPosition($1, $3) },
Var: $1,
// save comments EqualTkn: $2,
yylex.(*Parser).MoveFreeFloating($1, $$) Expr: $3,
yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) }
} }
| variable T_COALESCE_EQUAL expr | variable T_COALESCE_EQUAL expr
{ {
$$ = &ast.ExprAssignCoalesce{ast.Node{}, $1, $3} $$ = &ast.ExprAssignCoalesce{
Node: ast.Node{
// save position Position: position.NewNodesPosition($1, $3),
$$.GetNode().Position = position.NewNodesPosition($1, $3) },
Var: $1,
// save comments EqualTkn: $2,
yylex.(*Parser).MoveFreeFloating($1, $$) Expr: $3,
yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) }
} }
| variable T_INC | variable T_INC
{ {
@ -3059,189 +3059,190 @@ expr_without_variable:
} }
| expr T_BOOLEAN_OR expr | expr T_BOOLEAN_OR expr
{ {
$$ = &ast.ExprBinaryBooleanOr{ast.Node{}, $1, $3} $$ = &ast.ExprBinaryBooleanOr{
Node: ast.Node{
// save position Position: position.NewNodesPosition($1, $3),
$$.GetNode().Position = position.NewNodesPosition($1, $3) },
Left: $1,
// save comments OpTkn: $2,
yylex.(*Parser).MoveFreeFloating($1, $$) Right: $3,
yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) }
} }
| expr T_BOOLEAN_AND expr | expr T_BOOLEAN_AND expr
{ {
$$ = &ast.ExprBinaryBooleanAnd{ast.Node{}, $1, $3} $$ = &ast.ExprBinaryBooleanAnd{
Node: ast.Node{
// save position Position: position.NewNodesPosition($1, $3),
$$.GetNode().Position = position.NewNodesPosition($1, $3) },
Left: $1,
// save comments OpTkn: $2,
yylex.(*Parser).MoveFreeFloating($1, $$) Right: $3,
yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) }
} }
| expr T_LOGICAL_OR expr | expr T_LOGICAL_OR expr
{ {
$$ = &ast.ExprBinaryLogicalOr{ast.Node{}, $1, $3} $$ = &ast.ExprBinaryLogicalOr{
Node: ast.Node{
// save position Position: position.NewNodesPosition($1, $3),
$$.GetNode().Position = position.NewNodesPosition($1, $3) },
Left: $1,
// save comments OpTkn: $2,
yylex.(*Parser).MoveFreeFloating($1, $$) Right: $3,
yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) }
} }
| expr T_LOGICAL_AND expr | expr T_LOGICAL_AND expr
{ {
$$ = &ast.ExprBinaryLogicalAnd{ast.Node{}, $1, $3} $$ = &ast.ExprBinaryLogicalAnd{
Node: ast.Node{
// save position Position: position.NewNodesPosition($1, $3),
$$.GetNode().Position = position.NewNodesPosition($1, $3) },
Left: $1,
// save comments OpTkn: $2,
yylex.(*Parser).MoveFreeFloating($1, $$) Right: $3,
yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) }
} }
| expr T_LOGICAL_XOR expr | expr T_LOGICAL_XOR expr
{ {
$$ = &ast.ExprBinaryLogicalXor{ast.Node{}, $1, $3} $$ = &ast.ExprBinaryLogicalXor{
Node: ast.Node{
// save position Position: position.NewNodesPosition($1, $3),
$$.GetNode().Position = position.NewNodesPosition($1, $3) },
Left: $1,
// save comments OpTkn: $2,
yylex.(*Parser).MoveFreeFloating($1, $$) Right: $3,
yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) }
} }
| expr '|' expr | expr '|' expr
{ {
$$ = &ast.ExprBinaryBitwiseOr{ast.Node{}, $1, $3} $$ = &ast.ExprBinaryBitwiseOr{
Node: ast.Node{
// save position Position: position.NewNodesPosition($1, $3),
$$.GetNode().Position = position.NewNodesPosition($1, $3) },
Left: $1,
// save comments OpTkn: $2,
yylex.(*Parser).MoveFreeFloating($1, $$) Right: $3,
yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) }
} }
| expr '&' expr | expr '&' expr
{ {
$$ = &ast.ExprBinaryBitwiseAnd{ast.Node{}, $1, $3} $$ = &ast.ExprBinaryBitwiseAnd{
Node: ast.Node{
// save position Position: position.NewNodesPosition($1, $3),
$$.GetNode().Position = position.NewNodesPosition($1, $3) },
Left: $1,
// save comments OpTkn: $2,
yylex.(*Parser).MoveFreeFloating($1, $$) Right: $3,
yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) }
} }
| expr '^' expr | expr '^' expr
{ {
$$ = &ast.ExprBinaryBitwiseXor{ast.Node{}, $1, $3} $$ = &ast.ExprBinaryBitwiseXor{
Node: ast.Node{
// save position Position: position.NewNodesPosition($1, $3),
$$.GetNode().Position = position.NewNodesPosition($1, $3) },
Left: $1,
// save comments OpTkn: $2,
yylex.(*Parser).MoveFreeFloating($1, $$) Right: $3,
yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) }
} }
| expr '.' expr | expr '.' expr
{ {
$$ = &ast.ExprBinaryConcat{ast.Node{}, $1, $3} $$ = &ast.ExprBinaryConcat{
Node: ast.Node{
// save position Position: position.NewNodesPosition($1, $3),
$$.GetNode().Position = position.NewNodesPosition($1, $3) },
Left: $1,
// save comments OpTkn: $2,
yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) Right: $3,
}
} }
| expr '+' expr | expr '+' expr
{ {
$$ = &ast.ExprBinaryPlus{ast.Node{}, $1, $3} $$ = &ast.ExprBinaryPlus{
Node: ast.Node{
// save position Position: position.NewNodesPosition($1, $3),
$$.GetNode().Position = position.NewNodesPosition($1, $3) },
Left: $1,
// save comments OpTkn: $2,
yylex.(*Parser).MoveFreeFloating($1, $$) Right: $3,
yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) }
} }
| expr '-' expr | expr '-' expr
{ {
$$ = &ast.ExprBinaryMinus{ast.Node{}, $1, $3} $$ = &ast.ExprBinaryMinus{
Node: ast.Node{
// save position Position: position.NewNodesPosition($1, $3),
$$.GetNode().Position = position.NewNodesPosition($1, $3) },
Left: $1,
// save comments OpTkn: $2,
yylex.(*Parser).MoveFreeFloating($1, $$) Right: $3,
yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) }
} }
| expr '*' expr | expr '*' expr
{ {
$$ = &ast.ExprBinaryMul{ast.Node{}, $1, $3} $$ = &ast.ExprBinaryMul{
Node: ast.Node{
// save position Position: position.NewNodesPosition($1, $3),
$$.GetNode().Position = position.NewNodesPosition($1, $3) },
Left: $1,
// save comments OpTkn: $2,
yylex.(*Parser).MoveFreeFloating($1, $$) Right: $3,
yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) }
} }
| expr T_POW expr | expr T_POW expr
{ {
$$ = &ast.ExprBinaryPow{ast.Node{}, $1, $3} $$ = &ast.ExprBinaryPow{
Node: ast.Node{
// save position Position: position.NewNodesPosition($1, $3),
$$.GetNode().Position = position.NewNodesPosition($1, $3) },
Left: $1,
// save comments OpTkn: $2,
yylex.(*Parser).MoveFreeFloating($1, $$) Right: $3,
yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) }
} }
| expr '/' expr | expr '/' expr
{ {
$$ = &ast.ExprBinaryDiv{ast.Node{}, $1, $3} $$ = &ast.ExprBinaryDiv{
Node: ast.Node{
// save position Position: position.NewNodesPosition($1, $3),
$$.GetNode().Position = position.NewNodesPosition($1, $3) },
Left: $1,
// save comments OpTkn: $2,
yylex.(*Parser).MoveFreeFloating($1, $$) Right: $3,
yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) }
} }
| expr '%' expr | expr '%' expr
{ {
$$ = &ast.ExprBinaryMod{ast.Node{}, $1, $3} $$ = &ast.ExprBinaryMod{
Node: ast.Node{
// save position Position: position.NewNodesPosition($1, $3),
$$.GetNode().Position = position.NewNodesPosition($1, $3) },
Left: $1,
// save comments OpTkn: $2,
yylex.(*Parser).MoveFreeFloating($1, $$) Right: $3,
yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) }
} }
| expr T_SL expr | expr T_SL expr
{ {
$$ = &ast.ExprBinaryShiftLeft{ast.Node{}, $1, $3} $$ = &ast.ExprBinaryShiftLeft{
Node: ast.Node{
// save position Position: position.NewNodesPosition($1, $3),
$$.GetNode().Position = position.NewNodesPosition($1, $3) },
Left: $1,
// save comments OpTkn: $2,
yylex.(*Parser).MoveFreeFloating($1, $$) Right: $3,
yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) }
} }
| expr T_SR expr | expr T_SR expr
{ {
$$ = &ast.ExprBinaryShiftRight{ast.Node{}, $1, $3} $$ = &ast.ExprBinaryShiftRight{
Node: ast.Node{
// save position Position: position.NewNodesPosition($1, $3),
$$.GetNode().Position = position.NewNodesPosition($1, $3) },
Left: $1,
// save comments OpTkn: $2,
yylex.(*Parser).MoveFreeFloating($1, $$) Right: $3,
yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) }
} }
| '+' expr %prec T_INC | '+' expr %prec T_INC
{ {
@ -3285,103 +3286,102 @@ expr_without_variable:
} }
| expr T_IS_IDENTICAL expr | expr T_IS_IDENTICAL expr
{ {
$$ = &ast.ExprBinaryIdentical{ast.Node{}, $1, $3} $$ = &ast.ExprBinaryIdentical{
Node: ast.Node{
// save position Position: position.NewNodesPosition($1, $3),
$$.GetNode().Position = position.NewNodesPosition($1, $3) },
Left: $1,
// save comments OpTkn: $2,
yylex.(*Parser).MoveFreeFloating($1, $$) Right: $3,
yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) }
} }
| expr T_IS_NOT_IDENTICAL expr | expr T_IS_NOT_IDENTICAL expr
{ {
$$ = &ast.ExprBinaryNotIdentical{ast.Node{}, $1, $3} $$ = &ast.ExprBinaryNotIdentical{
Node: ast.Node{
// save position Position: position.NewNodesPosition($1, $3),
$$.GetNode().Position = position.NewNodesPosition($1, $3) },
Left: $1,
// save comments OpTkn: $2,
yylex.(*Parser).MoveFreeFloating($1, $$) Right: $3,
yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) }
} }
| expr T_IS_EQUAL expr | expr T_IS_EQUAL expr
{ {
$$ = &ast.ExprBinaryEqual{ast.Node{}, $1, $3} $$ = &ast.ExprBinaryEqual{
Node: ast.Node{
// save position Position: position.NewNodesPosition($1, $3),
$$.GetNode().Position = position.NewNodesPosition($1, $3) },
Left: $1,
// save comments OpTkn: $2,
yylex.(*Parser).MoveFreeFloating($1, $$) Right: $3,
yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) }
} }
| expr T_IS_NOT_EQUAL expr | expr T_IS_NOT_EQUAL expr
{ {
$$ = &ast.ExprBinaryNotEqual{ast.Node{}, $1, $3} $$ = &ast.ExprBinaryNotEqual{
Node: ast.Node{
// save position Position: position.NewNodesPosition($1, $3),
$$.GetNode().Position = position.NewNodesPosition($1, $3) },
Left: $1,
// save comments OpTkn: $2,
yylex.(*Parser).MoveFreeFloating($1, $$) Right: $3,
yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) }
yylex.(*Parser).setToken($$, token.Equal, $2.SkippedTokens)
} }
| expr '<' expr | expr '<' expr
{ {
$$ = &ast.ExprBinarySmaller{ast.Node{}, $1, $3} $$ = &ast.ExprBinarySmaller{
Node: ast.Node{
// save position Position: position.NewNodesPosition($1, $3),
$$.GetNode().Position = position.NewNodesPosition($1, $3) },
Left: $1,
// save comments OpTkn: $2,
yylex.(*Parser).MoveFreeFloating($1, $$) Right: $3,
yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) }
} }
| expr T_IS_SMALLER_OR_EQUAL expr | expr T_IS_SMALLER_OR_EQUAL expr
{ {
$$ = &ast.ExprBinarySmallerOrEqual{ast.Node{}, $1, $3} $$ = &ast.ExprBinarySmallerOrEqual{
Node: ast.Node{
// save position Position: position.NewNodesPosition($1, $3),
$$.GetNode().Position = position.NewNodesPosition($1, $3) },
Left: $1,
// save comments OpTkn: $2,
yylex.(*Parser).MoveFreeFloating($1, $$) Right: $3,
yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) }
} }
| expr '>' expr | expr '>' expr
{ {
$$ = &ast.ExprBinaryGreater{ast.Node{}, $1, $3} $$ = &ast.ExprBinaryGreater{
Node: ast.Node{
// save position Position: position.NewNodesPosition($1, $3),
$$.GetNode().Position = position.NewNodesPosition($1, $3) },
Left: $1,
// save comments OpTkn: $2,
yylex.(*Parser).MoveFreeFloating($1, $$) Right: $3,
yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) }
} }
| expr T_IS_GREATER_OR_EQUAL expr | expr T_IS_GREATER_OR_EQUAL expr
{ {
$$ = &ast.ExprBinaryGreaterOrEqual{ast.Node{}, $1, $3} $$ = &ast.ExprBinaryGreaterOrEqual{
Node: ast.Node{
// save position Position: position.NewNodesPosition($1, $3),
$$.GetNode().Position = position.NewNodesPosition($1, $3) },
Left: $1,
// save comments OpTkn: $2,
yylex.(*Parser).MoveFreeFloating($1, $$) Right: $3,
yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) }
} }
| expr T_SPACESHIP expr | expr T_SPACESHIP expr
{ {
$$ = &ast.ExprBinarySpaceship{ast.Node{}, $1, $3} $$ = &ast.ExprBinarySpaceship{
Node: ast.Node{
// save position Position: position.NewNodesPosition($1, $3),
$$.GetNode().Position = position.NewNodesPosition($1, $3) },
Left: $1,
// save comments OpTkn: $2,
yylex.(*Parser).MoveFreeFloating($1, $$) Right: $3,
yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) }
} }
| expr T_INSTANCEOF class_name_reference | expr T_INSTANCEOF class_name_reference
{ {
@ -3440,14 +3440,14 @@ expr_without_variable:
} }
| expr T_COALESCE expr | expr T_COALESCE expr
{ {
$$ = &ast.ExprBinaryCoalesce{ast.Node{}, $1, $3} $$ = &ast.ExprBinaryCoalesce{
Node: ast.Node{
// save position Position: position.NewNodesPosition($1, $3),
$$.GetNode().Position = position.NewNodesPosition($1, $3) },
Left: $1,
// save comments OpTkn: $2,
yylex.(*Parser).MoveFreeFloating($1, $$) Right: $3,
yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) }
} }
| internal_functions_in_yacc | internal_functions_in_yacc
{ {

View File

@ -1530,6 +1530,7 @@ func (n *ExprCastUnset) Accept(v NodeVisitor) {
type ExprAssign struct { type ExprAssign struct {
Node Node
Var Vertex Var Vertex
EqualTkn *token.Token
Expr Vertex Expr Vertex
} }
@ -1541,6 +1542,8 @@ func (n *ExprAssign) Accept(v NodeVisitor) {
type ExprAssignReference struct { type ExprAssignReference struct {
Node Node
Var Vertex Var Vertex
EqualTkn *token.Token
AmpersandTkn *token.Token
Expr Vertex Expr Vertex
} }
@ -1552,6 +1555,7 @@ func (n *ExprAssignReference) Accept(v NodeVisitor) {
type ExprAssignBitwiseAnd struct { type ExprAssignBitwiseAnd struct {
Node Node
Var Vertex Var Vertex
EqualTkn *token.Token
Expr Vertex Expr Vertex
} }
@ -1563,6 +1567,7 @@ func (n *ExprAssignBitwiseAnd) Accept(v NodeVisitor) {
type ExprAssignBitwiseOr struct { type ExprAssignBitwiseOr struct {
Node Node
Var Vertex Var Vertex
EqualTkn *token.Token
Expr Vertex Expr Vertex
} }
@ -1574,6 +1579,7 @@ func (n *ExprAssignBitwiseOr) Accept(v NodeVisitor) {
type ExprAssignBitwiseXor struct { type ExprAssignBitwiseXor struct {
Node Node
Var Vertex Var Vertex
EqualTkn *token.Token
Expr Vertex Expr Vertex
} }
@ -1585,6 +1591,7 @@ func (n *ExprAssignBitwiseXor) Accept(v NodeVisitor) {
type ExprAssignCoalesce struct { type ExprAssignCoalesce struct {
Node Node
Var Vertex Var Vertex
EqualTkn *token.Token
Expr Vertex Expr Vertex
} }
@ -1596,6 +1603,7 @@ func (n *ExprAssignCoalesce) Accept(v NodeVisitor) {
type ExprAssignConcat struct { type ExprAssignConcat struct {
Node Node
Var Vertex Var Vertex
EqualTkn *token.Token
Expr Vertex Expr Vertex
} }
@ -1607,6 +1615,7 @@ func (n *ExprAssignConcat) Accept(v NodeVisitor) {
type ExprAssignDiv struct { type ExprAssignDiv struct {
Node Node
Var Vertex Var Vertex
EqualTkn *token.Token
Expr Vertex Expr Vertex
} }
@ -1618,6 +1627,7 @@ func (n *ExprAssignDiv) Accept(v NodeVisitor) {
type ExprAssignMinus struct { type ExprAssignMinus struct {
Node Node
Var Vertex Var Vertex
EqualTkn *token.Token
Expr Vertex Expr Vertex
} }
@ -1629,6 +1639,7 @@ func (n *ExprAssignMinus) Accept(v NodeVisitor) {
type ExprAssignMod struct { type ExprAssignMod struct {
Node Node
Var Vertex Var Vertex
EqualTkn *token.Token
Expr Vertex Expr Vertex
} }
@ -1640,6 +1651,7 @@ func (n *ExprAssignMod) Accept(v NodeVisitor) {
type ExprAssignMul struct { type ExprAssignMul struct {
Node Node
Var Vertex Var Vertex
EqualTkn *token.Token
Expr Vertex Expr Vertex
} }
@ -1651,6 +1663,7 @@ func (n *ExprAssignMul) Accept(v NodeVisitor) {
type ExprAssignPlus struct { type ExprAssignPlus struct {
Node Node
Var Vertex Var Vertex
EqualTkn *token.Token
Expr Vertex Expr Vertex
} }
@ -1662,6 +1675,7 @@ func (n *ExprAssignPlus) Accept(v NodeVisitor) {
type ExprAssignPow struct { type ExprAssignPow struct {
Node Node
Var Vertex Var Vertex
EqualTkn *token.Token
Expr Vertex Expr Vertex
} }
@ -1673,6 +1687,7 @@ func (n *ExprAssignPow) Accept(v NodeVisitor) {
type ExprAssignShiftLeft struct { type ExprAssignShiftLeft struct {
Node Node
Var Vertex Var Vertex
EqualTkn *token.Token
Expr Vertex Expr Vertex
} }
@ -1684,6 +1699,7 @@ func (n *ExprAssignShiftLeft) Accept(v NodeVisitor) {
type ExprAssignShiftRight struct { type ExprAssignShiftRight struct {
Node Node
Var Vertex Var Vertex
EqualTkn *token.Token
Expr Vertex Expr Vertex
} }
@ -1695,6 +1711,7 @@ func (n *ExprAssignShiftRight) Accept(v NodeVisitor) {
type ExprBinaryBitwiseAnd struct { type ExprBinaryBitwiseAnd struct {
Node Node
Left Vertex Left Vertex
OpTkn *token.Token
Right Vertex Right Vertex
} }
@ -1706,6 +1723,7 @@ func (n *ExprBinaryBitwiseAnd) Accept(v NodeVisitor) {
type ExprBinaryBitwiseOr struct { type ExprBinaryBitwiseOr struct {
Node Node
Left Vertex Left Vertex
OpTkn *token.Token
Right Vertex Right Vertex
} }
@ -1717,6 +1735,7 @@ func (n *ExprBinaryBitwiseOr) Accept(v NodeVisitor) {
type ExprBinaryBitwiseXor struct { type ExprBinaryBitwiseXor struct {
Node Node
Left Vertex Left Vertex
OpTkn *token.Token
Right Vertex Right Vertex
} }
@ -1728,6 +1747,7 @@ func (n *ExprBinaryBitwiseXor) Accept(v NodeVisitor) {
type ExprBinaryBooleanAnd struct { type ExprBinaryBooleanAnd struct {
Node Node
Left Vertex Left Vertex
OpTkn *token.Token
Right Vertex Right Vertex
} }
@ -1739,6 +1759,7 @@ func (n *ExprBinaryBooleanAnd) Accept(v NodeVisitor) {
type ExprBinaryBooleanOr struct { type ExprBinaryBooleanOr struct {
Node Node
Left Vertex Left Vertex
OpTkn *token.Token
Right Vertex Right Vertex
} }
@ -1750,6 +1771,7 @@ func (n *ExprBinaryBooleanOr) Accept(v NodeVisitor) {
type ExprBinaryCoalesce struct { type ExprBinaryCoalesce struct {
Node Node
Left Vertex Left Vertex
OpTkn *token.Token
Right Vertex Right Vertex
} }
@ -1761,6 +1783,7 @@ func (n *ExprBinaryCoalesce) Accept(v NodeVisitor) {
type ExprBinaryConcat struct { type ExprBinaryConcat struct {
Node Node
Left Vertex Left Vertex
OpTkn *token.Token
Right Vertex Right Vertex
} }
@ -1772,6 +1795,7 @@ func (n *ExprBinaryConcat) Accept(v NodeVisitor) {
type ExprBinaryDiv struct { type ExprBinaryDiv struct {
Node Node
Left Vertex Left Vertex
OpTkn *token.Token
Right Vertex Right Vertex
} }
@ -1783,6 +1807,7 @@ func (n *ExprBinaryDiv) Accept(v NodeVisitor) {
type ExprBinaryEqual struct { type ExprBinaryEqual struct {
Node Node
Left Vertex Left Vertex
OpTkn *token.Token
Right Vertex Right Vertex
} }
@ -1794,6 +1819,7 @@ func (n *ExprBinaryEqual) Accept(v NodeVisitor) {
type ExprBinaryGreater struct { type ExprBinaryGreater struct {
Node Node
Left Vertex Left Vertex
OpTkn *token.Token
Right Vertex Right Vertex
} }
@ -1805,6 +1831,7 @@ func (n *ExprBinaryGreater) Accept(v NodeVisitor) {
type ExprBinaryGreaterOrEqual struct { type ExprBinaryGreaterOrEqual struct {
Node Node
Left Vertex Left Vertex
OpTkn *token.Token
Right Vertex Right Vertex
} }
@ -1816,6 +1843,7 @@ func (n *ExprBinaryGreaterOrEqual) Accept(v NodeVisitor) {
type ExprBinaryIdentical struct { type ExprBinaryIdentical struct {
Node Node
Left Vertex Left Vertex
OpTkn *token.Token
Right Vertex Right Vertex
} }
@ -1827,6 +1855,7 @@ func (n *ExprBinaryIdentical) Accept(v NodeVisitor) {
type ExprBinaryLogicalAnd struct { type ExprBinaryLogicalAnd struct {
Node Node
Left Vertex Left Vertex
OpTkn *token.Token
Right Vertex Right Vertex
} }
@ -1838,6 +1867,7 @@ func (n *ExprBinaryLogicalAnd) Accept(v NodeVisitor) {
type ExprBinaryLogicalOr struct { type ExprBinaryLogicalOr struct {
Node Node
Left Vertex Left Vertex
OpTkn *token.Token
Right Vertex Right Vertex
} }
@ -1849,6 +1879,7 @@ func (n *ExprBinaryLogicalOr) Accept(v NodeVisitor) {
type ExprBinaryLogicalXor struct { type ExprBinaryLogicalXor struct {
Node Node
Left Vertex Left Vertex
OpTkn *token.Token
Right Vertex Right Vertex
} }
@ -1860,6 +1891,7 @@ func (n *ExprBinaryLogicalXor) Accept(v NodeVisitor) {
type ExprBinaryMinus struct { type ExprBinaryMinus struct {
Node Node
Left Vertex Left Vertex
OpTkn *token.Token
Right Vertex Right Vertex
} }
@ -1871,6 +1903,7 @@ func (n *ExprBinaryMinus) Accept(v NodeVisitor) {
type ExprBinaryMod struct { type ExprBinaryMod struct {
Node Node
Left Vertex Left Vertex
OpTkn *token.Token
Right Vertex Right Vertex
} }
@ -1882,6 +1915,7 @@ func (n *ExprBinaryMod) Accept(v NodeVisitor) {
type ExprBinaryMul struct { type ExprBinaryMul struct {
Node Node
Left Vertex Left Vertex
OpTkn *token.Token
Right Vertex Right Vertex
} }
@ -1893,6 +1927,7 @@ func (n *ExprBinaryMul) Accept(v NodeVisitor) {
type ExprBinaryNotEqual struct { type ExprBinaryNotEqual struct {
Node Node
Left Vertex Left Vertex
OpTkn *token.Token
Right Vertex Right Vertex
} }
@ -1904,6 +1939,7 @@ func (n *ExprBinaryNotEqual) Accept(v NodeVisitor) {
type ExprBinaryNotIdentical struct { type ExprBinaryNotIdentical struct {
Node Node
Left Vertex Left Vertex
OpTkn *token.Token
Right Vertex Right Vertex
} }
@ -1915,6 +1951,7 @@ func (n *ExprBinaryNotIdentical) Accept(v NodeVisitor) {
type ExprBinaryPlus struct { type ExprBinaryPlus struct {
Node Node
Left Vertex Left Vertex
OpTkn *token.Token
Right Vertex Right Vertex
} }
@ -1926,6 +1963,7 @@ func (n *ExprBinaryPlus) Accept(v NodeVisitor) {
type ExprBinaryPow struct { type ExprBinaryPow struct {
Node Node
Left Vertex Left Vertex
OpTkn *token.Token
Right Vertex Right Vertex
} }
@ -1937,6 +1975,7 @@ func (n *ExprBinaryPow) Accept(v NodeVisitor) {
type ExprBinaryShiftLeft struct { type ExprBinaryShiftLeft struct {
Node Node
Left Vertex Left Vertex
OpTkn *token.Token
Right Vertex Right Vertex
} }
@ -1948,6 +1987,7 @@ func (n *ExprBinaryShiftLeft) Accept(v NodeVisitor) {
type ExprBinaryShiftRight struct { type ExprBinaryShiftRight struct {
Node Node
Left Vertex Left Vertex
OpTkn *token.Token
Right Vertex Right Vertex
} }
@ -1959,6 +1999,7 @@ func (n *ExprBinaryShiftRight) Accept(v NodeVisitor) {
type ExprBinarySmaller struct { type ExprBinarySmaller struct {
Node Node
Left Vertex Left Vertex
OpTkn *token.Token
Right Vertex Right Vertex
} }
@ -1970,6 +2011,7 @@ func (n *ExprBinarySmaller) Accept(v NodeVisitor) {
type ExprBinarySmallerOrEqual struct { type ExprBinarySmallerOrEqual struct {
Node Node
Left Vertex Left Vertex
OpTkn *token.Token
Right Vertex Right Vertex
} }
@ -1981,6 +2023,7 @@ func (n *ExprBinarySmallerOrEqual) Accept(v NodeVisitor) {
type ExprBinarySpaceship struct { type ExprBinarySpaceship struct {
Node Node
Left Vertex Left Vertex
OpTkn *token.Token
Right Vertex Right Vertex
} }