isset node

This commit is contained in:
z7zmey 2017-12-17 23:21:46 +02:00
parent aa520300c0
commit 6d35bfff65
3 changed files with 137 additions and 106 deletions

31
node/expr/isset.go Normal file
View File

@ -0,0 +1,31 @@
package expr
import (
"fmt"
"io"
"github.com/z7zmey/php-parser/node"
)
type Isset struct {
node.SimpleNode
variables []node.Node
}
func NewIsset(variables []node.Node) node.Node {
return Isset{
node.SimpleNode{Name: "Isset", Attributes: make(map[string]string)},
variables,
}
}
func (n Isset) Print(out io.Writer, indent string) {
fmt.Fprintf(out, "\n%v%v [- -]", indent, n.Name)
if n.variables != nil {
fmt.Fprintf(out, "\n%vvariables:", indent+" ")
for _, nn := range n.variables {
nn.Print(out, indent+" ")
}
}
}

View File

@ -604,14 +604,14 @@ var yyAct = [...]int{
807, 197, 199, 198, 332, 607, 795, 610, 608, 308, 807, 197, 199, 198, 332, 607, 795, 610, 608, 308,
766, 718, 669, 279, 280, 642, 817, 633, 628, 785, 766, 718, 669, 279, 280, 642, 817, 633, 628, 785,
229, 564, 812, 824, 810, 825, 554, 118, 231, 409, 229, 564, 812, 824, 810, 825, 554, 118, 231, 409,
1, 831, 835, 365, 659, 544, 255, 256, 804, 803, 1, 831, 519, 835, 659, 544, 255, 256, 365, 803,
842, 848, 651, 830, 144, 813, 578, 846, 833, 748, 842, 804, 848, 830, 651, 813, 578, 846, 833, 144,
855, 141, 841, 687, 688, 689, 686, 685, 684, 321, 855, 748, 841, 687, 688, 689, 686, 685, 684, 141,
864, 854, 167, 168, 161, 162, 160, 163, 165, 166, 864, 854, 167, 168, 161, 162, 160, 163, 165, 166,
863, 178, 148, 800, 872, 666, 873, 829, 868, 250, 863, 178, 321, 148, 872, 800, 873, 666, 868, 829,
877, 37, 681, 164, 861, 679, 879, 678, 221, 223, 877, 250, 37, 164, 861, 681, 879, 679, 678, 221,
42, 912, 855, 529, 782, 878, 570, 41, 882, 15, 223, 42, 855, 912, 782, 878, 529, 570, 882, 41,
14, 519, 606, 854, 888, 889, 266, 48, 890, 87, 15, 14, 606, 854, 888, 889, 266, 48, 890, 87,
88, 89, 90, 91, 47, 107, 49, 82, 73, 74, 88, 89, 90, 91, 47, 107, 49, 82, 73, 74,
80, 75, 71, 247, 896, 893, 61, 264, 897, 60, 80, 75, 71, 247, 896, 893, 61, 264, 897, 60,
898, 902, 901, 900, 853, 578, 852, 163, 165, 166, 898, 902, 901, 900, 853, 578, 852, 163, 165, 166,
@ -1371,12 +1371,12 @@ var yyPgo = [...]int{
904, 9, 903, 902, 896, 894, 13, 48, 889, 887, 904, 9, 903, 902, 896, 894, 13, 48, 889, 887,
111, 98, 197, 886, 883, 882, 8, 880, 81, 43, 111, 98, 197, 886, 883, 882, 8, 880, 81, 43,
877, 55, 47, 876, 875, 874, 867, 866, 97, 862, 877, 55, 47, 876, 875, 874, 867, 866, 97, 862,
861, 103, 1, 860, 859, 7, 19, 38, 857, 856, 103, 1, 861, 860, 7, 19, 38, 859, 857, 83,
83, 853, 10, 4, 851, 86, 850, 849, 848, 44, 856, 10, 4, 853, 86, 851, 850, 849, 44, 42,
42, 32, 41, 2, 16, 847, 845, 842, 5, 775, 32, 41, 2, 16, 848, 847, 845, 5, 775, 842,
841, 670, 839, 28, 837, 835, 833, 90, 832, 31, 670, 841, 28, 839, 837, 835, 90, 833, 31, 832,
819, 811, 25, 29, 809, 804, 802, 24, 801, 798, 819, 25, 29, 811, 809, 804, 24, 802, 801, 798,
793, 549, 792, 18, 790, 37, 12, 549, 793, 18, 792, 790, 37, 12,
} }
var yyR1 = [...]int{ var yyR1 = [...]int{
@ -1387,28 +1387,28 @@ var yyR1 = [...]int{
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6,
6, 6, 6, 6, 6, 6, 7, 7, 71, 71, 6, 6, 6, 6, 6, 6, 7, 7, 70, 70,
103, 103, 9, 9, 9, 8, 8, 8, 8, 8, 102, 102, 9, 9, 9, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8, 8, 99, 8, 8, 8, 8, 8, 8, 8, 8, 8, 98,
99, 16, 16, 18, 18, 125, 125, 113, 113, 112, 98, 16, 16, 18, 18, 125, 125, 112, 112, 111,
112, 121, 121, 17, 17, 20, 20, 19, 19, 107, 111, 120, 120, 17, 17, 20, 20, 19, 19, 106,
107, 72, 72, 22, 22, 22, 22, 22, 22, 10, 106, 71, 71, 22, 22, 22, 22, 22, 22, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 105, 105, 104, 104, 30, 30, 120, 10, 10, 10, 104, 104, 103, 103, 30, 30, 119,
120, 31, 11, 1, 1, 2, 2, 12, 12, 100, 119, 31, 11, 1, 1, 2, 2, 12, 12, 99,
100, 4, 4, 13, 14, 33, 33, 15, 15, 77, 99, 4, 4, 13, 14, 33, 33, 15, 15, 76,
77, 27, 27, 27, 27, 26, 26, 28, 28, 29, 76, 27, 27, 27, 27, 26, 26, 28, 28, 29,
29, 116, 116, 116, 116, 117, 117, 117, 126, 126, 29, 115, 115, 115, 115, 116, 116, 116, 126, 126,
25, 25, 78, 78, 73, 73, 86, 86, 74, 74, 25, 25, 77, 77, 72, 72, 85, 85, 73, 73,
75, 75, 79, 79, 34, 34, 35, 35, 94, 94, 74, 74, 78, 78, 34, 34, 35, 35, 93, 93,
92, 92, 92, 93, 93, 80, 80, 81, 81, 36, 91, 91, 91, 92, 92, 79, 79, 80, 80, 36,
36, 111, 111, 38, 115, 115, 39, 39, 76, 76, 36, 110, 110, 38, 114, 114, 39, 39, 75, 75,
40, 40, 40, 40, 83, 83, 119, 119, 119, 118, 40, 40, 40, 40, 82, 82, 118, 118, 118, 117,
118, 41, 41, 42, 43, 43, 43, 43, 45, 45, 117, 41, 41, 42, 43, 43, 43, 43, 45, 45,
44, 84, 84, 95, 95, 96, 96, 97, 97, 98, 44, 83, 83, 94, 94, 95, 95, 96, 96, 97,
98, 98, 98, 98, 98, 114, 114, 46, 46, 106, 97, 97, 97, 97, 97, 113, 113, 46, 46, 105,
106, 82, 21, 108, 108, 47, 109, 109, 110, 110, 105, 81, 21, 107, 107, 47, 108, 108, 109, 109,
49, 48, 48, 37, 37, 37, 37, 37, 37, 37, 49, 48, 48, 37, 37, 37, 37, 37, 37, 37,
37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
@ -1417,18 +1417,18 @@ var yyR1 = [...]int{
37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
37, 37, 37, 37, 37, 37, 37, 37, 37, 3, 37, 37, 37, 37, 37, 37, 37, 37, 37, 3,
3, 123, 123, 122, 122, 56, 56, 57, 57, 57, 3, 122, 122, 121, 121, 56, 56, 57, 57, 57,
57, 50, 50, 51, 51, 54, 54, 102, 102, 102, 57, 50, 50, 51, 51, 54, 54, 101, 101, 101,
85, 85, 61, 61, 61, 55, 55, 55, 55, 55, 84, 84, 61, 61, 61, 55, 55, 55, 55, 55,
55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
55, 62, 62, 62, 23, 23, 24, 24, 60, 63, 55, 62, 62, 62, 23, 23, 24, 24, 60, 63,
63, 63, 64, 64, 64, 65, 65, 65, 65, 65, 63, 63, 64, 64, 64, 65, 65, 65, 65, 65,
65, 32, 32, 32, 52, 52, 52, 66, 66, 67, 65, 32, 32, 32, 52, 52, 52, 66, 66, 67,
67, 67, 67, 67, 67, 58, 58, 58, 59, 59, 67, 67, 67, 67, 67, 58, 58, 58, 59, 59,
59, 89, 90, 90, 88, 88, 87, 87, 87, 87, 59, 88, 89, 89, 87, 87, 86, 86, 86, 86,
87, 87, 101, 101, 101, 101, 68, 68, 68, 68, 86, 86, 100, 100, 100, 100, 68, 68, 68, 68,
68, 68, 68, 69, 69, 69, 69, 53, 53, 53, 68, 68, 68, 69, 69, 69, 69, 53, 53, 53,
53, 53, 53, 53, 70, 70, 91, 53, 53, 53, 53, 123, 123, 90,
} }
var yyR2 = [...]int{ var yyR2 = [...]int{
@ -1484,21 +1484,21 @@ var yyR2 = [...]int{
} }
var yyChk = [...]int{ var yyChk = [...]int{
-1000, -124, -71, -8, -10, -11, -12, -13, -14, 127, -1000, -124, -70, -8, -10, -11, -12, -13, -14, 127,
154, 120, 114, 161, -73, -74, 97, 96, 99, 106, 154, 120, 114, 161, -72, -73, 97, 96, 99, 106,
110, 111, 115, 122, 76, 95, 90, -23, 124, 101, 110, 111, 115, 122, 76, 95, 90, -23, 124, 101,
103, 163, 116, 119, 112, 86, 113, -100, 128, 129, 103, 163, 116, 119, 112, 86, 113, -99, 128, 129,
130, -78, -86, -32, -37, -4, 83, -65, -66, -63, 130, -77, -85, -32, -37, -4, 83, -65, -66, -63,
134, 69, 71, 58, 59, 49, 50, 55, 57, 164, 134, 69, 71, 58, 59, 49, 50, 55, 57, 164,
-48, -53, 60, 61, 62, 63, 64, 65, 66, 82, -48, -53, 60, 61, 62, 63, 64, 65, 66, 82,
67, -55, 160, 13, 14, 16, 77, 78, -52, -62, 67, -55, 160, 13, 14, 16, 77, 78, -52, -62,
-57, -50, -60, -61, 70, 125, 126, 4, 5, 6, -57, -50, -60, -61, 70, 125, 126, 4, 5, 6,
7, 8, 84, 85, 141, 142, 156, 138, 139, 140, 7, 8, 84, 85, 141, 142, 156, 138, 139, 140,
155, 137, 149, 159, 88, 167, -9, -64, 135, 94, 155, 137, 149, 159, 88, 167, -9, -64, 135, 94,
-103, 157, 164, 157, -103, 161, 86, -18, -99, -121, -102, 157, 164, 157, -102, 161, 86, -18, -98, -120,
-103, 157, 113, 114, -19, -20, -107, -21, 86, -72, -102, 157, 113, 114, -19, -20, -106, -21, 86, -71,
164, -10, 113, 154, 164, 164, -24, -23, 76, -24, 164, -10, 113, 154, 164, 164, -24, -23, 76, -24,
-24, -111, -38, -52, -115, 113, -39, 88, -108, -47, -24, -110, -38, -52, -114, 113, -39, 88, -107, -47,
-23, 163, 33, 34, 10, 12, 11, 35, 37, 36, -23, 163, 33, 34, 10, 12, 11, 35, 37, 36,
51, 49, 50, 52, 68, 53, 54, 47, 48, 40, 51, 49, 50, 52, 68, 53, 54, 47, 48, 40,
41, 38, 39, 43, 44, 45, 46, 42, 56, 30, 41, 38, 39, 43, 44, 45, 46, 42, 56, 30,
@ -1506,26 +1506,26 @@ var yyChk = [...]int{
128, -4, 86, 86, 86, 73, 74, 73, 75, 74, 128, -4, 86, 86, 86, 73, 74, 73, 75, 74,
17, 18, 19, 20, 29, 21, 22, 23, 24, 25, 17, 18, 19, 20, 29, 21, 22, 23, 24, 25,
26, 27, 28, 58, 59, 164, 69, 161, 133, 164, 26, 27, 28, 58, 59, 164, 69, 161, 133, 164,
-89, -88, -90, -87, -23, 37, 134, -23, -32, -62, -88, -87, -89, -86, -23, 37, 134, -23, -32, -62,
164, -61, 76, 69, -32, -23, -23, -23, -23, -23, 164, -61, 76, 69, -32, -23, -23, -23, -23, -23,
-23, -23, -23, -23, -23, -23, -23, -54, 164, -23, -23, -23, -23, -23, -23, -23, -23, -54, 164, -23,
-102, 93, -101, -68, 88, 151, 152, -23, -23, -23, -101, 93, -100, -68, 88, 151, 152, -23, -23, -23,
69, 153, 153, -51, -49, -50, -67, 128, -9, -52, 69, 153, 153, -51, -49, -50, -67, 128, -9, -52,
164, 164, -23, -23, 164, -23, -23, 93, 150, -101, 164, 164, -23, -23, 164, -23, -23, 93, 150, -100,
-101, 93, 161, -52, -80, 164, -80, 164, 157, -103, -100, 93, 161, -52, -79, 164, -79, 164, 157, -102,
165, -103, 163, 161, -71, 163, -16, -121, -103, 157, 165, -102, 163, 161, -70, 163, -16, -120, -102, 157,
163, 9, 157, 105, -103, -20, 163, 9, 17, -22, 163, 9, 157, 105, -102, -20, 163, 9, 17, -22,
162, -10, -11, -12, -13, -14, 127, -23, 97, -3, 162, -10, -11, -12, -13, -14, 127, -23, 97, -3,
-109, -110, -23, -23, 163, 163, 163, 163, 9, 163, -108, -109, -23, -23, 163, 163, 163, 163, 9, 163,
9, -3, 17, 163, 9, -23, -23, -23, -23, -23, 9, -3, 17, 163, 9, -23, -23, -23, -23, -23,
-23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23,
-23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23,
-23, -51, -23, 31, -23, -120, -31, -32, -23, -107, -23, -51, -23, 31, -23, -119, -31, -32, -23, -106,
-72, 163, 163, 86, 164, 86, -33, 131, 161, -15, -71, 163, 163, 86, 164, 86, -33, 131, 161, -15,
131, 164, -10, 164, 163, 31, -23, 37, -23, -23, 131, 164, -10, 164, 163, 31, -23, 37, -23, -23,
-23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23,
-23, -24, -23, -59, 86, 161, -52, -89, 166, 9, -23, -24, -23, -59, 86, 161, -52, -88, 166, 9,
15, -32, 164, -23, -89, 165, -24, 160, -68, -68, 15, -32, 164, -23, -88, 165, -24, 160, -68, -68,
93, 69, 133, -23, 87, -32, 15, -24, -58, -7, 93, 69, 133, -23, 87, -32, 15, -24, -58, -7,
-52, 161, 86, -6, -5, 76, 77, 78, 79, 80, -52, 161, 86, -6, -5, 76, 77, 78, 79, 80,
81, 4, 5, 6, 7, 8, 10, 11, 12, 56, 81, 4, 5, 6, 7, 8, 10, 11, 12, 56,
@ -1535,47 +1535,47 @@ var yyChk = [...]int{
112, 113, 114, 115, 13, 14, 134, 106, 107, 108, 112, 113, 114, 115, 13, 14, 134, 106, 107, 108,
109, 110, 135, 136, 131, 132, 154, 129, 130, 128, 109, 110, 135, 136, 131, 132, 154, 129, 130, 128,
137, 138, 140, 139, 141, 142, 156, 155, -58, -7, 137, 138, 140, 139, 141, 142, 156, 155, -58, -7,
-52, -85, -80, 153, 69, 161, 133, 153, -85, -70, -52, -84, -79, 153, 69, 161, 133, 153, -84, -123,
-91, -23, -23, -23, 150, 150, 159, -23, 165, -81, -90, -23, -23, -23, 150, 150, 159, -23, 165, -80,
-36, -23, 158, -89, 86, 163, -71, 162, 163, 163, -36, -23, 158, -88, 86, 163, -70, 162, 163, 163,
157, -103, -19, 157, -103, 161, 86, 157, -21, -23, 157, -102, -19, 157, -102, 161, 86, 157, -21, -23,
164, 165, 164, 163, 9, 165, -38, -39, 164, -23, 164, 165, 164, 163, 9, 165, -38, -39, 164, -23,
-47, 31, -23, -125, 9, 105, 165, 162, 164, -75, -47, 31, -23, -125, 9, 105, 165, 162, 164, -74,
-79, -34, -35, -94, -92, 30, 135, 136, -9, -33, -78, -34, -35, -93, -91, 30, 135, 136, -9, -33,
-77, 132, -9, -76, 161, -83, -9, -23, -23, -72, -76, 132, -9, -75, 161, -82, -9, -23, -23, -71,
-23, 165, 166, 162, -80, -23, 165, 17, -90, -23, -23, 165, 166, 162, -79, -23, 165, 17, -89, -23,
37, 134, -89, 165, 166, 165, -69, 86, 89, 50, 37, 134, -88, 165, 166, 165, -69, 86, 89, 50,
88, 86, 162, 162, 69, 162, -23, 166, -80, -23, 88, 86, 162, 162, 69, 162, -23, 166, -79, -23,
-80, -52, -24, -23, -59, -52, -33, -125, 9, 165, -79, -52, -24, -23, -59, -52, -33, -125, 9, 165,
165, 162, -125, 9, -23, 165, 162, 161, 157, -113, 165, 162, -125, 9, -23, 165, 162, 161, 157, -112,
-17, -20, -99, 161, 165, -25, -10, 31, -23, -109, -17, -20, -98, 161, 165, -25, -10, 31, -23, -108,
-23, -116, 161, 31, -75, -23, 165, -31, -27, -32, -23, -115, 161, 31, -74, -23, 165, -31, -27, -32,
37, 134, 69, -29, -10, 31, -105, -75, 165, 9, 37, 134, 69, -29, -10, 31, -104, -74, 165, 9,
-1, 37, -92, -77, 161, -83, 162, -40, -95, -96, -1, 37, -91, -76, 161, -82, 162, -40, -94, -95,
120, -97, 123, -98, 81, 80, 79, 76, 77, 78, 120, -96, 123, -97, 81, 80, 79, 76, 77, 78,
-76, 9, 165, 165, 75, -10, 31, 162, 17, -23, -75, 9, 165, 165, 75, -10, 31, 162, 17, -23,
-32, 164, 165, 166, 89, -23, 162, 166, 162, -77, -32, 164, 165, 166, 89, -23, 162, 166, 162, -76,
165, -91, 165, -36, -112, -20, 161, -125, 9, -20, 165, -90, 165, -36, -111, -20, 161, -125, 9, -20,
-113, 163, -72, 165, 163, -117, 163, -117, 163, 165, -112, 163, -71, 165, 163, -116, 163, -116, 163, 165,
163, 165, 15, -32, 164, -89, -72, -30, 117, 118, 163, 165, 15, -32, 164, -88, -71, -30, 117, 118,
165, -123, 120, -34, -2, 158, 161, -76, -114, -46, 165, -122, 120, -34, -2, 158, 161, -75, -113, -46,
88, 114, 113, -83, -98, 162, -9, -10, 31, 163, 88, 114, 113, -82, -97, 162, -9, -10, 31, 163,
-72, -23, -89, 166, 161, -125, 9, -112, 162, -17, -71, -23, -88, 166, 161, -125, 9, -111, 162, -17,
-125, 98, 163, -109, 162, 108, 109, -117, 107, -117, -125, 98, 163, -108, 162, 108, 109, -116, 107, -116,
-123, -28, -10, 31, -27, -89, 166, 104, 164, 161, -122, -28, -10, 31, -27, -88, 166, 104, 164, 161,
-93, 31, -93, 164, 88, -76, 162, 163, 9, 17, -92, 31, -92, 164, 88, -75, 162, 163, 9, 17,
-106, -82, -7, -3, -119, 163, 161, -72, 165, 162, -105, -81, -7, -3, -118, 163, 161, -71, 165, 162,
-76, 162, -20, -125, 162, 163, 165, -23, -126, 31, -75, 162, -20, -125, 162, 163, 165, -23, -126, 31,
163, 162, 163, 107, -93, -72, 165, 165, 163, -104, 163, 162, 163, 107, -92, -71, 165, 165, 163, -103,
-9, -72, 161, -94, 161, -122, -56, 88, 37, 17, -9, -71, 161, -93, 161, -121, -56, 88, 37, 17,
162, -46, -23, 163, 9, 17, -7, 162, -118, -41, 162, -46, -23, 163, 9, 17, -7, 162, -117, -41,
-42, -43, -44, -45, -9, -7, 154, 86, 162, 162, -42, -43, -44, -45, -9, -7, 154, 86, 162, 162,
-26, -10, 31, -126, -72, 163, 161, 102, -28, 88, -26, -10, 31, -126, -71, 163, 161, 102, -28, 88,
35, 162, -72, -72, 165, 9, 88, -23, -82, -23, 35, 162, -71, -71, 165, 9, 88, -23, -81, -23,
164, 162, -41, 163, 163, 121, 105, 153, -72, -72, 164, 162, -41, 163, 163, 121, 105, 153, -71, -71,
-72, 163, 165, -9, 162, 162, -56, -75, -83, 86, -71, 163, 165, -9, 162, 162, -56, -74, -82, 86,
-5, -98, -7, 100, 162, 161, 165, -7, 163, -72, -5, -97, -7, 100, 162, 161, 165, -7, 163, -71,
-93, 162, -84, 163, 161, -72, 162, -92, 162, -83, 163, 161, -71, 162,
} }
var yyDef = [...]int{ var yyDef = [...]int{
@ -4904,7 +4904,7 @@ yydefault:
yyDollar = yyS[yypt-5 : yypt+1] yyDollar = yyS[yypt-5 : yypt+1]
//line parser/parser.y:1122 //line parser/parser.y:1122
{ {
yyVAL.node = yyDollar[3].node yyVAL.node = expr.NewIsset(yyDollar[3].list)
} }
case 478: case 478:
yyDollar = yyS[yypt-4 : yypt+1] yyDollar = yyS[yypt-4 : yypt+1]
@ -4946,19 +4946,19 @@ yydefault:
yyDollar = yyS[yypt-1 : yypt+1] yyDollar = yyS[yypt-1 : yypt+1]
//line parser/parser.y:1132 //line parser/parser.y:1132
{ {
yyVAL.node = yyDollar[1].node yyVAL.list = []node.Node{yyDollar[1].node}
} }
case 485: case 485:
yyDollar = yyS[yypt-3 : yypt+1] yyDollar = yyS[yypt-3 : yypt+1]
//line parser/parser.y:1133 //line parser/parser.y:1133
{ {
yyVAL.node = node.NewSimpleNode("AndIsset").Append(yyDollar[1].node).Append(yyDollar[3].node) yyVAL.list = append(yyDollar[1].list, yyDollar[3].node)
} }
case 486: case 486:
yyDollar = yyS[yypt-1 : yypt+1] yyDollar = yyS[yypt-1 : yypt+1]
//line parser/parser.y:1137 //line parser/parser.y:1137
{ {
yyVAL.node = node.NewSimpleNode("Isset").Append(yyDollar[1].node) yyVAL.node = yyDollar[1].node
} }
} }
goto yystack /* stack new state and value */ goto yystack /* stack new state and value */

View File

@ -206,7 +206,7 @@ func Parse(src io.Reader, fName string) node.Node {
%type <node> exit_expr scalar lexical_var function_call member_name property_name %type <node> exit_expr scalar lexical_var function_call member_name property_name
%type <node> variable_class_name dereferencable_scalar constant dereferencable %type <node> variable_class_name dereferencable_scalar constant dereferencable
%type <node> callable_expr callable_variable static_member new_variable %type <node> callable_expr callable_variable static_member new_variable
%type <node> encaps_var encaps_var_offset isset_variables %type <node> encaps_var encaps_var_offset
%type <node> top_statement_list inner_statement_list if_stmt %type <node> top_statement_list inner_statement_list if_stmt
%type <node> alt_if_stmt %type <node> alt_if_stmt
%type <node> parameter_list class_statement_list %type <node> parameter_list class_statement_list
@ -226,7 +226,7 @@ func Parse(src io.Reader, fName string) node.Node {
%type <list> const_list echo_expr_list for_exprs non_empty_for_exprs global_var_list %type <list> const_list echo_expr_list for_exprs non_empty_for_exprs global_var_list
%type <list> unprefixed_use_declarations inline_use_declarations property_list static_var_list %type <list> unprefixed_use_declarations inline_use_declarations property_list static_var_list
%type <list> switch_case_list case_list trait_adaptation_list trait_adaptations unset_variables %type <list> switch_case_list case_list trait_adaptation_list trait_adaptations unset_variables
%type <list> use_declarations lexical_var_list lexical_vars %type <list> use_declarations lexical_var_list lexical_vars isset_variables
%% %%
@ -1119,7 +1119,7 @@ encaps_var_offset:
; ;
internal_functions_in_yacc: internal_functions_in_yacc:
T_ISSET '(' isset_variables possible_comma ')' { $$ = $3; } T_ISSET '(' isset_variables possible_comma ')' { $$ = expr.NewIsset($3) }
| T_EMPTY '(' expr ')' { $$ = expr.NewEmpty($3) } | T_EMPTY '(' expr ')' { $$ = expr.NewEmpty($3) }
| T_INCLUDE expr { $$ = expr.NewInclude($2) } | T_INCLUDE expr { $$ = expr.NewInclude($2) }
| T_INCLUDE_ONCE expr { $$ = expr.NewIncludeOnce($2) } | T_INCLUDE_ONCE expr { $$ = expr.NewIncludeOnce($2) }
@ -1129,12 +1129,12 @@ internal_functions_in_yacc:
; ;
isset_variables: isset_variables:
isset_variable { $$ = $1; } isset_variable { $$ = []node.Node{$1} }
| isset_variables ',' isset_variable { $$ = node.NewSimpleNode("AndIsset").Append($1).Append($3); } | isset_variables ',' isset_variable { $$ = append($1, $3) }
; ;
isset_variable: isset_variable:
expr { $$ = node.NewSimpleNode("Isset").Append($1) } expr { $$ = $1 }
; ;
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////