diff --git a/internal/php5/parser_test.go b/internal/php5/parser_test.go index 11e39da..0eb1d67 100644 --- a/internal/php5/parser_test.go +++ b/internal/php5/parser_test.go @@ -6431,7 +6431,7 @@ func TestStmtForeach_Alt(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtAltForeach{ + &ast.StmtForeach{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -6440,6 +6440,7 @@ func TestStmtForeach_Alt(t *testing.T) { EndPos: 35, }, }, + Alt: true, Expr: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 324e992..498f6b5 100644 --- a/internal/php5/php5.go +++ b/internal/php5/php5.go @@ -346,7 +346,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -// line internal/php5/php5.y:6190 +// line internal/php5/php5.y:6151 type simpleIndirectReference struct { all []*ast.ExprVariable @@ -3228,87 +3228,45 @@ yydefault: yyDollar = yyS[yypt-8 : yypt+1] // line internal/php5/php5.y:1096 { + yyDollar[8].node.(*ast.StmtForeach).ForeachTkn = yyDollar[1].token + yyDollar[8].node.(*ast.StmtForeach).OpenParenthesisTkn = yyDollar[2].token + yyDollar[8].node.(*ast.StmtForeach).Expr = yyDollar[3].node + yyDollar[8].node.(*ast.StmtForeach).AsTkn = yyDollar[4].token if yyDollar[6].node == nil { - switch n := yyDollar[8].node.(type) { - case *ast.StmtForeach: - n.Expr = yyDollar[3].node - n.Var = yyDollar[5].node - case *ast.StmtAltForeach: - n.Expr = yyDollar[3].node - n.Var = yyDollar[5].node - } + yyDollar[8].node.(*ast.StmtForeach).Var = yyDollar[5].node } else { - switch n := yyDollar[8].node.(type) { - case *ast.StmtForeach: - n.Expr = yyDollar[3].node - n.Key = yyDollar[5].node - n.Var = yyDollar[6].node - case *ast.StmtAltForeach: - n.Expr = yyDollar[3].node - n.Key = yyDollar[5].node - n.Var = yyDollar[6].node - } + yyDollar[8].node.(*ast.StmtForeach).Key = yyDollar[5].node + yyDollar[8].node.(*ast.StmtForeach).DoubleArrowTkn = yyDollar[6].node.(*ast.StmtForeach).DoubleArrowTkn + yyDollar[8].node.(*ast.StmtForeach).Var = yyDollar[6].node.(*ast.StmtForeach).Var } + yyDollar[8].node.(*ast.StmtForeach).CloseParenthesisTkn = yyDollar[7].token + yyDollar[8].node.(*ast.StmtForeach).Node.Position = position.NewTokenNodePosition(yyDollar[1].token, yyDollar[8].node) yyVAL.node = yyDollar[8].node - - // save position - yyVAL.node.GetNode().Position = position.NewTokenNodePosition(yyDollar[1].token, yyDollar[8].node) - - // save comments - yylex.(*Parser).setFreeFloating(yyVAL.node, token.Start, yyDollar[1].token.SkippedTokens) - yylex.(*Parser).setFreeFloating(yyVAL.node, token.Foreach, yyDollar[2].token.SkippedTokens) - yylex.(*Parser).setFreeFloating(yyVAL.node, token.Expr, yyDollar[4].token.SkippedTokens) - if yyDollar[6].node != nil { - yylex.(*Parser).setFreeFloatingTokens(yyVAL.node, token.Key, yyDollar[6].node.GetNode().Tokens[token.Key]) - delete(yyDollar[6].node.GetNode().Tokens, token.Key) - } - yylex.(*Parser).setFreeFloating(yyVAL.node, token.Var, yyDollar[7].token.SkippedTokens) } case 69: yyDollar = yyS[yypt-8 : yypt+1] - // line internal/php5/php5.y:1134 + // line internal/php5/php5.y:1114 { + yyDollar[8].node.(*ast.StmtForeach).ForeachTkn = yyDollar[1].token + yyDollar[8].node.(*ast.StmtForeach).OpenParenthesisTkn = yyDollar[2].token + yyDollar[8].node.(*ast.StmtForeach).Expr = yyDollar[3].node + yyDollar[8].node.(*ast.StmtForeach).AsTkn = yyDollar[4].token if yyDollar[6].node == nil { - switch n := yyDollar[8].node.(type) { - case *ast.StmtForeach: - n.Expr = yyDollar[3].node - n.Var = yyDollar[5].node - case *ast.StmtAltForeach: - n.Expr = yyDollar[3].node - n.Var = yyDollar[5].node - } + yyDollar[8].node.(*ast.StmtForeach).Var = yyDollar[5].node } else { - switch n := yyDollar[8].node.(type) { - case *ast.StmtForeach: - n.Expr = yyDollar[3].node - n.Key = yyDollar[5].node - n.Var = yyDollar[6].node - case *ast.StmtAltForeach: - n.Expr = yyDollar[3].node - n.Key = yyDollar[5].node - n.Var = yyDollar[6].node - } + yyDollar[8].node.(*ast.StmtForeach).Key = yyDollar[5].node + yyDollar[8].node.(*ast.StmtForeach).DoubleArrowTkn = yyDollar[6].node.(*ast.StmtForeach).DoubleArrowTkn + yyDollar[8].node.(*ast.StmtForeach).Var = yyDollar[6].node.(*ast.StmtForeach).Var } + yyDollar[8].node.(*ast.StmtForeach).CloseParenthesisTkn = yyDollar[7].token + yyDollar[8].node.(*ast.StmtForeach).Node.Position = position.NewTokenNodePosition(yyDollar[1].token, yyDollar[8].node) - // save position yyVAL.node = yyDollar[8].node - - yyVAL.node.GetNode().Position = position.NewTokenNodePosition(yyDollar[1].token, yyDollar[8].node) - - // save comments - yylex.(*Parser).setFreeFloating(yyVAL.node, token.Start, yyDollar[1].token.SkippedTokens) - yylex.(*Parser).setFreeFloating(yyVAL.node, token.Foreach, yyDollar[2].token.SkippedTokens) - yylex.(*Parser).setFreeFloating(yyVAL.node, token.Expr, yyDollar[4].token.SkippedTokens) - if yyDollar[6].node != nil { - yylex.(*Parser).setFreeFloatingTokens(yyVAL.node, token.Key, yyDollar[6].node.GetNode().Tokens[token.Key]) - delete(yyDollar[6].node.GetNode().Tokens, token.Key) - } - yylex.(*Parser).setFreeFloating(yyVAL.node, token.Var, yyDollar[7].token.SkippedTokens) } case 70: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:1172 + // line internal/php5/php5.y:1132 { yyVAL.node = yyDollar[5].node yyVAL.node.(*ast.StmtDeclare).Consts = yyDollar[3].list @@ -3323,7 +3281,7 @@ yydefault: } case 71: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1185 + // line internal/php5/php5.y:1145 { yyVAL.node = &ast.StmtNop{ast.Node{}} @@ -3336,7 +3294,7 @@ yydefault: } case 72: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php5/php5.y:1196 + // line internal/php5/php5.y:1156 { yyVAL.node = &ast.StmtTry{ast.Node{}, yyDollar[3].list, yyDollar[5].list, yyDollar[6].node} @@ -3354,7 +3312,7 @@ yydefault: } case 73: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1212 + // line internal/php5/php5.y:1172 { yyVAL.node = &ast.StmtThrow{ast.Node{}, yyDollar[2].node} @@ -3368,7 +3326,7 @@ yydefault: } case 74: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1224 + // line internal/php5/php5.y:1184 { label := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} yyVAL.node = &ast.StmtGoto{ast.Node{}, label} @@ -3385,13 +3343,13 @@ yydefault: } case 75: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1242 + // line internal/php5/php5.y:1202 { yyVAL.list = []ast.Vertex{} } case 76: yyDollar = yyS[yypt-9 : yypt+1] - // line internal/php5/php5.y:1246 + // line internal/php5/php5.y:1206 { identifier := &ast.Identifier{ast.Node{}, yyDollar[4].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -3413,13 +3371,13 @@ yydefault: } case 77: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1269 + // line internal/php5/php5.y:1229 { yyVAL.node = nil } case 78: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:1273 + // line internal/php5/php5.y:1233 { yyVAL.node = &ast.StmtFinally{ast.Node{}, yyDollar[3].list} @@ -3433,31 +3391,31 @@ yydefault: } case 79: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1288 + // line internal/php5/php5.y:1248 { yyVAL.list = yyDollar[1].list } case 80: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1292 + // line internal/php5/php5.y:1252 { yyVAL.list = []ast.Vertex{} } case 81: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1299 + // line internal/php5/php5.y:1259 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 82: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1303 + // line internal/php5/php5.y:1263 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 83: yyDollar = yyS[yypt-8 : yypt+1] - // line internal/php5/php5.y:1310 + // line internal/php5/php5.y:1270 { identifier := &ast.Identifier{ast.Node{}, yyDollar[4].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -3478,7 +3436,7 @@ yydefault: } case 84: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1332 + // line internal/php5/php5.y:1292 { yyVAL.node = &ast.StmtUnset{ Vars: []ast.Vertex{yyDollar[1].node}, @@ -3486,7 +3444,7 @@ yydefault: } case 85: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1338 + // line internal/php5/php5.y:1298 { yyDollar[1].node.(*ast.StmtUnset).Vars = append(yyDollar[1].node.(*ast.StmtUnset).Vars, yyDollar[3].node) yyDollar[1].node.(*ast.StmtUnset).SeparatorTkns = append(yyDollar[1].node.(*ast.StmtUnset).SeparatorTkns, yyDollar[2].token) @@ -3495,49 +3453,49 @@ yydefault: } case 86: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1348 + // line internal/php5/php5.y:1308 { yyVAL.node = yyDollar[1].node } case 87: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1355 + // line internal/php5/php5.y:1315 { yyVAL.node = yyDollar[1].node } case 88: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1362 + // line internal/php5/php5.y:1322 { yyVAL.node = yyDollar[1].node } case 89: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1369 + // line internal/php5/php5.y:1329 { yyVAL.token = nil } case 90: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1373 + // line internal/php5/php5.y:1333 { yyVAL.token = yyDollar[1].token } case 91: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1380 + // line internal/php5/php5.y:1340 { yyVAL.token = nil } case 92: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1384 + // line internal/php5/php5.y:1344 { yyVAL.token = yyDollar[1].token } case 93: yyDollar = yyS[yypt-9 : yypt+1] - // line internal/php5/php5.y:1391 + // line internal/php5/php5.y:1351 { name := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} yyVAL.node = &ast.StmtFunction{ast.Node{}, yyDollar[2].token != nil, name, yyDollar[5].list, nil, yyDollar[8].list} @@ -3561,7 +3519,7 @@ yydefault: } case 94: yyDollar = yyS[yypt-7 : yypt+1] - // line internal/php5/php5.y:1416 + // line internal/php5/php5.y:1376 { name := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} switch n := yyDollar[1].node.(type) { @@ -3589,7 +3547,7 @@ yydefault: } case 95: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php5/php5.y:1442 + // line internal/php5/php5.y:1402 { name := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} yyVAL.node = &ast.StmtInterface{ast.Node{}, name, yyDollar[3].InterfaceExtends, yyDollar[5].list} @@ -3606,7 +3564,7 @@ yydefault: } case 96: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1461 + // line internal/php5/php5.y:1421 { yyVAL.node = &ast.StmtClass{ast.Node{}, nil, nil, nil, nil, nil, nil} @@ -3618,7 +3576,7 @@ yydefault: } case 97: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1471 + // line internal/php5/php5.y:1431 { classModifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.StmtClass{ast.Node{}, nil, []ast.Vertex{classModifier}, nil, nil, nil, nil} @@ -3633,7 +3591,7 @@ yydefault: } case 98: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1484 + // line internal/php5/php5.y:1444 { yyVAL.node = &ast.StmtTrait{ast.Node{}, nil, nil} @@ -3645,7 +3603,7 @@ yydefault: } case 99: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1494 + // line internal/php5/php5.y:1454 { classModifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.StmtClass{ast.Node{}, nil, []ast.Vertex{classModifier}, nil, nil, nil, nil} @@ -3660,13 +3618,13 @@ yydefault: } case 100: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1510 + // line internal/php5/php5.y:1470 { yyVAL.ClassExtends = nil } case 101: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1514 + // line internal/php5/php5.y:1474 { yyVAL.ClassExtends = &ast.StmtClassExtends{ast.Node{}, yyDollar[2].node} @@ -3678,19 +3636,19 @@ yydefault: } case 102: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1527 + // line internal/php5/php5.y:1487 { yyVAL.token = yyDollar[1].token } case 103: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1534 + // line internal/php5/php5.y:1494 { yyVAL.InterfaceExtends = nil } case 104: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1538 + // line internal/php5/php5.y:1498 { yyVAL.InterfaceExtends = &ast.StmtInterfaceExtends{ast.Node{}, yyDollar[2].list} @@ -3702,13 +3660,13 @@ yydefault: } case 105: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1551 + // line internal/php5/php5.y:1511 { yyVAL.ClassImplements = nil } case 106: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1555 + // line internal/php5/php5.y:1515 { yyVAL.ClassImplements = &ast.StmtClassImplements{ast.Node{}, yyDollar[2].list} @@ -3720,13 +3678,13 @@ yydefault: } case 107: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1568 + // line internal/php5/php5.y:1528 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 108: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1572 + // line internal/php5/php5.y:1532 { switch n := lastNode(yyDollar[1].list).(type) { case *ast.NameName: @@ -3740,28 +3698,28 @@ yydefault: } case 109: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1584 + // line internal/php5/php5.y:1544 { yyVAL.node = nil } case 110: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1588 + // line internal/php5/php5.y:1548 { - yyVAL.node = yyDollar[2].node - - // save comments - yylex.(*Parser).setFreeFloating(yyVAL.node, token.Key, yyDollar[1].token.SkippedTokens) + yyVAL.node = &ast.StmtForeach{ + DoubleArrowTkn: yyDollar[1].token, + Var: yyDollar[2].node, + } } case 111: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1598 + // line internal/php5/php5.y:1558 { yyVAL.node = yyDollar[1].node } case 112: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1602 + // line internal/php5/php5.y:1562 { yyVAL.node = &ast.ExprReference{ast.Node{}, yyDollar[2].node} @@ -3773,7 +3731,7 @@ yydefault: } case 113: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:1612 + // line internal/php5/php5.y:1572 { yyVAL.node = &ast.ExprList{ast.Node{}, yyDollar[3].list} @@ -3787,7 +3745,7 @@ yydefault: } case 114: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1627 + // line internal/php5/php5.y:1587 { yyVAL.node = &ast.StmtFor{ Node: ast.Node{ @@ -3798,7 +3756,7 @@ yydefault: } case 115: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:1636 + // line internal/php5/php5.y:1596 { yyVAL.node = &ast.StmtFor{ Node: ast.Node{ @@ -3818,37 +3776,38 @@ yydefault: } case 116: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1657 + // line internal/php5/php5.y:1617 { - yyVAL.node = &ast.StmtForeach{ast.Node{}, nil, nil, nil, yyDollar[1].node} - - // save position - yyVAL.node.GetNode().Position = position.NewNodePosition(yyDollar[1].node) + yyVAL.node = &ast.StmtForeach{ + Node: ast.Node{ + Position: position.NewNodePosition(yyDollar[1].node), + }, + Stmt: yyDollar[1].node, + } } case 117: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:1664 + // line internal/php5/php5.y:1626 { - stmtList := &ast.StmtStmtList{ + yyVAL.node = &ast.StmtForeach{ Node: ast.Node{ - Position: position.NewNodeListPosition(yyDollar[2].list), + Position: position.NewTokensPosition(yyDollar[1].token, yyDollar[4].token), }, - Stmts: yyDollar[2].list, + Alt: true, + ColonTkn: yyDollar[1].token, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: position.NewNodeListPosition(yyDollar[2].list), + }, + Stmts: yyDollar[2].list, + }, + EndForeachTkn: yyDollar[3].token, + SemiColonTkn: yyDollar[4].token, } - yyVAL.node = &ast.StmtAltForeach{ast.Node{}, nil, nil, nil, stmtList} - - // save position - yyVAL.node.GetNode().Position = position.NewTokensPosition(yyDollar[1].token, yyDollar[4].token) - - // save comments - yylex.(*Parser).setFreeFloating(yyVAL.node, token.Cond, yyDollar[1].token.SkippedTokens) - yylex.(*Parser).setFreeFloating(yyVAL.node, token.Stmts, yyDollar[3].token.SkippedTokens) - yylex.(*Parser).setFreeFloating(yyVAL.node, token.AltEnd, yyDollar[4].token.SkippedTokens) - yylex.(*Parser).setToken(yyVAL.node, token.SemiColon, yyDollar[4].token.SkippedTokens) } case 118: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1687 + // line internal/php5/php5.y:1648 { yyVAL.node = &ast.StmtDeclare{ast.Node{}, false, nil, yyDollar[1].node} @@ -3857,7 +3816,7 @@ yydefault: } case 119: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:1694 + // line internal/php5/php5.y:1655 { stmtList := &ast.StmtStmtList{ Node: ast.Node{ @@ -3878,7 +3837,7 @@ yydefault: } case 120: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1717 + // line internal/php5/php5.y:1678 { yyVAL.list = []ast.Vertex{ &ast.StmtConstant{ @@ -3900,7 +3859,7 @@ yydefault: } case 121: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:1737 + // line internal/php5/php5.y:1698 { lastNode(yyDollar[1].list).(*ast.StmtConstant).CommaTkn = yyDollar[2].token yyVAL.list = append(yyDollar[1].list, &ast.StmtConstant{ @@ -3921,7 +3880,7 @@ yydefault: } case 122: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1760 + // line internal/php5/php5.y:1721 { yyVAL.node = &ast.StmtSwitch{ Node: ast.Node{ @@ -3934,7 +3893,7 @@ yydefault: } case 123: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:1771 + // line internal/php5/php5.y:1732 { yyVAL.node = &ast.StmtSwitch{ Node: ast.Node{ @@ -3948,7 +3907,7 @@ yydefault: } case 124: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:1783 + // line internal/php5/php5.y:1744 { yyVAL.node = &ast.StmtSwitch{ Node: ast.Node{ @@ -3963,7 +3922,7 @@ yydefault: } case 125: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:1796 + // line internal/php5/php5.y:1757 { yyVAL.node = &ast.StmtSwitch{ Node: ast.Node{ @@ -3979,13 +3938,13 @@ yydefault: } case 126: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1814 + // line internal/php5/php5.y:1775 { yyVAL.list = nil } case 127: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:1818 + // line internal/php5/php5.y:1779 { yyVAL.list = append(yyDollar[1].list, &ast.StmtCase{ Node: ast.Node{ @@ -3999,7 +3958,7 @@ yydefault: } case 128: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:1830 + // line internal/php5/php5.y:1791 { yyVAL.list = append(yyDollar[1].list, &ast.StmtDefault{ Node: ast.Node{ @@ -4012,19 +3971,19 @@ yydefault: } case 129: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1845 + // line internal/php5/php5.y:1806 { yyVAL.token = yyDollar[1].token } case 130: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1849 + // line internal/php5/php5.y:1810 { yyVAL.token = yyDollar[1].token } case 131: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1857 + // line internal/php5/php5.y:1818 { yyVAL.node = &ast.StmtWhile{ Node: ast.Node{ @@ -4035,7 +3994,7 @@ yydefault: } case 132: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:1866 + // line internal/php5/php5.y:1827 { yyVAL.node = &ast.StmtWhile{ Node: ast.Node{ @@ -4055,13 +4014,13 @@ yydefault: } case 133: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1889 + // line internal/php5/php5.y:1850 { yyVAL.list = nil } case 134: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:1893 + // line internal/php5/php5.y:1854 { yyVAL.list = append(yyDollar[1].list, &ast.StmtElseIf{ Node: ast.Node{ @@ -4076,13 +4035,13 @@ yydefault: } case 135: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1910 + // line internal/php5/php5.y:1871 { yyVAL.list = nil } case 136: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:1914 + // line internal/php5/php5.y:1875 { yyVAL.list = append(yyDollar[1].list, &ast.StmtElseIf{ Node: ast.Node{ @@ -4104,13 +4063,13 @@ yydefault: } case 137: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1938 + // line internal/php5/php5.y:1899 { yyVAL.node = nil } case 138: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1942 + // line internal/php5/php5.y:1903 { yyVAL.node = &ast.StmtElse{ Node: ast.Node{ @@ -4122,13 +4081,13 @@ yydefault: } case 139: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1956 + // line internal/php5/php5.y:1917 { yyVAL.node = nil } case 140: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1960 + // line internal/php5/php5.y:1921 { yyVAL.node = &ast.StmtElse{ Node: ast.Node{ @@ -4147,25 +4106,25 @@ yydefault: } case 141: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1981 + // line internal/php5/php5.y:1942 { yyVAL.list = yyDollar[1].list } case 142: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1985 + // line internal/php5/php5.y:1946 { yyVAL.list = nil } case 143: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1992 + // line internal/php5/php5.y:1953 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 144: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1996 + // line internal/php5/php5.y:1957 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4174,7 +4133,7 @@ yydefault: } case 145: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:2006 + // line internal/php5/php5.y:1967 { identifier := &ast.Identifier{ast.Node{}, yyDollar[4].token.Value} identifier.GetNode().Position = position.NewTokenPosition(yyDollar[4].token) @@ -4210,7 +4169,7 @@ yydefault: } case 146: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php5/php5.y:2040 + // line internal/php5/php5.y:2001 { identifier := &ast.Identifier{ast.Node{}, yyDollar[4].token.Value} identifier.GetNode().Position = position.NewTokenPosition(yyDollar[4].token) @@ -4247,13 +4206,13 @@ yydefault: } case 147: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:2079 + // line internal/php5/php5.y:2040 { yyVAL.node = nil } case 148: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2083 + // line internal/php5/php5.y:2044 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -4265,7 +4224,7 @@ yydefault: } case 149: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2093 + // line internal/php5/php5.y:2054 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -4277,13 +4236,13 @@ yydefault: } case 150: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2103 + // line internal/php5/php5.y:2064 { yyVAL.node = yyDollar[1].node } case 151: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2111 + // line internal/php5/php5.y:2072 { yyVAL.node = &ast.ArgumentList{ast.Node{}, nil} @@ -4296,7 +4255,7 @@ yydefault: } case 152: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2122 + // line internal/php5/php5.y:2083 { yyVAL.node = &ast.ArgumentList{ast.Node{}, yyDollar[2].list} @@ -4309,7 +4268,7 @@ yydefault: } case 153: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2133 + // line internal/php5/php5.y:2094 { arg := &ast.Argument{ast.Node{}, false, false, yyDollar[2].node} yyVAL.node = &ast.ArgumentList{ast.Node{}, []ast.Vertex{arg}} @@ -4324,13 +4283,13 @@ yydefault: } case 154: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2150 + // line internal/php5/php5.y:2111 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 155: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2154 + // line internal/php5/php5.y:2115 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4339,7 +4298,7 @@ yydefault: } case 156: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2164 + // line internal/php5/php5.y:2125 { yyVAL.node = &ast.Argument{ast.Node{}, false, false, yyDollar[1].node} @@ -4351,7 +4310,7 @@ yydefault: } case 157: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2174 + // line internal/php5/php5.y:2135 { yyVAL.node = &ast.Argument{ast.Node{}, false, false, yyDollar[1].node} @@ -4363,7 +4322,7 @@ yydefault: } case 158: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2184 + // line internal/php5/php5.y:2145 { yyVAL.node = &ast.Argument{ast.Node{}, false, true, yyDollar[2].node} @@ -4375,7 +4334,7 @@ yydefault: } case 159: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2194 + // line internal/php5/php5.y:2155 { yyVAL.node = &ast.Argument{ast.Node{}, true, false, yyDollar[2].node} @@ -4387,7 +4346,7 @@ yydefault: } case 160: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2207 + // line internal/php5/php5.y:2168 { yyDollar[1].node.(*ast.StmtGlobal).Vars = append(yyDollar[1].node.(*ast.StmtGlobal).Vars, yyDollar[3].node) yyDollar[1].node.(*ast.StmtGlobal).SeparatorTkns = append(yyDollar[1].node.(*ast.StmtGlobal).SeparatorTkns, yyDollar[2].token) @@ -4396,7 +4355,7 @@ yydefault: } case 161: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2214 + // line internal/php5/php5.y:2175 { yyVAL.node = &ast.StmtGlobal{ Vars: []ast.Vertex{yyDollar[1].node}, @@ -4404,7 +4363,7 @@ yydefault: } case 162: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2224 + // line internal/php5/php5.y:2185 { name := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.ExprVariable{ast.Node{}, name} @@ -4418,7 +4377,7 @@ yydefault: } case 163: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2236 + // line internal/php5/php5.y:2197 { yyVAL.node = &ast.ExprVariable{ast.Node{}, yyDollar[2].node} @@ -4430,7 +4389,7 @@ yydefault: } case 164: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:2246 + // line internal/php5/php5.y:2207 { yyVAL.node = &ast.ExprVariable{ast.Node{}, yyDollar[3].node} @@ -4444,7 +4403,7 @@ yydefault: } case 165: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2262 + // line internal/php5/php5.y:2223 { identifier := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -4468,7 +4427,7 @@ yydefault: } case 166: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:2284 + // line internal/php5/php5.y:2245 { identifier := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -4494,7 +4453,7 @@ yydefault: } case 167: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2308 + // line internal/php5/php5.y:2269 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -4519,7 +4478,7 @@ yydefault: } case 168: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2331 + // line internal/php5/php5.y:2292 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -4546,19 +4505,19 @@ yydefault: } case 169: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2360 + // line internal/php5/php5.y:2321 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 170: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:2364 + // line internal/php5/php5.y:2325 { yyVAL.list = []ast.Vertex{} } case 171: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2372 + // line internal/php5/php5.y:2333 { yyVAL.node = &ast.StmtPropertyList{ast.Node{}, yyDollar[1].list, nil, yyDollar[2].list} @@ -4572,7 +4531,7 @@ yydefault: } case 172: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2384 + // line internal/php5/php5.y:2345 { yyDollar[1].node.(*ast.StmtClassConstList).SemiColonTkn = yyDollar[2].token yyDollar[1].node.(*ast.StmtClassConstList).Node.Position = position.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token) @@ -4580,13 +4539,13 @@ yydefault: } case 173: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2390 + // line internal/php5/php5.y:2351 { yyVAL.node = yyDollar[1].node } case 174: yyDollar = yyS[yypt-8 : yypt+1] - // line internal/php5/php5.y:2394 + // line internal/php5/php5.y:2355 { name := &ast.Identifier{ast.Node{}, yyDollar[4].token.Value} yyVAL.node = &ast.StmtClassMethod{ast.Node{}, yyDollar[3].token != nil, name, yyDollar[1].list, yyDollar[6].list, nil, yyDollar[8].node} @@ -4617,7 +4576,7 @@ yydefault: } case 175: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2426 + // line internal/php5/php5.y:2387 { yyVAL.node = &ast.StmtTraitUse{ast.Node{}, yyDollar[2].list, yyDollar[3].node} @@ -4629,13 +4588,13 @@ yydefault: } case 176: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2439 + // line internal/php5/php5.y:2400 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 177: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2443 + // line internal/php5/php5.y:2404 { switch n := lastNode(yyDollar[1].list).(type) { case *ast.NameName: @@ -4649,7 +4608,7 @@ yydefault: } case 178: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2455 + // line internal/php5/php5.y:2416 { yyVAL.node = &ast.StmtNop{ast.Node{}} @@ -4661,7 +4620,7 @@ yydefault: } case 179: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2465 + // line internal/php5/php5.y:2426 { yyVAL.node = &ast.StmtTraitAdaptationList{ast.Node{}, yyDollar[2].list} @@ -4673,31 +4632,31 @@ yydefault: } case 180: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:2478 + // line internal/php5/php5.y:2439 { yyVAL.list = nil } case 181: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2482 + // line internal/php5/php5.y:2443 { yyVAL.list = yyDollar[1].list } case 182: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2489 + // line internal/php5/php5.y:2450 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 183: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2493 + // line internal/php5/php5.y:2454 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 184: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2500 + // line internal/php5/php5.y:2461 { yyVAL.node = yyDollar[1].node @@ -4707,7 +4666,7 @@ yydefault: } case 185: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2508 + // line internal/php5/php5.y:2469 { yyVAL.node = yyDollar[1].node @@ -4717,7 +4676,7 @@ yydefault: } case 186: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2519 + // line internal/php5/php5.y:2480 { yyVAL.node = &ast.StmtTraitUsePrecedence{ast.Node{}, yyDollar[1].node, yyDollar[3].list} @@ -4730,13 +4689,13 @@ yydefault: } case 187: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2533 + // line internal/php5/php5.y:2494 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 188: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2537 + // line internal/php5/php5.y:2498 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4745,7 +4704,7 @@ yydefault: } case 189: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2547 + // line internal/php5/php5.y:2508 { name := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.StmtTraitMethodRef{ast.Node{}, nil, name} @@ -4759,13 +4718,13 @@ yydefault: } case 190: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2559 + // line internal/php5/php5.y:2520 { yyVAL.node = yyDollar[1].node } case 191: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2566 + // line internal/php5/php5.y:2527 { target := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} yyVAL.node = &ast.StmtTraitMethodRef{ast.Node{}, yyDollar[1].node, target} @@ -4781,7 +4740,7 @@ yydefault: } case 192: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:2583 + // line internal/php5/php5.y:2544 { alias := &ast.Identifier{ast.Node{}, yyDollar[4].token.Value} yyVAL.node = &ast.StmtTraitUseAlias{ast.Node{}, yyDollar[1].node, yyDollar[3].node, alias} @@ -4797,7 +4756,7 @@ yydefault: } case 193: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2597 + // line internal/php5/php5.y:2558 { yyVAL.node = &ast.StmtTraitUseAlias{ast.Node{}, yyDollar[1].node, yyDollar[3].node, nil} @@ -4810,19 +4769,19 @@ yydefault: } case 194: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:2611 + // line internal/php5/php5.y:2572 { yyVAL.node = nil } case 195: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2615 + // line internal/php5/php5.y:2576 { yyVAL.node = yyDollar[1].node } case 196: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2622 + // line internal/php5/php5.y:2583 { yyVAL.node = &ast.StmtNop{ast.Node{}} @@ -4835,7 +4794,7 @@ yydefault: } case 197: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2633 + // line internal/php5/php5.y:2594 { yyVAL.node = &ast.StmtStmtList{ Node: ast.Node{ @@ -4848,13 +4807,13 @@ yydefault: } case 198: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2647 + // line internal/php5/php5.y:2608 { yyVAL.list = yyDollar[1].list } case 199: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2651 + // line internal/php5/php5.y:2612 { modifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.list = []ast.Vertex{modifier} @@ -4867,31 +4826,31 @@ yydefault: } case 200: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:2665 + // line internal/php5/php5.y:2626 { yyVAL.list = nil } case 201: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2669 + // line internal/php5/php5.y:2630 { yyVAL.list = yyDollar[1].list } case 202: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2676 + // line internal/php5/php5.y:2637 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 203: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2680 + // line internal/php5/php5.y:2641 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 204: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2687 + // line internal/php5/php5.y:2648 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -4903,7 +4862,7 @@ yydefault: } case 205: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2697 + // line internal/php5/php5.y:2658 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -4915,7 +4874,7 @@ yydefault: } case 206: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2707 + // line internal/php5/php5.y:2668 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -4927,7 +4886,7 @@ yydefault: } case 207: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2717 + // line internal/php5/php5.y:2678 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -4939,7 +4898,7 @@ yydefault: } case 208: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2727 + // line internal/php5/php5.y:2688 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -4951,7 +4910,7 @@ yydefault: } case 209: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2737 + // line internal/php5/php5.y:2698 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -4963,7 +4922,7 @@ yydefault: } case 210: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2750 + // line internal/php5/php5.y:2711 { identifier := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -4981,7 +4940,7 @@ yydefault: } case 211: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:2766 + // line internal/php5/php5.y:2727 { identifier := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -5000,7 +4959,7 @@ yydefault: } case 212: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2783 + // line internal/php5/php5.y:2744 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -5017,7 +4976,7 @@ yydefault: } case 213: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2798 + // line internal/php5/php5.y:2759 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -5035,7 +4994,7 @@ yydefault: } case 214: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:2817 + // line internal/php5/php5.y:2778 { constList := yyDollar[1].node.(*ast.StmtClassConstList) constList.Node.Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[5].node) @@ -5060,7 +5019,7 @@ yydefault: } case 215: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:2840 + // line internal/php5/php5.y:2801 { yyVAL.node = &ast.StmtClassConstList{ Node: ast.Node{ @@ -5088,7 +5047,7 @@ yydefault: } case 216: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2869 + // line internal/php5/php5.y:2830 { yyDollar[1].node.(*ast.StmtEcho).Exprs = append(yyDollar[1].node.(*ast.StmtEcho).Exprs, yyDollar[3].node) yyDollar[1].node.(*ast.StmtEcho).SeparatorTkns = append(yyDollar[1].node.(*ast.StmtEcho).SeparatorTkns, yyDollar[2].token) @@ -5097,7 +5056,7 @@ yydefault: } case 217: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2876 + // line internal/php5/php5.y:2837 { yyVAL.node = &ast.StmtEcho{ Exprs: []ast.Vertex{yyDollar[1].node}, @@ -5105,19 +5064,19 @@ yydefault: } case 218: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:2886 + // line internal/php5/php5.y:2847 { yyVAL.list = nil } case 219: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2890 + // line internal/php5/php5.y:2851 { yyVAL.list = yyDollar[1].list } case 220: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2897 + // line internal/php5/php5.y:2858 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5126,25 +5085,25 @@ yydefault: } case 221: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2904 + // line internal/php5/php5.y:2865 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 222: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2911 + // line internal/php5/php5.y:2872 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 223: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2915 + // line internal/php5/php5.y:2876 { yyVAL.list = yyDollar[1].list } case 224: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:2922 + // line internal/php5/php5.y:2883 { fetch := &ast.ExprArrayDimFetch{ast.Node{}, nil, yyDollar[3].node} yyVAL.list = append(yyDollar[1].list, fetch) @@ -5158,7 +5117,7 @@ yydefault: } case 225: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2934 + // line internal/php5/php5.y:2895 { fetch := &ast.ExprArrayDimFetch{ast.Node{}, nil, yyDollar[2].node} yyVAL.list = []ast.Vertex{fetch} @@ -5172,37 +5131,37 @@ yydefault: } case 226: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2949 + // line internal/php5/php5.y:2910 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 227: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2953 + // line internal/php5/php5.y:2914 { yyVAL.list = yyDollar[1].list } case 228: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2957 + // line internal/php5/php5.y:2918 { yyVAL.list = yyDollar[1].list } case 229: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:2964 + // line internal/php5/php5.y:2925 { yyVAL.list = nil } case 230: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2968 + // line internal/php5/php5.y:2929 { yyVAL.list = yyDollar[1].list } case 231: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2975 + // line internal/php5/php5.y:2936 { if yyDollar[3].node != nil { @@ -5218,7 +5177,7 @@ yydefault: } case 232: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php5/php5.y:2992 + // line internal/php5/php5.y:2953 { listNode := &ast.ExprList{ast.Node{}, yyDollar[3].list} yyVAL.node = &ast.ExprAssign{ast.Node{}, listNode, yyDollar[6].node} @@ -5235,7 +5194,7 @@ yydefault: } case 233: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3007 + // line internal/php5/php5.y:2968 { yyVAL.node = &ast.ExprAssign{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5248,7 +5207,7 @@ yydefault: } case 234: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:3018 + // line internal/php5/php5.y:2979 { yyVAL.node = &ast.ExprAssignReference{ast.Node{}, yyDollar[1].node, yyDollar[4].node} @@ -5262,7 +5221,7 @@ yydefault: } case 235: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php5/php5.y:3030 + // line internal/php5/php5.y:2991 { var _new *ast.ExprNew @@ -5289,7 +5248,7 @@ yydefault: } case 236: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3055 + // line internal/php5/php5.y:3016 { yyVAL.node = &ast.ExprClone{ast.Node{}, yyDollar[2].node} @@ -5301,7 +5260,7 @@ yydefault: } case 237: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3065 + // line internal/php5/php5.y:3026 { yyVAL.node = &ast.ExprAssignPlus{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5313,7 +5272,7 @@ yydefault: } case 238: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3075 + // line internal/php5/php5.y:3036 { yyVAL.node = &ast.ExprAssignMinus{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5326,7 +5285,7 @@ yydefault: } case 239: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3086 + // line internal/php5/php5.y:3047 { yyVAL.node = &ast.ExprAssignMul{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5339,7 +5298,7 @@ yydefault: } case 240: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3097 + // line internal/php5/php5.y:3058 { yyVAL.node = &ast.ExprAssignPow{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5352,7 +5311,7 @@ yydefault: } case 241: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3108 + // line internal/php5/php5.y:3069 { yyVAL.node = &ast.ExprAssignDiv{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5365,7 +5324,7 @@ yydefault: } case 242: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3119 + // line internal/php5/php5.y:3080 { yyVAL.node = &ast.ExprAssignConcat{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5378,7 +5337,7 @@ yydefault: } case 243: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3130 + // line internal/php5/php5.y:3091 { yyVAL.node = &ast.ExprAssignMod{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5391,7 +5350,7 @@ yydefault: } case 244: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3141 + // line internal/php5/php5.y:3102 { yyVAL.node = &ast.ExprAssignBitwiseAnd{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5404,7 +5363,7 @@ yydefault: } case 245: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3152 + // line internal/php5/php5.y:3113 { yyVAL.node = &ast.ExprAssignBitwiseOr{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5417,7 +5376,7 @@ yydefault: } case 246: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3163 + // line internal/php5/php5.y:3124 { yyVAL.node = &ast.ExprAssignBitwiseXor{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5430,7 +5389,7 @@ yydefault: } case 247: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3174 + // line internal/php5/php5.y:3135 { yyVAL.node = &ast.ExprAssignShiftLeft{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5443,7 +5402,7 @@ yydefault: } case 248: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3185 + // line internal/php5/php5.y:3146 { yyVAL.node = &ast.ExprAssignShiftRight{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5456,7 +5415,7 @@ yydefault: } case 249: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3196 + // line internal/php5/php5.y:3157 { yyVAL.node = &ast.ExprPostInc{ast.Node{}, yyDollar[1].node} @@ -5469,7 +5428,7 @@ yydefault: } case 250: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3207 + // line internal/php5/php5.y:3168 { yyVAL.node = &ast.ExprPreInc{ast.Node{}, yyDollar[2].node} @@ -5481,7 +5440,7 @@ yydefault: } case 251: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3217 + // line internal/php5/php5.y:3178 { yyVAL.node = &ast.ExprPostDec{ast.Node{}, yyDollar[1].node} @@ -5494,7 +5453,7 @@ yydefault: } case 252: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3228 + // line internal/php5/php5.y:3189 { yyVAL.node = &ast.ExprPreDec{ast.Node{}, yyDollar[2].node} @@ -5506,7 +5465,7 @@ yydefault: } case 253: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3238 + // line internal/php5/php5.y:3199 { yyVAL.node = &ast.ExprBinaryBooleanOr{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5519,7 +5478,7 @@ yydefault: } case 254: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3249 + // line internal/php5/php5.y:3210 { yyVAL.node = &ast.ExprBinaryBooleanAnd{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5532,7 +5491,7 @@ yydefault: } case 255: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3260 + // line internal/php5/php5.y:3221 { yyVAL.node = &ast.ExprBinaryLogicalOr{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5545,7 +5504,7 @@ yydefault: } case 256: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3271 + // line internal/php5/php5.y:3232 { yyVAL.node = &ast.ExprBinaryLogicalAnd{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5558,7 +5517,7 @@ yydefault: } case 257: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3282 + // line internal/php5/php5.y:3243 { yyVAL.node = &ast.ExprBinaryLogicalXor{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5571,7 +5530,7 @@ yydefault: } case 258: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3293 + // line internal/php5/php5.y:3254 { yyVAL.node = &ast.ExprBinaryBitwiseOr{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5584,7 +5543,7 @@ yydefault: } case 259: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3304 + // line internal/php5/php5.y:3265 { yyVAL.node = &ast.ExprBinaryBitwiseAnd{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5597,7 +5556,7 @@ yydefault: } case 260: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3315 + // line internal/php5/php5.y:3276 { yyVAL.node = &ast.ExprBinaryBitwiseXor{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5610,7 +5569,7 @@ yydefault: } case 261: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3326 + // line internal/php5/php5.y:3287 { yyVAL.node = &ast.ExprBinaryConcat{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5622,7 +5581,7 @@ yydefault: } case 262: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3336 + // line internal/php5/php5.y:3297 { yyVAL.node = &ast.ExprBinaryPlus{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5635,7 +5594,7 @@ yydefault: } case 263: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3347 + // line internal/php5/php5.y:3308 { yyVAL.node = &ast.ExprBinaryMinus{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5648,7 +5607,7 @@ yydefault: } case 264: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3358 + // line internal/php5/php5.y:3319 { yyVAL.node = &ast.ExprBinaryMul{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5661,7 +5620,7 @@ yydefault: } case 265: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3369 + // line internal/php5/php5.y:3330 { yyVAL.node = &ast.ExprBinaryPow{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5674,7 +5633,7 @@ yydefault: } case 266: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3380 + // line internal/php5/php5.y:3341 { yyVAL.node = &ast.ExprBinaryDiv{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5687,7 +5646,7 @@ yydefault: } case 267: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3391 + // line internal/php5/php5.y:3352 { yyVAL.node = &ast.ExprBinaryMod{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5700,7 +5659,7 @@ yydefault: } case 268: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3402 + // line internal/php5/php5.y:3363 { yyVAL.node = &ast.ExprBinaryShiftLeft{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5713,7 +5672,7 @@ yydefault: } case 269: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3413 + // line internal/php5/php5.y:3374 { yyVAL.node = &ast.ExprBinaryShiftRight{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5726,7 +5685,7 @@ yydefault: } case 270: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3424 + // line internal/php5/php5.y:3385 { yyVAL.node = &ast.ExprUnaryPlus{ast.Node{}, yyDollar[2].node} @@ -5738,7 +5697,7 @@ yydefault: } case 271: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3434 + // line internal/php5/php5.y:3395 { yyVAL.node = &ast.ExprUnaryMinus{ast.Node{}, yyDollar[2].node} @@ -5750,7 +5709,7 @@ yydefault: } case 272: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3444 + // line internal/php5/php5.y:3405 { yyVAL.node = &ast.ExprBooleanNot{ast.Node{}, yyDollar[2].node} @@ -5762,7 +5721,7 @@ yydefault: } case 273: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3454 + // line internal/php5/php5.y:3415 { yyVAL.node = &ast.ExprBitwiseNot{ast.Node{}, yyDollar[2].node} @@ -5774,7 +5733,7 @@ yydefault: } case 274: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3464 + // line internal/php5/php5.y:3425 { yyVAL.node = &ast.ExprBinaryIdentical{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5787,7 +5746,7 @@ yydefault: } case 275: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3475 + // line internal/php5/php5.y:3436 { yyVAL.node = &ast.ExprBinaryNotIdentical{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5800,7 +5759,7 @@ yydefault: } case 276: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3486 + // line internal/php5/php5.y:3447 { yyVAL.node = &ast.ExprBinaryEqual{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5813,7 +5772,7 @@ yydefault: } case 277: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3497 + // line internal/php5/php5.y:3458 { yyVAL.node = &ast.ExprBinaryNotEqual{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5827,7 +5786,7 @@ yydefault: } case 278: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3509 + // line internal/php5/php5.y:3470 { yyVAL.node = &ast.ExprBinarySmaller{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5840,7 +5799,7 @@ yydefault: } case 279: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3520 + // line internal/php5/php5.y:3481 { yyVAL.node = &ast.ExprBinarySmallerOrEqual{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5853,7 +5812,7 @@ yydefault: } case 280: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3531 + // line internal/php5/php5.y:3492 { yyVAL.node = &ast.ExprBinaryGreater{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5866,7 +5825,7 @@ yydefault: } case 281: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3542 + // line internal/php5/php5.y:3503 { yyVAL.node = &ast.ExprBinaryGreaterOrEqual{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5879,7 +5838,7 @@ yydefault: } case 282: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3553 + // line internal/php5/php5.y:3514 { yyVAL.node = &ast.ExprInstanceOf{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5892,19 +5851,19 @@ yydefault: } case 283: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3564 + // line internal/php5/php5.y:3525 { yyVAL.node = yyDollar[1].node } case 284: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3568 + // line internal/php5/php5.y:3529 { yyVAL.node = yyDollar[1].node } case 285: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:3572 + // line internal/php5/php5.y:3533 { yyVAL.node = yyDollar[2].node @@ -5936,7 +5895,7 @@ yydefault: } case 286: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:3602 + // line internal/php5/php5.y:3563 { yyVAL.node = &ast.ExprTernary{ast.Node{}, yyDollar[1].node, yyDollar[3].node, yyDollar[5].node} @@ -5950,7 +5909,7 @@ yydefault: } case 287: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:3614 + // line internal/php5/php5.y:3575 { yyVAL.node = &ast.ExprTernary{ast.Node{}, yyDollar[1].node, nil, yyDollar[4].node} @@ -5964,13 +5923,13 @@ yydefault: } case 288: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3626 + // line internal/php5/php5.y:3587 { yyVAL.node = yyDollar[1].node } case 289: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3630 + // line internal/php5/php5.y:3591 { yyVAL.node = &ast.ExprCastInt{ast.Node{}, yyDollar[2].node} @@ -5983,7 +5942,7 @@ yydefault: } case 290: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3641 + // line internal/php5/php5.y:3602 { yyVAL.node = &ast.ExprCastDouble{ast.Node{}, yyDollar[2].node} @@ -5996,7 +5955,7 @@ yydefault: } case 291: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3652 + // line internal/php5/php5.y:3613 { yyVAL.node = &ast.ExprCastString{ast.Node{}, yyDollar[2].node} @@ -6009,7 +5968,7 @@ yydefault: } case 292: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3663 + // line internal/php5/php5.y:3624 { yyVAL.node = &ast.ExprCastArray{ast.Node{}, yyDollar[2].node} @@ -6022,7 +5981,7 @@ yydefault: } case 293: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3674 + // line internal/php5/php5.y:3635 { yyVAL.node = &ast.ExprCastObject{ast.Node{}, yyDollar[2].node} @@ -6035,7 +5994,7 @@ yydefault: } case 294: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3685 + // line internal/php5/php5.y:3646 { yyVAL.node = &ast.ExprCastBool{ast.Node{}, yyDollar[2].node} @@ -6048,7 +6007,7 @@ yydefault: } case 295: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3696 + // line internal/php5/php5.y:3657 { yyVAL.node = &ast.ExprCastUnset{ast.Node{}, yyDollar[2].node} @@ -6061,7 +6020,7 @@ yydefault: } case 296: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3707 + // line internal/php5/php5.y:3668 { yyVAL.node = &ast.ExprExit{ast.Node{}, false, yyDollar[2].node} @@ -6081,7 +6040,7 @@ yydefault: } case 297: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3725 + // line internal/php5/php5.y:3686 { yyVAL.node = &ast.ExprErrorSuppress{ast.Node{}, yyDollar[2].node} @@ -6093,25 +6052,25 @@ yydefault: } case 298: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3735 + // line internal/php5/php5.y:3696 { yyVAL.node = yyDollar[1].node } case 299: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3739 + // line internal/php5/php5.y:3700 { yyVAL.node = yyDollar[1].node } case 300: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3743 + // line internal/php5/php5.y:3704 { yyVAL.node = yyDollar[1].node } case 301: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3747 + // line internal/php5/php5.y:3708 { yyVAL.node = &ast.ExprShellExec{ast.Node{}, yyDollar[2].list} @@ -6123,7 +6082,7 @@ yydefault: } case 302: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3757 + // line internal/php5/php5.y:3718 { yyVAL.node = &ast.ExprPrint{ast.Node{}, yyDollar[2].node} @@ -6135,7 +6094,7 @@ yydefault: } case 303: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3767 + // line internal/php5/php5.y:3728 { yyVAL.node = &ast.ExprYield{ast.Node{}, nil, nil} @@ -6147,7 +6106,7 @@ yydefault: } case 304: yyDollar = yyS[yypt-9 : yypt+1] - // line internal/php5/php5.y:3777 + // line internal/php5/php5.y:3738 { yyVAL.node = &ast.ExprClosure{ast.Node{}, yyDollar[2].token != nil, false, yyDollar[4].list, yyDollar[6].ClosureUse, nil, yyDollar[8].list} @@ -6174,7 +6133,7 @@ yydefault: } case 305: yyDollar = yyS[yypt-10 : yypt+1] - // line internal/php5/php5.y:3801 + // line internal/php5/php5.y:3762 { yyVAL.node = &ast.ExprClosure{ast.Node{}, yyDollar[3].token != nil, true, yyDollar[5].list, yyDollar[7].ClosureUse, nil, yyDollar[9].list} @@ -6202,7 +6161,7 @@ yydefault: } case 306: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3829 + // line internal/php5/php5.y:3790 { yyVAL.node = &ast.ExprYield{ast.Node{}, nil, yyDollar[2].node} @@ -6214,7 +6173,7 @@ yydefault: } case 307: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3839 + // line internal/php5/php5.y:3800 { yyVAL.node = &ast.ExprYield{ast.Node{}, nil, yyDollar[2].node} @@ -6226,7 +6185,7 @@ yydefault: } case 308: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:3849 + // line internal/php5/php5.y:3810 { yyVAL.node = &ast.ExprYield{ast.Node{}, yyDollar[2].node, yyDollar[4].node} @@ -6239,7 +6198,7 @@ yydefault: } case 309: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:3860 + // line internal/php5/php5.y:3821 { yyVAL.node = &ast.ExprYield{ast.Node{}, yyDollar[2].node, yyDollar[4].node} @@ -6252,7 +6211,7 @@ yydefault: } case 310: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:3874 + // line internal/php5/php5.y:3835 { yyVAL.node = &ast.ExprArrayDimFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6265,7 +6224,7 @@ yydefault: } case 311: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:3885 + // line internal/php5/php5.y:3846 { yyVAL.node = &ast.ExprArrayDimFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6278,7 +6237,7 @@ yydefault: } case 312: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:3896 + // line internal/php5/php5.y:3857 { str := &ast.ScalarString{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.ExprArrayDimFetch{ast.Node{}, str, yyDollar[3].node} @@ -6294,7 +6253,7 @@ yydefault: } case 313: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:3910 + // line internal/php5/php5.y:3871 { yyVAL.node = &ast.ExprArrayDimFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6307,7 +6266,7 @@ yydefault: } case 314: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:3924 + // line internal/php5/php5.y:3885 { yyVAL.node = &ast.ExprArray{ast.Node{}, yyDollar[3].list} @@ -6321,7 +6280,7 @@ yydefault: } case 315: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3936 + // line internal/php5/php5.y:3897 { yyVAL.node = &ast.ExprShortArray{ast.Node{}, yyDollar[2].list} @@ -6334,19 +6293,19 @@ yydefault: } case 316: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3950 + // line internal/php5/php5.y:3911 { yyVAL.token = yyDollar[1].token } case 317: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:3957 + // line internal/php5/php5.y:3918 { yyVAL.ClosureUse = nil } case 318: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:3961 + // line internal/php5/php5.y:3922 { yyVAL.ClosureUse = &ast.ExprClosureUse{ast.Node{}, yyDollar[3].list} @@ -6360,7 +6319,7 @@ yydefault: } case 319: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3976 + // line internal/php5/php5.y:3937 { identifier := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -6376,7 +6335,7 @@ yydefault: } case 320: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:3990 + // line internal/php5/php5.y:3951 { identifier := &ast.Identifier{ast.Node{}, yyDollar[4].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -6395,7 +6354,7 @@ yydefault: } case 321: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4007 + // line internal/php5/php5.y:3968 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -6410,7 +6369,7 @@ yydefault: } case 322: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4020 + // line internal/php5/php5.y:3981 { identifier := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -6428,7 +6387,7 @@ yydefault: } case 323: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4039 + // line internal/php5/php5.y:4000 { name := &ast.NameName{ Node: ast.Node{ @@ -6443,7 +6402,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4052 + // line internal/php5/php5.y:4013 { name := &ast.NameRelative{ Node: ast.Node{ @@ -6460,7 +6419,7 @@ yydefault: } case 325: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4067 + // line internal/php5/php5.y:4028 { name := &ast.NameFullyQualified{ Node: ast.Node{ @@ -6476,7 +6435,7 @@ yydefault: } case 326: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4081 + // line internal/php5/php5.y:4042 { yyVAL.node = &ast.ExprStaticCall{ast.Node{}, yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*ast.ArgumentList)} @@ -6489,7 +6448,7 @@ yydefault: } case 327: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4092 + // line internal/php5/php5.y:4053 { yyVAL.node = &ast.ExprStaticCall{ast.Node{}, yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*ast.ArgumentList)} @@ -6502,7 +6461,7 @@ yydefault: } case 328: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4103 + // line internal/php5/php5.y:4064 { yyVAL.node = &ast.ExprStaticCall{ast.Node{}, yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*ast.ArgumentList)} @@ -6515,7 +6474,7 @@ yydefault: } case 329: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4114 + // line internal/php5/php5.y:4075 { yyVAL.node = &ast.ExprStaticCall{ast.Node{}, yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*ast.ArgumentList)} @@ -6528,7 +6487,7 @@ yydefault: } case 330: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4125 + // line internal/php5/php5.y:4086 { yyVAL.node = &ast.ExprFunctionCall{ast.Node{}, yyDollar[1].node, yyDollar[2].node.(*ast.ArgumentList)} @@ -6540,7 +6499,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4138 + // line internal/php5/php5.y:4099 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -6552,7 +6511,7 @@ yydefault: } case 332: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4148 + // line internal/php5/php5.y:4109 { yyVAL.node = &ast.NameName{ Node: ast.Node{ @@ -6563,7 +6522,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4157 + // line internal/php5/php5.y:4118 { yyVAL.node = &ast.NameRelative{ Node: ast.Node{ @@ -6576,7 +6535,7 @@ yydefault: } case 334: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4168 + // line internal/php5/php5.y:4129 { yyVAL.node = &ast.NameFullyQualified{ Node: ast.Node{ @@ -6588,7 +6547,7 @@ yydefault: } case 335: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4181 + // line internal/php5/php5.y:4142 { yyVAL.node = &ast.NameName{ Node: ast.Node{ @@ -6599,7 +6558,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4190 + // line internal/php5/php5.y:4151 { yyVAL.node = &ast.NameRelative{ Node: ast.Node{ @@ -6612,7 +6571,7 @@ yydefault: } case 337: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4201 + // line internal/php5/php5.y:4162 { yyVAL.node = &ast.NameFullyQualified{ Node: ast.Node{ @@ -6624,19 +6583,19 @@ yydefault: } case 338: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4214 + // line internal/php5/php5.y:4175 { yyVAL.node = yyDollar[1].node } case 339: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4218 + // line internal/php5/php5.y:4179 { yyVAL.node = yyDollar[1].node } case 340: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4225 + // line internal/php5/php5.y:4186 { yyVAL.node = yyDollar[1].node @@ -6677,25 +6636,25 @@ yydefault: } case 341: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4264 + // line internal/php5/php5.y:4225 { yyVAL.node = yyDollar[1].node } case 342: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4272 + // line internal/php5/php5.y:4233 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 343: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:4276 + // line internal/php5/php5.y:4237 { yyVAL.list = []ast.Vertex{} } case 344: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4284 + // line internal/php5/php5.y:4245 { yyVAL.list = yyDollar[2].list @@ -6704,13 +6663,13 @@ yydefault: } case 345: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:4294 + // line internal/php5/php5.y:4255 { yyVAL.node = nil } case 346: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4298 + // line internal/php5/php5.y:4259 { yyVAL.node = &ast.ParserBrackets{ Node: ast.Node{ @@ -6726,19 +6685,19 @@ yydefault: } case 347: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4312 + // line internal/php5/php5.y:4273 { yyVAL.node = yyDollar[1].node } case 348: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:4319 + // line internal/php5/php5.y:4280 { yyVAL.list = []ast.Vertex{} } case 349: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4323 + // line internal/php5/php5.y:4284 { part := &ast.ScalarEncapsedStringPart{ast.Node{}, yyDollar[1].token.Value} yyVAL.list = []ast.Vertex{part} @@ -6748,25 +6707,25 @@ yydefault: } case 350: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4331 + // line internal/php5/php5.y:4292 { yyVAL.list = yyDollar[1].list } case 351: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:4338 + // line internal/php5/php5.y:4299 { yyVAL.node = nil } case 352: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4342 + // line internal/php5/php5.y:4303 { yyVAL.node = yyDollar[1].node } case 353: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4349 + // line internal/php5/php5.y:4310 { yyVAL.node = &ast.ScalarLnumber{ast.Node{}, yyDollar[1].token.Value} @@ -6778,7 +6737,7 @@ yydefault: } case 354: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4359 + // line internal/php5/php5.y:4320 { yyVAL.node = &ast.ScalarDnumber{ast.Node{}, yyDollar[1].token.Value} @@ -6790,7 +6749,7 @@ yydefault: } case 355: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4369 + // line internal/php5/php5.y:4330 { yyVAL.node = &ast.ScalarString{ast.Node{}, yyDollar[1].token.Value} @@ -6802,7 +6761,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4379 + // line internal/php5/php5.y:4340 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -6814,7 +6773,7 @@ yydefault: } case 357: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4389 + // line internal/php5/php5.y:4350 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -6826,7 +6785,7 @@ yydefault: } case 358: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4399 + // line internal/php5/php5.y:4360 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -6838,7 +6797,7 @@ yydefault: } case 359: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4409 + // line internal/php5/php5.y:4370 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -6850,7 +6809,7 @@ yydefault: } case 360: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4419 + // line internal/php5/php5.y:4380 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -6862,7 +6821,7 @@ yydefault: } case 361: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4429 + // line internal/php5/php5.y:4390 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -6874,7 +6833,7 @@ yydefault: } case 362: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4439 + // line internal/php5/php5.y:4400 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -6886,7 +6845,7 @@ yydefault: } case 363: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4449 + // line internal/php5/php5.y:4410 { encapsed := &ast.ScalarEncapsedStringPart{ast.Node{}, yyDollar[2].token.Value} yyVAL.node = &ast.ScalarHeredoc{ast.Node{}, yyDollar[1].token.Value, []ast.Vertex{encapsed}} @@ -6900,7 +6859,7 @@ yydefault: } case 364: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4461 + // line internal/php5/php5.y:4422 { yyVAL.node = &ast.ScalarHeredoc{ast.Node{}, yyDollar[1].token.Value, nil} @@ -6912,7 +6871,7 @@ yydefault: } case 365: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4474 + // line internal/php5/php5.y:4435 { target := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} yyVAL.node = &ast.ExprClassConstFetch{ast.Node{}, yyDollar[1].node, target} @@ -6928,25 +6887,25 @@ yydefault: } case 366: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4491 + // line internal/php5/php5.y:4452 { yyVAL.node = yyDollar[1].node } case 367: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4498 + // line internal/php5/php5.y:4459 { yyVAL.node = yyDollar[1].node } case 368: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4502 + // line internal/php5/php5.y:4463 { yyVAL.node = yyDollar[1].node } case 369: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4506 + // line internal/php5/php5.y:4467 { name := &ast.NameName{ Node: ast.Node{ @@ -6961,7 +6920,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4519 + // line internal/php5/php5.y:4480 { name := &ast.NameRelative{ Node: ast.Node{ @@ -6978,7 +6937,7 @@ yydefault: } case 371: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4534 + // line internal/php5/php5.y:4495 { name := &ast.NameFullyQualified{ Node: ast.Node{ @@ -6994,7 +6953,7 @@ yydefault: } case 372: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4548 + // line internal/php5/php5.y:4509 { yyVAL.node = &ast.ExprArray{ast.Node{}, yyDollar[3].list} @@ -7008,7 +6967,7 @@ yydefault: } case 373: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4560 + // line internal/php5/php5.y:4521 { yyVAL.node = &ast.ExprShortArray{ast.Node{}, yyDollar[2].list} @@ -7021,13 +6980,13 @@ yydefault: } case 374: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4571 + // line internal/php5/php5.y:4532 { yyVAL.node = yyDollar[1].node } case 375: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4575 + // line internal/php5/php5.y:4536 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -7039,13 +6998,13 @@ yydefault: } case 376: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4585 + // line internal/php5/php5.y:4546 { yyVAL.node = yyDollar[1].node } case 377: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4592 + // line internal/php5/php5.y:4553 { yyVAL.node = &ast.ExprArrayDimFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7058,7 +7017,7 @@ yydefault: } case 378: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4603 + // line internal/php5/php5.y:4564 { yyVAL.node = &ast.ExprBinaryPlus{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7071,7 +7030,7 @@ yydefault: } case 379: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4614 + // line internal/php5/php5.y:4575 { yyVAL.node = &ast.ExprBinaryMinus{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7084,7 +7043,7 @@ yydefault: } case 380: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4625 + // line internal/php5/php5.y:4586 { yyVAL.node = &ast.ExprBinaryMul{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7097,7 +7056,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4636 + // line internal/php5/php5.y:4597 { yyVAL.node = &ast.ExprBinaryPow{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7110,7 +7069,7 @@ yydefault: } case 382: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4647 + // line internal/php5/php5.y:4608 { yyVAL.node = &ast.ExprBinaryDiv{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7123,7 +7082,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4658 + // line internal/php5/php5.y:4619 { yyVAL.node = &ast.ExprBinaryMod{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7136,7 +7095,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4669 + // line internal/php5/php5.y:4630 { yyVAL.node = &ast.ExprBooleanNot{ast.Node{}, yyDollar[2].node} @@ -7148,7 +7107,7 @@ yydefault: } case 385: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4679 + // line internal/php5/php5.y:4640 { yyVAL.node = &ast.ExprBitwiseNot{ast.Node{}, yyDollar[2].node} @@ -7160,7 +7119,7 @@ yydefault: } case 386: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4689 + // line internal/php5/php5.y:4650 { yyVAL.node = &ast.ExprBinaryBitwiseOr{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7173,7 +7132,7 @@ yydefault: } case 387: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4700 + // line internal/php5/php5.y:4661 { yyVAL.node = &ast.ExprBinaryBitwiseAnd{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7186,7 +7145,7 @@ yydefault: } case 388: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4711 + // line internal/php5/php5.y:4672 { yyVAL.node = &ast.ExprBinaryBitwiseXor{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7199,7 +7158,7 @@ yydefault: } case 389: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4722 + // line internal/php5/php5.y:4683 { yyVAL.node = &ast.ExprBinaryShiftLeft{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7212,7 +7171,7 @@ yydefault: } case 390: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4733 + // line internal/php5/php5.y:4694 { yyVAL.node = &ast.ExprBinaryShiftRight{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7225,7 +7184,7 @@ yydefault: } case 391: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4744 + // line internal/php5/php5.y:4705 { yyVAL.node = &ast.ExprBinaryConcat{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7238,7 +7197,7 @@ yydefault: } case 392: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4755 + // line internal/php5/php5.y:4716 { yyVAL.node = &ast.ExprBinaryLogicalXor{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7251,7 +7210,7 @@ yydefault: } case 393: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4766 + // line internal/php5/php5.y:4727 { yyVAL.node = &ast.ExprBinaryLogicalAnd{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7264,7 +7223,7 @@ yydefault: } case 394: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4777 + // line internal/php5/php5.y:4738 { yyVAL.node = &ast.ExprBinaryLogicalOr{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7277,7 +7236,7 @@ yydefault: } case 395: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4788 + // line internal/php5/php5.y:4749 { yyVAL.node = &ast.ExprBinaryBooleanAnd{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7290,7 +7249,7 @@ yydefault: } case 396: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4799 + // line internal/php5/php5.y:4760 { yyVAL.node = &ast.ExprBinaryBooleanOr{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7303,7 +7262,7 @@ yydefault: } case 397: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4810 + // line internal/php5/php5.y:4771 { yyVAL.node = &ast.ExprBinaryIdentical{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7316,7 +7275,7 @@ yydefault: } case 398: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4821 + // line internal/php5/php5.y:4782 { yyVAL.node = &ast.ExprBinaryNotIdentical{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7329,7 +7288,7 @@ yydefault: } case 399: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4832 + // line internal/php5/php5.y:4793 { yyVAL.node = &ast.ExprBinaryEqual{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7342,7 +7301,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4843 + // line internal/php5/php5.y:4804 { yyVAL.node = &ast.ExprBinaryNotEqual{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7356,7 +7315,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4855 + // line internal/php5/php5.y:4816 { yyVAL.node = &ast.ExprBinarySmaller{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7369,7 +7328,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4866 + // line internal/php5/php5.y:4827 { yyVAL.node = &ast.ExprBinaryGreater{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7382,7 +7341,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4877 + // line internal/php5/php5.y:4838 { yyVAL.node = &ast.ExprBinarySmallerOrEqual{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7395,7 +7354,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4888 + // line internal/php5/php5.y:4849 { yyVAL.node = &ast.ExprBinaryGreaterOrEqual{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7408,7 +7367,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4899 + // line internal/php5/php5.y:4860 { yyVAL.node = &ast.ExprTernary{ast.Node{}, yyDollar[1].node, nil, yyDollar[4].node} @@ -7422,7 +7381,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:4911 + // line internal/php5/php5.y:4872 { yyVAL.node = &ast.ExprTernary{ast.Node{}, yyDollar[1].node, yyDollar[3].node, yyDollar[5].node} @@ -7436,7 +7395,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4923 + // line internal/php5/php5.y:4884 { yyVAL.node = &ast.ExprUnaryPlus{ast.Node{}, yyDollar[2].node} @@ -7448,7 +7407,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4933 + // line internal/php5/php5.y:4894 { yyVAL.node = &ast.ExprUnaryMinus{ast.Node{}, yyDollar[2].node} @@ -7460,7 +7419,7 @@ yydefault: } case 409: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4943 + // line internal/php5/php5.y:4904 { yyVAL.node = yyDollar[2].node @@ -7470,13 +7429,13 @@ yydefault: } case 410: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4954 + // line internal/php5/php5.y:4915 { yyVAL.node = yyDollar[1].node } case 411: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4958 + // line internal/php5/php5.y:4919 { name := &ast.NameName{ Node: ast.Node{ @@ -7491,7 +7450,7 @@ yydefault: } case 412: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4971 + // line internal/php5/php5.y:4932 { name := &ast.NameRelative{ Node: ast.Node{ @@ -7508,7 +7467,7 @@ yydefault: } case 413: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4986 + // line internal/php5/php5.y:4947 { name := &ast.NameFullyQualified{ Node: ast.Node{ @@ -7524,7 +7483,7 @@ yydefault: } case 414: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5003 + // line internal/php5/php5.y:4964 { name := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.ExprVariable{ast.Node{}, name} @@ -7538,25 +7497,25 @@ yydefault: } case 415: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5015 + // line internal/php5/php5.y:4976 { yyVAL.node = yyDollar[1].node } case 416: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5019 + // line internal/php5/php5.y:4980 { yyVAL.node = yyDollar[1].node } case 417: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5023 + // line internal/php5/php5.y:4984 { yyVAL.node = yyDollar[1].node } case 418: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5027 + // line internal/php5/php5.y:4988 { yyVAL.node = &ast.ScalarEncapsed{ast.Node{}, yyDollar[2].list} @@ -7568,7 +7527,7 @@ yydefault: } case 419: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5037 + // line internal/php5/php5.y:4998 { yyVAL.node = &ast.ScalarHeredoc{ast.Node{}, yyDollar[1].token.Value, yyDollar[2].list} @@ -7580,7 +7539,7 @@ yydefault: } case 420: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5047 + // line internal/php5/php5.y:5008 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -7592,13 +7551,13 @@ yydefault: } case 421: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:5060 + // line internal/php5/php5.y:5021 { yyVAL.list = nil } case 422: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:5064 + // line internal/php5/php5.y:5025 { yyVAL.list = yyDollar[1].list @@ -7609,19 +7568,19 @@ yydefault: } case 423: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:5076 + // line internal/php5/php5.y:5037 { yyVAL.token = nil } case 424: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5080 + // line internal/php5/php5.y:5041 { yyVAL.token = yyDollar[1].token } case 425: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:5087 + // line internal/php5/php5.y:5048 { arrayItem := &ast.ExprArrayItem{ast.Node{}, false, yyDollar[3].node, yyDollar[5].node} yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -7636,7 +7595,7 @@ yydefault: } case 426: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5100 + // line internal/php5/php5.y:5061 { arrayItem := &ast.ExprArrayItem{ast.Node{}, false, nil, yyDollar[3].node} yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -7650,7 +7609,7 @@ yydefault: } case 427: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5112 + // line internal/php5/php5.y:5073 { arrayItem := &ast.ExprArrayItem{ast.Node{}, false, yyDollar[1].node, yyDollar[3].node} yyVAL.list = []ast.Vertex{arrayItem} @@ -7664,7 +7623,7 @@ yydefault: } case 428: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5124 + // line internal/php5/php5.y:5085 { arrayItem := &ast.ExprArrayItem{ast.Node{}, false, nil, yyDollar[1].node} yyVAL.list = []ast.Vertex{arrayItem} @@ -7677,19 +7636,19 @@ yydefault: } case 429: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5138 + // line internal/php5/php5.y:5099 { yyVAL.node = yyDollar[1].node } case 430: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5142 + // line internal/php5/php5.y:5103 { yyVAL.node = yyDollar[1].node } case 431: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5149 + // line internal/php5/php5.y:5110 { yyVAL.node = &ast.ParserBrackets{ Node: ast.Node{ @@ -7706,7 +7665,7 @@ yydefault: } case 432: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5164 + // line internal/php5/php5.y:5125 { yyVAL.node = &ast.ParserBrackets{ Node: ast.Node{ @@ -7723,25 +7682,25 @@ yydefault: } case 433: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5183 + // line internal/php5/php5.y:5144 { yyVAL.node = yyDollar[1].node } case 434: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5191 + // line internal/php5/php5.y:5152 { yyVAL.node = yyDollar[1].node } case 435: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5198 + // line internal/php5/php5.y:5159 { yyVAL.node = yyDollar[1].node } case 436: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:5205 + // line internal/php5/php5.y:5166 { yyVAL.node = yyDollar[1].node @@ -7799,25 +7758,25 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5261 + // line internal/php5/php5.y:5222 { yyVAL.node = yyDollar[1].node } case 438: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:5268 + // line internal/php5/php5.y:5229 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 439: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:5272 + // line internal/php5/php5.y:5233 { yyVAL.list = []ast.Vertex{} } case 440: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5280 + // line internal/php5/php5.y:5241 { if yyDollar[3].list != nil { yyDollar[3].list[0].(*ast.ExprMethodCall).Method = yyDollar[2].list[len(yyDollar[2].list)-1].(*ast.ExprPropertyFetch).Property @@ -7831,7 +7790,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:5295 + // line internal/php5/php5.y:5256 { fetch := &ast.ExprArrayDimFetch{ast.Node{}, nil, yyDollar[3].node} yyVAL.list = append(yyDollar[1].list, fetch) @@ -7845,7 +7804,7 @@ yydefault: } case 442: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:5307 + // line internal/php5/php5.y:5268 { fetch := &ast.ExprArrayDimFetch{ast.Node{}, nil, yyDollar[3].node} yyVAL.list = []ast.Vertex{yyDollar[1].node, fetch} @@ -7859,7 +7818,7 @@ yydefault: } case 443: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5322 + // line internal/php5/php5.y:5283 { yyVAL.node = &ast.ExprMethodCall{ast.Node{}, nil, nil, yyDollar[1].node.(*ast.ArgumentList)} @@ -7868,31 +7827,31 @@ yydefault: } case 444: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5332 + // line internal/php5/php5.y:5293 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 445: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5336 + // line internal/php5/php5.y:5297 { yyVAL.list = yyDollar[1].list } case 446: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:5340 + // line internal/php5/php5.y:5301 { yyVAL.list = nil } case 447: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5347 + // line internal/php5/php5.y:5308 { yyVAL.node = yyDollar[1].node } case 448: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:5351 + // line internal/php5/php5.y:5312 { yyDollar[1].simpleIndirectReference.last.VarName = yyDollar[2].node @@ -7904,7 +7863,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5364 + // line internal/php5/php5.y:5325 { yyVAL.node = &ast.ExprStaticPropertyFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7917,7 +7876,7 @@ yydefault: } case 450: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5375 + // line internal/php5/php5.y:5336 { yyVAL.node = &ast.ExprStaticPropertyFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7930,13 +7889,13 @@ yydefault: } case 451: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5389 + // line internal/php5/php5.y:5350 { yyVAL.node = yyDollar[1].node } case 452: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:5396 + // line internal/php5/php5.y:5357 { yyVAL.node = &ast.ExprArrayDimFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7949,7 +7908,7 @@ yydefault: } case 453: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:5407 + // line internal/php5/php5.y:5368 { yyVAL.node = &ast.ExprArrayDimFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7962,31 +7921,31 @@ yydefault: } case 454: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5421 + // line internal/php5/php5.y:5382 { yyVAL.node = yyDollar[1].node } case 455: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5425 + // line internal/php5/php5.y:5386 { yyVAL.node = yyDollar[1].node } case 456: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5429 + // line internal/php5/php5.y:5390 { yyVAL.node = yyDollar[1].node } case 457: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5437 + // line internal/php5/php5.y:5398 { yyVAL.node = yyDollar[1].node } case 458: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:5441 + // line internal/php5/php5.y:5402 { yyDollar[1].simpleIndirectReference.last.VarName = yyDollar[2].node @@ -7998,13 +7957,13 @@ yydefault: } case 459: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5451 + // line internal/php5/php5.y:5412 { yyVAL.node = yyDollar[1].node } case 460: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:5458 + // line internal/php5/php5.y:5419 { yyVAL.node = &ast.ExprArrayDimFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -8017,7 +7976,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:5469 + // line internal/php5/php5.y:5430 { yyVAL.node = &ast.ExprArrayDimFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -8030,13 +7989,13 @@ yydefault: } case 462: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5480 + // line internal/php5/php5.y:5441 { yyVAL.node = yyDollar[1].node } case 463: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5488 + // line internal/php5/php5.y:5449 { name := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.ExprVariable{ast.Node{}, name} @@ -8050,7 +8009,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:5500 + // line internal/php5/php5.y:5461 { yyVAL.node = &ast.ExprVariable{ast.Node{}, yyDollar[3].node} @@ -8064,25 +8023,25 @@ yydefault: } case 465: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:5515 + // line internal/php5/php5.y:5476 { yyVAL.node = nil } case 466: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5519 + // line internal/php5/php5.y:5480 { yyVAL.node = yyDollar[1].node } case 467: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5527 + // line internal/php5/php5.y:5488 { yyVAL.list = yyDollar[1].list } case 468: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5531 + // line internal/php5/php5.y:5492 { fetch := &ast.ExprPropertyFetch{ast.Node{}, nil, yyDollar[1].node} yyVAL.list = []ast.Vertex{fetch} @@ -8092,7 +8051,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:5542 + // line internal/php5/php5.y:5503 { fetch := &ast.ExprArrayDimFetch{ast.Node{}, nil, yyDollar[3].node} yyVAL.list = append(yyDollar[1].list, fetch) @@ -8106,7 +8065,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:5554 + // line internal/php5/php5.y:5515 { fetch := &ast.ExprArrayDimFetch{ast.Node{}, nil, yyDollar[3].node} yyVAL.list = append(yyDollar[1].list, fetch) @@ -8120,7 +8079,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5566 + // line internal/php5/php5.y:5527 { fetch := &ast.ExprPropertyFetch{ast.Node{}, nil, yyDollar[1].node} yyVAL.list = []ast.Vertex{fetch} @@ -8130,7 +8089,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5577 + // line internal/php5/php5.y:5538 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -8142,7 +8101,7 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5587 + // line internal/php5/php5.y:5548 { yyVAL.node = yyDollar[2].node @@ -8155,7 +8114,7 @@ yydefault: } case 474: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5601 + // line internal/php5/php5.y:5562 { n := &ast.ExprVariable{ast.Node{}, nil} yyVAL.simpleIndirectReference = simpleIndirectReference{[]*ast.ExprVariable{n}, n} @@ -8168,7 +8127,7 @@ yydefault: } case 475: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:5612 + // line internal/php5/php5.y:5573 { n := &ast.ExprVariable{ast.Node{}, nil} @@ -8185,7 +8144,7 @@ yydefault: } case 476: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5630 + // line internal/php5/php5.y:5591 { if len(yyDollar[1].list) == 0 { yyDollar[1].list = []ast.Vertex{&ast.ExprArrayItem{ast.Node{}, false, nil, nil}} @@ -8198,7 +8157,7 @@ yydefault: } case 477: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5641 + // line internal/php5/php5.y:5602 { if yyDollar[1].node.(*ast.ExprArrayItem).Key == nil && yyDollar[1].node.(*ast.ExprArrayItem).Val == nil { yyVAL.list = []ast.Vertex{} @@ -8208,7 +8167,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5653 + // line internal/php5/php5.y:5614 { yyVAL.node = &ast.ExprArrayItem{ast.Node{}, false, nil, yyDollar[1].node} @@ -8220,7 +8179,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:5663 + // line internal/php5/php5.y:5624 { listNode := &ast.ExprList{ast.Node{}, yyDollar[3].list} yyVAL.node = &ast.ExprArrayItem{ast.Node{}, false, nil, listNode} @@ -8236,19 +8195,19 @@ yydefault: } case 480: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:5677 + // line internal/php5/php5.y:5638 { yyVAL.node = &ast.ExprArrayItem{ast.Node{}, false, nil, nil} } case 481: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:5685 + // line internal/php5/php5.y:5646 { yyVAL.list = []ast.Vertex{} } case 482: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:5689 + // line internal/php5/php5.y:5650 { yyVAL.list = yyDollar[1].list @@ -8263,7 +8222,7 @@ yydefault: } case 483: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:5705 + // line internal/php5/php5.y:5666 { arrayItem := &ast.ExprArrayItem{ast.Node{}, false, yyDollar[3].node, yyDollar[5].node} yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -8278,7 +8237,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5718 + // line internal/php5/php5.y:5679 { arrayItem := &ast.ExprArrayItem{ast.Node{}, false, nil, yyDollar[3].node} yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -8292,7 +8251,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5730 + // line internal/php5/php5.y:5691 { arrayItem := &ast.ExprArrayItem{ast.Node{}, false, yyDollar[1].node, yyDollar[3].node} yyVAL.list = []ast.Vertex{arrayItem} @@ -8306,7 +8265,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5742 + // line internal/php5/php5.y:5703 { arrayItem := &ast.ExprArrayItem{ast.Node{}, false, nil, yyDollar[1].node} yyVAL.list = []ast.Vertex{arrayItem} @@ -8319,7 +8278,7 @@ yydefault: } case 487: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php5/php5.y:5753 + // line internal/php5/php5.y:5714 { reference := &ast.ExprReference{ast.Node{}, yyDollar[6].node} arrayItem := &ast.ExprArrayItem{ast.Node{}, false, yyDollar[3].node, reference} @@ -8337,7 +8296,7 @@ yydefault: } case 488: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:5769 + // line internal/php5/php5.y:5730 { reference := &ast.ExprReference{ast.Node{}, yyDollar[4].node} arrayItem := &ast.ExprArrayItem{ast.Node{}, false, nil, reference} @@ -8353,7 +8312,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:5783 + // line internal/php5/php5.y:5744 { reference := &ast.ExprReference{ast.Node{}, yyDollar[4].node} arrayItem := &ast.ExprArrayItem{ast.Node{}, false, yyDollar[1].node, reference} @@ -8370,7 +8329,7 @@ yydefault: } case 490: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:5798 + // line internal/php5/php5.y:5759 { reference := &ast.ExprReference{ast.Node{}, yyDollar[2].node} arrayItem := &ast.ExprArrayItem{ast.Node{}, false, nil, reference} @@ -8385,13 +8344,13 @@ yydefault: } case 491: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:5814 + // line internal/php5/php5.y:5775 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 492: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:5818 + // line internal/php5/php5.y:5779 { encapsed := &ast.ScalarEncapsedStringPart{ast.Node{}, yyDollar[2].token.Value} yyVAL.list = append(yyDollar[1].list, encapsed) @@ -8404,13 +8363,13 @@ yydefault: } case 493: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5829 + // line internal/php5/php5.y:5790 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 494: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:5833 + // line internal/php5/php5.y:5794 { encapsed := &ast.ScalarEncapsedStringPart{ast.Node{}, yyDollar[1].token.Value} yyVAL.list = []ast.Vertex{encapsed, yyDollar[2].node} @@ -8423,7 +8382,7 @@ yydefault: } case 495: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5847 + // line internal/php5/php5.y:5808 { name := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.ExprVariable{ast.Node{}, name} @@ -8437,7 +8396,7 @@ yydefault: } case 496: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:5859 + // line internal/php5/php5.y:5820 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -8454,7 +8413,7 @@ yydefault: } case 497: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5874 + // line internal/php5/php5.y:5835 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -8473,7 +8432,7 @@ yydefault: } case 498: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5891 + // line internal/php5/php5.y:5852 { variable := &ast.ExprVariable{ast.Node{}, yyDollar[2].node} @@ -8488,7 +8447,7 @@ yydefault: } case 499: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5904 + // line internal/php5/php5.y:5865 { name := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} variable := &ast.ExprVariable{ast.Node{}, name} @@ -8505,7 +8464,7 @@ yydefault: } case 500: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php5/php5.y:5919 + // line internal/php5/php5.y:5880 { identifier := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -8524,7 +8483,7 @@ yydefault: } case 501: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5936 + // line internal/php5/php5.y:5897 { yyVAL.node = yyDollar[2].node @@ -8534,7 +8493,7 @@ yydefault: } case 502: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5947 + // line internal/php5/php5.y:5908 { yyVAL.node = &ast.ScalarString{ast.Node{}, yyDollar[1].token.Value} @@ -8546,7 +8505,7 @@ yydefault: } case 503: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5957 + // line internal/php5/php5.y:5918 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(string(yyDollar[1].token.Value)); err == nil { @@ -8563,7 +8522,7 @@ yydefault: } case 504: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5972 + // line internal/php5/php5.y:5933 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.ExprVariable{ast.Node{}, identifier} @@ -8577,7 +8536,7 @@ yydefault: } case 505: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:5987 + // line internal/php5/php5.y:5948 { yyVAL.node = &ast.ExprIsset{ast.Node{}, yyDollar[3].list} @@ -8591,7 +8550,7 @@ yydefault: } case 506: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:5999 + // line internal/php5/php5.y:5960 { exprBrackets := &ast.ParserBrackets{ Node: ast.Node{ @@ -8613,7 +8572,7 @@ yydefault: } case 507: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:6019 + // line internal/php5/php5.y:5980 { exprBrackets := &ast.ParserBrackets{ Node: ast.Node{ @@ -8635,7 +8594,7 @@ yydefault: } case 508: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:6039 + // line internal/php5/php5.y:6000 { yyVAL.node = &ast.ExprInclude{ast.Node{}, yyDollar[2].node} @@ -8647,7 +8606,7 @@ yydefault: } case 509: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:6049 + // line internal/php5/php5.y:6010 { yyVAL.node = &ast.ExprIncludeOnce{ast.Node{}, yyDollar[2].node} @@ -8659,7 +8618,7 @@ yydefault: } case 510: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:6059 + // line internal/php5/php5.y:6020 { exprBrackets := &ast.ParserBrackets{ Node: ast.Node{ @@ -8681,7 +8640,7 @@ yydefault: } case 511: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:6079 + // line internal/php5/php5.y:6040 { yyVAL.node = &ast.ExprRequire{ast.Node{}, yyDollar[2].node} @@ -8693,7 +8652,7 @@ yydefault: } case 512: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:6089 + // line internal/php5/php5.y:6050 { yyVAL.node = &ast.ExprRequireOnce{ast.Node{}, yyDollar[2].node} @@ -8705,13 +8664,13 @@ yydefault: } case 513: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:6102 + // line internal/php5/php5.y:6063 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 514: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:6106 + // line internal/php5/php5.y:6067 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -8720,19 +8679,19 @@ yydefault: } case 515: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:6116 + // line internal/php5/php5.y:6077 { yyVAL.node = yyDollar[1].node } case 516: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:6120 + // line internal/php5/php5.y:6081 { yyVAL.node = yyDollar[1].node } case 517: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:6127 + // line internal/php5/php5.y:6088 { target := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} yyVAL.node = &ast.ExprClassConstFetch{ast.Node{}, yyDollar[1].node, target} @@ -8748,7 +8707,7 @@ yydefault: } case 518: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:6141 + // line internal/php5/php5.y:6102 { target := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} yyVAL.node = &ast.ExprClassConstFetch{ast.Node{}, yyDollar[1].node, target} @@ -8764,7 +8723,7 @@ yydefault: } case 519: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:6158 + // line internal/php5/php5.y:6119 { target := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} yyVAL.node = &ast.ExprClassConstFetch{ast.Node{}, yyDollar[1].node, target} @@ -8780,7 +8739,7 @@ yydefault: } case 520: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:6175 + // line internal/php5/php5.y:6136 { target := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} yyVAL.node = &ast.ExprClassConstFetch{ast.Node{}, yyDollar[1].node, target} diff --git a/internal/php5/php5.y b/internal/php5/php5.y index f599ddd..5fb516e 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -1094,79 +1094,39 @@ unticked_statement: } | T_FOREACH '(' variable T_AS foreach_variable foreach_optional_arg ')' foreach_statement { + $8.(*ast.StmtForeach).ForeachTkn = $1 + $8.(*ast.StmtForeach).OpenParenthesisTkn = $2 + $8.(*ast.StmtForeach).Expr = $3 + $8.(*ast.StmtForeach).AsTkn = $4 if $6 == nil { - switch n := $8.(type) { - case *ast.StmtForeach : - n.Expr = $3 - n.Var = $5 - case *ast.StmtAltForeach : - n.Expr = $3 - n.Var = $5 - } + $8.(*ast.StmtForeach).Var = $5 } else { - switch n := $8.(type) { - case *ast.StmtForeach : - n.Expr = $3 - n.Key = $5 - n.Var = $6 - case *ast.StmtAltForeach : - n.Expr = $3 - n.Key = $5 - n.Var = $6 - } + $8.(*ast.StmtForeach).Key = $5 + $8.(*ast.StmtForeach).DoubleArrowTkn = $6.(*ast.StmtForeach).DoubleArrowTkn + $8.(*ast.StmtForeach).Var = $6.(*ast.StmtForeach).Var } + $8.(*ast.StmtForeach).CloseParenthesisTkn = $7 + $8.(*ast.StmtForeach).Node.Position = position.NewTokenNodePosition($1, $8) $$ = $8 - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $8) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Foreach, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $4.SkippedTokens) - if $6 != nil { - yylex.(*Parser).setFreeFloatingTokens($$, token.Key, $6.GetNode().Tokens[token.Key]); delete($6.GetNode().Tokens, token.Key) - } - yylex.(*Parser).setFreeFloating($$, token.Var, $7.SkippedTokens) } | T_FOREACH '(' expr_without_variable T_AS foreach_variable foreach_optional_arg ')' foreach_statement { + $8.(*ast.StmtForeach).ForeachTkn = $1 + $8.(*ast.StmtForeach).OpenParenthesisTkn = $2 + $8.(*ast.StmtForeach).Expr = $3 + $8.(*ast.StmtForeach).AsTkn = $4 if $6 == nil { - switch n := $8.(type) { - case *ast.StmtForeach : - n.Expr = $3 - n.Var = $5 - case *ast.StmtAltForeach : - n.Expr = $3 - n.Var = $5 - } + $8.(*ast.StmtForeach).Var = $5 } else { - switch n := $8.(type) { - case *ast.StmtForeach : - n.Expr = $3 - n.Key = $5 - n.Var = $6 - case *ast.StmtAltForeach : - n.Expr = $3 - n.Key = $5 - n.Var = $6 - } + $8.(*ast.StmtForeach).Key = $5 + $8.(*ast.StmtForeach).DoubleArrowTkn = $6.(*ast.StmtForeach).DoubleArrowTkn + $8.(*ast.StmtForeach).Var = $6.(*ast.StmtForeach).Var } + $8.(*ast.StmtForeach).CloseParenthesisTkn = $7 + $8.(*ast.StmtForeach).Node.Position = position.NewTokenNodePosition($1, $8) - // save position $$ = $8 - - $$.GetNode().Position = position.NewTokenNodePosition($1, $8) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Foreach, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $4.SkippedTokens) - if $6 != nil { - yylex.(*Parser).setFreeFloatingTokens($$, token.Key, $6.GetNode().Tokens[token.Key]); delete($6.GetNode().Tokens, token.Key) - } - yylex.(*Parser).setFreeFloating($$, token.Var, $7.SkippedTokens) } | T_DECLARE '(' declare_list ')' declare_statement { @@ -1586,10 +1546,10 @@ foreach_optional_arg: } | T_DOUBLE_ARROW foreach_variable { - $$ = $2 - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Key, $1.SkippedTokens) + $$ = &ast.StmtForeach{ + DoubleArrowTkn: $1, + Var: $2, + } } ; @@ -1655,29 +1615,30 @@ for_statement: foreach_statement: statement { - $$ = &ast.StmtForeach{ast.Node{}, nil, nil, nil, $1} - - // save position - $$.GetNode().Position = position.NewNodePosition($1) + $$ = &ast.StmtForeach{ + Node: ast.Node{ + Position: position.NewNodePosition($1), + }, + Stmt: $1, + } } | ':' inner_statement_list T_ENDFOREACH ';' { - stmtList := &ast.StmtStmtList{ + $$ = &ast.StmtForeach{ Node: ast.Node{ - Position: position.NewNodeListPosition($2), + Position: position.NewTokensPosition($1, $4), }, - Stmts: $2, + Alt: true, + ColonTkn: $1, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: position.NewNodeListPosition($2), + }, + Stmts: $2, + }, + EndForeachTkn: $3, + SemiColonTkn: $4, } - $$ = &ast.StmtAltForeach{ast.Node{}, nil, nil, nil, stmtList} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $4) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Cond, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.SkippedTokens) - yylex.(*Parser).setToken($$, token.SemiColon, $4.SkippedTokens) } ; diff --git a/internal/php5/php5_test.go b/internal/php5/php5_test.go index 8537e6c..406f860 100644 --- a/internal/php5/php5_test.go +++ b/internal/php5/php5_test.go @@ -4705,7 +4705,7 @@ func TestPhp5(t *testing.T) { Stmts: []ast.Vertex{}, }, }, - &ast.StmtAltForeach{ + &ast.StmtForeach{ Node: ast.Node{ Position: &position.Position{ StartLine: 81, @@ -4714,6 +4714,7 @@ func TestPhp5(t *testing.T) { EndPos: 1762, }, }, + Alt: true, Expr: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ diff --git a/internal/php7/parser_test.go b/internal/php7/parser_test.go index 5efe233..94835e1 100644 --- a/internal/php7/parser_test.go +++ b/internal/php7/parser_test.go @@ -7028,7 +7028,7 @@ func TestStmtForeach_Alt(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtAltForeach{ + &ast.StmtForeach{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -7037,6 +7037,7 @@ func TestStmtForeach_Alt(t *testing.T) { EndPos: 35, }, }, + Alt: true, Expr: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ diff --git a/internal/php7/php7.go b/internal/php7/php7.go index 56d0fc9..4b801a5 100644 --- a/internal/php7/php7.go +++ b/internal/php7/php7.go @@ -346,7 +346,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -// line internal/php7/php7.y:4817 +// line internal/php7/php7.y:4797 // line yacctab:1 var yyExca = [...]int{ @@ -2113,7 +2113,7 @@ yydefault: case 1: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:294 + // line internal/php7/php7.y:294 { yylex.(*Parser).rootNode = &ast.Root{ast.Node{}, yyDollar[1].list} @@ -2124,469 +2124,469 @@ yydefault: } case 2: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:305 + // line internal/php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 3: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:305 + // line internal/php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 4: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:305 + // line internal/php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 5: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:305 + // line internal/php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 6: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:305 + // line internal/php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 7: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:305 + // line internal/php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 8: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:305 + // line internal/php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 9: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:305 + // line internal/php7/php7.y:305 { yyVAL.token = yyDollar[1].token } case 10: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:306 + // line internal/php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 11: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:306 + // line internal/php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 12: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:306 + // line internal/php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 13: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:306 + // line internal/php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 14: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:306 + // line internal/php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 15: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:306 + // line internal/php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 16: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:306 + // line internal/php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 17: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:306 + // line internal/php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 18: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:306 + // line internal/php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 19: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:306 + // line internal/php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 20: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:306 + // line internal/php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 21: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:306 + // line internal/php7/php7.y:306 { yyVAL.token = yyDollar[1].token } case 22: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:307 + // line internal/php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 23: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:307 + // line internal/php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 24: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:307 + // line internal/php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 25: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:307 + // line internal/php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 26: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:307 + // line internal/php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 27: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:307 + // line internal/php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 28: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:307 + // line internal/php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 29: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:307 + // line internal/php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 30: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:307 + // line internal/php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 31: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:307 + // line internal/php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 32: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:308 + // line internal/php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 33: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:308 + // line internal/php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 34: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:308 + // line internal/php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 35: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:308 + // line internal/php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 36: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:308 + // line internal/php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 37: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:308 + // line internal/php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 38: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:308 + // line internal/php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 39: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:308 + // line internal/php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 40: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:308 + // line internal/php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 41: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:308 + // line internal/php7/php7.y:308 { yyVAL.token = yyDollar[1].token } case 42: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:309 + // line internal/php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 43: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:309 + // line internal/php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 44: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:309 + // line internal/php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 45: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:309 + // line internal/php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 46: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:309 + // line internal/php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 47: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:309 + // line internal/php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 48: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:309 + // line internal/php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 49: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:309 + // line internal/php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 50: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:309 + // line internal/php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 51: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:309 + // line internal/php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 52: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:309 + // line internal/php7/php7.y:309 { yyVAL.token = yyDollar[1].token } case 53: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:310 + // line internal/php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 54: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:310 + // line internal/php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 55: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:310 + // line internal/php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 56: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:310 + // line internal/php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 57: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:310 + // line internal/php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 58: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:310 + // line internal/php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 59: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:310 + // line internal/php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 60: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:310 + // line internal/php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 61: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:311 + // line internal/php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 62: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:311 + // line internal/php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 63: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:311 + // line internal/php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 64: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:311 + // line internal/php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 65: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:311 + // line internal/php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 66: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:311 + // line internal/php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 67: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:311 + // line internal/php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 68: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:311 + // line internal/php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 69: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:311 + // line internal/php7/php7.y:311 { yyVAL.token = yyDollar[1].token } case 70: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:316 + // line internal/php7/php7.y:316 { yyVAL.token = yyDollar[1].token } case 71: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:319 + // line internal/php7/php7.y:319 { yyVAL.token = yyDollar[1].token } case 72: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:319 + // line internal/php7/php7.y:319 { yyVAL.token = yyDollar[1].token } case 73: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:319 + // line internal/php7/php7.y:319 { yyVAL.token = yyDollar[1].token } case 74: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:319 + // line internal/php7/php7.y:319 { yyVAL.token = yyDollar[1].token } case 75: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:319 + // line internal/php7/php7.y:319 { yyVAL.token = yyDollar[1].token } case 76: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:319 + // line internal/php7/php7.y:319 { yyVAL.token = yyDollar[1].token } case 77: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:324 + // line internal/php7/php7.y:324 { yyVAL.token = yyDollar[1].token } case 78: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:328 + // line internal/php7/php7.y:328 { yyVAL.token = yyDollar[1].token } case 79: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:335 + // line internal/php7/php7.y:335 { if inlineHtmlNode, ok := yyDollar[2].node.(*ast.StmtInlineHtml); ok && len(yyDollar[1].list) > 0 { prevNode := lastNode(yyDollar[1].list) @@ -2599,13 +2599,13 @@ yydefault: } case 80: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:346 + // line internal/php7/php7.y:346 { yyVAL.list = []ast.Vertex{} } case 81: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:353 + // line internal/php7/php7.y:353 { yyVAL.list = []ast.Vertex{ &ast.NameNamePart{ @@ -2619,7 +2619,7 @@ yydefault: } case 82: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:365 + // line internal/php7/php7.y:365 { yyVAL.list = append(yyDollar[1].list, &ast.NameNamePart{ Node: ast.Node{ @@ -2632,7 +2632,7 @@ yydefault: } case 83: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:379 + // line internal/php7/php7.y:379 { yyVAL.node = &ast.NameName{ Node: ast.Node{ @@ -2643,7 +2643,7 @@ yydefault: } case 84: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:388 + // line internal/php7/php7.y:388 { yyVAL.node = &ast.NameRelative{ Node: ast.Node{ @@ -2656,7 +2656,7 @@ yydefault: } case 85: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:399 + // line internal/php7/php7.y:399 { yyVAL.node = &ast.NameFullyQualified{ Node: ast.Node{ @@ -2668,44 +2668,44 @@ yydefault: } case 86: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:412 + // line internal/php7/php7.y:412 { // error yyVAL.node = nil } case 87: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:417 + // line internal/php7/php7.y:417 { yyVAL.node = yyDollar[1].node } case 88: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:421 + // line internal/php7/php7.y:421 { yyVAL.node = yyDollar[1].node } case 89: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:425 + // line internal/php7/php7.y:425 { yyVAL.node = yyDollar[1].node } case 90: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:429 + // line internal/php7/php7.y:429 { yyVAL.node = yyDollar[1].node } case 91: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:433 + // line internal/php7/php7.y:433 { yyVAL.node = yyDollar[1].node } case 92: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:437 + // line internal/php7/php7.y:437 { yyVAL.node = &ast.StmtHaltCompiler{ Node: ast.Node{ @@ -2719,7 +2719,7 @@ yydefault: } case 93: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:449 + // line internal/php7/php7.y:449 { yyVAL.node = &ast.StmtNamespace{ Node: ast.Node{ @@ -2737,7 +2737,7 @@ yydefault: } case 94: yyDollar = yyS[yypt-5 : yypt+1] -// line internal/php7/php7.y:465 + // line internal/php7/php7.y:465 { yyVAL.node = &ast.StmtNamespace{ Node: ast.Node{ @@ -2757,7 +2757,7 @@ yydefault: } case 95: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:483 + // line internal/php7/php7.y:483 { yyVAL.node = &ast.StmtNamespace{ Node: ast.Node{ @@ -2771,7 +2771,7 @@ yydefault: } case 96: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:495 + // line internal/php7/php7.y:495 { use := yyDollar[2].node.(*ast.StmtGroupUse) @@ -2783,7 +2783,7 @@ yydefault: } case 97: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:505 + // line internal/php7/php7.y:505 { use := yyDollar[3].node.(*ast.StmtGroupUse) @@ -2796,7 +2796,7 @@ yydefault: } case 98: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:516 + // line internal/php7/php7.y:516 { yyVAL.node = &ast.StmtUse{ Node: ast.Node{ @@ -2809,7 +2809,7 @@ yydefault: } case 99: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:527 + // line internal/php7/php7.y:527 { yyVAL.node = &ast.StmtUse{ Node: ast.Node{ @@ -2823,7 +2823,7 @@ yydefault: } case 100: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:539 + // line internal/php7/php7.y:539 { yyVAL.node = &ast.StmtConstList{ Node: ast.Node{ @@ -2836,7 +2836,7 @@ yydefault: } case 101: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:553 + // line internal/php7/php7.y:553 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -2848,7 +2848,7 @@ yydefault: } case 102: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:563 + // line internal/php7/php7.y:563 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -2860,7 +2860,7 @@ yydefault: } case 103: yyDollar = yyS[yypt-6 : yypt+1] -// line internal/php7/php7.y:576 + // line internal/php7/php7.y:576 { if len(yyDollar[4].list) > 0 { yyDollar[4].list[len(yyDollar[4].list)-1].(*ast.StmtUseDeclaration).CommaTkn = yyDollar[5].token @@ -2884,7 +2884,7 @@ yydefault: } case 104: yyDollar = yyS[yypt-7 : yypt+1] -// line internal/php7/php7.y:598 + // line internal/php7/php7.y:598 { yyDollar[5].list[len(yyDollar[5].list)-1].(*ast.StmtUseDeclaration).CommaTkn = yyDollar[6].token @@ -2907,7 +2907,7 @@ yydefault: } case 105: yyDollar = yyS[yypt-6 : yypt+1] -// line internal/php7/php7.y:622 + // line internal/php7/php7.y:622 { yyDollar[4].list[len(yyDollar[4].list)-1].(*ast.StmtUseDeclaration).CommaTkn = yyDollar[5].token @@ -2929,7 +2929,7 @@ yydefault: } case 106: yyDollar = yyS[yypt-7 : yypt+1] -// line internal/php7/php7.y:642 + // line internal/php7/php7.y:642 { yyDollar[5].list[len(yyDollar[5].list)-1].(*ast.StmtUseDeclaration).CommaTkn = yyDollar[6].token @@ -2952,19 +2952,19 @@ yydefault: } case 107: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:666 + // line internal/php7/php7.y:666 { yyVAL.token = nil } case 108: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:670 + // line internal/php7/php7.y:670 { yyVAL.token = yyDollar[1].token } case 109: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:677 + // line internal/php7/php7.y:677 { yyDollar[1].list[len(yyDollar[1].list)-1].(*ast.StmtUseDeclaration).CommaTkn = yyDollar[2].token @@ -2972,13 +2972,13 @@ yydefault: } case 110: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:683 + // line internal/php7/php7.y:683 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 111: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:690 + // line internal/php7/php7.y:690 { yyDollar[1].list[len(yyDollar[1].list)-1].(*ast.StmtUseDeclaration).CommaTkn = yyDollar[2].token @@ -2986,13 +2986,13 @@ yydefault: } case 112: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:696 + // line internal/php7/php7.y:696 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 113: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:703 + // line internal/php7/php7.y:703 { yyDollar[1].list[len(yyDollar[1].list)-1].(*ast.StmtUseDeclaration).CommaTkn = yyDollar[2].token @@ -3000,19 +3000,19 @@ yydefault: } case 114: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:709 + // line internal/php7/php7.y:709 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 115: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:716 + // line internal/php7/php7.y:716 { yyVAL.node = yyDollar[1].node } case 116: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:720 + // line internal/php7/php7.y:720 { decl := yyDollar[2].node.(*ast.StmtUseDeclaration) decl.Type = yyDollar[1].node @@ -3022,7 +3022,7 @@ yydefault: } case 117: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:731 + // line internal/php7/php7.y:731 { yyVAL.node = &ast.StmtUseDeclaration{ Node: ast.Node{ @@ -3038,7 +3038,7 @@ yydefault: } case 118: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:745 + // line internal/php7/php7.y:745 { yyVAL.node = &ast.StmtUseDeclaration{ Node: ast.Node{ @@ -3061,13 +3061,13 @@ yydefault: } case 119: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:769 + // line internal/php7/php7.y:769 { yyVAL.node = yyDollar[1].node } case 120: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:773 + // line internal/php7/php7.y:773 { decl := yyDollar[2].node.(*ast.StmtUseDeclaration) decl.NsSeparatorTkn = yyDollar[1].token @@ -3077,7 +3077,7 @@ yydefault: } case 121: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:784 + // line internal/php7/php7.y:784 { lastNode(yyDollar[1].list).(*ast.StmtConstant).CommaTkn = yyDollar[2].token @@ -3085,13 +3085,13 @@ yydefault: } case 122: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:790 + // line internal/php7/php7.y:790 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 123: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:797 + // line internal/php7/php7.y:797 { if inlineHtmlNode, ok := yyDollar[2].node.(*ast.StmtInlineHtml); ok && len(yyDollar[1].list) > 0 { prevNode := lastNode(yyDollar[1].list) @@ -3104,50 +3104,50 @@ yydefault: } case 124: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:808 + // line internal/php7/php7.y:808 { yyVAL.list = []ast.Vertex{} } case 125: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:815 + // line internal/php7/php7.y:815 { // error yyVAL.node = nil } case 126: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:820 + // line internal/php7/php7.y:820 { yyVAL.node = yyDollar[1].node } case 127: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:824 + // line internal/php7/php7.y:824 { yyVAL.node = yyDollar[1].node } case 128: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:828 + // line internal/php7/php7.y:828 { yyVAL.node = yyDollar[1].node } case 129: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:832 + // line internal/php7/php7.y:832 { yyVAL.node = yyDollar[1].node } case 130: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:836 + // line internal/php7/php7.y:836 { yyVAL.node = yyDollar[1].node } case 131: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:840 + // line internal/php7/php7.y:840 { yyVAL.node = &ast.StmtHaltCompiler{ Node: ast.Node{ @@ -3161,7 +3161,7 @@ yydefault: } case 132: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:854 + // line internal/php7/php7.y:854 { yyVAL.node = &ast.StmtStmtList{ Node: ast.Node{ @@ -3174,19 +3174,19 @@ yydefault: } case 133: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:865 + // line internal/php7/php7.y:865 { yyVAL.node = yyDollar[1].node } case 134: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:869 + // line internal/php7/php7.y:869 { yyVAL.node = yyDollar[1].node } case 135: yyDollar = yyS[yypt-5 : yypt+1] -// line internal/php7/php7.y:873 + // line internal/php7/php7.y:873 { yyDollar[5].node.(*ast.StmtWhile).WhileTkn = yyDollar[1].token yyDollar[5].node.(*ast.StmtWhile).OpenParenthesisTkn = yyDollar[2].token @@ -3198,7 +3198,7 @@ yydefault: } case 136: yyDollar = yyS[yypt-7 : yypt+1] -// line internal/php7/php7.y:883 + // line internal/php7/php7.y:883 { yyVAL.node = &ast.StmtDo{ Node: ast.Node{ @@ -3215,7 +3215,7 @@ yydefault: } case 137: yyDollar = yyS[yypt-9 : yypt+1] -// line internal/php7/php7.y:898 + // line internal/php7/php7.y:898 { yyDollar[9].node.(*ast.StmtFor).ForTkn = yyDollar[1].token yyDollar[9].node.(*ast.StmtFor).OpenParenthesisTkn = yyDollar[2].token @@ -3231,7 +3231,7 @@ yydefault: } case 138: yyDollar = yyS[yypt-5 : yypt+1] -// line internal/php7/php7.y:912 + // line internal/php7/php7.y:912 { yyDollar[5].node.(*ast.StmtSwitch).SwitchTkn = yyDollar[1].token yyDollar[5].node.(*ast.StmtSwitch).OpenParenthesisTkn = yyDollar[2].token @@ -3243,7 +3243,7 @@ yydefault: } case 139: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:922 + // line internal/php7/php7.y:922 { yyVAL.node = &ast.StmtBreak{ Node: ast.Node{ @@ -3256,7 +3256,7 @@ yydefault: } case 140: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:933 + // line internal/php7/php7.y:933 { yyVAL.node = &ast.StmtContinue{ Node: ast.Node{ @@ -3269,7 +3269,7 @@ yydefault: } case 141: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:944 + // line internal/php7/php7.y:944 { yyVAL.node = &ast.StmtReturn{ Node: ast.Node{ @@ -3282,7 +3282,7 @@ yydefault: } case 142: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:955 + // line internal/php7/php7.y:955 { yyDollar[2].node.(*ast.StmtGlobal).GlobalTkn = yyDollar[1].token yyDollar[2].node.(*ast.StmtGlobal).SemiColonTkn = yyDollar[3].token @@ -3292,7 +3292,7 @@ yydefault: } case 143: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:963 + // line internal/php7/php7.y:963 { yyDollar[2].node.(*ast.StmtStatic).StaticTkn = yyDollar[1].token yyDollar[2].node.(*ast.StmtStatic).SemiColonTkn = yyDollar[3].token @@ -3302,7 +3302,7 @@ yydefault: } case 144: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:971 + // line internal/php7/php7.y:971 { yyDollar[2].node.(*ast.StmtEcho).EchoTkn = yyDollar[1].token yyDollar[2].node.(*ast.StmtEcho).SemiColonTkn = yyDollar[3].token @@ -3312,7 +3312,7 @@ yydefault: } case 145: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:979 + // line internal/php7/php7.y:979 { yyVAL.node = &ast.StmtInlineHtml{ Node: ast.Node{ @@ -3324,7 +3324,7 @@ yydefault: } case 146: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:989 + // line internal/php7/php7.y:989 { yyVAL.node = &ast.StmtExpression{ast.Node{}, yyDollar[1].node} @@ -3338,7 +3338,7 @@ yydefault: } case 147: yyDollar = yyS[yypt-6 : yypt+1] -// line internal/php7/php7.y:1001 + // line internal/php7/php7.y:1001 { yyDollar[3].node.(*ast.StmtUnset).UnsetTkn = yyDollar[1].token yyDollar[3].node.(*ast.StmtUnset).OpenParenthesisTkn = yyDollar[2].token @@ -3351,58 +3351,37 @@ yydefault: } case 148: yyDollar = yyS[yypt-7 : yypt+1] -// line internal/php7/php7.y:1012 + // line internal/php7/php7.y:1012 { - switch n := yyDollar[7].node.(type) { - case *ast.StmtForeach: - n.Expr = yyDollar[3].node - n.Var = yyDollar[5].node - case *ast.StmtAltForeach: - n.Expr = yyDollar[3].node - n.Var = yyDollar[5].node - } + yyDollar[7].node.(*ast.StmtForeach).ForeachTkn = yyDollar[1].token + yyDollar[7].node.(*ast.StmtForeach).OpenParenthesisTkn = yyDollar[2].token + yyDollar[7].node.(*ast.StmtForeach).Expr = yyDollar[3].node + yyDollar[7].node.(*ast.StmtForeach).AsTkn = yyDollar[4].token + yyDollar[7].node.(*ast.StmtForeach).Var = yyDollar[5].node + yyDollar[7].node.(*ast.StmtForeach).CloseParenthesisTkn = yyDollar[6].token + yyDollar[7].node.(*ast.StmtForeach).Node.Position = position.NewTokenNodePosition(yyDollar[1].token, yyDollar[7].node) yyVAL.node = yyDollar[7].node - - // save position - yyVAL.node.GetNode().Position = position.NewTokenNodePosition(yyDollar[1].token, yyDollar[7].node) - - // save comments - yylex.(*Parser).setFreeFloating(yyVAL.node, token.Start, yyDollar[1].token.SkippedTokens) - yylex.(*Parser).setFreeFloating(yyVAL.node, token.Foreach, yyDollar[2].token.SkippedTokens) - yylex.(*Parser).setFreeFloating(yyVAL.node, token.Expr, yyDollar[4].token.SkippedTokens) - yylex.(*Parser).setFreeFloating(yyVAL.node, token.Var, yyDollar[6].token.SkippedTokens) } case 149: yyDollar = yyS[yypt-9 : yypt+1] -// line internal/php7/php7.y:1034 + // line internal/php7/php7.y:1024 { - switch n := yyDollar[9].node.(type) { - case *ast.StmtForeach: - n.Expr = yyDollar[3].node - n.Key = yyDollar[5].node - n.Var = yyDollar[7].node - case *ast.StmtAltForeach: - n.Expr = yyDollar[3].node - n.Key = yyDollar[5].node - n.Var = yyDollar[7].node - } + yyDollar[9].node.(*ast.StmtForeach).ForeachTkn = yyDollar[1].token + yyDollar[9].node.(*ast.StmtForeach).OpenParenthesisTkn = yyDollar[2].token + yyDollar[9].node.(*ast.StmtForeach).Expr = yyDollar[3].node + yyDollar[9].node.(*ast.StmtForeach).AsTkn = yyDollar[4].token + yyDollar[9].node.(*ast.StmtForeach).Key = yyDollar[5].node + yyDollar[9].node.(*ast.StmtForeach).DoubleArrowTkn = yyDollar[6].token + yyDollar[9].node.(*ast.StmtForeach).Var = yyDollar[7].node + yyDollar[9].node.(*ast.StmtForeach).CloseParenthesisTkn = yyDollar[8].token + yyDollar[9].node.(*ast.StmtForeach).Node.Position = position.NewTokenNodePosition(yyDollar[1].token, yyDollar[9].node) yyVAL.node = yyDollar[9].node - - // save position - yyVAL.node.GetNode().Position = position.NewTokenNodePosition(yyDollar[1].token, yyDollar[9].node) - - // save comments - yylex.(*Parser).setFreeFloating(yyVAL.node, token.Start, yyDollar[1].token.SkippedTokens) - yylex.(*Parser).setFreeFloating(yyVAL.node, token.Foreach, yyDollar[2].token.SkippedTokens) - yylex.(*Parser).setFreeFloating(yyVAL.node, token.Expr, yyDollar[4].token.SkippedTokens) - yylex.(*Parser).setFreeFloating(yyVAL.node, token.Key, yyDollar[6].token.SkippedTokens) - yylex.(*Parser).setFreeFloating(yyVAL.node, token.Var, yyDollar[8].token.SkippedTokens) } case 150: yyDollar = yyS[yypt-5 : yypt+1] -// line internal/php7/php7.y:1059 + // line internal/php7/php7.y:1038 { yyVAL.node = yyDollar[5].node yyVAL.node.(*ast.StmtDeclare).Consts = yyDollar[3].list @@ -3417,7 +3396,7 @@ yydefault: } case 151: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1072 + // line internal/php7/php7.y:1051 { yyVAL.node = &ast.StmtNop{ast.Node{}} @@ -3430,7 +3409,7 @@ yydefault: } case 152: yyDollar = yyS[yypt-6 : yypt+1] -// line internal/php7/php7.y:1083 + // line internal/php7/php7.y:1062 { if yyDollar[6].node == nil { yyVAL.node = &ast.StmtTry{ast.Node{}, yyDollar[3].list, yyDollar[5].list, yyDollar[6].node} @@ -3447,7 +3426,7 @@ yydefault: } case 153: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:1098 + // line internal/php7/php7.y:1077 { yyVAL.node = &ast.StmtThrow{ast.Node{}, yyDollar[2].node} @@ -3461,7 +3440,7 @@ yydefault: } case 154: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:1110 + // line internal/php7/php7.y:1089 { label := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} yyVAL.node = &ast.StmtGoto{ast.Node{}, label} @@ -3478,7 +3457,7 @@ yydefault: } case 155: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:1125 + // line internal/php7/php7.y:1104 { label := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.StmtLabel{ast.Node{}, label} @@ -3493,13 +3472,13 @@ yydefault: } case 156: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:1140 + // line internal/php7/php7.y:1119 { yyVAL.list = []ast.Vertex{} } case 157: yyDollar = yyS[yypt-9 : yypt+1] -// line internal/php7/php7.y:1144 + // line internal/php7/php7.y:1123 { identifier := &ast.Identifier{ast.Node{}, yyDollar[5].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -3521,13 +3500,13 @@ yydefault: } case 158: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1166 + // line internal/php7/php7.y:1145 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 159: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:1170 + // line internal/php7/php7.y:1149 { switch n := lastNode(yyDollar[1].list).(type) { case *ast.NameName: @@ -3541,13 +3520,13 @@ yydefault: } case 160: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:1182 + // line internal/php7/php7.y:1161 { yyVAL.node = nil } case 161: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:1186 + // line internal/php7/php7.y:1165 { yyVAL.node = &ast.StmtFinally{ast.Node{}, yyDollar[3].list} @@ -3561,7 +3540,7 @@ yydefault: } case 162: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1201 + // line internal/php7/php7.y:1180 { yyVAL.node = &ast.StmtUnset{ Vars: []ast.Vertex{yyDollar[1].node}, @@ -3569,7 +3548,7 @@ yydefault: } case 163: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:1207 + // line internal/php7/php7.y:1186 { yyDollar[1].node.(*ast.StmtUnset).Vars = append(yyDollar[1].node.(*ast.StmtUnset).Vars, yyDollar[3].node) yyDollar[1].node.(*ast.StmtUnset).SeparatorTkns = append(yyDollar[1].node.(*ast.StmtUnset).SeparatorTkns, yyDollar[2].token) @@ -3578,13 +3557,13 @@ yydefault: } case 164: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1217 + // line internal/php7/php7.y:1196 { yyVAL.node = yyDollar[1].node } case 165: yyDollar = yyS[yypt-11 : yypt+1] -// line internal/php7/php7.y:1224 + // line internal/php7/php7.y:1203 { name := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} yyVAL.node = &ast.StmtFunction{ast.Node{}, yyDollar[2].token != nil, name, yyDollar[6].list, yyDollar[8].node, yyDollar[10].list} @@ -3614,31 +3593,31 @@ yydefault: } case 166: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:1255 + // line internal/php7/php7.y:1234 { yyVAL.token = nil } case 167: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1259 + // line internal/php7/php7.y:1238 { yyVAL.token = yyDollar[1].token } case 168: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:1266 + // line internal/php7/php7.y:1245 { yyVAL.token = nil } case 169: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1270 + // line internal/php7/php7.y:1249 { yyVAL.token = yyDollar[1].token } case 170: yyDollar = yyS[yypt-9 : yypt+1] -// line internal/php7/php7.y:1277 + // line internal/php7/php7.y:1256 { name := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} yyVAL.node = &ast.StmtClass{ast.Node{}, name, yyDollar[1].list, nil, yyDollar[4].ClassExtends, yyDollar[5].ClassImplements, yyDollar[8].list} @@ -3656,7 +3635,7 @@ yydefault: } case 171: yyDollar = yyS[yypt-8 : yypt+1] -// line internal/php7/php7.y:1293 + // line internal/php7/php7.y:1272 { name := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} yyVAL.node = &ast.StmtClass{ast.Node{}, name, nil, nil, yyDollar[3].ClassExtends, yyDollar[4].ClassImplements, yyDollar[7].list} @@ -3673,19 +3652,19 @@ yydefault: } case 172: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1311 + // line internal/php7/php7.y:1290 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 173: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:1315 + // line internal/php7/php7.y:1294 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 174: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1322 + // line internal/php7/php7.y:1301 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -3697,7 +3676,7 @@ yydefault: } case 175: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1332 + // line internal/php7/php7.y:1311 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -3709,7 +3688,7 @@ yydefault: } case 176: yyDollar = yyS[yypt-6 : yypt+1] -// line internal/php7/php7.y:1345 + // line internal/php7/php7.y:1324 { name := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} yyVAL.node = &ast.StmtTrait{ast.Node{}, name, yyDollar[5].list} @@ -3726,7 +3705,7 @@ yydefault: } case 177: yyDollar = yyS[yypt-7 : yypt+1] -// line internal/php7/php7.y:1363 + // line internal/php7/php7.y:1342 { name := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} yyVAL.node = &ast.StmtInterface{ast.Node{}, name, yyDollar[3].InterfaceExtends, yyDollar[6].list} @@ -3743,13 +3722,13 @@ yydefault: } case 178: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:1381 + // line internal/php7/php7.y:1360 { yyVAL.ClassExtends = nil } case 179: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:1385 + // line internal/php7/php7.y:1364 { yyVAL.ClassExtends = &ast.StmtClassExtends{ast.Node{}, yyDollar[2].node} @@ -3761,13 +3740,13 @@ yydefault: } case 180: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:1398 + // line internal/php7/php7.y:1377 { yyVAL.InterfaceExtends = nil } case 181: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:1402 + // line internal/php7/php7.y:1381 { yyVAL.InterfaceExtends = &ast.StmtInterfaceExtends{ast.Node{}, yyDollar[2].list} @@ -3779,13 +3758,13 @@ yydefault: } case 182: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:1415 + // line internal/php7/php7.y:1394 { yyVAL.ClassImplements = nil } case 183: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:1419 + // line internal/php7/php7.y:1398 { yyVAL.ClassImplements = &ast.StmtClassImplements{ast.Node{}, yyDollar[2].list} @@ -3797,13 +3776,13 @@ yydefault: } case 184: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1432 + // line internal/php7/php7.y:1411 { yyVAL.node = yyDollar[1].node } case 185: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:1436 + // line internal/php7/php7.y:1415 { yyVAL.node = &ast.ExprReference{ast.Node{}, yyDollar[2].node} @@ -3815,7 +3794,7 @@ yydefault: } case 186: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:1446 + // line internal/php7/php7.y:1425 { yyVAL.node = &ast.ExprList{ast.Node{}, yyDollar[3].list} @@ -3829,7 +3808,7 @@ yydefault: } case 187: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:1458 + // line internal/php7/php7.y:1437 { yyVAL.node = &ast.ExprShortList{ast.Node{}, yyDollar[2].list} @@ -3842,7 +3821,7 @@ yydefault: } case 188: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1472 + // line internal/php7/php7.y:1451 { yyVAL.node = &ast.StmtFor{ Node: ast.Node{ @@ -3853,7 +3832,7 @@ yydefault: } case 189: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:1481 + // line internal/php7/php7.y:1460 { yyVAL.node = &ast.StmtFor{ Node: ast.Node{ @@ -3873,37 +3852,38 @@ yydefault: } case 190: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1502 + // line internal/php7/php7.y:1481 { - yyVAL.node = &ast.StmtForeach{ast.Node{}, nil, nil, nil, yyDollar[1].node} - - // save position - yyVAL.node.GetNode().Position = position.NewNodePosition(yyDollar[1].node) + yyVAL.node = &ast.StmtForeach{ + Node: ast.Node{ + Position: position.NewNodePosition(yyDollar[1].node), + }, + Stmt: yyDollar[1].node, + } } case 191: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:1509 + // line internal/php7/php7.y:1490 { - stmtList := &ast.StmtStmtList{ + yyVAL.node = &ast.StmtForeach{ Node: ast.Node{ - Position: position.NewNodeListPosition(yyDollar[2].list), + Position: position.NewTokensPosition(yyDollar[1].token, yyDollar[4].token), }, - Stmts: yyDollar[2].list, + Alt: true, + ColonTkn: yyDollar[1].token, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: position.NewNodeListPosition(yyDollar[2].list), + }, + Stmts: yyDollar[2].list, + }, + EndForeachTkn: yyDollar[3].token, + SemiColonTkn: yyDollar[4].token, } - yyVAL.node = &ast.StmtAltForeach{ast.Node{}, nil, nil, nil, stmtList} - - // save position - yyVAL.node.GetNode().Position = position.NewTokensPosition(yyDollar[1].token, yyDollar[4].token) - - // save comments - yylex.(*Parser).setFreeFloating(yyVAL.node, token.Cond, yyDollar[1].token.SkippedTokens) - yylex.(*Parser).setFreeFloating(yyVAL.node, token.Stmts, yyDollar[3].token.SkippedTokens) - yylex.(*Parser).setFreeFloating(yyVAL.node, token.AltEnd, yyDollar[4].token.SkippedTokens) - yylex.(*Parser).setToken(yyVAL.node, token.SemiColon, yyDollar[4].token.SkippedTokens) } case 192: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1531 + // line internal/php7/php7.y:1511 { yyVAL.node = &ast.StmtDeclare{ast.Node{}, false, nil, yyDollar[1].node} @@ -3912,7 +3892,7 @@ yydefault: } case 193: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:1538 + // line internal/php7/php7.y:1518 { stmtList := &ast.StmtStmtList{ Node: ast.Node{ @@ -3933,7 +3913,7 @@ yydefault: } case 194: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:1560 + // line internal/php7/php7.y:1540 { yyVAL.node = &ast.StmtSwitch{ Node: ast.Node{ @@ -3946,7 +3926,7 @@ yydefault: } case 195: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:1571 + // line internal/php7/php7.y:1551 { yyVAL.node = &ast.StmtSwitch{ Node: ast.Node{ @@ -3960,7 +3940,7 @@ yydefault: } case 196: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:1583 + // line internal/php7/php7.y:1563 { yyVAL.node = &ast.StmtSwitch{ Node: ast.Node{ @@ -3975,7 +3955,7 @@ yydefault: } case 197: yyDollar = yyS[yypt-5 : yypt+1] -// line internal/php7/php7.y:1596 + // line internal/php7/php7.y:1576 { yyVAL.node = &ast.StmtSwitch{ Node: ast.Node{ @@ -3991,13 +3971,13 @@ yydefault: } case 198: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:1613 + // line internal/php7/php7.y:1593 { yyVAL.list = nil } case 199: yyDollar = yyS[yypt-5 : yypt+1] -// line internal/php7/php7.y:1617 + // line internal/php7/php7.y:1597 { yyVAL.list = append(yyDollar[1].list, &ast.StmtCase{ Node: ast.Node{ @@ -4011,7 +3991,7 @@ yydefault: } case 200: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:1629 + // line internal/php7/php7.y:1609 { yyVAL.list = append(yyDollar[1].list, &ast.StmtDefault{ Node: ast.Node{ @@ -4024,19 +4004,19 @@ yydefault: } case 201: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1643 + // line internal/php7/php7.y:1623 { yyVAL.token = yyDollar[1].token } case 202: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1647 + // line internal/php7/php7.y:1627 { yyVAL.token = yyDollar[1].token } case 203: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1654 + // line internal/php7/php7.y:1634 { yyVAL.node = &ast.StmtWhile{ Node: ast.Node{ @@ -4047,7 +4027,7 @@ yydefault: } case 204: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:1663 + // line internal/php7/php7.y:1643 { yyVAL.node = &ast.StmtWhile{ Node: ast.Node{ @@ -4067,7 +4047,7 @@ yydefault: } case 205: yyDollar = yyS[yypt-5 : yypt+1] -// line internal/php7/php7.y:1684 + // line internal/php7/php7.y:1664 { yyVAL.node = &ast.StmtIf{ Node: ast.Node{ @@ -4082,7 +4062,7 @@ yydefault: } case 206: yyDollar = yyS[yypt-6 : yypt+1] -// line internal/php7/php7.y:1697 + // line internal/php7/php7.y:1677 { yyDollar[1].node.(*ast.StmtIf).ElseIf = append(yyDollar[1].node.(*ast.StmtIf).ElseIf, &ast.StmtElseIf{ Node: ast.Node{ @@ -4101,13 +4081,13 @@ yydefault: } case 207: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1717 + // line internal/php7/php7.y:1697 { yyVAL.node = yyDollar[1].node } case 208: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:1721 + // line internal/php7/php7.y:1701 { yyDollar[1].node.(*ast.StmtIf).Else = &ast.StmtElse{ Node: ast.Node{ @@ -4123,7 +4103,7 @@ yydefault: } case 209: yyDollar = yyS[yypt-6 : yypt+1] -// line internal/php7/php7.y:1738 + // line internal/php7/php7.y:1718 { yyVAL.node = &ast.StmtIf{ Node: ast.Node{ @@ -4145,7 +4125,7 @@ yydefault: } case 210: yyDollar = yyS[yypt-7 : yypt+1] -// line internal/php7/php7.y:1758 + // line internal/php7/php7.y:1738 { yyDollar[1].node.(*ast.StmtIf).ElseIf = append(yyDollar[1].node.(*ast.StmtIf).ElseIf, &ast.StmtElseIf{ Node: ast.Node{ @@ -4169,7 +4149,7 @@ yydefault: } case 211: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:1783 + // line internal/php7/php7.y:1763 { yyDollar[1].node.(*ast.StmtIf).EndIfTkn = yyDollar[2].token yyDollar[1].node.(*ast.StmtIf).SemiColonTkn = yyDollar[3].token @@ -4179,7 +4159,7 @@ yydefault: } case 212: yyDollar = yyS[yypt-6 : yypt+1] -// line internal/php7/php7.y:1791 + // line internal/php7/php7.y:1771 { yyDollar[1].node.(*ast.StmtIf).Else = &ast.StmtElse{ Node: ast.Node{ @@ -4203,25 +4183,25 @@ yydefault: } case 213: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1816 + // line internal/php7/php7.y:1796 { yyVAL.list = yyDollar[1].list } case 214: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:1820 + // line internal/php7/php7.y:1800 { yyVAL.list = nil } case 215: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1827 + // line internal/php7/php7.y:1807 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 216: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:1831 + // line internal/php7/php7.y:1811 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4230,7 +4210,7 @@ yydefault: } case 217: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:1841 + // line internal/php7/php7.y:1821 { identifier := &ast.Identifier{ast.Node{}, yyDollar[4].token.Value} identifier.GetNode().Position = position.NewTokenPosition(yyDollar[4].token) @@ -4266,7 +4246,7 @@ yydefault: } case 218: yyDollar = yyS[yypt-6 : yypt+1] -// line internal/php7/php7.y:1875 + // line internal/php7/php7.y:1855 { identifier := &ast.Identifier{ast.Node{}, yyDollar[4].token.Value} identifier.GetNode().Position = position.NewTokenPosition(yyDollar[4].token) @@ -4303,25 +4283,25 @@ yydefault: } case 219: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:1913 + // line internal/php7/php7.y:1893 { yyVAL.node = nil } case 220: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1917 + // line internal/php7/php7.y:1897 { yyVAL.node = yyDollar[1].node } case 221: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1924 + // line internal/php7/php7.y:1904 { yyVAL.node = yyDollar[1].node } case 222: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:1928 + // line internal/php7/php7.y:1908 { yyVAL.node = &ast.Nullable{ast.Node{}, yyDollar[2].node} @@ -4333,7 +4313,7 @@ yydefault: } case 223: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1941 + // line internal/php7/php7.y:1921 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -4345,7 +4325,7 @@ yydefault: } case 224: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1951 + // line internal/php7/php7.y:1931 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -4357,19 +4337,19 @@ yydefault: } case 225: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1961 + // line internal/php7/php7.y:1941 { yyVAL.node = yyDollar[1].node } case 226: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:1968 + // line internal/php7/php7.y:1948 { yyVAL.node = nil } case 227: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:1972 + // line internal/php7/php7.y:1952 { yyVAL.node = yyDollar[2].node @@ -4378,7 +4358,7 @@ yydefault: } case 228: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:1982 + // line internal/php7/php7.y:1962 { yyVAL.node = &ast.ArgumentList{ast.Node{}, nil} @@ -4391,7 +4371,7 @@ yydefault: } case 229: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:1993 + // line internal/php7/php7.y:1973 { yyVAL.node = &ast.ArgumentList{ast.Node{}, yyDollar[2].list} @@ -4408,13 +4388,13 @@ yydefault: } case 230: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2011 + // line internal/php7/php7.y:1991 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 231: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2015 + // line internal/php7/php7.y:1995 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4423,7 +4403,7 @@ yydefault: } case 232: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2025 + // line internal/php7/php7.y:2005 { yyVAL.node = &ast.Argument{ast.Node{}, false, false, yyDollar[1].node} @@ -4435,7 +4415,7 @@ yydefault: } case 233: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:2035 + // line internal/php7/php7.y:2015 { yyVAL.node = &ast.Argument{ast.Node{}, true, false, yyDollar[2].node} @@ -4447,7 +4427,7 @@ yydefault: } case 234: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2048 + // line internal/php7/php7.y:2028 { yyDollar[1].node.(*ast.StmtGlobal).Vars = append(yyDollar[1].node.(*ast.StmtGlobal).Vars, yyDollar[3].node) yyDollar[1].node.(*ast.StmtGlobal).SeparatorTkns = append(yyDollar[1].node.(*ast.StmtGlobal).SeparatorTkns, yyDollar[2].token) @@ -4456,7 +4436,7 @@ yydefault: } case 235: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2055 + // line internal/php7/php7.y:2035 { yyVAL.node = &ast.StmtGlobal{ Vars: []ast.Vertex{yyDollar[1].node}, @@ -4464,13 +4444,13 @@ yydefault: } case 236: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2064 + // line internal/php7/php7.y:2044 { yyVAL.node = yyDollar[1].node } case 237: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2071 + // line internal/php7/php7.y:2051 { yyDollar[1].node.(*ast.StmtStatic).Vars = append(yyDollar[1].node.(*ast.StmtStatic).Vars, yyDollar[3].node) yyDollar[1].node.(*ast.StmtStatic).SeparatorTkns = append(yyDollar[1].node.(*ast.StmtStatic).SeparatorTkns, yyDollar[2].token) @@ -4479,7 +4459,7 @@ yydefault: } case 238: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2078 + // line internal/php7/php7.y:2058 { yyVAL.node = &ast.StmtStatic{ Vars: []ast.Vertex{yyDollar[1].node}, @@ -4487,7 +4467,7 @@ yydefault: } case 239: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2087 + // line internal/php7/php7.y:2067 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -4508,7 +4488,7 @@ yydefault: } case 240: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2106 + // line internal/php7/php7.y:2086 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -4530,19 +4510,19 @@ yydefault: } case 241: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:2129 + // line internal/php7/php7.y:2109 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 242: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:2133 + // line internal/php7/php7.y:2113 { yyVAL.list = []ast.Vertex{} } case 243: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:2140 + // line internal/php7/php7.y:2120 { yyVAL.node = &ast.StmtPropertyList{ast.Node{}, yyDollar[1].list, yyDollar[2].node, yyDollar[3].list} @@ -4556,7 +4536,7 @@ yydefault: } case 244: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:2152 + // line internal/php7/php7.y:2132 { yyVAL.node = &ast.StmtClassConstList{ Node: ast.Node{ @@ -4570,7 +4550,7 @@ yydefault: } case 245: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2164 + // line internal/php7/php7.y:2144 { yyVAL.node = &ast.StmtTraitUse{ast.Node{}, yyDollar[2].list, yyDollar[3].node} @@ -4582,7 +4562,7 @@ yydefault: } case 246: yyDollar = yyS[yypt-10 : yypt+1] -// line internal/php7/php7.y:2174 + // line internal/php7/php7.y:2154 { name := &ast.Identifier{ast.Node{}, yyDollar[4].token.Value} yyVAL.node = &ast.StmtClassMethod{ast.Node{}, yyDollar[3].token != nil, name, yyDollar[1].list, yyDollar[7].list, yyDollar[9].node, yyDollar[10].node} @@ -4613,13 +4593,13 @@ yydefault: } case 247: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2206 + // line internal/php7/php7.y:2186 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 248: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2210 + // line internal/php7/php7.y:2190 { switch n := lastNode(yyDollar[1].list).(type) { case *ast.NameName: @@ -4633,7 +4613,7 @@ yydefault: } case 249: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2222 + // line internal/php7/php7.y:2202 { yyVAL.node = &ast.StmtNop{ast.Node{}} @@ -4645,7 +4625,7 @@ yydefault: } case 250: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:2232 + // line internal/php7/php7.y:2212 { yyVAL.node = &ast.StmtTraitAdaptationList{ast.Node{}, nil} @@ -4657,7 +4637,7 @@ yydefault: } case 251: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2242 + // line internal/php7/php7.y:2222 { yyVAL.node = &ast.StmtTraitAdaptationList{ast.Node{}, yyDollar[2].list} @@ -4669,19 +4649,19 @@ yydefault: } case 252: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2255 + // line internal/php7/php7.y:2235 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 253: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:2259 + // line internal/php7/php7.y:2239 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 254: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:2266 + // line internal/php7/php7.y:2246 { yyVAL.node = yyDollar[1].node @@ -4691,7 +4671,7 @@ yydefault: } case 255: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:2274 + // line internal/php7/php7.y:2254 { yyVAL.node = yyDollar[1].node @@ -4701,7 +4681,7 @@ yydefault: } case 256: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2285 + // line internal/php7/php7.y:2265 { yyVAL.node = &ast.StmtTraitUsePrecedence{ast.Node{}, yyDollar[1].node, yyDollar[3].list} @@ -4714,7 +4694,7 @@ yydefault: } case 257: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2299 + // line internal/php7/php7.y:2279 { alias := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} yyVAL.node = &ast.StmtTraitUseAlias{ast.Node{}, yyDollar[1].node, nil, alias} @@ -4730,7 +4710,7 @@ yydefault: } case 258: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2313 + // line internal/php7/php7.y:2293 { alias := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} yyVAL.node = &ast.StmtTraitUseAlias{ast.Node{}, yyDollar[1].node, nil, alias} @@ -4746,7 +4726,7 @@ yydefault: } case 259: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:2327 + // line internal/php7/php7.y:2307 { alias := &ast.Identifier{ast.Node{}, yyDollar[4].token.Value} yyVAL.node = &ast.StmtTraitUseAlias{ast.Node{}, yyDollar[1].node, yyDollar[3].node, alias} @@ -4762,7 +4742,7 @@ yydefault: } case 260: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2341 + // line internal/php7/php7.y:2321 { yyVAL.node = &ast.StmtTraitUseAlias{ast.Node{}, yyDollar[1].node, yyDollar[3].node, nil} @@ -4775,7 +4755,7 @@ yydefault: } case 261: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2355 + // line internal/php7/php7.y:2335 { name := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.StmtTraitMethodRef{ast.Node{}, nil, name} @@ -4789,13 +4769,13 @@ yydefault: } case 262: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2367 + // line internal/php7/php7.y:2347 { yyVAL.node = yyDollar[1].node } case 263: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2374 + // line internal/php7/php7.y:2354 { target := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} yyVAL.node = &ast.StmtTraitMethodRef{ast.Node{}, yyDollar[1].node, target} @@ -4811,7 +4791,7 @@ yydefault: } case 264: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2391 + // line internal/php7/php7.y:2371 { yyVAL.node = &ast.StmtNop{ast.Node{}} @@ -4824,7 +4804,7 @@ yydefault: } case 265: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2402 + // line internal/php7/php7.y:2382 { yyVAL.node = &ast.StmtStmtList{ Node: ast.Node{ @@ -4837,13 +4817,13 @@ yydefault: } case 266: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2416 + // line internal/php7/php7.y:2396 { yyVAL.list = yyDollar[1].list } case 267: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2420 + // line internal/php7/php7.y:2400 { modifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.list = []ast.Vertex{modifier} @@ -4856,31 +4836,31 @@ yydefault: } case 268: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:2434 + // line internal/php7/php7.y:2414 { yyVAL.list = nil } case 269: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2438 + // line internal/php7/php7.y:2418 { yyVAL.list = yyDollar[1].list } case 270: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2445 + // line internal/php7/php7.y:2425 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 271: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:2449 + // line internal/php7/php7.y:2429 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 272: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2456 + // line internal/php7/php7.y:2436 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -4892,7 +4872,7 @@ yydefault: } case 273: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2466 + // line internal/php7/php7.y:2446 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -4904,7 +4884,7 @@ yydefault: } case 274: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2476 + // line internal/php7/php7.y:2456 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -4916,7 +4896,7 @@ yydefault: } case 275: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2486 + // line internal/php7/php7.y:2466 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -4928,7 +4908,7 @@ yydefault: } case 276: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2496 + // line internal/php7/php7.y:2476 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -4940,7 +4920,7 @@ yydefault: } case 277: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2506 + // line internal/php7/php7.y:2486 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -4952,7 +4932,7 @@ yydefault: } case 278: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2519 + // line internal/php7/php7.y:2499 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4961,13 +4941,13 @@ yydefault: } case 279: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2526 + // line internal/php7/php7.y:2506 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 280: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:2533 + // line internal/php7/php7.y:2513 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -4983,7 +4963,7 @@ yydefault: } case 281: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:2547 + // line internal/php7/php7.y:2527 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -5000,7 +4980,7 @@ yydefault: } case 282: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2565 + // line internal/php7/php7.y:2545 { lastNode(yyDollar[1].list).(*ast.StmtConstant).CommaTkn = yyDollar[2].token @@ -5008,13 +4988,13 @@ yydefault: } case 283: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2571 + // line internal/php7/php7.y:2551 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 284: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:2578 + // line internal/php7/php7.y:2558 { yyVAL.node = &ast.StmtConstant{ Node: ast.Node{ @@ -5034,7 +5014,7 @@ yydefault: } case 285: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:2599 + // line internal/php7/php7.y:2579 { yyVAL.node = &ast.StmtConstant{ Node: ast.Node{ @@ -5054,7 +5034,7 @@ yydefault: } case 286: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2620 + // line internal/php7/php7.y:2600 { yyDollar[1].node.(*ast.StmtEcho).Exprs = append(yyDollar[1].node.(*ast.StmtEcho).Exprs, yyDollar[3].node) yyDollar[1].node.(*ast.StmtEcho).SeparatorTkns = append(yyDollar[1].node.(*ast.StmtEcho).SeparatorTkns, yyDollar[2].token) @@ -5063,7 +5043,7 @@ yydefault: } case 287: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2627 + // line internal/php7/php7.y:2607 { yyVAL.node = &ast.StmtEcho{ Exprs: []ast.Vertex{yyDollar[1].node}, @@ -5071,25 +5051,25 @@ yydefault: } case 288: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2636 + // line internal/php7/php7.y:2616 { yyVAL.node = yyDollar[1].node } case 289: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:2643 + // line internal/php7/php7.y:2623 { yyVAL.list = nil } case 290: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2647 + // line internal/php7/php7.y:2627 { yyVAL.list = yyDollar[1].list } case 291: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2654 + // line internal/php7/php7.y:2634 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5098,13 +5078,13 @@ yydefault: } case 292: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2661 + // line internal/php7/php7.y:2641 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 293: yyDollar = yyS[yypt-8 : yypt+1] -// line internal/php7/php7.y:2668 + // line internal/php7/php7.y:2648 { if yyDollar[2].node != nil { yyVAL.node = &ast.StmtClass{ast.Node{}, nil, nil, yyDollar[2].node.(*ast.ArgumentList), yyDollar[3].ClassExtends, yyDollar[4].ClassImplements, yyDollar[7].list} @@ -5122,7 +5102,7 @@ yydefault: } case 294: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2687 + // line internal/php7/php7.y:2667 { if yyDollar[3].node != nil { yyVAL.node = &ast.ExprNew{ast.Node{}, yyDollar[2].node, yyDollar[3].node.(*ast.ArgumentList)} @@ -5137,7 +5117,7 @@ yydefault: } case 295: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:2700 + // line internal/php7/php7.y:2680 { yyVAL.node = &ast.ExprNew{ast.Node{}, yyDollar[2].node, nil} @@ -5149,7 +5129,7 @@ yydefault: } case 296: yyDollar = yyS[yypt-6 : yypt+1] -// line internal/php7/php7.y:2713 + // line internal/php7/php7.y:2693 { listNode := &ast.ExprList{ast.Node{}, yyDollar[3].list} yyVAL.node = &ast.ExprAssign{ast.Node{}, listNode, yyDollar[6].node} @@ -5166,7 +5146,7 @@ yydefault: } case 297: yyDollar = yyS[yypt-5 : yypt+1] -// line internal/php7/php7.y:2728 + // line internal/php7/php7.y:2708 { shortList := &ast.ExprShortList{ast.Node{}, yyDollar[2].list} yyVAL.node = &ast.ExprAssign{ast.Node{}, shortList, yyDollar[5].node} @@ -5182,7 +5162,7 @@ yydefault: } case 298: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2742 + // line internal/php7/php7.y:2722 { yyVAL.node = &ast.ExprAssign{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5195,7 +5175,7 @@ yydefault: } case 299: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:2753 + // line internal/php7/php7.y:2733 { yyVAL.node = &ast.ExprAssignReference{ast.Node{}, yyDollar[1].node, yyDollar[4].node} @@ -5209,7 +5189,7 @@ yydefault: } case 300: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:2765 + // line internal/php7/php7.y:2745 { yyVAL.node = &ast.ExprClone{ast.Node{}, yyDollar[2].node} @@ -5221,7 +5201,7 @@ yydefault: } case 301: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2775 + // line internal/php7/php7.y:2755 { yyVAL.node = &ast.ExprAssignPlus{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5234,7 +5214,7 @@ yydefault: } case 302: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2786 + // line internal/php7/php7.y:2766 { yyVAL.node = &ast.ExprAssignMinus{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5247,7 +5227,7 @@ yydefault: } case 303: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2797 + // line internal/php7/php7.y:2777 { yyVAL.node = &ast.ExprAssignMul{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5260,7 +5240,7 @@ yydefault: } case 304: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2808 + // line internal/php7/php7.y:2788 { yyVAL.node = &ast.ExprAssignPow{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5273,7 +5253,7 @@ yydefault: } case 305: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2819 + // line internal/php7/php7.y:2799 { yyVAL.node = &ast.ExprAssignDiv{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5286,7 +5266,7 @@ yydefault: } case 306: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2830 + // line internal/php7/php7.y:2810 { yyVAL.node = &ast.ExprAssignConcat{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5299,7 +5279,7 @@ yydefault: } case 307: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2841 + // line internal/php7/php7.y:2821 { yyVAL.node = &ast.ExprAssignMod{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5312,7 +5292,7 @@ yydefault: } case 308: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2852 + // line internal/php7/php7.y:2832 { yyVAL.node = &ast.ExprAssignBitwiseAnd{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5325,7 +5305,7 @@ yydefault: } case 309: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2863 + // line internal/php7/php7.y:2843 { yyVAL.node = &ast.ExprAssignBitwiseOr{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5338,7 +5318,7 @@ yydefault: } case 310: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2874 + // line internal/php7/php7.y:2854 { yyVAL.node = &ast.ExprAssignBitwiseXor{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5351,7 +5331,7 @@ yydefault: } case 311: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2885 + // line internal/php7/php7.y:2865 { yyVAL.node = &ast.ExprAssignShiftLeft{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5364,7 +5344,7 @@ yydefault: } case 312: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2896 + // line internal/php7/php7.y:2876 { yyVAL.node = &ast.ExprAssignShiftRight{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5377,7 +5357,7 @@ yydefault: } case 313: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2907 + // line internal/php7/php7.y:2887 { yyVAL.node = &ast.ExprAssignCoalesce{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5390,7 +5370,7 @@ yydefault: } case 314: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:2918 + // line internal/php7/php7.y:2898 { yyVAL.node = &ast.ExprPostInc{ast.Node{}, yyDollar[1].node} @@ -5403,7 +5383,7 @@ yydefault: } case 315: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:2929 + // line internal/php7/php7.y:2909 { yyVAL.node = &ast.ExprPreInc{ast.Node{}, yyDollar[2].node} @@ -5415,7 +5395,7 @@ yydefault: } case 316: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:2939 + // line internal/php7/php7.y:2919 { yyVAL.node = &ast.ExprPostDec{ast.Node{}, yyDollar[1].node} @@ -5428,7 +5408,7 @@ yydefault: } case 317: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:2950 + // line internal/php7/php7.y:2930 { yyVAL.node = &ast.ExprPreDec{ast.Node{}, yyDollar[2].node} @@ -5440,7 +5420,7 @@ yydefault: } case 318: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2960 + // line internal/php7/php7.y:2940 { yyVAL.node = &ast.ExprBinaryBooleanOr{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5453,7 +5433,7 @@ yydefault: } case 319: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2971 + // line internal/php7/php7.y:2951 { yyVAL.node = &ast.ExprBinaryBooleanAnd{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5466,7 +5446,7 @@ yydefault: } case 320: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2982 + // line internal/php7/php7.y:2962 { yyVAL.node = &ast.ExprBinaryLogicalOr{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5479,7 +5459,7 @@ yydefault: } case 321: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2993 + // line internal/php7/php7.y:2973 { yyVAL.node = &ast.ExprBinaryLogicalAnd{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5492,7 +5472,7 @@ yydefault: } case 322: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3004 + // line internal/php7/php7.y:2984 { yyVAL.node = &ast.ExprBinaryLogicalXor{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5505,7 +5485,7 @@ yydefault: } case 323: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3015 + // line internal/php7/php7.y:2995 { yyVAL.node = &ast.ExprBinaryBitwiseOr{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5518,7 +5498,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3026 + // line internal/php7/php7.y:3006 { yyVAL.node = &ast.ExprBinaryBitwiseAnd{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5531,7 +5511,7 @@ yydefault: } case 325: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3037 + // line internal/php7/php7.y:3017 { yyVAL.node = &ast.ExprBinaryBitwiseXor{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5544,7 +5524,7 @@ yydefault: } case 326: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3048 + // line internal/php7/php7.y:3028 { yyVAL.node = &ast.ExprBinaryConcat{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5556,7 +5536,7 @@ yydefault: } case 327: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3058 + // line internal/php7/php7.y:3038 { yyVAL.node = &ast.ExprBinaryPlus{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5569,7 +5549,7 @@ yydefault: } case 328: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3069 + // line internal/php7/php7.y:3049 { yyVAL.node = &ast.ExprBinaryMinus{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5582,7 +5562,7 @@ yydefault: } case 329: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3080 + // line internal/php7/php7.y:3060 { yyVAL.node = &ast.ExprBinaryMul{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5595,7 +5575,7 @@ yydefault: } case 330: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3091 + // line internal/php7/php7.y:3071 { yyVAL.node = &ast.ExprBinaryPow{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5608,7 +5588,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3102 + // line internal/php7/php7.y:3082 { yyVAL.node = &ast.ExprBinaryDiv{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5621,7 +5601,7 @@ yydefault: } case 332: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3113 + // line internal/php7/php7.y:3093 { yyVAL.node = &ast.ExprBinaryMod{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5634,7 +5614,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3124 + // line internal/php7/php7.y:3104 { yyVAL.node = &ast.ExprBinaryShiftLeft{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5647,7 +5627,7 @@ yydefault: } case 334: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3135 + // line internal/php7/php7.y:3115 { yyVAL.node = &ast.ExprBinaryShiftRight{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5660,7 +5640,7 @@ yydefault: } case 335: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3146 + // line internal/php7/php7.y:3126 { yyVAL.node = &ast.ExprUnaryPlus{ast.Node{}, yyDollar[2].node} @@ -5672,7 +5652,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3156 + // line internal/php7/php7.y:3136 { yyVAL.node = &ast.ExprUnaryMinus{ast.Node{}, yyDollar[2].node} @@ -5684,7 +5664,7 @@ yydefault: } case 337: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3166 + // line internal/php7/php7.y:3146 { yyVAL.node = &ast.ExprBooleanNot{ast.Node{}, yyDollar[2].node} @@ -5696,7 +5676,7 @@ yydefault: } case 338: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3176 + // line internal/php7/php7.y:3156 { yyVAL.node = &ast.ExprBitwiseNot{ast.Node{}, yyDollar[2].node} @@ -5708,7 +5688,7 @@ yydefault: } case 339: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3186 + // line internal/php7/php7.y:3166 { yyVAL.node = &ast.ExprBinaryIdentical{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5721,7 +5701,7 @@ yydefault: } case 340: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3197 + // line internal/php7/php7.y:3177 { yyVAL.node = &ast.ExprBinaryNotIdentical{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5734,7 +5714,7 @@ yydefault: } case 341: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3208 + // line internal/php7/php7.y:3188 { yyVAL.node = &ast.ExprBinaryEqual{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5747,7 +5727,7 @@ yydefault: } case 342: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3219 + // line internal/php7/php7.y:3199 { yyVAL.node = &ast.ExprBinaryNotEqual{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5761,7 +5741,7 @@ yydefault: } case 343: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3231 + // line internal/php7/php7.y:3211 { yyVAL.node = &ast.ExprBinarySmaller{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5774,7 +5754,7 @@ yydefault: } case 344: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3242 + // line internal/php7/php7.y:3222 { yyVAL.node = &ast.ExprBinarySmallerOrEqual{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5787,7 +5767,7 @@ yydefault: } case 345: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3253 + // line internal/php7/php7.y:3233 { yyVAL.node = &ast.ExprBinaryGreater{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5800,7 +5780,7 @@ yydefault: } case 346: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3264 + // line internal/php7/php7.y:3244 { yyVAL.node = &ast.ExprBinaryGreaterOrEqual{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5813,7 +5793,7 @@ yydefault: } case 347: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3275 + // line internal/php7/php7.y:3255 { yyVAL.node = &ast.ExprBinarySpaceship{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5826,7 +5806,7 @@ yydefault: } case 348: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3286 + // line internal/php7/php7.y:3266 { yyVAL.node = &ast.ExprInstanceOf{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5839,7 +5819,7 @@ yydefault: } case 349: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3297 + // line internal/php7/php7.y:3277 { yyVAL.node = &ast.ParserBrackets{ Node: ast.Node{ @@ -5856,13 +5836,13 @@ yydefault: } case 350: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3312 + // line internal/php7/php7.y:3292 { yyVAL.node = yyDollar[1].node } case 351: yyDollar = yyS[yypt-5 : yypt+1] -// line internal/php7/php7.y:3316 + // line internal/php7/php7.y:3296 { yyVAL.node = &ast.ExprTernary{ast.Node{}, yyDollar[1].node, yyDollar[3].node, yyDollar[5].node} @@ -5876,7 +5856,7 @@ yydefault: } case 352: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:3328 + // line internal/php7/php7.y:3308 { yyVAL.node = &ast.ExprTernary{ast.Node{}, yyDollar[1].node, nil, yyDollar[4].node} @@ -5890,7 +5870,7 @@ yydefault: } case 353: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3340 + // line internal/php7/php7.y:3320 { yyVAL.node = &ast.ExprBinaryCoalesce{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5903,13 +5883,13 @@ yydefault: } case 354: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3351 + // line internal/php7/php7.y:3331 { yyVAL.node = yyDollar[1].node } case 355: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3355 + // line internal/php7/php7.y:3335 { yyVAL.node = &ast.ExprCastInt{ast.Node{}, yyDollar[2].node} @@ -5922,7 +5902,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3366 + // line internal/php7/php7.y:3346 { yyVAL.node = &ast.ExprCastDouble{ast.Node{}, yyDollar[2].node} @@ -5935,7 +5915,7 @@ yydefault: } case 357: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3377 + // line internal/php7/php7.y:3357 { yyVAL.node = &ast.ExprCastString{ast.Node{}, yyDollar[2].node} @@ -5948,7 +5928,7 @@ yydefault: } case 358: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3388 + // line internal/php7/php7.y:3368 { yyVAL.node = &ast.ExprCastArray{ast.Node{}, yyDollar[2].node} @@ -5961,7 +5941,7 @@ yydefault: } case 359: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3399 + // line internal/php7/php7.y:3379 { yyVAL.node = &ast.ExprCastObject{ast.Node{}, yyDollar[2].node} @@ -5974,7 +5954,7 @@ yydefault: } case 360: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3410 + // line internal/php7/php7.y:3390 { yyVAL.node = &ast.ExprCastBool{ast.Node{}, yyDollar[2].node} @@ -5987,7 +5967,7 @@ yydefault: } case 361: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3421 + // line internal/php7/php7.y:3401 { yyVAL.node = &ast.ExprCastUnset{ast.Node{}, yyDollar[2].node} @@ -6000,7 +5980,7 @@ yydefault: } case 362: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3432 + // line internal/php7/php7.y:3412 { yyVAL.node = &ast.ExprExit{ast.Node{}, false, yyDollar[2].node} @@ -6020,7 +6000,7 @@ yydefault: } case 363: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3450 + // line internal/php7/php7.y:3430 { yyVAL.node = &ast.ExprErrorSuppress{ast.Node{}, yyDollar[2].node} @@ -6032,13 +6012,13 @@ yydefault: } case 364: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3460 + // line internal/php7/php7.y:3440 { yyVAL.node = yyDollar[1].node } case 365: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3464 + // line internal/php7/php7.y:3444 { yyVAL.node = &ast.ExprShellExec{ast.Node{}, yyDollar[2].list} @@ -6050,7 +6030,7 @@ yydefault: } case 366: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3474 + // line internal/php7/php7.y:3454 { yyVAL.node = &ast.ExprPrint{ast.Node{}, yyDollar[2].node} @@ -6062,7 +6042,7 @@ yydefault: } case 367: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3484 + // line internal/php7/php7.y:3464 { yyVAL.node = &ast.ExprYield{ast.Node{}, nil, nil} @@ -6074,7 +6054,7 @@ yydefault: } case 368: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3494 + // line internal/php7/php7.y:3474 { yyVAL.node = &ast.ExprYield{ast.Node{}, nil, yyDollar[2].node} @@ -6086,7 +6066,7 @@ yydefault: } case 369: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:3504 + // line internal/php7/php7.y:3484 { yyVAL.node = &ast.ExprYield{ast.Node{}, yyDollar[2].node, yyDollar[4].node} @@ -6099,7 +6079,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3515 + // line internal/php7/php7.y:3495 { yyVAL.node = &ast.ExprYieldFrom{ast.Node{}, yyDollar[2].node} @@ -6111,13 +6091,13 @@ yydefault: } case 371: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3525 + // line internal/php7/php7.y:3505 { yyVAL.node = yyDollar[1].node } case 372: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3529 + // line internal/php7/php7.y:3509 { yyVAL.node = yyDollar[2].node @@ -6138,7 +6118,7 @@ yydefault: } case 373: yyDollar = yyS[yypt-11 : yypt+1] -// line internal/php7/php7.y:3550 + // line internal/php7/php7.y:3530 { yyVAL.node = &ast.ExprClosure{ast.Node{}, yyDollar[2].token != nil, false, yyDollar[5].list, yyDollar[7].ClosureUse, yyDollar[8].node, yyDollar[10].list} @@ -6169,7 +6149,7 @@ yydefault: } case 374: yyDollar = yyS[yypt-9 : yypt+1] -// line internal/php7/php7.y:3577 + // line internal/php7/php7.y:3557 { yyVAL.node = &ast.ExprArrowFunction{ast.Node{}, yyDollar[2].token != nil, false, yyDollar[4].list, yyDollar[6].node, yyDollar[9].node} @@ -6195,25 +6175,25 @@ yydefault: } case 376: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:3607 + // line internal/php7/php7.y:3587 { yyVAL.token = nil } case 377: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3611 + // line internal/php7/php7.y:3591 { yyVAL.token = yyDollar[1].token } case 378: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:3618 + // line internal/php7/php7.y:3598 { yyVAL.ClosureUse = nil } case 379: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:3622 + // line internal/php7/php7.y:3602 { yyVAL.ClosureUse = &ast.ExprClosureUse{ast.Node{}, yyDollar[3].list} @@ -6227,7 +6207,7 @@ yydefault: } case 380: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3637 + // line internal/php7/php7.y:3617 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -6236,13 +6216,13 @@ yydefault: } case 381: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3644 + // line internal/php7/php7.y:3624 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 382: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3651 + // line internal/php7/php7.y:3631 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.ExprVariable{ast.Node{}, identifier} @@ -6256,7 +6236,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3663 + // line internal/php7/php7.y:3643 { identifier := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -6273,7 +6253,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3681 + // line internal/php7/php7.y:3661 { yyVAL.node = &ast.ExprFunctionCall{ast.Node{}, yyDollar[1].node, yyDollar[2].node.(*ast.ArgumentList)} @@ -6285,7 +6265,7 @@ yydefault: } case 385: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:3691 + // line internal/php7/php7.y:3671 { yyVAL.node = &ast.ExprStaticCall{ast.Node{}, yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*ast.ArgumentList)} @@ -6298,7 +6278,7 @@ yydefault: } case 386: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:3702 + // line internal/php7/php7.y:3682 { yyVAL.node = &ast.ExprStaticCall{ast.Node{}, yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*ast.ArgumentList)} @@ -6311,7 +6291,7 @@ yydefault: } case 387: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3713 + // line internal/php7/php7.y:3693 { yyVAL.node = &ast.ExprFunctionCall{ast.Node{}, yyDollar[1].node, yyDollar[2].node.(*ast.ArgumentList)} @@ -6323,7 +6303,7 @@ yydefault: } case 388: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3726 + // line internal/php7/php7.y:3706 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -6335,31 +6315,31 @@ yydefault: } case 389: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3736 + // line internal/php7/php7.y:3716 { yyVAL.node = yyDollar[1].node } case 390: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3743 + // line internal/php7/php7.y:3723 { yyVAL.node = yyDollar[1].node } case 391: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3747 + // line internal/php7/php7.y:3727 { yyVAL.node = yyDollar[1].node } case 392: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:3754 + // line internal/php7/php7.y:3734 { yyVAL.node = nil } case 393: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3758 + // line internal/php7/php7.y:3738 { yyVAL.node = &ast.ParserBrackets{ Node: ast.Node{ @@ -6376,13 +6356,13 @@ yydefault: } case 394: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:3776 + // line internal/php7/php7.y:3756 { yyVAL.list = []ast.Vertex{} } case 395: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3780 + // line internal/php7/php7.y:3760 { part := &ast.ScalarEncapsedStringPart{ast.Node{}, yyDollar[1].token.Value} yyVAL.list = []ast.Vertex{part} @@ -6392,25 +6372,25 @@ yydefault: } case 396: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3788 + // line internal/php7/php7.y:3768 { yyVAL.list = yyDollar[1].list } case 397: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:3795 + // line internal/php7/php7.y:3775 { yyVAL.node = nil } case 398: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3799 + // line internal/php7/php7.y:3779 { yyVAL.node = yyDollar[1].node } case 399: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:3806 + // line internal/php7/php7.y:3786 { yyVAL.node = &ast.ExprArray{ast.Node{}, yyDollar[3].list} @@ -6424,7 +6404,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3818 + // line internal/php7/php7.y:3798 { yyVAL.node = &ast.ExprShortArray{ast.Node{}, yyDollar[2].list} @@ -6437,7 +6417,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3829 + // line internal/php7/php7.y:3809 { yyVAL.node = &ast.ScalarString{ast.Node{}, yyDollar[1].token.Value} @@ -6449,7 +6429,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3842 + // line internal/php7/php7.y:3822 { yyVAL.node = &ast.ScalarLnumber{ast.Node{}, yyDollar[1].token.Value} @@ -6461,7 +6441,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3852 + // line internal/php7/php7.y:3832 { yyVAL.node = &ast.ScalarDnumber{ast.Node{}, yyDollar[1].token.Value} @@ -6473,7 +6453,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3862 + // line internal/php7/php7.y:3842 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -6485,7 +6465,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3872 + // line internal/php7/php7.y:3852 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -6497,7 +6477,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3882 + // line internal/php7/php7.y:3862 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -6509,7 +6489,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3892 + // line internal/php7/php7.y:3872 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -6521,7 +6501,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3902 + // line internal/php7/php7.y:3882 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -6533,7 +6513,7 @@ yydefault: } case 409: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3912 + // line internal/php7/php7.y:3892 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -6545,7 +6525,7 @@ yydefault: } case 410: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3922 + // line internal/php7/php7.y:3902 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -6557,7 +6537,7 @@ yydefault: } case 411: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3932 + // line internal/php7/php7.y:3912 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -6569,7 +6549,7 @@ yydefault: } case 412: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3942 + // line internal/php7/php7.y:3922 { encapsed := &ast.ScalarEncapsedStringPart{ast.Node{}, yyDollar[2].token.Value} yyVAL.node = &ast.ScalarHeredoc{ast.Node{}, yyDollar[1].token.Value, []ast.Vertex{encapsed}} @@ -6583,7 +6563,7 @@ yydefault: } case 413: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3954 + // line internal/php7/php7.y:3934 { yyVAL.node = &ast.ScalarHeredoc{ast.Node{}, yyDollar[1].token.Value, nil} @@ -6595,7 +6575,7 @@ yydefault: } case 414: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3964 + // line internal/php7/php7.y:3944 { yyVAL.node = &ast.ScalarEncapsed{ast.Node{}, yyDollar[2].list} @@ -6607,7 +6587,7 @@ yydefault: } case 415: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3974 + // line internal/php7/php7.y:3954 { yyVAL.node = &ast.ScalarHeredoc{ast.Node{}, yyDollar[1].token.Value, yyDollar[2].list} @@ -6619,19 +6599,19 @@ yydefault: } case 416: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3984 + // line internal/php7/php7.y:3964 { yyVAL.node = yyDollar[1].node } case 417: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3988 + // line internal/php7/php7.y:3968 { yyVAL.node = yyDollar[1].node } case 418: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3995 + // line internal/php7/php7.y:3975 { yyVAL.node = &ast.ExprConstFetch{ast.Node{}, yyDollar[1].node} @@ -6643,7 +6623,7 @@ yydefault: } case 419: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:4005 + // line internal/php7/php7.y:3985 { target := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} yyVAL.node = &ast.ExprClassConstFetch{ast.Node{}, yyDollar[1].node, target} @@ -6659,7 +6639,7 @@ yydefault: } case 420: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:4019 + // line internal/php7/php7.y:3999 { target := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} yyVAL.node = &ast.ExprClassConstFetch{ast.Node{}, yyDollar[1].node, target} @@ -6675,43 +6655,43 @@ yydefault: } case 421: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4036 + // line internal/php7/php7.y:4016 { yyVAL.node = yyDollar[1].node } case 422: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4040 + // line internal/php7/php7.y:4020 { yyVAL.node = yyDollar[1].node } case 423: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:4047 + // line internal/php7/php7.y:4027 { yyVAL.node = nil } case 424: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4051 + // line internal/php7/php7.y:4031 { yyVAL.node = yyDollar[1].node } case 425: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4058 + // line internal/php7/php7.y:4038 { yyVAL.node = yyDollar[1].node } case 426: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4065 + // line internal/php7/php7.y:4045 { yyVAL.node = yyDollar[1].node } case 427: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:4069 + // line internal/php7/php7.y:4049 { yyVAL.node = &ast.ParserBrackets{ Node: ast.Node{ @@ -6728,19 +6708,19 @@ yydefault: } case 428: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4084 + // line internal/php7/php7.y:4064 { yyVAL.node = yyDollar[1].node } case 429: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4091 + // line internal/php7/php7.y:4071 { yyVAL.node = yyDollar[1].node } case 430: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:4095 + // line internal/php7/php7.y:4075 { yyVAL.node = &ast.ParserBrackets{ Node: ast.Node{ @@ -6757,19 +6737,19 @@ yydefault: } case 431: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4110 + // line internal/php7/php7.y:4090 { yyVAL.node = yyDollar[1].node } case 432: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4117 + // line internal/php7/php7.y:4097 { yyVAL.node = yyDollar[1].node } case 433: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:4121 + // line internal/php7/php7.y:4101 { yyVAL.node = &ast.ExprArrayDimFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6782,7 +6762,7 @@ yydefault: } case 434: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:4132 + // line internal/php7/php7.y:4112 { yyVAL.node = &ast.ExprArrayDimFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6795,7 +6775,7 @@ yydefault: } case 435: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:4143 + // line internal/php7/php7.y:4123 { yyVAL.node = &ast.ExprArrayDimFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6808,7 +6788,7 @@ yydefault: } case 436: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:4154 + // line internal/php7/php7.y:4134 { yyVAL.node = &ast.ExprMethodCall{ast.Node{}, yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*ast.ArgumentList)} @@ -6821,25 +6801,25 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4165 + // line internal/php7/php7.y:4145 { yyVAL.node = yyDollar[1].node } case 438: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4172 + // line internal/php7/php7.y:4152 { yyVAL.node = yyDollar[1].node } case 439: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4176 + // line internal/php7/php7.y:4156 { yyVAL.node = yyDollar[1].node } case 440: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:4180 + // line internal/php7/php7.y:4160 { yyVAL.node = &ast.ExprPropertyFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6852,7 +6832,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4194 + // line internal/php7/php7.y:4174 { name := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.ExprVariable{ast.Node{}, name} @@ -6866,7 +6846,7 @@ yydefault: } case 442: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:4206 + // line internal/php7/php7.y:4186 { yyVAL.node = &ast.ExprVariable{ast.Node{}, yyDollar[3].node} @@ -6880,7 +6860,7 @@ yydefault: } case 443: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:4218 + // line internal/php7/php7.y:4198 { yyVAL.node = &ast.ExprVariable{ast.Node{}, yyDollar[2].node} @@ -6892,7 +6872,7 @@ yydefault: } case 444: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:4231 + // line internal/php7/php7.y:4211 { yyVAL.node = &ast.ExprStaticPropertyFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6905,7 +6885,7 @@ yydefault: } case 445: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:4242 + // line internal/php7/php7.y:4222 { yyVAL.node = &ast.ExprStaticPropertyFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6918,13 +6898,13 @@ yydefault: } case 446: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4256 + // line internal/php7/php7.y:4236 { yyVAL.node = yyDollar[1].node } case 447: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:4260 + // line internal/php7/php7.y:4240 { yyVAL.node = &ast.ExprArrayDimFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6937,7 +6917,7 @@ yydefault: } case 448: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:4271 + // line internal/php7/php7.y:4251 { yyVAL.node = &ast.ExprArrayDimFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6950,7 +6930,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:4282 + // line internal/php7/php7.y:4262 { yyVAL.node = &ast.ExprPropertyFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6963,7 +6943,7 @@ yydefault: } case 450: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:4293 + // line internal/php7/php7.y:4273 { yyVAL.node = &ast.ExprStaticPropertyFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6976,7 +6956,7 @@ yydefault: } case 451: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:4304 + // line internal/php7/php7.y:4284 { yyVAL.node = &ast.ExprStaticPropertyFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6989,7 +6969,7 @@ yydefault: } case 452: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4318 + // line internal/php7/php7.y:4298 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -7001,7 +6981,7 @@ yydefault: } case 453: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:4328 + // line internal/php7/php7.y:4308 { yyVAL.node = yyDollar[2].node @@ -7011,13 +6991,13 @@ yydefault: } case 454: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4336 + // line internal/php7/php7.y:4316 { yyVAL.node = yyDollar[1].node } case 455: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4343 + // line internal/php7/php7.y:4323 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -7029,7 +7009,7 @@ yydefault: } case 456: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:4353 + // line internal/php7/php7.y:4333 { yyVAL.node = yyDollar[2].node @@ -7039,31 +7019,31 @@ yydefault: } case 457: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4361 + // line internal/php7/php7.y:4341 { yyVAL.node = yyDollar[1].node } case 458: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4368 + // line internal/php7/php7.y:4348 { yyVAL.list = yyDollar[1].list } case 459: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:4375 + // line internal/php7/php7.y:4355 { yyVAL.node = &ast.ExprArrayItem{ast.Node{}, false, nil, nil} } case 460: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4379 + // line internal/php7/php7.y:4359 { yyVAL.node = yyDollar[1].node } case 461: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:4386 + // line internal/php7/php7.y:4366 { if len(yyDollar[1].list) == 0 { yyDollar[1].list = []ast.Vertex{&ast.ExprArrayItem{ast.Node{}, false, nil, nil}} @@ -7076,7 +7056,7 @@ yydefault: } case 462: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4397 + // line internal/php7/php7.y:4377 { if yyDollar[1].node.(*ast.ExprArrayItem).Key == nil && yyDollar[1].node.(*ast.ExprArrayItem).Val == nil { yyVAL.list = []ast.Vertex{} @@ -7086,7 +7066,7 @@ yydefault: } case 463: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:4408 + // line internal/php7/php7.y:4388 { yyVAL.node = &ast.ExprArrayItem{ast.Node{}, false, yyDollar[1].node, yyDollar[3].node} @@ -7099,7 +7079,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4419 + // line internal/php7/php7.y:4399 { yyVAL.node = &ast.ExprArrayItem{ast.Node{}, false, nil, yyDollar[1].node} @@ -7111,7 +7091,7 @@ yydefault: } case 465: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:4429 + // line internal/php7/php7.y:4409 { reference := &ast.ExprReference{ast.Node{}, yyDollar[4].node} yyVAL.node = &ast.ExprArrayItem{ast.Node{}, false, yyDollar[1].node, reference} @@ -7127,7 +7107,7 @@ yydefault: } case 466: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:4443 + // line internal/php7/php7.y:4423 { reference := &ast.ExprReference{ast.Node{}, yyDollar[2].node} yyVAL.node = &ast.ExprArrayItem{ast.Node{}, false, nil, reference} @@ -7141,7 +7121,7 @@ yydefault: } case 467: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:4455 + // line internal/php7/php7.y:4435 { yyVAL.node = &ast.ExprArrayItem{ast.Node{}, true, nil, yyDollar[2].node} @@ -7153,7 +7133,7 @@ yydefault: } case 468: yyDollar = yyS[yypt-6 : yypt+1] -// line internal/php7/php7.y:4465 + // line internal/php7/php7.y:4445 { // TODO: Cannot use list() as standalone expression listNode := &ast.ExprList{ast.Node{}, yyDollar[5].list} @@ -7172,7 +7152,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:4482 + // line internal/php7/php7.y:4462 { // TODO: Cannot use list() as standalone expression listNode := &ast.ExprList{ast.Node{}, yyDollar[3].list} @@ -7189,13 +7169,13 @@ yydefault: } case 470: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:4500 + // line internal/php7/php7.y:4480 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 471: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:4504 + // line internal/php7/php7.y:4484 { encapsed := &ast.ScalarEncapsedStringPart{ast.Node{}, yyDollar[2].token.Value} yyVAL.list = append(yyDollar[1].list, encapsed) @@ -7208,13 +7188,13 @@ yydefault: } case 472: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4515 + // line internal/php7/php7.y:4495 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 473: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:4519 + // line internal/php7/php7.y:4499 { encapsed := &ast.ScalarEncapsedStringPart{ast.Node{}, yyDollar[1].token.Value} yyVAL.list = []ast.Vertex{encapsed, yyDollar[2].node} @@ -7227,7 +7207,7 @@ yydefault: } case 474: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4533 + // line internal/php7/php7.y:4513 { name := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.ExprVariable{ast.Node{}, name} @@ -7241,7 +7221,7 @@ yydefault: } case 475: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:4545 + // line internal/php7/php7.y:4525 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -7258,7 +7238,7 @@ yydefault: } case 476: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:4560 + // line internal/php7/php7.y:4540 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -7277,7 +7257,7 @@ yydefault: } case 477: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:4577 + // line internal/php7/php7.y:4557 { variable := &ast.ExprVariable{ast.Node{}, yyDollar[2].node} @@ -7292,7 +7272,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:4590 + // line internal/php7/php7.y:4570 { name := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} variable := &ast.ExprVariable{ast.Node{}, name} @@ -7309,7 +7289,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-6 : yypt+1] -// line internal/php7/php7.y:4605 + // line internal/php7/php7.y:4585 { identifier := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -7328,7 +7308,7 @@ yydefault: } case 480: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:4622 + // line internal/php7/php7.y:4602 { yyVAL.node = yyDollar[2].node @@ -7338,7 +7318,7 @@ yydefault: } case 481: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4633 + // line internal/php7/php7.y:4613 { yyVAL.node = &ast.ScalarString{ast.Node{}, yyDollar[1].token.Value} @@ -7350,7 +7330,7 @@ yydefault: } case 482: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4643 + // line internal/php7/php7.y:4623 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(string(yyDollar[1].token.Value)); err == nil { @@ -7367,7 +7347,7 @@ yydefault: } case 483: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:4658 + // line internal/php7/php7.y:4638 { var lnumber *ast.ScalarLnumber // TODO: add option to handle 64 bit integer @@ -7393,7 +7373,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4682 + // line internal/php7/php7.y:4662 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.ExprVariable{ast.Node{}, identifier} @@ -7407,7 +7387,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-5 : yypt+1] -// line internal/php7/php7.y:4697 + // line internal/php7/php7.y:4677 { yyVAL.node = &ast.ExprIsset{ast.Node{}, yyDollar[3].list} @@ -7425,7 +7405,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:4713 + // line internal/php7/php7.y:4693 { exprBrackets := &ast.ParserBrackets{ Node: ast.Node{ @@ -7447,7 +7427,7 @@ yydefault: } case 487: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:4733 + // line internal/php7/php7.y:4713 { yyVAL.node = &ast.ExprInclude{ast.Node{}, yyDollar[2].node} @@ -7459,7 +7439,7 @@ yydefault: } case 488: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:4743 + // line internal/php7/php7.y:4723 { yyVAL.node = &ast.ExprIncludeOnce{ast.Node{}, yyDollar[2].node} @@ -7471,7 +7451,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:4753 + // line internal/php7/php7.y:4733 { exprBrackets := &ast.ParserBrackets{ Node: ast.Node{ @@ -7493,7 +7473,7 @@ yydefault: } case 490: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:4773 + // line internal/php7/php7.y:4753 { yyVAL.node = &ast.ExprRequire{ast.Node{}, yyDollar[2].node} @@ -7505,7 +7485,7 @@ yydefault: } case 491: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:4783 + // line internal/php7/php7.y:4763 { yyVAL.node = &ast.ExprRequireOnce{ast.Node{}, yyDollar[2].node} @@ -7517,13 +7497,13 @@ yydefault: } case 492: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4796 + // line internal/php7/php7.y:4776 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 493: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:4800 + // line internal/php7/php7.y:4780 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -7532,7 +7512,7 @@ yydefault: } case 494: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4810 + // line internal/php7/php7.y:4790 { yyVAL.node = yyDollar[1].node } diff --git a/internal/php7/php7.y b/internal/php7/php7.y index 8a2dfb4..2d9825a 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -1010,50 +1010,29 @@ statement: } | T_FOREACH '(' expr T_AS foreach_variable ')' foreach_statement { - switch n := $7.(type) { - case *ast.StmtForeach : - n.Expr = $3 - n.Var = $5 - case *ast.StmtAltForeach : - n.Expr = $3 - n.Var = $5 - } + $7.(*ast.StmtForeach).ForeachTkn = $1 + $7.(*ast.StmtForeach).OpenParenthesisTkn = $2 + $7.(*ast.StmtForeach).Expr = $3 + $7.(*ast.StmtForeach).AsTkn = $4 + $7.(*ast.StmtForeach).Var = $5 + $7.(*ast.StmtForeach).CloseParenthesisTkn = $6 + $7.(*ast.StmtForeach).Node.Position = position.NewTokenNodePosition($1, $7) $$ = $7 - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $7) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Foreach, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $4.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Var, $6.SkippedTokens) } | T_FOREACH '(' expr T_AS variable T_DOUBLE_ARROW foreach_variable ')' foreach_statement { - switch n := $9.(type) { - case *ast.StmtForeach : - n.Expr = $3 - n.Key = $5 - n.Var = $7 - case *ast.StmtAltForeach : - n.Expr = $3 - n.Key = $5 - n.Var = $7 - } + $9.(*ast.StmtForeach).ForeachTkn = $1 + $9.(*ast.StmtForeach).OpenParenthesisTkn = $2 + $9.(*ast.StmtForeach).Expr = $3 + $9.(*ast.StmtForeach).AsTkn = $4 + $9.(*ast.StmtForeach).Key = $5 + $9.(*ast.StmtForeach).DoubleArrowTkn = $6 + $9.(*ast.StmtForeach).Var = $7 + $9.(*ast.StmtForeach).CloseParenthesisTkn = $8 + $9.(*ast.StmtForeach).Node.Position = position.NewTokenNodePosition($1, $9) $$ = $9 - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $9) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Foreach, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $4.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Key, $6.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Var, $8.SkippedTokens) } | T_DECLARE '(' const_list ')' declare_statement { @@ -1500,29 +1479,30 @@ for_statement: foreach_statement: statement { - $$ = &ast.StmtForeach{ast.Node{}, nil, nil, nil, $1} - - // save position - $$.GetNode().Position = position.NewNodePosition($1) + $$ = &ast.StmtForeach{ + Node: ast.Node{ + Position: position.NewNodePosition($1), + }, + Stmt: $1, + } } | ':' inner_statement_list T_ENDFOREACH ';' { - stmtList := &ast.StmtStmtList{ + $$ = &ast.StmtForeach{ Node: ast.Node{ - Position: position.NewNodeListPosition($2), + Position: position.NewTokensPosition($1, $4), }, - Stmts: $2, + Alt: true, + ColonTkn: $1, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: position.NewNodeListPosition($2), + }, + Stmts: $2, + }, + EndForeachTkn: $3, + SemiColonTkn: $4, } - $$ = &ast.StmtAltForeach{ast.Node{}, nil, nil, nil, stmtList} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $4) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Cond, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.SkippedTokens) - yylex.(*Parser).setToken($$, token.SemiColon, $4.SkippedTokens) } ; diff --git a/internal/php7/php7_test.go b/internal/php7/php7_test.go index 06528b4..452a0a3 100644 --- a/internal/php7/php7_test.go +++ b/internal/php7/php7_test.go @@ -5590,7 +5590,7 @@ func TestPhp7(t *testing.T) { Stmts: []ast.Vertex{}, }, }, - &ast.StmtAltForeach{ + &ast.StmtForeach{ Node: ast.Node{ Position: &position.Position{ StartLine: 94, @@ -5599,6 +5599,7 @@ func TestPhp7(t *testing.T) { EndPos: 2014, }, }, + Alt: true, Expr: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ diff --git a/pkg/ast/ast.go b/pkg/ast/ast.go index 33713e7..aa2170a 100644 --- a/pkg/ast/ast.go +++ b/pkg/ast/ast.go @@ -27,7 +27,6 @@ type NodeVisitor interface { ArgumentList(n *ArgumentList) Argument(n *Argument) - StmtAltForeach(n *StmtAltForeach) StmtBreak(n *StmtBreak) StmtCase(n *StmtCase) StmtCatch(n *StmtCatch) diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 50235a7..516019f 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -175,19 +175,6 @@ func (n *ScalarString) Accept(v NodeVisitor) { v.ScalarString(n) } -// StmtAltForeach node -type StmtAltForeach struct { - Node - Expr Vertex - Key Vertex - Var Vertex - Stmt Vertex -} - -func (n *StmtAltForeach) Accept(v NodeVisitor) { - v.StmtAltForeach(n) -} - // StmtBreak node type StmtBreak struct { Node @@ -452,10 +439,19 @@ func (n *StmtFor) Accept(v NodeVisitor) { // StmtForeach node type StmtForeach struct { Node - Expr Vertex - Key Vertex - Var Vertex - Stmt Vertex + Alt bool + ForeachTkn *token.Token + OpenParenthesisTkn *token.Token + Expr Vertex + AsTkn *token.Token + Key Vertex + DoubleArrowTkn *token.Token + Var Vertex + CloseParenthesisTkn *token.Token + ColonTkn *token.Token + Stmt Vertex + EndForeachTkn *token.Token + SemiColonTkn *token.Token } func (n *StmtForeach) Accept(v NodeVisitor) { diff --git a/pkg/ast/traverser/dfs.go b/pkg/ast/traverser/dfs.go index cca893c..615c682 100644 --- a/pkg/ast/traverser/dfs.go +++ b/pkg/ast/traverser/dfs.go @@ -119,33 +119,6 @@ func (t *DFS) Traverse(n ast.Vertex) { t.Traverse(nn.Expr) t.visitor.Leave("Expr", true) } - case *ast.StmtAltForeach: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - if nn.Key != nil { - t.visitor.Enter("Key", true) - t.Traverse(nn.Key) - t.visitor.Leave("Key", true) - } - if nn.Var != nil { - t.visitor.Enter("Var", true) - t.Traverse(nn.Var) - t.visitor.Leave("Var", true) - } - if nn.Stmt != nil { - t.visitor.Enter("Stmt", true) - t.Traverse(nn.Stmt) - t.visitor.Leave("Stmt", true) - } case *ast.StmtBreak: if nn == nil { return diff --git a/pkg/ast/visitor/dump.go b/pkg/ast/visitor/dump.go index 5569a60..de06927 100644 --- a/pkg/ast/visitor/dump.go +++ b/pkg/ast/visitor/dump.go @@ -252,12 +252,6 @@ func (v *Dump) Argument(n *ast.Argument) { } } -func (v *Dump) StmtAltForeach(n *ast.StmtAltForeach) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtAltForeach{\n") - v.printNode(n.GetNode()) -} - func (v *Dump) StmtBreak(n *ast.StmtBreak) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtBreak{\n") diff --git a/pkg/ast/visitor/filter_parser_nodes.go b/pkg/ast/visitor/filter_parser_nodes.go index 0d7ce76..6ccd522 100644 --- a/pkg/ast/visitor/filter_parser_nodes.go +++ b/pkg/ast/visitor/filter_parser_nodes.go @@ -111,26 +111,6 @@ func (v *FilterParserNodes) StmtReturn(n *ast.StmtReturn) { } } -func (v *FilterParserNodes) StmtForeach(n *ast.StmtForeach) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) StmtAltForeach(n *ast.StmtAltForeach) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - func (v *FilterParserNodes) ExprYield(n *ast.ExprYield) { for { if nn, ok := n.Key.(*ast.ParserBrackets); ok { diff --git a/pkg/ast/visitor/filter_tokens.go b/pkg/ast/visitor/filter_tokens.go index d3ad950..6c86b92 100644 --- a/pkg/ast/visitor/filter_tokens.go +++ b/pkg/ast/visitor/filter_tokens.go @@ -213,3 +213,14 @@ func (v *FilterTokens) StmtUnset(n *ast.StmtUnset) { n.SemiColonTkn = nil n.SemiColonTkn = nil } + +func (v *FilterTokens) StmtForeach(n *ast.StmtForeach) { + n.ForeachTkn = nil + n.OpenParenthesisTkn = nil + n.AsTkn = nil + n.DoubleArrowTkn = nil + n.CloseParenthesisTkn = nil + n.ColonTkn = nil + n.EndForeachTkn = nil + n.SemiColonTkn = nil +} diff --git a/pkg/ast/visitor/null.go b/pkg/ast/visitor/null.go index 225a604..582033e 100644 --- a/pkg/ast/visitor/null.go +++ b/pkg/ast/visitor/null.go @@ -54,10 +54,6 @@ func (v *Null) Argument(_ *ast.Argument) { // do nothing } -func (v *Null) StmtAltForeach(_ *ast.StmtAltForeach) { - // do nothing -} - func (v *Null) StmtBreak(_ *ast.StmtBreak) { // do nothing } diff --git a/pkg/printer/pretty_printer.go b/pkg/printer/pretty_printer.go index 987655d..67d4571 100644 --- a/pkg/printer/pretty_printer.go +++ b/pkg/printer/pretty_printer.go @@ -297,8 +297,6 @@ func (p *PrettyPrinter) printNode(n ast.Vertex) { // stmt - case *ast.StmtAltForeach: - p.printStmtAltForeach(n) case *ast.StmtBreak: p.printStmtBreak(n) case *ast.StmtCase: @@ -1359,30 +1357,6 @@ func (p *PrettyPrinter) printStmtAltElse(n ast.Vertex) { } } -func (p *PrettyPrinter) printStmtAltForeach(n ast.Vertex) { - nn := n.(*ast.StmtAltForeach) - - io.WriteString(p.w, "foreach (") - p.Print(nn.Expr) - io.WriteString(p.w, " as ") - - if nn.Key != nil { - p.Print(nn.Key) - io.WriteString(p.w, " => ") - } - - p.Print(nn.Var) - - io.WriteString(p.w, ") :\n") - - s := nn.Stmt.(*ast.StmtStmtList) - p.printNodes(s.Stmts) - - io.WriteString(p.w, "\n") - p.printIndent() - io.WriteString(p.w, "endforeach;") -} - func (p *PrettyPrinter) printStmtAltIf(n ast.Vertex) { nn := n.(*ast.StmtIf) @@ -1749,6 +1723,11 @@ func (p *PrettyPrinter) printStmtAltFor(n ast.Vertex) { func (p *PrettyPrinter) printStmtForeach(n ast.Vertex) { nn := n.(*ast.StmtForeach) + if nn.Alt { + p.printStmtAltForeach(n) + return + } + io.WriteString(p.w, "foreach (") p.Print(nn.Expr) io.WriteString(p.w, " as ") @@ -1777,6 +1756,30 @@ func (p *PrettyPrinter) printStmtForeach(n ast.Vertex) { } } +func (p *PrettyPrinter) printStmtAltForeach(n ast.Vertex) { + nn := n.(*ast.StmtForeach) + + io.WriteString(p.w, "foreach (") + p.Print(nn.Expr) + io.WriteString(p.w, " as ") + + if nn.Key != nil { + p.Print(nn.Key) + io.WriteString(p.w, " => ") + } + + p.Print(nn.Var) + + io.WriteString(p.w, ") :\n") + + s := nn.Stmt.(*ast.StmtStmtList) + p.printNodes(s.Stmts) + + io.WriteString(p.w, "\n") + p.printIndent() + io.WriteString(p.w, "endforeach;") +} + func (p *PrettyPrinter) printStmtFunction(n ast.Vertex) { nn := n.(*ast.StmtFunction) diff --git a/pkg/printer/pretty_printer_test.go b/pkg/printer/pretty_printer_test.go index 54fcdd0..82ac6ef 100644 --- a/pkg/printer/pretty_printer_test.go +++ b/pkg/printer/pretty_printer_test.go @@ -2210,7 +2210,8 @@ func TestPrintAltForeach(t *testing.T) { p := printer.NewPrettyPrinter(o, " ") p.Print(&ast.StmtNamespace{ Stmts: []ast.Vertex{ - &ast.StmtAltForeach{ + &ast.StmtForeach{ + Alt: true, Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, Key: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("key")}}, Var: &ast.ExprReference{Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("val")}}}, diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index 0068785..b808de1 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -386,8 +386,6 @@ func (p *Printer) printNode(n ast.Vertex) { // stmt - case *ast.StmtAltForeach: - p.printStmtAltForeach(n) case *ast.StmtBreak: p.printStmtBreak(n) case *ast.StmtCase: @@ -1996,54 +1994,6 @@ func (p *Printer) printExprYield(n ast.Vertex) { // smtm -func (p *Printer) printStmtAltForeach(n ast.Vertex) { - nn := n.(*ast.StmtAltForeach) - p.printFreeFloating(nn, token.Start) - - p.write([]byte("foreach")) - p.printFreeFloating(nn, token.Foreach) - p.write([]byte("(")) - p.Print(nn.Expr) - p.printFreeFloating(nn, token.Expr) - if nn.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - p.write([]byte("as")) - - if nn.Key != nil { - if nn.Key.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - p.Print(nn.Key) - p.printFreeFloating(nn, token.Key) - p.write([]byte("=>")) - } else { - if nn.Var.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - } - - p.Print(nn.Var) - p.printFreeFloating(nn, token.Var) - - p.write([]byte(")")) - p.printFreeFloating(nn, token.Cond) - - p.write([]byte(":")) - s := nn.Stmt.(*ast.StmtStmtList) - p.printNodes(s.Stmts) - p.printFreeFloating(nn, token.Stmts) - - p.write([]byte("endforeach")) - p.printFreeFloating(nn, token.AltEnd) - p.printFreeFloating(nn, token.SemiColon) - if nn.GetNode().Tokens.IsEmpty() { - p.write([]byte(";")) - } - - p.printFreeFloating(nn, token.End) -} - func (p *Printer) printStmtBreak(n *ast.StmtBreak) { p.printToken(n.BreakTkn, "break") @@ -2407,42 +2357,50 @@ func (p *Printer) printStmtAltFor(n *ast.StmtFor) { p.printToken(n.SemiColonTkn, ";") } -func (p *Printer) printStmtForeach(n ast.Vertex) { - nn := n.(*ast.StmtForeach) - p.printFreeFloating(nn, token.Start) - - p.write([]byte("foreach")) - p.printFreeFloating(nn, token.Foreach) - p.write([]byte("(")) - - p.Print(nn.Expr) - p.printFreeFloating(nn, token.Expr) - if nn.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) +func (p *Printer) printStmtForeach(n *ast.StmtForeach) { + if n.Alt { + p.printStmtAltForeach(n) + return } - p.write([]byte("as")) + p.printToken(n.ForeachTkn, "foreach") + p.printToken(n.OpenParenthesisTkn, "(") + p.Print(n.Expr) + p.bufStart = " " + p.printToken(n.AsTkn, "as") + p.bufStart = " " + if n.Key != nil { + p.Print(n.Key) + p.printToken(n.DoubleArrowTkn, "=>") + } + p.Print(n.Var) + p.printToken(n.CloseParenthesisTkn, ")") + p.Print(n.Stmt) +} - if nn.Key != nil { - if nn.Key.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - p.Print(nn.Key) - p.printFreeFloating(nn, token.Key) - p.write([]byte("=>")) +func (p *Printer) printStmtAltForeach(n *ast.StmtForeach) { + p.printToken(n.ForeachTkn, "foreach") + p.printToken(n.OpenParenthesisTkn, "(") + p.Print(n.Expr) + p.bufStart = " " + p.printToken(n.AsTkn, "as") + p.bufStart = " " + if n.Key != nil { + p.Print(n.Key) + p.printToken(n.DoubleArrowTkn, "=>") + } + p.Print(n.Var) + p.printToken(n.CloseParenthesisTkn, ")") + p.printToken(n.ColonTkn, ":") + + if stmtList, ok := n.Stmt.(*ast.StmtStmtList); ok { + p.printNodes(stmtList.Stmts) } else { - if nn.Var.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } + p.Print(n.Stmt) } - p.Print(nn.Var) - p.printFreeFloating(nn, token.Var) - p.write([]byte(")")) - - p.Print(nn.Stmt) - - p.printFreeFloating(nn, token.End) + p.printToken(n.EndForeachTkn, "endforeach") + p.printToken(n.SemiColonTkn, ";") } func (p *Printer) printStmtFunction(n ast.Vertex) { diff --git a/pkg/printer/printer_test.go b/pkg/printer/printer_test.go index de97168..8956574 100644 --- a/pkg/printer/printer_test.go +++ b/pkg/printer/printer_test.go @@ -2667,7 +2667,8 @@ func TestPrinterPrintAltForeach(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&ast.StmtAltForeach{ + p.Print(&ast.StmtForeach{ + Alt: true, Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, },