diff --git a/internal/php5/parser_test.go b/internal/php5/parser_test.go index 0a8d776..725f642 100644 --- a/internal/php5/parser_test.go +++ b/internal/php5/parser_test.go @@ -12762,7 +12762,7 @@ func TestStmtBreak(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtAltWhile{ + &ast.StmtWhile{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12771,6 +12771,7 @@ func TestStmtBreak(t *testing.T) { EndPos: 34, }, }, + Alt: true, Cond: &ast.ScalarLnumber{ Node: ast.Node{ Position: &position.Position{ diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 953db89..d6165d2 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:6215 +// line internal/php5/php5.y:6209 type simpleIndirectReference struct { all []*ast.ExprVariable @@ -2315,7 +2315,7 @@ yydefault: case 1: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:275 +// line internal/php5/php5.y:275 { yylex.(*Parser).rootNode = &ast.Root{ast.Node{}, yyDollar[1].list} yylex.(*Parser).rootNode.GetNode().Position = position.NewNodeListPosition(yyDollar[1].list) @@ -2324,7 +2324,7 @@ yydefault: } case 2: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:285 +// line internal/php5/php5.y:285 { if inlineHtmlNode, ok := yyDollar[2].node.(*ast.StmtInlineHtml); ok && len(yyDollar[1].list) > 0 { prevNode := lastNode(yyDollar[1].list) @@ -2337,13 +2337,13 @@ yydefault: } case 3: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:296 +// line internal/php5/php5.y:296 { yyVAL.list = []ast.Vertex{} } case 4: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:303 +// line internal/php5/php5.y:303 { yyVAL.list = []ast.Vertex{ &ast.NameNamePart{ @@ -2357,7 +2357,7 @@ yydefault: } case 5: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:315 +// line internal/php5/php5.y:315 { yyVAL.list = append(yyDollar[1].list, &ast.NameNamePart{ Node: ast.Node{ @@ -2370,32 +2370,32 @@ yydefault: } case 6: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:329 +// line internal/php5/php5.y:329 { // error yyVAL.node = nil } case 7: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:334 +// line internal/php5/php5.y:334 { yyVAL.node = yyDollar[1].node } case 8: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:338 +// line internal/php5/php5.y:338 { yyVAL.node = yyDollar[1].node } case 9: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:342 +// line internal/php5/php5.y:342 { yyVAL.node = yyDollar[1].node } case 10: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:346 +// line internal/php5/php5.y:346 { yyVAL.node = &ast.StmtHaltCompiler{ Node: ast.Node{ @@ -2409,7 +2409,7 @@ yydefault: } case 11: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:358 +// line internal/php5/php5.y:358 { yyVAL.node = &ast.StmtNamespace{ Node: ast.Node{ @@ -2427,7 +2427,7 @@ yydefault: } case 12: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:374 +// line internal/php5/php5.y:374 { yyVAL.node = &ast.StmtNamespace{ Node: ast.Node{ @@ -2447,7 +2447,7 @@ yydefault: } case 13: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:392 +// line internal/php5/php5.y:392 { yyVAL.node = &ast.StmtNamespace{ Node: ast.Node{ @@ -2461,7 +2461,7 @@ yydefault: } case 14: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:404 +// line internal/php5/php5.y:404 { yyVAL.node = &ast.StmtUse{ Node: ast.Node{ @@ -2474,7 +2474,7 @@ yydefault: } case 15: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:415 +// line internal/php5/php5.y:415 { yyVAL.node = &ast.StmtUse{ Node: ast.Node{ @@ -2493,7 +2493,7 @@ yydefault: } case 16: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:432 +// line internal/php5/php5.y:432 { yyVAL.node = &ast.StmtUse{ Node: ast.Node{ @@ -2512,7 +2512,7 @@ yydefault: } case 17: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:449 +// line internal/php5/php5.y:449 { yyDollar[1].node.(*ast.StmtConstList).SemiColonTkn = yyDollar[2].token yyDollar[1].node.(*ast.StmtConstList).Node.Position = position.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token) @@ -2520,7 +2520,7 @@ yydefault: } case 18: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:458 +// line internal/php5/php5.y:458 { yyDollar[1].list[len(yyDollar[1].list)-1].(*ast.StmtUseDeclaration).CommaTkn = yyDollar[2].token @@ -2528,13 +2528,13 @@ yydefault: } case 19: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:464 +// line internal/php5/php5.y:464 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 20: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:471 +// line internal/php5/php5.y:471 { yyVAL.node = &ast.StmtUseDeclaration{ Node: ast.Node{ @@ -2550,7 +2550,7 @@ yydefault: } case 21: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:485 +// line internal/php5/php5.y:485 { yyVAL.node = &ast.StmtUseDeclaration{ Node: ast.Node{ @@ -2573,7 +2573,7 @@ yydefault: } case 22: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:506 +// line internal/php5/php5.y:506 { yyVAL.node = &ast.StmtUseDeclaration{ Node: ast.Node{ @@ -2590,7 +2590,7 @@ yydefault: } case 23: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:521 +// line internal/php5/php5.y:521 { yyVAL.node = &ast.StmtUseDeclaration{ Node: ast.Node{ @@ -2614,7 +2614,7 @@ yydefault: } case 24: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:546 +// line internal/php5/php5.y:546 { yyDollar[1].list[len(yyDollar[1].list)-1].(*ast.StmtUseDeclaration).CommaTkn = yyDollar[2].token @@ -2622,13 +2622,13 @@ yydefault: } case 25: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:552 +// line internal/php5/php5.y:552 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 26: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:559 +// line internal/php5/php5.y:559 { yyVAL.node = &ast.StmtUseDeclaration{ Node: ast.Node{ @@ -2644,7 +2644,7 @@ yydefault: } case 27: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:573 +// line internal/php5/php5.y:573 { yyVAL.node = &ast.StmtUseDeclaration{ Node: ast.Node{ @@ -2667,7 +2667,7 @@ yydefault: } case 28: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:594 +// line internal/php5/php5.y:594 { yyVAL.node = &ast.StmtUseDeclaration{ Node: ast.Node{ @@ -2684,7 +2684,7 @@ yydefault: } case 29: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:609 +// line internal/php5/php5.y:609 { yyVAL.node = &ast.StmtUseDeclaration{ Node: ast.Node{ @@ -2708,7 +2708,7 @@ yydefault: } case 30: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:634 +// line internal/php5/php5.y:634 { yyDollar[1].list[len(yyDollar[1].list)-1].(*ast.StmtUseDeclaration).CommaTkn = yyDollar[2].token @@ -2716,13 +2716,13 @@ yydefault: } case 31: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:640 +// line internal/php5/php5.y:640 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 32: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:647 +// line internal/php5/php5.y:647 { yyVAL.node = &ast.StmtUseDeclaration{ Node: ast.Node{ @@ -2738,7 +2738,7 @@ yydefault: } case 33: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:661 +// line internal/php5/php5.y:661 { yyVAL.node = &ast.StmtUseDeclaration{ Node: ast.Node{ @@ -2761,7 +2761,7 @@ yydefault: } case 34: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:682 +// line internal/php5/php5.y:682 { yyVAL.node = &ast.StmtUseDeclaration{ Node: ast.Node{ @@ -2778,7 +2778,7 @@ yydefault: } case 35: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:697 +// line internal/php5/php5.y:697 { yyVAL.node = &ast.StmtUseDeclaration{ Node: ast.Node{ @@ -2802,7 +2802,7 @@ yydefault: } case 36: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:722 +// line internal/php5/php5.y:722 { constList := yyDollar[1].node.(*ast.StmtConstList) constList.Node.Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[5].node) @@ -2827,7 +2827,7 @@ yydefault: } case 37: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:745 +// line internal/php5/php5.y:745 { yyVAL.node = &ast.StmtConstList{ Node: ast.Node{ @@ -2855,7 +2855,7 @@ yydefault: } case 38: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:774 +// line internal/php5/php5.y:774 { if inlineHtmlNode, ok := yyDollar[2].node.(*ast.StmtInlineHtml); ok && len(yyDollar[1].list) > 0 { prevNode := lastNode(yyDollar[1].list) @@ -2868,38 +2868,38 @@ yydefault: } case 39: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:785 +// line internal/php5/php5.y:785 { yyVAL.list = []ast.Vertex{} } case 40: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:793 +// line internal/php5/php5.y:793 { // error yyVAL.node = nil } case 41: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:798 +// line internal/php5/php5.y:798 { yyVAL.node = yyDollar[1].node } case 42: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:802 +// line internal/php5/php5.y:802 { yyVAL.node = yyDollar[1].node } case 43: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:806 +// line internal/php5/php5.y:806 { yyVAL.node = yyDollar[1].node } case 44: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:810 +// line internal/php5/php5.y:810 { yyVAL.node = &ast.StmtHaltCompiler{ Node: ast.Node{ @@ -2913,13 +2913,13 @@ yydefault: } case 45: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:826 +// line internal/php5/php5.y:826 { yyVAL.node = yyDollar[1].node } case 46: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:830 +// line internal/php5/php5.y:830 { label := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.StmtLabel{ast.Node{}, label} @@ -2934,7 +2934,7 @@ yydefault: } case 47: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:846 +// line internal/php5/php5.y:846 { yyVAL.node = &ast.StmtStmtList{ Node: ast.Node{ @@ -2947,7 +2947,7 @@ yydefault: } case 48: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:857 +// line internal/php5/php5.y:857 { pos := position.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node) if yyDollar[5].node != nil { @@ -2971,7 +2971,7 @@ yydefault: } case 49: yyDollar = yyS[yypt-8 : yypt+1] - // line internal/php5/php5.y:879 +// line internal/php5/php5.y:879 { yyVAL.node = &ast.StmtIf{ Node: ast.Node{ @@ -2997,26 +2997,19 @@ yydefault: } case 50: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:903 +// line internal/php5/php5.y:903 { - switch n := yyDollar[3].node.(type) { - case *ast.StmtWhile: - n.Cond = yyDollar[2].node - case *ast.StmtAltWhile: - n.Cond = yyDollar[2].node - } + yyDollar[3].node.(*ast.StmtWhile).WhileTkn = yyDollar[1].token + yyDollar[3].node.(*ast.StmtWhile).OpenParenthesisTkn = yyDollar[2].node.(*ast.ParserBrackets).OpenBracketTkn + yyDollar[3].node.(*ast.StmtWhile).Cond = yyDollar[2].node.(*ast.ParserBrackets).Child + yyDollar[3].node.(*ast.StmtWhile).CloseParenthesisTkn = yyDollar[2].node.(*ast.ParserBrackets).CloseBracketTkn + yyDollar[3].node.(*ast.StmtWhile).Node.Position = position.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node) yyVAL.node = yyDollar[3].node - - // save position - yyVAL.node.GetNode().Position = position.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node) - - // save comments - yylex.(*Parser).setFreeFloating(yyVAL.node, token.Start, yyDollar[1].token.SkippedTokens) } case 51: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:920 +// line internal/php5/php5.y:913 { yyVAL.node = &ast.StmtDo{ast.Node{}, yyDollar[2].node, yyDollar[4].node} @@ -3031,7 +3024,7 @@ yydefault: } case 52: yyDollar = yyS[yypt-9 : yypt+1] - // line internal/php5/php5.y:933 +// line internal/php5/php5.y:926 { switch n := yyDollar[9].node.(type) { case *ast.StmtFor: @@ -3058,7 +3051,7 @@ yydefault: } case 53: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:958 +// line internal/php5/php5.y:951 { switch n := yyDollar[3].node.(type) { case *ast.StmtSwitch: @@ -3079,7 +3072,7 @@ yydefault: } case 54: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:977 +// line internal/php5/php5.y:970 { yyVAL.node = &ast.StmtBreak{ast.Node{}, nil} @@ -3093,7 +3086,7 @@ yydefault: } case 55: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:989 +// line internal/php5/php5.y:982 { yyVAL.node = &ast.StmtBreak{ast.Node{}, yyDollar[2].node} @@ -3107,7 +3100,7 @@ yydefault: } case 56: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1001 +// line internal/php5/php5.y:994 { yyVAL.node = &ast.StmtContinue{ast.Node{}, nil} @@ -3121,7 +3114,7 @@ yydefault: } case 57: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1013 +// line internal/php5/php5.y:1006 { yyVAL.node = &ast.StmtContinue{ast.Node{}, yyDollar[2].node} @@ -3135,7 +3128,7 @@ yydefault: } case 58: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1025 +// line internal/php5/php5.y:1018 { yyVAL.node = &ast.StmtReturn{ast.Node{}, nil} @@ -3149,7 +3142,7 @@ yydefault: } case 59: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1037 +// line internal/php5/php5.y:1030 { yyVAL.node = &ast.StmtReturn{ast.Node{}, yyDollar[2].node} @@ -3163,7 +3156,7 @@ yydefault: } case 60: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1049 +// line internal/php5/php5.y:1042 { yyVAL.node = &ast.StmtReturn{ast.Node{}, yyDollar[2].node} @@ -3177,7 +3170,7 @@ yydefault: } case 61: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1061 +// line internal/php5/php5.y:1054 { yyVAL.node = &ast.StmtExpression{ast.Node{}, yyDollar[1].node} @@ -3191,7 +3184,7 @@ yydefault: } case 62: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1073 +// line internal/php5/php5.y:1066 { yyVAL.node = &ast.StmtGlobal{ast.Node{}, yyDollar[2].list} @@ -3205,7 +3198,7 @@ yydefault: } case 63: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1085 +// line internal/php5/php5.y:1078 { yyVAL.node = &ast.StmtStatic{ast.Node{}, yyDollar[2].list} @@ -3219,7 +3212,7 @@ yydefault: } case 64: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1097 +// line internal/php5/php5.y:1090 { yyVAL.node = &ast.StmtEcho{ast.Node{}, yyDollar[2].list} @@ -3234,7 +3227,7 @@ yydefault: } case 65: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1110 +// line internal/php5/php5.y:1103 { yyVAL.node = &ast.StmtInlineHtml{ast.Node{}, yyDollar[1].token.Value} @@ -3246,7 +3239,7 @@ yydefault: } case 66: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1120 +// line internal/php5/php5.y:1113 { yyVAL.node = &ast.StmtExpression{ast.Node{}, yyDollar[1].node} @@ -3260,7 +3253,7 @@ yydefault: } case 67: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:1132 +// line internal/php5/php5.y:1125 { yyVAL.node = &ast.StmtUnset{ast.Node{}, yyDollar[3].list} @@ -3276,7 +3269,7 @@ yydefault: } case 68: yyDollar = yyS[yypt-8 : yypt+1] - // line internal/php5/php5.y:1146 +// line internal/php5/php5.y:1139 { if yyDollar[6].node == nil { switch n := yyDollar[8].node.(type) { @@ -3317,7 +3310,7 @@ yydefault: } case 69: yyDollar = yyS[yypt-8 : yypt+1] - // line internal/php5/php5.y:1184 +// line internal/php5/php5.y:1177 { if yyDollar[6].node == nil { switch n := yyDollar[8].node.(type) { @@ -3358,7 +3351,7 @@ yydefault: } case 70: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:1222 +// line internal/php5/php5.y:1215 { yyVAL.node = yyDollar[5].node yyVAL.node.(*ast.StmtDeclare).Consts = yyDollar[3].list @@ -3373,7 +3366,7 @@ yydefault: } case 71: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1235 +// line internal/php5/php5.y:1228 { yyVAL.node = &ast.StmtNop{ast.Node{}} @@ -3386,7 +3379,7 @@ yydefault: } case 72: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php5/php5.y:1246 +// line internal/php5/php5.y:1239 { yyVAL.node = &ast.StmtTry{ast.Node{}, yyDollar[3].list, yyDollar[5].list, yyDollar[6].node} @@ -3404,7 +3397,7 @@ yydefault: } case 73: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1262 +// line internal/php5/php5.y:1255 { yyVAL.node = &ast.StmtThrow{ast.Node{}, yyDollar[2].node} @@ -3418,7 +3411,7 @@ yydefault: } case 74: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1274 +// line internal/php5/php5.y:1267 { label := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} yyVAL.node = &ast.StmtGoto{ast.Node{}, label} @@ -3435,13 +3428,13 @@ yydefault: } case 75: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1292 +// line internal/php5/php5.y:1285 { yyVAL.list = []ast.Vertex{} } case 76: yyDollar = yyS[yypt-9 : yypt+1] - // line internal/php5/php5.y:1296 +// line internal/php5/php5.y:1289 { identifier := &ast.Identifier{ast.Node{}, yyDollar[4].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -3463,13 +3456,13 @@ yydefault: } case 77: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1319 +// line internal/php5/php5.y:1312 { yyVAL.node = nil } case 78: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:1323 +// line internal/php5/php5.y:1316 { yyVAL.node = &ast.StmtFinally{ast.Node{}, yyDollar[3].list} @@ -3483,31 +3476,31 @@ yydefault: } case 79: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1338 +// line internal/php5/php5.y:1331 { yyVAL.list = yyDollar[1].list } case 80: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1342 +// line internal/php5/php5.y:1335 { yyVAL.list = []ast.Vertex{} } case 81: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1349 +// line internal/php5/php5.y:1342 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 82: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1353 +// line internal/php5/php5.y:1346 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 83: yyDollar = yyS[yypt-8 : yypt+1] - // line internal/php5/php5.y:1360 +// line internal/php5/php5.y:1353 { identifier := &ast.Identifier{ast.Node{}, yyDollar[4].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -3528,13 +3521,13 @@ yydefault: } case 84: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1382 +// line internal/php5/php5.y:1375 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 85: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1386 +// line internal/php5/php5.y:1379 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3543,49 +3536,49 @@ yydefault: } case 86: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1396 +// line internal/php5/php5.y:1389 { yyVAL.node = yyDollar[1].node } case 87: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1403 +// line internal/php5/php5.y:1396 { yyVAL.node = yyDollar[1].node } case 88: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1410 +// line internal/php5/php5.y:1403 { yyVAL.node = yyDollar[1].node } case 89: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1417 +// line internal/php5/php5.y:1410 { yyVAL.token = nil } case 90: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1421 +// line internal/php5/php5.y:1414 { yyVAL.token = yyDollar[1].token } case 91: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1428 +// line internal/php5/php5.y:1421 { yyVAL.token = nil } case 92: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1432 +// line internal/php5/php5.y:1425 { yyVAL.token = yyDollar[1].token } case 93: yyDollar = yyS[yypt-9 : yypt+1] - // line internal/php5/php5.y:1439 +// line internal/php5/php5.y:1432 { 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} @@ -3609,7 +3602,7 @@ yydefault: } case 94: yyDollar = yyS[yypt-7 : yypt+1] - // line internal/php5/php5.y:1464 +// line internal/php5/php5.y:1457 { name := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} switch n := yyDollar[1].node.(type) { @@ -3637,7 +3630,7 @@ yydefault: } case 95: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php5/php5.y:1490 +// line internal/php5/php5.y:1483 { name := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} yyVAL.node = &ast.StmtInterface{ast.Node{}, name, yyDollar[3].InterfaceExtends, yyDollar[5].list} @@ -3654,7 +3647,7 @@ yydefault: } case 96: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1509 +// line internal/php5/php5.y:1502 { yyVAL.node = &ast.StmtClass{ast.Node{}, nil, nil, nil, nil, nil, nil} @@ -3666,7 +3659,7 @@ yydefault: } case 97: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1519 +// line internal/php5/php5.y:1512 { classModifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.StmtClass{ast.Node{}, nil, []ast.Vertex{classModifier}, nil, nil, nil, nil} @@ -3681,7 +3674,7 @@ yydefault: } case 98: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1532 +// line internal/php5/php5.y:1525 { yyVAL.node = &ast.StmtTrait{ast.Node{}, nil, nil} @@ -3693,7 +3686,7 @@ yydefault: } case 99: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1542 +// line internal/php5/php5.y:1535 { classModifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.StmtClass{ast.Node{}, nil, []ast.Vertex{classModifier}, nil, nil, nil, nil} @@ -3708,13 +3701,13 @@ yydefault: } case 100: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1558 +// line internal/php5/php5.y:1551 { yyVAL.ClassExtends = nil } case 101: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1562 +// line internal/php5/php5.y:1555 { yyVAL.ClassExtends = &ast.StmtClassExtends{ast.Node{}, yyDollar[2].node} @@ -3726,19 +3719,19 @@ yydefault: } case 102: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1575 +// line internal/php5/php5.y:1568 { yyVAL.token = yyDollar[1].token } case 103: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1582 +// line internal/php5/php5.y:1575 { yyVAL.InterfaceExtends = nil } case 104: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1586 +// line internal/php5/php5.y:1579 { yyVAL.InterfaceExtends = &ast.StmtInterfaceExtends{ast.Node{}, yyDollar[2].list} @@ -3750,13 +3743,13 @@ yydefault: } case 105: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1599 +// line internal/php5/php5.y:1592 { yyVAL.ClassImplements = nil } case 106: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1603 +// line internal/php5/php5.y:1596 { yyVAL.ClassImplements = &ast.StmtClassImplements{ast.Node{}, yyDollar[2].list} @@ -3768,13 +3761,13 @@ yydefault: } case 107: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1616 +// line internal/php5/php5.y:1609 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 108: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1620 +// line internal/php5/php5.y:1613 { switch n := lastNode(yyDollar[1].list).(type) { case *ast.NameName: @@ -3788,13 +3781,13 @@ yydefault: } case 109: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1632 +// line internal/php5/php5.y:1625 { yyVAL.node = nil } case 110: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1636 +// line internal/php5/php5.y:1629 { yyVAL.node = yyDollar[2].node @@ -3803,13 +3796,13 @@ yydefault: } case 111: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1646 +// line internal/php5/php5.y:1639 { yyVAL.node = yyDollar[1].node } case 112: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1650 +// line internal/php5/php5.y:1643 { yyVAL.node = &ast.ExprReference{ast.Node{}, yyDollar[2].node} @@ -3821,7 +3814,7 @@ yydefault: } case 113: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:1660 +// line internal/php5/php5.y:1653 { yyVAL.node = &ast.ExprList{ast.Node{}, yyDollar[3].list} @@ -3835,7 +3828,7 @@ yydefault: } case 114: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1675 +// line internal/php5/php5.y:1668 { yyVAL.node = &ast.StmtFor{ast.Node{}, nil, nil, nil, yyDollar[1].node} @@ -3844,7 +3837,7 @@ yydefault: } case 115: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:1682 +// line internal/php5/php5.y:1675 { stmtList := &ast.StmtStmtList{ Node: ast.Node{ @@ -3865,7 +3858,7 @@ yydefault: } case 116: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1704 +// line internal/php5/php5.y:1697 { yyVAL.node = &ast.StmtForeach{ast.Node{}, nil, nil, nil, yyDollar[1].node} @@ -3874,7 +3867,7 @@ yydefault: } case 117: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:1711 +// line internal/php5/php5.y:1704 { stmtList := &ast.StmtStmtList{ Node: ast.Node{ @@ -3895,7 +3888,7 @@ yydefault: } case 118: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1734 +// line internal/php5/php5.y:1727 { yyVAL.node = &ast.StmtDeclare{ast.Node{}, false, nil, yyDollar[1].node} @@ -3904,7 +3897,7 @@ yydefault: } case 119: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:1741 +// line internal/php5/php5.y:1734 { stmtList := &ast.StmtStmtList{ Node: ast.Node{ @@ -3925,7 +3918,7 @@ yydefault: } case 120: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1764 +// line internal/php5/php5.y:1757 { yyVAL.list = []ast.Vertex{ &ast.StmtConstant{ @@ -3947,7 +3940,7 @@ yydefault: } case 121: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:1784 +// line internal/php5/php5.y:1777 { lastNode(yyDollar[1].list).(*ast.StmtConstant).CommaTkn = yyDollar[2].token yyVAL.list = append(yyDollar[1].list, &ast.StmtConstant{ @@ -3968,7 +3961,7 @@ yydefault: } case 122: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1807 +// line internal/php5/php5.y:1800 { caseList := &ast.StmtCaseList{ast.Node{}, yyDollar[2].list} yyVAL.node = &ast.StmtSwitch{ast.Node{}, nil, caseList} @@ -3983,7 +3976,7 @@ yydefault: } case 123: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:1820 +// line internal/php5/php5.y:1813 { caseList := &ast.StmtCaseList{ast.Node{}, yyDollar[3].list} yyVAL.node = &ast.StmtSwitch{ast.Node{}, nil, caseList} @@ -3999,7 +3992,7 @@ yydefault: } case 124: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:1834 +// line internal/php5/php5.y:1827 { caseList := &ast.StmtCaseList{ast.Node{}, yyDollar[2].list} yyVAL.node = &ast.StmtAltSwitch{ast.Node{}, nil, caseList} @@ -4016,7 +4009,7 @@ yydefault: } case 125: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:1849 +// line internal/php5/php5.y:1842 { caseList := &ast.StmtCaseList{ast.Node{}, yyDollar[3].list} @@ -4035,13 +4028,13 @@ yydefault: } case 126: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1870 +// line internal/php5/php5.y:1863 { yyVAL.list = []ast.Vertex{} } case 127: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:1874 +// line internal/php5/php5.y:1867 { _case := &ast.StmtCase{ast.Node{}, yyDollar[3].node, yyDollar[5].list} yyVAL.list = append(yyDollar[1].list, _case) @@ -4056,7 +4049,7 @@ yydefault: } case 128: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:1887 +// line internal/php5/php5.y:1880 { _default := &ast.StmtDefault{ast.Node{}, yyDollar[4].list} yyVAL.list = append(yyDollar[1].list, _default) @@ -4071,55 +4064,56 @@ yydefault: } case 129: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1904 +// line internal/php5/php5.y:1897 { yyVAL.token = yyDollar[1].token } case 130: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1908 +// line internal/php5/php5.y:1901 { yyVAL.token = yyDollar[1].token } case 131: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1916 +// line internal/php5/php5.y:1909 { - yyVAL.node = &ast.StmtWhile{ast.Node{}, nil, yyDollar[1].node} - - // save position - yyVAL.node.GetNode().Position = position.NewNodePosition(yyDollar[1].node) + yyVAL.node = &ast.StmtWhile{ + Node: ast.Node{ + Position: position.NewNodePosition(yyDollar[1].node), + }, + Stmt: yyDollar[1].node, + } } case 132: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:1923 +// line internal/php5/php5.y:1918 { - stmtList := &ast.StmtStmtList{ + yyVAL.node = &ast.StmtWhile{ 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, + }, + EndWhileTkn: yyDollar[3].token, + SemiColonTkn: yyDollar[4].token, } - yyVAL.node = &ast.StmtAltWhile{ast.Node{}, 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 133: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1947 +// line internal/php5/php5.y:1941 { yyVAL.list = nil } case 134: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:1951 +// line internal/php5/php5.y:1945 { yyVAL.list = append(yyDollar[1].list, &ast.StmtElseIf{ Node: ast.Node{ @@ -4134,13 +4128,13 @@ yydefault: } case 135: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1968 +// line internal/php5/php5.y:1962 { yyVAL.list = nil } case 136: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:1972 +// line internal/php5/php5.y:1966 { yyVAL.list = append(yyDollar[1].list, &ast.StmtElseIf{ Node: ast.Node{ @@ -4162,13 +4156,13 @@ yydefault: } case 137: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1996 +// line internal/php5/php5.y:1990 { yyVAL.node = nil } case 138: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2000 +// line internal/php5/php5.y:1994 { yyVAL.node = &ast.StmtElse{ Node: ast.Node{ @@ -4180,13 +4174,13 @@ yydefault: } case 139: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:2014 +// line internal/php5/php5.y:2008 { yyVAL.node = nil } case 140: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2018 +// line internal/php5/php5.y:2012 { yyVAL.node = &ast.StmtElse{ Node: ast.Node{ @@ -4205,25 +4199,25 @@ yydefault: } case 141: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2039 +// line internal/php5/php5.y:2033 { yyVAL.list = yyDollar[1].list } case 142: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:2043 +// line internal/php5/php5.y:2037 { yyVAL.list = nil } case 143: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2050 +// line internal/php5/php5.y:2044 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 144: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2054 +// line internal/php5/php5.y:2048 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4232,7 +4226,7 @@ yydefault: } case 145: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:2064 +// line internal/php5/php5.y:2058 { identifier := &ast.Identifier{ast.Node{}, yyDollar[4].token.Value} identifier.GetNode().Position = position.NewTokenPosition(yyDollar[4].token) @@ -4268,7 +4262,7 @@ yydefault: } case 146: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php5/php5.y:2098 +// line internal/php5/php5.y:2092 { identifier := &ast.Identifier{ast.Node{}, yyDollar[4].token.Value} identifier.GetNode().Position = position.NewTokenPosition(yyDollar[4].token) @@ -4305,13 +4299,13 @@ yydefault: } case 147: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:2137 +// line internal/php5/php5.y:2131 { yyVAL.node = nil } case 148: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2141 +// line internal/php5/php5.y:2135 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -4323,7 +4317,7 @@ yydefault: } case 149: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2151 +// line internal/php5/php5.y:2145 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -4335,13 +4329,13 @@ yydefault: } case 150: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2161 +// line internal/php5/php5.y:2155 { yyVAL.node = yyDollar[1].node } case 151: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2169 +// line internal/php5/php5.y:2163 { yyVAL.node = &ast.ArgumentList{ast.Node{}, nil} @@ -4354,7 +4348,7 @@ yydefault: } case 152: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2180 +// line internal/php5/php5.y:2174 { yyVAL.node = &ast.ArgumentList{ast.Node{}, yyDollar[2].list} @@ -4367,7 +4361,7 @@ yydefault: } case 153: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2191 +// line internal/php5/php5.y:2185 { arg := &ast.Argument{ast.Node{}, false, false, yyDollar[2].node} yyVAL.node = &ast.ArgumentList{ast.Node{}, []ast.Vertex{arg}} @@ -4382,13 +4376,13 @@ yydefault: } case 154: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2208 +// line internal/php5/php5.y:2202 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 155: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2212 +// line internal/php5/php5.y:2206 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4397,7 +4391,7 @@ yydefault: } case 156: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2222 +// line internal/php5/php5.y:2216 { yyVAL.node = &ast.Argument{ast.Node{}, false, false, yyDollar[1].node} @@ -4409,7 +4403,7 @@ yydefault: } case 157: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2232 +// line internal/php5/php5.y:2226 { yyVAL.node = &ast.Argument{ast.Node{}, false, false, yyDollar[1].node} @@ -4421,7 +4415,7 @@ yydefault: } case 158: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2242 +// line internal/php5/php5.y:2236 { yyVAL.node = &ast.Argument{ast.Node{}, false, true, yyDollar[2].node} @@ -4433,7 +4427,7 @@ yydefault: } case 159: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2252 +// line internal/php5/php5.y:2246 { yyVAL.node = &ast.Argument{ast.Node{}, true, false, yyDollar[2].node} @@ -4445,7 +4439,7 @@ yydefault: } case 160: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2265 +// line internal/php5/php5.y:2259 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4454,13 +4448,13 @@ yydefault: } case 161: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2272 +// line internal/php5/php5.y:2266 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 162: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2280 +// line internal/php5/php5.y:2274 { name := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.ExprVariable{ast.Node{}, name} @@ -4474,7 +4468,7 @@ yydefault: } case 163: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2292 +// line internal/php5/php5.y:2286 { yyVAL.node = &ast.ExprVariable{ast.Node{}, yyDollar[2].node} @@ -4486,7 +4480,7 @@ yydefault: } case 164: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:2302 +// line internal/php5/php5.y:2296 { yyVAL.node = &ast.ExprVariable{ast.Node{}, yyDollar[3].node} @@ -4500,7 +4494,7 @@ yydefault: } case 165: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2318 +// line internal/php5/php5.y:2312 { identifier := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -4518,7 +4512,7 @@ yydefault: } case 166: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:2334 +// line internal/php5/php5.y:2328 { identifier := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -4537,7 +4531,7 @@ yydefault: } case 167: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2351 +// line internal/php5/php5.y:2345 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -4554,7 +4548,7 @@ yydefault: } case 168: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2366 +// line internal/php5/php5.y:2360 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -4572,19 +4566,19 @@ yydefault: } case 169: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2386 +// line internal/php5/php5.y:2380 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 170: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:2390 +// line internal/php5/php5.y:2384 { yyVAL.list = []ast.Vertex{} } case 171: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2398 +// line internal/php5/php5.y:2392 { yyVAL.node = &ast.StmtPropertyList{ast.Node{}, yyDollar[1].list, nil, yyDollar[2].list} @@ -4598,7 +4592,7 @@ yydefault: } case 172: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2410 +// line internal/php5/php5.y:2404 { yyDollar[1].node.(*ast.StmtClassConstList).SemiColonTkn = yyDollar[2].token yyDollar[1].node.(*ast.StmtClassConstList).Node.Position = position.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token) @@ -4606,13 +4600,13 @@ yydefault: } case 173: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2416 +// line internal/php5/php5.y:2410 { yyVAL.node = yyDollar[1].node } case 174: yyDollar = yyS[yypt-8 : yypt+1] - // line internal/php5/php5.y:2420 +// line internal/php5/php5.y:2414 { 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} @@ -4643,7 +4637,7 @@ yydefault: } case 175: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2452 +// line internal/php5/php5.y:2446 { yyVAL.node = &ast.StmtTraitUse{ast.Node{}, yyDollar[2].list, yyDollar[3].node} @@ -4655,13 +4649,13 @@ yydefault: } case 176: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2465 +// line internal/php5/php5.y:2459 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 177: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2469 +// line internal/php5/php5.y:2463 { switch n := lastNode(yyDollar[1].list).(type) { case *ast.NameName: @@ -4675,7 +4669,7 @@ yydefault: } case 178: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2481 +// line internal/php5/php5.y:2475 { yyVAL.node = &ast.StmtNop{ast.Node{}} @@ -4687,7 +4681,7 @@ yydefault: } case 179: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2491 +// line internal/php5/php5.y:2485 { yyVAL.node = &ast.StmtTraitAdaptationList{ast.Node{}, yyDollar[2].list} @@ -4699,31 +4693,31 @@ yydefault: } case 180: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:2504 +// line internal/php5/php5.y:2498 { yyVAL.list = nil } case 181: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2508 +// line internal/php5/php5.y:2502 { yyVAL.list = yyDollar[1].list } case 182: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2515 +// line internal/php5/php5.y:2509 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 183: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2519 +// line internal/php5/php5.y:2513 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 184: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2526 +// line internal/php5/php5.y:2520 { yyVAL.node = yyDollar[1].node @@ -4733,7 +4727,7 @@ yydefault: } case 185: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2534 +// line internal/php5/php5.y:2528 { yyVAL.node = yyDollar[1].node @@ -4743,7 +4737,7 @@ yydefault: } case 186: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2545 +// line internal/php5/php5.y:2539 { yyVAL.node = &ast.StmtTraitUsePrecedence{ast.Node{}, yyDollar[1].node, yyDollar[3].list} @@ -4756,13 +4750,13 @@ yydefault: } case 187: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2559 +// line internal/php5/php5.y:2553 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 188: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2563 +// line internal/php5/php5.y:2557 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4771,7 +4765,7 @@ yydefault: } case 189: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2573 +// line internal/php5/php5.y:2567 { name := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.StmtTraitMethodRef{ast.Node{}, nil, name} @@ -4785,13 +4779,13 @@ yydefault: } case 190: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2585 +// line internal/php5/php5.y:2579 { yyVAL.node = yyDollar[1].node } case 191: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2592 +// line internal/php5/php5.y:2586 { target := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} yyVAL.node = &ast.StmtTraitMethodRef{ast.Node{}, yyDollar[1].node, target} @@ -4807,7 +4801,7 @@ yydefault: } case 192: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:2609 +// line internal/php5/php5.y:2603 { alias := &ast.Identifier{ast.Node{}, yyDollar[4].token.Value} yyVAL.node = &ast.StmtTraitUseAlias{ast.Node{}, yyDollar[1].node, yyDollar[3].node, alias} @@ -4823,7 +4817,7 @@ yydefault: } case 193: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2623 +// line internal/php5/php5.y:2617 { yyVAL.node = &ast.StmtTraitUseAlias{ast.Node{}, yyDollar[1].node, yyDollar[3].node, nil} @@ -4836,19 +4830,19 @@ yydefault: } case 194: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:2637 +// line internal/php5/php5.y:2631 { yyVAL.node = nil } case 195: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2641 +// line internal/php5/php5.y:2635 { yyVAL.node = yyDollar[1].node } case 196: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2648 +// line internal/php5/php5.y:2642 { yyVAL.node = &ast.StmtNop{ast.Node{}} @@ -4861,7 +4855,7 @@ yydefault: } case 197: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2659 +// line internal/php5/php5.y:2653 { yyVAL.node = &ast.StmtStmtList{ Node: ast.Node{ @@ -4874,13 +4868,13 @@ yydefault: } case 198: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2673 +// line internal/php5/php5.y:2667 { yyVAL.list = yyDollar[1].list } case 199: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2677 +// line internal/php5/php5.y:2671 { modifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.list = []ast.Vertex{modifier} @@ -4893,31 +4887,31 @@ yydefault: } case 200: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:2691 +// line internal/php5/php5.y:2685 { yyVAL.list = nil } case 201: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2695 +// line internal/php5/php5.y:2689 { yyVAL.list = yyDollar[1].list } case 202: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2702 +// line internal/php5/php5.y:2696 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 203: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2706 +// line internal/php5/php5.y:2700 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 204: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2713 +// line internal/php5/php5.y:2707 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -4929,7 +4923,7 @@ yydefault: } case 205: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2723 +// line internal/php5/php5.y:2717 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -4941,7 +4935,7 @@ yydefault: } case 206: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2733 +// line internal/php5/php5.y:2727 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -4953,7 +4947,7 @@ yydefault: } case 207: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2743 +// line internal/php5/php5.y:2737 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -4965,7 +4959,7 @@ yydefault: } case 208: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2753 +// line internal/php5/php5.y:2747 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -4977,7 +4971,7 @@ yydefault: } case 209: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2763 +// line internal/php5/php5.y:2757 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -4989,7 +4983,7 @@ yydefault: } case 210: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2776 +// line internal/php5/php5.y:2770 { identifier := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -5007,7 +5001,7 @@ yydefault: } case 211: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:2792 +// line internal/php5/php5.y:2786 { identifier := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -5026,7 +5020,7 @@ yydefault: } case 212: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2809 +// line internal/php5/php5.y:2803 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -5043,7 +5037,7 @@ yydefault: } case 213: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2824 +// line internal/php5/php5.y:2818 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -5061,7 +5055,7 @@ yydefault: } case 214: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:2843 +// line internal/php5/php5.y:2837 { constList := yyDollar[1].node.(*ast.StmtClassConstList) constList.Node.Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[5].node) @@ -5086,7 +5080,7 @@ yydefault: } case 215: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:2866 +// line internal/php5/php5.y:2860 { yyVAL.node = &ast.StmtClassConstList{ Node: ast.Node{ @@ -5114,7 +5108,7 @@ yydefault: } case 216: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2895 +// line internal/php5/php5.y:2889 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5123,25 +5117,25 @@ yydefault: } case 217: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2902 +// line internal/php5/php5.y:2896 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 218: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:2910 +// line internal/php5/php5.y:2904 { yyVAL.list = nil } case 219: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2914 +// line internal/php5/php5.y:2908 { yyVAL.list = yyDollar[1].list } case 220: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2921 +// line internal/php5/php5.y:2915 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5150,25 +5144,25 @@ yydefault: } case 221: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2928 +// line internal/php5/php5.y:2922 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 222: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2935 +// line internal/php5/php5.y:2929 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 223: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2939 +// line internal/php5/php5.y:2933 { yyVAL.list = yyDollar[1].list } case 224: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:2946 +// line internal/php5/php5.y:2940 { fetch := &ast.ExprArrayDimFetch{ast.Node{}, nil, yyDollar[3].node} yyVAL.list = append(yyDollar[1].list, fetch) @@ -5182,7 +5176,7 @@ yydefault: } case 225: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2958 +// line internal/php5/php5.y:2952 { fetch := &ast.ExprArrayDimFetch{ast.Node{}, nil, yyDollar[2].node} yyVAL.list = []ast.Vertex{fetch} @@ -5196,37 +5190,37 @@ yydefault: } case 226: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2973 +// line internal/php5/php5.y:2967 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 227: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2977 +// line internal/php5/php5.y:2971 { yyVAL.list = yyDollar[1].list } case 228: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2981 +// line internal/php5/php5.y:2975 { yyVAL.list = yyDollar[1].list } case 229: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:2988 +// line internal/php5/php5.y:2982 { yyVAL.list = nil } case 230: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2992 +// line internal/php5/php5.y:2986 { yyVAL.list = yyDollar[1].list } case 231: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2999 +// line internal/php5/php5.y:2993 { if yyDollar[3].node != nil { @@ -5242,7 +5236,7 @@ yydefault: } case 232: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php5/php5.y:3016 +// line internal/php5/php5.y:3010 { listNode := &ast.ExprList{ast.Node{}, yyDollar[3].list} yyVAL.node = &ast.ExprAssign{ast.Node{}, listNode, yyDollar[6].node} @@ -5259,7 +5253,7 @@ yydefault: } case 233: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3031 +// line internal/php5/php5.y:3025 { yyVAL.node = &ast.ExprAssign{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5272,7 +5266,7 @@ yydefault: } case 234: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:3042 +// line internal/php5/php5.y:3036 { yyVAL.node = &ast.ExprAssignReference{ast.Node{}, yyDollar[1].node, yyDollar[4].node} @@ -5286,7 +5280,7 @@ yydefault: } case 235: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php5/php5.y:3054 +// line internal/php5/php5.y:3048 { var _new *ast.ExprNew @@ -5313,7 +5307,7 @@ yydefault: } case 236: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3079 +// line internal/php5/php5.y:3073 { yyVAL.node = &ast.ExprClone{ast.Node{}, yyDollar[2].node} @@ -5325,7 +5319,7 @@ yydefault: } case 237: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3089 +// line internal/php5/php5.y:3083 { yyVAL.node = &ast.ExprAssignPlus{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5337,7 +5331,7 @@ yydefault: } case 238: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3099 +// line internal/php5/php5.y:3093 { yyVAL.node = &ast.ExprAssignMinus{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5350,7 +5344,7 @@ yydefault: } case 239: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3110 +// line internal/php5/php5.y:3104 { yyVAL.node = &ast.ExprAssignMul{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5363,7 +5357,7 @@ yydefault: } case 240: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3121 +// line internal/php5/php5.y:3115 { yyVAL.node = &ast.ExprAssignPow{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5376,7 +5370,7 @@ yydefault: } case 241: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3132 +// line internal/php5/php5.y:3126 { yyVAL.node = &ast.ExprAssignDiv{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5389,7 +5383,7 @@ yydefault: } case 242: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3143 +// line internal/php5/php5.y:3137 { yyVAL.node = &ast.ExprAssignConcat{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5402,7 +5396,7 @@ yydefault: } case 243: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3154 +// line internal/php5/php5.y:3148 { yyVAL.node = &ast.ExprAssignMod{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5415,7 +5409,7 @@ yydefault: } case 244: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3165 +// line internal/php5/php5.y:3159 { yyVAL.node = &ast.ExprAssignBitwiseAnd{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5428,7 +5422,7 @@ yydefault: } case 245: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3176 +// line internal/php5/php5.y:3170 { yyVAL.node = &ast.ExprAssignBitwiseOr{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5441,7 +5435,7 @@ yydefault: } case 246: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3187 +// line internal/php5/php5.y:3181 { yyVAL.node = &ast.ExprAssignBitwiseXor{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5454,7 +5448,7 @@ yydefault: } case 247: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3198 +// line internal/php5/php5.y:3192 { yyVAL.node = &ast.ExprAssignShiftLeft{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5467,7 +5461,7 @@ yydefault: } case 248: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3209 +// line internal/php5/php5.y:3203 { yyVAL.node = &ast.ExprAssignShiftRight{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5480,7 +5474,7 @@ yydefault: } case 249: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3220 +// line internal/php5/php5.y:3214 { yyVAL.node = &ast.ExprPostInc{ast.Node{}, yyDollar[1].node} @@ -5493,7 +5487,7 @@ yydefault: } case 250: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3231 +// line internal/php5/php5.y:3225 { yyVAL.node = &ast.ExprPreInc{ast.Node{}, yyDollar[2].node} @@ -5505,7 +5499,7 @@ yydefault: } case 251: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3241 +// line internal/php5/php5.y:3235 { yyVAL.node = &ast.ExprPostDec{ast.Node{}, yyDollar[1].node} @@ -5518,7 +5512,7 @@ yydefault: } case 252: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3252 +// line internal/php5/php5.y:3246 { yyVAL.node = &ast.ExprPreDec{ast.Node{}, yyDollar[2].node} @@ -5530,7 +5524,7 @@ yydefault: } case 253: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3262 +// line internal/php5/php5.y:3256 { yyVAL.node = &ast.ExprBinaryBooleanOr{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5543,7 +5537,7 @@ yydefault: } case 254: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3273 +// line internal/php5/php5.y:3267 { yyVAL.node = &ast.ExprBinaryBooleanAnd{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5556,7 +5550,7 @@ yydefault: } case 255: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3284 +// line internal/php5/php5.y:3278 { yyVAL.node = &ast.ExprBinaryLogicalOr{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5569,7 +5563,7 @@ yydefault: } case 256: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3295 +// line internal/php5/php5.y:3289 { yyVAL.node = &ast.ExprBinaryLogicalAnd{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5582,7 +5576,7 @@ yydefault: } case 257: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3306 +// line internal/php5/php5.y:3300 { yyVAL.node = &ast.ExprBinaryLogicalXor{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5595,7 +5589,7 @@ yydefault: } case 258: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3317 +// line internal/php5/php5.y:3311 { yyVAL.node = &ast.ExprBinaryBitwiseOr{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5608,7 +5602,7 @@ yydefault: } case 259: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3328 +// line internal/php5/php5.y:3322 { yyVAL.node = &ast.ExprBinaryBitwiseAnd{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5621,7 +5615,7 @@ yydefault: } case 260: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3339 +// line internal/php5/php5.y:3333 { yyVAL.node = &ast.ExprBinaryBitwiseXor{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5634,7 +5628,7 @@ yydefault: } case 261: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3350 +// line internal/php5/php5.y:3344 { yyVAL.node = &ast.ExprBinaryConcat{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5647,7 +5641,7 @@ yydefault: } case 262: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3361 +// line internal/php5/php5.y:3355 { yyVAL.node = &ast.ExprBinaryPlus{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5660,7 +5654,7 @@ yydefault: } case 263: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3372 +// line internal/php5/php5.y:3366 { yyVAL.node = &ast.ExprBinaryMinus{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5673,7 +5667,7 @@ yydefault: } case 264: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3383 +// line internal/php5/php5.y:3377 { yyVAL.node = &ast.ExprBinaryMul{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5686,7 +5680,7 @@ yydefault: } case 265: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3394 +// line internal/php5/php5.y:3388 { yyVAL.node = &ast.ExprBinaryPow{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5699,7 +5693,7 @@ yydefault: } case 266: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3405 +// line internal/php5/php5.y:3399 { yyVAL.node = &ast.ExprBinaryDiv{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5712,7 +5706,7 @@ yydefault: } case 267: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3416 +// line internal/php5/php5.y:3410 { yyVAL.node = &ast.ExprBinaryMod{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5725,7 +5719,7 @@ yydefault: } case 268: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3427 +// line internal/php5/php5.y:3421 { yyVAL.node = &ast.ExprBinaryShiftLeft{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5738,7 +5732,7 @@ yydefault: } case 269: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3438 +// line internal/php5/php5.y:3432 { yyVAL.node = &ast.ExprBinaryShiftRight{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5751,7 +5745,7 @@ yydefault: } case 270: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3449 +// line internal/php5/php5.y:3443 { yyVAL.node = &ast.ExprUnaryPlus{ast.Node{}, yyDollar[2].node} @@ -5763,7 +5757,7 @@ yydefault: } case 271: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3459 +// line internal/php5/php5.y:3453 { yyVAL.node = &ast.ExprUnaryMinus{ast.Node{}, yyDollar[2].node} @@ -5775,7 +5769,7 @@ yydefault: } case 272: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3469 +// line internal/php5/php5.y:3463 { yyVAL.node = &ast.ExprBooleanNot{ast.Node{}, yyDollar[2].node} @@ -5787,7 +5781,7 @@ yydefault: } case 273: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3479 +// line internal/php5/php5.y:3473 { yyVAL.node = &ast.ExprBitwiseNot{ast.Node{}, yyDollar[2].node} @@ -5799,7 +5793,7 @@ yydefault: } case 274: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3489 +// line internal/php5/php5.y:3483 { yyVAL.node = &ast.ExprBinaryIdentical{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5812,7 +5806,7 @@ yydefault: } case 275: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3500 +// line internal/php5/php5.y:3494 { yyVAL.node = &ast.ExprBinaryNotIdentical{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5825,7 +5819,7 @@ yydefault: } case 276: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3511 +// line internal/php5/php5.y:3505 { yyVAL.node = &ast.ExprBinaryEqual{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5838,7 +5832,7 @@ yydefault: } case 277: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3522 +// line internal/php5/php5.y:3516 { yyVAL.node = &ast.ExprBinaryNotEqual{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5852,7 +5846,7 @@ yydefault: } case 278: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3534 +// line internal/php5/php5.y:3528 { yyVAL.node = &ast.ExprBinarySmaller{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5865,7 +5859,7 @@ yydefault: } case 279: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3545 +// line internal/php5/php5.y:3539 { yyVAL.node = &ast.ExprBinarySmallerOrEqual{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5878,7 +5872,7 @@ yydefault: } case 280: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3556 +// line internal/php5/php5.y:3550 { yyVAL.node = &ast.ExprBinaryGreater{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5891,7 +5885,7 @@ yydefault: } case 281: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3567 +// line internal/php5/php5.y:3561 { yyVAL.node = &ast.ExprBinaryGreaterOrEqual{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5904,7 +5898,7 @@ yydefault: } case 282: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3578 +// line internal/php5/php5.y:3572 { yyVAL.node = &ast.ExprInstanceOf{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5917,19 +5911,19 @@ yydefault: } case 283: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3589 +// line internal/php5/php5.y:3583 { yyVAL.node = yyDollar[1].node } case 284: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3593 +// line internal/php5/php5.y:3587 { yyVAL.node = yyDollar[1].node } case 285: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:3597 +// line internal/php5/php5.y:3591 { yyVAL.node = yyDollar[2].node @@ -5961,7 +5955,7 @@ yydefault: } case 286: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:3627 +// line internal/php5/php5.y:3621 { yyVAL.node = &ast.ExprTernary{ast.Node{}, yyDollar[1].node, yyDollar[3].node, yyDollar[5].node} @@ -5975,7 +5969,7 @@ yydefault: } case 287: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:3639 +// line internal/php5/php5.y:3633 { yyVAL.node = &ast.ExprTernary{ast.Node{}, yyDollar[1].node, nil, yyDollar[4].node} @@ -5989,13 +5983,13 @@ yydefault: } case 288: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3651 +// line internal/php5/php5.y:3645 { yyVAL.node = yyDollar[1].node } case 289: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3655 +// line internal/php5/php5.y:3649 { yyVAL.node = &ast.ExprCastInt{ast.Node{}, yyDollar[2].node} @@ -6008,7 +6002,7 @@ yydefault: } case 290: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3666 +// line internal/php5/php5.y:3660 { yyVAL.node = &ast.ExprCastDouble{ast.Node{}, yyDollar[2].node} @@ -6021,7 +6015,7 @@ yydefault: } case 291: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3677 +// line internal/php5/php5.y:3671 { yyVAL.node = &ast.ExprCastString{ast.Node{}, yyDollar[2].node} @@ -6034,7 +6028,7 @@ yydefault: } case 292: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3688 +// line internal/php5/php5.y:3682 { yyVAL.node = &ast.ExprCastArray{ast.Node{}, yyDollar[2].node} @@ -6047,7 +6041,7 @@ yydefault: } case 293: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3699 +// line internal/php5/php5.y:3693 { yyVAL.node = &ast.ExprCastObject{ast.Node{}, yyDollar[2].node} @@ -6060,7 +6054,7 @@ yydefault: } case 294: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3710 +// line internal/php5/php5.y:3704 { yyVAL.node = &ast.ExprCastBool{ast.Node{}, yyDollar[2].node} @@ -6073,7 +6067,7 @@ yydefault: } case 295: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3721 +// line internal/php5/php5.y:3715 { yyVAL.node = &ast.ExprCastUnset{ast.Node{}, yyDollar[2].node} @@ -6086,7 +6080,7 @@ yydefault: } case 296: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3732 +// line internal/php5/php5.y:3726 { yyVAL.node = &ast.ExprExit{ast.Node{}, false, yyDollar[2].node} @@ -6106,7 +6100,7 @@ yydefault: } case 297: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3750 +// line internal/php5/php5.y:3744 { yyVAL.node = &ast.ExprErrorSuppress{ast.Node{}, yyDollar[2].node} @@ -6118,25 +6112,25 @@ yydefault: } case 298: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3760 +// line internal/php5/php5.y:3754 { yyVAL.node = yyDollar[1].node } case 299: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3764 +// line internal/php5/php5.y:3758 { yyVAL.node = yyDollar[1].node } case 300: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3768 +// line internal/php5/php5.y:3762 { yyVAL.node = yyDollar[1].node } case 301: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3772 +// line internal/php5/php5.y:3766 { yyVAL.node = &ast.ExprShellExec{ast.Node{}, yyDollar[2].list} @@ -6148,7 +6142,7 @@ yydefault: } case 302: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3782 +// line internal/php5/php5.y:3776 { yyVAL.node = &ast.ExprPrint{ast.Node{}, yyDollar[2].node} @@ -6160,7 +6154,7 @@ yydefault: } case 303: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3792 +// line internal/php5/php5.y:3786 { yyVAL.node = &ast.ExprYield{ast.Node{}, nil, nil} @@ -6172,7 +6166,7 @@ yydefault: } case 304: yyDollar = yyS[yypt-9 : yypt+1] - // line internal/php5/php5.y:3802 +// line internal/php5/php5.y:3796 { yyVAL.node = &ast.ExprClosure{ast.Node{}, yyDollar[2].token != nil, false, yyDollar[4].list, yyDollar[6].ClosureUse, nil, yyDollar[8].list} @@ -6199,7 +6193,7 @@ yydefault: } case 305: yyDollar = yyS[yypt-10 : yypt+1] - // line internal/php5/php5.y:3826 +// line internal/php5/php5.y:3820 { yyVAL.node = &ast.ExprClosure{ast.Node{}, yyDollar[3].token != nil, true, yyDollar[5].list, yyDollar[7].ClosureUse, nil, yyDollar[9].list} @@ -6227,7 +6221,7 @@ yydefault: } case 306: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3854 +// line internal/php5/php5.y:3848 { yyVAL.node = &ast.ExprYield{ast.Node{}, nil, yyDollar[2].node} @@ -6239,7 +6233,7 @@ yydefault: } case 307: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3864 +// line internal/php5/php5.y:3858 { yyVAL.node = &ast.ExprYield{ast.Node{}, nil, yyDollar[2].node} @@ -6251,7 +6245,7 @@ yydefault: } case 308: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:3874 +// line internal/php5/php5.y:3868 { yyVAL.node = &ast.ExprYield{ast.Node{}, yyDollar[2].node, yyDollar[4].node} @@ -6264,7 +6258,7 @@ yydefault: } case 309: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:3885 +// line internal/php5/php5.y:3879 { yyVAL.node = &ast.ExprYield{ast.Node{}, yyDollar[2].node, yyDollar[4].node} @@ -6277,7 +6271,7 @@ yydefault: } case 310: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:3899 +// line internal/php5/php5.y:3893 { yyVAL.node = &ast.ExprArrayDimFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6290,7 +6284,7 @@ yydefault: } case 311: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:3910 +// line internal/php5/php5.y:3904 { yyVAL.node = &ast.ExprArrayDimFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6303,7 +6297,7 @@ yydefault: } case 312: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:3921 +// line internal/php5/php5.y:3915 { str := &ast.ScalarString{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.ExprArrayDimFetch{ast.Node{}, str, yyDollar[3].node} @@ -6319,7 +6313,7 @@ yydefault: } case 313: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:3935 +// line internal/php5/php5.y:3929 { yyVAL.node = &ast.ExprArrayDimFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6332,7 +6326,7 @@ yydefault: } case 314: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:3949 +// line internal/php5/php5.y:3943 { yyVAL.node = &ast.ExprArray{ast.Node{}, yyDollar[3].list} @@ -6346,7 +6340,7 @@ yydefault: } case 315: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3961 +// line internal/php5/php5.y:3955 { yyVAL.node = &ast.ExprShortArray{ast.Node{}, yyDollar[2].list} @@ -6359,19 +6353,19 @@ yydefault: } case 316: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3975 +// line internal/php5/php5.y:3969 { yyVAL.token = yyDollar[1].token } case 317: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:3982 +// line internal/php5/php5.y:3976 { yyVAL.ClosureUse = nil } case 318: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:3986 +// line internal/php5/php5.y:3980 { yyVAL.ClosureUse = &ast.ExprClosureUse{ast.Node{}, yyDollar[3].list} @@ -6385,7 +6379,7 @@ yydefault: } case 319: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4001 +// line internal/php5/php5.y:3995 { identifier := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -6401,7 +6395,7 @@ yydefault: } case 320: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4015 +// line internal/php5/php5.y:4009 { identifier := &ast.Identifier{ast.Node{}, yyDollar[4].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -6420,7 +6414,7 @@ yydefault: } case 321: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4032 +// line internal/php5/php5.y:4026 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -6435,7 +6429,7 @@ yydefault: } case 322: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4045 +// line internal/php5/php5.y:4039 { identifier := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -6453,7 +6447,7 @@ yydefault: } case 323: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4064 +// line internal/php5/php5.y:4058 { name := &ast.NameName{ Node: ast.Node{ @@ -6468,7 +6462,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4077 +// line internal/php5/php5.y:4071 { name := &ast.NameRelative{ Node: ast.Node{ @@ -6485,7 +6479,7 @@ yydefault: } case 325: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4092 +// line internal/php5/php5.y:4086 { name := &ast.NameFullyQualified{ Node: ast.Node{ @@ -6501,7 +6495,7 @@ yydefault: } case 326: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4106 +// line internal/php5/php5.y:4100 { yyVAL.node = &ast.ExprStaticCall{ast.Node{}, yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*ast.ArgumentList)} @@ -6514,7 +6508,7 @@ yydefault: } case 327: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4117 +// line internal/php5/php5.y:4111 { yyVAL.node = &ast.ExprStaticCall{ast.Node{}, yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*ast.ArgumentList)} @@ -6527,7 +6521,7 @@ yydefault: } case 328: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4128 +// line internal/php5/php5.y:4122 { yyVAL.node = &ast.ExprStaticCall{ast.Node{}, yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*ast.ArgumentList)} @@ -6540,7 +6534,7 @@ yydefault: } case 329: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4139 +// line internal/php5/php5.y:4133 { yyVAL.node = &ast.ExprStaticCall{ast.Node{}, yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*ast.ArgumentList)} @@ -6553,7 +6547,7 @@ yydefault: } case 330: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4150 +// line internal/php5/php5.y:4144 { yyVAL.node = &ast.ExprFunctionCall{ast.Node{}, yyDollar[1].node, yyDollar[2].node.(*ast.ArgumentList)} @@ -6565,7 +6559,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4163 +// line internal/php5/php5.y:4157 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -6577,7 +6571,7 @@ yydefault: } case 332: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4173 +// line internal/php5/php5.y:4167 { yyVAL.node = &ast.NameName{ Node: ast.Node{ @@ -6588,7 +6582,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4182 +// line internal/php5/php5.y:4176 { yyVAL.node = &ast.NameRelative{ Node: ast.Node{ @@ -6601,7 +6595,7 @@ yydefault: } case 334: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4193 +// line internal/php5/php5.y:4187 { yyVAL.node = &ast.NameFullyQualified{ Node: ast.Node{ @@ -6613,7 +6607,7 @@ yydefault: } case 335: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4206 +// line internal/php5/php5.y:4200 { yyVAL.node = &ast.NameName{ Node: ast.Node{ @@ -6624,7 +6618,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4215 +// line internal/php5/php5.y:4209 { yyVAL.node = &ast.NameRelative{ Node: ast.Node{ @@ -6637,7 +6631,7 @@ yydefault: } case 337: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4226 +// line internal/php5/php5.y:4220 { yyVAL.node = &ast.NameFullyQualified{ Node: ast.Node{ @@ -6649,19 +6643,19 @@ yydefault: } case 338: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4239 +// line internal/php5/php5.y:4233 { yyVAL.node = yyDollar[1].node } case 339: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4243 +// line internal/php5/php5.y:4237 { yyVAL.node = yyDollar[1].node } case 340: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4250 +// line internal/php5/php5.y:4244 { yyVAL.node = yyDollar[1].node @@ -6702,25 +6696,25 @@ yydefault: } case 341: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4289 +// line internal/php5/php5.y:4283 { yyVAL.node = yyDollar[1].node } case 342: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4297 +// line internal/php5/php5.y:4291 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 343: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:4301 +// line internal/php5/php5.y:4295 { yyVAL.list = []ast.Vertex{} } case 344: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4309 +// line internal/php5/php5.y:4303 { yyVAL.list = yyDollar[2].list @@ -6729,13 +6723,13 @@ yydefault: } case 345: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:4319 +// line internal/php5/php5.y:4313 { yyVAL.node = nil } case 346: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4323 +// line internal/php5/php5.y:4317 { yyVAL.node = &ast.ParserBrackets{ Node: ast.Node{ @@ -6751,19 +6745,19 @@ yydefault: } case 347: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4337 +// line internal/php5/php5.y:4331 { yyVAL.node = yyDollar[1].node } case 348: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:4344 +// line internal/php5/php5.y:4338 { yyVAL.list = []ast.Vertex{} } case 349: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4348 +// line internal/php5/php5.y:4342 { part := &ast.ScalarEncapsedStringPart{ast.Node{}, yyDollar[1].token.Value} yyVAL.list = []ast.Vertex{part} @@ -6773,25 +6767,25 @@ yydefault: } case 350: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4356 +// line internal/php5/php5.y:4350 { yyVAL.list = yyDollar[1].list } case 351: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:4363 +// line internal/php5/php5.y:4357 { yyVAL.node = nil } case 352: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4367 +// line internal/php5/php5.y:4361 { yyVAL.node = yyDollar[1].node } case 353: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4374 +// line internal/php5/php5.y:4368 { yyVAL.node = &ast.ScalarLnumber{ast.Node{}, yyDollar[1].token.Value} @@ -6803,7 +6797,7 @@ yydefault: } case 354: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4384 +// line internal/php5/php5.y:4378 { yyVAL.node = &ast.ScalarDnumber{ast.Node{}, yyDollar[1].token.Value} @@ -6815,7 +6809,7 @@ yydefault: } case 355: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4394 +// line internal/php5/php5.y:4388 { yyVAL.node = &ast.ScalarString{ast.Node{}, yyDollar[1].token.Value} @@ -6827,7 +6821,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4404 +// line internal/php5/php5.y:4398 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -6839,7 +6833,7 @@ yydefault: } case 357: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4414 +// line internal/php5/php5.y:4408 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -6851,7 +6845,7 @@ yydefault: } case 358: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4424 +// line internal/php5/php5.y:4418 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -6863,7 +6857,7 @@ yydefault: } case 359: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4434 +// line internal/php5/php5.y:4428 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -6875,7 +6869,7 @@ yydefault: } case 360: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4444 +// line internal/php5/php5.y:4438 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -6887,7 +6881,7 @@ yydefault: } case 361: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4454 +// line internal/php5/php5.y:4448 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -6899,7 +6893,7 @@ yydefault: } case 362: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4464 +// line internal/php5/php5.y:4458 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -6911,7 +6905,7 @@ yydefault: } case 363: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4474 +// line internal/php5/php5.y:4468 { encapsed := &ast.ScalarEncapsedStringPart{ast.Node{}, yyDollar[2].token.Value} yyVAL.node = &ast.ScalarHeredoc{ast.Node{}, yyDollar[1].token.Value, []ast.Vertex{encapsed}} @@ -6925,7 +6919,7 @@ yydefault: } case 364: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4486 +// line internal/php5/php5.y:4480 { yyVAL.node = &ast.ScalarHeredoc{ast.Node{}, yyDollar[1].token.Value, nil} @@ -6937,7 +6931,7 @@ yydefault: } case 365: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4499 +// line internal/php5/php5.y:4493 { target := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} yyVAL.node = &ast.ExprClassConstFetch{ast.Node{}, yyDollar[1].node, target} @@ -6953,25 +6947,25 @@ yydefault: } case 366: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4516 +// line internal/php5/php5.y:4510 { yyVAL.node = yyDollar[1].node } case 367: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4523 +// line internal/php5/php5.y:4517 { yyVAL.node = yyDollar[1].node } case 368: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4527 +// line internal/php5/php5.y:4521 { yyVAL.node = yyDollar[1].node } case 369: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4531 +// line internal/php5/php5.y:4525 { name := &ast.NameName{ Node: ast.Node{ @@ -6986,7 +6980,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4544 +// line internal/php5/php5.y:4538 { name := &ast.NameRelative{ Node: ast.Node{ @@ -7003,7 +6997,7 @@ yydefault: } case 371: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4559 +// line internal/php5/php5.y:4553 { name := &ast.NameFullyQualified{ Node: ast.Node{ @@ -7019,7 +7013,7 @@ yydefault: } case 372: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4573 +// line internal/php5/php5.y:4567 { yyVAL.node = &ast.ExprArray{ast.Node{}, yyDollar[3].list} @@ -7033,7 +7027,7 @@ yydefault: } case 373: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4585 +// line internal/php5/php5.y:4579 { yyVAL.node = &ast.ExprShortArray{ast.Node{}, yyDollar[2].list} @@ -7046,13 +7040,13 @@ yydefault: } case 374: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4596 +// line internal/php5/php5.y:4590 { yyVAL.node = yyDollar[1].node } case 375: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4600 +// line internal/php5/php5.y:4594 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -7064,13 +7058,13 @@ yydefault: } case 376: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4610 +// line internal/php5/php5.y:4604 { yyVAL.node = yyDollar[1].node } case 377: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4617 +// line internal/php5/php5.y:4611 { yyVAL.node = &ast.ExprArrayDimFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7083,7 +7077,7 @@ yydefault: } case 378: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4628 +// line internal/php5/php5.y:4622 { yyVAL.node = &ast.ExprBinaryPlus{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7096,7 +7090,7 @@ yydefault: } case 379: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4639 +// line internal/php5/php5.y:4633 { yyVAL.node = &ast.ExprBinaryMinus{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7109,7 +7103,7 @@ yydefault: } case 380: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4650 +// line internal/php5/php5.y:4644 { yyVAL.node = &ast.ExprBinaryMul{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7122,7 +7116,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4661 +// line internal/php5/php5.y:4655 { yyVAL.node = &ast.ExprBinaryPow{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7135,7 +7129,7 @@ yydefault: } case 382: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4672 +// line internal/php5/php5.y:4666 { yyVAL.node = &ast.ExprBinaryDiv{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7148,7 +7142,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4683 +// line internal/php5/php5.y:4677 { yyVAL.node = &ast.ExprBinaryMod{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7161,7 +7155,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4694 +// line internal/php5/php5.y:4688 { yyVAL.node = &ast.ExprBooleanNot{ast.Node{}, yyDollar[2].node} @@ -7173,7 +7167,7 @@ yydefault: } case 385: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4704 +// line internal/php5/php5.y:4698 { yyVAL.node = &ast.ExprBitwiseNot{ast.Node{}, yyDollar[2].node} @@ -7185,7 +7179,7 @@ yydefault: } case 386: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4714 +// line internal/php5/php5.y:4708 { yyVAL.node = &ast.ExprBinaryBitwiseOr{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7198,7 +7192,7 @@ yydefault: } case 387: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4725 +// line internal/php5/php5.y:4719 { yyVAL.node = &ast.ExprBinaryBitwiseAnd{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7211,7 +7205,7 @@ yydefault: } case 388: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4736 +// line internal/php5/php5.y:4730 { yyVAL.node = &ast.ExprBinaryBitwiseXor{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7224,7 +7218,7 @@ yydefault: } case 389: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4747 +// line internal/php5/php5.y:4741 { yyVAL.node = &ast.ExprBinaryShiftLeft{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7237,7 +7231,7 @@ yydefault: } case 390: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4758 +// line internal/php5/php5.y:4752 { yyVAL.node = &ast.ExprBinaryShiftRight{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7250,7 +7244,7 @@ yydefault: } case 391: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4769 +// line internal/php5/php5.y:4763 { yyVAL.node = &ast.ExprBinaryConcat{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7263,7 +7257,7 @@ yydefault: } case 392: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4780 +// line internal/php5/php5.y:4774 { yyVAL.node = &ast.ExprBinaryLogicalXor{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7276,7 +7270,7 @@ yydefault: } case 393: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4791 +// line internal/php5/php5.y:4785 { yyVAL.node = &ast.ExprBinaryLogicalAnd{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7289,7 +7283,7 @@ yydefault: } case 394: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4802 +// line internal/php5/php5.y:4796 { yyVAL.node = &ast.ExprBinaryLogicalOr{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7302,7 +7296,7 @@ yydefault: } case 395: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4813 +// line internal/php5/php5.y:4807 { yyVAL.node = &ast.ExprBinaryBooleanAnd{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7315,7 +7309,7 @@ yydefault: } case 396: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4824 +// line internal/php5/php5.y:4818 { yyVAL.node = &ast.ExprBinaryBooleanOr{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7328,7 +7322,7 @@ yydefault: } case 397: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4835 +// line internal/php5/php5.y:4829 { yyVAL.node = &ast.ExprBinaryIdentical{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7341,7 +7335,7 @@ yydefault: } case 398: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4846 +// line internal/php5/php5.y:4840 { yyVAL.node = &ast.ExprBinaryNotIdentical{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7354,7 +7348,7 @@ yydefault: } case 399: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4857 +// line internal/php5/php5.y:4851 { yyVAL.node = &ast.ExprBinaryEqual{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7367,7 +7361,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4868 +// line internal/php5/php5.y:4862 { yyVAL.node = &ast.ExprBinaryNotEqual{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7381,7 +7375,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4880 +// line internal/php5/php5.y:4874 { yyVAL.node = &ast.ExprBinarySmaller{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7394,7 +7388,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4891 +// line internal/php5/php5.y:4885 { yyVAL.node = &ast.ExprBinaryGreater{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7407,7 +7401,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4902 +// line internal/php5/php5.y:4896 { yyVAL.node = &ast.ExprBinarySmallerOrEqual{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7420,7 +7414,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4913 +// line internal/php5/php5.y:4907 { yyVAL.node = &ast.ExprBinaryGreaterOrEqual{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7433,7 +7427,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4924 +// line internal/php5/php5.y:4918 { yyVAL.node = &ast.ExprTernary{ast.Node{}, yyDollar[1].node, nil, yyDollar[4].node} @@ -7447,7 +7441,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:4936 +// line internal/php5/php5.y:4930 { yyVAL.node = &ast.ExprTernary{ast.Node{}, yyDollar[1].node, yyDollar[3].node, yyDollar[5].node} @@ -7461,7 +7455,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4948 +// line internal/php5/php5.y:4942 { yyVAL.node = &ast.ExprUnaryPlus{ast.Node{}, yyDollar[2].node} @@ -7473,7 +7467,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4958 +// line internal/php5/php5.y:4952 { yyVAL.node = &ast.ExprUnaryMinus{ast.Node{}, yyDollar[2].node} @@ -7485,7 +7479,7 @@ yydefault: } case 409: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4968 +// line internal/php5/php5.y:4962 { yyVAL.node = yyDollar[2].node @@ -7495,13 +7489,13 @@ yydefault: } case 410: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4979 +// line internal/php5/php5.y:4973 { yyVAL.node = yyDollar[1].node } case 411: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4983 +// line internal/php5/php5.y:4977 { name := &ast.NameName{ Node: ast.Node{ @@ -7516,7 +7510,7 @@ yydefault: } case 412: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4996 +// line internal/php5/php5.y:4990 { name := &ast.NameRelative{ Node: ast.Node{ @@ -7533,7 +7527,7 @@ yydefault: } case 413: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:5011 +// line internal/php5/php5.y:5005 { name := &ast.NameFullyQualified{ Node: ast.Node{ @@ -7549,7 +7543,7 @@ yydefault: } case 414: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5028 +// line internal/php5/php5.y:5022 { name := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.ExprVariable{ast.Node{}, name} @@ -7563,25 +7557,25 @@ yydefault: } case 415: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5040 +// line internal/php5/php5.y:5034 { yyVAL.node = yyDollar[1].node } case 416: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5044 +// line internal/php5/php5.y:5038 { yyVAL.node = yyDollar[1].node } case 417: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5048 +// line internal/php5/php5.y:5042 { yyVAL.node = yyDollar[1].node } case 418: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5052 +// line internal/php5/php5.y:5046 { yyVAL.node = &ast.ScalarEncapsed{ast.Node{}, yyDollar[2].list} @@ -7593,7 +7587,7 @@ yydefault: } case 419: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5062 +// line internal/php5/php5.y:5056 { yyVAL.node = &ast.ScalarHeredoc{ast.Node{}, yyDollar[1].token.Value, yyDollar[2].list} @@ -7605,7 +7599,7 @@ yydefault: } case 420: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5072 +// line internal/php5/php5.y:5066 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -7617,13 +7611,13 @@ yydefault: } case 421: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:5085 +// line internal/php5/php5.y:5079 { yyVAL.list = nil } case 422: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:5089 +// line internal/php5/php5.y:5083 { yyVAL.list = yyDollar[1].list @@ -7634,19 +7628,19 @@ yydefault: } case 423: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:5101 +// line internal/php5/php5.y:5095 { yyVAL.token = nil } case 424: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5105 +// line internal/php5/php5.y:5099 { yyVAL.token = yyDollar[1].token } case 425: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:5112 +// line internal/php5/php5.y:5106 { arrayItem := &ast.ExprArrayItem{ast.Node{}, false, yyDollar[3].node, yyDollar[5].node} yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -7661,7 +7655,7 @@ yydefault: } case 426: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5125 +// line internal/php5/php5.y:5119 { arrayItem := &ast.ExprArrayItem{ast.Node{}, false, nil, yyDollar[3].node} yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -7675,7 +7669,7 @@ yydefault: } case 427: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5137 +// line internal/php5/php5.y:5131 { arrayItem := &ast.ExprArrayItem{ast.Node{}, false, yyDollar[1].node, yyDollar[3].node} yyVAL.list = []ast.Vertex{arrayItem} @@ -7689,7 +7683,7 @@ yydefault: } case 428: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5149 +// line internal/php5/php5.y:5143 { arrayItem := &ast.ExprArrayItem{ast.Node{}, false, nil, yyDollar[1].node} yyVAL.list = []ast.Vertex{arrayItem} @@ -7702,19 +7696,19 @@ yydefault: } case 429: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5163 +// line internal/php5/php5.y:5157 { yyVAL.node = yyDollar[1].node } case 430: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5167 +// line internal/php5/php5.y:5161 { yyVAL.node = yyDollar[1].node } case 431: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5174 +// line internal/php5/php5.y:5168 { yyVAL.node = &ast.ParserBrackets{ Node: ast.Node{ @@ -7731,7 +7725,7 @@ yydefault: } case 432: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5189 +// line internal/php5/php5.y:5183 { yyVAL.node = &ast.ParserBrackets{ Node: ast.Node{ @@ -7748,25 +7742,25 @@ yydefault: } case 433: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5208 +// line internal/php5/php5.y:5202 { yyVAL.node = yyDollar[1].node } case 434: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5216 +// line internal/php5/php5.y:5210 { yyVAL.node = yyDollar[1].node } case 435: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5223 +// line internal/php5/php5.y:5217 { yyVAL.node = yyDollar[1].node } case 436: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:5230 +// line internal/php5/php5.y:5224 { yyVAL.node = yyDollar[1].node @@ -7824,25 +7818,25 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5286 +// line internal/php5/php5.y:5280 { yyVAL.node = yyDollar[1].node } case 438: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:5293 +// line internal/php5/php5.y:5287 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 439: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:5297 +// line internal/php5/php5.y:5291 { yyVAL.list = []ast.Vertex{} } case 440: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5305 +// line internal/php5/php5.y:5299 { if yyDollar[3].list != nil { yyDollar[3].list[0].(*ast.ExprMethodCall).Method = yyDollar[2].list[len(yyDollar[2].list)-1].(*ast.ExprPropertyFetch).Property @@ -7856,7 +7850,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:5320 +// line internal/php5/php5.y:5314 { fetch := &ast.ExprArrayDimFetch{ast.Node{}, nil, yyDollar[3].node} yyVAL.list = append(yyDollar[1].list, fetch) @@ -7870,7 +7864,7 @@ yydefault: } case 442: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:5332 +// line internal/php5/php5.y:5326 { fetch := &ast.ExprArrayDimFetch{ast.Node{}, nil, yyDollar[3].node} yyVAL.list = []ast.Vertex{yyDollar[1].node, fetch} @@ -7884,7 +7878,7 @@ yydefault: } case 443: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5347 +// line internal/php5/php5.y:5341 { yyVAL.node = &ast.ExprMethodCall{ast.Node{}, nil, nil, yyDollar[1].node.(*ast.ArgumentList)} @@ -7893,31 +7887,31 @@ yydefault: } case 444: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5357 +// line internal/php5/php5.y:5351 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 445: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5361 +// line internal/php5/php5.y:5355 { yyVAL.list = yyDollar[1].list } case 446: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:5365 +// line internal/php5/php5.y:5359 { yyVAL.list = nil } case 447: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5372 +// line internal/php5/php5.y:5366 { yyVAL.node = yyDollar[1].node } case 448: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:5376 +// line internal/php5/php5.y:5370 { yyDollar[1].simpleIndirectReference.last.VarName = yyDollar[2].node @@ -7929,7 +7923,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5389 +// line internal/php5/php5.y:5383 { yyVAL.node = &ast.ExprStaticPropertyFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7942,7 +7936,7 @@ yydefault: } case 450: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5400 +// line internal/php5/php5.y:5394 { yyVAL.node = &ast.ExprStaticPropertyFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7955,13 +7949,13 @@ yydefault: } case 451: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5414 +// line internal/php5/php5.y:5408 { yyVAL.node = yyDollar[1].node } case 452: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:5421 +// line internal/php5/php5.y:5415 { yyVAL.node = &ast.ExprArrayDimFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7974,7 +7968,7 @@ yydefault: } case 453: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:5432 +// line internal/php5/php5.y:5426 { yyVAL.node = &ast.ExprArrayDimFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7987,31 +7981,31 @@ yydefault: } case 454: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5446 +// line internal/php5/php5.y:5440 { yyVAL.node = yyDollar[1].node } case 455: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5450 +// line internal/php5/php5.y:5444 { yyVAL.node = yyDollar[1].node } case 456: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5454 +// line internal/php5/php5.y:5448 { yyVAL.node = yyDollar[1].node } case 457: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5462 +// line internal/php5/php5.y:5456 { yyVAL.node = yyDollar[1].node } case 458: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:5466 +// line internal/php5/php5.y:5460 { yyDollar[1].simpleIndirectReference.last.VarName = yyDollar[2].node @@ -8023,13 +8017,13 @@ yydefault: } case 459: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5476 +// line internal/php5/php5.y:5470 { yyVAL.node = yyDollar[1].node } case 460: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:5483 +// line internal/php5/php5.y:5477 { yyVAL.node = &ast.ExprArrayDimFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -8042,7 +8036,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:5494 +// line internal/php5/php5.y:5488 { yyVAL.node = &ast.ExprArrayDimFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -8055,13 +8049,13 @@ yydefault: } case 462: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5505 +// line internal/php5/php5.y:5499 { yyVAL.node = yyDollar[1].node } case 463: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5513 +// line internal/php5/php5.y:5507 { name := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.ExprVariable{ast.Node{}, name} @@ -8075,7 +8069,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:5525 +// line internal/php5/php5.y:5519 { yyVAL.node = &ast.ExprVariable{ast.Node{}, yyDollar[3].node} @@ -8089,25 +8083,25 @@ yydefault: } case 465: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:5540 +// line internal/php5/php5.y:5534 { yyVAL.node = nil } case 466: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5544 +// line internal/php5/php5.y:5538 { yyVAL.node = yyDollar[1].node } case 467: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5552 +// line internal/php5/php5.y:5546 { yyVAL.list = yyDollar[1].list } case 468: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5556 +// line internal/php5/php5.y:5550 { fetch := &ast.ExprPropertyFetch{ast.Node{}, nil, yyDollar[1].node} yyVAL.list = []ast.Vertex{fetch} @@ -8117,7 +8111,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:5567 +// line internal/php5/php5.y:5561 { fetch := &ast.ExprArrayDimFetch{ast.Node{}, nil, yyDollar[3].node} yyVAL.list = append(yyDollar[1].list, fetch) @@ -8131,7 +8125,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:5579 +// line internal/php5/php5.y:5573 { fetch := &ast.ExprArrayDimFetch{ast.Node{}, nil, yyDollar[3].node} yyVAL.list = append(yyDollar[1].list, fetch) @@ -8145,7 +8139,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5591 +// line internal/php5/php5.y:5585 { fetch := &ast.ExprPropertyFetch{ast.Node{}, nil, yyDollar[1].node} yyVAL.list = []ast.Vertex{fetch} @@ -8155,7 +8149,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5602 +// line internal/php5/php5.y:5596 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -8167,7 +8161,7 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5612 +// line internal/php5/php5.y:5606 { yyVAL.node = yyDollar[2].node @@ -8180,7 +8174,7 @@ yydefault: } case 474: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5626 +// line internal/php5/php5.y:5620 { n := &ast.ExprVariable{ast.Node{}, nil} yyVAL.simpleIndirectReference = simpleIndirectReference{[]*ast.ExprVariable{n}, n} @@ -8193,7 +8187,7 @@ yydefault: } case 475: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:5637 +// line internal/php5/php5.y:5631 { n := &ast.ExprVariable{ast.Node{}, nil} @@ -8210,7 +8204,7 @@ yydefault: } case 476: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5655 +// line internal/php5/php5.y:5649 { if len(yyDollar[1].list) == 0 { yyDollar[1].list = []ast.Vertex{&ast.ExprArrayItem{ast.Node{}, false, nil, nil}} @@ -8223,7 +8217,7 @@ yydefault: } case 477: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5666 +// line internal/php5/php5.y:5660 { if yyDollar[1].node.(*ast.ExprArrayItem).Key == nil && yyDollar[1].node.(*ast.ExprArrayItem).Val == nil { yyVAL.list = []ast.Vertex{} @@ -8233,7 +8227,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5678 +// line internal/php5/php5.y:5672 { yyVAL.node = &ast.ExprArrayItem{ast.Node{}, false, nil, yyDollar[1].node} @@ -8245,7 +8239,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:5688 +// line internal/php5/php5.y:5682 { listNode := &ast.ExprList{ast.Node{}, yyDollar[3].list} yyVAL.node = &ast.ExprArrayItem{ast.Node{}, false, nil, listNode} @@ -8261,19 +8255,19 @@ yydefault: } case 480: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:5702 +// line internal/php5/php5.y:5696 { yyVAL.node = &ast.ExprArrayItem{ast.Node{}, false, nil, nil} } case 481: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:5710 +// line internal/php5/php5.y:5704 { yyVAL.list = []ast.Vertex{} } case 482: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:5714 +// line internal/php5/php5.y:5708 { yyVAL.list = yyDollar[1].list @@ -8288,7 +8282,7 @@ yydefault: } case 483: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:5730 +// line internal/php5/php5.y:5724 { arrayItem := &ast.ExprArrayItem{ast.Node{}, false, yyDollar[3].node, yyDollar[5].node} yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -8303,7 +8297,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5743 +// line internal/php5/php5.y:5737 { arrayItem := &ast.ExprArrayItem{ast.Node{}, false, nil, yyDollar[3].node} yyVAL.list = append(yyDollar[1].list, arrayItem) @@ -8317,7 +8311,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5755 +// line internal/php5/php5.y:5749 { arrayItem := &ast.ExprArrayItem{ast.Node{}, false, yyDollar[1].node, yyDollar[3].node} yyVAL.list = []ast.Vertex{arrayItem} @@ -8331,7 +8325,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5767 +// line internal/php5/php5.y:5761 { arrayItem := &ast.ExprArrayItem{ast.Node{}, false, nil, yyDollar[1].node} yyVAL.list = []ast.Vertex{arrayItem} @@ -8344,7 +8338,7 @@ yydefault: } case 487: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php5/php5.y:5778 +// line internal/php5/php5.y:5772 { reference := &ast.ExprReference{ast.Node{}, yyDollar[6].node} arrayItem := &ast.ExprArrayItem{ast.Node{}, false, yyDollar[3].node, reference} @@ -8362,7 +8356,7 @@ yydefault: } case 488: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:5794 +// line internal/php5/php5.y:5788 { reference := &ast.ExprReference{ast.Node{}, yyDollar[4].node} arrayItem := &ast.ExprArrayItem{ast.Node{}, false, nil, reference} @@ -8378,7 +8372,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:5808 +// line internal/php5/php5.y:5802 { reference := &ast.ExprReference{ast.Node{}, yyDollar[4].node} arrayItem := &ast.ExprArrayItem{ast.Node{}, false, yyDollar[1].node, reference} @@ -8395,7 +8389,7 @@ yydefault: } case 490: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:5823 +// line internal/php5/php5.y:5817 { reference := &ast.ExprReference{ast.Node{}, yyDollar[2].node} arrayItem := &ast.ExprArrayItem{ast.Node{}, false, nil, reference} @@ -8410,13 +8404,13 @@ yydefault: } case 491: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:5839 +// line internal/php5/php5.y:5833 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 492: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:5843 +// line internal/php5/php5.y:5837 { encapsed := &ast.ScalarEncapsedStringPart{ast.Node{}, yyDollar[2].token.Value} yyVAL.list = append(yyDollar[1].list, encapsed) @@ -8429,13 +8423,13 @@ yydefault: } case 493: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5854 +// line internal/php5/php5.y:5848 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 494: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:5858 +// line internal/php5/php5.y:5852 { encapsed := &ast.ScalarEncapsedStringPart{ast.Node{}, yyDollar[1].token.Value} yyVAL.list = []ast.Vertex{encapsed, yyDollar[2].node} @@ -8448,7 +8442,7 @@ yydefault: } case 495: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5872 +// line internal/php5/php5.y:5866 { name := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.ExprVariable{ast.Node{}, name} @@ -8462,7 +8456,7 @@ yydefault: } case 496: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:5884 +// line internal/php5/php5.y:5878 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -8479,7 +8473,7 @@ yydefault: } case 497: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5899 +// line internal/php5/php5.y:5893 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -8498,7 +8492,7 @@ yydefault: } case 498: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5916 +// line internal/php5/php5.y:5910 { variable := &ast.ExprVariable{ast.Node{}, yyDollar[2].node} @@ -8513,7 +8507,7 @@ yydefault: } case 499: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5929 +// line internal/php5/php5.y:5923 { name := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} variable := &ast.ExprVariable{ast.Node{}, name} @@ -8530,7 +8524,7 @@ yydefault: } case 500: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php5/php5.y:5944 +// line internal/php5/php5.y:5938 { identifier := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -8549,7 +8543,7 @@ yydefault: } case 501: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5961 +// line internal/php5/php5.y:5955 { yyVAL.node = yyDollar[2].node @@ -8559,7 +8553,7 @@ yydefault: } case 502: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5972 +// line internal/php5/php5.y:5966 { yyVAL.node = &ast.ScalarString{ast.Node{}, yyDollar[1].token.Value} @@ -8571,7 +8565,7 @@ yydefault: } case 503: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5982 +// line internal/php5/php5.y:5976 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(string(yyDollar[1].token.Value)); err == nil { @@ -8588,7 +8582,7 @@ yydefault: } case 504: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5997 +// line internal/php5/php5.y:5991 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.ExprVariable{ast.Node{}, identifier} @@ -8602,7 +8596,7 @@ yydefault: } case 505: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:6012 +// line internal/php5/php5.y:6006 { yyVAL.node = &ast.ExprIsset{ast.Node{}, yyDollar[3].list} @@ -8616,7 +8610,7 @@ yydefault: } case 506: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:6024 +// line internal/php5/php5.y:6018 { exprBrackets := &ast.ParserBrackets{ Node: ast.Node{ @@ -8638,7 +8632,7 @@ yydefault: } case 507: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:6044 +// line internal/php5/php5.y:6038 { exprBrackets := &ast.ParserBrackets{ Node: ast.Node{ @@ -8660,7 +8654,7 @@ yydefault: } case 508: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:6064 +// line internal/php5/php5.y:6058 { yyVAL.node = &ast.ExprInclude{ast.Node{}, yyDollar[2].node} @@ -8672,7 +8666,7 @@ yydefault: } case 509: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:6074 +// line internal/php5/php5.y:6068 { yyVAL.node = &ast.ExprIncludeOnce{ast.Node{}, yyDollar[2].node} @@ -8684,7 +8678,7 @@ yydefault: } case 510: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:6084 +// line internal/php5/php5.y:6078 { exprBrackets := &ast.ParserBrackets{ Node: ast.Node{ @@ -8706,7 +8700,7 @@ yydefault: } case 511: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:6104 +// line internal/php5/php5.y:6098 { yyVAL.node = &ast.ExprRequire{ast.Node{}, yyDollar[2].node} @@ -8718,7 +8712,7 @@ yydefault: } case 512: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:6114 +// line internal/php5/php5.y:6108 { yyVAL.node = &ast.ExprRequireOnce{ast.Node{}, yyDollar[2].node} @@ -8730,13 +8724,13 @@ yydefault: } case 513: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:6127 +// line internal/php5/php5.y:6121 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 514: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:6131 +// line internal/php5/php5.y:6125 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -8745,19 +8739,19 @@ yydefault: } case 515: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:6141 +// line internal/php5/php5.y:6135 { yyVAL.node = yyDollar[1].node } case 516: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:6145 +// line internal/php5/php5.y:6139 { yyVAL.node = yyDollar[1].node } case 517: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:6152 +// line internal/php5/php5.y:6146 { target := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} yyVAL.node = &ast.ExprClassConstFetch{ast.Node{}, yyDollar[1].node, target} @@ -8773,7 +8767,7 @@ yydefault: } case 518: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:6166 +// line internal/php5/php5.y:6160 { target := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} yyVAL.node = &ast.ExprClassConstFetch{ast.Node{}, yyDollar[1].node, target} @@ -8789,7 +8783,7 @@ yydefault: } case 519: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:6183 +// line internal/php5/php5.y:6177 { target := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} yyVAL.node = &ast.ExprClassConstFetch{ast.Node{}, yyDollar[1].node, target} @@ -8805,7 +8799,7 @@ yydefault: } case 520: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:6200 +// line internal/php5/php5.y:6194 { 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 38a0d87..b760bdc 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -901,20 +901,13 @@ unticked_statement: } | T_WHILE parenthesis_expr while_statement { - switch n := $3.(type) { - case *ast.StmtWhile : - n.Cond = $2 - case *ast.StmtAltWhile : - n.Cond = $2 - } + $3.(*ast.StmtWhile).WhileTkn = $1 + $3.(*ast.StmtWhile).OpenParenthesisTkn = $2.(*ast.ParserBrackets).OpenBracketTkn + $3.(*ast.StmtWhile).Cond = $2.(*ast.ParserBrackets).Child + $3.(*ast.StmtWhile).CloseParenthesisTkn = $2.(*ast.ParserBrackets).CloseBracketTkn + $3.(*ast.StmtWhile).Node.Position = position.NewTokenNodePosition($1, $3) $$ = $3 - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_DO statement T_WHILE parenthesis_expr ';' { @@ -1914,29 +1907,30 @@ case_separator: while_statement: statement { - $$ = &ast.StmtWhile{ast.Node{}, nil, $1} - - // save position - $$.GetNode().Position = position.NewNodePosition($1) + $$ = &ast.StmtWhile{ + Node: ast.Node{ + Position: position.NewNodePosition($1), + }, + Stmt: $1, + } } | ':' inner_statement_list T_ENDWHILE ';' { - stmtList := &ast.StmtStmtList{ + $$ = &ast.StmtWhile{ 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, + }, + EndWhileTkn: $3, + SemiColonTkn: $4, } - $$ = &ast.StmtAltWhile{ast.Node{}, 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 535f8c7..de9eb19 100644 --- a/internal/php5/php5_test.go +++ b/internal/php5/php5_test.go @@ -3049,7 +3049,7 @@ func TestPhp5(t *testing.T) { }, }, }, - &ast.StmtAltWhile{ + &ast.StmtWhile{ Node: ast.Node{ Position: &position.Position{ StartLine: 57, @@ -3058,6 +3058,7 @@ func TestPhp5(t *testing.T) { EndPos: 1046, }, }, + Alt: true, Cond: &ast.ScalarLnumber{ Node: ast.Node{ Position: &position.Position{ diff --git a/internal/php7/parser_test.go b/internal/php7/parser_test.go index 67ce06a..8421ca1 100644 --- a/internal/php7/parser_test.go +++ b/internal/php7/parser_test.go @@ -14441,7 +14441,7 @@ func TestStmtBreak(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtAltWhile{ + &ast.StmtWhile{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -14450,6 +14450,7 @@ func TestStmtBreak(t *testing.T) { EndPos: 34, }, }, + Alt: true, Cond: &ast.ScalarLnumber{ Node: ast.Node{ Position: &position.Position{ diff --git a/internal/php7/php7.go b/internal/php7/php7.go index e1a071b..323095b 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:4889 +// line internal/php7/php7.y:4872 // line yacctab:1 var yyExca = [...]int{ @@ -3188,35 +3188,17 @@ yydefault: yyDollar = yyS[yypt-5 : yypt+1] // line internal/php7/php7.y:872 { - exprBrackets := &ast.ParserBrackets{ - Node: ast.Node{ - Position: position.NewTokensPosition(yyDollar[2].token, yyDollar[4].token), - }, - OpenBracketTkn: yyDollar[2].token, - Child: yyDollar[3].node, - CloseBracketTkn: yyDollar[4].token, - } - - switch n := yyDollar[5].node.(type) { - case *ast.StmtWhile: - n.Cond = exprBrackets - case *ast.StmtAltWhile: - n.Cond = exprBrackets - } + yyDollar[5].node.(*ast.StmtWhile).WhileTkn = yyDollar[1].token + yyDollar[5].node.(*ast.StmtWhile).OpenParenthesisTkn = yyDollar[2].token + yyDollar[5].node.(*ast.StmtWhile).Cond = yyDollar[3].node + yyDollar[5].node.(*ast.StmtWhile).CloseParenthesisTkn = yyDollar[4].token + yyDollar[5].node.(*ast.StmtWhile).Node.Position = position.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node) yyVAL.node = yyDollar[5].node - - // save position - yyVAL.node.GetNode().Position = position.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node) - - // save comments - yylex.(*Parser).setFreeFloating(yyVAL.node, token.Start, yyDollar[1].token.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, yyDollar[2].token.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.End, yyDollar[4].token.SkippedTokens) } case 136: yyDollar = yyS[yypt-7 : yypt+1] -// line internal/php7/php7.y:900 +// line internal/php7/php7.y:882 { exprBrackets := &ast.ParserBrackets{ Node: ast.Node{ @@ -3240,7 +3222,7 @@ yydefault: } case 137: yyDollar = yyS[yypt-9 : yypt+1] -// line internal/php7/php7.y:922 +// line internal/php7/php7.y:904 { switch n := yyDollar[9].node.(type) { case *ast.StmtFor: @@ -3267,7 +3249,7 @@ yydefault: } case 138: yyDollar = yyS[yypt-5 : yypt+1] -// line internal/php7/php7.y:947 +// line internal/php7/php7.y:929 { exprBrackets := &ast.ParserBrackets{ Node: ast.Node{ @@ -3300,7 +3282,7 @@ yydefault: } case 139: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:978 +// line internal/php7/php7.y:960 { yyVAL.node = &ast.StmtBreak{ast.Node{}, yyDollar[2].node} @@ -3314,7 +3296,7 @@ yydefault: } case 140: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:990 +// line internal/php7/php7.y:972 { yyVAL.node = &ast.StmtContinue{ast.Node{}, yyDollar[2].node} @@ -3328,7 +3310,7 @@ yydefault: } case 141: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:1002 +// line internal/php7/php7.y:984 { yyVAL.node = &ast.StmtReturn{ast.Node{}, yyDollar[2].node} @@ -3342,7 +3324,7 @@ yydefault: } case 142: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:1014 +// line internal/php7/php7.y:996 { yyVAL.node = &ast.StmtGlobal{ast.Node{}, yyDollar[2].list} @@ -3356,7 +3338,7 @@ yydefault: } case 143: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:1026 +// line internal/php7/php7.y:1008 { yyVAL.node = &ast.StmtStatic{ast.Node{}, yyDollar[2].list} @@ -3370,7 +3352,7 @@ yydefault: } case 144: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:1038 +// line internal/php7/php7.y:1020 { yyVAL.node = &ast.StmtEcho{ast.Node{}, yyDollar[2].list} @@ -3385,7 +3367,7 @@ yydefault: } case 145: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1051 +// line internal/php7/php7.y:1033 { yyVAL.node = &ast.StmtInlineHtml{ast.Node{}, yyDollar[1].token.Value} @@ -3397,7 +3379,7 @@ yydefault: } case 146: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:1061 +// line internal/php7/php7.y:1043 { yyVAL.node = &ast.StmtExpression{ast.Node{}, yyDollar[1].node} @@ -3411,7 +3393,7 @@ yydefault: } case 147: yyDollar = yyS[yypt-6 : yypt+1] -// line internal/php7/php7.y:1073 +// line internal/php7/php7.y:1055 { yyVAL.node = &ast.StmtUnset{ast.Node{}, yyDollar[3].list} @@ -3431,7 +3413,7 @@ yydefault: } case 148: yyDollar = yyS[yypt-7 : yypt+1] -// line internal/php7/php7.y:1091 +// line internal/php7/php7.y:1073 { switch n := yyDollar[7].node.(type) { case *ast.StmtForeach: @@ -3455,7 +3437,7 @@ yydefault: } case 149: yyDollar = yyS[yypt-9 : yypt+1] -// line internal/php7/php7.y:1113 +// line internal/php7/php7.y:1095 { switch n := yyDollar[9].node.(type) { case *ast.StmtForeach: @@ -3482,7 +3464,7 @@ yydefault: } case 150: yyDollar = yyS[yypt-5 : yypt+1] -// line internal/php7/php7.y:1138 +// line internal/php7/php7.y:1120 { yyVAL.node = yyDollar[5].node yyVAL.node.(*ast.StmtDeclare).Consts = yyDollar[3].list @@ -3497,7 +3479,7 @@ yydefault: } case 151: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1151 +// line internal/php7/php7.y:1133 { yyVAL.node = &ast.StmtNop{ast.Node{}} @@ -3510,7 +3492,7 @@ yydefault: } case 152: yyDollar = yyS[yypt-6 : yypt+1] -// line internal/php7/php7.y:1162 +// line internal/php7/php7.y:1144 { if yyDollar[6].node == nil { yyVAL.node = &ast.StmtTry{ast.Node{}, yyDollar[3].list, yyDollar[5].list, yyDollar[6].node} @@ -3527,7 +3509,7 @@ yydefault: } case 153: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:1177 +// line internal/php7/php7.y:1159 { yyVAL.node = &ast.StmtThrow{ast.Node{}, yyDollar[2].node} @@ -3541,7 +3523,7 @@ yydefault: } case 154: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:1189 +// line internal/php7/php7.y:1171 { label := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} yyVAL.node = &ast.StmtGoto{ast.Node{}, label} @@ -3558,7 +3540,7 @@ yydefault: } case 155: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:1204 +// line internal/php7/php7.y:1186 { label := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.StmtLabel{ast.Node{}, label} @@ -3573,13 +3555,13 @@ yydefault: } case 156: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:1219 +// line internal/php7/php7.y:1201 { yyVAL.list = []ast.Vertex{} } case 157: yyDollar = yyS[yypt-9 : yypt+1] -// line internal/php7/php7.y:1223 +// line internal/php7/php7.y:1205 { identifier := &ast.Identifier{ast.Node{}, yyDollar[5].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -3601,13 +3583,13 @@ yydefault: } case 158: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1245 +// line internal/php7/php7.y:1227 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 159: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:1249 +// line internal/php7/php7.y:1231 { switch n := lastNode(yyDollar[1].list).(type) { case *ast.NameName: @@ -3621,13 +3603,13 @@ yydefault: } case 160: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:1261 +// line internal/php7/php7.y:1243 { yyVAL.node = nil } case 161: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:1265 +// line internal/php7/php7.y:1247 { yyVAL.node = &ast.StmtFinally{ast.Node{}, yyDollar[3].list} @@ -3641,13 +3623,13 @@ yydefault: } case 162: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1280 +// line internal/php7/php7.y:1262 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 163: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:1284 +// line internal/php7/php7.y:1266 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -3656,13 +3638,13 @@ yydefault: } case 164: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1294 +// line internal/php7/php7.y:1276 { yyVAL.node = yyDollar[1].node } case 165: yyDollar = yyS[yypt-11 : yypt+1] -// line internal/php7/php7.y:1301 +// line internal/php7/php7.y:1283 { 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} @@ -3692,31 +3674,31 @@ yydefault: } case 166: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:1332 +// line internal/php7/php7.y:1314 { yyVAL.token = nil } case 167: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1336 +// line internal/php7/php7.y:1318 { yyVAL.token = yyDollar[1].token } case 168: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:1343 +// line internal/php7/php7.y:1325 { yyVAL.token = nil } case 169: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1347 +// line internal/php7/php7.y:1329 { yyVAL.token = yyDollar[1].token } case 170: yyDollar = yyS[yypt-9 : yypt+1] -// line internal/php7/php7.y:1354 +// line internal/php7/php7.y:1336 { 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} @@ -3734,7 +3716,7 @@ yydefault: } case 171: yyDollar = yyS[yypt-8 : yypt+1] -// line internal/php7/php7.y:1370 +// line internal/php7/php7.y:1352 { 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} @@ -3751,19 +3733,19 @@ yydefault: } case 172: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1388 +// line internal/php7/php7.y:1370 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 173: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:1392 +// line internal/php7/php7.y:1374 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 174: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1399 +// line internal/php7/php7.y:1381 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -3775,7 +3757,7 @@ yydefault: } case 175: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1409 +// line internal/php7/php7.y:1391 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -3787,7 +3769,7 @@ yydefault: } case 176: yyDollar = yyS[yypt-6 : yypt+1] -// line internal/php7/php7.y:1422 +// line internal/php7/php7.y:1404 { name := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} yyVAL.node = &ast.StmtTrait{ast.Node{}, name, yyDollar[5].list} @@ -3804,7 +3786,7 @@ yydefault: } case 177: yyDollar = yyS[yypt-7 : yypt+1] -// line internal/php7/php7.y:1440 +// line internal/php7/php7.y:1422 { name := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} yyVAL.node = &ast.StmtInterface{ast.Node{}, name, yyDollar[3].InterfaceExtends, yyDollar[6].list} @@ -3821,13 +3803,13 @@ yydefault: } case 178: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:1458 +// line internal/php7/php7.y:1440 { yyVAL.ClassExtends = nil } case 179: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:1462 +// line internal/php7/php7.y:1444 { yyVAL.ClassExtends = &ast.StmtClassExtends{ast.Node{}, yyDollar[2].node} @@ -3839,13 +3821,13 @@ yydefault: } case 180: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:1475 +// line internal/php7/php7.y:1457 { yyVAL.InterfaceExtends = nil } case 181: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:1479 +// line internal/php7/php7.y:1461 { yyVAL.InterfaceExtends = &ast.StmtInterfaceExtends{ast.Node{}, yyDollar[2].list} @@ -3857,13 +3839,13 @@ yydefault: } case 182: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:1492 +// line internal/php7/php7.y:1474 { yyVAL.ClassImplements = nil } case 183: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:1496 +// line internal/php7/php7.y:1478 { yyVAL.ClassImplements = &ast.StmtClassImplements{ast.Node{}, yyDollar[2].list} @@ -3875,13 +3857,13 @@ yydefault: } case 184: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1509 +// line internal/php7/php7.y:1491 { yyVAL.node = yyDollar[1].node } case 185: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:1513 +// line internal/php7/php7.y:1495 { yyVAL.node = &ast.ExprReference{ast.Node{}, yyDollar[2].node} @@ -3893,7 +3875,7 @@ yydefault: } case 186: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:1523 +// line internal/php7/php7.y:1505 { yyVAL.node = &ast.ExprList{ast.Node{}, yyDollar[3].list} @@ -3907,7 +3889,7 @@ yydefault: } case 187: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:1535 +// line internal/php7/php7.y:1517 { yyVAL.node = &ast.ExprShortList{ast.Node{}, yyDollar[2].list} @@ -3920,7 +3902,7 @@ yydefault: } case 188: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1549 +// line internal/php7/php7.y:1531 { yyVAL.node = &ast.StmtFor{ast.Node{}, nil, nil, nil, yyDollar[1].node} @@ -3929,7 +3911,7 @@ yydefault: } case 189: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:1556 +// line internal/php7/php7.y:1538 { stmtList := &ast.StmtStmtList{ Node: ast.Node{ @@ -3950,7 +3932,7 @@ yydefault: } case 190: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1578 +// line internal/php7/php7.y:1560 { yyVAL.node = &ast.StmtForeach{ast.Node{}, nil, nil, nil, yyDollar[1].node} @@ -3959,7 +3941,7 @@ yydefault: } case 191: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:1585 +// line internal/php7/php7.y:1567 { stmtList := &ast.StmtStmtList{ Node: ast.Node{ @@ -3980,7 +3962,7 @@ yydefault: } case 192: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1607 +// line internal/php7/php7.y:1589 { yyVAL.node = &ast.StmtDeclare{ast.Node{}, false, nil, yyDollar[1].node} @@ -3989,7 +3971,7 @@ yydefault: } case 193: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:1614 +// line internal/php7/php7.y:1596 { stmtList := &ast.StmtStmtList{ Node: ast.Node{ @@ -4010,7 +3992,7 @@ yydefault: } case 194: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:1636 +// line internal/php7/php7.y:1618 { caseList := &ast.StmtCaseList{ast.Node{}, yyDollar[2].list} yyVAL.node = &ast.StmtSwitch{ast.Node{}, nil, caseList} @@ -4025,7 +4007,7 @@ yydefault: } case 195: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:1649 +// line internal/php7/php7.y:1631 { caseList := &ast.StmtCaseList{ast.Node{}, yyDollar[3].list} yyVAL.node = &ast.StmtSwitch{ast.Node{}, nil, caseList} @@ -4041,7 +4023,7 @@ yydefault: } case 196: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:1663 +// line internal/php7/php7.y:1645 { caseList := &ast.StmtCaseList{ast.Node{}, yyDollar[2].list} yyVAL.node = &ast.StmtAltSwitch{ast.Node{}, nil, caseList} @@ -4058,7 +4040,7 @@ yydefault: } case 197: yyDollar = yyS[yypt-5 : yypt+1] -// line internal/php7/php7.y:1678 +// line internal/php7/php7.y:1660 { caseList := &ast.StmtCaseList{ast.Node{}, yyDollar[3].list} @@ -4077,13 +4059,13 @@ yydefault: } case 198: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:1698 +// line internal/php7/php7.y:1680 { yyVAL.list = []ast.Vertex{} } case 199: yyDollar = yyS[yypt-5 : yypt+1] -// line internal/php7/php7.y:1702 +// line internal/php7/php7.y:1684 { _case := &ast.StmtCase{ast.Node{}, yyDollar[3].node, yyDollar[5].list} yyVAL.list = append(yyDollar[1].list, _case) @@ -4098,7 +4080,7 @@ yydefault: } case 200: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:1715 +// line internal/php7/php7.y:1697 { _default := &ast.StmtDefault{ast.Node{}, yyDollar[4].list} yyVAL.list = append(yyDollar[1].list, _default) @@ -4113,49 +4095,50 @@ yydefault: } case 201: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1731 +// line internal/php7/php7.y:1713 { yyVAL.token = yyDollar[1].token } case 202: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1735 +// line internal/php7/php7.y:1717 { yyVAL.token = yyDollar[1].token } case 203: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1742 +// line internal/php7/php7.y:1724 { - yyVAL.node = &ast.StmtWhile{ast.Node{}, nil, yyDollar[1].node} - - // save position - yyVAL.node.GetNode().Position = position.NewNodePosition(yyDollar[1].node) + yyVAL.node = &ast.StmtWhile{ + Node: ast.Node{ + Position: position.NewNodePosition(yyDollar[1].node), + }, + Stmt: yyDollar[1].node, + } } case 204: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:1749 +// line internal/php7/php7.y:1733 { - stmtList := &ast.StmtStmtList{ + yyVAL.node = &ast.StmtWhile{ 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, + }, + EndWhileTkn: yyDollar[3].token, + SemiColonTkn: yyDollar[4].token, } - yyVAL.node = &ast.StmtAltWhile{ast.Node{}, 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 205: yyDollar = yyS[yypt-5 : yypt+1] -// line internal/php7/php7.y:1771 +// line internal/php7/php7.y:1754 { yyVAL.node = &ast.StmtIf{ Node: ast.Node{ @@ -4170,7 +4153,7 @@ yydefault: } case 206: yyDollar = yyS[yypt-6 : yypt+1] -// line internal/php7/php7.y:1784 +// line internal/php7/php7.y:1767 { yyDollar[1].node.(*ast.StmtIf).ElseIf = append(yyDollar[1].node.(*ast.StmtIf).ElseIf, &ast.StmtElseIf{ Node: ast.Node{ @@ -4189,13 +4172,13 @@ yydefault: } case 207: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1804 +// line internal/php7/php7.y:1787 { yyVAL.node = yyDollar[1].node } case 208: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:1808 +// line internal/php7/php7.y:1791 { yyDollar[1].node.(*ast.StmtIf).Else = &ast.StmtElse{ Node: ast.Node{ @@ -4211,7 +4194,7 @@ yydefault: } case 209: yyDollar = yyS[yypt-6 : yypt+1] -// line internal/php7/php7.y:1825 +// line internal/php7/php7.y:1808 { yyVAL.node = &ast.StmtIf{ Node: ast.Node{ @@ -4233,7 +4216,7 @@ yydefault: } case 210: yyDollar = yyS[yypt-7 : yypt+1] -// line internal/php7/php7.y:1845 +// line internal/php7/php7.y:1828 { yyDollar[1].node.(*ast.StmtIf).ElseIf = append(yyDollar[1].node.(*ast.StmtIf).ElseIf, &ast.StmtElseIf{ Node: ast.Node{ @@ -4257,7 +4240,7 @@ yydefault: } case 211: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:1870 +// line internal/php7/php7.y:1853 { yyDollar[1].node.(*ast.StmtIf).EndIfTkn = yyDollar[2].token yyDollar[1].node.(*ast.StmtIf).SemiColonTkn = yyDollar[3].token @@ -4267,7 +4250,7 @@ yydefault: } case 212: yyDollar = yyS[yypt-6 : yypt+1] -// line internal/php7/php7.y:1878 +// line internal/php7/php7.y:1861 { yyDollar[1].node.(*ast.StmtIf).Else = &ast.StmtElse{ Node: ast.Node{ @@ -4291,25 +4274,25 @@ yydefault: } case 213: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1903 +// line internal/php7/php7.y:1886 { yyVAL.list = yyDollar[1].list } case 214: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:1907 +// line internal/php7/php7.y:1890 { yyVAL.list = nil } case 215: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:1914 +// line internal/php7/php7.y:1897 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 216: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:1918 +// line internal/php7/php7.y:1901 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4318,7 +4301,7 @@ yydefault: } case 217: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:1928 +// line internal/php7/php7.y:1911 { identifier := &ast.Identifier{ast.Node{}, yyDollar[4].token.Value} identifier.GetNode().Position = position.NewTokenPosition(yyDollar[4].token) @@ -4354,7 +4337,7 @@ yydefault: } case 218: yyDollar = yyS[yypt-6 : yypt+1] -// line internal/php7/php7.y:1962 +// line internal/php7/php7.y:1945 { identifier := &ast.Identifier{ast.Node{}, yyDollar[4].token.Value} identifier.GetNode().Position = position.NewTokenPosition(yyDollar[4].token) @@ -4391,25 +4374,25 @@ yydefault: } case 219: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:2000 +// line internal/php7/php7.y:1983 { yyVAL.node = nil } case 220: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2004 +// line internal/php7/php7.y:1987 { yyVAL.node = yyDollar[1].node } case 221: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2011 +// line internal/php7/php7.y:1994 { yyVAL.node = yyDollar[1].node } case 222: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:2015 +// line internal/php7/php7.y:1998 { yyVAL.node = &ast.Nullable{ast.Node{}, yyDollar[2].node} @@ -4421,7 +4404,7 @@ yydefault: } case 223: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2028 +// line internal/php7/php7.y:2011 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -4433,7 +4416,7 @@ yydefault: } case 224: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2038 +// line internal/php7/php7.y:2021 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -4445,19 +4428,19 @@ yydefault: } case 225: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2048 +// line internal/php7/php7.y:2031 { yyVAL.node = yyDollar[1].node } case 226: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:2055 +// line internal/php7/php7.y:2038 { yyVAL.node = nil } case 227: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:2059 +// line internal/php7/php7.y:2042 { yyVAL.node = yyDollar[2].node @@ -4466,7 +4449,7 @@ yydefault: } case 228: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:2069 +// line internal/php7/php7.y:2052 { yyVAL.node = &ast.ArgumentList{ast.Node{}, nil} @@ -4479,7 +4462,7 @@ yydefault: } case 229: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:2080 +// line internal/php7/php7.y:2063 { yyVAL.node = &ast.ArgumentList{ast.Node{}, yyDollar[2].list} @@ -4496,13 +4479,13 @@ yydefault: } case 230: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2098 +// line internal/php7/php7.y:2081 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 231: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2102 +// line internal/php7/php7.y:2085 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4511,7 +4494,7 @@ yydefault: } case 232: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2112 +// line internal/php7/php7.y:2095 { yyVAL.node = &ast.Argument{ast.Node{}, false, false, yyDollar[1].node} @@ -4523,7 +4506,7 @@ yydefault: } case 233: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:2122 +// line internal/php7/php7.y:2105 { yyVAL.node = &ast.Argument{ast.Node{}, true, false, yyDollar[2].node} @@ -4535,7 +4518,7 @@ yydefault: } case 234: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2135 +// line internal/php7/php7.y:2118 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4544,19 +4527,19 @@ yydefault: } case 235: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2142 +// line internal/php7/php7.y:2125 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 236: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2149 +// line internal/php7/php7.y:2132 { yyVAL.node = yyDollar[1].node } case 237: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2156 +// line internal/php7/php7.y:2139 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -4565,13 +4548,13 @@ yydefault: } case 238: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2163 +// line internal/php7/php7.y:2146 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 239: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2170 +// line internal/php7/php7.y:2153 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -4587,7 +4570,7 @@ yydefault: } case 240: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2184 +// line internal/php7/php7.y:2167 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -4604,19 +4587,19 @@ yydefault: } case 241: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:2202 +// line internal/php7/php7.y:2185 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 242: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:2206 +// line internal/php7/php7.y:2189 { yyVAL.list = []ast.Vertex{} } case 243: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:2213 +// line internal/php7/php7.y:2196 { yyVAL.node = &ast.StmtPropertyList{ast.Node{}, yyDollar[1].list, yyDollar[2].node, yyDollar[3].list} @@ -4630,7 +4613,7 @@ yydefault: } case 244: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:2225 +// line internal/php7/php7.y:2208 { yyVAL.node = &ast.StmtClassConstList{ Node: ast.Node{ @@ -4644,7 +4627,7 @@ yydefault: } case 245: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2237 +// line internal/php7/php7.y:2220 { yyVAL.node = &ast.StmtTraitUse{ast.Node{}, yyDollar[2].list, yyDollar[3].node} @@ -4656,7 +4639,7 @@ yydefault: } case 246: yyDollar = yyS[yypt-10 : yypt+1] -// line internal/php7/php7.y:2247 +// line internal/php7/php7.y:2230 { 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} @@ -4687,13 +4670,13 @@ yydefault: } case 247: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2279 +// line internal/php7/php7.y:2262 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 248: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2283 +// line internal/php7/php7.y:2266 { switch n := lastNode(yyDollar[1].list).(type) { case *ast.NameName: @@ -4707,7 +4690,7 @@ yydefault: } case 249: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2295 +// line internal/php7/php7.y:2278 { yyVAL.node = &ast.StmtNop{ast.Node{}} @@ -4719,7 +4702,7 @@ yydefault: } case 250: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:2305 +// line internal/php7/php7.y:2288 { yyVAL.node = &ast.StmtTraitAdaptationList{ast.Node{}, nil} @@ -4731,7 +4714,7 @@ yydefault: } case 251: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2315 +// line internal/php7/php7.y:2298 { yyVAL.node = &ast.StmtTraitAdaptationList{ast.Node{}, yyDollar[2].list} @@ -4743,19 +4726,19 @@ yydefault: } case 252: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2328 +// line internal/php7/php7.y:2311 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 253: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:2332 +// line internal/php7/php7.y:2315 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 254: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:2339 +// line internal/php7/php7.y:2322 { yyVAL.node = yyDollar[1].node @@ -4765,7 +4748,7 @@ yydefault: } case 255: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:2347 +// line internal/php7/php7.y:2330 { yyVAL.node = yyDollar[1].node @@ -4775,7 +4758,7 @@ yydefault: } case 256: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2358 +// line internal/php7/php7.y:2341 { yyVAL.node = &ast.StmtTraitUsePrecedence{ast.Node{}, yyDollar[1].node, yyDollar[3].list} @@ -4788,7 +4771,7 @@ yydefault: } case 257: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2372 +// line internal/php7/php7.y:2355 { alias := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} yyVAL.node = &ast.StmtTraitUseAlias{ast.Node{}, yyDollar[1].node, nil, alias} @@ -4804,7 +4787,7 @@ yydefault: } case 258: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2386 +// line internal/php7/php7.y:2369 { alias := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} yyVAL.node = &ast.StmtTraitUseAlias{ast.Node{}, yyDollar[1].node, nil, alias} @@ -4820,7 +4803,7 @@ yydefault: } case 259: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:2400 +// line internal/php7/php7.y:2383 { alias := &ast.Identifier{ast.Node{}, yyDollar[4].token.Value} yyVAL.node = &ast.StmtTraitUseAlias{ast.Node{}, yyDollar[1].node, yyDollar[3].node, alias} @@ -4836,7 +4819,7 @@ yydefault: } case 260: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2414 +// line internal/php7/php7.y:2397 { yyVAL.node = &ast.StmtTraitUseAlias{ast.Node{}, yyDollar[1].node, yyDollar[3].node, nil} @@ -4849,7 +4832,7 @@ yydefault: } case 261: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2428 +// line internal/php7/php7.y:2411 { name := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.StmtTraitMethodRef{ast.Node{}, nil, name} @@ -4863,13 +4846,13 @@ yydefault: } case 262: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2440 +// line internal/php7/php7.y:2423 { yyVAL.node = yyDollar[1].node } case 263: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2447 +// line internal/php7/php7.y:2430 { target := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} yyVAL.node = &ast.StmtTraitMethodRef{ast.Node{}, yyDollar[1].node, target} @@ -4885,7 +4868,7 @@ yydefault: } case 264: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2464 +// line internal/php7/php7.y:2447 { yyVAL.node = &ast.StmtNop{ast.Node{}} @@ -4898,7 +4881,7 @@ yydefault: } case 265: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2475 +// line internal/php7/php7.y:2458 { yyVAL.node = &ast.StmtStmtList{ Node: ast.Node{ @@ -4911,13 +4894,13 @@ yydefault: } case 266: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2489 +// line internal/php7/php7.y:2472 { yyVAL.list = yyDollar[1].list } case 267: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2493 +// line internal/php7/php7.y:2476 { modifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.list = []ast.Vertex{modifier} @@ -4930,31 +4913,31 @@ yydefault: } case 268: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:2507 +// line internal/php7/php7.y:2490 { yyVAL.list = nil } case 269: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2511 +// line internal/php7/php7.y:2494 { yyVAL.list = yyDollar[1].list } case 270: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2518 +// line internal/php7/php7.y:2501 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 271: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:2522 +// line internal/php7/php7.y:2505 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 272: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2529 +// line internal/php7/php7.y:2512 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -4966,7 +4949,7 @@ yydefault: } case 273: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2539 +// line internal/php7/php7.y:2522 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -4978,7 +4961,7 @@ yydefault: } case 274: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2549 +// line internal/php7/php7.y:2532 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -4990,7 +4973,7 @@ yydefault: } case 275: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2559 +// line internal/php7/php7.y:2542 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -5002,7 +4985,7 @@ yydefault: } case 276: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2569 +// line internal/php7/php7.y:2552 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -5014,7 +4997,7 @@ yydefault: } case 277: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2579 +// line internal/php7/php7.y:2562 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -5026,7 +5009,7 @@ yydefault: } case 278: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2592 +// line internal/php7/php7.y:2575 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5035,13 +5018,13 @@ yydefault: } case 279: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2599 +// line internal/php7/php7.y:2582 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 280: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:2606 +// line internal/php7/php7.y:2589 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -5057,7 +5040,7 @@ yydefault: } case 281: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:2620 +// line internal/php7/php7.y:2603 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -5074,7 +5057,7 @@ yydefault: } case 282: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2638 +// line internal/php7/php7.y:2621 { lastNode(yyDollar[1].list).(*ast.StmtConstant).CommaTkn = yyDollar[2].token @@ -5082,13 +5065,13 @@ yydefault: } case 283: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2644 +// line internal/php7/php7.y:2627 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 284: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:2651 +// line internal/php7/php7.y:2634 { yyVAL.node = &ast.StmtConstant{ Node: ast.Node{ @@ -5108,7 +5091,7 @@ yydefault: } case 285: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:2672 +// line internal/php7/php7.y:2655 { yyVAL.node = &ast.StmtConstant{ Node: ast.Node{ @@ -5128,7 +5111,7 @@ yydefault: } case 286: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2693 +// line internal/php7/php7.y:2676 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5137,31 +5120,31 @@ yydefault: } case 287: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2700 +// line internal/php7/php7.y:2683 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 288: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2707 +// line internal/php7/php7.y:2690 { yyVAL.node = yyDollar[1].node } case 289: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:2714 +// line internal/php7/php7.y:2697 { yyVAL.list = nil } case 290: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2718 +// line internal/php7/php7.y:2701 { yyVAL.list = yyDollar[1].list } case 291: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2725 +// line internal/php7/php7.y:2708 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -5170,13 +5153,13 @@ yydefault: } case 292: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:2732 +// line internal/php7/php7.y:2715 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 293: yyDollar = yyS[yypt-8 : yypt+1] -// line internal/php7/php7.y:2739 +// line internal/php7/php7.y:2722 { 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} @@ -5194,7 +5177,7 @@ yydefault: } case 294: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2758 +// line internal/php7/php7.y:2741 { if yyDollar[3].node != nil { yyVAL.node = &ast.ExprNew{ast.Node{}, yyDollar[2].node, yyDollar[3].node.(*ast.ArgumentList)} @@ -5209,7 +5192,7 @@ yydefault: } case 295: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:2771 +// line internal/php7/php7.y:2754 { yyVAL.node = &ast.ExprNew{ast.Node{}, yyDollar[2].node, nil} @@ -5221,7 +5204,7 @@ yydefault: } case 296: yyDollar = yyS[yypt-6 : yypt+1] -// line internal/php7/php7.y:2784 +// line internal/php7/php7.y:2767 { listNode := &ast.ExprList{ast.Node{}, yyDollar[3].list} yyVAL.node = &ast.ExprAssign{ast.Node{}, listNode, yyDollar[6].node} @@ -5238,7 +5221,7 @@ yydefault: } case 297: yyDollar = yyS[yypt-5 : yypt+1] -// line internal/php7/php7.y:2799 +// line internal/php7/php7.y:2782 { shortList := &ast.ExprShortList{ast.Node{}, yyDollar[2].list} yyVAL.node = &ast.ExprAssign{ast.Node{}, shortList, yyDollar[5].node} @@ -5254,7 +5237,7 @@ yydefault: } case 298: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2813 +// line internal/php7/php7.y:2796 { yyVAL.node = &ast.ExprAssign{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5267,7 +5250,7 @@ yydefault: } case 299: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:2824 +// line internal/php7/php7.y:2807 { yyVAL.node = &ast.ExprAssignReference{ast.Node{}, yyDollar[1].node, yyDollar[4].node} @@ -5281,7 +5264,7 @@ yydefault: } case 300: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:2836 +// line internal/php7/php7.y:2819 { yyVAL.node = &ast.ExprClone{ast.Node{}, yyDollar[2].node} @@ -5293,7 +5276,7 @@ yydefault: } case 301: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2846 +// line internal/php7/php7.y:2829 { yyVAL.node = &ast.ExprAssignPlus{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5306,7 +5289,7 @@ yydefault: } case 302: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2857 +// line internal/php7/php7.y:2840 { yyVAL.node = &ast.ExprAssignMinus{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5319,7 +5302,7 @@ yydefault: } case 303: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2868 +// line internal/php7/php7.y:2851 { yyVAL.node = &ast.ExprAssignMul{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5332,7 +5315,7 @@ yydefault: } case 304: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2879 +// line internal/php7/php7.y:2862 { yyVAL.node = &ast.ExprAssignPow{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5345,7 +5328,7 @@ yydefault: } case 305: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2890 +// line internal/php7/php7.y:2873 { yyVAL.node = &ast.ExprAssignDiv{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5358,7 +5341,7 @@ yydefault: } case 306: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2901 +// line internal/php7/php7.y:2884 { yyVAL.node = &ast.ExprAssignConcat{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5371,7 +5354,7 @@ yydefault: } case 307: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2912 +// line internal/php7/php7.y:2895 { yyVAL.node = &ast.ExprAssignMod{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5384,7 +5367,7 @@ yydefault: } case 308: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2923 +// line internal/php7/php7.y:2906 { yyVAL.node = &ast.ExprAssignBitwiseAnd{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5397,7 +5380,7 @@ yydefault: } case 309: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2934 +// line internal/php7/php7.y:2917 { yyVAL.node = &ast.ExprAssignBitwiseOr{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5410,7 +5393,7 @@ yydefault: } case 310: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2945 +// line internal/php7/php7.y:2928 { yyVAL.node = &ast.ExprAssignBitwiseXor{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5423,7 +5406,7 @@ yydefault: } case 311: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2956 +// line internal/php7/php7.y:2939 { yyVAL.node = &ast.ExprAssignShiftLeft{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5436,7 +5419,7 @@ yydefault: } case 312: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2967 +// line internal/php7/php7.y:2950 { yyVAL.node = &ast.ExprAssignShiftRight{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5449,7 +5432,7 @@ yydefault: } case 313: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:2978 +// line internal/php7/php7.y:2961 { yyVAL.node = &ast.ExprAssignCoalesce{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5462,7 +5445,7 @@ yydefault: } case 314: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:2989 +// line internal/php7/php7.y:2972 { yyVAL.node = &ast.ExprPostInc{ast.Node{}, yyDollar[1].node} @@ -5475,7 +5458,7 @@ yydefault: } case 315: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3000 +// line internal/php7/php7.y:2983 { yyVAL.node = &ast.ExprPreInc{ast.Node{}, yyDollar[2].node} @@ -5487,7 +5470,7 @@ yydefault: } case 316: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3010 +// line internal/php7/php7.y:2993 { yyVAL.node = &ast.ExprPostDec{ast.Node{}, yyDollar[1].node} @@ -5500,7 +5483,7 @@ yydefault: } case 317: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3021 +// line internal/php7/php7.y:3004 { yyVAL.node = &ast.ExprPreDec{ast.Node{}, yyDollar[2].node} @@ -5512,7 +5495,7 @@ yydefault: } case 318: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3031 +// line internal/php7/php7.y:3014 { yyVAL.node = &ast.ExprBinaryBooleanOr{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5525,7 +5508,7 @@ yydefault: } case 319: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3042 +// line internal/php7/php7.y:3025 { yyVAL.node = &ast.ExprBinaryBooleanAnd{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5538,7 +5521,7 @@ yydefault: } case 320: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3053 +// line internal/php7/php7.y:3036 { yyVAL.node = &ast.ExprBinaryLogicalOr{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5551,7 +5534,7 @@ yydefault: } case 321: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3064 +// line internal/php7/php7.y:3047 { yyVAL.node = &ast.ExprBinaryLogicalAnd{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5564,7 +5547,7 @@ yydefault: } case 322: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3075 +// line internal/php7/php7.y:3058 { yyVAL.node = &ast.ExprBinaryLogicalXor{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5577,7 +5560,7 @@ yydefault: } case 323: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3086 +// line internal/php7/php7.y:3069 { yyVAL.node = &ast.ExprBinaryBitwiseOr{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5590,7 +5573,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3097 +// line internal/php7/php7.y:3080 { yyVAL.node = &ast.ExprBinaryBitwiseAnd{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5603,7 +5586,7 @@ yydefault: } case 325: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3108 +// line internal/php7/php7.y:3091 { yyVAL.node = &ast.ExprBinaryBitwiseXor{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5616,7 +5599,7 @@ yydefault: } case 326: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3119 +// line internal/php7/php7.y:3102 { yyVAL.node = &ast.ExprBinaryConcat{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5629,7 +5612,7 @@ yydefault: } case 327: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3130 +// line internal/php7/php7.y:3113 { yyVAL.node = &ast.ExprBinaryPlus{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5642,7 +5625,7 @@ yydefault: } case 328: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3141 +// line internal/php7/php7.y:3124 { yyVAL.node = &ast.ExprBinaryMinus{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5655,7 +5638,7 @@ yydefault: } case 329: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3152 +// line internal/php7/php7.y:3135 { yyVAL.node = &ast.ExprBinaryMul{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5668,7 +5651,7 @@ yydefault: } case 330: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3163 +// line internal/php7/php7.y:3146 { yyVAL.node = &ast.ExprBinaryPow{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5681,7 +5664,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3174 +// line internal/php7/php7.y:3157 { yyVAL.node = &ast.ExprBinaryDiv{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5694,7 +5677,7 @@ yydefault: } case 332: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3185 +// line internal/php7/php7.y:3168 { yyVAL.node = &ast.ExprBinaryMod{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5707,7 +5690,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3196 +// line internal/php7/php7.y:3179 { yyVAL.node = &ast.ExprBinaryShiftLeft{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5720,7 +5703,7 @@ yydefault: } case 334: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3207 +// line internal/php7/php7.y:3190 { yyVAL.node = &ast.ExprBinaryShiftRight{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5733,7 +5716,7 @@ yydefault: } case 335: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3218 +// line internal/php7/php7.y:3201 { yyVAL.node = &ast.ExprUnaryPlus{ast.Node{}, yyDollar[2].node} @@ -5745,7 +5728,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3228 +// line internal/php7/php7.y:3211 { yyVAL.node = &ast.ExprUnaryMinus{ast.Node{}, yyDollar[2].node} @@ -5757,7 +5740,7 @@ yydefault: } case 337: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3238 +// line internal/php7/php7.y:3221 { yyVAL.node = &ast.ExprBooleanNot{ast.Node{}, yyDollar[2].node} @@ -5769,7 +5752,7 @@ yydefault: } case 338: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3248 +// line internal/php7/php7.y:3231 { yyVAL.node = &ast.ExprBitwiseNot{ast.Node{}, yyDollar[2].node} @@ -5781,7 +5764,7 @@ yydefault: } case 339: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3258 +// line internal/php7/php7.y:3241 { yyVAL.node = &ast.ExprBinaryIdentical{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5794,7 +5777,7 @@ yydefault: } case 340: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3269 +// line internal/php7/php7.y:3252 { yyVAL.node = &ast.ExprBinaryNotIdentical{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5807,7 +5790,7 @@ yydefault: } case 341: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3280 +// line internal/php7/php7.y:3263 { yyVAL.node = &ast.ExprBinaryEqual{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5820,7 +5803,7 @@ yydefault: } case 342: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3291 +// line internal/php7/php7.y:3274 { yyVAL.node = &ast.ExprBinaryNotEqual{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5834,7 +5817,7 @@ yydefault: } case 343: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3303 +// line internal/php7/php7.y:3286 { yyVAL.node = &ast.ExprBinarySmaller{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5847,7 +5830,7 @@ yydefault: } case 344: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3314 +// line internal/php7/php7.y:3297 { yyVAL.node = &ast.ExprBinarySmallerOrEqual{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5860,7 +5843,7 @@ yydefault: } case 345: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3325 +// line internal/php7/php7.y:3308 { yyVAL.node = &ast.ExprBinaryGreater{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5873,7 +5856,7 @@ yydefault: } case 346: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3336 +// line internal/php7/php7.y:3319 { yyVAL.node = &ast.ExprBinaryGreaterOrEqual{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5886,7 +5869,7 @@ yydefault: } case 347: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3347 +// line internal/php7/php7.y:3330 { yyVAL.node = &ast.ExprBinarySpaceship{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5899,7 +5882,7 @@ yydefault: } case 348: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3358 +// line internal/php7/php7.y:3341 { yyVAL.node = &ast.ExprInstanceOf{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5912,7 +5895,7 @@ yydefault: } case 349: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3369 +// line internal/php7/php7.y:3352 { yyVAL.node = &ast.ParserBrackets{ Node: ast.Node{ @@ -5929,13 +5912,13 @@ yydefault: } case 350: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3384 +// line internal/php7/php7.y:3367 { yyVAL.node = yyDollar[1].node } case 351: yyDollar = yyS[yypt-5 : yypt+1] -// line internal/php7/php7.y:3388 +// line internal/php7/php7.y:3371 { yyVAL.node = &ast.ExprTernary{ast.Node{}, yyDollar[1].node, yyDollar[3].node, yyDollar[5].node} @@ -5949,7 +5932,7 @@ yydefault: } case 352: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:3400 +// line internal/php7/php7.y:3383 { yyVAL.node = &ast.ExprTernary{ast.Node{}, yyDollar[1].node, nil, yyDollar[4].node} @@ -5963,7 +5946,7 @@ yydefault: } case 353: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3412 +// line internal/php7/php7.y:3395 { yyVAL.node = &ast.ExprBinaryCoalesce{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -5976,13 +5959,13 @@ yydefault: } case 354: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3423 +// line internal/php7/php7.y:3406 { yyVAL.node = yyDollar[1].node } case 355: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3427 +// line internal/php7/php7.y:3410 { yyVAL.node = &ast.ExprCastInt{ast.Node{}, yyDollar[2].node} @@ -5995,7 +5978,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3438 +// line internal/php7/php7.y:3421 { yyVAL.node = &ast.ExprCastDouble{ast.Node{}, yyDollar[2].node} @@ -6008,7 +5991,7 @@ yydefault: } case 357: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3449 +// line internal/php7/php7.y:3432 { yyVAL.node = &ast.ExprCastString{ast.Node{}, yyDollar[2].node} @@ -6021,7 +6004,7 @@ yydefault: } case 358: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3460 +// line internal/php7/php7.y:3443 { yyVAL.node = &ast.ExprCastArray{ast.Node{}, yyDollar[2].node} @@ -6034,7 +6017,7 @@ yydefault: } case 359: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3471 +// line internal/php7/php7.y:3454 { yyVAL.node = &ast.ExprCastObject{ast.Node{}, yyDollar[2].node} @@ -6047,7 +6030,7 @@ yydefault: } case 360: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3482 +// line internal/php7/php7.y:3465 { yyVAL.node = &ast.ExprCastBool{ast.Node{}, yyDollar[2].node} @@ -6060,7 +6043,7 @@ yydefault: } case 361: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3493 +// line internal/php7/php7.y:3476 { yyVAL.node = &ast.ExprCastUnset{ast.Node{}, yyDollar[2].node} @@ -6073,7 +6056,7 @@ yydefault: } case 362: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3504 +// line internal/php7/php7.y:3487 { yyVAL.node = &ast.ExprExit{ast.Node{}, false, yyDollar[2].node} @@ -6093,7 +6076,7 @@ yydefault: } case 363: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3522 +// line internal/php7/php7.y:3505 { yyVAL.node = &ast.ExprErrorSuppress{ast.Node{}, yyDollar[2].node} @@ -6105,13 +6088,13 @@ yydefault: } case 364: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3532 +// line internal/php7/php7.y:3515 { yyVAL.node = yyDollar[1].node } case 365: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3536 +// line internal/php7/php7.y:3519 { yyVAL.node = &ast.ExprShellExec{ast.Node{}, yyDollar[2].list} @@ -6123,7 +6106,7 @@ yydefault: } case 366: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3546 +// line internal/php7/php7.y:3529 { yyVAL.node = &ast.ExprPrint{ast.Node{}, yyDollar[2].node} @@ -6135,7 +6118,7 @@ yydefault: } case 367: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3556 +// line internal/php7/php7.y:3539 { yyVAL.node = &ast.ExprYield{ast.Node{}, nil, nil} @@ -6147,7 +6130,7 @@ yydefault: } case 368: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3566 +// line internal/php7/php7.y:3549 { yyVAL.node = &ast.ExprYield{ast.Node{}, nil, yyDollar[2].node} @@ -6159,7 +6142,7 @@ yydefault: } case 369: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:3576 +// line internal/php7/php7.y:3559 { yyVAL.node = &ast.ExprYield{ast.Node{}, yyDollar[2].node, yyDollar[4].node} @@ -6172,7 +6155,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3587 +// line internal/php7/php7.y:3570 { yyVAL.node = &ast.ExprYieldFrom{ast.Node{}, yyDollar[2].node} @@ -6184,13 +6167,13 @@ yydefault: } case 371: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3597 +// line internal/php7/php7.y:3580 { yyVAL.node = yyDollar[1].node } case 372: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3601 +// line internal/php7/php7.y:3584 { yyVAL.node = yyDollar[2].node @@ -6211,7 +6194,7 @@ yydefault: } case 373: yyDollar = yyS[yypt-11 : yypt+1] -// line internal/php7/php7.y:3622 +// line internal/php7/php7.y:3605 { yyVAL.node = &ast.ExprClosure{ast.Node{}, yyDollar[2].token != nil, false, yyDollar[5].list, yyDollar[7].ClosureUse, yyDollar[8].node, yyDollar[10].list} @@ -6242,7 +6225,7 @@ yydefault: } case 374: yyDollar = yyS[yypt-9 : yypt+1] -// line internal/php7/php7.y:3649 +// line internal/php7/php7.y:3632 { yyVAL.node = &ast.ExprArrowFunction{ast.Node{}, yyDollar[2].token != nil, false, yyDollar[4].list, yyDollar[6].node, yyDollar[9].node} @@ -6268,25 +6251,25 @@ yydefault: } case 376: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:3679 +// line internal/php7/php7.y:3662 { yyVAL.token = nil } case 377: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3683 +// line internal/php7/php7.y:3666 { yyVAL.token = yyDollar[1].token } case 378: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:3690 +// line internal/php7/php7.y:3673 { yyVAL.ClosureUse = nil } case 379: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:3694 +// line internal/php7/php7.y:3677 { yyVAL.ClosureUse = &ast.ExprClosureUse{ast.Node{}, yyDollar[3].list} @@ -6300,7 +6283,7 @@ yydefault: } case 380: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3709 +// line internal/php7/php7.y:3692 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -6309,13 +6292,13 @@ yydefault: } case 381: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3716 +// line internal/php7/php7.y:3699 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 382: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3723 +// line internal/php7/php7.y:3706 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.ExprVariable{ast.Node{}, identifier} @@ -6329,7 +6312,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3735 +// line internal/php7/php7.y:3718 { identifier := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -6346,7 +6329,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3753 +// line internal/php7/php7.y:3736 { yyVAL.node = &ast.ExprFunctionCall{ast.Node{}, yyDollar[1].node, yyDollar[2].node.(*ast.ArgumentList)} @@ -6358,7 +6341,7 @@ yydefault: } case 385: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:3763 +// line internal/php7/php7.y:3746 { yyVAL.node = &ast.ExprStaticCall{ast.Node{}, yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*ast.ArgumentList)} @@ -6371,7 +6354,7 @@ yydefault: } case 386: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:3774 +// line internal/php7/php7.y:3757 { yyVAL.node = &ast.ExprStaticCall{ast.Node{}, yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*ast.ArgumentList)} @@ -6384,7 +6367,7 @@ yydefault: } case 387: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:3785 +// line internal/php7/php7.y:3768 { yyVAL.node = &ast.ExprFunctionCall{ast.Node{}, yyDollar[1].node, yyDollar[2].node.(*ast.ArgumentList)} @@ -6396,7 +6379,7 @@ yydefault: } case 388: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3798 +// line internal/php7/php7.y:3781 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -6408,31 +6391,31 @@ yydefault: } case 389: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3808 +// line internal/php7/php7.y:3791 { yyVAL.node = yyDollar[1].node } case 390: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3815 +// line internal/php7/php7.y:3798 { yyVAL.node = yyDollar[1].node } case 391: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3819 +// line internal/php7/php7.y:3802 { yyVAL.node = yyDollar[1].node } case 392: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:3826 +// line internal/php7/php7.y:3809 { yyVAL.node = nil } case 393: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3830 +// line internal/php7/php7.y:3813 { yyVAL.node = &ast.ParserBrackets{ Node: ast.Node{ @@ -6449,13 +6432,13 @@ yydefault: } case 394: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:3848 +// line internal/php7/php7.y:3831 { yyVAL.list = []ast.Vertex{} } case 395: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3852 +// line internal/php7/php7.y:3835 { part := &ast.ScalarEncapsedStringPart{ast.Node{}, yyDollar[1].token.Value} yyVAL.list = []ast.Vertex{part} @@ -6465,25 +6448,25 @@ yydefault: } case 396: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3860 +// line internal/php7/php7.y:3843 { yyVAL.list = yyDollar[1].list } case 397: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:3867 +// line internal/php7/php7.y:3850 { yyVAL.node = nil } case 398: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3871 +// line internal/php7/php7.y:3854 { yyVAL.node = yyDollar[1].node } case 399: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:3878 +// line internal/php7/php7.y:3861 { yyVAL.node = &ast.ExprArray{ast.Node{}, yyDollar[3].list} @@ -6497,7 +6480,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:3890 +// line internal/php7/php7.y:3873 { yyVAL.node = &ast.ExprShortArray{ast.Node{}, yyDollar[2].list} @@ -6510,7 +6493,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3901 +// line internal/php7/php7.y:3884 { yyVAL.node = &ast.ScalarString{ast.Node{}, yyDollar[1].token.Value} @@ -6522,7 +6505,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3914 +// line internal/php7/php7.y:3897 { yyVAL.node = &ast.ScalarLnumber{ast.Node{}, yyDollar[1].token.Value} @@ -6534,7 +6517,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3924 +// line internal/php7/php7.y:3907 { yyVAL.node = &ast.ScalarDnumber{ast.Node{}, yyDollar[1].token.Value} @@ -6546,7 +6529,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3934 +// line internal/php7/php7.y:3917 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -6558,7 +6541,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3944 +// line internal/php7/php7.y:3927 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -6570,7 +6553,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3954 +// line internal/php7/php7.y:3937 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -6582,7 +6565,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3964 +// line internal/php7/php7.y:3947 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -6594,7 +6577,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3974 +// line internal/php7/php7.y:3957 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -6606,7 +6589,7 @@ yydefault: } case 409: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3984 +// line internal/php7/php7.y:3967 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -6618,7 +6601,7 @@ yydefault: } case 410: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:3994 +// line internal/php7/php7.y:3977 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -6630,7 +6613,7 @@ yydefault: } case 411: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4004 +// line internal/php7/php7.y:3987 { yyVAL.node = &ast.ScalarMagicConstant{ast.Node{}, yyDollar[1].token.Value} @@ -6642,7 +6625,7 @@ yydefault: } case 412: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:4014 +// line internal/php7/php7.y:3997 { encapsed := &ast.ScalarEncapsedStringPart{ast.Node{}, yyDollar[2].token.Value} yyVAL.node = &ast.ScalarHeredoc{ast.Node{}, yyDollar[1].token.Value, []ast.Vertex{encapsed}} @@ -6656,7 +6639,7 @@ yydefault: } case 413: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:4026 +// line internal/php7/php7.y:4009 { yyVAL.node = &ast.ScalarHeredoc{ast.Node{}, yyDollar[1].token.Value, nil} @@ -6668,7 +6651,7 @@ yydefault: } case 414: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:4036 +// line internal/php7/php7.y:4019 { yyVAL.node = &ast.ScalarEncapsed{ast.Node{}, yyDollar[2].list} @@ -6680,7 +6663,7 @@ yydefault: } case 415: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:4046 +// line internal/php7/php7.y:4029 { yyVAL.node = &ast.ScalarHeredoc{ast.Node{}, yyDollar[1].token.Value, yyDollar[2].list} @@ -6692,19 +6675,19 @@ yydefault: } case 416: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4056 +// line internal/php7/php7.y:4039 { yyVAL.node = yyDollar[1].node } case 417: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4060 +// line internal/php7/php7.y:4043 { yyVAL.node = yyDollar[1].node } case 418: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4067 +// line internal/php7/php7.y:4050 { yyVAL.node = &ast.ExprConstFetch{ast.Node{}, yyDollar[1].node} @@ -6716,7 +6699,7 @@ yydefault: } case 419: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:4077 +// line internal/php7/php7.y:4060 { target := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} yyVAL.node = &ast.ExprClassConstFetch{ast.Node{}, yyDollar[1].node, target} @@ -6732,7 +6715,7 @@ yydefault: } case 420: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:4091 +// line internal/php7/php7.y:4074 { target := &ast.Identifier{ast.Node{}, yyDollar[3].token.Value} yyVAL.node = &ast.ExprClassConstFetch{ast.Node{}, yyDollar[1].node, target} @@ -6748,43 +6731,43 @@ yydefault: } case 421: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4108 +// line internal/php7/php7.y:4091 { yyVAL.node = yyDollar[1].node } case 422: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4112 +// line internal/php7/php7.y:4095 { yyVAL.node = yyDollar[1].node } case 423: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:4119 +// line internal/php7/php7.y:4102 { yyVAL.node = nil } case 424: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4123 +// line internal/php7/php7.y:4106 { yyVAL.node = yyDollar[1].node } case 425: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4130 +// line internal/php7/php7.y:4113 { yyVAL.node = yyDollar[1].node } case 426: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4137 +// line internal/php7/php7.y:4120 { yyVAL.node = yyDollar[1].node } case 427: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:4141 +// line internal/php7/php7.y:4124 { yyVAL.node = &ast.ParserBrackets{ Node: ast.Node{ @@ -6801,19 +6784,19 @@ yydefault: } case 428: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4156 +// line internal/php7/php7.y:4139 { yyVAL.node = yyDollar[1].node } case 429: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4163 +// line internal/php7/php7.y:4146 { yyVAL.node = yyDollar[1].node } case 430: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:4167 +// line internal/php7/php7.y:4150 { yyVAL.node = &ast.ParserBrackets{ Node: ast.Node{ @@ -6830,19 +6813,19 @@ yydefault: } case 431: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4182 +// line internal/php7/php7.y:4165 { yyVAL.node = yyDollar[1].node } case 432: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4189 +// line internal/php7/php7.y:4172 { yyVAL.node = yyDollar[1].node } case 433: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:4193 +// line internal/php7/php7.y:4176 { yyVAL.node = &ast.ExprArrayDimFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6855,7 +6838,7 @@ yydefault: } case 434: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:4204 +// line internal/php7/php7.y:4187 { yyVAL.node = &ast.ExprArrayDimFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6868,7 +6851,7 @@ yydefault: } case 435: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:4215 +// line internal/php7/php7.y:4198 { yyVAL.node = &ast.ExprArrayDimFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6881,7 +6864,7 @@ yydefault: } case 436: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:4226 +// line internal/php7/php7.y:4209 { yyVAL.node = &ast.ExprMethodCall{ast.Node{}, yyDollar[1].node, yyDollar[3].node, yyDollar[4].node.(*ast.ArgumentList)} @@ -6894,25 +6877,25 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4237 +// line internal/php7/php7.y:4220 { yyVAL.node = yyDollar[1].node } case 438: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4244 +// line internal/php7/php7.y:4227 { yyVAL.node = yyDollar[1].node } case 439: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4248 +// line internal/php7/php7.y:4231 { yyVAL.node = yyDollar[1].node } case 440: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:4252 +// line internal/php7/php7.y:4235 { yyVAL.node = &ast.ExprPropertyFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6925,7 +6908,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4266 +// line internal/php7/php7.y:4249 { name := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.ExprVariable{ast.Node{}, name} @@ -6939,7 +6922,7 @@ yydefault: } case 442: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:4278 +// line internal/php7/php7.y:4261 { yyVAL.node = &ast.ExprVariable{ast.Node{}, yyDollar[3].node} @@ -6953,7 +6936,7 @@ yydefault: } case 443: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:4290 +// line internal/php7/php7.y:4273 { yyVAL.node = &ast.ExprVariable{ast.Node{}, yyDollar[2].node} @@ -6965,7 +6948,7 @@ yydefault: } case 444: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:4303 +// line internal/php7/php7.y:4286 { yyVAL.node = &ast.ExprStaticPropertyFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6978,7 +6961,7 @@ yydefault: } case 445: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:4314 +// line internal/php7/php7.y:4297 { yyVAL.node = &ast.ExprStaticPropertyFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -6991,13 +6974,13 @@ yydefault: } case 446: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4328 +// line internal/php7/php7.y:4311 { yyVAL.node = yyDollar[1].node } case 447: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:4332 +// line internal/php7/php7.y:4315 { yyVAL.node = &ast.ExprArrayDimFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7010,7 +6993,7 @@ yydefault: } case 448: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:4343 +// line internal/php7/php7.y:4326 { yyVAL.node = &ast.ExprArrayDimFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7023,7 +7006,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:4354 +// line internal/php7/php7.y:4337 { yyVAL.node = &ast.ExprPropertyFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7036,7 +7019,7 @@ yydefault: } case 450: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:4365 +// line internal/php7/php7.y:4348 { yyVAL.node = &ast.ExprStaticPropertyFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7049,7 +7032,7 @@ yydefault: } case 451: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:4376 +// line internal/php7/php7.y:4359 { yyVAL.node = &ast.ExprStaticPropertyFetch{ast.Node{}, yyDollar[1].node, yyDollar[3].node} @@ -7062,7 +7045,7 @@ yydefault: } case 452: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4390 +// line internal/php7/php7.y:4373 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -7074,7 +7057,7 @@ yydefault: } case 453: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:4400 +// line internal/php7/php7.y:4383 { yyVAL.node = yyDollar[2].node @@ -7084,13 +7067,13 @@ yydefault: } case 454: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4408 +// line internal/php7/php7.y:4391 { yyVAL.node = yyDollar[1].node } case 455: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4415 +// line internal/php7/php7.y:4398 { yyVAL.node = &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} @@ -7102,7 +7085,7 @@ yydefault: } case 456: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:4425 +// line internal/php7/php7.y:4408 { yyVAL.node = yyDollar[2].node @@ -7112,31 +7095,31 @@ yydefault: } case 457: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4433 +// line internal/php7/php7.y:4416 { yyVAL.node = yyDollar[1].node } case 458: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4440 +// line internal/php7/php7.y:4423 { yyVAL.list = yyDollar[1].list } case 459: yyDollar = yyS[yypt-0 : yypt+1] -// line internal/php7/php7.y:4447 +// line internal/php7/php7.y:4430 { yyVAL.node = &ast.ExprArrayItem{ast.Node{}, false, nil, nil} } case 460: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4451 +// line internal/php7/php7.y:4434 { yyVAL.node = yyDollar[1].node } case 461: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:4458 +// line internal/php7/php7.y:4441 { if len(yyDollar[1].list) == 0 { yyDollar[1].list = []ast.Vertex{&ast.ExprArrayItem{ast.Node{}, false, nil, nil}} @@ -7149,7 +7132,7 @@ yydefault: } case 462: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4469 +// line internal/php7/php7.y:4452 { if yyDollar[1].node.(*ast.ExprArrayItem).Key == nil && yyDollar[1].node.(*ast.ExprArrayItem).Val == nil { yyVAL.list = []ast.Vertex{} @@ -7159,7 +7142,7 @@ yydefault: } case 463: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:4480 +// line internal/php7/php7.y:4463 { yyVAL.node = &ast.ExprArrayItem{ast.Node{}, false, yyDollar[1].node, yyDollar[3].node} @@ -7172,7 +7155,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4491 +// line internal/php7/php7.y:4474 { yyVAL.node = &ast.ExprArrayItem{ast.Node{}, false, nil, yyDollar[1].node} @@ -7184,7 +7167,7 @@ yydefault: } case 465: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:4501 +// line internal/php7/php7.y:4484 { reference := &ast.ExprReference{ast.Node{}, yyDollar[4].node} yyVAL.node = &ast.ExprArrayItem{ast.Node{}, false, yyDollar[1].node, reference} @@ -7200,7 +7183,7 @@ yydefault: } case 466: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:4515 +// line internal/php7/php7.y:4498 { reference := &ast.ExprReference{ast.Node{}, yyDollar[2].node} yyVAL.node = &ast.ExprArrayItem{ast.Node{}, false, nil, reference} @@ -7214,7 +7197,7 @@ yydefault: } case 467: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:4527 +// line internal/php7/php7.y:4510 { yyVAL.node = &ast.ExprArrayItem{ast.Node{}, true, nil, yyDollar[2].node} @@ -7226,7 +7209,7 @@ yydefault: } case 468: yyDollar = yyS[yypt-6 : yypt+1] -// line internal/php7/php7.y:4537 +// line internal/php7/php7.y:4520 { // TODO: Cannot use list() as standalone expression listNode := &ast.ExprList{ast.Node{}, yyDollar[5].list} @@ -7245,7 +7228,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:4554 +// line internal/php7/php7.y:4537 { // TODO: Cannot use list() as standalone expression listNode := &ast.ExprList{ast.Node{}, yyDollar[3].list} @@ -7262,13 +7245,13 @@ yydefault: } case 470: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:4572 +// line internal/php7/php7.y:4555 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 471: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:4576 +// line internal/php7/php7.y:4559 { encapsed := &ast.ScalarEncapsedStringPart{ast.Node{}, yyDollar[2].token.Value} yyVAL.list = append(yyDollar[1].list, encapsed) @@ -7281,13 +7264,13 @@ yydefault: } case 472: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4587 +// line internal/php7/php7.y:4570 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 473: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:4591 +// line internal/php7/php7.y:4574 { encapsed := &ast.ScalarEncapsedStringPart{ast.Node{}, yyDollar[1].token.Value} yyVAL.list = []ast.Vertex{encapsed, yyDollar[2].node} @@ -7300,7 +7283,7 @@ yydefault: } case 474: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4605 +// line internal/php7/php7.y:4588 { name := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.ExprVariable{ast.Node{}, name} @@ -7314,7 +7297,7 @@ yydefault: } case 475: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:4617 +// line internal/php7/php7.y:4600 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -7331,7 +7314,7 @@ yydefault: } case 476: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:4632 +// line internal/php7/php7.y:4615 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -7350,7 +7333,7 @@ yydefault: } case 477: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:4649 +// line internal/php7/php7.y:4632 { variable := &ast.ExprVariable{ast.Node{}, yyDollar[2].node} @@ -7365,7 +7348,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:4662 +// line internal/php7/php7.y:4645 { name := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} variable := &ast.ExprVariable{ast.Node{}, name} @@ -7382,7 +7365,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-6 : yypt+1] -// line internal/php7/php7.y:4677 +// line internal/php7/php7.y:4660 { identifier := &ast.Identifier{ast.Node{}, yyDollar[2].token.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} @@ -7401,7 +7384,7 @@ yydefault: } case 480: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:4694 +// line internal/php7/php7.y:4677 { yyVAL.node = yyDollar[2].node @@ -7411,7 +7394,7 @@ yydefault: } case 481: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4705 +// line internal/php7/php7.y:4688 { yyVAL.node = &ast.ScalarString{ast.Node{}, yyDollar[1].token.Value} @@ -7423,7 +7406,7 @@ yydefault: } case 482: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4715 +// line internal/php7/php7.y:4698 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(string(yyDollar[1].token.Value)); err == nil { @@ -7440,7 +7423,7 @@ yydefault: } case 483: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:4730 +// line internal/php7/php7.y:4713 { var lnumber *ast.ScalarLnumber // TODO: add option to handle 64 bit integer @@ -7466,7 +7449,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4754 +// line internal/php7/php7.y:4737 { identifier := &ast.Identifier{ast.Node{}, yyDollar[1].token.Value} yyVAL.node = &ast.ExprVariable{ast.Node{}, identifier} @@ -7480,7 +7463,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-5 : yypt+1] -// line internal/php7/php7.y:4769 +// line internal/php7/php7.y:4752 { yyVAL.node = &ast.ExprIsset{ast.Node{}, yyDollar[3].list} @@ -7498,7 +7481,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:4785 +// line internal/php7/php7.y:4768 { exprBrackets := &ast.ParserBrackets{ Node: ast.Node{ @@ -7520,7 +7503,7 @@ yydefault: } case 487: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:4805 +// line internal/php7/php7.y:4788 { yyVAL.node = &ast.ExprInclude{ast.Node{}, yyDollar[2].node} @@ -7532,7 +7515,7 @@ yydefault: } case 488: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:4815 +// line internal/php7/php7.y:4798 { yyVAL.node = &ast.ExprIncludeOnce{ast.Node{}, yyDollar[2].node} @@ -7544,7 +7527,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-4 : yypt+1] -// line internal/php7/php7.y:4825 +// line internal/php7/php7.y:4808 { exprBrackets := &ast.ParserBrackets{ Node: ast.Node{ @@ -7566,7 +7549,7 @@ yydefault: } case 490: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:4845 +// line internal/php7/php7.y:4828 { yyVAL.node = &ast.ExprRequire{ast.Node{}, yyDollar[2].node} @@ -7578,7 +7561,7 @@ yydefault: } case 491: yyDollar = yyS[yypt-2 : yypt+1] -// line internal/php7/php7.y:4855 +// line internal/php7/php7.y:4838 { yyVAL.node = &ast.ExprRequireOnce{ast.Node{}, yyDollar[2].node} @@ -7590,13 +7573,13 @@ yydefault: } case 492: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4868 +// line internal/php7/php7.y:4851 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 493: yyDollar = yyS[yypt-3 : yypt+1] -// line internal/php7/php7.y:4872 +// line internal/php7/php7.y:4855 { yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) @@ -7605,7 +7588,7 @@ yydefault: } case 494: yyDollar = yyS[yypt-1 : yypt+1] -// line internal/php7/php7.y:4882 +// line internal/php7/php7.y:4865 { yyVAL.node = yyDollar[1].node } diff --git a/internal/php7/php7.y b/internal/php7/php7.y index 03fbb1e..bc12e9f 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -870,31 +870,13 @@ statement: } | T_WHILE '(' expr ')' while_statement { - exprBrackets := &ast.ParserBrackets{ - Node: ast.Node{ - Position: position.NewTokensPosition($2, $4), - }, - OpenBracketTkn: $2, - Child: $3, - CloseBracketTkn: $4, - } - - switch n := $5.(type) { - case *ast.StmtWhile : - n.Cond = exprBrackets - case *ast.StmtAltWhile : - n.Cond = exprBrackets - } + $5.(*ast.StmtWhile).WhileTkn = $1 + $5.(*ast.StmtWhile).OpenParenthesisTkn = $2 + $5.(*ast.StmtWhile).Cond = $3 + $5.(*ast.StmtWhile).CloseParenthesisTkn = $4 + $5.(*ast.StmtWhile).Node.Position = position.NewTokenNodePosition($1, $5) $$ = $5 - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $5) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $2.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.End, $4.SkippedTokens) } | T_DO statement T_WHILE '(' expr ')' ';' { @@ -1740,29 +1722,30 @@ case_separator: while_statement: statement { - $$ = &ast.StmtWhile{ast.Node{}, nil, $1} - - // save position - $$.GetNode().Position = position.NewNodePosition($1) + $$ = &ast.StmtWhile{ + Node: ast.Node{ + Position: position.NewNodePosition($1), + }, + Stmt: $1, + } } | ':' inner_statement_list T_ENDWHILE ';' { - stmtList := &ast.StmtStmtList{ + $$ = &ast.StmtWhile{ 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, + }, + EndWhileTkn: $3, + SemiColonTkn: $4, } - $$ = &ast.StmtAltWhile{ast.Node{}, 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 a12803b..2204bc8 100644 --- a/internal/php7/php7_test.go +++ b/internal/php7/php7_test.go @@ -3821,7 +3821,7 @@ func TestPhp7(t *testing.T) { }, }, }, - &ast.StmtAltWhile{ + &ast.StmtWhile{ Node: ast.Node{ Position: &position.Position{ StartLine: 69, @@ -3830,6 +3830,7 @@ func TestPhp7(t *testing.T) { EndPos: 1290, }, }, + Alt: true, Cond: &ast.ScalarLnumber{ Node: ast.Node{ Position: &position.Position{ diff --git a/pkg/ast/ast.go b/pkg/ast/ast.go index 4b60110..cceb924 100644 --- a/pkg/ast/ast.go +++ b/pkg/ast/ast.go @@ -30,7 +30,6 @@ type NodeVisitor interface { StmtAltFor(n *StmtAltFor) StmtAltForeach(n *StmtAltForeach) StmtAltSwitch(n *StmtAltSwitch) - StmtAltWhile(n *StmtAltWhile) StmtBreak(n *StmtBreak) StmtCase(n *StmtCase) StmtCaseList(n *StmtCaseList) diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 993b65b..80ca23e 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -212,17 +212,6 @@ func (n *StmtAltSwitch) Accept(v NodeVisitor) { v.StmtAltSwitch(n) } -// StmtAltWhile node -type StmtAltWhile struct { - Node - Cond Vertex - Stmt Vertex -} - -func (n *StmtAltWhile) Accept(v NodeVisitor) { - v.StmtAltWhile(n) -} - // StmtBreak node type StmtBreak struct { Node @@ -839,8 +828,15 @@ func (n *StmtUseDeclaration) Accept(v NodeVisitor) { // StmtWhile node type StmtWhile struct { Node - Cond Vertex - Stmt Vertex + Alt bool + WhileTkn *token.Token + OpenParenthesisTkn *token.Token + Cond Vertex + CloseParenthesisTkn *token.Token + ColonTkn *token.Token + Stmt Vertex + EndWhileTkn *token.Token + SemiColonTkn *token.Token } func (n *StmtWhile) Accept(v NodeVisitor) { diff --git a/pkg/ast/traverser/dfs.go b/pkg/ast/traverser/dfs.go index 89d6977..5903f24 100644 --- a/pkg/ast/traverser/dfs.go +++ b/pkg/ast/traverser/dfs.go @@ -196,23 +196,6 @@ func (t *DFS) Traverse(n ast.Vertex) { t.Traverse(nn.CaseList) t.visitor.Leave("CaseList", true) } - case *ast.StmtAltWhile: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Cond != nil { - t.visitor.Enter("Cond", true) - t.Traverse(nn.Cond) - t.visitor.Leave("Cond", 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 874e88d..c684ede 100644 --- a/pkg/ast/visitor/dump.go +++ b/pkg/ast/visitor/dump.go @@ -270,12 +270,6 @@ func (v *Dump) StmtAltSwitch(n *ast.StmtAltSwitch) { v.printNode(n.GetNode()) } -func (v *Dump) StmtAltWhile(n *ast.StmtAltWhile) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtAltWhile{\n") - v.printNode(n.GetNode()) -} - func (v *Dump) StmtBreak(n *ast.StmtBreak) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtBreak{\n") @@ -637,6 +631,11 @@ func (v *Dump) StmtWhile(n *ast.StmtWhile) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtWhile{\n") v.printNode(n.GetNode()) + + if n.Alt { + v.printIndent(v.indent) + v.print("Alt: true,\n") + } } func (v *Dump) ExprArray(n *ast.ExprArray) { diff --git a/pkg/ast/visitor/filter_parser_nodes.go b/pkg/ast/visitor/filter_parser_nodes.go index 859778f..20ed98d 100644 --- a/pkg/ast/visitor/filter_parser_nodes.go +++ b/pkg/ast/visitor/filter_parser_nodes.go @@ -13,26 +13,6 @@ func (v *FilterParserNodes) EnterNode(n ast.Vertex) bool { return true } -func (v *FilterParserNodes) StmtWhile(n *ast.StmtWhile) { - for { - if nn, ok := n.Cond.(*ast.ParserBrackets); ok { - n.Cond = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) StmtAltWhile(n *ast.StmtAltWhile) { - for { - if nn, ok := n.Cond.(*ast.ParserBrackets); ok { - n.Cond = nn.Child - } else { - break - } - } -} - func (v *FilterParserNodes) StmtDo(n *ast.StmtDo) { for { if nn, ok := n.Cond.(*ast.ParserBrackets); ok { diff --git a/pkg/ast/visitor/filter_tokens.go b/pkg/ast/visitor/filter_tokens.go index a1df886..620b703 100644 --- a/pkg/ast/visitor/filter_tokens.go +++ b/pkg/ast/visitor/filter_tokens.go @@ -113,3 +113,12 @@ func (v *FilterTokens) ParserBrackets(n *ast.ParserBrackets) { n.OpenBracketTkn = nil n.CloseBracketTkn = nil } + +func (v *FilterTokens) StmtWhile(n *ast.StmtWhile) { + n.WhileTkn = nil + n.OpenParenthesisTkn = nil + n.CloseParenthesisTkn = nil + n.ColonTkn = nil + n.EndWhileTkn = nil + n.SemiColonTkn = nil +} diff --git a/pkg/ast/visitor/null.go b/pkg/ast/visitor/null.go index 83c590d..4054486 100644 --- a/pkg/ast/visitor/null.go +++ b/pkg/ast/visitor/null.go @@ -66,10 +66,6 @@ func (v *Null) StmtAltSwitch(_ *ast.StmtAltSwitch) { // do nothing } -func (v *Null) StmtAltWhile(_ *ast.StmtAltWhile) { - // 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 b089a24..c172f41 100644 --- a/pkg/printer/pretty_printer.go +++ b/pkg/printer/pretty_printer.go @@ -303,8 +303,6 @@ func (p *PrettyPrinter) printNode(n ast.Vertex) { p.printStmtAltForeach(n) case *ast.StmtAltSwitch: p.printStmtAltSwitch(n) - case *ast.StmtAltWhile: - p.printStmtAltWhile(n) case *ast.StmtBreak: p.printStmtBreak(n) case *ast.StmtCase: @@ -1450,21 +1448,6 @@ func (p *PrettyPrinter) printStmtAltSwitch(n ast.Vertex) { io.WriteString(p.w, "endswitch;") } -func (p *PrettyPrinter) printStmtAltWhile(n ast.Vertex) { - nn := n.(*ast.StmtAltWhile) - - io.WriteString(p.w, "while (") - p.Print(nn.Cond) - 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, "endwhile;") -} - func (p *PrettyPrinter) printStmtBreak(n ast.Vertex) { nn := n.(*ast.StmtBreak) @@ -2190,6 +2173,11 @@ func (p *PrettyPrinter) printStmtUseDeclaration(n ast.Vertex) { func (p *PrettyPrinter) printStmtWhile(n ast.Vertex) { nn := n.(*ast.StmtWhile) + if nn.Alt { + p.printStmtAltWhile(nn) + return + } + io.WriteString(p.w, "while (") p.Print(nn.Cond) io.WriteString(p.w, ")") @@ -2209,3 +2197,18 @@ func (p *PrettyPrinter) printStmtWhile(n ast.Vertex) { p.indentDepth-- } } + +func (p *PrettyPrinter) printStmtAltWhile(n ast.Vertex) { + nn := n.(*ast.StmtWhile) + + io.WriteString(p.w, "while (") + p.Print(nn.Cond) + 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, "endwhile;") +} diff --git a/pkg/printer/pretty_printer_test.go b/pkg/printer/pretty_printer_test.go index f4a3188..6bb07ea 100644 --- a/pkg/printer/pretty_printer_test.go +++ b/pkg/printer/pretty_printer_test.go @@ -2091,7 +2091,7 @@ func TestPrintAltElseIf(t *testing.T) { p := printer.NewPrettyPrinter(o, " ") p.Print(&ast.StmtElseIf{ - Alt: true, + Alt: true, Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ @@ -2114,7 +2114,7 @@ func TestPrintAltElseIfEmpty(t *testing.T) { p := printer.NewPrettyPrinter(o, " ") p.Print(&ast.StmtElseIf{ - Alt: true, + Alt: true, Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, Stmt: &ast.StmtStmtList{}, }) @@ -2154,7 +2154,7 @@ func TestPrintAltElseEmpty(t *testing.T) { p := printer.NewPrettyPrinter(o, " ") p.Print(&ast.StmtElse{ - Alt: true, + Alt: true, Stmt: &ast.StmtStmtList{}, }) @@ -2241,7 +2241,7 @@ func TestPrintAltIf(t *testing.T) { p.Print(&ast.StmtNamespace{ Stmts: []ast.Vertex{ &ast.StmtIf{ - Alt: true, + Alt: true, Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ @@ -2250,7 +2250,7 @@ func TestPrintAltIf(t *testing.T) { }, ElseIf: []ast.Vertex{ &ast.StmtElseIf{ - Alt: true, + Alt: true, Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ @@ -2259,7 +2259,7 @@ func TestPrintAltIf(t *testing.T) { }, }, &ast.StmtElseIf{ - Alt: true, + Alt: true, Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("c")}}, Stmt: &ast.StmtStmtList{}, }, @@ -2342,7 +2342,8 @@ func TestPrintAltWhile(t *testing.T) { p := printer.NewPrettyPrinter(o, " ") p.Print(&ast.StmtNamespace{ Stmts: []ast.Vertex{ - &ast.StmtAltWhile{ + &ast.StmtWhile{ + Alt: true, Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index afc80a8..8275817 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -365,8 +365,6 @@ func (p *Printer) printNode(n ast.Vertex) { p.printStmtAltForeach(n) case *ast.StmtAltSwitch: p.printStmtAltSwitch(n) - case *ast.StmtAltWhile: - p.printStmtAltWhile(n) case *ast.StmtBreak: p.printStmtBreak(n) case *ast.StmtCase: @@ -2091,39 +2089,6 @@ func (p *Printer) printStmtAltSwitch(n ast.Vertex) { p.printFreeFloating(nn, token.End) } -func (p *Printer) printStmtAltWhile(n ast.Vertex) { - nn := n.(*ast.StmtAltWhile) - p.printFreeFloating(nn, token.Start) - - io.WriteString(p.w, "while") - - if _, ok := nn.Cond.(*ast.ParserBrackets); !ok { - io.WriteString(p.w, "(") - } - - p.Print(nn.Cond) - - if _, ok := nn.Cond.(*ast.ParserBrackets); !ok { - io.WriteString(p.w, ")") - } - - p.printFreeFloating(nn, token.Cond) - io.WriteString(p.w, ":") - - s := nn.Stmt.(*ast.StmtStmtList) - p.printNodes(s.Stmts) - p.printFreeFloating(nn, token.Stmts) - - io.WriteString(p.w, "endwhile") - p.printFreeFloating(nn, token.AltEnd) - p.printFreeFloating(nn, token.SemiColon) - if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, ";") - } - - p.printFreeFloating(nn, token.End) -} - func (p *Printer) printStmtBreak(n ast.Vertex) { nn := n.(*ast.StmtBreak) p.printFreeFloating(nn, token.Start) @@ -3169,25 +3134,35 @@ func (p *Printer) printStmtUseDeclaration(n *ast.StmtUseDeclaration) { p.printToken(n.CommaTkn, "") } -func (p *Printer) printStmtWhile(n ast.Vertex) { - nn := n.(*ast.StmtWhile) - p.printFreeFloating(nn, token.Start) - - io.WriteString(p.w, "while") - - if _, ok := nn.Cond.(*ast.ParserBrackets); !ok { - io.WriteString(p.w, "(") +func (p *Printer) printStmtWhile(n *ast.StmtWhile) { + if n.Alt { + p.printStmtAltWhile(n) + return } - p.Print(nn.Cond) + p.printToken(n.WhileTkn, "while") + p.printToken(n.OpenParenthesisTkn, "(") + p.Print(n.Cond) + p.printToken(n.CloseParenthesisTkn, ")") - if _, ok := nn.Cond.(*ast.ParserBrackets); !ok { - io.WriteString(p.w, ")") + p.Print(n.Stmt) +} + +func (p *Printer) printStmtAltWhile(n *ast.StmtWhile) { + p.printToken(n.WhileTkn, "while") + p.printToken(n.OpenParenthesisTkn, "(") + p.Print(n.Cond) + p.printToken(n.CloseParenthesisTkn, ")") + p.printToken(n.ColonTkn, ":") + + if stmtList, ok := n.Stmt.(*ast.StmtStmtList); ok { + p.printNodes(stmtList.Stmts) + } else { + p.Print(n.Stmt) } - p.Print(nn.Stmt) - - p.printFreeFloating(nn, token.End) + p.printToken(n.EndWhileTkn, "endwhile") + p.printToken(n.SemiColonTkn, ";") } func (p *Printer) printParserAs(n ast.Vertex) { diff --git a/pkg/printer/printer_parsed_php5_test.go b/pkg/printer/printer_parsed_php5_test.go index 82dd9a2..1af1e60 100644 --- a/pkg/printer/printer_parsed_php5_test.go +++ b/pkg/printer/printer_parsed_php5_test.go @@ -820,7 +820,8 @@ func TestParseAndPrintPhp5AltSwitch(t *testing.T) { } func TestParseAndPrintPhp5AltWhile(t *testing.T) { - src := `