diff --git a/internal/php5/php5.go b/internal/php5/php5.go index bff63f6..7f98c48 100644 --- a/internal/php5/php5.go +++ b/internal/php5/php5.go @@ -21,8 +21,6 @@ type yySymType struct { node ast.Vertex token *token.Token list []ast.Vertex - - ClosureUse *ast.ExprClosureUse } const T_INCLUDE = 57346 @@ -342,7 +340,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -// line internal/php5/php5.y:6522 +// line internal/php5/php5.y:6567 // line yacctab:1 var yyExca = [...]int{ @@ -687,28 +685,28 @@ var yyAct = [...]int{ 284, 723, 259, 652, 650, 231, 521, 438, 647, 521, 91, 572, 963, 572, 971, 39, 602, 39, 514, 481, 395, 324, 203, 202, 199, 39, 136, 39, 39, 946, - 830, 521, 748, 754, 864, 445, 572, 971, 609, 589, - 959, 983, 590, 962, 39, 470, 260, 261, 39, 39, - 521, 259, 572, 591, 255, 994, 283, 572, 996, 285, - 260, 261, 840, 965, 998, 980, 964, 260, 261, 839, - 836, 1006, 1005, 39, 572, 1012, 531, 725, 698, 1013, - 538, 318, 531, 531, 993, 572, 1016, 518, 716, 314, + 748, 521, 754, 864, 445, 609, 572, 971, 589, 590, + 959, 983, 591, 962, 39, 470, 260, 261, 39, 39, + 521, 259, 572, 255, 840, 994, 283, 572, 996, 285, + 260, 261, 965, 964, 998, 980, 839, 260, 261, 836, + 1006, 1005, 725, 39, 572, 1012, 531, 698, 538, 1013, + 403, 318, 531, 531, 993, 572, 1016, 518, 716, 314, 422, 39, 658, 664, 665, 672, 673, 674, 675, 678, - 679, 127, 403, 259, 446, 231, 31, 231, 256, 654, - 531, 575, 296, 656, 655, 39, 260, 261, 449, 903, - 401, 39, 341, 657, 659, 660, 676, 677, 666, 460, - 147, 151, 155, 335, 945, 685, 165, 995, 478, 1009, - 929, 483, 343, 290, 198, 394, 389, 939, 896, 206, - 164, 157, 161, 528, 608, 231, 997, 970, 531, 969, - 223, 968, 967, 838, 235, 236, 237, 238, 260, 261, - 240, 837, 242, 243, 244, 245, 246, 247, 248, 835, - 252, 40, 568, 15, 821, 262, 14, 823, 566, 720, - 276, 277, 802, 279, 280, 695, 11, 249, 75, 76, - 531, 116, 266, 64, 291, 89, 671, 670, 658, 664, - 665, 672, 673, 674, 675, 678, 679, 598, 90, 520, - 101, 74, 12, 531, 326, 654, 531, 680, 662, 656, - 655, 305, 100, 99, 79, 119, 661, 526, 663, 657, - 659, 660, 676, 677, 666, 3, 240, 41, 531, 117, + 679, 127, 575, 259, 446, 231, 31, 231, 256, 654, + 531, 903, 296, 656, 655, 39, 260, 261, 449, 401, + 341, 39, 460, 657, 659, 660, 676, 677, 666, 335, + 147, 151, 155, 945, 685, 995, 165, 1009, 478, 929, + 483, 343, 290, 394, 198, 389, 939, 896, 164, 206, + 157, 161, 528, 608, 997, 231, 970, 969, 531, 968, + 223, 967, 838, 837, 235, 236, 237, 238, 260, 261, + 240, 835, 242, 243, 244, 245, 246, 247, 248, 40, + 252, 568, 15, 14, 821, 262, 823, 566, 720, 802, + 276, 277, 695, 279, 280, 11, 249, 75, 76, 116, + 531, 266, 64, 89, 291, 598, 671, 670, 658, 664, + 665, 672, 673, 674, 675, 678, 679, 90, 520, 101, + 74, 12, 326, 531, 100, 654, 531, 680, 662, 656, + 655, 305, 99, 79, 119, 526, 661, 3, 663, 657, + 659, 660, 676, 677, 666, 830, 240, 41, 531, 117, 842, 342, 0, 0, 0, 0, 843, 0, 0, 841, 0, 0, 0, 0, 0, 0, 0, 531, 0, 0, 880, 0, 0, 0, 361, 362, 363, 364, 365, 366, @@ -1598,78 +1596,78 @@ var yyPact = [...]int{ } var yyPgo = [...]int{ - 0, 29, 1177, 22, 8, 1175, 40, 33, 27, 940, - 1167, 1165, 36, 217, 1179, 91, 1036, 72, 99, 59, - 810, 200, 1164, 31, 1163, 1162, 1154, 42, 1152, 50, - 34, 1151, 1150, 1149, 1148, 131, 1147, 1135, 20, 1133, - 26, 38, 168, 1132, 722, 35, 1131, 1, 1129, 1128, - 24, 1127, 68, 51, 46, 1126, 1125, 1122, 28, 1119, - 3, 1118, 1117, 2, 1116, 1113, 1112, 16, 1111, 1109, - 1101, 1093, 48, 5, 1092, 1091, 1089, 1087, 1086, 6, - 1084, 1017, 1083, 1082, 1081, 18, 1042, 1080, 1078, 1077, - 1076, 1075, 1073, 41, 1072, 1071, 4, 1070, 1069, 1067, - 17, 1065, 12, 1064, 1063, 1059, 7, 21, 30, 1052, - 1050, 25, 1049, 1041, 1032, 14, 39, 0, 1031, 1019, - 1011, 391, 619, 1010, 1008, 52, 1007, 1002, 1001, 15, - 1000, 999, 996, 993, 992, 984, 983, 972, 23, 969, - 19, 9, 968, 37, 965, 964, 963, 962, 182, 13, - 960, 923, + 0, 29, 1177, 22, 8, 13, 1175, 1167, 40, 33, + 27, 940, 1165, 1164, 36, 217, 1179, 91, 1036, 72, + 99, 59, 810, 200, 1163, 31, 1162, 1154, 1152, 42, + 1151, 50, 34, 1150, 1149, 1148, 1147, 131, 1135, 1133, + 20, 1132, 26, 38, 168, 1131, 722, 35, 1129, 1, + 1128, 1127, 24, 1126, 68, 51, 46, 1125, 1122, 1119, + 28, 1118, 3, 1117, 1116, 2, 1113, 1112, 1111, 16, + 1109, 1101, 1093, 1092, 48, 5, 1091, 1089, 1087, 1086, + 1084, 6, 1083, 1017, 1082, 1081, 1080, 18, 1042, 1078, + 1077, 1076, 1075, 1073, 1072, 41, 1071, 1070, 4, 1069, + 1067, 1065, 17, 1064, 12, 1063, 1059, 1052, 7, 21, + 30, 1050, 1049, 25, 1041, 0, 1032, 1031, 1019, 1011, + 1010, 14, 39, 391, 619, 1008, 1007, 52, 1002, 1001, + 1000, 15, 999, 996, 993, 992, 984, 983, 972, 969, + 23, 968, 19, 9, 965, 37, 964, 963, 962, 960, + 182, 923, } var yyR1 = [...]int{ - 0, 151, 116, 116, 117, 117, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 118, 118, - 6, 6, 6, 6, 119, 119, 7, 7, 7, 7, - 120, 120, 8, 8, 8, 8, 55, 55, 121, 121, - 26, 26, 26, 26, 26, 27, 27, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 126, 126, 62, 62, 127, - 127, 128, 128, 63, 90, 90, 58, 53, 54, 149, - 149, 150, 150, 64, 65, 65, 68, 68, 68, 68, - 110, 110, 2, 114, 114, 113, 113, 111, 111, 107, - 107, 106, 106, 106, 103, 103, 102, 102, 59, 59, - 91, 91, 94, 94, 94, 94, 125, 125, 125, 4, - 4, 104, 104, 123, 123, 124, 124, 56, 56, 57, - 57, 60, 60, 61, 61, 67, 67, 66, 66, 66, - 66, 86, 86, 86, 95, 95, 72, 72, 72, 72, - 84, 84, 29, 29, 29, 83, 83, 83, 83, 129, - 129, 69, 69, 69, 69, 71, 112, 112, 89, 89, - 132, 132, 133, 133, 73, 73, 74, 99, 99, 77, - 77, 76, 75, 75, 78, 78, 98, 98, 130, 130, - 131, 131, 134, 134, 79, 79, 79, 79, 79, 79, - 88, 88, 88, 88, 70, 70, 87, 87, 108, 108, - 109, 109, 138, 138, 136, 136, 137, 137, 137, 139, - 139, 44, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 52, 52, 52, 52, - 49, 49, 49, 49, 48, 48, 1, 115, 115, 97, - 97, 97, 97, 25, 25, 25, 25, 25, 25, 25, - 25, 13, 13, 13, 13, 47, 47, 47, 45, 45, - 43, 43, 146, 146, 145, 51, 51, 51, 135, 135, - 135, 85, 85, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 10, 30, 81, 81, 81, - 81, 81, 81, 81, 81, 81, 81, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, - 37, 37, 37, 37, 31, 31, 31, 31, 31, 31, - 31, 100, 100, 3, 3, 101, 101, 101, 101, 16, - 16, 50, 50, 18, 19, 20, 21, 21, 147, 147, - 140, 142, 142, 80, 141, 141, 141, 42, 42, 46, - 46, 14, 24, 24, 22, 22, 22, 23, 23, 23, - 12, 12, 12, 11, 11, 15, 15, 143, 143, 144, - 144, 144, 41, 41, 148, 148, 96, 96, 40, 40, - 40, 93, 93, 92, 92, 92, 92, 92, 92, 92, - 92, 122, 122, 122, 122, 35, 35, 35, 35, 35, - 35, 35, 36, 36, 36, 39, 39, 39, 39, 39, - 39, 39, 39, 105, 105, 38, 38, 32, 32, 33, - 34, + 0, 151, 122, 122, 115, 115, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 117, 117, + 8, 8, 8, 8, 118, 118, 9, 9, 9, 9, + 119, 119, 10, 10, 10, 10, 57, 57, 123, 123, + 28, 28, 28, 28, 28, 29, 29, 30, 30, 30, + 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, + 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, + 30, 30, 30, 30, 30, 128, 128, 64, 64, 129, + 129, 130, 130, 65, 92, 92, 60, 55, 56, 5, + 5, 6, 6, 66, 67, 67, 70, 70, 70, 70, + 112, 112, 2, 120, 120, 116, 116, 113, 113, 109, + 109, 108, 108, 108, 105, 105, 104, 104, 61, 61, + 93, 93, 96, 96, 96, 96, 127, 127, 127, 4, + 4, 106, 106, 125, 125, 126, 126, 58, 58, 59, + 59, 62, 62, 63, 63, 69, 69, 68, 68, 68, + 68, 88, 88, 88, 97, 97, 74, 74, 74, 74, + 86, 86, 31, 31, 31, 85, 85, 85, 85, 131, + 131, 71, 71, 71, 71, 73, 114, 114, 91, 91, + 134, 134, 135, 135, 75, 75, 76, 101, 101, 79, + 79, 78, 77, 77, 80, 80, 100, 100, 132, 132, + 133, 133, 136, 136, 81, 81, 81, 81, 81, 81, + 90, 90, 90, 90, 72, 72, 89, 89, 110, 110, + 111, 111, 140, 140, 138, 138, 139, 139, 139, 141, + 141, 46, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 54, 54, 54, 54, + 51, 51, 51, 51, 50, 50, 1, 121, 121, 99, + 99, 99, 99, 27, 27, 27, 27, 27, 27, 27, + 27, 15, 15, 15, 15, 49, 49, 49, 47, 47, + 45, 45, 148, 148, 147, 53, 53, 53, 137, 137, + 137, 87, 87, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 12, 32, 83, 83, 83, + 83, 83, 83, 83, 83, 83, 83, 84, 84, 84, + 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, + 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, + 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, + 39, 39, 39, 39, 33, 33, 33, 33, 33, 33, + 33, 102, 102, 3, 3, 103, 103, 103, 103, 18, + 18, 52, 52, 20, 21, 22, 23, 23, 149, 149, + 142, 144, 144, 82, 143, 143, 143, 44, 44, 48, + 48, 16, 26, 26, 24, 24, 24, 25, 25, 25, + 14, 14, 14, 13, 13, 17, 17, 145, 145, 146, + 146, 146, 43, 43, 150, 150, 98, 98, 42, 42, + 42, 95, 95, 94, 94, 94, 94, 94, 94, 94, + 94, 124, 124, 124, 124, 37, 37, 37, 37, 37, + 37, 37, 38, 38, 38, 41, 41, 41, 41, 41, + 41, 41, 41, 107, 107, 40, 40, 34, 34, 35, + 36, } var yyR2 = [...]int{ @@ -1729,109 +1727,109 @@ var yyR2 = [...]int{ } var yyChk = [...]int{ - -1000, -151, -116, -5, 2, -27, -53, -54, 52, 80, - 45, -55, -28, 10, -64, -65, 39, 144, 7, 21, - 20, 23, 30, 34, 35, 40, -52, 47, 99, 19, - 14, -16, 49, 25, 27, 146, 41, 44, 36, -1, - -68, -2, 98, -18, -17, 37, 53, 100, 54, 101, - 55, -21, 60, 93, -20, 105, 106, 155, 154, 156, - 157, -50, -44, 148, -39, 108, 109, 110, 111, 112, - 113, 114, 6, 158, -31, -49, -48, 143, 97, -22, - 92, 50, 51, 4, 5, 85, 86, 87, 11, -37, - -34, -9, 142, 75, 63, 18, 61, 150, -23, -24, - -25, -32, -117, 83, -13, 8, 9, 67, 68, 82, - 64, 65, 66, 81, -12, -148, -46, -14, -42, -11, - 159, 12, 148, -117, 144, 83, 10, -118, 37, 39, - -6, -117, 83, 146, 160, 147, 10, -121, -50, 148, - -50, -27, -1, 80, 148, -50, 146, -16, 98, 99, - 146, -16, 146, -17, -21, -16, 146, -84, -29, 12, - 159, -83, -1, 12, -87, -16, 146, 131, 132, 88, + -1000, -151, -122, -7, 2, -29, -55, -56, 52, 80, + 45, -57, -30, 10, -66, -67, 39, 144, 7, 21, + 20, 23, 30, 34, 35, 40, -54, 47, 99, 19, + 14, -18, 49, 25, 27, 146, 41, 44, 36, -1, + -70, -2, 98, -20, -19, 37, 53, 100, 54, 101, + 55, -23, 60, 93, -22, 105, 106, 155, 154, 156, + 157, -52, -46, 148, -41, 108, 109, 110, 111, 112, + 113, 114, 6, 158, -33, -51, -50, 143, 97, -24, + 92, 50, 51, 4, 5, 85, 86, 87, 11, -39, + -36, -11, 142, 75, 63, 18, 61, 150, -25, -26, + -27, -34, -115, 83, -15, 8, 9, 67, 68, 82, + 64, 65, 66, 81, -14, -150, -48, -16, -44, -13, + 159, 12, 148, -115, 144, 83, 10, -117, 37, 39, + -8, -115, 83, 146, 160, 147, 10, -123, -52, 148, + -52, -29, -1, 80, 148, -52, 146, -18, 98, 99, + 146, -18, 146, -19, -23, -18, 146, -86, -31, 12, + 159, -85, -1, 12, -89, -18, 146, 131, 132, 88, 90, 89, 161, 153, 163, 169, 155, 154, 164, 133, 165, 166, 134, 135, 136, 137, 138, 139, 167, 140, - 168, 141, 91, 152, 148, 148, 148, 144, -16, 10, - -149, 153, 10, 10, -17, -21, -16, 53, 53, 162, + 168, 141, 91, 152, 148, 148, 148, 144, -18, 10, + -5, 153, 10, 10, -19, -23, -18, 53, 53, 162, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 148, -16, 105, 106, -20, -21, -117, 80, - 83, -13, -14, 99, -20, -16, -16, -16, -16, -44, - -16, -52, -16, -16, -16, -16, -16, -16, -16, -51, - 148, -50, -16, 150, 150, -135, 17, -122, -35, 12, - 77, 78, -16, 58, -45, -13, -43, -117, 80, 83, - -23, -12, -148, -14, 148, 148, -16, -16, 148, -16, - -16, 150, -122, 17, 17, 76, -122, 150, 148, -93, - -92, -16, 153, 150, 150, 83, -86, 148, -117, 79, - 150, 144, -12, 159, 79, -86, 144, 149, 146, 144, - -116, -117, 146, 160, -119, -7, -117, 83, -120, -8, - -117, 83, 29, -117, 10, 162, -26, 145, 2, -27, - -53, -54, 52, -27, 147, -104, -27, 147, 21, -149, - -108, -109, -16, -94, 144, 147, 146, 146, 146, 146, - 146, 160, -18, 144, -21, 146, 160, -149, 162, 146, - 160, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -45, -16, 147, -90, - -58, -21, -21, -17, -91, 10, -121, 146, 146, 10, - 148, -110, 56, -114, 56, 59, -16, 153, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -96, -40, -21, 60, 83, -117, 79, 79, 149, 149, - 149, 149, -15, -16, -15, 143, -35, -35, 17, 150, - 58, -16, 11, -21, -143, -144, -42, -41, -12, -148, - 10, 144, -85, -86, 79, 83, -117, 58, -12, 79, - -105, -38, -21, -17, -21, -16, -16, -15, 142, 76, - 76, -15, -93, 151, -3, 160, 59, -19, -21, -15, - -15, 10, 149, -95, -52, -72, -17, -21, 153, 84, - -86, -41, -42, 10, 53, -15, -16, -41, -42, 10, - -16, 146, -116, 145, -86, -6, 146, 160, 29, -117, - 146, 160, 29, -117, 10, 29, 162, -30, -81, -9, - -33, -117, 80, 83, 61, 150, -10, 63, -82, 18, - 75, -13, 156, 157, 155, 154, 148, 148, -123, -121, - -121, -50, 146, 160, -125, 146, -125, 146, -29, -16, - 12, 148, -30, -16, 147, -16, 149, 160, 29, 29, - 149, 160, 162, 145, 148, -60, -61, -67, -66, 61, - 62, -47, -117, 80, 83, -113, 57, -47, 144, -111, - -47, -17, -21, -21, 92, 149, 160, 148, -117, -139, - -137, -136, -138, 150, -140, 58, 151, 151, -36, 10, - 13, 12, 10, 145, 145, 150, 145, -141, -80, -142, - -86, 150, 144, -12, -16, -42, -117, -143, -42, 149, - 160, 149, 149, 149, 151, 151, 149, -16, 153, -16, - 153, 151, 151, 149, 160, 149, -19, -16, -86, -86, - 151, 145, -86, -86, 145, 145, -7, 10, 29, -8, - 10, 29, 10, -30, 150, 155, 154, 164, 133, 165, + 128, 129, 148, -18, 105, 106, -22, -23, -115, 80, + 83, -15, -16, 99, -22, -18, -18, -18, -18, -46, + -18, -54, -18, -18, -18, -18, -18, -18, -18, -53, + 148, -52, -18, 150, 150, -137, 17, -124, -37, 12, + 77, 78, -18, 58, -47, -15, -45, -115, 80, 83, + -25, -14, -150, -16, 148, 148, -18, -18, 148, -18, + -18, 150, -124, 17, 17, 76, -124, 150, 148, -95, + -94, -18, 153, 150, 150, 83, -88, 148, -115, 79, + 150, 144, -14, 159, 79, -88, 144, 149, 146, 144, + -122, -115, 146, 160, -118, -9, -115, 83, -119, -10, + -115, 83, 29, -115, 10, 162, -28, 145, 2, -29, + -55, -56, 52, -29, 147, -106, -29, 147, 21, -5, + -110, -111, -18, -96, 144, 147, 146, 146, 146, 146, + 146, 160, -20, 144, -23, 146, 160, -5, 162, 146, + 160, -18, -18, -18, -18, -18, -18, -18, -18, -18, + -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, + -18, -18, -18, -18, -18, -18, -47, -18, 147, -92, + -60, -23, -23, -19, -93, 10, -123, 146, 146, 10, + 148, -112, 56, -120, 56, 59, -18, 153, -18, -18, + -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, + -98, -42, -23, 60, 83, -115, 79, 79, 149, 149, + 149, 149, -17, -18, -17, 143, -37, -37, 17, 150, + 58, -18, 11, -23, -145, -146, -44, -43, -14, -150, + 10, 144, -87, -88, 79, 83, -115, 58, -14, 79, + -107, -40, -23, -19, -23, -18, -18, -17, 142, 76, + 76, -17, -95, 151, -3, 160, 59, -21, -23, -17, + -17, 10, 149, -97, -54, -74, -19, -23, 153, 84, + -88, -43, -44, 10, 53, -17, -18, -43, -44, 10, + -18, 146, -122, 145, -88, -8, 146, 160, 29, -115, + 146, 160, 29, -115, 10, 29, 162, -32, -83, -11, + -35, -115, 80, 83, 61, 150, -12, 63, -84, 18, + 75, -15, 156, 157, 155, 154, 148, 148, -125, -123, + -123, -52, 146, 160, -127, 146, -127, 146, -31, -18, + 12, 148, -32, -18, 147, -18, 149, 160, 29, 29, + 149, 160, 162, 145, 148, -62, -63, -69, -68, 61, + 62, -49, -115, 80, 83, -116, 57, -49, 144, -113, + -49, -19, -23, -23, 92, 149, 160, 148, -115, -141, + -139, -138, -140, 150, -142, 58, 151, 151, -38, 10, + 13, 12, 10, 145, 145, 150, 145, -143, -82, -144, + -88, 150, 144, -14, -18, -44, -115, -145, -44, 149, + 160, 149, 149, 149, 151, 151, 149, -18, 153, -18, + 153, 151, 151, 149, 160, 149, -21, -18, -88, -88, + 151, 145, -88, -88, 145, 145, -9, 10, 29, -10, + 10, 29, 10, -32, 150, 155, 154, 164, 133, 165, 166, 161, 153, 163, 134, 135, 169, 89, 90, 88, 132, 131, 136, 137, 138, 139, 167, 168, 140, 141, - 152, 83, -117, 148, -100, -101, -81, 17, 79, -81, - -81, -81, -81, -81, 149, -56, 94, 95, -124, 22, - 146, -108, -16, 145, 32, 33, -125, 31, -125, 145, - 162, -60, -16, 146, -58, -106, -21, 153, 60, -106, - -59, -27, 147, 10, -30, -126, 42, -60, 149, 160, - -149, 83, -117, 144, -111, -129, 160, -45, 162, -40, - -96, 150, -138, -140, -15, -143, 151, -16, -147, 150, - 150, -15, -16, 145, -146, -38, 59, -19, -19, -72, - 10, 10, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, 147, -81, - -117, -100, 151, -3, 160, 59, 10, 53, 149, 146, - -50, -27, -57, 94, 95, 146, 146, -16, -4, 147, - 146, 145, 146, 31, -30, 149, -107, 59, -21, 148, - -107, -121, 162, -62, 43, 148, 149, -115, 45, -67, - -150, 84, -117, -129, 145, -69, -130, -70, -71, -131, - -134, 48, 39, 45, -79, 104, 103, 102, 99, 100, - 101, -47, -85, -16, 149, -15, 151, -141, 151, -140, - -15, -15, 151, 145, -145, 58, -16, 153, 151, -81, - 147, 149, -81, -81, -27, 96, -50, 147, -108, -4, - -121, 146, -115, 149, -106, -96, 149, 28, -30, 144, - -47, 144, 144, 148, 12, 145, -88, 12, 146, 160, - -1, -79, 10, -112, -47, 151, 145, 151, 151, -143, - -19, -81, 59, 146, 147, -121, 149, -121, 144, -102, - -27, 147, 149, -102, 146, -121, 12, -121, -121, -97, - 12, 153, 162, 146, 160, 162, 10, -149, 162, -89, - 160, 146, 144, -81, -121, -103, -27, 147, -121, -121, - 145, 149, 145, 145, 149, 160, 12, -16, 12, -30, - 162, 10, -30, -47, -132, -133, -73, -74, -75, -76, - -77, -47, 10, -121, 145, 26, 144, 12, 153, 162, - -30, 148, 145, -73, 146, 146, 46, 29, 79, 24, - 146, -121, 12, -30, -60, -99, -47, -78, -79, 10, - 146, 145, 149, 160, 10, -127, -128, -63, 42, -98, - 146, 144, -47, -63, 148, -121, -47, 145, 12, 149, - 144, -121, 145, + 152, 83, -115, 148, -102, -103, -83, 17, 79, -83, + -83, -83, -83, -83, 149, -58, 94, 95, -126, 22, + 146, -110, -18, 145, 32, 33, -127, 31, -127, 145, + 162, -62, -18, 146, -60, -108, -23, 153, 60, -108, + -61, -29, 147, 10, -32, -128, 42, -62, 149, 160, + -5, 83, -115, 144, -113, -131, 160, -47, 162, -42, + -98, 150, -140, -142, -17, -145, 151, -18, -149, 150, + 150, -17, -18, 145, -148, -40, 59, -21, -21, -74, + 10, 10, -83, -83, -83, -83, -83, -83, -83, -83, + -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, + -83, -83, -83, -83, -83, -83, -83, -83, 147, -83, + -115, -102, 151, -3, 160, 59, 10, 53, 149, 146, + -52, -29, -59, 94, 95, 146, 146, -18, -4, 147, + 146, 145, 146, 31, -32, 149, -109, 59, -23, 148, + -109, -123, 162, -64, 43, 148, 149, -121, 45, -69, + -6, 84, -115, -131, 145, -71, -132, -72, -73, -133, + -136, 48, 39, 45, -81, 104, 103, 102, 99, 100, + 101, -49, -87, -18, 149, -17, 151, -143, 151, -142, + -17, -17, 151, 145, -147, 58, -18, 153, 151, -83, + 147, 149, -83, -83, -29, 96, -52, 147, -110, -4, + -123, 146, -121, 149, -108, -98, 149, 28, -32, 144, + -49, 144, 144, 148, 12, 145, -90, 12, 146, 160, + -1, -81, 10, -114, -49, 151, 145, 151, 151, -145, + -21, -83, 59, 146, 147, -123, 149, -123, 144, -104, + -29, 147, 149, -104, 146, -123, 12, -123, -123, -99, + 12, 153, 162, 146, 160, 162, 10, -5, 162, -91, + 160, 146, 144, -83, -123, -105, -29, 147, -123, -123, + 145, 149, 145, 145, 149, 160, 12, -18, 12, -32, + 162, 10, -32, -49, -134, -135, -75, -76, -77, -78, + -79, -49, 10, -123, 145, 26, 144, 12, 153, 162, + -32, 148, 145, -75, 146, 146, 46, 29, 79, 24, + 146, -123, 12, -32, -62, -101, -49, -80, -81, 10, + 146, 145, 149, 160, 10, -129, -130, -65, 42, -100, + 146, 144, -49, -65, 148, -123, -49, 145, 12, 149, + 144, -123, 145, } var yyDef = [...]int{ @@ -2316,7 +2314,7 @@ yydefault: case 1: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:269 +// line internal/php5/php5.y:267 { yylex.(*Parser).rootNode = &ast.Root{ Node: ast.Node{ @@ -2328,7 +2326,7 @@ yydefault: } case 2: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:282 +// line internal/php5/php5.y:280 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -2336,65 +2334,71 @@ yydefault: } case 3: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:288 +// line internal/php5/php5.y:286 { yyVAL.list = []ast.Vertex{} } case 4: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:295 +// line internal/php5/php5.y:293 { - yyVAL.list = []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: position.NewTokenPosition(yyDollar[1].token), + yyVAL.node = &ast.ParserSeparatedList{ + Items: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: position.NewTokenPosition(yyDollar[1].token), + }, + StringTkn: yyDollar[1].token, + Value: yyDollar[1].token.Value, }, - StringTkn: yyDollar[1].token, - Value: yyDollar[1].token.Value, }, } } case 5: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:307 +// line internal/php5/php5.y:307 { - yyVAL.list = append(yyDollar[1].list, &ast.NameNamePart{ + part := &ast.NameNamePart{ Node: ast.Node{ - Position: position.NewTokensPosition(yyDollar[2].token, yyDollar[3].token), + Position: position.NewTokenPosition(yyDollar[3].token), }, - NsSeparatorTkn: yyDollar[2].token, - StringTkn: yyDollar[3].token, - Value: yyDollar[3].token.Value, - }) + StringTkn: yyDollar[3].token, + Value: yyDollar[3].token.Value, + } + + yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns = append(yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns, yyDollar[2].token) + yyDollar[1].node.(*ast.ParserSeparatedList).Items = append(yyDollar[1].node.(*ast.ParserSeparatedList).Items, part) + + yyVAL.node = yyDollar[1].node } case 6: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:321 +// line internal/php5/php5.y:325 { // error yyVAL.node = nil } case 7: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:326 +// line internal/php5/php5.y:330 { yyVAL.node = yyDollar[1].node } case 8: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:330 +// line internal/php5/php5.y:334 { yyVAL.node = yyDollar[1].node } case 9: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:334 +// line internal/php5/php5.y:338 { yyVAL.node = yyDollar[1].node } case 10: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:338 +// line internal/php5/php5.y:342 { yyVAL.node = &ast.StmtHaltCompiler{ Node: ast.Node{ @@ -2408,7 +2412,7 @@ yydefault: } case 11: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:350 +// line internal/php5/php5.y:354 { yyVAL.node = &ast.StmtNamespace{ Node: ast.Node{ @@ -2417,16 +2421,17 @@ yydefault: NsTkn: yyDollar[1].token, Name: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition(yyDollar[2].list), + Position: position.NewNodeListPosition(yyDollar[2].node.(*ast.ParserSeparatedList).Items), }, - Parts: yyDollar[2].list, + Parts: yyDollar[2].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[2].node.(*ast.ParserSeparatedList).SeparatorTkns, }, SemiColonTkn: yyDollar[3].token, } } case 12: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:366 +// line internal/php5/php5.y:371 { yyVAL.node = &ast.StmtNamespace{ Node: ast.Node{ @@ -2435,9 +2440,10 @@ yydefault: NsTkn: yyDollar[1].token, Name: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition(yyDollar[2].list), + Position: position.NewNodeListPosition(yyDollar[2].node.(*ast.ParserSeparatedList).Items), }, - Parts: yyDollar[2].list, + Parts: yyDollar[2].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[2].node.(*ast.ParserSeparatedList).SeparatorTkns, }, OpenCurlyBracket: yyDollar[3].token, Stmts: yyDollar[4].list, @@ -2446,7 +2452,7 @@ yydefault: } case 13: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:384 +// line internal/php5/php5.y:390 { yyVAL.node = &ast.StmtNamespace{ Node: ast.Node{ @@ -2460,20 +2466,21 @@ yydefault: } case 14: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:396 +// line internal/php5/php5.y:402 { yyVAL.node = &ast.StmtUse{ Node: ast.Node{ Position: position.NewTokensPosition(yyDollar[1].token, yyDollar[3].token), }, UseTkn: yyDollar[1].token, - UseDeclarations: yyDollar[2].list, + UseDeclarations: yyDollar[2].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[2].node.(*ast.ParserSeparatedList).SeparatorTkns, SemiColonTkn: yyDollar[3].token, } } case 15: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:407 +// line internal/php5/php5.y:414 { yyVAL.node = &ast.StmtUse{ Node: ast.Node{ @@ -2487,13 +2494,14 @@ yydefault: IdentifierTkn: yyDollar[2].token, Value: yyDollar[2].token.Value, }, - UseDeclarations: yyDollar[3].list, + UseDeclarations: yyDollar[3].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[3].node.(*ast.ParserSeparatedList).SeparatorTkns, SemiColonTkn: yyDollar[4].token, } } case 16: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:425 +// line internal/php5/php5.y:433 { yyVAL.node = &ast.StmtUse{ Node: ast.Node{ @@ -2507,13 +2515,14 @@ yydefault: IdentifierTkn: yyDollar[2].token, Value: yyDollar[2].token.Value, }, - UseDeclarations: yyDollar[3].list, + UseDeclarations: yyDollar[3].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[3].node.(*ast.ParserSeparatedList).SeparatorTkns, SemiColonTkn: yyDollar[4].token, } } case 17: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:443 +// line internal/php5/php5.y:452 { yyDollar[1].node.(*ast.StmtConstList).SemiColonTkn = yyDollar[2].token yyDollar[1].node.(*ast.StmtConstList).Node.Position = position.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token) @@ -2521,47 +2530,52 @@ yydefault: } case 18: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:452 +// line internal/php5/php5.y:461 { - yyDollar[1].list[len(yyDollar[1].list)-1].(*ast.StmtUseDeclaration).CommaTkn = yyDollar[2].token + yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns = append(yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns, yyDollar[2].token) + yyDollar[1].node.(*ast.ParserSeparatedList).Items = append(yyDollar[1].node.(*ast.ParserSeparatedList).Items, yyDollar[3].node) - yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) + yyVAL.node = yyDollar[1].node } case 19: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:458 +// line internal/php5/php5.y:468 { - yyVAL.list = []ast.Vertex{yyDollar[1].node} + yyVAL.node = &ast.ParserSeparatedList{ + Items: []ast.Vertex{yyDollar[1].node}, + } } case 20: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:465 +// line internal/php5/php5.y:477 { yyVAL.node = &ast.StmtUseDeclaration{ Node: ast.Node{ - Position: position.NewNodeListPosition(yyDollar[1].list), + Position: position.NewNodeListPosition(yyDollar[1].node.(*ast.ParserSeparatedList).Items), }, Use: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition(yyDollar[1].list), + Position: position.NewNodeListPosition(yyDollar[1].node.(*ast.ParserSeparatedList).Items), }, - Parts: yyDollar[1].list, + Parts: yyDollar[1].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns, }, } } case 21: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:479 +// line internal/php5/php5.y:492 { yyVAL.node = &ast.StmtUseDeclaration{ Node: ast.Node{ - Position: position.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token), + Position: position.NewNodeListTokenPosition(yyDollar[1].node.(*ast.ParserSeparatedList).Items, yyDollar[3].token), }, Use: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition(yyDollar[1].list), + Position: position.NewNodeListPosition(yyDollar[1].node.(*ast.ParserSeparatedList).Items), }, - Parts: yyDollar[1].list, + Parts: yyDollar[1].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns, }, AsTkn: yyDollar[2].token, Alias: &ast.Identifier{ @@ -2575,24 +2589,25 @@ yydefault: } case 22: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:501 +// line internal/php5/php5.y:515 { yyVAL.node = &ast.StmtUseDeclaration{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list), + Position: position.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].node.(*ast.ParserSeparatedList).Items), }, NsSeparatorTkn: yyDollar[1].token, Use: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition(yyDollar[2].list), + Position: position.NewNodeListPosition(yyDollar[2].node.(*ast.ParserSeparatedList).Items), }, - Parts: yyDollar[2].list, + Parts: yyDollar[2].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[2].node.(*ast.ParserSeparatedList).SeparatorTkns, }, } } case 23: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:516 +// line internal/php5/php5.y:531 { yyVAL.node = &ast.StmtUseDeclaration{ Node: ast.Node{ @@ -2601,9 +2616,10 @@ yydefault: NsSeparatorTkn: yyDollar[1].token, Use: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition(yyDollar[2].list), + Position: position.NewNodeListPosition(yyDollar[2].node.(*ast.ParserSeparatedList).Items), }, - Parts: yyDollar[2].list, + Parts: yyDollar[2].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[2].node.(*ast.ParserSeparatedList).SeparatorTkns, }, AsTkn: yyDollar[3].token, Alias: &ast.Identifier{ @@ -2617,47 +2633,52 @@ yydefault: } case 24: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:542 +// line internal/php5/php5.y:558 { - yyDollar[1].list[len(yyDollar[1].list)-1].(*ast.StmtUseDeclaration).CommaTkn = yyDollar[2].token + yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns = append(yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns, yyDollar[2].token) + yyDollar[1].node.(*ast.ParserSeparatedList).Items = append(yyDollar[1].node.(*ast.ParserSeparatedList).Items, yyDollar[3].node) - yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) + yyVAL.node = yyDollar[1].node } case 25: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:548 +// line internal/php5/php5.y:565 { - yyVAL.list = []ast.Vertex{yyDollar[1].node} + yyVAL.node = &ast.ParserSeparatedList{ + Items: []ast.Vertex{yyDollar[1].node}, + } } case 26: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:555 +// line internal/php5/php5.y:574 { yyVAL.node = &ast.StmtUseDeclaration{ Node: ast.Node{ - Position: position.NewNodeListPosition(yyDollar[1].list), + Position: position.NewNodeListPosition(yyDollar[1].node.(*ast.ParserSeparatedList).Items), }, Use: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition(yyDollar[1].list), + Position: position.NewNodeListPosition(yyDollar[1].node.(*ast.ParserSeparatedList).Items), }, - Parts: yyDollar[1].list, + Parts: yyDollar[1].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns, }, } } case 27: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:569 +// line internal/php5/php5.y:589 { yyVAL.node = &ast.StmtUseDeclaration{ Node: ast.Node{ - Position: position.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token), + Position: position.NewNodeListTokenPosition(yyDollar[1].node.(*ast.ParserSeparatedList).Items, yyDollar[3].token), }, Use: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition(yyDollar[1].list), + Position: position.NewNodeListPosition(yyDollar[1].node.(*ast.ParserSeparatedList).Items), }, - Parts: yyDollar[1].list, + Parts: yyDollar[1].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns, }, AsTkn: yyDollar[2].token, Alias: &ast.Identifier{ @@ -2671,24 +2692,25 @@ yydefault: } case 28: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:591 +// line internal/php5/php5.y:612 { yyVAL.node = &ast.StmtUseDeclaration{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list), + Position: position.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].node.(*ast.ParserSeparatedList).Items), }, NsSeparatorTkn: yyDollar[1].token, Use: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition(yyDollar[2].list), + Position: position.NewNodeListPosition(yyDollar[2].node.(*ast.ParserSeparatedList).Items), }, - Parts: yyDollar[2].list, + Parts: yyDollar[2].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[2].node.(*ast.ParserSeparatedList).SeparatorTkns, }, } } case 29: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:606 +// line internal/php5/php5.y:628 { yyVAL.node = &ast.StmtUseDeclaration{ Node: ast.Node{ @@ -2697,9 +2719,10 @@ yydefault: NsSeparatorTkn: yyDollar[1].token, Use: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition(yyDollar[2].list), + Position: position.NewNodeListPosition(yyDollar[2].node.(*ast.ParserSeparatedList).Items), }, - Parts: yyDollar[2].list, + Parts: yyDollar[2].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[2].node.(*ast.ParserSeparatedList).SeparatorTkns, }, AsTkn: yyDollar[3].token, Alias: &ast.Identifier{ @@ -2713,47 +2736,52 @@ yydefault: } case 30: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:632 +// line internal/php5/php5.y:655 { - yyDollar[1].list[len(yyDollar[1].list)-1].(*ast.StmtUseDeclaration).CommaTkn = yyDollar[2].token + yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns = append(yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns, yyDollar[2].token) + yyDollar[1].node.(*ast.ParserSeparatedList).Items = append(yyDollar[1].node.(*ast.ParserSeparatedList).Items, yyDollar[3].node) - yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) + yyVAL.node = yyDollar[1].node } case 31: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:638 +// line internal/php5/php5.y:662 { - yyVAL.list = []ast.Vertex{yyDollar[1].node} + yyVAL.node = &ast.ParserSeparatedList{ + Items: []ast.Vertex{yyDollar[1].node}, + } } case 32: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:645 +// line internal/php5/php5.y:671 { yyVAL.node = &ast.StmtUseDeclaration{ Node: ast.Node{ - Position: position.NewNodeListPosition(yyDollar[1].list), + Position: position.NewNodeListPosition(yyDollar[1].node.(*ast.ParserSeparatedList).Items), }, Use: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition(yyDollar[1].list), + Position: position.NewNodeListPosition(yyDollar[1].node.(*ast.ParserSeparatedList).Items), }, - Parts: yyDollar[1].list, + Parts: yyDollar[1].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns, }, } } case 33: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:659 +// line internal/php5/php5.y:686 { yyVAL.node = &ast.StmtUseDeclaration{ Node: ast.Node{ - Position: position.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token), + Position: position.NewNodeListTokenPosition(yyDollar[1].node.(*ast.ParserSeparatedList).Items, yyDollar[3].token), }, Use: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition(yyDollar[1].list), + Position: position.NewNodeListPosition(yyDollar[1].node.(*ast.ParserSeparatedList).Items), }, - Parts: yyDollar[1].list, + Parts: yyDollar[1].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns, }, AsTkn: yyDollar[2].token, Alias: &ast.Identifier{ @@ -2767,24 +2795,25 @@ yydefault: } case 34: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:681 +// line internal/php5/php5.y:709 { yyVAL.node = &ast.StmtUseDeclaration{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list), + Position: position.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].node.(*ast.ParserSeparatedList).Items), }, NsSeparatorTkn: yyDollar[1].token, Use: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition(yyDollar[2].list), + Position: position.NewNodeListPosition(yyDollar[2].node.(*ast.ParserSeparatedList).Items), }, - Parts: yyDollar[2].list, + Parts: yyDollar[2].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[2].node.(*ast.ParserSeparatedList).SeparatorTkns, }, } } case 35: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:696 +// line internal/php5/php5.y:725 { yyVAL.node = &ast.StmtUseDeclaration{ Node: ast.Node{ @@ -2793,9 +2822,10 @@ yydefault: NsSeparatorTkn: yyDollar[1].token, Use: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition(yyDollar[2].list), + Position: position.NewNodeListPosition(yyDollar[2].node.(*ast.ParserSeparatedList).Items), }, - Parts: yyDollar[2].list, + Parts: yyDollar[2].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[2].node.(*ast.ParserSeparatedList).SeparatorTkns, }, AsTkn: yyDollar[3].token, Alias: &ast.Identifier{ @@ -2809,7 +2839,7 @@ yydefault: } case 36: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:722 +// line internal/php5/php5.y:752 { constList := yyDollar[1].node.(*ast.StmtConstList) constList.Node.Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[5].node) @@ -2833,7 +2863,7 @@ yydefault: } case 37: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:744 +// line internal/php5/php5.y:774 { yyVAL.node = &ast.StmtConstList{ Node: ast.Node{ @@ -2860,7 +2890,7 @@ yydefault: } case 38: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:772 +// line internal/php5/php5.y:802 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -2868,38 +2898,38 @@ yydefault: } case 39: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:778 +// line internal/php5/php5.y:808 { yyVAL.list = []ast.Vertex{} } case 40: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:786 +// line internal/php5/php5.y:816 { // error yyVAL.node = nil } case 41: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:791 +// line internal/php5/php5.y:821 { yyVAL.node = yyDollar[1].node } case 42: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:795 +// line internal/php5/php5.y:825 { yyVAL.node = yyDollar[1].node } case 43: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:799 +// line internal/php5/php5.y:829 { yyVAL.node = yyDollar[1].node } case 44: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:803 +// line internal/php5/php5.y:833 { yyVAL.node = &ast.StmtHaltCompiler{ Node: ast.Node{ @@ -2913,13 +2943,13 @@ yydefault: } case 45: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:819 +// line internal/php5/php5.y:849 { yyVAL.node = yyDollar[1].node } case 46: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:823 +// line internal/php5/php5.y:853 { yyVAL.node = &ast.StmtLabel{ Node: ast.Node{ @@ -2937,7 +2967,7 @@ yydefault: } case 47: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:842 +// line internal/php5/php5.y:872 { yyVAL.node = &ast.StmtStmtList{ Node: ast.Node{ @@ -2950,7 +2980,7 @@ yydefault: } case 48: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:853 +// line internal/php5/php5.y:883 { pos := position.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node) if yyDollar[5].node != nil { @@ -2974,7 +3004,7 @@ yydefault: } case 49: yyDollar = yyS[yypt-8 : yypt+1] - // line internal/php5/php5.y:875 +// line internal/php5/php5.y:905 { yyVAL.node = &ast.StmtIf{ Node: ast.Node{ @@ -3000,7 +3030,7 @@ yydefault: } case 50: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:899 +// line internal/php5/php5.y:929 { yyDollar[3].node.(*ast.StmtWhile).WhileTkn = yyDollar[1].token yyDollar[3].node.(*ast.StmtWhile).OpenParenthesisTkn = yyDollar[2].node.(*ast.ParserBrackets).OpenBracketTkn @@ -3012,7 +3042,7 @@ yydefault: } case 51: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:909 +// line internal/php5/php5.y:939 { yyVAL.node = &ast.StmtDo{ Node: ast.Node{ @@ -3029,7 +3059,7 @@ yydefault: } case 52: yyDollar = yyS[yypt-9 : yypt+1] - // line internal/php5/php5.y:924 +// line internal/php5/php5.y:954 { yyDollar[9].node.(*ast.StmtFor).ForTkn = yyDollar[1].token yyDollar[9].node.(*ast.StmtFor).OpenParenthesisTkn = yyDollar[2].token @@ -3048,7 +3078,7 @@ yydefault: } case 53: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:941 +// line internal/php5/php5.y:971 { yyDollar[3].node.(*ast.StmtSwitch).SwitchTkn = yyDollar[1].token yyDollar[3].node.(*ast.StmtSwitch).OpenParenthesisTkn = yyDollar[2].node.(*ast.ParserBrackets).OpenBracketTkn @@ -3060,7 +3090,7 @@ yydefault: } case 54: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:951 +// line internal/php5/php5.y:981 { yyVAL.node = &ast.StmtBreak{ Node: ast.Node{ @@ -3072,7 +3102,7 @@ yydefault: } case 55: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:961 +// line internal/php5/php5.y:991 { yyVAL.node = &ast.StmtBreak{ Node: ast.Node{ @@ -3085,7 +3115,7 @@ yydefault: } case 56: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:972 +// line internal/php5/php5.y:1002 { yyVAL.node = &ast.StmtContinue{ Node: ast.Node{ @@ -3097,7 +3127,7 @@ yydefault: } case 57: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:982 +// line internal/php5/php5.y:1012 { yyVAL.node = &ast.StmtContinue{ Node: ast.Node{ @@ -3110,7 +3140,7 @@ yydefault: } case 58: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:993 +// line internal/php5/php5.y:1023 { yyVAL.node = &ast.StmtReturn{ Node: ast.Node{ @@ -3122,7 +3152,7 @@ yydefault: } case 59: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1003 +// line internal/php5/php5.y:1033 { yyVAL.node = &ast.StmtReturn{ Node: ast.Node{ @@ -3135,7 +3165,7 @@ yydefault: } case 60: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1014 +// line internal/php5/php5.y:1044 { yyVAL.node = &ast.StmtReturn{ Node: ast.Node{ @@ -3148,7 +3178,7 @@ yydefault: } case 61: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1025 +// line internal/php5/php5.y:1055 { yyVAL.node = &ast.StmtExpression{ Node: ast.Node{ @@ -3160,7 +3190,7 @@ yydefault: } case 62: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1035 +// line internal/php5/php5.y:1065 { yyDollar[2].node.(*ast.StmtGlobal).GlobalTkn = yyDollar[1].token yyDollar[2].node.(*ast.StmtGlobal).SemiColonTkn = yyDollar[3].token @@ -3171,7 +3201,7 @@ yydefault: } case 63: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1044 +// line internal/php5/php5.y:1074 { yyDollar[2].node.(*ast.StmtStatic).StaticTkn = yyDollar[1].token yyDollar[2].node.(*ast.StmtStatic).SemiColonTkn = yyDollar[3].token @@ -3182,7 +3212,7 @@ yydefault: } case 64: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1053 +// line internal/php5/php5.y:1083 { yyDollar[2].node.(*ast.StmtEcho).EchoTkn = yyDollar[1].token yyDollar[2].node.(*ast.StmtEcho).SemiColonTkn = yyDollar[3].token @@ -3192,7 +3222,7 @@ yydefault: } case 65: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1061 +// line internal/php5/php5.y:1091 { yyVAL.node = &ast.StmtInlineHtml{ Node: ast.Node{ @@ -3204,7 +3234,7 @@ yydefault: } case 66: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1071 +// line internal/php5/php5.y:1101 { yyVAL.node = &ast.StmtExpression{ Node: ast.Node{ @@ -3216,7 +3246,7 @@ yydefault: } case 67: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:1081 +// line internal/php5/php5.y:1111 { yyDollar[3].node.(*ast.StmtUnset).UnsetTkn = yyDollar[1].token yyDollar[3].node.(*ast.StmtUnset).OpenParenthesisTkn = yyDollar[2].token @@ -3228,7 +3258,7 @@ yydefault: } case 68: yyDollar = yyS[yypt-8 : yypt+1] - // line internal/php5/php5.y:1091 +// line internal/php5/php5.y:1121 { yyDollar[8].node.(*ast.StmtForeach).ForeachTkn = yyDollar[1].token yyDollar[8].node.(*ast.StmtForeach).OpenParenthesisTkn = yyDollar[2].token @@ -3248,7 +3278,7 @@ yydefault: } case 69: yyDollar = yyS[yypt-8 : yypt+1] - // line internal/php5/php5.y:1109 +// line internal/php5/php5.y:1139 { yyDollar[8].node.(*ast.StmtForeach).ForeachTkn = yyDollar[1].token yyDollar[8].node.(*ast.StmtForeach).OpenParenthesisTkn = yyDollar[2].token @@ -3268,7 +3298,7 @@ yydefault: } case 70: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:1127 +// line internal/php5/php5.y:1157 { yyDollar[5].node.(*ast.StmtDeclare).DeclareTkn = yyDollar[1].token yyDollar[5].node.(*ast.StmtDeclare).OpenParenthesisTkn = yyDollar[2].token @@ -3281,7 +3311,7 @@ yydefault: } case 71: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1138 +// line internal/php5/php5.y:1168 { yyVAL.node = &ast.StmtNop{ Node: ast.Node{ @@ -3292,7 +3322,7 @@ yydefault: } case 72: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php5/php5.y:1147 +// line internal/php5/php5.y:1177 { yyVAL.node = &ast.StmtTry{ TryTkn: yyDollar[1].token, @@ -3311,7 +3341,7 @@ yydefault: } case 73: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1164 +// line internal/php5/php5.y:1194 { yyVAL.node = &ast.StmtThrow{ Node: ast.Node{ @@ -3324,7 +3354,7 @@ yydefault: } case 74: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1175 +// line internal/php5/php5.y:1205 { yyVAL.node = &ast.StmtGoto{ Node: ast.Node{ @@ -3343,13 +3373,13 @@ yydefault: } case 75: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1195 +// line internal/php5/php5.y:1225 { yyVAL.list = []ast.Vertex{} } case 76: yyDollar = yyS[yypt-9 : yypt+1] - // line internal/php5/php5.y:1199 +// line internal/php5/php5.y:1229 { catch := &ast.StmtCatch{ Node: ast.Node{ @@ -3379,13 +3409,13 @@ yydefault: } case 77: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1230 +// line internal/php5/php5.y:1260 { yyVAL.node = nil } case 78: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:1234 +// line internal/php5/php5.y:1264 { yyVAL.node = &ast.StmtFinally{ Node: ast.Node{ @@ -3399,31 +3429,31 @@ yydefault: } case 79: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1249 +// line internal/php5/php5.y:1279 { yyVAL.list = yyDollar[1].list } case 80: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1253 +// line internal/php5/php5.y:1283 { yyVAL.list = []ast.Vertex{} } case 81: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1260 +// line internal/php5/php5.y:1290 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 82: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1264 +// line internal/php5/php5.y:1294 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 83: yyDollar = yyS[yypt-8 : yypt+1] - // line internal/php5/php5.y:1271 +// line internal/php5/php5.y:1301 { yyVAL.node = &ast.StmtCatch{ Node: ast.Node{ @@ -3452,7 +3482,7 @@ yydefault: } case 84: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1301 +// line internal/php5/php5.y:1331 { yyVAL.node = &ast.StmtUnset{ Vars: []ast.Vertex{yyDollar[1].node}, @@ -3460,7 +3490,7 @@ yydefault: } case 85: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1307 +// line internal/php5/php5.y:1337 { yyDollar[1].node.(*ast.StmtUnset).Vars = append(yyDollar[1].node.(*ast.StmtUnset).Vars, yyDollar[3].node) yyDollar[1].node.(*ast.StmtUnset).SeparatorTkns = append(yyDollar[1].node.(*ast.StmtUnset).SeparatorTkns, yyDollar[2].token) @@ -3469,49 +3499,49 @@ yydefault: } case 86: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1317 +// line internal/php5/php5.y:1347 { yyVAL.node = yyDollar[1].node } case 87: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1324 +// line internal/php5/php5.y:1354 { yyVAL.node = yyDollar[1].node } case 88: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1331 +// line internal/php5/php5.y:1361 { yyVAL.node = yyDollar[1].node } case 89: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1338 +// line internal/php5/php5.y:1368 { yyVAL.token = nil } case 90: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1342 +// line internal/php5/php5.y:1372 { yyVAL.token = yyDollar[1].token } case 91: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1349 +// line internal/php5/php5.y:1379 { yyVAL.token = nil } case 92: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1353 +// line internal/php5/php5.y:1383 { yyVAL.token = yyDollar[1].token } case 93: yyDollar = yyS[yypt-9 : yypt+1] - // line internal/php5/php5.y:1360 +// line internal/php5/php5.y:1390 { yyVAL.node = &ast.StmtFunction{ Node: ast.Node{ @@ -3537,7 +3567,7 @@ yydefault: } case 94: yyDollar = yyS[yypt-7 : yypt+1] - // line internal/php5/php5.y:1387 +// line internal/php5/php5.y:1417 { switch n := yyDollar[1].node.(type) { case *ast.StmtClass: @@ -3574,7 +3604,7 @@ yydefault: } case 95: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php5/php5.y:1422 +// line internal/php5/php5.y:1452 { yyVAL.node = &ast.StmtInterface{ Node: ast.Node{ @@ -3596,7 +3626,7 @@ yydefault: } case 96: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1446 +// line internal/php5/php5.y:1476 { yyVAL.node = &ast.StmtClass{ Node: ast.Node{ @@ -3607,7 +3637,7 @@ yydefault: } case 97: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1455 +// line internal/php5/php5.y:1485 { yyVAL.node = &ast.StmtClass{ Node: ast.Node{ @@ -3627,7 +3657,7 @@ yydefault: } case 98: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1473 +// line internal/php5/php5.y:1503 { yyVAL.node = &ast.StmtTrait{ Node: ast.Node{ @@ -3638,7 +3668,7 @@ yydefault: } case 99: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1482 +// line internal/php5/php5.y:1512 { yyVAL.node = &ast.StmtClass{ Node: ast.Node{ @@ -3658,13 +3688,13 @@ yydefault: } case 100: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1503 +// line internal/php5/php5.y:1533 { yyVAL.node = nil } case 101: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1507 +// line internal/php5/php5.y:1537 { yyVAL.node = &ast.StmtClassExtends{ Node: ast.Node{ @@ -3676,19 +3706,19 @@ yydefault: } case 102: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1520 +// line internal/php5/php5.y:1550 { yyVAL.token = yyDollar[1].token } case 103: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1527 +// line internal/php5/php5.y:1557 { yyVAL.node = nil } case 104: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1531 +// line internal/php5/php5.y:1561 { yyVAL.node = &ast.StmtInterfaceExtends{ Node: ast.Node{ @@ -3701,13 +3731,13 @@ yydefault: } case 105: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1545 +// line internal/php5/php5.y:1575 { yyVAL.node = nil } case 106: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1549 +// line internal/php5/php5.y:1579 { yyVAL.node = &ast.StmtClassImplements{ Node: ast.Node{ @@ -3720,7 +3750,7 @@ yydefault: } case 107: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1563 +// line internal/php5/php5.y:1593 { yyVAL.node = &ast.ParserSeparatedList{ Items: []ast.Vertex{yyDollar[1].node}, @@ -3728,7 +3758,7 @@ yydefault: } case 108: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1569 +// line internal/php5/php5.y:1599 { yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns = append(yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns, yyDollar[2].token) yyDollar[1].node.(*ast.ParserSeparatedList).Items = append(yyDollar[1].node.(*ast.ParserSeparatedList).Items, yyDollar[3].node) @@ -3737,13 +3767,13 @@ yydefault: } case 109: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1579 +// line internal/php5/php5.y:1609 { yyVAL.node = nil } case 110: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1583 +// line internal/php5/php5.y:1613 { yyVAL.node = &ast.StmtForeach{ DoubleArrowTkn: yyDollar[1].token, @@ -3752,13 +3782,13 @@ yydefault: } case 111: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1593 +// line internal/php5/php5.y:1623 { yyVAL.node = yyDollar[1].node } case 112: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1597 +// line internal/php5/php5.y:1627 { yyVAL.node = &ast.ExprReference{ Node: ast.Node{ @@ -3770,7 +3800,7 @@ yydefault: } case 113: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:1607 +// line internal/php5/php5.y:1637 { pairList := yyDollar[3].node.(*ast.ParserSeparatedList) fistPair := pairList.Items[0].(*ast.ExprArrayItem) @@ -3792,7 +3822,7 @@ yydefault: } case 114: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1630 +// line internal/php5/php5.y:1660 { yyVAL.node = &ast.StmtFor{ Node: ast.Node{ @@ -3803,7 +3833,7 @@ yydefault: } case 115: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:1639 +// line internal/php5/php5.y:1669 { yyVAL.node = &ast.StmtFor{ Node: ast.Node{ @@ -3823,7 +3853,7 @@ yydefault: } case 116: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1660 +// line internal/php5/php5.y:1690 { yyVAL.node = &ast.StmtForeach{ Node: ast.Node{ @@ -3834,7 +3864,7 @@ yydefault: } case 117: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:1669 +// line internal/php5/php5.y:1699 { yyVAL.node = &ast.StmtForeach{ Node: ast.Node{ @@ -3854,7 +3884,7 @@ yydefault: } case 118: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1691 +// line internal/php5/php5.y:1721 { yyVAL.node = &ast.StmtDeclare{ Node: ast.Node{ @@ -3865,7 +3895,7 @@ yydefault: } case 119: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:1700 +// line internal/php5/php5.y:1730 { yyVAL.node = &ast.StmtDeclare{ Node: ast.Node{ @@ -3885,7 +3915,7 @@ yydefault: } case 120: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1722 +// line internal/php5/php5.y:1752 { yyVAL.node = &ast.ParserSeparatedList{ Items: []ast.Vertex{ @@ -3908,7 +3938,7 @@ yydefault: } case 121: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:1743 +// line internal/php5/php5.y:1773 { yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns = append(yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns, yyDollar[2].token) yyDollar[1].node.(*ast.ParserSeparatedList).Items = append( @@ -3933,7 +3963,7 @@ yydefault: } case 122: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1770 +// line internal/php5/php5.y:1800 { yyVAL.node = &ast.StmtSwitch{ Node: ast.Node{ @@ -3946,7 +3976,7 @@ yydefault: } case 123: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:1781 +// line internal/php5/php5.y:1811 { yyVAL.node = &ast.StmtSwitch{ Node: ast.Node{ @@ -3960,7 +3990,7 @@ yydefault: } case 124: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:1793 +// line internal/php5/php5.y:1823 { yyVAL.node = &ast.StmtSwitch{ Node: ast.Node{ @@ -3975,7 +4005,7 @@ yydefault: } case 125: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:1806 +// line internal/php5/php5.y:1836 { yyVAL.node = &ast.StmtSwitch{ Node: ast.Node{ @@ -3991,13 +4021,13 @@ yydefault: } case 126: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1824 +// line internal/php5/php5.y:1854 { yyVAL.list = nil } case 127: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:1828 +// line internal/php5/php5.y:1858 { yyVAL.list = append(yyDollar[1].list, &ast.StmtCase{ Node: ast.Node{ @@ -4011,7 +4041,7 @@ yydefault: } case 128: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:1840 +// line internal/php5/php5.y:1870 { yyVAL.list = append(yyDollar[1].list, &ast.StmtDefault{ Node: ast.Node{ @@ -4024,19 +4054,19 @@ yydefault: } case 129: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1855 +// line internal/php5/php5.y:1885 { yyVAL.token = yyDollar[1].token } case 130: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1859 +// line internal/php5/php5.y:1889 { yyVAL.token = yyDollar[1].token } case 131: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1867 +// line internal/php5/php5.y:1897 { yyVAL.node = &ast.StmtWhile{ Node: ast.Node{ @@ -4047,7 +4077,7 @@ yydefault: } case 132: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:1876 +// line internal/php5/php5.y:1906 { yyVAL.node = &ast.StmtWhile{ Node: ast.Node{ @@ -4067,13 +4097,13 @@ yydefault: } case 133: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1899 +// line internal/php5/php5.y:1929 { yyVAL.list = nil } case 134: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:1903 +// line internal/php5/php5.y:1933 { yyVAL.list = append(yyDollar[1].list, &ast.StmtElseIf{ Node: ast.Node{ @@ -4088,13 +4118,13 @@ yydefault: } case 135: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1920 +// line internal/php5/php5.y:1950 { yyVAL.list = nil } case 136: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:1924 +// line internal/php5/php5.y:1954 { yyVAL.list = append(yyDollar[1].list, &ast.StmtElseIf{ Node: ast.Node{ @@ -4116,13 +4146,13 @@ yydefault: } case 137: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1948 +// line internal/php5/php5.y:1978 { yyVAL.node = nil } case 138: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:1952 +// line internal/php5/php5.y:1982 { yyVAL.node = &ast.StmtElse{ Node: ast.Node{ @@ -4134,13 +4164,13 @@ yydefault: } case 139: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1966 +// line internal/php5/php5.y:1996 { yyVAL.node = nil } case 140: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:1970 +// line internal/php5/php5.y:2000 { yyVAL.node = &ast.StmtElse{ Node: ast.Node{ @@ -4159,19 +4189,19 @@ yydefault: } case 141: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:1991 +// line internal/php5/php5.y:2021 { yyVAL.node = yyDollar[1].node } case 142: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:1995 +// line internal/php5/php5.y:2025 { yyVAL.node = &ast.ParserSeparatedList{} } case 143: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2002 +// line internal/php5/php5.y:2032 { yyVAL.node = &ast.ParserSeparatedList{ Items: []ast.Vertex{yyDollar[1].node}, @@ -4179,7 +4209,7 @@ yydefault: } case 144: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2008 +// line internal/php5/php5.y:2038 { yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns = append(yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns, yyDollar[2].token) yyDollar[1].node.(*ast.ParserSeparatedList).Items = append(yyDollar[1].node.(*ast.ParserSeparatedList).Items, yyDollar[3].node) @@ -4188,7 +4218,7 @@ yydefault: } case 145: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:2018 +// line internal/php5/php5.y:2048 { pos := position.NewTokenPosition(yyDollar[4].token) if yyDollar[1].node != nil { @@ -4222,7 +4252,7 @@ yydefault: } case 146: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php5/php5.y:2050 +// line internal/php5/php5.y:2080 { pos := position.NewTokenNodePosition(yyDollar[4].token, yyDollar[6].node) if yyDollar[1].node != nil { @@ -4258,13 +4288,13 @@ yydefault: } case 147: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:2088 +// line internal/php5/php5.y:2118 { yyVAL.node = nil } case 148: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2092 +// line internal/php5/php5.y:2122 { yyVAL.node = &ast.Identifier{ Node: ast.Node{ @@ -4276,7 +4306,7 @@ yydefault: } case 149: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2102 +// line internal/php5/php5.y:2132 { yyVAL.node = &ast.Identifier{ Node: ast.Node{ @@ -4288,13 +4318,13 @@ yydefault: } case 150: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2112 +// line internal/php5/php5.y:2142 { yyVAL.node = yyDollar[1].node } case 151: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2120 +// line internal/php5/php5.y:2150 { yyVAL.node = &ast.ArgumentList{ Node: ast.Node{ @@ -4306,7 +4336,7 @@ yydefault: } case 152: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2130 +// line internal/php5/php5.y:2160 { argumentList := yyDollar[2].node.(*ast.ArgumentList) argumentList.Position = position.NewTokensPosition(yyDollar[1].token, yyDollar[3].token) @@ -4317,7 +4347,7 @@ yydefault: } case 153: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2139 +// line internal/php5/php5.y:2169 { yyVAL.node = &ast.ArgumentList{ Node: ast.Node{ @@ -4337,7 +4367,7 @@ yydefault: } case 154: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2161 +// line internal/php5/php5.y:2191 { yyVAL.node = &ast.ArgumentList{ Arguments: []ast.Vertex{yyDollar[1].node}, @@ -4345,7 +4375,7 @@ yydefault: } case 155: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2167 +// line internal/php5/php5.y:2197 { yyDollar[1].node.(*ast.ArgumentList).SeparatorTkns = append(yyDollar[1].node.(*ast.ArgumentList).SeparatorTkns, yyDollar[2].token) yyDollar[1].node.(*ast.ArgumentList).Arguments = append(yyDollar[1].node.(*ast.ArgumentList).Arguments, yyDollar[3].node) @@ -4354,7 +4384,7 @@ yydefault: } case 156: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2177 +// line internal/php5/php5.y:2207 { yyVAL.node = &ast.Argument{ Node: ast.Node{ @@ -4365,7 +4395,7 @@ yydefault: } case 157: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2186 +// line internal/php5/php5.y:2216 { yyVAL.node = &ast.Argument{ Node: ast.Node{ @@ -4376,7 +4406,7 @@ yydefault: } case 158: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2195 +// line internal/php5/php5.y:2225 { yyVAL.node = &ast.Argument{ Node: ast.Node{ @@ -4388,7 +4418,7 @@ yydefault: } case 159: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2205 +// line internal/php5/php5.y:2235 { yyVAL.node = &ast.Argument{ Node: ast.Node{ @@ -4400,7 +4430,7 @@ yydefault: } case 160: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2218 +// line internal/php5/php5.y:2248 { yyDollar[1].node.(*ast.StmtGlobal).Vars = append(yyDollar[1].node.(*ast.StmtGlobal).Vars, yyDollar[3].node) yyDollar[1].node.(*ast.StmtGlobal).SeparatorTkns = append(yyDollar[1].node.(*ast.StmtGlobal).SeparatorTkns, yyDollar[2].token) @@ -4409,7 +4439,7 @@ yydefault: } case 161: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2225 +// line internal/php5/php5.y:2255 { yyVAL.node = &ast.StmtGlobal{ Vars: []ast.Vertex{yyDollar[1].node}, @@ -4417,7 +4447,7 @@ yydefault: } case 162: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2235 +// line internal/php5/php5.y:2265 { yyVAL.node = &ast.ExprVariable{ Node: ast.Node{ @@ -4434,7 +4464,7 @@ yydefault: } case 163: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2250 +// line internal/php5/php5.y:2280 { yyVAL.node = &ast.ExprVariable{ Node: ast.Node{ @@ -4446,7 +4476,7 @@ yydefault: } case 164: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:2260 +// line internal/php5/php5.y:2290 { yyVAL.node = &ast.ExprVariable{ Node: ast.Node{ @@ -4465,7 +4495,7 @@ yydefault: } case 165: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2281 +// line internal/php5/php5.y:2311 { yyDollar[1].node.(*ast.StmtStatic).Vars = append(yyDollar[1].node.(*ast.StmtStatic).Vars, &ast.StmtStaticVar{ Node: ast.Node{ @@ -4490,7 +4520,7 @@ yydefault: } case 166: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:2304 +// line internal/php5/php5.y:2334 { yyDollar[1].node.(*ast.StmtStatic).Vars = append(yyDollar[1].node.(*ast.StmtStatic).Vars, &ast.StmtStaticVar{ Node: ast.Node{ @@ -4517,7 +4547,7 @@ yydefault: } case 167: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2329 +// line internal/php5/php5.y:2359 { yyVAL.node = &ast.StmtStatic{ Vars: []ast.Vertex{ @@ -4543,7 +4573,7 @@ yydefault: } case 168: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2353 +// line internal/php5/php5.y:2383 { yyVAL.node = &ast.StmtStatic{ Vars: []ast.Vertex{ @@ -4571,19 +4601,19 @@ yydefault: } case 169: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2383 +// line internal/php5/php5.y:2413 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 170: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:2387 +// line internal/php5/php5.y:2417 { yyVAL.list = []ast.Vertex{} } case 171: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2395 +// line internal/php5/php5.y:2425 { yyVAL.node = &ast.StmtPropertyList{ Node: ast.Node{ @@ -4597,7 +4627,7 @@ yydefault: } case 172: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2407 +// line internal/php5/php5.y:2437 { yyDollar[1].node.(*ast.StmtClassConstList).SemiColonTkn = yyDollar[2].token yyDollar[1].node.(*ast.StmtClassConstList).Node.Position = position.NewNodeTokenPosition(yyDollar[1].node, yyDollar[2].token) @@ -4605,13 +4635,13 @@ yydefault: } case 173: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2413 +// line internal/php5/php5.y:2443 { yyVAL.node = yyDollar[1].node } case 174: yyDollar = yyS[yypt-8 : yypt+1] - // line internal/php5/php5.y:2417 +// line internal/php5/php5.y:2447 { pos := position.NewTokenNodePosition(yyDollar[2].token, yyDollar[8].node) if yyDollar[1].list != nil { @@ -4641,7 +4671,7 @@ yydefault: } case 175: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2448 +// line internal/php5/php5.y:2478 { yyVAL.node = &ast.StmtTraitUse{ Node: ast.Node{ @@ -4655,7 +4685,7 @@ yydefault: } case 176: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2463 +// line internal/php5/php5.y:2493 { yyVAL.node = &ast.ParserSeparatedList{ Items: []ast.Vertex{yyDollar[1].node}, @@ -4663,7 +4693,7 @@ yydefault: } case 177: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2469 +// line internal/php5/php5.y:2499 { yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns = append(yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns, yyDollar[2].token) yyDollar[1].node.(*ast.ParserSeparatedList).Items = append(yyDollar[1].node.(*ast.ParserSeparatedList).Items, yyDollar[3].node) @@ -4672,7 +4702,7 @@ yydefault: } case 178: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2479 +// line internal/php5/php5.y:2509 { yyVAL.node = &ast.StmtNop{ Node: ast.Node{ @@ -4683,7 +4713,7 @@ yydefault: } case 179: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2488 +// line internal/php5/php5.y:2518 { yyVAL.node = &ast.StmtTraitAdaptationList{ Node: ast.Node{ @@ -4696,31 +4726,31 @@ yydefault: } case 180: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:2502 +// line internal/php5/php5.y:2532 { yyVAL.list = nil } case 181: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2506 +// line internal/php5/php5.y:2536 { yyVAL.list = yyDollar[1].list } case 182: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2513 +// line internal/php5/php5.y:2543 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 183: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2517 +// line internal/php5/php5.y:2547 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 184: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2524 +// line internal/php5/php5.y:2554 { yyDollar[1].node.(*ast.StmtTraitUsePrecedence).SemiColonTkn = yyDollar[2].token @@ -4728,7 +4758,7 @@ yydefault: } case 185: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2530 +// line internal/php5/php5.y:2560 { yyDollar[1].node.(*ast.StmtTraitUseAlias).SemiColonTkn = yyDollar[2].token @@ -4736,7 +4766,7 @@ yydefault: } case 186: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2539 +// line internal/php5/php5.y:2569 { yyVAL.node = &ast.StmtTraitUsePrecedence{ Node: ast.Node{ @@ -4750,7 +4780,7 @@ yydefault: } case 187: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2554 +// line internal/php5/php5.y:2584 { yyVAL.node = &ast.ParserSeparatedList{ Items: []ast.Vertex{yyDollar[1].node}, @@ -4758,7 +4788,7 @@ yydefault: } case 188: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2560 +// line internal/php5/php5.y:2590 { yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns = append(yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns, yyDollar[2].token) yyDollar[1].node.(*ast.ParserSeparatedList).Items = append(yyDollar[1].node.(*ast.ParserSeparatedList).Items, yyDollar[3].node) @@ -4767,7 +4797,7 @@ yydefault: } case 189: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2570 +// line internal/php5/php5.y:2600 { yyVAL.node = &ast.StmtTraitMethodRef{ Node: ast.Node{ @@ -4784,13 +4814,13 @@ yydefault: } case 190: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2585 +// line internal/php5/php5.y:2615 { yyVAL.node = yyDollar[1].node } case 191: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2592 +// line internal/php5/php5.y:2622 { yyVAL.node = &ast.StmtTraitMethodRef{ Node: ast.Node{ @@ -4809,7 +4839,7 @@ yydefault: } case 192: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:2612 +// line internal/php5/php5.y:2642 { yyVAL.node = &ast.StmtTraitUseAlias{ Node: ast.Node{ @@ -4829,7 +4859,7 @@ yydefault: } case 193: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2630 +// line internal/php5/php5.y:2660 { yyVAL.node = &ast.StmtTraitUseAlias{ Node: ast.Node{ @@ -4842,19 +4872,19 @@ yydefault: } case 194: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:2644 +// line internal/php5/php5.y:2674 { yyVAL.node = nil } case 195: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2648 +// line internal/php5/php5.y:2678 { yyVAL.node = yyDollar[1].node } case 196: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2655 +// line internal/php5/php5.y:2685 { yyVAL.node = &ast.StmtNop{ Node: ast.Node{ @@ -4865,7 +4895,7 @@ yydefault: } case 197: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2664 +// line internal/php5/php5.y:2694 { yyVAL.node = &ast.StmtStmtList{ Node: ast.Node{ @@ -4878,13 +4908,13 @@ yydefault: } case 198: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2678 +// line internal/php5/php5.y:2708 { yyVAL.list = yyDollar[1].list } case 199: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2682 +// line internal/php5/php5.y:2712 { yyVAL.list = []ast.Vertex{ &ast.Identifier{ @@ -4898,31 +4928,31 @@ yydefault: } case 200: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:2697 +// line internal/php5/php5.y:2727 { yyVAL.list = nil } case 201: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2701 +// line internal/php5/php5.y:2731 { yyVAL.list = yyDollar[1].list } case 202: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2708 +// line internal/php5/php5.y:2738 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 203: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2712 +// line internal/php5/php5.y:2742 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 204: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2719 +// line internal/php5/php5.y:2749 { yyVAL.node = &ast.Identifier{ Node: ast.Node{ @@ -4934,7 +4964,7 @@ yydefault: } case 205: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2729 +// line internal/php5/php5.y:2759 { yyVAL.node = &ast.Identifier{ Node: ast.Node{ @@ -4946,7 +4976,7 @@ yydefault: } case 206: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2739 +// line internal/php5/php5.y:2769 { yyVAL.node = &ast.Identifier{ Node: ast.Node{ @@ -4958,7 +4988,7 @@ yydefault: } case 207: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2749 +// line internal/php5/php5.y:2779 { yyVAL.node = &ast.Identifier{ Node: ast.Node{ @@ -4970,7 +5000,7 @@ yydefault: } case 208: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2759 +// line internal/php5/php5.y:2789 { yyVAL.node = &ast.Identifier{ Node: ast.Node{ @@ -4982,7 +5012,7 @@ yydefault: } case 209: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2769 +// line internal/php5/php5.y:2799 { yyVAL.node = &ast.Identifier{ Node: ast.Node{ @@ -4994,7 +5024,7 @@ yydefault: } case 210: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2782 +// line internal/php5/php5.y:2812 { item := &ast.StmtProperty{ Node: ast.Node{ @@ -5021,7 +5051,7 @@ yydefault: } case 211: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:2807 +// line internal/php5/php5.y:2837 { item := &ast.StmtProperty{ Node: ast.Node{ @@ -5050,7 +5080,7 @@ yydefault: } case 212: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2834 +// line internal/php5/php5.y:2864 { yyVAL.node = &ast.ParserSeparatedList{ Items: []ast.Vertex{ @@ -5077,7 +5107,7 @@ yydefault: } case 213: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2859 +// line internal/php5/php5.y:2889 { yyVAL.node = &ast.ParserSeparatedList{ Items: []ast.Vertex{ @@ -5105,11 +5135,11 @@ yydefault: } case 214: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:2888 +// line internal/php5/php5.y:2918 { constList := yyDollar[1].node.(*ast.StmtClassConstList) constList.Node.Position = position.NewNodesPosition(yyDollar[1].node, yyDollar[5].node) - lastNode(yyVAL.node.(*ast.StmtClassConstList).Consts).(*ast.StmtConstant).CommaTkn = yyDollar[2].token + constList.SeparatorTkns = append(constList.SeparatorTkns, yyDollar[2].token) constList.Consts = append(constList.Consts, &ast.StmtConstant{ Node: ast.Node{ Position: position.NewTokenNodePosition(yyDollar[3].token, yyDollar[5].node), @@ -5129,7 +5159,7 @@ yydefault: } case 215: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:2910 +// line internal/php5/php5.y:2940 { yyVAL.node = &ast.StmtClassConstList{ Node: ast.Node{ @@ -5156,7 +5186,7 @@ yydefault: } case 216: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2938 +// line internal/php5/php5.y:2968 { yyDollar[1].node.(*ast.StmtEcho).Exprs = append(yyDollar[1].node.(*ast.StmtEcho).Exprs, yyDollar[3].node) yyDollar[1].node.(*ast.StmtEcho).SeparatorTkns = append(yyDollar[1].node.(*ast.StmtEcho).SeparatorTkns, yyDollar[2].token) @@ -5165,7 +5195,7 @@ yydefault: } case 217: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2945 +// line internal/php5/php5.y:2975 { yyVAL.node = &ast.StmtEcho{ Exprs: []ast.Vertex{yyDollar[1].node}, @@ -5173,19 +5203,19 @@ yydefault: } case 218: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:2955 +// line internal/php5/php5.y:2985 { yyVAL.node = &ast.ParserSeparatedList{} } case 219: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2959 +// line internal/php5/php5.y:2989 { yyVAL.node = yyDollar[1].node } case 220: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:2966 +// line internal/php5/php5.y:2996 { yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns = append(yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns, yyDollar[2].token) yyDollar[1].node.(*ast.ParserSeparatedList).Items = append(yyDollar[1].node.(*ast.ParserSeparatedList).Items, yyDollar[3].node) @@ -5194,7 +5224,7 @@ yydefault: } case 221: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2973 +// line internal/php5/php5.y:3003 { yyVAL.node = &ast.ParserSeparatedList{ Items: []ast.Vertex{yyDollar[1].node}, @@ -5202,19 +5232,19 @@ yydefault: } case 222: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:2982 +// line internal/php5/php5.y:3012 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 223: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:2986 +// line internal/php5/php5.y:3016 { yyVAL.list = yyDollar[1].list } case 224: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:2993 +// line internal/php5/php5.y:3023 { fetch := &ast.ExprArrayDimFetch{ Node: ast.Node{ @@ -5230,7 +5260,7 @@ yydefault: } case 225: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3007 +// line internal/php5/php5.y:3037 { fetch := &ast.ExprArrayDimFetch{ Node: ast.Node{ @@ -5246,37 +5276,37 @@ yydefault: } case 226: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3024 +// line internal/php5/php5.y:3054 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 227: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3028 +// line internal/php5/php5.y:3058 { yyVAL.list = yyDollar[1].list } case 228: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3032 +// line internal/php5/php5.y:3062 { yyVAL.list = yyDollar[1].list } case 229: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:3039 +// line internal/php5/php5.y:3069 { yyVAL.list = nil } case 230: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3043 +// line internal/php5/php5.y:3073 { yyVAL.list = yyDollar[1].list } case 231: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3050 +// line internal/php5/php5.y:3080 { if yyDollar[3].node != nil { yyVAL.node = &ast.ExprNew{ @@ -5301,7 +5331,7 @@ yydefault: } case 232: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php5/php5.y:3076 +// line internal/php5/php5.y:3106 { yyVAL.node = &ast.ExprAssign{ Node: ast.Node{ @@ -5323,7 +5353,7 @@ yydefault: } case 233: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3096 +// line internal/php5/php5.y:3126 { yyVAL.node = &ast.ExprAssign{ Node: ast.Node{ @@ -5336,7 +5366,7 @@ yydefault: } case 234: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:3107 +// line internal/php5/php5.y:3137 { yyVAL.node = &ast.ExprAssignReference{ Node: ast.Node{ @@ -5350,7 +5380,7 @@ yydefault: } case 235: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php5/php5.y:3119 +// line internal/php5/php5.y:3149 { var _new *ast.ExprNew if yyDollar[3].token != nil { @@ -5387,7 +5417,7 @@ yydefault: } case 236: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3154 +// line internal/php5/php5.y:3184 { yyVAL.node = &ast.ExprClone{ Node: ast.Node{ @@ -5399,7 +5429,7 @@ yydefault: } case 237: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3164 +// line internal/php5/php5.y:3194 { yyVAL.node = &ast.ExprAssignPlus{ Node: ast.Node{ @@ -5412,7 +5442,7 @@ yydefault: } case 238: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3175 +// line internal/php5/php5.y:3205 { yyVAL.node = &ast.ExprAssignMinus{ Node: ast.Node{ @@ -5425,7 +5455,7 @@ yydefault: } case 239: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3186 +// line internal/php5/php5.y:3216 { yyVAL.node = &ast.ExprAssignMul{ Node: ast.Node{ @@ -5438,7 +5468,7 @@ yydefault: } case 240: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3197 +// line internal/php5/php5.y:3227 { yyVAL.node = &ast.ExprAssignPow{ Node: ast.Node{ @@ -5451,7 +5481,7 @@ yydefault: } case 241: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3208 +// line internal/php5/php5.y:3238 { yyVAL.node = &ast.ExprAssignDiv{ Node: ast.Node{ @@ -5464,7 +5494,7 @@ yydefault: } case 242: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3219 +// line internal/php5/php5.y:3249 { yyVAL.node = &ast.ExprAssignConcat{ Node: ast.Node{ @@ -5477,7 +5507,7 @@ yydefault: } case 243: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3230 +// line internal/php5/php5.y:3260 { yyVAL.node = &ast.ExprAssignMod{ Node: ast.Node{ @@ -5490,7 +5520,7 @@ yydefault: } case 244: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3241 +// line internal/php5/php5.y:3271 { yyVAL.node = &ast.ExprAssignBitwiseAnd{ Node: ast.Node{ @@ -5503,7 +5533,7 @@ yydefault: } case 245: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3252 +// line internal/php5/php5.y:3282 { yyVAL.node = &ast.ExprAssignBitwiseOr{ Node: ast.Node{ @@ -5516,7 +5546,7 @@ yydefault: } case 246: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3263 +// line internal/php5/php5.y:3293 { yyVAL.node = &ast.ExprAssignBitwiseXor{ Node: ast.Node{ @@ -5529,7 +5559,7 @@ yydefault: } case 247: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3274 +// line internal/php5/php5.y:3304 { yyVAL.node = &ast.ExprAssignShiftLeft{ Node: ast.Node{ @@ -5542,7 +5572,7 @@ yydefault: } case 248: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3285 +// line internal/php5/php5.y:3315 { yyVAL.node = &ast.ExprAssignShiftRight{ Node: ast.Node{ @@ -5555,7 +5585,7 @@ yydefault: } case 249: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3296 +// line internal/php5/php5.y:3326 { yyVAL.node = &ast.ExprPostInc{ Node: ast.Node{ @@ -5567,7 +5597,7 @@ yydefault: } case 250: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3306 +// line internal/php5/php5.y:3336 { yyVAL.node = &ast.ExprPreInc{ Node: ast.Node{ @@ -5579,7 +5609,7 @@ yydefault: } case 251: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3316 +// line internal/php5/php5.y:3346 { yyVAL.node = &ast.ExprPostDec{ Node: ast.Node{ @@ -5591,7 +5621,7 @@ yydefault: } case 252: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3326 +// line internal/php5/php5.y:3356 { yyVAL.node = &ast.ExprPreDec{ Node: ast.Node{ @@ -5603,7 +5633,7 @@ yydefault: } case 253: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3336 +// line internal/php5/php5.y:3366 { yyVAL.node = &ast.ExprBinaryBooleanOr{ Node: ast.Node{ @@ -5616,7 +5646,7 @@ yydefault: } case 254: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3347 +// line internal/php5/php5.y:3377 { yyVAL.node = &ast.ExprBinaryBooleanAnd{ Node: ast.Node{ @@ -5629,7 +5659,7 @@ yydefault: } case 255: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3358 +// line internal/php5/php5.y:3388 { yyVAL.node = &ast.ExprBinaryLogicalOr{ Node: ast.Node{ @@ -5642,7 +5672,7 @@ yydefault: } case 256: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3369 +// line internal/php5/php5.y:3399 { yyVAL.node = &ast.ExprBinaryLogicalAnd{ Node: ast.Node{ @@ -5655,7 +5685,7 @@ yydefault: } case 257: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3380 +// line internal/php5/php5.y:3410 { yyVAL.node = &ast.ExprBinaryLogicalXor{ Node: ast.Node{ @@ -5668,7 +5698,7 @@ yydefault: } case 258: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3391 +// line internal/php5/php5.y:3421 { yyVAL.node = &ast.ExprBinaryBitwiseOr{ Node: ast.Node{ @@ -5681,7 +5711,7 @@ yydefault: } case 259: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3402 +// line internal/php5/php5.y:3432 { yyVAL.node = &ast.ExprBinaryBitwiseAnd{ Node: ast.Node{ @@ -5694,7 +5724,7 @@ yydefault: } case 260: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3413 +// line internal/php5/php5.y:3443 { yyVAL.node = &ast.ExprBinaryBitwiseXor{ Node: ast.Node{ @@ -5707,7 +5737,7 @@ yydefault: } case 261: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3424 +// line internal/php5/php5.y:3454 { yyVAL.node = &ast.ExprBinaryConcat{ Node: ast.Node{ @@ -5720,7 +5750,7 @@ yydefault: } case 262: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3435 +// line internal/php5/php5.y:3465 { yyVAL.node = &ast.ExprBinaryPlus{ Node: ast.Node{ @@ -5733,7 +5763,7 @@ yydefault: } case 263: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3446 +// line internal/php5/php5.y:3476 { yyVAL.node = &ast.ExprBinaryMinus{ Node: ast.Node{ @@ -5746,7 +5776,7 @@ yydefault: } case 264: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3457 +// line internal/php5/php5.y:3487 { yyVAL.node = &ast.ExprBinaryMul{ Node: ast.Node{ @@ -5759,7 +5789,7 @@ yydefault: } case 265: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3468 +// line internal/php5/php5.y:3498 { yyVAL.node = &ast.ExprBinaryPow{ Node: ast.Node{ @@ -5772,7 +5802,7 @@ yydefault: } case 266: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3479 +// line internal/php5/php5.y:3509 { yyVAL.node = &ast.ExprBinaryDiv{ Node: ast.Node{ @@ -5785,7 +5815,7 @@ yydefault: } case 267: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3490 +// line internal/php5/php5.y:3520 { yyVAL.node = &ast.ExprBinaryMod{ Node: ast.Node{ @@ -5798,7 +5828,7 @@ yydefault: } case 268: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3501 +// line internal/php5/php5.y:3531 { yyVAL.node = &ast.ExprBinaryShiftLeft{ Node: ast.Node{ @@ -5811,7 +5841,7 @@ yydefault: } case 269: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3512 +// line internal/php5/php5.y:3542 { yyVAL.node = &ast.ExprBinaryShiftRight{ Node: ast.Node{ @@ -5824,7 +5854,7 @@ yydefault: } case 270: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3523 +// line internal/php5/php5.y:3553 { yyVAL.node = &ast.ExprUnaryPlus{ Node: ast.Node{ @@ -5836,7 +5866,7 @@ yydefault: } case 271: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3533 +// line internal/php5/php5.y:3563 { yyVAL.node = &ast.ExprUnaryMinus{ Node: ast.Node{ @@ -5848,7 +5878,7 @@ yydefault: } case 272: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3543 +// line internal/php5/php5.y:3573 { yyVAL.node = &ast.ExprBooleanNot{ Node: ast.Node{ @@ -5860,7 +5890,7 @@ yydefault: } case 273: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3553 +// line internal/php5/php5.y:3583 { yyVAL.node = &ast.ExprBitwiseNot{ Node: ast.Node{ @@ -5872,7 +5902,7 @@ yydefault: } case 274: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3563 +// line internal/php5/php5.y:3593 { yyVAL.node = &ast.ExprBinaryIdentical{ Node: ast.Node{ @@ -5885,7 +5915,7 @@ yydefault: } case 275: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3574 +// line internal/php5/php5.y:3604 { yyVAL.node = &ast.ExprBinaryNotIdentical{ Node: ast.Node{ @@ -5898,7 +5928,7 @@ yydefault: } case 276: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3585 +// line internal/php5/php5.y:3615 { yyVAL.node = &ast.ExprBinaryEqual{ Node: ast.Node{ @@ -5911,7 +5941,7 @@ yydefault: } case 277: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3596 +// line internal/php5/php5.y:3626 { yyVAL.node = &ast.ExprBinaryNotEqual{ Node: ast.Node{ @@ -5924,7 +5954,7 @@ yydefault: } case 278: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3607 +// line internal/php5/php5.y:3637 { yyVAL.node = &ast.ExprBinarySmaller{ Node: ast.Node{ @@ -5937,7 +5967,7 @@ yydefault: } case 279: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3618 +// line internal/php5/php5.y:3648 { yyVAL.node = &ast.ExprBinarySmallerOrEqual{ Node: ast.Node{ @@ -5950,7 +5980,7 @@ yydefault: } case 280: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3629 +// line internal/php5/php5.y:3659 { yyVAL.node = &ast.ExprBinaryGreater{ Node: ast.Node{ @@ -5963,7 +5993,7 @@ yydefault: } case 281: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3640 +// line internal/php5/php5.y:3670 { yyVAL.node = &ast.ExprBinaryGreaterOrEqual{ Node: ast.Node{ @@ -5976,7 +6006,7 @@ yydefault: } case 282: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3651 +// line internal/php5/php5.y:3681 { yyVAL.node = &ast.ExprInstanceOf{ Node: ast.Node{ @@ -5989,19 +6019,19 @@ yydefault: } case 283: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3662 +// line internal/php5/php5.y:3692 { yyVAL.node = yyDollar[1].node } case 284: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3666 +// line internal/php5/php5.y:3696 { yyVAL.node = yyDollar[1].node } case 285: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:3670 +// line internal/php5/php5.y:3700 { yyVAL.node = &ast.ParserBrackets{ Node: ast.Node{ @@ -6038,7 +6068,7 @@ yydefault: } case 286: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:3705 +// line internal/php5/php5.y:3735 { yyVAL.node = &ast.ExprTernary{ Node: ast.Node{ @@ -6053,7 +6083,7 @@ yydefault: } case 287: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:3718 +// line internal/php5/php5.y:3748 { yyVAL.node = &ast.ExprTernary{ Node: ast.Node{ @@ -6067,13 +6097,13 @@ yydefault: } case 288: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3730 +// line internal/php5/php5.y:3760 { yyVAL.node = yyDollar[1].node } case 289: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3734 +// line internal/php5/php5.y:3764 { yyVAL.node = &ast.ExprCastInt{ Node: ast.Node{ @@ -6085,7 +6115,7 @@ yydefault: } case 290: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3744 +// line internal/php5/php5.y:3774 { yyVAL.node = &ast.ExprCastDouble{ Node: ast.Node{ @@ -6097,7 +6127,7 @@ yydefault: } case 291: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3754 +// line internal/php5/php5.y:3784 { yyVAL.node = &ast.ExprCastString{ Node: ast.Node{ @@ -6109,7 +6139,7 @@ yydefault: } case 292: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3764 +// line internal/php5/php5.y:3794 { yyVAL.node = &ast.ExprCastArray{ Node: ast.Node{ @@ -6121,7 +6151,7 @@ yydefault: } case 293: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3774 +// line internal/php5/php5.y:3804 { yyVAL.node = &ast.ExprCastObject{ Node: ast.Node{ @@ -6133,7 +6163,7 @@ yydefault: } case 294: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3784 +// line internal/php5/php5.y:3814 { yyVAL.node = &ast.ExprCastBool{ Node: ast.Node{ @@ -6145,7 +6175,7 @@ yydefault: } case 295: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3794 +// line internal/php5/php5.y:3824 { yyVAL.node = &ast.ExprCastUnset{ Node: ast.Node{ @@ -6157,7 +6187,7 @@ yydefault: } case 296: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3804 +// line internal/php5/php5.y:3834 { exit := &ast.ExprExit{ DieTkn: yyDollar[1].token, @@ -6176,7 +6206,7 @@ yydefault: } case 297: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3821 +// line internal/php5/php5.y:3851 { yyVAL.node = &ast.ExprErrorSuppress{ Node: ast.Node{ @@ -6188,25 +6218,25 @@ yydefault: } case 298: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3831 +// line internal/php5/php5.y:3861 { yyVAL.node = yyDollar[1].node } case 299: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3835 +// line internal/php5/php5.y:3865 { yyVAL.node = yyDollar[1].node } case 300: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3839 +// line internal/php5/php5.y:3869 { yyVAL.node = yyDollar[1].node } case 301: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:3843 +// line internal/php5/php5.y:3873 { yyVAL.node = &ast.ExprShellExec{ Node: ast.Node{ @@ -6219,7 +6249,7 @@ yydefault: } case 302: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3854 +// line internal/php5/php5.y:3884 { yyVAL.node = &ast.ExprPrint{ Node: ast.Node{ @@ -6231,7 +6261,7 @@ yydefault: } case 303: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:3864 +// line internal/php5/php5.y:3894 { yyVAL.node = &ast.ExprYield{ Node: ast.Node{ @@ -6242,7 +6272,7 @@ yydefault: } case 304: yyDollar = yyS[yypt-9 : yypt+1] - // line internal/php5/php5.y:3873 +// line internal/php5/php5.y:3903 { yyVAL.node = &ast.ExprClosure{ Node: ast.Node{ @@ -6254,7 +6284,7 @@ yydefault: Params: yyDollar[4].node.(*ast.ParserSeparatedList).Items, SeparatorTkns: yyDollar[4].node.(*ast.ParserSeparatedList).SeparatorTkns, CloseParenthesisTkn: yyDollar[5].token, - ClosureUse: yyDollar[6].ClosureUse, + ClosureUse: yyDollar[6].node, OpenCurlyBracketTkn: yyDollar[7].token, Stmts: yyDollar[8].list, CloseCurlyBracketTkn: yyDollar[9].token, @@ -6262,7 +6292,7 @@ yydefault: } case 305: yyDollar = yyS[yypt-10 : yypt+1] - // line internal/php5/php5.y:3891 +// line internal/php5/php5.y:3921 { yyVAL.node = &ast.ExprClosure{ Node: ast.Node{ @@ -6275,7 +6305,7 @@ yydefault: Params: yyDollar[5].node.(*ast.ParserSeparatedList).Items, SeparatorTkns: yyDollar[5].node.(*ast.ParserSeparatedList).SeparatorTkns, CloseParenthesisTkn: yyDollar[6].token, - ClosureUse: yyDollar[7].ClosureUse, + ClosureUse: yyDollar[7].node, OpenCurlyBracketTkn: yyDollar[8].token, Stmts: yyDollar[9].list, CloseCurlyBracketTkn: yyDollar[10].token, @@ -6283,7 +6313,7 @@ yydefault: } case 306: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3913 +// line internal/php5/php5.y:3943 { yyVAL.node = &ast.ExprYield{ Node: ast.Node{ @@ -6295,7 +6325,7 @@ yydefault: } case 307: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:3923 +// line internal/php5/php5.y:3953 { yyVAL.node = &ast.ExprYield{ Node: ast.Node{ @@ -6307,7 +6337,7 @@ yydefault: } case 308: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:3933 +// line internal/php5/php5.y:3963 { yyVAL.node = &ast.ExprYield{ Node: ast.Node{ @@ -6321,7 +6351,7 @@ yydefault: } case 309: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:3945 +// line internal/php5/php5.y:3975 { yyVAL.node = &ast.ExprYield{ Node: ast.Node{ @@ -6335,7 +6365,7 @@ yydefault: } case 310: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:3960 +// line internal/php5/php5.y:3990 { yyVAL.node = &ast.ExprArrayDimFetch{ Node: ast.Node{ @@ -6349,7 +6379,7 @@ yydefault: } case 311: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:3972 +// line internal/php5/php5.y:4002 { yyVAL.node = &ast.ExprArrayDimFetch{ Node: ast.Node{ @@ -6363,7 +6393,7 @@ yydefault: } case 312: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:3984 +// line internal/php5/php5.y:4014 { yyVAL.node = &ast.ExprArrayDimFetch{ Node: ast.Node{ @@ -6383,7 +6413,7 @@ yydefault: } case 313: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4002 +// line internal/php5/php5.y:4032 { yyVAL.node = &ast.ExprArrayDimFetch{ Node: ast.Node{ @@ -6397,7 +6427,7 @@ yydefault: } case 314: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4017 +// line internal/php5/php5.y:4047 { yyVAL.node = &ast.ExprArray{ Node: ast.Node{ @@ -6412,7 +6442,7 @@ yydefault: } case 315: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4030 +// line internal/php5/php5.y:4060 { yyVAL.node = &ast.ExprArray{ Node: ast.Node{ @@ -6426,21 +6456,21 @@ yydefault: } case 316: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4045 +// line internal/php5/php5.y:4075 { yyVAL.token = yyDollar[1].token } case 317: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:4052 +// line internal/php5/php5.y:4082 { - yyVAL.ClosureUse = nil + yyVAL.node = nil } case 318: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4056 +// line internal/php5/php5.y:4086 { - yyVAL.ClosureUse = &ast.ExprClosureUse{ + yyVAL.node = &ast.ExprClosureUse{ Node: ast.Node{ Position: position.NewTokensPosition(yyDollar[1].token, yyDollar[4].token), }, @@ -6453,7 +6483,7 @@ yydefault: } case 319: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4072 +// line internal/php5/php5.y:4102 { variable := &ast.ExprVariable{ Node: ast.Node{ @@ -6475,7 +6505,7 @@ yydefault: } case 320: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4092 +// line internal/php5/php5.y:4122 { reference := &ast.ExprReference{ Node: ast.Node{ @@ -6503,7 +6533,7 @@ yydefault: } case 321: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4118 +// line internal/php5/php5.y:4148 { yyVAL.node = &ast.ParserSeparatedList{ Items: []ast.Vertex{ @@ -6524,7 +6554,7 @@ yydefault: } case 322: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4137 +// line internal/php5/php5.y:4167 { yyVAL.node = &ast.ParserSeparatedList{ Items: []ast.Vertex{ @@ -6551,17 +6581,18 @@ yydefault: } case 323: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4165 +// line internal/php5/php5.y:4195 { yyVAL.node = &ast.ExprFunctionCall{ Node: ast.Node{ - Position: position.NewNodeListNodePosition(yyDollar[1].list, yyDollar[2].node), + Position: position.NewNodeListNodePosition(yyDollar[1].node.(*ast.ParserSeparatedList).Items, yyDollar[2].node), }, Function: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition(yyDollar[1].list), + Position: position.NewNodeListPosition(yyDollar[1].node.(*ast.ParserSeparatedList).Items), }, - Parts: yyDollar[1].list, + Parts: yyDollar[1].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns, }, OpenParenthesisTkn: yyDollar[2].node.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: yyDollar[2].node.(*ast.ArgumentList).Arguments, @@ -6571,7 +6602,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4183 +// line internal/php5/php5.y:4214 { yyVAL.node = &ast.ExprFunctionCall{ Node: ast.Node{ @@ -6579,11 +6610,12 @@ yydefault: }, Function: &ast.NameRelative{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list), + Position: position.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].node.(*ast.ParserSeparatedList).Items), }, NsTkn: yyDollar[1].token, NsSeparatorTkn: yyDollar[2].token, - Parts: yyDollar[3].list, + Parts: yyDollar[3].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[3].node.(*ast.ParserSeparatedList).SeparatorTkns, }, OpenParenthesisTkn: yyDollar[4].node.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: yyDollar[4].node.(*ast.ArgumentList).Arguments, @@ -6593,7 +6625,7 @@ yydefault: } case 325: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4203 +// line internal/php5/php5.y:4235 { yyVAL.node = &ast.ExprFunctionCall{ Node: ast.Node{ @@ -6601,10 +6633,11 @@ yydefault: }, Function: &ast.NameFullyQualified{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list), + Position: position.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].node.(*ast.ParserSeparatedList).Items), }, NsSeparatorTkn: yyDollar[1].token, - Parts: yyDollar[2].list, + Parts: yyDollar[2].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[2].node.(*ast.ParserSeparatedList).SeparatorTkns, }, OpenParenthesisTkn: yyDollar[3].node.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: yyDollar[3].node.(*ast.ArgumentList).Arguments, @@ -6614,7 +6647,7 @@ yydefault: } case 326: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4222 +// line internal/php5/php5.y:4255 { yyVAL.node = &ast.ExprStaticCall{ Node: ast.Node{ @@ -6631,7 +6664,7 @@ yydefault: } case 327: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4237 +// line internal/php5/php5.y:4270 { yyVAL.node = &ast.ExprStaticCall{ Node: ast.Node{ @@ -6648,7 +6681,7 @@ yydefault: } case 328: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4252 +// line internal/php5/php5.y:4285 { yyVAL.node = &ast.ExprStaticCall{ Node: ast.Node{ @@ -6665,7 +6698,7 @@ yydefault: } case 329: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4267 +// line internal/php5/php5.y:4300 { yyVAL.node = &ast.ExprStaticCall{ Node: ast.Node{ @@ -6682,7 +6715,7 @@ yydefault: } case 330: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4282 +// line internal/php5/php5.y:4315 { yyVAL.node = &ast.ExprFunctionCall{ Node: ast.Node{ @@ -6697,7 +6730,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4298 +// line internal/php5/php5.y:4331 { yyVAL.node = &ast.Identifier{ Node: ast.Node{ @@ -6709,91 +6742,97 @@ yydefault: } case 332: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4308 +// line internal/php5/php5.y:4341 { yyVAL.node = &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition(yyDollar[1].list), + Position: position.NewNodeListPosition(yyDollar[1].node.(*ast.ParserSeparatedList).Items), }, - Parts: yyDollar[1].list, + Parts: yyDollar[1].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns, } } case 333: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4317 +// line internal/php5/php5.y:4351 { yyVAL.node = &ast.NameRelative{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list), + Position: position.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].node.(*ast.ParserSeparatedList).Items), }, NsTkn: yyDollar[1].token, NsSeparatorTkn: yyDollar[2].token, - Parts: yyDollar[3].list, + Parts: yyDollar[3].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[3].node.(*ast.ParserSeparatedList).SeparatorTkns, } } case 334: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4328 +// line internal/php5/php5.y:4363 { yyVAL.node = &ast.NameFullyQualified{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list), + Position: position.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].node.(*ast.ParserSeparatedList).Items), }, NsSeparatorTkn: yyDollar[1].token, - Parts: yyDollar[2].list, + Parts: yyDollar[2].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[2].node.(*ast.ParserSeparatedList).SeparatorTkns, } } case 335: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4341 +// line internal/php5/php5.y:4377 { yyVAL.node = &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition(yyDollar[1].list), + Position: position.NewNodeListPosition(yyDollar[1].node.(*ast.ParserSeparatedList).Items), }, - Parts: yyDollar[1].list, + Parts: yyDollar[1].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns, } } case 336: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4350 +// line internal/php5/php5.y:4387 { yyVAL.node = &ast.NameRelative{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list), + Position: position.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].node.(*ast.ParserSeparatedList).Items), }, NsTkn: yyDollar[1].token, NsSeparatorTkn: yyDollar[2].token, - Parts: yyDollar[3].list, + Parts: yyDollar[3].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[3].node.(*ast.ParserSeparatedList).SeparatorTkns, } } case 337: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4361 +// line internal/php5/php5.y:4399 { yyVAL.node = &ast.NameFullyQualified{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list), + Position: position.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].node.(*ast.ParserSeparatedList).Items), }, NsSeparatorTkn: yyDollar[1].token, - Parts: yyDollar[2].list, + Parts: yyDollar[2].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[2].node.(*ast.ParserSeparatedList).SeparatorTkns, } } case 338: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4374 +// line internal/php5/php5.y:4413 { yyVAL.node = yyDollar[1].node } case 339: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4378 +// line internal/php5/php5.y:4417 { yyVAL.node = yyDollar[1].node } case 340: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4385 +// line internal/php5/php5.y:4424 { yyVAL.node = yyDollar[1].node @@ -6829,25 +6868,25 @@ yydefault: } case 341: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4419 +// line internal/php5/php5.y:4458 { yyVAL.node = yyDollar[1].node } case 342: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4427 +// line internal/php5/php5.y:4466 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 343: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:4431 +// line internal/php5/php5.y:4470 { yyVAL.list = []ast.Vertex{} } case 344: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4439 +// line internal/php5/php5.y:4478 { yyDollar[2].list[0].(*ast.ExprPropertyFetch).ObjectOperatorTkn = yyDollar[1].token @@ -6855,13 +6894,13 @@ yydefault: } case 345: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:4448 +// line internal/php5/php5.y:4487 { yyVAL.node = nil } case 346: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4452 +// line internal/php5/php5.y:4491 { yyVAL.node = &ast.ParserBrackets{ Node: ast.Node{ @@ -6873,19 +6912,19 @@ yydefault: } case 347: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4462 +// line internal/php5/php5.y:4501 { yyVAL.node = yyDollar[1].node } case 348: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:4469 +// line internal/php5/php5.y:4508 { yyVAL.list = []ast.Vertex{} } case 349: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4473 +// line internal/php5/php5.y:4512 { yyVAL.list = []ast.Vertex{ &ast.ScalarEncapsedStringPart{ @@ -6899,25 +6938,25 @@ yydefault: } case 350: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4485 +// line internal/php5/php5.y:4524 { yyVAL.list = yyDollar[1].list } case 351: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:4492 +// line internal/php5/php5.y:4531 { yyVAL.node = nil } case 352: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4496 +// line internal/php5/php5.y:4535 { yyVAL.node = yyDollar[1].node } case 353: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4503 +// line internal/php5/php5.y:4542 { yyVAL.node = &ast.ScalarLnumber{ Node: ast.Node{ @@ -6929,7 +6968,7 @@ yydefault: } case 354: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4513 +// line internal/php5/php5.y:4552 { yyVAL.node = &ast.ScalarDnumber{ Node: ast.Node{ @@ -6941,7 +6980,7 @@ yydefault: } case 355: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4523 +// line internal/php5/php5.y:4562 { yyVAL.node = &ast.ScalarString{ Node: ast.Node{ @@ -6953,7 +6992,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4533 +// line internal/php5/php5.y:4572 { yyVAL.node = &ast.ScalarMagicConstant{ Node: ast.Node{ @@ -6965,7 +7004,7 @@ yydefault: } case 357: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4543 +// line internal/php5/php5.y:4582 { yyVAL.node = &ast.ScalarMagicConstant{ Node: ast.Node{ @@ -6977,7 +7016,7 @@ yydefault: } case 358: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4553 +// line internal/php5/php5.y:4592 { yyVAL.node = &ast.ScalarMagicConstant{ Node: ast.Node{ @@ -6989,7 +7028,7 @@ yydefault: } case 359: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4563 +// line internal/php5/php5.y:4602 { yyVAL.node = &ast.ScalarMagicConstant{ Node: ast.Node{ @@ -7001,7 +7040,7 @@ yydefault: } case 360: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4573 +// line internal/php5/php5.y:4612 { yyVAL.node = &ast.ScalarMagicConstant{ Node: ast.Node{ @@ -7013,7 +7052,7 @@ yydefault: } case 361: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4583 +// line internal/php5/php5.y:4622 { yyVAL.node = &ast.ScalarMagicConstant{ Node: ast.Node{ @@ -7025,7 +7064,7 @@ yydefault: } case 362: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4593 +// line internal/php5/php5.y:4632 { yyVAL.node = &ast.ScalarMagicConstant{ Node: ast.Node{ @@ -7037,7 +7076,7 @@ yydefault: } case 363: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4603 +// line internal/php5/php5.y:4642 { yyVAL.node = &ast.ScalarHeredoc{ Node: ast.Node{ @@ -7058,7 +7097,7 @@ yydefault: } case 364: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4622 +// line internal/php5/php5.y:4661 { yyVAL.node = &ast.ScalarHeredoc{ Node: ast.Node{ @@ -7070,7 +7109,7 @@ yydefault: } case 365: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4635 +// line internal/php5/php5.y:4674 { yyVAL.node = &ast.ExprClassConstFetch{ Node: ast.Node{ @@ -7089,76 +7128,79 @@ yydefault: } case 366: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4655 +// line internal/php5/php5.y:4694 { yyVAL.node = yyDollar[1].node } case 367: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4662 +// line internal/php5/php5.y:4701 { yyVAL.node = yyDollar[1].node } case 368: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4666 +// line internal/php5/php5.y:4705 { yyVAL.node = yyDollar[1].node } case 369: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4670 +// line internal/php5/php5.y:4709 { yyVAL.node = &ast.ExprConstFetch{ Node: ast.Node{ - Position: position.NewNodeListPosition(yyDollar[1].list), + Position: position.NewNodeListPosition(yyDollar[1].node.(*ast.ParserSeparatedList).Items), }, Const: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition(yyDollar[1].list), + Position: position.NewNodeListPosition(yyDollar[1].node.(*ast.ParserSeparatedList).Items), }, - Parts: yyDollar[1].list, + Parts: yyDollar[1].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns, }, } } case 370: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4684 +// line internal/php5/php5.y:4724 { yyVAL.node = &ast.ExprConstFetch{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list), + Position: position.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].node.(*ast.ParserSeparatedList).Items), }, Const: &ast.NameRelative{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list), + Position: position.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].node.(*ast.ParserSeparatedList).Items), }, NsTkn: yyDollar[1].token, NsSeparatorTkn: yyDollar[2].token, - Parts: yyDollar[3].list, + Parts: yyDollar[3].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[3].node.(*ast.ParserSeparatedList).SeparatorTkns, }, } } case 371: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4700 +// line internal/php5/php5.y:4741 { yyVAL.node = &ast.ExprConstFetch{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list), + Position: position.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].node.(*ast.ParserSeparatedList).Items), }, Const: &ast.NameFullyQualified{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list), + Position: position.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].node.(*ast.ParserSeparatedList).Items), }, NsSeparatorTkn: yyDollar[1].token, - Parts: yyDollar[2].list, + Parts: yyDollar[2].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[2].node.(*ast.ParserSeparatedList).SeparatorTkns, }, } } case 372: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4715 +// line internal/php5/php5.y:4757 { yyVAL.node = &ast.ExprArray{ Node: ast.Node{ @@ -7173,7 +7215,7 @@ yydefault: } case 373: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4728 +// line internal/php5/php5.y:4770 { yyVAL.node = &ast.ExprArray{ Node: ast.Node{ @@ -7187,13 +7229,13 @@ yydefault: } case 374: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4740 +// line internal/php5/php5.y:4782 { yyVAL.node = yyDollar[1].node } case 375: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4744 +// line internal/php5/php5.y:4786 { yyVAL.node = &ast.ScalarMagicConstant{ Node: ast.Node{ @@ -7205,13 +7247,13 @@ yydefault: } case 376: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:4754 +// line internal/php5/php5.y:4796 { yyVAL.node = yyDollar[1].node } case 377: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:4761 +// line internal/php5/php5.y:4803 { yyVAL.node = &ast.ExprArrayDimFetch{ Node: ast.Node{ @@ -7225,7 +7267,7 @@ yydefault: } case 378: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4773 +// line internal/php5/php5.y:4815 { yyVAL.node = &ast.ExprBinaryPlus{ Node: ast.Node{ @@ -7238,7 +7280,7 @@ yydefault: } case 379: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4784 +// line internal/php5/php5.y:4826 { yyVAL.node = &ast.ExprBinaryMinus{ Node: ast.Node{ @@ -7251,7 +7293,7 @@ yydefault: } case 380: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4795 +// line internal/php5/php5.y:4837 { yyVAL.node = &ast.ExprBinaryMul{ Node: ast.Node{ @@ -7264,7 +7306,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4806 +// line internal/php5/php5.y:4848 { yyVAL.node = &ast.ExprBinaryPow{ Node: ast.Node{ @@ -7277,7 +7319,7 @@ yydefault: } case 382: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4817 +// line internal/php5/php5.y:4859 { yyVAL.node = &ast.ExprBinaryDiv{ Node: ast.Node{ @@ -7290,7 +7332,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4828 +// line internal/php5/php5.y:4870 { yyVAL.node = &ast.ExprBinaryMod{ Node: ast.Node{ @@ -7303,7 +7345,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4839 +// line internal/php5/php5.y:4881 { yyVAL.node = &ast.ExprBooleanNot{ Node: ast.Node{ @@ -7315,7 +7357,7 @@ yydefault: } case 385: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:4849 +// line internal/php5/php5.y:4891 { yyVAL.node = &ast.ExprBitwiseNot{ Node: ast.Node{ @@ -7327,7 +7369,7 @@ yydefault: } case 386: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4859 +// line internal/php5/php5.y:4901 { yyVAL.node = &ast.ExprBinaryBitwiseOr{ Node: ast.Node{ @@ -7340,7 +7382,7 @@ yydefault: } case 387: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4870 +// line internal/php5/php5.y:4912 { yyVAL.node = &ast.ExprBinaryBitwiseAnd{ Node: ast.Node{ @@ -7353,7 +7395,7 @@ yydefault: } case 388: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4881 +// line internal/php5/php5.y:4923 { yyVAL.node = &ast.ExprBinaryBitwiseXor{ Node: ast.Node{ @@ -7366,7 +7408,7 @@ yydefault: } case 389: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4892 +// line internal/php5/php5.y:4934 { yyVAL.node = &ast.ExprBinaryShiftLeft{ Node: ast.Node{ @@ -7379,7 +7421,7 @@ yydefault: } case 390: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4903 +// line internal/php5/php5.y:4945 { yyVAL.node = &ast.ExprBinaryShiftRight{ Node: ast.Node{ @@ -7392,7 +7434,7 @@ yydefault: } case 391: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4914 +// line internal/php5/php5.y:4956 { yyVAL.node = &ast.ExprBinaryConcat{ Node: ast.Node{ @@ -7405,7 +7447,7 @@ yydefault: } case 392: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4925 +// line internal/php5/php5.y:4967 { yyVAL.node = &ast.ExprBinaryLogicalXor{ Node: ast.Node{ @@ -7418,7 +7460,7 @@ yydefault: } case 393: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4936 +// line internal/php5/php5.y:4978 { yyVAL.node = &ast.ExprBinaryLogicalAnd{ Node: ast.Node{ @@ -7431,7 +7473,7 @@ yydefault: } case 394: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4947 +// line internal/php5/php5.y:4989 { yyVAL.node = &ast.ExprBinaryLogicalOr{ Node: ast.Node{ @@ -7444,7 +7486,7 @@ yydefault: } case 395: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4958 +// line internal/php5/php5.y:5000 { yyVAL.node = &ast.ExprBinaryBooleanAnd{ Node: ast.Node{ @@ -7457,7 +7499,7 @@ yydefault: } case 396: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4969 +// line internal/php5/php5.y:5011 { yyVAL.node = &ast.ExprBinaryBooleanOr{ Node: ast.Node{ @@ -7470,7 +7512,7 @@ yydefault: } case 397: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4980 +// line internal/php5/php5.y:5022 { yyVAL.node = &ast.ExprBinaryIdentical{ Node: ast.Node{ @@ -7483,7 +7525,7 @@ yydefault: } case 398: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:4991 +// line internal/php5/php5.y:5033 { yyVAL.node = &ast.ExprBinaryNotIdentical{ Node: ast.Node{ @@ -7496,7 +7538,7 @@ yydefault: } case 399: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5002 +// line internal/php5/php5.y:5044 { yyVAL.node = &ast.ExprBinaryEqual{ Node: ast.Node{ @@ -7509,7 +7551,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5013 +// line internal/php5/php5.y:5055 { yyVAL.node = &ast.ExprBinaryNotEqual{ Node: ast.Node{ @@ -7522,7 +7564,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5024 +// line internal/php5/php5.y:5066 { yyVAL.node = &ast.ExprBinarySmaller{ Node: ast.Node{ @@ -7535,7 +7577,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5035 +// line internal/php5/php5.y:5077 { yyVAL.node = &ast.ExprBinaryGreater{ Node: ast.Node{ @@ -7548,7 +7590,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5046 +// line internal/php5/php5.y:5088 { yyVAL.node = &ast.ExprBinarySmallerOrEqual{ Node: ast.Node{ @@ -7561,7 +7603,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5057 +// line internal/php5/php5.y:5099 { yyVAL.node = &ast.ExprBinaryGreaterOrEqual{ Node: ast.Node{ @@ -7574,7 +7616,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:5068 +// line internal/php5/php5.y:5110 { yyVAL.node = &ast.ExprTernary{ Node: ast.Node{ @@ -7588,7 +7630,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:5080 +// line internal/php5/php5.y:5122 { yyVAL.node = &ast.ExprTernary{ Node: ast.Node{ @@ -7603,7 +7645,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:5093 +// line internal/php5/php5.y:5135 { yyVAL.node = &ast.ExprUnaryPlus{ Node: ast.Node{ @@ -7615,7 +7657,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:5103 +// line internal/php5/php5.y:5145 { yyVAL.node = &ast.ExprUnaryMinus{ Node: ast.Node{ @@ -7627,7 +7669,7 @@ yydefault: } case 409: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5113 +// line internal/php5/php5.y:5155 { yyVAL.node = &ast.ParserBrackets{ Node: ast.Node{ @@ -7640,64 +7682,67 @@ yydefault: } case 410: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5127 +// line internal/php5/php5.y:5169 { yyVAL.node = yyDollar[1].node } case 411: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5131 +// line internal/php5/php5.y:5173 { yyVAL.node = &ast.ExprConstFetch{ Node: ast.Node{ - Position: position.NewNodeListPosition(yyDollar[1].list), + Position: position.NewNodeListPosition(yyDollar[1].node.(*ast.ParserSeparatedList).Items), }, Const: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition(yyDollar[1].list), + Position: position.NewNodeListPosition(yyDollar[1].node.(*ast.ParserSeparatedList).Items), }, - Parts: yyDollar[1].list, + Parts: yyDollar[1].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns, }, } } case 412: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5145 +// line internal/php5/php5.y:5188 { yyVAL.node = &ast.ExprConstFetch{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list), + Position: position.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].node.(*ast.ParserSeparatedList).Items), }, Const: &ast.NameRelative{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list), + Position: position.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].node.(*ast.ParserSeparatedList).Items), }, NsTkn: yyDollar[1].token, NsSeparatorTkn: yyDollar[2].token, - Parts: yyDollar[3].list, + Parts: yyDollar[3].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[3].node.(*ast.ParserSeparatedList).SeparatorTkns, }, } } case 413: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:5161 +// line internal/php5/php5.y:5205 { yyVAL.node = &ast.ExprConstFetch{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list), + Position: position.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].node.(*ast.ParserSeparatedList).Items), }, Const: &ast.NameFullyQualified{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list), + Position: position.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].node.(*ast.ParserSeparatedList).Items), }, NsSeparatorTkn: yyDollar[1].token, - Parts: yyDollar[2].list, + Parts: yyDollar[2].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[2].node.(*ast.ParserSeparatedList).SeparatorTkns, }, } } case 414: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5179 +// line internal/php5/php5.y:5224 { yyVAL.node = &ast.ExprVariable{ Node: ast.Node{ @@ -7714,25 +7759,25 @@ yydefault: } case 415: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5194 +// line internal/php5/php5.y:5239 { yyVAL.node = yyDollar[1].node } case 416: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5198 +// line internal/php5/php5.y:5243 { yyVAL.node = yyDollar[1].node } case 417: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5202 +// line internal/php5/php5.y:5247 { yyVAL.node = yyDollar[1].node } case 418: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5206 +// line internal/php5/php5.y:5251 { yyVAL.node = &ast.ScalarEncapsed{ Node: ast.Node{ @@ -7745,7 +7790,7 @@ yydefault: } case 419: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5217 +// line internal/php5/php5.y:5262 { yyVAL.node = &ast.ScalarHeredoc{ Node: ast.Node{ @@ -7758,7 +7803,7 @@ yydefault: } case 420: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5228 +// line internal/php5/php5.y:5273 { yyVAL.node = &ast.ScalarMagicConstant{ Node: ast.Node{ @@ -7770,13 +7815,13 @@ yydefault: } case 421: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:5241 +// line internal/php5/php5.y:5286 { yyVAL.node = &ast.ParserSeparatedList{} } case 422: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:5245 +// line internal/php5/php5.y:5290 { if yyDollar[2].token != nil { yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns = append(yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns, yyDollar[2].token) @@ -7787,19 +7832,19 @@ yydefault: } case 423: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:5257 +// line internal/php5/php5.y:5302 { yyVAL.token = nil } case 424: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5261 +// line internal/php5/php5.y:5306 { yyVAL.token = yyDollar[1].token } case 425: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:5268 +// line internal/php5/php5.y:5313 { arrayItem := &ast.ExprArrayItem{ Node: ast.Node{ @@ -7817,7 +7862,7 @@ yydefault: } case 426: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5284 +// line internal/php5/php5.y:5329 { arrayItem := &ast.ExprArrayItem{ Node: ast.Node{ @@ -7833,7 +7878,7 @@ yydefault: } case 427: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5298 +// line internal/php5/php5.y:5343 { yyVAL.node = &ast.ParserSeparatedList{ Items: []ast.Vertex{ @@ -7850,7 +7895,7 @@ yydefault: } case 428: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5313 +// line internal/php5/php5.y:5358 { yyVAL.node = &ast.ParserSeparatedList{ Items: []ast.Vertex{ @@ -7865,19 +7910,19 @@ yydefault: } case 429: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5329 +// line internal/php5/php5.y:5374 { yyVAL.node = yyDollar[1].node } case 430: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5333 +// line internal/php5/php5.y:5378 { yyVAL.node = yyDollar[1].node } case 431: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5340 +// line internal/php5/php5.y:5385 { yyVAL.node = &ast.ParserBrackets{ Node: ast.Node{ @@ -7890,7 +7935,7 @@ yydefault: } case 432: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5351 +// line internal/php5/php5.y:5396 { yyVAL.node = &ast.ParserBrackets{ Node: ast.Node{ @@ -7903,25 +7948,25 @@ yydefault: } case 433: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5366 +// line internal/php5/php5.y:5411 { yyVAL.node = yyDollar[1].node } case 434: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5374 +// line internal/php5/php5.y:5419 { yyVAL.node = yyDollar[1].node } case 435: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5381 +// line internal/php5/php5.y:5426 { yyVAL.node = yyDollar[1].node } case 436: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:5388 +// line internal/php5/php5.y:5433 { yyVAL.node = yyDollar[1].node @@ -8000,25 +8045,25 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5465 +// line internal/php5/php5.y:5510 { yyVAL.node = yyDollar[1].node } case 438: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:5472 +// line internal/php5/php5.y:5517 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].list...) } case 439: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:5476 +// line internal/php5/php5.y:5521 { yyVAL.list = []ast.Vertex{} } case 440: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5484 +// line internal/php5/php5.y:5529 { println("FOOFOOFOOFOOFOOFOOFOOFOOFOO") yyDollar[2].list[0].(*ast.ExprPropertyFetch).ObjectOperatorTkn = yyDollar[1].token @@ -8050,7 +8095,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:5516 +// line internal/php5/php5.y:5561 { fetch := &ast.ExprArrayDimFetch{ Node: ast.Node{ @@ -8066,7 +8111,7 @@ yydefault: } case 442: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:5530 +// line internal/php5/php5.y:5575 { fetch := &ast.ExprArrayDimFetch{ Node: ast.Node{ @@ -8082,7 +8127,7 @@ yydefault: } case 443: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5547 +// line internal/php5/php5.y:5592 { yyVAL.node = &ast.ExprMethodCall{ Node: ast.Node{ @@ -8096,31 +8141,31 @@ yydefault: } case 444: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5562 +// line internal/php5/php5.y:5607 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 445: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5566 +// line internal/php5/php5.y:5611 { yyVAL.list = yyDollar[1].list } case 446: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:5570 +// line internal/php5/php5.y:5615 { yyVAL.list = nil } case 447: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5577 +// line internal/php5/php5.y:5622 { yyVAL.node = yyDollar[1].node } case 448: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:5581 +// line internal/php5/php5.y:5626 { for i := len(yyDollar[1].list) - 1; i >= 0; i-- { yyDollar[1].list[i].(*ast.ExprVariable).VarName = yyDollar[2].node @@ -8132,7 +8177,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5594 +// line internal/php5/php5.y:5639 { yyVAL.node = &ast.ExprStaticPropertyFetch{ Node: ast.Node{ @@ -8145,7 +8190,7 @@ yydefault: } case 450: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5605 +// line internal/php5/php5.y:5650 { yyVAL.node = &ast.ExprStaticPropertyFetch{ Node: ast.Node{ @@ -8158,13 +8203,13 @@ yydefault: } case 451: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5619 +// line internal/php5/php5.y:5664 { yyVAL.node = yyDollar[1].node } case 452: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:5626 +// line internal/php5/php5.y:5671 { yyVAL.node = &ast.ExprArrayDimFetch{ Node: ast.Node{ @@ -8178,7 +8223,7 @@ yydefault: } case 453: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:5638 +// line internal/php5/php5.y:5683 { yyVAL.node = &ast.ExprArrayDimFetch{ Node: ast.Node{ @@ -8192,31 +8237,31 @@ yydefault: } case 454: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5653 +// line internal/php5/php5.y:5698 { yyVAL.node = yyDollar[1].node } case 455: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5657 +// line internal/php5/php5.y:5702 { yyVAL.node = yyDollar[1].node } case 456: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5661 +// line internal/php5/php5.y:5706 { yyVAL.node = yyDollar[1].node } case 457: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5669 +// line internal/php5/php5.y:5714 { yyVAL.node = yyDollar[1].node } case 458: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:5673 +// line internal/php5/php5.y:5718 { for i := len(yyDollar[1].list) - 1; i >= 0; i-- { yyDollar[1].list[i].(*ast.ExprVariable).VarName = yyDollar[2].node @@ -8228,13 +8273,13 @@ yydefault: } case 459: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5683 +// line internal/php5/php5.y:5728 { yyVAL.node = yyDollar[1].node } case 460: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:5690 +// line internal/php5/php5.y:5735 { yyVAL.node = &ast.ExprArrayDimFetch{ Node: ast.Node{ @@ -8248,7 +8293,7 @@ yydefault: } case 461: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:5702 +// line internal/php5/php5.y:5747 { yyVAL.node = &ast.ExprArrayDimFetch{ Node: ast.Node{ @@ -8262,13 +8307,13 @@ yydefault: } case 462: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5714 +// line internal/php5/php5.y:5759 { yyVAL.node = yyDollar[1].node } case 463: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5722 +// line internal/php5/php5.y:5767 { yyVAL.node = &ast.ExprVariable{ Node: ast.Node{ @@ -8285,7 +8330,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:5737 +// line internal/php5/php5.y:5782 { yyVAL.node = &ast.ExprVariable{ Node: ast.Node{ @@ -8304,25 +8349,25 @@ yydefault: } case 465: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:5757 +// line internal/php5/php5.y:5802 { yyVAL.node = nil } case 466: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5761 +// line internal/php5/php5.y:5806 { yyVAL.node = yyDollar[1].node } case 467: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5769 +// line internal/php5/php5.y:5814 { yyVAL.list = yyDollar[1].list } case 468: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5773 +// line internal/php5/php5.y:5818 { yyVAL.list = []ast.Vertex{ &ast.ExprPropertyFetch{ @@ -8335,7 +8380,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:5787 +// line internal/php5/php5.y:5832 { fetch := &ast.ExprArrayDimFetch{ Node: ast.Node{ @@ -8351,7 +8396,7 @@ yydefault: } case 470: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:5801 +// line internal/php5/php5.y:5846 { fetch := &ast.ExprArrayDimFetch{ Node: ast.Node{ @@ -8367,7 +8412,7 @@ yydefault: } case 471: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5815 +// line internal/php5/php5.y:5860 { yyVAL.list = []ast.Vertex{ &ast.ExprPropertyFetch{ @@ -8380,7 +8425,7 @@ yydefault: } case 472: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5829 +// line internal/php5/php5.y:5874 { yyVAL.node = &ast.Identifier{ Node: ast.Node{ @@ -8392,7 +8437,7 @@ yydefault: } case 473: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5839 +// line internal/php5/php5.y:5884 { yyVAL.node = &ast.ParserBrackets{ Node: ast.Node{ @@ -8405,7 +8450,7 @@ yydefault: } case 474: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5853 +// line internal/php5/php5.y:5898 { yyVAL.list = []ast.Vertex{ &ast.ExprVariable{ @@ -8418,7 +8463,7 @@ yydefault: } case 475: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:5864 +// line internal/php5/php5.y:5909 { yyVAL.list = append(yyDollar[1].list, &ast.ExprVariable{ Node: ast.Node{ @@ -8429,7 +8474,7 @@ yydefault: } case 476: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5876 +// line internal/php5/php5.y:5921 { yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns = append(yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns, yyDollar[2].token) yyDollar[1].node.(*ast.ParserSeparatedList).Items = append(yyDollar[1].node.(*ast.ParserSeparatedList).Items, yyDollar[3].node) @@ -8438,7 +8483,7 @@ yydefault: } case 477: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5883 +// line internal/php5/php5.y:5928 { yyVAL.node = &ast.ParserSeparatedList{ Items: []ast.Vertex{yyDollar[1].node}, @@ -8446,7 +8491,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5893 +// line internal/php5/php5.y:5938 { yyVAL.node = &ast.ExprArrayItem{ Node: ast.Node{ @@ -8457,7 +8502,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:5902 +// line internal/php5/php5.y:5947 { pairList := yyDollar[3].node.(*ast.ParserSeparatedList) fistPair := pairList.Items[0].(*ast.ExprArrayItem) @@ -8484,19 +8529,19 @@ yydefault: } case 480: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:5927 +// line internal/php5/php5.y:5972 { yyVAL.node = &ast.ExprArrayItem{} } case 481: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php5/php5.y:5935 +// line internal/php5/php5.y:5980 { yyVAL.node = &ast.ParserSeparatedList{} } case 482: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:5939 +// line internal/php5/php5.y:5984 { if yyDollar[2].token != nil { yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns = append(yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns, yyDollar[2].token) @@ -8507,7 +8552,7 @@ yydefault: } case 483: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php5/php5.y:5951 +// line internal/php5/php5.y:5996 { arrayItem := &ast.ExprArrayItem{ Node: ast.Node{ @@ -8525,7 +8570,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5967 +// line internal/php5/php5.y:6012 { arrayItem := &ast.ExprArrayItem{ Node: ast.Node{ @@ -8541,7 +8586,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:5981 +// line internal/php5/php5.y:6026 { yyVAL.node = &ast.ParserSeparatedList{ Items: []ast.Vertex{ @@ -8558,7 +8603,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:5996 +// line internal/php5/php5.y:6041 { yyVAL.node = &ast.ParserSeparatedList{ Items: []ast.Vertex{ @@ -8573,7 +8618,7 @@ yydefault: } case 487: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php5/php5.y:6009 +// line internal/php5/php5.y:6054 { arrayItem := &ast.ExprArrayItem{ Node: ast.Node{ @@ -8597,7 +8642,7 @@ yydefault: } case 488: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:6031 +// line internal/php5/php5.y:6076 { arrayItem := &ast.ExprArrayItem{ Node: ast.Node{ @@ -8619,7 +8664,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:6051 +// line internal/php5/php5.y:6096 { yyVAL.node = &ast.ParserSeparatedList{ Items: []ast.Vertex{ @@ -8642,7 +8687,7 @@ yydefault: } case 490: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:6072 +// line internal/php5/php5.y:6117 { yyVAL.node = &ast.ParserSeparatedList{ Items: []ast.Vertex{ @@ -8663,13 +8708,13 @@ yydefault: } case 491: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:6094 +// line internal/php5/php5.y:6139 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 492: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:6098 +// line internal/php5/php5.y:6143 { yyVAL.list = append( yyDollar[1].list, @@ -8684,13 +8729,13 @@ yydefault: } case 493: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:6111 +// line internal/php5/php5.y:6156 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 494: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:6115 +// line internal/php5/php5.y:6160 { yyVAL.list = []ast.Vertex{ &ast.ScalarEncapsedStringPart{ @@ -8705,7 +8750,7 @@ yydefault: } case 495: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:6131 +// line internal/php5/php5.y:6176 { yyVAL.node = &ast.ExprVariable{ Node: ast.Node{ @@ -8722,7 +8767,7 @@ yydefault: } case 496: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:6146 +// line internal/php5/php5.y:6191 { yyVAL.node = &ast.ExprArrayDimFetch{ Node: ast.Node{ @@ -8747,7 +8792,7 @@ yydefault: } case 497: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:6169 +// line internal/php5/php5.y:6214 { yyVAL.node = &ast.ExprPropertyFetch{ Node: ast.Node{ @@ -8777,7 +8822,7 @@ yydefault: } case 498: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:6197 +// line internal/php5/php5.y:6242 { yyVAL.node = &ast.ParserBrackets{ Node: ast.Node{ @@ -8795,7 +8840,7 @@ yydefault: } case 499: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:6213 +// line internal/php5/php5.y:6258 { yyVAL.node = &ast.ParserBrackets{ Node: ast.Node{ @@ -8819,7 +8864,7 @@ yydefault: } case 500: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php5/php5.y:6235 +// line internal/php5/php5.y:6280 { yyVAL.node = &ast.ParserBrackets{ Node: ast.Node{ @@ -8851,7 +8896,7 @@ yydefault: } case 501: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:6265 +// line internal/php5/php5.y:6310 { yyVAL.node = &ast.ParserBrackets{ Node: ast.Node{ @@ -8864,7 +8909,7 @@ yydefault: } case 502: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:6279 +// line internal/php5/php5.y:6324 { yyVAL.node = &ast.ScalarString{ Node: ast.Node{ @@ -8876,7 +8921,7 @@ yydefault: } case 503: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:6289 +// line internal/php5/php5.y:6334 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(string(yyDollar[1].token.Value)); err == nil { @@ -8899,7 +8944,7 @@ yydefault: } case 504: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:6310 +// line internal/php5/php5.y:6355 { yyVAL.node = &ast.ExprVariable{ Node: ast.Node{ @@ -8916,7 +8961,7 @@ yydefault: } case 505: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:6328 +// line internal/php5/php5.y:6373 { yyVAL.node = &ast.ExprIsset{ Node: ast.Node{ @@ -8931,7 +8976,7 @@ yydefault: } case 506: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:6341 +// line internal/php5/php5.y:6386 { yyVAL.node = &ast.ExprEmpty{ Node: ast.Node{ @@ -8945,7 +8990,7 @@ yydefault: } case 507: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:6353 +// line internal/php5/php5.y:6398 { yyVAL.node = &ast.ExprEmpty{ Node: ast.Node{ @@ -8959,7 +9004,7 @@ yydefault: } case 508: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:6365 +// line internal/php5/php5.y:6410 { yyVAL.node = &ast.ExprInclude{ Node: ast.Node{ @@ -8971,7 +9016,7 @@ yydefault: } case 509: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:6375 +// line internal/php5/php5.y:6420 { yyVAL.node = &ast.ExprIncludeOnce{ Node: ast.Node{ @@ -8983,7 +9028,7 @@ yydefault: } case 510: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php5/php5.y:6385 +// line internal/php5/php5.y:6430 { yyVAL.node = &ast.ExprEval{ Node: ast.Node{ @@ -8997,7 +9042,7 @@ yydefault: } case 511: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:6397 +// line internal/php5/php5.y:6442 { yyVAL.node = &ast.ExprRequire{ Node: ast.Node{ @@ -9009,7 +9054,7 @@ yydefault: } case 512: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php5/php5.y:6407 +// line internal/php5/php5.y:6452 { yyVAL.node = &ast.ExprRequireOnce{ Node: ast.Node{ @@ -9021,7 +9066,7 @@ yydefault: } case 513: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:6420 +// line internal/php5/php5.y:6465 { yyVAL.node = &ast.ParserSeparatedList{ Items: []ast.Vertex{yyDollar[1].node}, @@ -9029,7 +9074,7 @@ yydefault: } case 514: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:6426 +// line internal/php5/php5.y:6471 { yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns = append(yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns, yyDollar[2].token) yyDollar[1].node.(*ast.ParserSeparatedList).Items = append(yyDollar[1].node.(*ast.ParserSeparatedList).Items, yyDollar[3].node) @@ -9038,19 +9083,19 @@ yydefault: } case 515: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:6436 +// line internal/php5/php5.y:6481 { yyVAL.node = yyDollar[1].node } case 516: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php5/php5.y:6440 +// line internal/php5/php5.y:6485 { yyVAL.node = yyDollar[1].node } case 517: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:6447 +// line internal/php5/php5.y:6492 { yyVAL.node = &ast.ExprClassConstFetch{ Node: ast.Node{ @@ -9069,7 +9114,7 @@ yydefault: } case 518: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:6464 +// line internal/php5/php5.y:6509 { yyVAL.node = &ast.ExprClassConstFetch{ Node: ast.Node{ @@ -9088,7 +9133,7 @@ yydefault: } case 519: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:6484 +// line internal/php5/php5.y:6529 { yyVAL.node = &ast.ExprClassConstFetch{ Node: ast.Node{ @@ -9107,7 +9152,7 @@ yydefault: } case 520: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php5/php5.y:6504 +// line internal/php5/php5.y:6549 { yyVAL.node = &ast.ExprClassConstFetch{ Node: ast.Node{ diff --git a/internal/php5/php5.y b/internal/php5/php5.y index 2a24915..4027440 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -15,8 +15,6 @@ import ( node ast.Vertex token *token.Token list []ast.Vertex - - ClosureUse *ast.ExprClosureUse } %token T_INCLUDE @@ -219,6 +217,7 @@ import ( %type function interface_entry %type possible_comma %type case_separator +%type is_reference is_variadic %type top_statement use_declaration use_function_declaration use_const_declaration common_scalar %type static_class_constant compound_variable reference_variable class_name variable_class_name @@ -241,12 +240,12 @@ import ( %type method_body trait_reference_list static_array_pair_list non_empty_static_array_pair_list %type foreach_statement for_statement while_statement isset_variables %type foreach_variable foreach_optional_arg for_expr non_empty_for_expr -%type extends_from interface_list trait_list -%type implements_list +%type extends_from interface_list trait_list namespace_name +%type implements_list use_declarations use_function_declarations use_const_declarations %type interface_extends_list -%type lexical_vars +%type lexical_vars -%type top_statement_list namespace_name use_declarations use_function_declarations use_const_declarations +%type top_statement_list %type inner_statement_list encaps_list %type elseif_list new_elseif_list %type case_list catch_statement additional_catches @@ -260,7 +259,6 @@ import ( %type dynamic_class_name_variable_properties variable_properties %type simple_indirect_reference -%type is_reference is_variadic %% @@ -293,26 +291,32 @@ top_statement_list: namespace_name: T_STRING { - $$ = []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + StringTkn: $1, + Value: $1.Value, }, - StringTkn: $1, - Value: $1.Value, }, } } | namespace_name T_NS_SEPARATOR T_STRING { - $$ = append($1, &ast.NameNamePart{ + part := &ast.NameNamePart{ Node: ast.Node{ - Position: position.NewTokensPosition($2, $3), + Position: position.NewTokenPosition($3), }, - NsSeparatorTkn: $2, StringTkn: $3, Value: $3.Value, - }) + } + + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, part) + + $$ = $1 } ; @@ -355,9 +359,10 @@ top_statement: NsTkn: $1, Name: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($2), + Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), }, - Parts: $2, + Parts: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, SemiColonTkn: $3, } @@ -371,9 +376,10 @@ top_statement: NsTkn: $1, Name: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($2), + Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), }, - Parts: $2, + Parts: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, OpenCurlyBracket: $3, Stmts: $4, @@ -399,7 +405,8 @@ top_statement: Position: position.NewTokensPosition($1, $3), }, UseTkn: $1, - UseDeclarations: $2, + UseDeclarations: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, SemiColonTkn: $3, } } @@ -417,7 +424,8 @@ top_statement: IdentifierTkn: $2, Value: $2.Value, }, - UseDeclarations: $3, + UseDeclarations: $3.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, SemiColonTkn: $4, } } @@ -435,7 +443,8 @@ top_statement: IdentifierTkn: $2, Value: $2.Value, }, - UseDeclarations: $3, + UseDeclarations: $3.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, SemiColonTkn: $4, } } @@ -450,13 +459,16 @@ top_statement: use_declarations: use_declarations ',' use_declaration { - $1[len($1)-1].(*ast.StmtUseDeclaration).CommaTkn = $2 + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) - $$ = append($1, $3) + $$ = $1 } | use_declaration { - $$ = []ast.Vertex{$1} + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{$1}, + } } ; @@ -465,13 +477,14 @@ use_declaration: { $$ = &ast.StmtUseDeclaration{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, Use: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, - Parts: $1, + Parts: $1.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, }, } } @@ -479,13 +492,14 @@ use_declaration: { $$ = &ast.StmtUseDeclaration{ Node: ast.Node{ - Position: position.NewNodeListTokenPosition($1, $3), + Position: position.NewNodeListTokenPosition($1.(*ast.ParserSeparatedList).Items, $3), }, Use: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, - Parts: $1, + Parts: $1.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, }, AsTkn: $2, Alias: &ast.Identifier{ @@ -501,14 +515,15 @@ use_declaration: { $$ = &ast.StmtUseDeclaration{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $2), + Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), }, NsSeparatorTkn: $1, Use: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($2), + Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), }, - Parts: $2, + Parts: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, } } @@ -521,9 +536,10 @@ use_declaration: NsSeparatorTkn: $1, Use: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($2), + Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), }, - Parts: $2, + Parts: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, AsTkn: $3, Alias: &ast.Identifier{ @@ -540,13 +556,16 @@ use_declaration: use_function_declarations: use_function_declarations ',' use_function_declaration { - $1[len($1)-1].(*ast.StmtUseDeclaration).CommaTkn = $2 + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) - $$ = append($1, $3) + $$ = $1 } | use_function_declaration { - $$ = []ast.Vertex{$1} + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{$1}, + } } ; @@ -555,13 +574,14 @@ use_function_declaration: { $$ = &ast.StmtUseDeclaration{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, Use: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, - Parts: $1, + Parts: $1.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, }, } } @@ -569,13 +589,14 @@ use_function_declaration: { $$ = &ast.StmtUseDeclaration{ Node: ast.Node{ - Position: position.NewNodeListTokenPosition($1, $3), + Position: position.NewNodeListTokenPosition($1.(*ast.ParserSeparatedList).Items, $3), }, Use: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, - Parts: $1, + Parts: $1.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, }, AsTkn: $2, Alias: &ast.Identifier{ @@ -591,14 +612,15 @@ use_function_declaration: { $$ = &ast.StmtUseDeclaration{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $2), + Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), }, NsSeparatorTkn: $1, Use: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($2), + Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), }, - Parts: $2, + Parts: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, } } @@ -611,9 +633,10 @@ use_function_declaration: NsSeparatorTkn: $1, Use: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($2), + Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), }, - Parts: $2, + Parts: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, AsTkn: $3, Alias: &ast.Identifier{ @@ -630,13 +653,16 @@ use_function_declaration: use_const_declarations: use_const_declarations ',' use_const_declaration { - $1[len($1)-1].(*ast.StmtUseDeclaration).CommaTkn = $2 + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) - $$ = append($1, $3) + $$ = $1 } | use_const_declaration { - $$ = []ast.Vertex{$1} + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{$1}, + } } ; @@ -645,13 +671,14 @@ use_const_declaration: { $$ = &ast.StmtUseDeclaration{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, Use: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, - Parts: $1, + Parts: $1.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, }, } } @@ -659,13 +686,14 @@ use_const_declaration: { $$ = &ast.StmtUseDeclaration{ Node: ast.Node{ - Position: position.NewNodeListTokenPosition($1, $3), + Position: position.NewNodeListTokenPosition($1.(*ast.ParserSeparatedList).Items, $3), }, Use: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, - Parts: $1, + Parts: $1.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, }, AsTkn: $2, Alias: &ast.Identifier{ @@ -681,14 +709,15 @@ use_const_declaration: { $$ = &ast.StmtUseDeclaration{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $2), + Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), }, NsSeparatorTkn: $1, Use: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($2), + Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), }, - Parts: $2, + Parts: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, } } @@ -701,9 +730,10 @@ use_const_declaration: NsSeparatorTkn: $1, Use: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($2), + Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), }, - Parts: $2, + Parts: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, AsTkn: $3, Alias: &ast.Identifier{ @@ -2888,7 +2918,7 @@ class_constant_declaration: { constList := $1.(*ast.StmtClassConstList) constList.Node.Position = position.NewNodesPosition($1, $5) - lastNode($$.(*ast.StmtClassConstList).Consts).(*ast.StmtConstant).CommaTkn = $2 + constList.SeparatorTkns = append(constList.SeparatorTkns, $2) constList.Consts = append(constList.Consts, &ast.StmtConstant{ Node: ast.Node{ Position: position.NewTokenNodePosition($3, $5), @@ -4165,13 +4195,14 @@ function_call: { $$ = &ast.ExprFunctionCall{ Node: ast.Node{ - Position: position.NewNodeListNodePosition($1, $2), + Position: position.NewNodeListNodePosition($1.(*ast.ParserSeparatedList).Items, $2), }, Function: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, - Parts: $1, + Parts: $1.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, }, OpenParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $2.(*ast.ArgumentList).Arguments, @@ -4187,11 +4218,12 @@ function_call: }, Function: &ast.NameRelative{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $3), + Position: position.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), }, NsTkn: $1, NsSeparatorTkn: $2, - Parts: $3, + Parts: $3.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, }, OpenParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $4.(*ast.ArgumentList).Arguments, @@ -4207,10 +4239,11 @@ function_call: }, Function: &ast.NameFullyQualified{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $2), + Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), }, NsSeparatorTkn: $1, - Parts: $2, + Parts: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, OpenParenthesisTkn: $3.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $3.(*ast.ArgumentList).Arguments, @@ -4308,30 +4341,33 @@ class_name: { $$ = &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, - Parts: $1, + Parts: $1.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, } } | T_NAMESPACE T_NS_SEPARATOR namespace_name { $$ = &ast.NameRelative{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $3), + Position: position.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), }, NsTkn: $1, NsSeparatorTkn: $2, - Parts: $3, + Parts: $3.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, } } | T_NS_SEPARATOR namespace_name { $$ = &ast.NameFullyQualified{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $2), + Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), }, NsSeparatorTkn: $1, - Parts: $2, + Parts: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, } } ; @@ -4341,30 +4377,33 @@ fully_qualified_class_name: { $$ = &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, - Parts: $1, + Parts: $1.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, } } | T_NAMESPACE T_NS_SEPARATOR namespace_name { $$ = &ast.NameRelative{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $3), + Position: position.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), }, NsTkn: $1, NsSeparatorTkn: $2, - Parts: $3, + Parts: $3.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, } } | T_NS_SEPARATOR namespace_name { $$ = &ast.NameFullyQualified{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $2), + Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), }, NsSeparatorTkn: $1, - Parts: $2, + Parts: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, } } ; @@ -4670,13 +4709,14 @@ static_scalar_value: { $$ = &ast.ExprConstFetch{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, Const: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, - Parts: $1, + Parts: $1.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, }, } } @@ -4684,15 +4724,16 @@ static_scalar_value: { $$ = &ast.ExprConstFetch{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $3), + Position: position.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), }, Const: &ast.NameRelative{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $3), + Position: position.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), }, NsTkn: $1, NsSeparatorTkn: $2, - Parts: $3, + Parts: $3.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, }, } } @@ -4700,14 +4741,15 @@ static_scalar_value: { $$ = &ast.ExprConstFetch{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $2), + Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), }, Const: &ast.NameFullyQualified{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $2), + Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), }, NsSeparatorTkn: $1, - Parts: $2, + Parts: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, } } @@ -5131,13 +5173,14 @@ general_constant: { $$ = &ast.ExprConstFetch{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, Const: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, - Parts: $1, + Parts: $1.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, }, } } @@ -5145,15 +5188,16 @@ general_constant: { $$ = &ast.ExprConstFetch{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $3), + Position: position.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), }, Const: &ast.NameRelative{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $3), + Position: position.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), }, NsTkn: $1, NsSeparatorTkn: $2, - Parts: $3, + Parts: $3.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, }, } } @@ -5161,14 +5205,15 @@ general_constant: { $$ = &ast.ExprConstFetch{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $2), + Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), }, Const: &ast.NameFullyQualified{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $2), + Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), }, NsSeparatorTkn: $1, - Parts: $2, + Parts: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, } } diff --git a/internal/php7/php7.go b/internal/php7/php7.go index c592f8c..e224ae3 100644 --- a/internal/php7/php7.go +++ b/internal/php7/php7.go @@ -20,10 +20,7 @@ type yySymType struct { yys int node ast.Vertex token *token.Token - tkn *token.Token list []ast.Vertex - - ClosureUse *ast.ExprClosureUse } const T_INCLUDE = 57346 @@ -343,7 +340,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -// line internal/php7/php7.y:4968 +// line internal/php7/php7.y:4997 // line yacctab:1 var yyExca = [...]int{ @@ -624,9 +621,9 @@ var yyAct = [...]int{ 554, 381, 379, 814, 810, 197, 832, 693, 833, 834, 196, 195, 815, 189, 1, 831, 825, 780, 781, 38, 746, 283, 260, 261, 260, 261, 836, 743, 844, 783, - 780, 781, 856, 111, 744, 879, 841, 848, 676, 255, - 796, 533, 260, 261, 855, 385, 371, 656, 852, 934, - 662, 859, 136, 845, 227, 114, 43, 42, 528, 877, + 780, 781, 856, 111, 744, 879, 676, 848, 255, 796, + 385, 533, 260, 261, 855, 371, 656, 852, 934, 662, + 845, 859, 136, 227, 43, 114, 42, 841, 528, 877, 890, 891, 886, 865, 16, 838, 892, 893, 539, 885, 15, 237, 830, 853, 151, 897, 898, 730, 606, 872, 271, 49, 786, 896, 903, 48, 110, 905, 50, 217, @@ -1427,10 +1424,10 @@ var yyPgo = [...]int{ 905, 100, 88, 242, 890, 889, 34, 887, 886, 8, 883, 80, 41, 882, 56, 49, 878, 876, 875, 871, 870, 86, 868, 864, 862, 10, 860, 87, 858, 855, - 854, 853, 848, 847, 12, 846, 844, 46, 39, 40, - 2, 16, 667, 43, 85, 843, 840, 839, 13, 838, - 837, 555, 836, 45, 71, 835, 830, 6, 721, 20, - 540, 829, 18, 828, 826, 25, 33, 37, 825, 530, + 854, 853, 848, 847, 846, 25, 33, 530, 12, 18, + 844, 843, 46, 39, 40, 2, 16, 667, 43, 85, + 840, 839, 838, 13, 837, 836, 555, 835, 45, 71, + 830, 829, 6, 721, 20, 540, 828, 826, 37, 825, 99, 1, 17, 824, 817, 810, 809, 804, 28, } @@ -1443,27 +1440,27 @@ var yyR1 = [...]int{ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 120, - 120, 112, 112, 10, 10, 10, 9, 9, 9, 9, + 120, 89, 89, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 108, 108, 16, 16, 18, 18, 7, 7, 116, - 116, 115, 115, 119, 119, 17, 17, 20, 20, 19, + 9, 113, 113, 16, 16, 18, 18, 7, 7, 86, + 86, 85, 85, 87, 87, 17, 17, 20, 20, 19, 19, 77, 77, 121, 121, 22, 22, 22, 22, 22, 22, 22, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 113, 113, 74, 74, - 30, 30, 102, 102, 31, 12, 1, 1, 2, 2, - 13, 13, 126, 126, 92, 92, 14, 15, 103, 103, - 105, 105, 104, 104, 109, 109, 109, 109, 99, 99, - 98, 98, 29, 29, 96, 96, 96, 96, 117, 117, - 117, 8, 8, 100, 100, 83, 83, 76, 76, 85, - 85, 80, 80, 27, 27, 28, 28, 33, 33, 34, - 34, 91, 91, 89, 89, 89, 90, 90, 93, 93, + 11, 11, 11, 11, 11, 11, 117, 117, 74, 74, + 30, 30, 107, 107, 31, 12, 1, 1, 2, 2, + 13, 13, 126, 126, 97, 97, 14, 15, 108, 108, + 110, 110, 109, 109, 114, 114, 114, 114, 104, 104, + 103, 103, 29, 29, 101, 101, 101, 101, 118, 118, + 118, 8, 8, 105, 105, 84, 84, 76, 76, 90, + 90, 80, 80, 27, 27, 28, 28, 33, 33, 34, + 34, 96, 96, 94, 94, 94, 95, 95, 98, 98, 78, 78, 35, 35, 37, 37, 38, 39, 39, 40, - 40, 122, 122, 41, 41, 41, 41, 75, 75, 95, - 95, 95, 118, 118, 42, 42, 43, 44, 44, 44, - 44, 46, 46, 45, 97, 97, 124, 124, 123, 123, - 125, 125, 107, 107, 107, 107, 107, 107, 79, 79, - 47, 47, 114, 114, 84, 21, 73, 73, 48, 23, + 40, 122, 122, 41, 41, 41, 41, 75, 75, 100, + 100, 100, 119, 119, 42, 42, 43, 44, 44, 44, + 44, 46, 46, 45, 102, 102, 124, 124, 123, 123, + 125, 125, 112, 112, 112, 112, 112, 112, 79, 79, + 47, 47, 83, 83, 88, 21, 73, 73, 48, 23, 23, 24, 24, 50, 49, 49, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, @@ -1472,19 +1469,19 @@ var yyR1 = [...]int{ 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 101, 101, 128, 3, 3, 106, 106, + 36, 36, 36, 106, 106, 128, 3, 3, 111, 111, 81, 81, 59, 59, 60, 60, 60, 60, 51, 51, - 52, 52, 57, 57, 111, 111, 111, 94, 94, 64, + 52, 52, 57, 57, 116, 116, 116, 99, 99, 64, 64, 64, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 65, 65, 65, 25, 25, 26, 26, 63, 66, 66, 66, 67, 67, 67, 68, 68, 68, 68, 68, 68, 32, 32, 32, 53, 53, 53, 69, 69, 70, 70, 70, 70, - 70, 70, 61, 61, 61, 62, 62, 62, 56, 87, - 87, 55, 55, 86, 86, 86, 86, 86, 86, 86, - 110, 110, 110, 110, 71, 71, 71, 71, 71, 71, + 70, 70, 61, 61, 61, 62, 62, 62, 56, 92, + 92, 55, 55, 91, 91, 91, 91, 91, 91, 91, + 115, 115, 115, 115, 71, 71, 71, 71, 71, 71, 71, 72, 72, 72, 72, 54, 54, 54, 54, 54, - 54, 54, 82, 82, 88, + 54, 54, 82, 82, 93, } var yyR2 = [...]int{ @@ -1545,41 +1542,41 @@ var yyChk = [...]int{ 52, 80, 45, 39, 144, -76, -80, 21, 20, 23, 30, 34, 35, 40, 47, 99, 19, 14, -25, 49, 25, 27, 146, 41, 44, 36, 10, 37, -126, 53, - 54, 55, -83, -85, -32, -36, -92, 7, -68, -69, + 54, 55, -84, -90, -32, -36, -97, 7, -68, -69, -66, 60, 150, 93, 105, 106, 155, 154, 156, 157, 148, -49, -54, 108, 109, 110, 111, 112, 113, 114, - 6, 158, -58, 143, 97, 98, 107, -101, 100, 101, + 6, 158, -58, 143, 97, 98, 107, -106, 100, 101, -53, -65, -60, -51, -63, -64, 92, 50, 51, 4, 5, 85, 86, 87, 8, 9, 67, 68, 82, 64, 65, 66, 81, 63, 75, 142, 38, 12, 159, -10, - -67, 61, 18, -112, 83, 148, 83, -112, 144, 10, - -18, -108, -119, -112, 83, 37, 39, -19, -20, -77, + -67, 61, 18, -89, 83, 148, 83, -89, 144, 10, + -18, -113, -87, -89, 83, 37, 39, -19, -20, -77, -21, 10, -121, 148, -11, 37, 80, 148, 148, -26, - -25, 99, -26, -26, -37, -38, -53, -39, -101, -40, + -25, 99, -26, -26, -37, -38, -53, -39, -106, -40, 12, -73, -48, -25, 146, 131, 132, 88, 90, 89, 161, 153, 163, 169, 155, 154, 164, 133, 165, 166, 134, 135, 136, 137, 138, 139, 167, 140, 168, 141, 116, 91, 152, 115, 148, 148, 148, 144, -25, 10, - 147, -3, 153, 53, -92, 10, 10, 10, 94, 95, + 147, -3, 153, 53, -97, 10, 10, 10, 94, 95, 94, 96, 95, 162, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 105, 106, 148, - 150, 144, 58, 148, -56, -55, -87, -86, -25, 153, + 150, 144, 58, 148, -56, -55, -92, -91, -25, 153, 84, 60, -25, -32, -65, 148, -64, 99, 150, -32, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -57, 148, -25, -111, 17, -110, -71, 12, + -25, -25, -57, 148, -25, -116, 17, -115, -71, 12, 77, 78, -25, -25, -25, 150, 79, 79, -52, -50, -51, -70, 53, -10, -53, 148, 148, -25, -25, 148, - -25, -25, 17, 76, -110, -110, 17, -3, 144, -53, - -93, 148, -93, 148, 83, -112, 149, -112, 146, 144, - -120, 146, -16, -119, -112, 83, 146, 160, 83, 29, - -112, -20, 146, 160, 162, -22, 145, 2, -11, -12, + -25, -25, 17, 76, -115, -115, 17, -3, 144, -53, + -98, 148, -98, 148, 83, -89, 149, -89, 146, 144, + -120, 146, -16, -87, -89, 83, 146, 160, 83, 29, + -89, -20, 146, 160, 162, -22, 145, 2, -11, -12, -13, -14, -15, 52, -25, 21, -3, -23, -24, -25, -25, 146, 146, 146, 146, 160, 146, 160, 162, 146, 160, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -52, -25, 147, - -25, -102, -31, -32, -25, -77, -121, 146, 146, 10, - -128, 10, -103, 56, -128, -105, 56, 148, -11, 148, + -25, -107, -31, -32, -25, -77, -121, 146, 146, 10, + -128, 10, -108, 56, -128, -110, 56, 148, -11, 148, 146, 147, -25, 153, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -26, -25, -62, 10, 144, -53, -56, 151, 160, 59, -32, -25, @@ -1593,48 +1590,48 @@ var yyChk = [...]int{ 39, 40, 97, 98, 60, 30, 31, 32, 33, 34, 61, 62, 56, 57, 80, 54, 55, 53, 63, 64, 66, 65, 67, 68, 82, 81, 38, -61, -6, -53, - -94, -93, 79, 150, 144, 58, 79, -94, -82, -88, + -99, -98, 79, 150, 144, 58, 79, -99, -82, -93, -25, -25, -25, 76, 76, 142, 148, -25, 149, -78, -35, -25, 84, -56, 10, 146, -120, 145, 146, 146, - 83, -112, -19, 83, -112, 144, 10, 83, -21, -25, + 83, -89, -19, 83, -89, 144, 10, 83, -21, -25, 148, 149, 148, 146, 160, 149, -38, -40, -25, -48, - 147, -25, -7, 160, 29, 149, 145, -128, 148, -103, - -104, 57, -10, 144, -128, -75, -10, -25, -25, -121, - -25, 149, 151, 145, -93, -25, 149, 162, -87, -25, + 147, -25, -7, 160, 29, 149, 145, -128, 148, -108, + -109, 57, -10, 144, -128, -75, -10, -25, -25, -121, + -25, 149, 151, 145, -98, -25, 149, 162, -92, -25, 153, 60, -56, 149, 151, 149, -72, 10, 13, 154, - 12, 10, 145, 145, 150, 145, -25, 151, -93, -25, - -93, -53, -26, -25, -62, -53, -103, -7, 160, 149, - 149, -27, -28, -33, -34, -91, -89, 152, 61, 62, - -10, 145, -7, 160, -25, 149, 145, 144, 83, -116, - -17, -20, -108, 144, -128, 149, -100, -11, 147, -25, - -23, -25, -96, 144, 147, -25, 149, -31, -109, -32, - 153, 60, 150, -29, -11, 147, -113, 148, -27, -104, + 12, 10, 145, 145, 150, 145, -25, 151, -98, -25, + -98, -53, -26, -25, -62, -53, -108, -7, 160, 149, + 149, -27, -28, -33, -34, -96, -94, 152, 61, 62, + -10, 145, -7, 160, -25, 149, 145, 144, 83, -86, + -17, -20, -113, 144, -128, 149, -105, -11, 147, -25, + -23, -25, -101, 144, 147, -25, 149, -31, -114, -32, + 153, 60, 150, -29, -11, 147, -117, 148, -27, -109, -128, -75, -122, 144, 160, 149, 149, 96, -11, 147, 145, 162, -25, -32, 148, 149, 151, 13, -25, 145, - 151, 145, -104, 149, -88, 149, 160, -1, 153, -89, - 149, -35, -115, -20, 144, -7, 160, -20, -116, 146, - -121, 149, 146, -117, 146, -117, 146, 146, 149, 59, + 151, 145, -109, 149, -93, 149, 160, -1, 153, -94, + 149, -35, -85, -20, 144, -7, 160, -20, -86, 146, + -121, 149, 146, -118, 146, -118, 146, 146, 149, 59, -32, 148, -56, -121, -30, 42, 43, -27, 149, -128, - 144, 145, -41, -124, -123, 45, -125, 48, -107, 104, + 144, 145, -41, -124, -123, 45, -125, 48, -112, 104, 103, 102, 99, 100, 101, -122, -10, -11, 147, 146, - -121, -25, -56, 151, -128, -90, 147, -33, -2, 84, - -7, 160, -115, 145, -17, -7, 22, 146, -23, 145, - 32, 33, -117, 31, -117, -98, -11, 147, -109, -32, - -56, 151, 28, 148, 144, 149, -106, 45, 144, -122, - -34, 39, 37, -75, -107, 145, -121, 149, 145, 144, - -128, -91, 12, 145, -20, -7, 145, 146, 149, -25, + -121, -25, -56, 151, -128, -95, 147, -33, -2, 84, + -7, 160, -85, 145, -17, -7, 22, 146, -23, 145, + 32, 33, -118, 31, -118, -103, -11, 147, -114, -32, + -56, 151, 28, 148, 144, 149, -111, 45, 144, -122, + -34, 39, 37, -75, -112, 145, -121, 149, 145, 144, + -128, -96, 12, 145, -20, -7, 145, 146, 149, -25, -8, 147, 146, 145, 146, 31, -121, 149, 149, 146, - -74, -10, -121, -90, -90, 148, -122, 145, -79, -47, - 12, -114, -84, -6, -3, -95, 146, 144, -122, 59, - 162, 145, -99, -11, 147, -8, -121, 146, 26, -98, + -74, -10, -121, -95, -95, 148, -122, 145, -79, -47, + 12, -83, -88, -6, -3, -100, 146, 144, -122, 59, + 162, 145, -104, -11, 147, -8, -121, 146, 26, -103, 12, 161, 145, 144, 144, -81, -59, 12, 153, 145, - 146, 160, -128, 162, 146, 160, 162, -6, 145, -118, + 146, 160, -128, 162, 146, 160, 162, -6, 145, -119, -42, -43, -44, -45, -46, -10, -6, 80, 10, 145, -25, -25, -121, -121, 146, 149, -10, -121, -121, 149, - 160, 12, -47, -25, -84, -25, -128, 145, -42, 146, + 160, 12, -47, -25, -88, -25, -128, 145, -42, 146, 146, 46, 29, 79, 24, 144, 145, 145, -59, -128, - -128, 148, -75, 10, -4, -107, -6, 146, -121, -27, - -6, 145, 149, -90, -97, 146, 144, -121, 145, + -128, 148, -75, 10, -4, -112, -6, 146, -121, -27, + -6, 145, 149, -95, -102, 146, 144, -121, 145, } var yyDef = [...]int{ @@ -2110,7 +2107,7 @@ yydefault: case 1: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:289 +// line internal/php7/php7.y:284 { yylex.(*Parser).rootNode = &ast.Root{ Node: ast.Node{ @@ -2122,469 +2119,469 @@ yydefault: } case 2: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:301 +// line internal/php7/php7.y:296 { yyVAL.token = yyDollar[1].token } case 3: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:301 +// line internal/php7/php7.y:296 { yyVAL.token = yyDollar[1].token } case 4: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:301 +// line internal/php7/php7.y:296 { yyVAL.token = yyDollar[1].token } case 5: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:301 +// line internal/php7/php7.y:296 { yyVAL.token = yyDollar[1].token } case 6: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:301 +// line internal/php7/php7.y:296 { yyVAL.token = yyDollar[1].token } case 7: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:301 +// line internal/php7/php7.y:296 { yyVAL.token = yyDollar[1].token } case 8: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:301 +// line internal/php7/php7.y:296 { yyVAL.token = yyDollar[1].token } case 9: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:301 +// line internal/php7/php7.y:296 { yyVAL.token = yyDollar[1].token } case 10: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:302 +// line internal/php7/php7.y:297 { yyVAL.token = yyDollar[1].token } case 11: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:302 +// line internal/php7/php7.y:297 { yyVAL.token = yyDollar[1].token } case 12: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:302 +// line internal/php7/php7.y:297 { yyVAL.token = yyDollar[1].token } case 13: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:302 +// line internal/php7/php7.y:297 { yyVAL.token = yyDollar[1].token } case 14: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:302 +// line internal/php7/php7.y:297 { yyVAL.token = yyDollar[1].token } case 15: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:302 +// line internal/php7/php7.y:297 { yyVAL.token = yyDollar[1].token } case 16: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:302 +// line internal/php7/php7.y:297 { yyVAL.token = yyDollar[1].token } case 17: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:302 +// line internal/php7/php7.y:297 { yyVAL.token = yyDollar[1].token } case 18: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:302 +// line internal/php7/php7.y:297 { yyVAL.token = yyDollar[1].token } case 19: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:302 +// line internal/php7/php7.y:297 { yyVAL.token = yyDollar[1].token } case 20: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:302 +// line internal/php7/php7.y:297 { yyVAL.token = yyDollar[1].token } case 21: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:302 +// line internal/php7/php7.y:297 { yyVAL.token = yyDollar[1].token } case 22: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:303 +// line internal/php7/php7.y:298 { yyVAL.token = yyDollar[1].token } case 23: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:303 +// line internal/php7/php7.y:298 { yyVAL.token = yyDollar[1].token } case 24: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:303 +// line internal/php7/php7.y:298 { yyVAL.token = yyDollar[1].token } case 25: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:303 +// line internal/php7/php7.y:298 { yyVAL.token = yyDollar[1].token } case 26: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:303 +// line internal/php7/php7.y:298 { yyVAL.token = yyDollar[1].token } case 27: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:303 +// line internal/php7/php7.y:298 { yyVAL.token = yyDollar[1].token } case 28: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:303 +// line internal/php7/php7.y:298 { yyVAL.token = yyDollar[1].token } case 29: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:303 +// line internal/php7/php7.y:298 { yyVAL.token = yyDollar[1].token } case 30: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:303 +// line internal/php7/php7.y:298 { yyVAL.token = yyDollar[1].token } case 31: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:303 +// line internal/php7/php7.y:298 { yyVAL.token = yyDollar[1].token } case 32: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:304 +// line internal/php7/php7.y:299 { yyVAL.token = yyDollar[1].token } case 33: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:304 +// line internal/php7/php7.y:299 { yyVAL.token = yyDollar[1].token } case 34: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:304 +// line internal/php7/php7.y:299 { yyVAL.token = yyDollar[1].token } case 35: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:304 +// line internal/php7/php7.y:299 { yyVAL.token = yyDollar[1].token } case 36: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:304 +// line internal/php7/php7.y:299 { yyVAL.token = yyDollar[1].token } case 37: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:304 +// line internal/php7/php7.y:299 { yyVAL.token = yyDollar[1].token } case 38: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:304 +// line internal/php7/php7.y:299 { yyVAL.token = yyDollar[1].token } case 39: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:304 +// line internal/php7/php7.y:299 { yyVAL.token = yyDollar[1].token } case 40: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:304 +// line internal/php7/php7.y:299 { yyVAL.token = yyDollar[1].token } case 41: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:304 +// line internal/php7/php7.y:299 { yyVAL.token = yyDollar[1].token } case 42: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:305 +// line internal/php7/php7.y:300 { yyVAL.token = yyDollar[1].token } case 43: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:305 +// line internal/php7/php7.y:300 { yyVAL.token = yyDollar[1].token } case 44: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:305 +// line internal/php7/php7.y:300 { yyVAL.token = yyDollar[1].token } case 45: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:305 +// line internal/php7/php7.y:300 { yyVAL.token = yyDollar[1].token } case 46: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:305 +// line internal/php7/php7.y:300 { yyVAL.token = yyDollar[1].token } case 47: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:305 +// line internal/php7/php7.y:300 { yyVAL.token = yyDollar[1].token } case 48: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:305 +// line internal/php7/php7.y:300 { yyVAL.token = yyDollar[1].token } case 49: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:305 +// line internal/php7/php7.y:300 { yyVAL.token = yyDollar[1].token } case 50: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:305 +// line internal/php7/php7.y:300 { yyVAL.token = yyDollar[1].token } case 51: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:305 +// line internal/php7/php7.y:300 { yyVAL.token = yyDollar[1].token } case 52: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:305 +// line internal/php7/php7.y:300 { yyVAL.token = yyDollar[1].token } case 53: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:306 +// line internal/php7/php7.y:301 { yyVAL.token = yyDollar[1].token } case 54: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:306 +// line internal/php7/php7.y:301 { yyVAL.token = yyDollar[1].token } case 55: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:306 +// line internal/php7/php7.y:301 { yyVAL.token = yyDollar[1].token } case 56: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:306 +// line internal/php7/php7.y:301 { yyVAL.token = yyDollar[1].token } case 57: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:306 +// line internal/php7/php7.y:301 { yyVAL.token = yyDollar[1].token } case 58: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:306 +// line internal/php7/php7.y:301 { yyVAL.token = yyDollar[1].token } case 59: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:306 +// line internal/php7/php7.y:301 { yyVAL.token = yyDollar[1].token } case 60: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:306 +// line internal/php7/php7.y:301 { yyVAL.token = yyDollar[1].token } case 61: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:307 +// line internal/php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 62: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:307 +// line internal/php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 63: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:307 +// line internal/php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 64: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:307 +// line internal/php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 65: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:307 +// line internal/php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 66: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:307 +// line internal/php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 67: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:307 +// line internal/php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 68: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:307 +// line internal/php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 69: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:307 +// line internal/php7/php7.y:302 { yyVAL.token = yyDollar[1].token } case 70: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:312 +// line internal/php7/php7.y:307 { yyVAL.token = yyDollar[1].token } case 71: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:315 +// line internal/php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 72: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:315 +// line internal/php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 73: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:315 +// line internal/php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 74: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:315 +// line internal/php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 75: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:315 +// line internal/php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 76: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:315 +// line internal/php7/php7.y:310 { yyVAL.token = yyDollar[1].token } case 77: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:320 +// line internal/php7/php7.y:315 { yyVAL.token = yyDollar[1].token } case 78: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:324 +// line internal/php7/php7.y:319 { yyVAL.token = yyDollar[1].token } case 79: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:331 +// line internal/php7/php7.y:326 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -2592,113 +2589,122 @@ yydefault: } case 80: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:337 +// line internal/php7/php7.y:332 { yyVAL.list = []ast.Vertex{} } case 81: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:344 +// line internal/php7/php7.y:339 { - yyVAL.list = []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: position.NewTokenPosition(yyDollar[1].token), + yyVAL.node = &ast.ParserSeparatedList{ + Items: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: position.NewTokenPosition(yyDollar[1].token), + }, + StringTkn: yyDollar[1].token, + Value: yyDollar[1].token.Value, }, - StringTkn: yyDollar[1].token, - Value: yyDollar[1].token.Value, }, } } case 82: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:356 +// line internal/php7/php7.y:353 { - yyVAL.list = append(yyDollar[1].list, &ast.NameNamePart{ + part := &ast.NameNamePart{ Node: ast.Node{ - Position: position.NewTokensPosition(yyDollar[2].token, yyDollar[3].token), + Position: position.NewTokenPosition(yyDollar[3].token), }, - NsSeparatorTkn: yyDollar[2].token, - StringTkn: yyDollar[3].token, - Value: yyDollar[3].token.Value, - }) + StringTkn: yyDollar[3].token, + Value: yyDollar[3].token.Value, + } + + yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns = append(yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns, yyDollar[2].token) + yyDollar[1].node.(*ast.ParserSeparatedList).Items = append(yyDollar[1].node.(*ast.ParserSeparatedList).Items, part) + + yyVAL.node = yyDollar[1].node } case 83: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:370 +// line internal/php7/php7.y:371 { yyVAL.node = &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition(yyDollar[1].list), + Position: position.NewNodeListPosition(yyDollar[1].node.(*ast.ParserSeparatedList).Items), }, - Parts: yyDollar[1].list, + Parts: yyDollar[1].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns, } } case 84: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:379 +// line internal/php7/php7.y:381 { yyVAL.node = &ast.NameRelative{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].list), + Position: position.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[3].node.(*ast.ParserSeparatedList).Items), }, NsTkn: yyDollar[1].token, NsSeparatorTkn: yyDollar[2].token, - Parts: yyDollar[3].list, + Parts: yyDollar[3].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[3].node.(*ast.ParserSeparatedList).SeparatorTkns, } } case 85: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:390 +// line internal/php7/php7.y:393 { yyVAL.node = &ast.NameFullyQualified{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].list), + Position: position.NewTokenNodeListPosition(yyDollar[1].token, yyDollar[2].node.(*ast.ParserSeparatedList).Items), }, NsSeparatorTkn: yyDollar[1].token, - Parts: yyDollar[2].list, + Parts: yyDollar[2].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[2].node.(*ast.ParserSeparatedList).SeparatorTkns, } } case 86: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:403 +// line internal/php7/php7.y:407 { // error yyVAL.node = nil } case 87: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:408 +// line internal/php7/php7.y:412 { yyVAL.node = yyDollar[1].node } case 88: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:412 +// line internal/php7/php7.y:416 { yyVAL.node = yyDollar[1].node } case 89: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:416 +// line internal/php7/php7.y:420 { yyVAL.node = yyDollar[1].node } case 90: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:420 +// line internal/php7/php7.y:424 { yyVAL.node = yyDollar[1].node } case 91: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:424 +// line internal/php7/php7.y:428 { yyVAL.node = yyDollar[1].node } case 92: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:428 +// line internal/php7/php7.y:432 { yyVAL.node = &ast.StmtHaltCompiler{ Node: ast.Node{ @@ -2712,7 +2718,7 @@ yydefault: } case 93: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:440 +// line internal/php7/php7.y:444 { yyVAL.node = &ast.StmtNamespace{ Node: ast.Node{ @@ -2721,16 +2727,17 @@ yydefault: NsTkn: yyDollar[1].token, Name: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition(yyDollar[2].list), + Position: position.NewNodeListPosition(yyDollar[2].node.(*ast.ParserSeparatedList).Items), }, - Parts: yyDollar[2].list, + Parts: yyDollar[2].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[2].node.(*ast.ParserSeparatedList).SeparatorTkns, }, SemiColonTkn: yyDollar[3].token, } } case 94: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php7/php7.y:456 +// line internal/php7/php7.y:461 { yyVAL.node = &ast.StmtNamespace{ Node: ast.Node{ @@ -2739,9 +2746,10 @@ yydefault: NsTkn: yyDollar[1].token, Name: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition(yyDollar[2].list), + Position: position.NewNodeListPosition(yyDollar[2].node.(*ast.ParserSeparatedList).Items), }, - Parts: yyDollar[2].list, + Parts: yyDollar[2].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[2].node.(*ast.ParserSeparatedList).SeparatorTkns, }, OpenCurlyBracket: yyDollar[3].token, Stmts: yyDollar[4].list, @@ -2750,7 +2758,7 @@ yydefault: } case 95: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:474 +// line internal/php7/php7.y:480 { yyVAL.node = &ast.StmtNamespace{ Node: ast.Node{ @@ -2764,7 +2772,7 @@ yydefault: } case 96: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:486 +// line internal/php7/php7.y:492 { use := yyDollar[2].node.(*ast.StmtGroupUse) @@ -2776,7 +2784,7 @@ yydefault: } case 97: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:496 +// line internal/php7/php7.y:502 { use := yyDollar[3].node.(*ast.StmtGroupUse) @@ -2789,20 +2797,21 @@ yydefault: } case 98: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:507 +// line internal/php7/php7.y:513 { yyVAL.node = &ast.StmtUse{ Node: ast.Node{ Position: position.NewTokensPosition(yyDollar[1].token, yyDollar[3].token), }, UseTkn: yyDollar[1].token, - UseDeclarations: yyDollar[2].list, + UseDeclarations: yyDollar[2].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[2].node.(*ast.ParserSeparatedList).SeparatorTkns, SemiColonTkn: yyDollar[3].token, } } case 99: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:518 +// line internal/php7/php7.y:525 { yyVAL.node = &ast.StmtUse{ Node: ast.Node{ @@ -2810,13 +2819,14 @@ yydefault: }, UseTkn: yyDollar[1].token, Type: yyDollar[2].node, - UseDeclarations: yyDollar[3].list, + UseDeclarations: yyDollar[3].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[3].node.(*ast.ParserSeparatedList).SeparatorTkns, SemiColonTkn: yyDollar[4].token, } } case 100: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:530 +// line internal/php7/php7.y:538 { yyVAL.node = &ast.StmtConstList{ Node: ast.Node{ @@ -2830,7 +2840,7 @@ yydefault: } case 101: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:545 +// line internal/php7/php7.y:553 { yyVAL.node = &ast.Identifier{ Node: ast.Node{ @@ -2842,7 +2852,7 @@ yydefault: } case 102: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:555 +// line internal/php7/php7.y:563 { yyVAL.node = &ast.Identifier{ Node: ast.Node{ @@ -2854,33 +2864,33 @@ yydefault: } case 103: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php7/php7.y:568 +// line internal/php7/php7.y:576 { - if len(yyDollar[4].list) > 0 { - yyDollar[4].list[len(yyDollar[4].list)-1].(*ast.StmtUseDeclaration).CommaTkn = yyDollar[5].token - } + yyDollar[4].node.(*ast.ParserSeparatedList).SeparatorTkns = append(yyDollar[4].node.(*ast.ParserSeparatedList).SeparatorTkns, yyDollar[5].token) yyVAL.node = &ast.StmtGroupUse{ Node: ast.Node{ - Position: position.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[6].token), + Position: position.NewNodeListTokenPosition(yyDollar[1].node.(*ast.ParserSeparatedList).Items, yyDollar[6].token), }, Prefix: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition(yyDollar[1].list), + Position: position.NewNodeListPosition(yyDollar[1].node.(*ast.ParserSeparatedList).Items), }, - Parts: yyDollar[1].list, + Parts: yyDollar[1].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns, }, NsSeparatorTkn: yyDollar[2].token, OpenCurlyBracketTkn: yyDollar[3].token, - UseDeclarations: yyDollar[4].list, + UseDeclarations: yyDollar[4].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[4].node.(*ast.ParserSeparatedList).SeparatorTkns, CloseCurlyBracketTkn: yyDollar[6].token, } } case 104: yyDollar = yyS[yypt-7 : yypt+1] - // line internal/php7/php7.y:590 +// line internal/php7/php7.y:598 { - yyDollar[5].list[len(yyDollar[5].list)-1].(*ast.StmtUseDeclaration).CommaTkn = yyDollar[6].token + yyDollar[5].node.(*ast.ParserSeparatedList).SeparatorTkns = append(yyDollar[5].node.(*ast.ParserSeparatedList).SeparatorTkns, yyDollar[6].token) yyVAL.node = &ast.StmtGroupUse{ Node: ast.Node{ @@ -2889,43 +2899,47 @@ yydefault: LeadingNsSeparatorTkn: yyDollar[1].token, Prefix: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition(yyDollar[2].list), + Position: position.NewNodeListPosition(yyDollar[2].node.(*ast.ParserSeparatedList).Items), }, - Parts: yyDollar[2].list, + Parts: yyDollar[2].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[2].node.(*ast.ParserSeparatedList).SeparatorTkns, }, NsSeparatorTkn: yyDollar[3].token, OpenCurlyBracketTkn: yyDollar[4].token, - UseDeclarations: yyDollar[5].list, + UseDeclarations: yyDollar[5].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[5].node.(*ast.ParserSeparatedList).SeparatorTkns, CloseCurlyBracketTkn: yyDollar[7].token, } } case 105: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php7/php7.y:614 +// line internal/php7/php7.y:624 { - yyDollar[4].list[len(yyDollar[4].list)-1].(*ast.StmtUseDeclaration).CommaTkn = yyDollar[5].token + yyDollar[4].node.(*ast.ParserSeparatedList).SeparatorTkns = append(yyDollar[4].node.(*ast.ParserSeparatedList).SeparatorTkns, yyDollar[5].token) yyVAL.node = &ast.StmtGroupUse{ Node: ast.Node{ - Position: position.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[6].token), + Position: position.NewNodeListTokenPosition(yyDollar[1].node.(*ast.ParserSeparatedList).Items, yyDollar[6].token), }, Prefix: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition(yyDollar[1].list), + Position: position.NewNodeListPosition(yyDollar[1].node.(*ast.ParserSeparatedList).Items), }, - Parts: yyDollar[1].list, + Parts: yyDollar[1].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns, }, NsSeparatorTkn: yyDollar[2].token, OpenCurlyBracketTkn: yyDollar[3].token, - UseDeclarations: yyDollar[4].list, + UseDeclarations: yyDollar[4].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[4].node.(*ast.ParserSeparatedList).SeparatorTkns, CloseCurlyBracketTkn: yyDollar[6].token, } } case 106: yyDollar = yyS[yypt-7 : yypt+1] - // line internal/php7/php7.y:634 +// line internal/php7/php7.y:646 { - yyDollar[5].list[len(yyDollar[5].list)-1].(*ast.StmtUseDeclaration).CommaTkn = yyDollar[6].token + yyDollar[5].node.(*ast.ParserSeparatedList).SeparatorTkns = append(yyDollar[5].node.(*ast.ParserSeparatedList).SeparatorTkns, yyDollar[6].token) yyVAL.node = &ast.StmtGroupUse{ Node: ast.Node{ @@ -2934,79 +2948,90 @@ yydefault: LeadingNsSeparatorTkn: yyDollar[1].token, Prefix: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition(yyDollar[2].list), + Position: position.NewNodeListPosition(yyDollar[2].node.(*ast.ParserSeparatedList).Items), }, - Parts: yyDollar[2].list, + Parts: yyDollar[2].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[2].node.(*ast.ParserSeparatedList).SeparatorTkns, }, NsSeparatorTkn: yyDollar[3].token, OpenCurlyBracketTkn: yyDollar[4].token, - UseDeclarations: yyDollar[5].list, + UseDeclarations: yyDollar[5].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[5].node.(*ast.ParserSeparatedList).SeparatorTkns, CloseCurlyBracketTkn: yyDollar[7].token, } } case 107: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:658 +// line internal/php7/php7.y:672 { yyVAL.token = nil } case 108: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:662 +// line internal/php7/php7.y:676 { yyVAL.token = yyDollar[1].token } case 109: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:669 +// line internal/php7/php7.y:683 { - yyDollar[1].list[len(yyDollar[1].list)-1].(*ast.StmtUseDeclaration).CommaTkn = yyDollar[2].token + yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns = append(yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns, yyDollar[2].token) + yyDollar[1].node.(*ast.ParserSeparatedList).Items = append(yyDollar[1].node.(*ast.ParserSeparatedList).Items, yyDollar[3].node) - yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) + yyVAL.node = yyDollar[1].node } case 110: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:675 +// line internal/php7/php7.y:690 { - yyVAL.list = []ast.Vertex{yyDollar[1].node} + yyVAL.node = &ast.ParserSeparatedList{ + Items: []ast.Vertex{yyDollar[1].node}, + } } case 111: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:682 +// line internal/php7/php7.y:699 { - yyDollar[1].list[len(yyDollar[1].list)-1].(*ast.StmtUseDeclaration).CommaTkn = yyDollar[2].token + yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns = append(yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns, yyDollar[2].token) + yyDollar[1].node.(*ast.ParserSeparatedList).Items = append(yyDollar[1].node.(*ast.ParserSeparatedList).Items, yyDollar[3].node) - yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) + yyVAL.node = yyDollar[1].node } case 112: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:688 +// line internal/php7/php7.y:706 { - yyVAL.list = []ast.Vertex{yyDollar[1].node} + yyVAL.node = &ast.ParserSeparatedList{ + Items: []ast.Vertex{yyDollar[1].node}, + } } case 113: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:695 +// line internal/php7/php7.y:715 { - yyDollar[1].list[len(yyDollar[1].list)-1].(*ast.StmtUseDeclaration).CommaTkn = yyDollar[2].token + yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns = append(yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns, yyDollar[2].token) + yyDollar[1].node.(*ast.ParserSeparatedList).Items = append(yyDollar[1].node.(*ast.ParserSeparatedList).Items, yyDollar[3].node) - yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) + yyVAL.node = yyDollar[1].node } case 114: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:701 +// line internal/php7/php7.y:722 { - yyVAL.list = []ast.Vertex{yyDollar[1].node} + yyVAL.node = &ast.ParserSeparatedList{ + Items: []ast.Vertex{yyDollar[1].node}, + } } case 115: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:708 +// line internal/php7/php7.y:731 { yyVAL.node = yyDollar[1].node } case 116: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:712 +// line internal/php7/php7.y:735 { decl := yyDollar[2].node.(*ast.StmtUseDeclaration) decl.Type = yyDollar[1].node @@ -3016,33 +3041,35 @@ yydefault: } case 117: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:723 +// line internal/php7/php7.y:746 { yyVAL.node = &ast.StmtUseDeclaration{ Node: ast.Node{ - Position: position.NewNodeListPosition(yyDollar[1].list), + Position: position.NewNodeListPosition(yyDollar[1].node.(*ast.ParserSeparatedList).Items), }, Use: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition(yyDollar[1].list), + Position: position.NewNodeListPosition(yyDollar[1].node.(*ast.ParserSeparatedList).Items), }, - Parts: yyDollar[1].list, + Parts: yyDollar[1].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns, }, } } case 118: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:737 +// line internal/php7/php7.y:761 { yyVAL.node = &ast.StmtUseDeclaration{ Node: ast.Node{ - Position: position.NewNodeListTokenPosition(yyDollar[1].list, yyDollar[3].token), + Position: position.NewNodeListTokenPosition(yyDollar[1].node.(*ast.ParserSeparatedList).Items, yyDollar[3].token), }, Use: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition(yyDollar[1].list), + Position: position.NewNodeListPosition(yyDollar[1].node.(*ast.ParserSeparatedList).Items), }, - Parts: yyDollar[1].list, + Parts: yyDollar[1].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns, }, AsTkn: yyDollar[2].token, Alias: &ast.Identifier{ @@ -3056,13 +3083,13 @@ yydefault: } case 119: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:762 +// line internal/php7/php7.y:787 { yyVAL.node = yyDollar[1].node } case 120: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:766 +// line internal/php7/php7.y:791 { decl := yyDollar[2].node.(*ast.StmtUseDeclaration) decl.NsSeparatorTkn = yyDollar[1].token @@ -3072,7 +3099,7 @@ yydefault: } case 121: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:777 +// line internal/php7/php7.y:802 { yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns = append(yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns, yyDollar[2].token) yyDollar[1].node.(*ast.ParserSeparatedList).Items = append(yyDollar[1].node.(*ast.ParserSeparatedList).Items, yyDollar[3].node) @@ -3081,7 +3108,7 @@ yydefault: } case 122: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:784 +// line internal/php7/php7.y:809 { yyVAL.node = &ast.ParserSeparatedList{ Items: []ast.Vertex{yyDollar[1].node}, @@ -3089,7 +3116,7 @@ yydefault: } case 123: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:793 +// line internal/php7/php7.y:818 { if yyDollar[2].node != nil { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) @@ -3097,50 +3124,50 @@ yydefault: } case 124: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:799 +// line internal/php7/php7.y:824 { yyVAL.list = []ast.Vertex{} } case 125: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:806 +// line internal/php7/php7.y:831 { // error yyVAL.node = nil } case 126: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:811 +// line internal/php7/php7.y:836 { yyVAL.node = yyDollar[1].node } case 127: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:815 +// line internal/php7/php7.y:840 { yyVAL.node = yyDollar[1].node } case 128: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:819 +// line internal/php7/php7.y:844 { yyVAL.node = yyDollar[1].node } case 129: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:823 +// line internal/php7/php7.y:848 { yyVAL.node = yyDollar[1].node } case 130: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:827 +// line internal/php7/php7.y:852 { yyVAL.node = yyDollar[1].node } case 131: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:831 +// line internal/php7/php7.y:856 { yyVAL.node = &ast.StmtHaltCompiler{ Node: ast.Node{ @@ -3154,7 +3181,7 @@ yydefault: } case 132: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:845 +// line internal/php7/php7.y:870 { yyVAL.node = &ast.StmtStmtList{ Node: ast.Node{ @@ -3167,19 +3194,19 @@ yydefault: } case 133: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:856 +// line internal/php7/php7.y:881 { yyVAL.node = yyDollar[1].node } case 134: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:860 +// line internal/php7/php7.y:885 { yyVAL.node = yyDollar[1].node } case 135: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php7/php7.y:864 +// line internal/php7/php7.y:889 { yyDollar[5].node.(*ast.StmtWhile).WhileTkn = yyDollar[1].token yyDollar[5].node.(*ast.StmtWhile).OpenParenthesisTkn = yyDollar[2].token @@ -3191,7 +3218,7 @@ yydefault: } case 136: yyDollar = yyS[yypt-7 : yypt+1] - // line internal/php7/php7.y:874 +// line internal/php7/php7.y:899 { yyVAL.node = &ast.StmtDo{ Node: ast.Node{ @@ -3208,7 +3235,7 @@ yydefault: } case 137: yyDollar = yyS[yypt-9 : yypt+1] - // line internal/php7/php7.y:889 +// line internal/php7/php7.y:914 { yyDollar[9].node.(*ast.StmtFor).ForTkn = yyDollar[1].token yyDollar[9].node.(*ast.StmtFor).OpenParenthesisTkn = yyDollar[2].token @@ -3227,7 +3254,7 @@ yydefault: } case 138: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php7/php7.y:906 +// line internal/php7/php7.y:931 { yyDollar[5].node.(*ast.StmtSwitch).SwitchTkn = yyDollar[1].token yyDollar[5].node.(*ast.StmtSwitch).OpenParenthesisTkn = yyDollar[2].token @@ -3239,7 +3266,7 @@ yydefault: } case 139: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:916 +// line internal/php7/php7.y:941 { yyVAL.node = &ast.StmtBreak{ Node: ast.Node{ @@ -3252,7 +3279,7 @@ yydefault: } case 140: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:927 +// line internal/php7/php7.y:952 { yyVAL.node = &ast.StmtContinue{ Node: ast.Node{ @@ -3265,7 +3292,7 @@ yydefault: } case 141: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:938 +// line internal/php7/php7.y:963 { yyVAL.node = &ast.StmtReturn{ Node: ast.Node{ @@ -3278,7 +3305,7 @@ yydefault: } case 142: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:949 +// line internal/php7/php7.y:974 { yyDollar[2].node.(*ast.StmtGlobal).GlobalTkn = yyDollar[1].token yyDollar[2].node.(*ast.StmtGlobal).SemiColonTkn = yyDollar[3].token @@ -3288,7 +3315,7 @@ yydefault: } case 143: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:957 +// line internal/php7/php7.y:982 { yyDollar[2].node.(*ast.StmtStatic).StaticTkn = yyDollar[1].token yyDollar[2].node.(*ast.StmtStatic).SemiColonTkn = yyDollar[3].token @@ -3298,7 +3325,7 @@ yydefault: } case 144: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:965 +// line internal/php7/php7.y:990 { yyDollar[2].node.(*ast.StmtEcho).EchoTkn = yyDollar[1].token yyDollar[2].node.(*ast.StmtEcho).SemiColonTkn = yyDollar[3].token @@ -3308,7 +3335,7 @@ yydefault: } case 145: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:973 +// line internal/php7/php7.y:998 { yyVAL.node = &ast.StmtInlineHtml{ Node: ast.Node{ @@ -3320,7 +3347,7 @@ yydefault: } case 146: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:983 +// line internal/php7/php7.y:1008 { yyVAL.node = &ast.StmtExpression{ Node: ast.Node{ @@ -3332,7 +3359,7 @@ yydefault: } case 147: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php7/php7.y:993 +// line internal/php7/php7.y:1018 { yyDollar[3].node.(*ast.StmtUnset).UnsetTkn = yyDollar[1].token yyDollar[3].node.(*ast.StmtUnset).OpenParenthesisTkn = yyDollar[2].token @@ -3345,7 +3372,7 @@ yydefault: } case 148: yyDollar = yyS[yypt-7 : yypt+1] - // line internal/php7/php7.y:1004 +// line internal/php7/php7.y:1029 { yyDollar[7].node.(*ast.StmtForeach).ForeachTkn = yyDollar[1].token yyDollar[7].node.(*ast.StmtForeach).OpenParenthesisTkn = yyDollar[2].token @@ -3359,7 +3386,7 @@ yydefault: } case 149: yyDollar = yyS[yypt-9 : yypt+1] - // line internal/php7/php7.y:1016 +// line internal/php7/php7.y:1041 { yyDollar[9].node.(*ast.StmtForeach).ForeachTkn = yyDollar[1].token yyDollar[9].node.(*ast.StmtForeach).OpenParenthesisTkn = yyDollar[2].token @@ -3375,7 +3402,7 @@ yydefault: } case 150: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php7/php7.y:1030 +// line internal/php7/php7.y:1055 { yyDollar[5].node.(*ast.StmtDeclare).DeclareTkn = yyDollar[1].token yyDollar[5].node.(*ast.StmtDeclare).OpenParenthesisTkn = yyDollar[2].token @@ -3388,7 +3415,7 @@ yydefault: } case 151: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:1041 +// line internal/php7/php7.y:1066 { yyVAL.node = &ast.StmtNop{ Node: ast.Node{ @@ -3399,7 +3426,7 @@ yydefault: } case 152: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php7/php7.y:1050 +// line internal/php7/php7.y:1075 { yyVAL.node = &ast.StmtTry{ TryTkn: yyDollar[1].token, @@ -3418,7 +3445,7 @@ yydefault: } case 153: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:1067 +// line internal/php7/php7.y:1092 { yyVAL.node = &ast.StmtThrow{ Node: ast.Node{ @@ -3431,7 +3458,7 @@ yydefault: } case 154: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:1078 +// line internal/php7/php7.y:1103 { yyVAL.node = &ast.StmtGoto{ Node: ast.Node{ @@ -3450,7 +3477,7 @@ yydefault: } case 155: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:1095 +// line internal/php7/php7.y:1120 { yyVAL.node = &ast.StmtLabel{ Node: ast.Node{ @@ -3468,13 +3495,13 @@ yydefault: } case 156: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:1113 +// line internal/php7/php7.y:1138 { yyVAL.list = []ast.Vertex{} } case 157: yyDollar = yyS[yypt-9 : yypt+1] - // line internal/php7/php7.y:1117 +// line internal/php7/php7.y:1142 { catch := yyDollar[4].node.(*ast.StmtCatch) catch.CatchTkn = yyDollar[2].token @@ -3501,7 +3528,7 @@ yydefault: } case 158: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:1144 +// line internal/php7/php7.y:1169 { yyVAL.node = &ast.StmtCatch{ Types: []ast.Vertex{yyDollar[1].node}, @@ -3509,7 +3536,7 @@ yydefault: } case 159: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:1150 +// line internal/php7/php7.y:1175 { yyDollar[1].node.(*ast.StmtCatch).SeparatorTkns = append(yyDollar[1].node.(*ast.StmtCatch).SeparatorTkns, yyDollar[2].token) yyDollar[1].node.(*ast.StmtCatch).Types = append(yyDollar[1].node.(*ast.StmtCatch).Types, yyDollar[3].node) @@ -3518,13 +3545,13 @@ yydefault: } case 160: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:1160 +// line internal/php7/php7.y:1185 { yyVAL.node = nil } case 161: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:1164 +// line internal/php7/php7.y:1189 { yyVAL.node = &ast.StmtFinally{ Node: ast.Node{ @@ -3538,7 +3565,7 @@ yydefault: } case 162: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:1179 +// line internal/php7/php7.y:1204 { yyVAL.node = &ast.StmtUnset{ Vars: []ast.Vertex{yyDollar[1].node}, @@ -3546,7 +3573,7 @@ yydefault: } case 163: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:1185 +// line internal/php7/php7.y:1210 { yyDollar[1].node.(*ast.StmtUnset).Vars = append(yyDollar[1].node.(*ast.StmtUnset).Vars, yyDollar[3].node) yyDollar[1].node.(*ast.StmtUnset).SeparatorTkns = append(yyDollar[1].node.(*ast.StmtUnset).SeparatorTkns, yyDollar[2].token) @@ -3555,13 +3582,13 @@ yydefault: } case 164: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:1195 +// line internal/php7/php7.y:1220 { yyVAL.node = yyDollar[1].node } case 165: yyDollar = yyS[yypt-11 : yypt+1] - // line internal/php7/php7.y:1202 +// line internal/php7/php7.y:1227 { yyVAL.node = &ast.StmtFunction{ Node: ast.Node{ @@ -3589,31 +3616,31 @@ yydefault: } case 166: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:1231 +// line internal/php7/php7.y:1256 { yyVAL.token = nil } case 167: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:1235 +// line internal/php7/php7.y:1260 { yyVAL.token = yyDollar[1].token } case 168: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:1242 +// line internal/php7/php7.y:1267 { yyVAL.token = nil } case 169: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:1246 +// line internal/php7/php7.y:1271 { yyVAL.token = yyDollar[1].token } case 170: yyDollar = yyS[yypt-9 : yypt+1] - // line internal/php7/php7.y:1253 +// line internal/php7/php7.y:1278 { yyVAL.node = &ast.StmtClass{ Node: ast.Node{ @@ -3637,7 +3664,7 @@ yydefault: } case 171: yyDollar = yyS[yypt-8 : yypt+1] - // line internal/php7/php7.y:1275 +// line internal/php7/php7.y:1300 { yyVAL.node = &ast.StmtClass{ Node: ast.Node{ @@ -3660,19 +3687,19 @@ yydefault: } case 172: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:1299 +// line internal/php7/php7.y:1324 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 173: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:1303 +// line internal/php7/php7.y:1328 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 174: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:1310 +// line internal/php7/php7.y:1335 { yyVAL.node = &ast.Identifier{ Node: ast.Node{ @@ -3684,7 +3711,7 @@ yydefault: } case 175: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:1320 +// line internal/php7/php7.y:1345 { yyVAL.node = &ast.Identifier{ Node: ast.Node{ @@ -3696,7 +3723,7 @@ yydefault: } case 176: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php7/php7.y:1333 +// line internal/php7/php7.y:1358 { yyVAL.node = &ast.StmtTrait{ Node: ast.Node{ @@ -3717,7 +3744,7 @@ yydefault: } case 177: yyDollar = yyS[yypt-7 : yypt+1] - // line internal/php7/php7.y:1355 +// line internal/php7/php7.y:1380 { yyVAL.node = &ast.StmtInterface{ Node: ast.Node{ @@ -3739,13 +3766,13 @@ yydefault: } case 178: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:1378 +// line internal/php7/php7.y:1403 { yyVAL.node = nil } case 179: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:1382 +// line internal/php7/php7.y:1407 { yyVAL.node = &ast.StmtClassExtends{ Node: ast.Node{ @@ -3757,13 +3784,13 @@ yydefault: } case 180: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:1395 +// line internal/php7/php7.y:1420 { yyVAL.node = nil } case 181: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:1399 +// line internal/php7/php7.y:1424 { yyVAL.node = &ast.StmtInterfaceExtends{ Node: ast.Node{ @@ -3776,13 +3803,13 @@ yydefault: } case 182: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:1413 +// line internal/php7/php7.y:1438 { yyVAL.node = nil } case 183: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:1417 +// line internal/php7/php7.y:1442 { yyVAL.node = &ast.StmtClassImplements{ Node: ast.Node{ @@ -3795,13 +3822,13 @@ yydefault: } case 184: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:1431 +// line internal/php7/php7.y:1456 { yyVAL.node = yyDollar[1].node } case 185: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:1435 +// line internal/php7/php7.y:1460 { yyVAL.node = &ast.ExprReference{ Node: ast.Node{ @@ -3813,7 +3840,7 @@ yydefault: } case 186: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:1445 +// line internal/php7/php7.y:1470 { yyVAL.node = &ast.ExprList{ Node: ast.Node{ @@ -3828,7 +3855,7 @@ yydefault: } case 187: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:1458 +// line internal/php7/php7.y:1483 { yyVAL.node = &ast.ExprList{ Node: ast.Node{ @@ -3842,7 +3869,7 @@ yydefault: } case 188: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:1473 +// line internal/php7/php7.y:1498 { yyVAL.node = &ast.StmtFor{ Node: ast.Node{ @@ -3853,7 +3880,7 @@ yydefault: } case 189: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:1482 +// line internal/php7/php7.y:1507 { yyVAL.node = &ast.StmtFor{ Node: ast.Node{ @@ -3873,7 +3900,7 @@ yydefault: } case 190: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:1503 +// line internal/php7/php7.y:1528 { yyVAL.node = &ast.StmtForeach{ Node: ast.Node{ @@ -3884,7 +3911,7 @@ yydefault: } case 191: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:1512 +// line internal/php7/php7.y:1537 { yyVAL.node = &ast.StmtForeach{ Node: ast.Node{ @@ -3904,7 +3931,7 @@ yydefault: } case 192: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:1533 +// line internal/php7/php7.y:1558 { yyVAL.node = &ast.StmtDeclare{ Node: ast.Node{ @@ -3915,7 +3942,7 @@ yydefault: } case 193: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:1542 +// line internal/php7/php7.y:1567 { yyVAL.node = &ast.StmtDeclare{ Node: ast.Node{ @@ -3935,7 +3962,7 @@ yydefault: } case 194: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:1563 +// line internal/php7/php7.y:1588 { yyVAL.node = &ast.StmtSwitch{ Node: ast.Node{ @@ -3948,7 +3975,7 @@ yydefault: } case 195: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:1574 +// line internal/php7/php7.y:1599 { yyVAL.node = &ast.StmtSwitch{ Node: ast.Node{ @@ -3962,7 +3989,7 @@ yydefault: } case 196: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:1586 +// line internal/php7/php7.y:1611 { yyVAL.node = &ast.StmtSwitch{ Node: ast.Node{ @@ -3977,7 +4004,7 @@ yydefault: } case 197: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php7/php7.y:1599 +// line internal/php7/php7.y:1624 { yyVAL.node = &ast.StmtSwitch{ Node: ast.Node{ @@ -3993,13 +4020,13 @@ yydefault: } case 198: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:1616 +// line internal/php7/php7.y:1641 { yyVAL.list = nil } case 199: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php7/php7.y:1620 +// line internal/php7/php7.y:1645 { yyVAL.list = append(yyDollar[1].list, &ast.StmtCase{ Node: ast.Node{ @@ -4013,7 +4040,7 @@ yydefault: } case 200: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:1632 +// line internal/php7/php7.y:1657 { yyVAL.list = append(yyDollar[1].list, &ast.StmtDefault{ Node: ast.Node{ @@ -4026,19 +4053,19 @@ yydefault: } case 201: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:1646 +// line internal/php7/php7.y:1671 { yyVAL.token = yyDollar[1].token } case 202: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:1650 +// line internal/php7/php7.y:1675 { yyVAL.token = yyDollar[1].token } case 203: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:1657 +// line internal/php7/php7.y:1682 { yyVAL.node = &ast.StmtWhile{ Node: ast.Node{ @@ -4049,7 +4076,7 @@ yydefault: } case 204: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:1666 +// line internal/php7/php7.y:1691 { yyVAL.node = &ast.StmtWhile{ Node: ast.Node{ @@ -4069,7 +4096,7 @@ yydefault: } case 205: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php7/php7.y:1687 +// line internal/php7/php7.y:1712 { yyVAL.node = &ast.StmtIf{ Node: ast.Node{ @@ -4084,7 +4111,7 @@ yydefault: } case 206: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php7/php7.y:1700 +// line internal/php7/php7.y:1725 { yyDollar[1].node.(*ast.StmtIf).ElseIf = append(yyDollar[1].node.(*ast.StmtIf).ElseIf, &ast.StmtElseIf{ Node: ast.Node{ @@ -4103,13 +4130,13 @@ yydefault: } case 207: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:1720 +// line internal/php7/php7.y:1745 { yyVAL.node = yyDollar[1].node } case 208: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:1724 +// line internal/php7/php7.y:1749 { yyDollar[1].node.(*ast.StmtIf).Else = &ast.StmtElse{ Node: ast.Node{ @@ -4125,7 +4152,7 @@ yydefault: } case 209: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php7/php7.y:1741 +// line internal/php7/php7.y:1766 { yyVAL.node = &ast.StmtIf{ Node: ast.Node{ @@ -4147,7 +4174,7 @@ yydefault: } case 210: yyDollar = yyS[yypt-7 : yypt+1] - // line internal/php7/php7.y:1761 +// line internal/php7/php7.y:1786 { yyDollar[1].node.(*ast.StmtIf).ElseIf = append(yyDollar[1].node.(*ast.StmtIf).ElseIf, &ast.StmtElseIf{ Node: ast.Node{ @@ -4171,7 +4198,7 @@ yydefault: } case 211: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:1786 +// line internal/php7/php7.y:1811 { yyDollar[1].node.(*ast.StmtIf).EndIfTkn = yyDollar[2].token yyDollar[1].node.(*ast.StmtIf).SemiColonTkn = yyDollar[3].token @@ -4181,7 +4208,7 @@ yydefault: } case 212: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php7/php7.y:1794 +// line internal/php7/php7.y:1819 { yyDollar[1].node.(*ast.StmtIf).Else = &ast.StmtElse{ Node: ast.Node{ @@ -4205,19 +4232,19 @@ yydefault: } case 213: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:1819 +// line internal/php7/php7.y:1844 { yyVAL.node = yyDollar[1].node } case 214: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:1823 +// line internal/php7/php7.y:1848 { yyVAL.node = &ast.ParserSeparatedList{} } case 215: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:1830 +// line internal/php7/php7.y:1855 { yyVAL.node = &ast.ParserSeparatedList{ Items: []ast.Vertex{yyDollar[1].node}, @@ -4225,7 +4252,7 @@ yydefault: } case 216: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:1836 +// line internal/php7/php7.y:1861 { yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns = append(yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns, yyDollar[2].token) yyDollar[1].node.(*ast.ParserSeparatedList).Items = append(yyDollar[1].node.(*ast.ParserSeparatedList).Items, yyDollar[3].node) @@ -4234,7 +4261,7 @@ yydefault: } case 217: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:1846 +// line internal/php7/php7.y:1871 { pos := position.NewTokenPosition(yyDollar[4].token) if yyDollar[1].node != nil { @@ -4268,7 +4295,7 @@ yydefault: } case 218: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php7/php7.y:1878 +// line internal/php7/php7.y:1903 { pos := position.NewTokenNodePosition(yyDollar[4].token, yyDollar[6].node) if yyDollar[1].node != nil { @@ -4304,25 +4331,25 @@ yydefault: } case 219: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:1915 +// line internal/php7/php7.y:1940 { yyVAL.node = nil } case 220: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:1919 +// line internal/php7/php7.y:1944 { yyVAL.node = yyDollar[1].node } case 221: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:1926 +// line internal/php7/php7.y:1951 { yyVAL.node = yyDollar[1].node } case 222: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:1930 +// line internal/php7/php7.y:1955 { yyVAL.node = &ast.Nullable{ Node: ast.Node{ @@ -4334,7 +4361,7 @@ yydefault: } case 223: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:1943 +// line internal/php7/php7.y:1968 { yyVAL.node = &ast.Identifier{ Node: ast.Node{ @@ -4346,7 +4373,7 @@ yydefault: } case 224: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:1953 +// line internal/php7/php7.y:1978 { yyVAL.node = &ast.Identifier{ Node: ast.Node{ @@ -4358,19 +4385,19 @@ yydefault: } case 225: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:1963 +// line internal/php7/php7.y:1988 { yyVAL.node = yyDollar[1].node } case 226: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:1970 +// line internal/php7/php7.y:1995 { yyVAL.node = nil } case 227: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:1974 +// line internal/php7/php7.y:1999 { yyVAL.node = &ast.ReturnType{ ColonTkn: yyDollar[1].token, @@ -4379,7 +4406,7 @@ yydefault: } case 228: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:1984 +// line internal/php7/php7.y:2009 { yyVAL.node = &ast.ArgumentList{ Node: ast.Node{ @@ -4391,7 +4418,7 @@ yydefault: } case 229: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:1994 +// line internal/php7/php7.y:2019 { argumentList := yyDollar[2].node.(*ast.ArgumentList) argumentList.Position = position.NewTokensPosition(yyDollar[1].token, yyDollar[4].token) @@ -4403,7 +4430,7 @@ yydefault: } case 230: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2007 +// line internal/php7/php7.y:2032 { yyVAL.node = &ast.ArgumentList{ Arguments: []ast.Vertex{yyDollar[1].node}, @@ -4411,7 +4438,7 @@ yydefault: } case 231: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2013 +// line internal/php7/php7.y:2038 { yyDollar[1].node.(*ast.ArgumentList).SeparatorTkns = append(yyDollar[1].node.(*ast.ArgumentList).SeparatorTkns, yyDollar[2].token) yyDollar[1].node.(*ast.ArgumentList).Arguments = append(yyDollar[1].node.(*ast.ArgumentList).Arguments, yyDollar[3].node) @@ -4420,7 +4447,7 @@ yydefault: } case 232: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2023 +// line internal/php7/php7.y:2048 { yyVAL.node = &ast.Argument{ Node: ast.Node{ @@ -4431,7 +4458,7 @@ yydefault: } case 233: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:2032 +// line internal/php7/php7.y:2057 { yyVAL.node = &ast.Argument{ Node: ast.Node{ @@ -4443,7 +4470,7 @@ yydefault: } case 234: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2045 +// line internal/php7/php7.y:2070 { yyDollar[1].node.(*ast.StmtGlobal).Vars = append(yyDollar[1].node.(*ast.StmtGlobal).Vars, yyDollar[3].node) yyDollar[1].node.(*ast.StmtGlobal).SeparatorTkns = append(yyDollar[1].node.(*ast.StmtGlobal).SeparatorTkns, yyDollar[2].token) @@ -4452,7 +4479,7 @@ yydefault: } case 235: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2052 +// line internal/php7/php7.y:2077 { yyVAL.node = &ast.StmtGlobal{ Vars: []ast.Vertex{yyDollar[1].node}, @@ -4460,13 +4487,13 @@ yydefault: } case 236: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2061 +// line internal/php7/php7.y:2086 { yyVAL.node = yyDollar[1].node } case 237: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2068 +// line internal/php7/php7.y:2093 { yyDollar[1].node.(*ast.StmtStatic).Vars = append(yyDollar[1].node.(*ast.StmtStatic).Vars, yyDollar[3].node) yyDollar[1].node.(*ast.StmtStatic).SeparatorTkns = append(yyDollar[1].node.(*ast.StmtStatic).SeparatorTkns, yyDollar[2].token) @@ -4475,7 +4502,7 @@ yydefault: } case 238: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2075 +// line internal/php7/php7.y:2100 { yyVAL.node = &ast.StmtStatic{ Vars: []ast.Vertex{yyDollar[1].node}, @@ -4483,7 +4510,7 @@ yydefault: } case 239: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2084 +// line internal/php7/php7.y:2109 { yyVAL.node = &ast.StmtStaticVar{ @@ -4506,7 +4533,7 @@ yydefault: } case 240: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2105 +// line internal/php7/php7.y:2130 { yyVAL.node = &ast.StmtStaticVar{ Node: ast.Node{ @@ -4530,19 +4557,19 @@ yydefault: } case 241: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:2130 +// line internal/php7/php7.y:2155 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 242: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:2134 +// line internal/php7/php7.y:2159 { yyVAL.list = []ast.Vertex{} } case 243: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:2141 +// line internal/php7/php7.y:2166 { yyVAL.node = &ast.StmtPropertyList{ Node: ast.Node{ @@ -4557,21 +4584,22 @@ yydefault: } case 244: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:2154 +// line internal/php7/php7.y:2179 { yyVAL.node = &ast.StmtClassConstList{ Node: ast.Node{ Position: position.NewOptionalListTokensPosition(yyDollar[1].list, yyDollar[2].token, yyDollar[4].token), }, - Modifiers: yyDollar[1].list, - ConstTkn: yyDollar[2].token, - Consts: yyDollar[3].list, - SemiColonTkn: yyDollar[4].token, + Modifiers: yyDollar[1].list, + ConstTkn: yyDollar[2].token, + Consts: yyDollar[3].node.(*ast.ParserSeparatedList).Items, + SeparatorTkns: yyDollar[3].node.(*ast.ParserSeparatedList).SeparatorTkns, + SemiColonTkn: yyDollar[4].token, } } case 245: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2166 +// line internal/php7/php7.y:2192 { yyVAL.node = &ast.StmtTraitUse{ Node: ast.Node{ @@ -4585,7 +4613,7 @@ yydefault: } case 246: yyDollar = yyS[yypt-10 : yypt+1] - // line internal/php7/php7.y:2178 +// line internal/php7/php7.y:2204 { pos := position.NewTokenNodePosition(yyDollar[2].token, yyDollar[10].node) if yyDollar[1].list != nil { @@ -4617,7 +4645,7 @@ yydefault: } case 247: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2211 +// line internal/php7/php7.y:2237 { yyVAL.node = &ast.ParserSeparatedList{ Items: []ast.Vertex{yyDollar[1].node}, @@ -4625,7 +4653,7 @@ yydefault: } case 248: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2217 +// line internal/php7/php7.y:2243 { yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns = append(yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns, yyDollar[2].token) yyDollar[1].node.(*ast.ParserSeparatedList).Items = append(yyDollar[1].node.(*ast.ParserSeparatedList).Items, yyDollar[3].node) @@ -4634,7 +4662,7 @@ yydefault: } case 249: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2227 +// line internal/php7/php7.y:2253 { yyVAL.node = &ast.StmtNop{ Node: ast.Node{ @@ -4645,7 +4673,7 @@ yydefault: } case 250: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:2236 +// line internal/php7/php7.y:2262 { yyVAL.node = &ast.StmtTraitAdaptationList{ Node: ast.Node{ @@ -4657,7 +4685,7 @@ yydefault: } case 251: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2246 +// line internal/php7/php7.y:2272 { yyVAL.node = &ast.StmtTraitAdaptationList{ Node: ast.Node{ @@ -4670,19 +4698,19 @@ yydefault: } case 252: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2260 +// line internal/php7/php7.y:2286 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 253: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:2264 +// line internal/php7/php7.y:2290 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 254: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:2271 +// line internal/php7/php7.y:2297 { yyDollar[1].node.(*ast.StmtTraitUsePrecedence).SemiColonTkn = yyDollar[2].token @@ -4690,7 +4718,7 @@ yydefault: } case 255: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:2277 +// line internal/php7/php7.y:2303 { yyDollar[1].node.(*ast.StmtTraitUseAlias).SemiColonTkn = yyDollar[2].token @@ -4698,7 +4726,7 @@ yydefault: } case 256: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2286 +// line internal/php7/php7.y:2312 { yyVAL.node = &ast.StmtTraitUsePrecedence{ Node: ast.Node{ @@ -4712,7 +4740,7 @@ yydefault: } case 257: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2301 +// line internal/php7/php7.y:2327 { yyVAL.node = &ast.StmtTraitUseAlias{ Node: ast.Node{ @@ -4731,7 +4759,7 @@ yydefault: } case 258: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2318 +// line internal/php7/php7.y:2344 { yyVAL.node = &ast.StmtTraitUseAlias{ Node: ast.Node{ @@ -4750,7 +4778,7 @@ yydefault: } case 259: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:2335 +// line internal/php7/php7.y:2361 { yyVAL.node = &ast.StmtTraitUseAlias{ Node: ast.Node{ @@ -4770,7 +4798,7 @@ yydefault: } case 260: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2353 +// line internal/php7/php7.y:2379 { yyVAL.node = &ast.StmtTraitUseAlias{ Node: ast.Node{ @@ -4783,7 +4811,7 @@ yydefault: } case 261: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2367 +// line internal/php7/php7.y:2393 { yyVAL.node = &ast.StmtTraitMethodRef{ Node: ast.Node{ @@ -4800,13 +4828,13 @@ yydefault: } case 262: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2382 +// line internal/php7/php7.y:2408 { yyVAL.node = yyDollar[1].node } case 263: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2389 +// line internal/php7/php7.y:2415 { yyVAL.node = &ast.StmtTraitMethodRef{ Node: ast.Node{ @@ -4825,7 +4853,7 @@ yydefault: } case 264: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2409 +// line internal/php7/php7.y:2435 { yyVAL.node = &ast.StmtNop{ Node: ast.Node{ @@ -4836,7 +4864,7 @@ yydefault: } case 265: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2418 +// line internal/php7/php7.y:2444 { yyVAL.node = &ast.StmtStmtList{ Node: ast.Node{ @@ -4849,13 +4877,13 @@ yydefault: } case 266: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2432 +// line internal/php7/php7.y:2458 { yyVAL.list = yyDollar[1].list } case 267: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2436 +// line internal/php7/php7.y:2462 { yyVAL.list = []ast.Vertex{ &ast.Identifier{ @@ -4869,31 +4897,31 @@ yydefault: } case 268: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:2451 +// line internal/php7/php7.y:2477 { yyVAL.list = nil } case 269: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2455 +// line internal/php7/php7.y:2481 { yyVAL.list = yyDollar[1].list } case 270: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2462 +// line internal/php7/php7.y:2488 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 271: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:2466 +// line internal/php7/php7.y:2492 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 272: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2473 +// line internal/php7/php7.y:2499 { yyVAL.node = &ast.Identifier{ Node: ast.Node{ @@ -4905,7 +4933,7 @@ yydefault: } case 273: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2483 +// line internal/php7/php7.y:2509 { yyVAL.node = &ast.Identifier{ Node: ast.Node{ @@ -4917,7 +4945,7 @@ yydefault: } case 274: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2493 +// line internal/php7/php7.y:2519 { yyVAL.node = &ast.Identifier{ Node: ast.Node{ @@ -4929,7 +4957,7 @@ yydefault: } case 275: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2503 +// line internal/php7/php7.y:2529 { yyVAL.node = &ast.Identifier{ Node: ast.Node{ @@ -4941,7 +4969,7 @@ yydefault: } case 276: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2513 +// line internal/php7/php7.y:2539 { yyVAL.node = &ast.Identifier{ Node: ast.Node{ @@ -4953,7 +4981,7 @@ yydefault: } case 277: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2523 +// line internal/php7/php7.y:2549 { yyVAL.node = &ast.Identifier{ Node: ast.Node{ @@ -4965,7 +4993,7 @@ yydefault: } case 278: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2536 +// line internal/php7/php7.y:2562 { yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns = append(yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns, yyDollar[2].token) yyDollar[1].node.(*ast.ParserSeparatedList).Items = append(yyDollar[1].node.(*ast.ParserSeparatedList).Items, yyDollar[3].node) @@ -4974,7 +5002,7 @@ yydefault: } case 279: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2543 +// line internal/php7/php7.y:2569 { yyVAL.node = &ast.ParserSeparatedList{ Items: []ast.Vertex{yyDollar[1].node}, @@ -4982,7 +5010,7 @@ yydefault: } case 280: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:2552 +// line internal/php7/php7.y:2578 { yyVAL.node = &ast.StmtProperty{ Node: ast.Node{ @@ -5005,7 +5033,7 @@ yydefault: } case 281: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:2573 +// line internal/php7/php7.y:2599 { yyVAL.node = &ast.StmtProperty{ Node: ast.Node{ @@ -5029,21 +5057,24 @@ yydefault: } case 282: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2598 +// line internal/php7/php7.y:2624 { - lastNode(yyDollar[1].list).(*ast.StmtConstant).CommaTkn = yyDollar[2].token + yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns = append(yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns, yyDollar[2].token) + yyDollar[1].node.(*ast.ParserSeparatedList).Items = append(yyDollar[1].node.(*ast.ParserSeparatedList).Items, yyDollar[3].node) - yyVAL.list = append(yyDollar[1].list, yyDollar[3].node) + yyVAL.node = yyDollar[1].node } case 283: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2604 +// line internal/php7/php7.y:2631 { - yyVAL.list = []ast.Vertex{yyDollar[1].node} + yyVAL.node = &ast.ParserSeparatedList{ + Items: []ast.Vertex{yyDollar[1].node}, + } } case 284: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:2611 +// line internal/php7/php7.y:2640 { yyVAL.node = &ast.StmtConstant{ Node: ast.Node{ @@ -5062,7 +5093,7 @@ yydefault: } case 285: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:2631 +// line internal/php7/php7.y:2660 { yyVAL.node = &ast.StmtConstant{ Node: ast.Node{ @@ -5081,7 +5112,7 @@ yydefault: } case 286: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2651 +// line internal/php7/php7.y:2680 { yyDollar[1].node.(*ast.StmtEcho).Exprs = append(yyDollar[1].node.(*ast.StmtEcho).Exprs, yyDollar[3].node) yyDollar[1].node.(*ast.StmtEcho).SeparatorTkns = append(yyDollar[1].node.(*ast.StmtEcho).SeparatorTkns, yyDollar[2].token) @@ -5090,7 +5121,7 @@ yydefault: } case 287: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2658 +// line internal/php7/php7.y:2687 { yyVAL.node = &ast.StmtEcho{ Exprs: []ast.Vertex{yyDollar[1].node}, @@ -5098,25 +5129,25 @@ yydefault: } case 288: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2667 +// line internal/php7/php7.y:2696 { yyVAL.node = yyDollar[1].node } case 289: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:2674 +// line internal/php7/php7.y:2703 { yyVAL.node = &ast.ParserSeparatedList{} } case 290: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2678 +// line internal/php7/php7.y:2707 { yyVAL.node = yyDollar[1].node } case 291: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2685 +// line internal/php7/php7.y:2714 { yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns = append(yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns, yyDollar[2].token) yyDollar[1].node.(*ast.ParserSeparatedList).Items = append(yyDollar[1].node.(*ast.ParserSeparatedList).Items, yyDollar[3].node) @@ -5125,7 +5156,7 @@ yydefault: } case 292: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:2692 +// line internal/php7/php7.y:2721 { yyVAL.node = &ast.ParserSeparatedList{ Items: []ast.Vertex{yyDollar[1].node}, @@ -5133,7 +5164,7 @@ yydefault: } case 293: yyDollar = yyS[yypt-8 : yypt+1] - // line internal/php7/php7.y:2701 +// line internal/php7/php7.y:2730 { yyVAL.node = &ast.StmtClass{ Node: ast.Node{ @@ -5153,7 +5184,7 @@ yydefault: } case 294: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2722 +// line internal/php7/php7.y:2751 { if yyDollar[3].node != nil { yyVAL.node = &ast.ExprNew{ @@ -5179,7 +5210,7 @@ yydefault: } case 295: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:2746 +// line internal/php7/php7.y:2775 { yyVAL.node = &ast.ExprNew{ Node: ast.Node{ @@ -5191,7 +5222,7 @@ yydefault: } case 296: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php7/php7.y:2759 +// line internal/php7/php7.y:2788 { yyVAL.node = &ast.ExprAssign{ Node: ast.Node{ @@ -5213,7 +5244,7 @@ yydefault: } case 297: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php7/php7.y:2779 +// line internal/php7/php7.y:2808 { yyVAL.node = &ast.ExprAssign{ Node: ast.Node{ @@ -5234,7 +5265,7 @@ yydefault: } case 298: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2798 +// line internal/php7/php7.y:2827 { yyVAL.node = &ast.ExprAssign{ Node: ast.Node{ @@ -5247,7 +5278,7 @@ yydefault: } case 299: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:2809 +// line internal/php7/php7.y:2838 { yyVAL.node = &ast.ExprAssignReference{ Node: ast.Node{ @@ -5261,7 +5292,7 @@ yydefault: } case 300: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:2821 +// line internal/php7/php7.y:2850 { yyVAL.node = &ast.ExprClone{ Node: ast.Node{ @@ -5273,7 +5304,7 @@ yydefault: } case 301: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2831 +// line internal/php7/php7.y:2860 { yyVAL.node = &ast.ExprAssignPlus{ Node: ast.Node{ @@ -5286,7 +5317,7 @@ yydefault: } case 302: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2842 +// line internal/php7/php7.y:2871 { yyVAL.node = &ast.ExprAssignMinus{ Node: ast.Node{ @@ -5299,7 +5330,7 @@ yydefault: } case 303: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2853 +// line internal/php7/php7.y:2882 { yyVAL.node = &ast.ExprAssignMul{ Node: ast.Node{ @@ -5312,7 +5343,7 @@ yydefault: } case 304: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2864 +// line internal/php7/php7.y:2893 { yyVAL.node = &ast.ExprAssignPow{ Node: ast.Node{ @@ -5325,7 +5356,7 @@ yydefault: } case 305: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2875 +// line internal/php7/php7.y:2904 { yyVAL.node = &ast.ExprAssignDiv{ Node: ast.Node{ @@ -5338,7 +5369,7 @@ yydefault: } case 306: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2886 +// line internal/php7/php7.y:2915 { yyVAL.node = &ast.ExprAssignConcat{ Node: ast.Node{ @@ -5351,7 +5382,7 @@ yydefault: } case 307: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2897 +// line internal/php7/php7.y:2926 { yyVAL.node = &ast.ExprAssignMod{ Node: ast.Node{ @@ -5364,7 +5395,7 @@ yydefault: } case 308: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2908 +// line internal/php7/php7.y:2937 { yyVAL.node = &ast.ExprAssignBitwiseAnd{ Node: ast.Node{ @@ -5377,7 +5408,7 @@ yydefault: } case 309: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2919 +// line internal/php7/php7.y:2948 { yyVAL.node = &ast.ExprAssignBitwiseOr{ Node: ast.Node{ @@ -5390,7 +5421,7 @@ yydefault: } case 310: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2930 +// line internal/php7/php7.y:2959 { yyVAL.node = &ast.ExprAssignBitwiseXor{ Node: ast.Node{ @@ -5403,7 +5434,7 @@ yydefault: } case 311: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2941 +// line internal/php7/php7.y:2970 { yyVAL.node = &ast.ExprAssignShiftLeft{ Node: ast.Node{ @@ -5416,7 +5447,7 @@ yydefault: } case 312: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2952 +// line internal/php7/php7.y:2981 { yyVAL.node = &ast.ExprAssignShiftRight{ Node: ast.Node{ @@ -5429,7 +5460,7 @@ yydefault: } case 313: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:2963 +// line internal/php7/php7.y:2992 { yyVAL.node = &ast.ExprAssignCoalesce{ Node: ast.Node{ @@ -5442,7 +5473,7 @@ yydefault: } case 314: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:2974 +// line internal/php7/php7.y:3003 { yyVAL.node = &ast.ExprPostInc{ Node: ast.Node{ @@ -5454,7 +5485,7 @@ yydefault: } case 315: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:2984 +// line internal/php7/php7.y:3013 { yyVAL.node = &ast.ExprPreInc{ Node: ast.Node{ @@ -5466,7 +5497,7 @@ yydefault: } case 316: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:2994 +// line internal/php7/php7.y:3023 { yyVAL.node = &ast.ExprPostDec{ Node: ast.Node{ @@ -5478,7 +5509,7 @@ yydefault: } case 317: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:3004 +// line internal/php7/php7.y:3033 { yyVAL.node = &ast.ExprPreDec{ Node: ast.Node{ @@ -5490,7 +5521,7 @@ yydefault: } case 318: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3014 +// line internal/php7/php7.y:3043 { yyVAL.node = &ast.ExprBinaryBooleanOr{ Node: ast.Node{ @@ -5503,7 +5534,7 @@ yydefault: } case 319: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3025 +// line internal/php7/php7.y:3054 { yyVAL.node = &ast.ExprBinaryBooleanAnd{ Node: ast.Node{ @@ -5516,7 +5547,7 @@ yydefault: } case 320: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3036 +// line internal/php7/php7.y:3065 { yyVAL.node = &ast.ExprBinaryLogicalOr{ Node: ast.Node{ @@ -5529,7 +5560,7 @@ yydefault: } case 321: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3047 +// line internal/php7/php7.y:3076 { yyVAL.node = &ast.ExprBinaryLogicalAnd{ Node: ast.Node{ @@ -5542,7 +5573,7 @@ yydefault: } case 322: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3058 +// line internal/php7/php7.y:3087 { yyVAL.node = &ast.ExprBinaryLogicalXor{ Node: ast.Node{ @@ -5555,7 +5586,7 @@ yydefault: } case 323: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3069 +// line internal/php7/php7.y:3098 { yyVAL.node = &ast.ExprBinaryBitwiseOr{ Node: ast.Node{ @@ -5568,7 +5599,7 @@ yydefault: } case 324: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3080 +// line internal/php7/php7.y:3109 { yyVAL.node = &ast.ExprBinaryBitwiseAnd{ Node: ast.Node{ @@ -5581,7 +5612,7 @@ yydefault: } case 325: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3091 +// line internal/php7/php7.y:3120 { yyVAL.node = &ast.ExprBinaryBitwiseXor{ Node: ast.Node{ @@ -5594,7 +5625,7 @@ yydefault: } case 326: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3102 +// line internal/php7/php7.y:3131 { yyVAL.node = &ast.ExprBinaryConcat{ Node: ast.Node{ @@ -5607,7 +5638,7 @@ yydefault: } case 327: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3113 +// line internal/php7/php7.y:3142 { yyVAL.node = &ast.ExprBinaryPlus{ Node: ast.Node{ @@ -5620,7 +5651,7 @@ yydefault: } case 328: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3124 +// line internal/php7/php7.y:3153 { yyVAL.node = &ast.ExprBinaryMinus{ Node: ast.Node{ @@ -5633,7 +5664,7 @@ yydefault: } case 329: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3135 +// line internal/php7/php7.y:3164 { yyVAL.node = &ast.ExprBinaryMul{ Node: ast.Node{ @@ -5646,7 +5677,7 @@ yydefault: } case 330: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3146 +// line internal/php7/php7.y:3175 { yyVAL.node = &ast.ExprBinaryPow{ Node: ast.Node{ @@ -5659,7 +5690,7 @@ yydefault: } case 331: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3157 +// line internal/php7/php7.y:3186 { yyVAL.node = &ast.ExprBinaryDiv{ Node: ast.Node{ @@ -5672,7 +5703,7 @@ yydefault: } case 332: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3168 +// line internal/php7/php7.y:3197 { yyVAL.node = &ast.ExprBinaryMod{ Node: ast.Node{ @@ -5685,7 +5716,7 @@ yydefault: } case 333: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3179 +// line internal/php7/php7.y:3208 { yyVAL.node = &ast.ExprBinaryShiftLeft{ Node: ast.Node{ @@ -5698,7 +5729,7 @@ yydefault: } case 334: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3190 +// line internal/php7/php7.y:3219 { yyVAL.node = &ast.ExprBinaryShiftRight{ Node: ast.Node{ @@ -5711,7 +5742,7 @@ yydefault: } case 335: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:3201 +// line internal/php7/php7.y:3230 { yyVAL.node = &ast.ExprUnaryPlus{ Node: ast.Node{ @@ -5723,7 +5754,7 @@ yydefault: } case 336: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:3211 +// line internal/php7/php7.y:3240 { yyVAL.node = &ast.ExprUnaryMinus{ Node: ast.Node{ @@ -5735,7 +5766,7 @@ yydefault: } case 337: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:3221 +// line internal/php7/php7.y:3250 { yyVAL.node = &ast.ExprBooleanNot{ Node: ast.Node{ @@ -5747,7 +5778,7 @@ yydefault: } case 338: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:3231 +// line internal/php7/php7.y:3260 { yyVAL.node = &ast.ExprBitwiseNot{ Node: ast.Node{ @@ -5759,7 +5790,7 @@ yydefault: } case 339: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3241 +// line internal/php7/php7.y:3270 { yyVAL.node = &ast.ExprBinaryIdentical{ Node: ast.Node{ @@ -5772,7 +5803,7 @@ yydefault: } case 340: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3252 +// line internal/php7/php7.y:3281 { yyVAL.node = &ast.ExprBinaryNotIdentical{ Node: ast.Node{ @@ -5785,7 +5816,7 @@ yydefault: } case 341: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3263 +// line internal/php7/php7.y:3292 { yyVAL.node = &ast.ExprBinaryEqual{ Node: ast.Node{ @@ -5798,7 +5829,7 @@ yydefault: } case 342: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3274 +// line internal/php7/php7.y:3303 { yyVAL.node = &ast.ExprBinaryNotEqual{ Node: ast.Node{ @@ -5811,7 +5842,7 @@ yydefault: } case 343: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3285 +// line internal/php7/php7.y:3314 { yyVAL.node = &ast.ExprBinarySmaller{ Node: ast.Node{ @@ -5824,7 +5855,7 @@ yydefault: } case 344: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3296 +// line internal/php7/php7.y:3325 { yyVAL.node = &ast.ExprBinarySmallerOrEqual{ Node: ast.Node{ @@ -5837,7 +5868,7 @@ yydefault: } case 345: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3307 +// line internal/php7/php7.y:3336 { yyVAL.node = &ast.ExprBinaryGreater{ Node: ast.Node{ @@ -5850,7 +5881,7 @@ yydefault: } case 346: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3318 +// line internal/php7/php7.y:3347 { yyVAL.node = &ast.ExprBinaryGreaterOrEqual{ Node: ast.Node{ @@ -5863,7 +5894,7 @@ yydefault: } case 347: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3329 +// line internal/php7/php7.y:3358 { yyVAL.node = &ast.ExprBinarySpaceship{ Node: ast.Node{ @@ -5876,7 +5907,7 @@ yydefault: } case 348: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3340 +// line internal/php7/php7.y:3369 { yyVAL.node = &ast.ExprInstanceOf{ Node: ast.Node{ @@ -5889,7 +5920,7 @@ yydefault: } case 349: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3351 +// line internal/php7/php7.y:3380 { yyVAL.node = &ast.ParserBrackets{ Node: ast.Node{ @@ -5902,13 +5933,13 @@ yydefault: } case 350: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:3362 +// line internal/php7/php7.y:3391 { yyVAL.node = yyDollar[1].node } case 351: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php7/php7.y:3366 +// line internal/php7/php7.y:3395 { yyVAL.node = &ast.ExprTernary{ Node: ast.Node{ @@ -5923,7 +5954,7 @@ yydefault: } case 352: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:3379 +// line internal/php7/php7.y:3408 { yyVAL.node = &ast.ExprTernary{ Node: ast.Node{ @@ -5937,7 +5968,7 @@ yydefault: } case 353: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3391 +// line internal/php7/php7.y:3420 { yyVAL.node = &ast.ExprBinaryCoalesce{ Node: ast.Node{ @@ -5950,13 +5981,13 @@ yydefault: } case 354: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:3402 +// line internal/php7/php7.y:3431 { yyVAL.node = yyDollar[1].node } case 355: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:3406 +// line internal/php7/php7.y:3435 { yyVAL.node = &ast.ExprCastInt{ Node: ast.Node{ @@ -5968,7 +5999,7 @@ yydefault: } case 356: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:3416 +// line internal/php7/php7.y:3445 { yyVAL.node = &ast.ExprCastDouble{ Node: ast.Node{ @@ -5980,7 +6011,7 @@ yydefault: } case 357: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:3426 +// line internal/php7/php7.y:3455 { yyVAL.node = &ast.ExprCastString{ Node: ast.Node{ @@ -5992,7 +6023,7 @@ yydefault: } case 358: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:3436 +// line internal/php7/php7.y:3465 { yyVAL.node = &ast.ExprCastArray{ Node: ast.Node{ @@ -6004,7 +6035,7 @@ yydefault: } case 359: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:3446 +// line internal/php7/php7.y:3475 { yyVAL.node = &ast.ExprCastObject{ Node: ast.Node{ @@ -6016,7 +6047,7 @@ yydefault: } case 360: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:3456 +// line internal/php7/php7.y:3485 { yyVAL.node = &ast.ExprCastBool{ Node: ast.Node{ @@ -6028,7 +6059,7 @@ yydefault: } case 361: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:3466 +// line internal/php7/php7.y:3495 { yyVAL.node = &ast.ExprCastUnset{ Node: ast.Node{ @@ -6040,7 +6071,7 @@ yydefault: } case 362: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:3476 +// line internal/php7/php7.y:3505 { exit := &ast.ExprExit{ DieTkn: yyDollar[1].token, @@ -6059,7 +6090,7 @@ yydefault: } case 363: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:3493 +// line internal/php7/php7.y:3522 { yyVAL.node = &ast.ExprErrorSuppress{ Node: ast.Node{ @@ -6071,13 +6102,13 @@ yydefault: } case 364: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:3503 +// line internal/php7/php7.y:3532 { yyVAL.node = yyDollar[1].node } case 365: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3507 +// line internal/php7/php7.y:3536 { yyVAL.node = &ast.ExprShellExec{ Node: ast.Node{ @@ -6090,7 +6121,7 @@ yydefault: } case 366: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:3518 +// line internal/php7/php7.y:3547 { yyVAL.node = &ast.ExprPrint{ Node: ast.Node{ @@ -6102,7 +6133,7 @@ yydefault: } case 367: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:3528 +// line internal/php7/php7.y:3557 { yyVAL.node = &ast.ExprYield{ Node: ast.Node{ @@ -6113,7 +6144,7 @@ yydefault: } case 368: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:3537 +// line internal/php7/php7.y:3566 { yyVAL.node = &ast.ExprYield{ Node: ast.Node{ @@ -6125,7 +6156,7 @@ yydefault: } case 369: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:3547 +// line internal/php7/php7.y:3576 { yyVAL.node = &ast.ExprYield{ Node: ast.Node{ @@ -6139,7 +6170,7 @@ yydefault: } case 370: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:3559 +// line internal/php7/php7.y:3588 { yyVAL.node = &ast.ExprYieldFrom{ Node: ast.Node{ @@ -6151,13 +6182,13 @@ yydefault: } case 371: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:3569 +// line internal/php7/php7.y:3598 { yyVAL.node = yyDollar[1].node } case 372: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:3573 +// line internal/php7/php7.y:3602 { switch n := yyDollar[2].node.(type) { case *ast.ExprClosure: @@ -6172,7 +6203,7 @@ yydefault: } case 373: yyDollar = yyS[yypt-11 : yypt+1] - // line internal/php7/php7.y:3589 +// line internal/php7/php7.y:3618 { yyVAL.node = &ast.ExprClosure{ Node: ast.Node{ @@ -6184,7 +6215,7 @@ yydefault: Params: yyDollar[5].node.(*ast.ParserSeparatedList).Items, SeparatorTkns: yyDollar[5].node.(*ast.ParserSeparatedList).SeparatorTkns, CloseParenthesisTkn: yyDollar[6].token, - ClosureUse: yyDollar[7].ClosureUse, + ClosureUse: yyDollar[7].node, ColonTkn: yyDollar[8].node.(*ast.ReturnType).ColonTkn, ReturnType: yyDollar[8].node.(*ast.ReturnType).Type, OpenCurlyBracketTkn: yyDollar[9].token, @@ -6194,7 +6225,7 @@ yydefault: } case 374: yyDollar = yyS[yypt-9 : yypt+1] - // line internal/php7/php7.y:3609 +// line internal/php7/php7.y:3638 { yyVAL.node = &ast.ExprArrowFunction{ Node: ast.Node{ @@ -6214,27 +6245,27 @@ yydefault: } case 376: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:3634 +// line internal/php7/php7.y:3663 { yyVAL.token = nil } case 377: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:3638 +// line internal/php7/php7.y:3667 { yyVAL.token = yyDollar[1].token } case 378: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:3645 +// line internal/php7/php7.y:3674 { - yyVAL.ClosureUse = nil + yyVAL.node = nil } case 379: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:3649 +// line internal/php7/php7.y:3678 { - yyVAL.ClosureUse = &ast.ExprClosureUse{ + yyVAL.node = &ast.ExprClosureUse{ Node: ast.Node{ Position: position.NewTokensPosition(yyDollar[1].token, yyDollar[4].token), }, @@ -6247,7 +6278,7 @@ yydefault: } case 380: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3665 +// line internal/php7/php7.y:3694 { yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns = append(yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns, yyDollar[2].token) yyDollar[1].node.(*ast.ParserSeparatedList).Items = append(yyDollar[1].node.(*ast.ParserSeparatedList).Items, yyDollar[3].node) @@ -6256,7 +6287,7 @@ yydefault: } case 381: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:3672 +// line internal/php7/php7.y:3701 { yyVAL.node = &ast.ParserSeparatedList{ Items: []ast.Vertex{yyDollar[1].node}, @@ -6264,7 +6295,7 @@ yydefault: } case 382: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:3681 +// line internal/php7/php7.y:3710 { yyVAL.node = &ast.ExprVariable{ Node: ast.Node{ @@ -6281,7 +6312,7 @@ yydefault: } case 383: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:3696 +// line internal/php7/php7.y:3725 { yyVAL.node = &ast.ExprReference{ Node: ast.Node{ @@ -6304,7 +6335,7 @@ yydefault: } case 384: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:3720 +// line internal/php7/php7.y:3749 { yyVAL.node = &ast.ExprFunctionCall{ Node: ast.Node{ @@ -6319,7 +6350,7 @@ yydefault: } case 385: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:3733 +// line internal/php7/php7.y:3762 { yyVAL.node = &ast.ExprStaticCall{ Node: ast.Node{ @@ -6336,7 +6367,7 @@ yydefault: } case 386: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:3748 +// line internal/php7/php7.y:3777 { yyVAL.node = &ast.ExprStaticCall{ Node: ast.Node{ @@ -6353,7 +6384,7 @@ yydefault: } case 387: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:3763 +// line internal/php7/php7.y:3792 { yyVAL.node = &ast.ExprFunctionCall{ Node: ast.Node{ @@ -6368,7 +6399,7 @@ yydefault: } case 388: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:3779 +// line internal/php7/php7.y:3808 { yyVAL.node = &ast.Identifier{ Node: ast.Node{ @@ -6380,31 +6411,31 @@ yydefault: } case 389: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:3789 +// line internal/php7/php7.y:3818 { yyVAL.node = yyDollar[1].node } case 390: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:3796 +// line internal/php7/php7.y:3825 { yyVAL.node = yyDollar[1].node } case 391: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:3800 +// line internal/php7/php7.y:3829 { yyVAL.node = yyDollar[1].node } case 392: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:3807 +// line internal/php7/php7.y:3836 { yyVAL.node = nil } case 393: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3811 +// line internal/php7/php7.y:3840 { yyVAL.node = &ast.ParserBrackets{ Node: ast.Node{ @@ -6417,13 +6448,13 @@ yydefault: } case 394: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:3825 +// line internal/php7/php7.y:3854 { yyVAL.list = []ast.Vertex{} } case 395: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:3829 +// line internal/php7/php7.y:3858 { yyVAL.list = []ast.Vertex{ &ast.ScalarEncapsedStringPart{ @@ -6437,25 +6468,25 @@ yydefault: } case 396: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:3841 +// line internal/php7/php7.y:3870 { yyVAL.list = yyDollar[1].list } case 397: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:3848 +// line internal/php7/php7.y:3877 { yyVAL.node = nil } case 398: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:3852 +// line internal/php7/php7.y:3881 { yyVAL.node = yyDollar[1].node } case 399: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:3859 +// line internal/php7/php7.y:3888 { yyVAL.node = &ast.ExprArray{ Node: ast.Node{ @@ -6470,7 +6501,7 @@ yydefault: } case 400: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3872 +// line internal/php7/php7.y:3901 { yyVAL.node = &ast.ExprArray{ Node: ast.Node{ @@ -6484,7 +6515,7 @@ yydefault: } case 401: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:3884 +// line internal/php7/php7.y:3913 { yyVAL.node = &ast.ScalarString{ Node: ast.Node{ @@ -6496,7 +6527,7 @@ yydefault: } case 402: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:3897 +// line internal/php7/php7.y:3926 { yyVAL.node = &ast.ScalarLnumber{ Node: ast.Node{ @@ -6508,7 +6539,7 @@ yydefault: } case 403: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:3907 +// line internal/php7/php7.y:3936 { yyVAL.node = &ast.ScalarDnumber{ Node: ast.Node{ @@ -6520,7 +6551,7 @@ yydefault: } case 404: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:3917 +// line internal/php7/php7.y:3946 { yyVAL.node = &ast.ScalarMagicConstant{ Node: ast.Node{ @@ -6532,7 +6563,7 @@ yydefault: } case 405: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:3927 +// line internal/php7/php7.y:3956 { yyVAL.node = &ast.ScalarMagicConstant{ Node: ast.Node{ @@ -6544,7 +6575,7 @@ yydefault: } case 406: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:3937 +// line internal/php7/php7.y:3966 { yyVAL.node = &ast.ScalarMagicConstant{ Node: ast.Node{ @@ -6556,7 +6587,7 @@ yydefault: } case 407: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:3947 +// line internal/php7/php7.y:3976 { yyVAL.node = &ast.ScalarMagicConstant{ Node: ast.Node{ @@ -6568,7 +6599,7 @@ yydefault: } case 408: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:3957 +// line internal/php7/php7.y:3986 { yyVAL.node = &ast.ScalarMagicConstant{ Node: ast.Node{ @@ -6580,7 +6611,7 @@ yydefault: } case 409: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:3967 +// line internal/php7/php7.y:3996 { yyVAL.node = &ast.ScalarMagicConstant{ Node: ast.Node{ @@ -6592,7 +6623,7 @@ yydefault: } case 410: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:3977 +// line internal/php7/php7.y:4006 { yyVAL.node = &ast.ScalarMagicConstant{ Node: ast.Node{ @@ -6604,7 +6635,7 @@ yydefault: } case 411: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:3987 +// line internal/php7/php7.y:4016 { yyVAL.node = &ast.ScalarMagicConstant{ Node: ast.Node{ @@ -6616,7 +6647,7 @@ yydefault: } case 412: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:3997 +// line internal/php7/php7.y:4026 { yyVAL.node = &ast.ScalarHeredoc{ Node: ast.Node{ @@ -6637,7 +6668,7 @@ yydefault: } case 413: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:4016 +// line internal/php7/php7.y:4045 { yyVAL.node = &ast.ScalarHeredoc{ Node: ast.Node{ @@ -6649,7 +6680,7 @@ yydefault: } case 414: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:4026 +// line internal/php7/php7.y:4055 { yyVAL.node = &ast.ScalarEncapsed{ Node: ast.Node{ @@ -6662,7 +6693,7 @@ yydefault: } case 415: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:4037 +// line internal/php7/php7.y:4066 { yyVAL.node = &ast.ScalarHeredoc{ Node: ast.Node{ @@ -6675,19 +6706,19 @@ yydefault: } case 416: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4048 +// line internal/php7/php7.y:4077 { yyVAL.node = yyDollar[1].node } case 417: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4052 +// line internal/php7/php7.y:4081 { yyVAL.node = yyDollar[1].node } case 418: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4059 +// line internal/php7/php7.y:4088 { yyVAL.node = &ast.ExprConstFetch{ Node: ast.Node{ @@ -6698,7 +6729,7 @@ yydefault: } case 419: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:4068 +// line internal/php7/php7.y:4097 { yyVAL.node = &ast.ExprClassConstFetch{ Node: ast.Node{ @@ -6717,7 +6748,7 @@ yydefault: } case 420: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:4085 +// line internal/php7/php7.y:4114 { yyVAL.node = &ast.ExprClassConstFetch{ Node: ast.Node{ @@ -6736,43 +6767,43 @@ yydefault: } case 421: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4105 +// line internal/php7/php7.y:4134 { yyVAL.node = yyDollar[1].node } case 422: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4109 +// line internal/php7/php7.y:4138 { yyVAL.node = yyDollar[1].node } case 423: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:4116 +// line internal/php7/php7.y:4145 { yyVAL.node = nil } case 424: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4120 +// line internal/php7/php7.y:4149 { yyVAL.node = yyDollar[1].node } case 425: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4127 +// line internal/php7/php7.y:4156 { yyVAL.node = yyDollar[1].node } case 426: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4134 +// line internal/php7/php7.y:4163 { yyVAL.node = yyDollar[1].node } case 427: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:4138 +// line internal/php7/php7.y:4167 { yyVAL.node = &ast.ParserBrackets{ Node: ast.Node{ @@ -6785,19 +6816,19 @@ yydefault: } case 428: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4149 +// line internal/php7/php7.y:4178 { yyVAL.node = yyDollar[1].node } case 429: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4156 +// line internal/php7/php7.y:4185 { yyVAL.node = yyDollar[1].node } case 430: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:4160 +// line internal/php7/php7.y:4189 { yyVAL.node = &ast.ParserBrackets{ Node: ast.Node{ @@ -6810,19 +6841,19 @@ yydefault: } case 431: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4171 +// line internal/php7/php7.y:4200 { yyVAL.node = yyDollar[1].node } case 432: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4178 +// line internal/php7/php7.y:4207 { yyVAL.node = yyDollar[1].node } case 433: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:4182 +// line internal/php7/php7.y:4211 { yyVAL.node = &ast.ExprArrayDimFetch{ Node: ast.Node{ @@ -6836,7 +6867,7 @@ yydefault: } case 434: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:4194 +// line internal/php7/php7.y:4223 { yyVAL.node = &ast.ExprArrayDimFetch{ Node: ast.Node{ @@ -6850,7 +6881,7 @@ yydefault: } case 435: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:4206 +// line internal/php7/php7.y:4235 { yyVAL.node = &ast.ExprArrayDimFetch{ Node: ast.Node{ @@ -6864,7 +6895,7 @@ yydefault: } case 436: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:4218 +// line internal/php7/php7.y:4247 { yyVAL.node = &ast.ExprMethodCall{ Node: ast.Node{ @@ -6881,25 +6912,25 @@ yydefault: } case 437: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4233 +// line internal/php7/php7.y:4262 { yyVAL.node = yyDollar[1].node } case 438: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4240 +// line internal/php7/php7.y:4269 { yyVAL.node = yyDollar[1].node } case 439: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4244 +// line internal/php7/php7.y:4273 { yyVAL.node = yyDollar[1].node } case 440: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:4248 +// line internal/php7/php7.y:4277 { yyVAL.node = &ast.ExprPropertyFetch{ Node: ast.Node{ @@ -6912,7 +6943,7 @@ yydefault: } case 441: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4262 +// line internal/php7/php7.y:4291 { yyVAL.node = &ast.ExprVariable{ Node: ast.Node{ @@ -6929,7 +6960,7 @@ yydefault: } case 442: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:4277 +// line internal/php7/php7.y:4306 { yyVAL.node = &ast.ExprVariable{ Node: ast.Node{ @@ -6948,7 +6979,7 @@ yydefault: } case 443: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:4294 +// line internal/php7/php7.y:4323 { yyVAL.node = &ast.ExprVariable{ Node: ast.Node{ @@ -6960,7 +6991,7 @@ yydefault: } case 444: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:4307 +// line internal/php7/php7.y:4336 { yyVAL.node = &ast.ExprStaticPropertyFetch{ Node: ast.Node{ @@ -6973,7 +7004,7 @@ yydefault: } case 445: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:4318 +// line internal/php7/php7.y:4347 { yyVAL.node = &ast.ExprStaticPropertyFetch{ Node: ast.Node{ @@ -6986,13 +7017,13 @@ yydefault: } case 446: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4332 +// line internal/php7/php7.y:4361 { yyVAL.node = yyDollar[1].node } case 447: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:4336 +// line internal/php7/php7.y:4365 { yyVAL.node = &ast.ExprArrayDimFetch{ Node: ast.Node{ @@ -7006,7 +7037,7 @@ yydefault: } case 448: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:4348 +// line internal/php7/php7.y:4377 { yyVAL.node = &ast.ExprArrayDimFetch{ Node: ast.Node{ @@ -7020,7 +7051,7 @@ yydefault: } case 449: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:4360 +// line internal/php7/php7.y:4389 { yyVAL.node = &ast.ExprPropertyFetch{ Node: ast.Node{ @@ -7033,7 +7064,7 @@ yydefault: } case 450: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:4371 +// line internal/php7/php7.y:4400 { yyVAL.node = &ast.ExprStaticPropertyFetch{ Node: ast.Node{ @@ -7046,7 +7077,7 @@ yydefault: } case 451: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:4382 +// line internal/php7/php7.y:4411 { yyVAL.node = &ast.ExprStaticPropertyFetch{ Node: ast.Node{ @@ -7059,7 +7090,7 @@ yydefault: } case 452: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4396 +// line internal/php7/php7.y:4425 { yyVAL.node = &ast.Identifier{ Node: ast.Node{ @@ -7071,7 +7102,7 @@ yydefault: } case 453: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:4406 +// line internal/php7/php7.y:4435 { yyVAL.node = &ast.ParserBrackets{ Node: ast.Node{ @@ -7084,13 +7115,13 @@ yydefault: } case 454: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4417 +// line internal/php7/php7.y:4446 { yyVAL.node = yyDollar[1].node } case 455: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4424 +// line internal/php7/php7.y:4453 { yyVAL.node = &ast.Identifier{ Node: ast.Node{ @@ -7102,7 +7133,7 @@ yydefault: } case 456: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:4434 +// line internal/php7/php7.y:4463 { yyVAL.node = &ast.ParserBrackets{ Node: ast.Node{ @@ -7115,13 +7146,13 @@ yydefault: } case 457: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4445 +// line internal/php7/php7.y:4474 { yyVAL.node = yyDollar[1].node } case 458: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4452 +// line internal/php7/php7.y:4481 { pairList := yyDollar[1].node.(*ast.ParserSeparatedList) fistPair := pairList.Items[0].(*ast.ExprArrayItem) @@ -7134,19 +7165,19 @@ yydefault: } case 459: yyDollar = yyS[yypt-0 : yypt+1] - // line internal/php7/php7.y:4466 +// line internal/php7/php7.y:4495 { yyVAL.node = &ast.ExprArrayItem{} } case 460: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4470 +// line internal/php7/php7.y:4499 { yyVAL.node = yyDollar[1].node } case 461: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:4477 +// line internal/php7/php7.y:4506 { yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns = append(yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns, yyDollar[2].token) yyDollar[1].node.(*ast.ParserSeparatedList).Items = append(yyDollar[1].node.(*ast.ParserSeparatedList).Items, yyDollar[3].node) @@ -7155,7 +7186,7 @@ yydefault: } case 462: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4484 +// line internal/php7/php7.y:4513 { yyVAL.node = &ast.ParserSeparatedList{ Items: []ast.Vertex{yyDollar[1].node}, @@ -7163,7 +7194,7 @@ yydefault: } case 463: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:4493 +// line internal/php7/php7.y:4522 { yyVAL.node = &ast.ExprArrayItem{ Node: ast.Node{ @@ -7176,7 +7207,7 @@ yydefault: } case 464: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4504 +// line internal/php7/php7.y:4533 { yyVAL.node = &ast.ExprArrayItem{ Node: ast.Node{ @@ -7187,7 +7218,7 @@ yydefault: } case 465: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:4513 +// line internal/php7/php7.y:4542 { yyVAL.node = &ast.ExprArrayItem{ Node: ast.Node{ @@ -7206,7 +7237,7 @@ yydefault: } case 466: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:4530 +// line internal/php7/php7.y:4559 { yyVAL.node = &ast.ExprArrayItem{ Node: ast.Node{ @@ -7223,7 +7254,7 @@ yydefault: } case 467: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:4545 +// line internal/php7/php7.y:4574 { yyVAL.node = &ast.ExprArrayItem{ Node: ast.Node{ @@ -7235,7 +7266,7 @@ yydefault: } case 468: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php7/php7.y:4555 +// line internal/php7/php7.y:4584 { yyVAL.node = &ast.ExprArrayItem{ Node: ast.Node{ @@ -7257,7 +7288,7 @@ yydefault: } case 469: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:4575 +// line internal/php7/php7.y:4604 { yyVAL.node = &ast.ExprArrayItem{ Node: ast.Node{ @@ -7277,13 +7308,13 @@ yydefault: } case 470: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:4596 +// line internal/php7/php7.y:4625 { yyVAL.list = append(yyDollar[1].list, yyDollar[2].node) } case 471: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:4600 +// line internal/php7/php7.y:4629 { yyVAL.list = append( yyDollar[1].list, @@ -7298,13 +7329,13 @@ yydefault: } case 472: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4613 +// line internal/php7/php7.y:4642 { yyVAL.list = []ast.Vertex{yyDollar[1].node} } case 473: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:4617 +// line internal/php7/php7.y:4646 { yyVAL.list = []ast.Vertex{ &ast.ScalarEncapsedStringPart{ @@ -7319,7 +7350,7 @@ yydefault: } case 474: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4633 +// line internal/php7/php7.y:4662 { yyVAL.node = &ast.ExprVariable{ Node: ast.Node{ @@ -7336,7 +7367,7 @@ yydefault: } case 475: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:4648 +// line internal/php7/php7.y:4677 { yyVAL.node = &ast.ExprArrayDimFetch{ Node: ast.Node{ @@ -7361,7 +7392,7 @@ yydefault: } case 476: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:4671 +// line internal/php7/php7.y:4700 { yyVAL.node = &ast.ExprPropertyFetch{ Node: ast.Node{ @@ -7391,7 +7422,7 @@ yydefault: } case 477: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:4699 +// line internal/php7/php7.y:4728 { yyVAL.node = &ast.ParserBrackets{ Node: ast.Node{ @@ -7409,7 +7440,7 @@ yydefault: } case 478: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:4715 +// line internal/php7/php7.y:4744 { yyVAL.node = &ast.ParserBrackets{ Node: ast.Node{ @@ -7433,7 +7464,7 @@ yydefault: } case 479: yyDollar = yyS[yypt-6 : yypt+1] - // line internal/php7/php7.y:4737 +// line internal/php7/php7.y:4766 { yyVAL.node = &ast.ParserBrackets{ Node: ast.Node{ @@ -7465,7 +7496,7 @@ yydefault: } case 480: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:4767 +// line internal/php7/php7.y:4796 { yyVAL.node = &ast.ParserBrackets{ Node: ast.Node{ @@ -7478,7 +7509,7 @@ yydefault: } case 481: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4781 +// line internal/php7/php7.y:4810 { yyVAL.node = &ast.ScalarString{ Node: ast.Node{ @@ -7490,7 +7521,7 @@ yydefault: } case 482: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4791 +// line internal/php7/php7.y:4820 { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(string(yyDollar[1].token.Value)); err == nil { @@ -7513,7 +7544,7 @@ yydefault: } case 483: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:4812 +// line internal/php7/php7.y:4841 { _, err := strconv.Atoi(string(yyDollar[2].token.Value)) isInt := err == nil @@ -7546,7 +7577,7 @@ yydefault: } case 484: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4843 +// line internal/php7/php7.y:4872 { yyVAL.node = &ast.ExprVariable{ Node: ast.Node{ @@ -7563,7 +7594,7 @@ yydefault: } case 485: yyDollar = yyS[yypt-5 : yypt+1] - // line internal/php7/php7.y:4861 +// line internal/php7/php7.y:4890 { if yyDollar[4].token != nil { yyDollar[3].node.(*ast.ParserSeparatedList).SeparatorTkns = append(yyDollar[3].node.(*ast.ParserSeparatedList).SeparatorTkns, yyDollar[4].token) @@ -7582,7 +7613,7 @@ yydefault: } case 486: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:4878 +// line internal/php7/php7.y:4907 { yyVAL.node = &ast.ExprEmpty{ Node: ast.Node{ @@ -7596,7 +7627,7 @@ yydefault: } case 487: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:4890 +// line internal/php7/php7.y:4919 { yyVAL.node = &ast.ExprInclude{ Node: ast.Node{ @@ -7608,7 +7639,7 @@ yydefault: } case 488: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:4900 +// line internal/php7/php7.y:4929 { yyVAL.node = &ast.ExprIncludeOnce{ Node: ast.Node{ @@ -7620,7 +7651,7 @@ yydefault: } case 489: yyDollar = yyS[yypt-4 : yypt+1] - // line internal/php7/php7.y:4910 +// line internal/php7/php7.y:4939 { yyVAL.node = &ast.ExprEval{ Node: ast.Node{ @@ -7634,7 +7665,7 @@ yydefault: } case 490: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:4922 +// line internal/php7/php7.y:4951 { yyVAL.node = &ast.ExprRequire{ Node: ast.Node{ @@ -7646,7 +7677,7 @@ yydefault: } case 491: yyDollar = yyS[yypt-2 : yypt+1] - // line internal/php7/php7.y:4932 +// line internal/php7/php7.y:4961 { yyVAL.node = &ast.ExprRequireOnce{ Node: ast.Node{ @@ -7658,7 +7689,7 @@ yydefault: } case 492: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4945 +// line internal/php7/php7.y:4974 { yyVAL.node = &ast.ParserSeparatedList{ Items: []ast.Vertex{yyDollar[1].node}, @@ -7666,7 +7697,7 @@ yydefault: } case 493: yyDollar = yyS[yypt-3 : yypt+1] - // line internal/php7/php7.y:4951 +// line internal/php7/php7.y:4980 { yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns = append(yyDollar[1].node.(*ast.ParserSeparatedList).SeparatorTkns, yyDollar[2].token) yyDollar[1].node.(*ast.ParserSeparatedList).Items = append(yyDollar[1].node.(*ast.ParserSeparatedList).Items, yyDollar[3].node) @@ -7675,7 +7706,7 @@ yydefault: } case 494: yyDollar = yyS[yypt-1 : yypt+1] - // line internal/php7/php7.y:4961 +// line internal/php7/php7.y:4990 { yyVAL.node = yyDollar[1].node } diff --git a/internal/php7/php7.y b/internal/php7/php7.y index bb74f7b..6dd4946 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -14,10 +14,7 @@ import ( %union{ node ast.Vertex token *token.Token - tkn *token.Token list []ast.Vertex - - ClosureUse *ast.ExprClosureUse } %token T_INCLUDE @@ -247,9 +244,9 @@ import ( %type callable_expr callable_variable static_member new_variable %type encaps_var encaps_var_offset echo_expr_list catch_name_list name_list %type if_stmt const_list non_empty_argument_list property_list -%type alt_if_stmt lexical_var_list isset_variables -%type if_stmt_without_else -%type class_const_decl +%type alt_if_stmt lexical_var_list isset_variables class_const_list +%type if_stmt_without_else unprefixed_use_declarations inline_use_declarations use_declarations +%type class_const_decl namespace_name %type alt_if_stmt_without_else %type array_pair possible_array_pair %type isset_variable type return_type type_expr @@ -264,17 +261,15 @@ import ( %type extends_from %type implements_list %type interface_extends_list -%type lexical_vars +%type lexical_vars %type member_modifier %type use_type %type foreach_variable -%type encaps_list backticks_expr namespace_name catch_list class_const_list -%type unprefixed_use_declarations inline_use_declarations +%type encaps_list backticks_expr catch_list %type case_list trait_adaptation_list -%type use_declarations %type top_statement_list %type inner_statement_list class_statement_list %type method_modifiers variable_modifiers @@ -342,26 +337,32 @@ top_statement_list: namespace_name: T_STRING { - $$ = []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + StringTkn: $1, + Value: $1.Value, }, - StringTkn: $1, - Value: $1.Value, }, } } | namespace_name T_NS_SEPARATOR T_STRING { - $$ = append($1, &ast.NameNamePart{ + part := &ast.NameNamePart{ Node: ast.Node{ - Position: position.NewTokensPosition($2, $3), + Position: position.NewTokenPosition($3), }, - NsSeparatorTkn: $2, StringTkn: $3, Value: $3.Value, - }) + } + + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, part) + + $$ = $1 } ; @@ -370,30 +371,33 @@ name: { $$ = &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, - Parts: $1, + Parts: $1.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, } } | T_NAMESPACE T_NS_SEPARATOR namespace_name { $$ = &ast.NameRelative{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $3), + Position: position.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), }, NsTkn: $1, NsSeparatorTkn: $2, - Parts: $3, + Parts: $3.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, } } | T_NS_SEPARATOR namespace_name { $$ = &ast.NameFullyQualified{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $2), + Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), }, NsSeparatorTkn: $1, - Parts: $2, + Parts: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, } } ; @@ -445,9 +449,10 @@ top_statement: NsTkn: $1, Name: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($2), + Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), }, - Parts: $2, + Parts: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, SemiColonTkn: $3, } @@ -461,9 +466,10 @@ top_statement: NsTkn: $1, Name: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($2), + Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), }, - Parts: $2, + Parts: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, OpenCurlyBracket: $3, Stmts: $4, @@ -510,7 +516,8 @@ top_statement: Position: position.NewTokensPosition($1, $3), }, UseTkn: $1, - UseDeclarations: $2, + UseDeclarations: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, SemiColonTkn: $3, } } @@ -522,7 +529,8 @@ top_statement: }, UseTkn: $1, Type: $2, - UseDeclarations: $3, + UseDeclarations: $3.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, SemiColonTkn: $4, } } @@ -566,29 +574,29 @@ use_type: group_use_declaration: namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations possible_comma '}' { - if len($4) > 0 { - $4[len($4)-1].(*ast.StmtUseDeclaration).CommaTkn = $5 - } + $4.(*ast.ParserSeparatedList).SeparatorTkns = append($4.(*ast.ParserSeparatedList).SeparatorTkns, $5) $$ = &ast.StmtGroupUse{ Node: ast.Node{ - Position: position.NewNodeListTokenPosition($1, $6), + Position: position.NewNodeListTokenPosition($1.(*ast.ParserSeparatedList).Items, $6), }, Prefix: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, - Parts: $1, + Parts: $1.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, }, NsSeparatorTkn: $2, OpenCurlyBracketTkn: $3, - UseDeclarations: $4, + UseDeclarations: $4.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $4.(*ast.ParserSeparatedList).SeparatorTkns, CloseCurlyBracketTkn: $6, } } | T_NS_SEPARATOR namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations possible_comma '}' { - $5[len($5)-1].(*ast.StmtUseDeclaration).CommaTkn = $6 + $5.(*ast.ParserSeparatedList).SeparatorTkns = append($5.(*ast.ParserSeparatedList).SeparatorTkns, $6) $$ = &ast.StmtGroupUse{ Node: ast.Node{ @@ -597,13 +605,15 @@ group_use_declaration: LeadingNsSeparatorTkn: $1, Prefix: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($2), + Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), }, - Parts: $2, + Parts: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, NsSeparatorTkn: $3, OpenCurlyBracketTkn: $4, - UseDeclarations: $5, + UseDeclarations: $5.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $5.(*ast.ParserSeparatedList).SeparatorTkns, CloseCurlyBracketTkn: $7, } } @@ -612,27 +622,29 @@ group_use_declaration: mixed_group_use_declaration: namespace_name T_NS_SEPARATOR '{' inline_use_declarations possible_comma '}' { - $4[len($4)-1].(*ast.StmtUseDeclaration).CommaTkn = $5 + $4.(*ast.ParserSeparatedList).SeparatorTkns = append($4.(*ast.ParserSeparatedList).SeparatorTkns, $5) $$ = &ast.StmtGroupUse{ Node: ast.Node{ - Position: position.NewNodeListTokenPosition($1, $6), + Position: position.NewNodeListTokenPosition($1.(*ast.ParserSeparatedList).Items, $6), }, Prefix: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, - Parts: $1, + Parts: $1.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, }, NsSeparatorTkn: $2, OpenCurlyBracketTkn: $3, - UseDeclarations: $4, + UseDeclarations: $4.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $4.(*ast.ParserSeparatedList).SeparatorTkns, CloseCurlyBracketTkn: $6, } } | T_NS_SEPARATOR namespace_name T_NS_SEPARATOR '{' inline_use_declarations possible_comma '}' { - $5[len($5)-1].(*ast.StmtUseDeclaration).CommaTkn = $6 + $5.(*ast.ParserSeparatedList).SeparatorTkns = append($5.(*ast.ParserSeparatedList).SeparatorTkns, $6) $$ = &ast.StmtGroupUse{ Node: ast.Node{ @@ -641,13 +653,15 @@ mixed_group_use_declaration: LeadingNsSeparatorTkn: $1, Prefix: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($2), + Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), }, - Parts: $2, + Parts: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, NsSeparatorTkn: $3, OpenCurlyBracketTkn: $4, - UseDeclarations: $5, + UseDeclarations: $5.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $5.(*ast.ParserSeparatedList).SeparatorTkns, CloseCurlyBracketTkn: $7, } } @@ -667,39 +681,48 @@ possible_comma: inline_use_declarations: inline_use_declarations ',' inline_use_declaration { - $1[len($1)-1].(*ast.StmtUseDeclaration).CommaTkn = $2 + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) - $$ = append($1, $3) + $$ = $1 } | inline_use_declaration { - $$ = []ast.Vertex{$1} + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{$1}, + } } ; unprefixed_use_declarations: unprefixed_use_declarations ',' unprefixed_use_declaration { - $1[len($1)-1].(*ast.StmtUseDeclaration).CommaTkn = $2 + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) - $$ = append($1, $3) + $$ = $1 } | unprefixed_use_declaration { - $$ = []ast.Vertex{$1} + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{$1}, + } } ; use_declarations: use_declarations ',' use_declaration { - $1[len($1)-1].(*ast.StmtUseDeclaration).CommaTkn = $2 + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) - $$ = append($1, $3) + $$ = $1 } | use_declaration { - $$ = []ast.Vertex{$1} + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{$1}, + } } ; @@ -723,13 +746,14 @@ unprefixed_use_declaration: { $$ = &ast.StmtUseDeclaration{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, Use: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, - Parts: $1, + Parts: $1.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, }, } } @@ -737,13 +761,14 @@ unprefixed_use_declaration: { $$ = &ast.StmtUseDeclaration{ Node: ast.Node{ - Position: position.NewNodeListTokenPosition($1, $3), + Position: position.NewNodeListTokenPosition($1.(*ast.ParserSeparatedList).Items, $3), }, Use: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, - Parts: $1, + Parts: $1.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, }, AsTkn: $2, Alias: &ast.Identifier{ @@ -2156,10 +2181,11 @@ class_statement: Node: ast.Node{ Position: position.NewOptionalListTokensPosition($1, $2, $4), }, - Modifiers: $1, - ConstTkn: $2, - Consts: $3, - SemiColonTkn: $4, + Modifiers: $1, + ConstTkn: $2, + Consts: $3.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + SemiColonTkn: $4, } } | T_USE name_list trait_adaptations @@ -2596,13 +2622,16 @@ property: class_const_list: class_const_list ',' class_const_decl { - lastNode($1).(*ast.StmtConstant).CommaTkn = $2 + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) - $$ = append($1, $3) + $$ = $1 } | class_const_decl { - $$ = []ast.Vertex{$1} + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{$1}, + } } ; diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 5a71e3d..b375c45 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -227,10 +227,11 @@ func (n *StmtClass) Accept(v NodeVisitor) { // StmtClassConstList node type StmtClassConstList struct { Node - Modifiers []Vertex - ConstTkn *token.Token - Consts []Vertex - SemiColonTkn *token.Token + Modifiers []Vertex + ConstTkn *token.Token + Consts []Vertex + SeparatorTkns []*token.Token + SemiColonTkn *token.Token } func (n *StmtClassConstList) Accept(v NodeVisitor) { @@ -299,7 +300,6 @@ type StmtConstant struct { Name Vertex EqualTkn *token.Token Expr Vertex - CommaTkn *token.Token } func (n *StmtConstant) Accept(v NodeVisitor) { @@ -856,6 +856,7 @@ type StmtUse struct { UseTkn *token.Token Type Vertex UseDeclarations []Vertex + SeparatorTkns []*token.Token SemiColonTkn *token.Token } @@ -873,6 +874,7 @@ type StmtGroupUse struct { NsSeparatorTkn *token.Token OpenCurlyBracketTkn *token.Token UseDeclarations []Vertex + SeparatorTkns []*token.Token CloseCurlyBracketTkn *token.Token SemiColonTkn *token.Token } @@ -889,7 +891,6 @@ type StmtUseDeclaration struct { Use Vertex AsTkn *token.Token Alias Vertex - CommaTkn *token.Token } func (n *StmtUseDeclaration) Accept(v NodeVisitor) { @@ -1029,7 +1030,7 @@ type ExprClosure struct { Params []Vertex SeparatorTkns []*token.Token CloseParenthesisTkn *token.Token - ClosureUse *ExprClosureUse + ClosureUse Vertex ColonTkn *token.Token ReturnType Vertex OpenCurlyBracketTkn *token.Token @@ -2017,8 +2018,8 @@ func (n *ExprBinarySpaceship) Accept(v NodeVisitor) { type NameName struct { Node - Parts []Vertex - ListSeparatorTkn *token.Token + Parts []Vertex + SeparatorTkns []*token.Token } func (n *NameName) Accept(v NodeVisitor) { @@ -2027,9 +2028,9 @@ func (n *NameName) Accept(v NodeVisitor) { type NameFullyQualified struct { Node - NsSeparatorTkn *token.Token - Parts []Vertex - ListSeparatorTkn *token.Token + NsSeparatorTkn *token.Token + Parts []Vertex + SeparatorTkns []*token.Token } func (n *NameFullyQualified) Accept(v NodeVisitor) { @@ -2038,10 +2039,10 @@ func (n *NameFullyQualified) Accept(v NodeVisitor) { type NameRelative struct { Node - NsTkn *token.Token - NsSeparatorTkn *token.Token - Parts []Vertex - ListSeparatorTkn *token.Token + NsTkn *token.Token + NsSeparatorTkn *token.Token + Parts []Vertex + SeparatorTkns []*token.Token } func (n *NameRelative) Accept(v NodeVisitor) { @@ -2050,9 +2051,8 @@ func (n *NameRelative) Accept(v NodeVisitor) { type NameNamePart struct { Node - NsSeparatorTkn *token.Token - StringTkn *token.Token - Value []byte + StringTkn *token.Token + Value []byte } func (n *NameNamePart) Accept(v NodeVisitor) { diff --git a/pkg/ast/visitor/dump.go b/pkg/ast/visitor/dump.go index d6546f3..abcf932 100644 --- a/pkg/ast/visitor/dump.go +++ b/pkg/ast/visitor/dump.go @@ -572,7 +572,6 @@ func (v *Dump) StmtUseDeclaration(n *ast.StmtUseDeclaration) { v.printNode(n.GetNode()) v.printToken("NsSeparatorTkn", n.NsSeparatorTkn) v.printToken("AsTkn", n.AsTkn) - v.printToken("CommaTkn", n.CommaTkn) } func (v *Dump) StmtWhile(n *ast.StmtWhile) { diff --git a/pkg/ast/visitor/filter_parser_nodes.go b/pkg/ast/visitor/filter_parser_nodes.go deleted file mode 100644 index 6ccd522..0000000 --- a/pkg/ast/visitor/filter_parser_nodes.go +++ /dev/null @@ -1,1077 +0,0 @@ -package visitor - -import ( - "github.com/z7zmey/php-parser/pkg/ast" -) - -type FilterParserNodes struct { - Null -} - -func (v *FilterParserNodes) EnterNode(n ast.Vertex) bool { - n.Accept(v) - return true -} - -func (v *FilterParserNodes) ExprExit(n *ast.ExprExit) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) StmtContinue(n *ast.StmtContinue) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) StmtBreak(n *ast.StmtBreak) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprClone(n *ast.ExprClone) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprPrint(n *ast.ExprPrint) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) StmtExpression(n *ast.StmtExpression) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) StmtEcho(n *ast.StmtEcho) { - for k, v := range n.Exprs { - for { - if nn, ok := v.(*ast.ParserBrackets); ok { - v = nn.Child - } else { - break - } - } - - n.Exprs[k] = v - } -} - -func (v *FilterParserNodes) ExprIsset(n *ast.ExprIsset) { - for k, v := range n.Vars { - for { - if nn, ok := v.(*ast.ParserBrackets); ok { - v = nn.Child - } else { - break - } - } - - n.Vars[k] = v - } -} - -func (v *FilterParserNodes) StmtReturn(n *ast.StmtReturn) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprYield(n *ast.ExprYield) { - for { - if nn, ok := n.Key.(*ast.ParserBrackets); ok { - n.Key = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Value.(*ast.ParserBrackets); ok { - n.Value = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) Argument(n *ast.Argument) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) StmtThrow(n *ast.StmtThrow) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) StmtCase(n *ast.StmtCase) { - for { - if nn, ok := n.Cond.(*ast.ParserBrackets); ok { - n.Cond = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprVariable(n *ast.ExprVariable) { - for { - if nn, ok := n.VarName.(*ast.ParserBrackets); ok { - n.VarName = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprAssign(n *ast.ExprAssign) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprAssignBitwiseAnd(n *ast.ExprAssignBitwiseAnd) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprAssignBitwiseOr(n *ast.ExprAssignBitwiseOr) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprAssignBitwiseXor(n *ast.ExprAssignBitwiseXor) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprAssignCoalesce(n *ast.ExprAssignCoalesce) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprAssignConcat(n *ast.ExprAssignConcat) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprAssignDiv(n *ast.ExprAssignDiv) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprAssignMinus(n *ast.ExprAssignMinus) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprAssignMod(n *ast.ExprAssignMod) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprAssignMul(n *ast.ExprAssignMul) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprAssignPlus(n *ast.ExprAssignPlus) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprAssignPow(n *ast.ExprAssignPow) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprAssignShiftLeft(n *ast.ExprAssignShiftLeft) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprAssignShiftRight(n *ast.ExprAssignShiftRight) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} -func (v *FilterParserNodes) ExprBinaryBitwiseAnd(n *ast.ExprBinaryBitwiseAnd) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryBitwiseOr(n *ast.ExprBinaryBitwiseOr) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryBitwiseXor(n *ast.ExprBinaryBitwiseXor) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryBooleanAnd(n *ast.ExprBinaryBooleanAnd) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryBooleanOr(n *ast.ExprBinaryBooleanOr) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryCoalesce(n *ast.ExprBinaryCoalesce) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryConcat(n *ast.ExprBinaryConcat) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryDiv(n *ast.ExprBinaryDiv) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryEqual(n *ast.ExprBinaryEqual) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryGreater(n *ast.ExprBinaryGreater) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryGreaterOrEqual(n *ast.ExprBinaryGreaterOrEqual) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryIdentical(n *ast.ExprBinaryIdentical) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryLogicalAnd(n *ast.ExprBinaryLogicalAnd) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryLogicalOr(n *ast.ExprBinaryLogicalOr) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryLogicalXor(n *ast.ExprBinaryLogicalXor) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryMinus(n *ast.ExprBinaryMinus) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryMod(n *ast.ExprBinaryMod) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryMul(n *ast.ExprBinaryMul) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryNotEqual(n *ast.ExprBinaryNotEqual) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryNotIdentical(n *ast.ExprBinaryNotIdentical) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryPlus(n *ast.ExprBinaryPlus) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryPow(n *ast.ExprBinaryPow) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryShiftLeft(n *ast.ExprBinaryShiftLeft) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryShiftRight(n *ast.ExprBinaryShiftRight) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinarySmaller(n *ast.ExprBinarySmaller) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinarySmallerOrEqual(n *ast.ExprBinarySmallerOrEqual) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinarySpaceship(n *ast.ExprBinarySpaceship) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprUnaryMinus(n *ast.ExprUnaryMinus) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprUnaryPlus(n *ast.ExprUnaryPlus) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBooleanNot(n *ast.ExprBooleanNot) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBitwiseNot(n *ast.ExprBitwiseNot) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprInstanceOf(n *ast.ExprInstanceOf) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprTernary(n *ast.ExprTernary) { - for { - if nn, ok := n.Condition.(*ast.ParserBrackets); ok { - n.Condition = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.IfTrue.(*ast.ParserBrackets); ok { - n.IfTrue = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.IfFalse.(*ast.ParserBrackets); ok { - n.IfFalse = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprCastArray(n *ast.ExprCastArray) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprCastBool(n *ast.ExprCastBool) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprCastDouble(n *ast.ExprCastDouble) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprCastInt(n *ast.ExprCastInt) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprCastObject(n *ast.ExprCastObject) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprCastString(n *ast.ExprCastString) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprCastUnset(n *ast.ExprCastUnset) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprErrorSuppress(n *ast.ExprErrorSuppress) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprArrayDimFetch(n *ast.ExprArrayDimFetch) { - for { - if nn, ok := n.Dim.(*ast.ParserBrackets); ok { - n.Dim = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprArrayItem(n *ast.ExprArrayItem) { - for { - if nn, ok := n.Key.(*ast.ParserBrackets); ok { - n.Key = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Val.(*ast.ParserBrackets); ok { - n.Val = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprEmpty(n *ast.ExprEmpty) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprInclude(n *ast.ExprInclude) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprIncludeOnce(n *ast.ExprIncludeOnce) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprEval(n *ast.ExprEval) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprRequire(n *ast.ExprRequire) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprRequireOnce(n *ast.ExprRequireOnce) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprPropertyFetch(n *ast.ExprPropertyFetch) { - for { - if nn, ok := n.Var.(*ast.ParserBrackets); ok { - n.Var = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Property.(*ast.ParserBrackets); ok { - n.Property = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprFunctionCall(n *ast.ExprFunctionCall) { - for { - if nn, ok := n.Function.(*ast.ParserBrackets); ok { - n.Function = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprStaticCall(n *ast.ExprStaticCall) { - for { - if nn, ok := n.Call.(*ast.ParserBrackets); ok { - n.Call = nn.Child - } else { - break - } - } -} diff --git a/pkg/ast/visitor/filter_tokens.go b/pkg/ast/visitor/filter_tokens.go deleted file mode 100644 index 579bb8d..0000000 --- a/pkg/ast/visitor/filter_tokens.go +++ /dev/null @@ -1,276 +0,0 @@ -package visitor - -import ( - "github.com/z7zmey/php-parser/pkg/ast" -) - -type FilterTokens struct { - Null -} - -func (v *FilterTokens) EnterNode(n ast.Vertex) bool { - n.GetNode().Tokens = nil - n.Accept(v) - return true -} - -func (v *FilterTokens) StmtUse(n *ast.StmtUse) { - n.UseTkn = nil - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtGroupUse(n *ast.StmtGroupUse) { - n.UseTkn = nil - n.LeadingNsSeparatorTkn = nil - n.NsSeparatorTkn = nil - n.OpenCurlyBracketTkn = nil - n.CloseCurlyBracketTkn = nil - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtUseDeclaration(n *ast.StmtUseDeclaration) { - n.NsSeparatorTkn = nil - n.AsTkn = nil - n.CommaTkn = nil -} - -func (v *FilterTokens) NameNamePart(n *ast.NameNamePart) { - n.NsSeparatorTkn = nil - n.StringTkn = nil -} - -func (v *FilterTokens) NameName(n *ast.NameName) { - n.ListSeparatorTkn = nil -} - -func (v *FilterTokens) NameFullyQualified(n *ast.NameFullyQualified) { - n.NsSeparatorTkn = nil - n.ListSeparatorTkn = nil -} - -func (v *FilterTokens) NameRelative(n *ast.NameRelative) { - n.NsTkn = nil - n.NsSeparatorTkn = nil - n.ListSeparatorTkn = nil -} - -func (v *FilterTokens) StmtNamespace(n *ast.StmtNamespace) { - n.NsTkn = nil - n.OpenCurlyBracket = nil - n.CloseCurlyBracket = nil - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtHaltCompiler(n *ast.StmtHaltCompiler) { - n.HaltCompilerTkn = nil - n.OpenParenthesisTkn = nil - n.CloseParenthesisTkn = nil - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtConstList(n *ast.StmtConstList) { - n.ConstTkn = nil - n.SeparatorTkns = nil - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtClassConstList(n *ast.StmtClassConstList) { - n.ConstTkn = nil - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtConstant(n *ast.StmtConstant) { - n.EqualTkn = nil - n.CommaTkn = nil -} - -func (v *FilterTokens) StmtStmtList(n *ast.StmtStmtList) { - n.OpenCurlyBracket = nil - n.CloseCurlyBracket = nil -} - -func (v *FilterTokens) StmtIf(n *ast.StmtIf) { - n.IfTkn = nil - n.OpenParenthesisTkn = nil - n.CloseParenthesisTkn = nil - n.ColonTkn = nil - n.EndIfTkn = nil - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtElseIf(n *ast.StmtElseIf) { - n.ElseIfTkn = nil - n.OpenParenthesisTkn = nil - n.CloseParenthesisTkn = nil - n.ColonTkn = nil -} - -func (v *FilterTokens) StmtElse(n *ast.StmtElse) { - n.ElseTkn = nil - n.ColonTkn = nil -} - -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 -} - -func (v *FilterTokens) StmtDo(n *ast.StmtDo) { - n.DoTkn = nil - n.WhileTkn = nil - n.OpenParenthesisTkn = nil - n.CloseParenthesisTkn = nil - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtFor(n *ast.StmtFor) { - n.ForTkn = nil - n.OpenParenthesisTkn = nil - n.InitSemiColonTkn = nil - n.CondSemiColonTkn = nil - n.CloseParenthesisTkn = nil - n.ColonTkn = nil - n.EndForTkn = nil - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtSwitch(n *ast.StmtSwitch) { - n.SwitchTkn = nil - n.OpenParenthesisTkn = nil - n.CloseParenthesisTkn = nil - n.OpenCurlyBracketTkn = nil - n.CaseSeparatorTkn = nil - n.ColonTkn = nil - n.CloseCurlyBracketTkn = nil - n.EndSwitchTkn = nil - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtCase(n *ast.StmtCase) { - n.CaseTkn = nil - n.CaseSeparatorTkn = nil -} - -func (v *FilterTokens) StmtDefault(n *ast.StmtDefault) { - n.DefaultTkn = nil - n.CaseSeparatorTkn = nil -} - -func (v *FilterTokens) StmtBreak(n *ast.StmtBreak) { - n.BreakTkn = nil - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtContinue(n *ast.StmtContinue) { - n.ContinueTkn = nil - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtReturn(n *ast.StmtReturn) { - n.ReturnTkn = nil - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtGlobal(n *ast.StmtGlobal) { - n.GlobalTkn = nil - n.SeparatorTkns = nil - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtStatic(n *ast.StmtStatic) { - n.StaticTkn = nil - n.SeparatorTkns = nil - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtStaticVar(n *ast.StmtStaticVar) { - n.EqualTkn = nil -} - -func (v *FilterTokens) StmtEcho(n *ast.StmtEcho) { - n.EchoTkn = nil - n.SeparatorTkns = nil - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtInlineHtml(n *ast.StmtInlineHtml) { - n.InlineHtmlTkn = nil -} - -func (v *FilterTokens) StmtUnset(n *ast.StmtUnset) { - n.UnsetTkn = nil - n.OpenParenthesisTkn = nil - n.SeparatorTkns = nil - n.CloseParenthesisTkn = nil - n.SemiColonTkn = nil - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtForeach(n *ast.StmtForeach) { - n.ForeachTkn = nil - n.OpenParenthesisTkn = nil - n.AsTkn = nil - n.DoubleArrowTkn = nil - n.CloseParenthesisTkn = nil - n.ColonTkn = nil - n.EndForeachTkn = nil - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtDeclare(n *ast.StmtDeclare) { - n.DeclareTkn = nil - n.OpenParenthesisTkn = nil - n.SeparatorTkns = nil - n.CloseParenthesisTkn = nil - n.ColonTkn = nil - n.EndDeclareTkn = nil - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtNop(n *ast.StmtNop) { - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtTry(n *ast.StmtTry) { - n.TryTkn = nil - n.OpenCurlyBracket = nil - n.CloseCurlyBracket = nil -} - -func (v *FilterTokens) StmtCatch(n *ast.StmtCatch) { - n.CatchTkn = nil - n.OpenParenthesisTkn = nil - n.SeparatorTkns = nil - n.CloseParenthesisTkn = nil - n.OpenCurlyBracketTkn = nil - n.CloseCurlyBracketTkn = nil -} - -func (v *FilterTokens) StmtFinally(n *ast.StmtFinally) { - n.FinallyTkn = nil - n.OpenCurlyBracketTkn = nil - n.CloseCurlyBracketTkn = nil -} - -func (v *FilterTokens) StmtThrow(n *ast.StmtThrow) { - n.ThrowTkn = nil - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtGoto(n *ast.StmtGoto) { - n.GotoTkn = nil - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtLabel(n *ast.StmtLabel) { - n.ColonTkn = nil -} diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index 0109652..026708e 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -550,7 +550,6 @@ func (p *Printer) printNodeArgument(n ast.Vertex) { // name func (p *Printer) printNameNamePart(n *ast.NameNamePart) { - p.printToken(n.NsSeparatorTkn, "") p.printToken(n.StringTkn, string(n.Value)) } @@ -558,8 +557,6 @@ func (p *Printer) printNameName(n *ast.NameName) { p.printFreeFloating(n, token.Start) p.joinPrintRefactored("\\", n.Parts) - - p.printToken(n.ListSeparatorTkn, "") } func (p *Printer) printNameFullyQualified(n *ast.NameFullyQualified) { @@ -567,8 +564,6 @@ func (p *Printer) printNameFullyQualified(n *ast.NameFullyQualified) { p.printToken(n.NsSeparatorTkn, "\\") p.joinPrintRefactored("\\", n.Parts) - - p.printToken(n.ListSeparatorTkn, "") } func (p *Printer) printNameRelative(n *ast.NameRelative) { @@ -577,8 +572,6 @@ func (p *Printer) printNameRelative(n *ast.NameRelative) { p.printToken(n.NsSeparatorTkn, "\\") p.joinPrintRefactored("\\", n.Parts) - - p.printToken(n.ListSeparatorTkn, "") } // scalar @@ -2099,7 +2092,6 @@ func (p *Printer) printStmtConstant(n *ast.StmtConstant) { p.Print(n.Name) p.printToken(n.EqualTkn, "=") p.Print(n.Expr) - p.printToken(n.CommaTkn, "") } func (p *Printer) printStmtContinue(n *ast.StmtContinue) { @@ -2795,7 +2787,6 @@ func (p *Printer) printStmtUseDeclaration(n *ast.StmtUseDeclaration) { p.Print(n.Use) if n.Alias == nil { - p.printToken(n.CommaTkn, "") return } @@ -2804,8 +2795,6 @@ func (p *Printer) printStmtUseDeclaration(n *ast.StmtUseDeclaration) { p.bufStart = " " p.Print(n.Alias) - - p.printToken(n.CommaTkn, "") } func (p *Printer) printStmtWhile(n *ast.StmtWhile) {