synvert-core 1.2.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,4 @@
1
+ # typed: false
1
2
  # frozen_string_literal: true
2
3
  # encoding: UTF-8
3
4
  #--
@@ -35,8 +36,8 @@ class Synvert::Core::NodeQuery::Lexer
35
36
  REGEXP = /\/(#{REGEXP_BODY})(?<!\\)\/([imxo]*)/
36
37
  SYMBOL = /:[\w!\?<>=]+/
37
38
  TRUE = /true/
38
- SINGLE_QUOTE_STRING = /'(.*?)'/
39
- DOUBLE_QUOTE_STRING = /"(.*?)"/
39
+ SINGLE_QUOTE_STRING = /'.*?'/
40
+ DOUBLE_QUOTE_STRING = /".*?"/
40
41
  # :startdoc:
41
42
  # :stopdoc:
42
43
  class LexerError < StandardError ; end
@@ -142,11 +143,11 @@ class Synvert::Core::NodeQuery::Lexer
142
143
  when text = ss.scan(/#{NODE_TYPE}/) then
143
144
  action { [:tNODE_TYPE, text[1..]] }
144
145
  when text = ss.scan(/>/) then
145
- action { [:tCHILD, text] }
146
+ action { [:tRELATIONSHIP, text] }
146
147
  when text = ss.scan(/~/) then
147
- action { [:tSUBSEQUENT_SIBLING, text] }
148
+ action { [:tRELATIONSHIP, text] }
148
149
  when text = ss.scan(/\+/) then
149
- action { [:tNEXT_SIBLING, text] }
150
+ action { [:tRELATIONSHIP, text] }
150
151
  when text = ss.scan(/#{OPEN_SELECTOR}/) then
151
152
  action { [:tOPEN_SELECTOR, text] }
152
153
  when text = ss.scan(/#{CLOSE_SELECTOR}/) then
@@ -175,28 +176,34 @@ class Synvert::Core::NodeQuery::Lexer
175
176
  case
176
177
  when ss.skip(/\s+/) then
177
178
  # do nothing
178
- when text = ss.scan(/!=/) then
179
- action { @state = :VALUE; [:tNOT_EQUAL, text] }
180
- when text = ss.scan(/=~/) then
181
- action { @state = :VALUE; [:tMATCH, text] }
182
- when text = ss.scan(/!~/) then
183
- action { @state = :VALUE; [:tNOT_MATCH, text] }
184
- when text = ss.scan(/>=/) then
185
- action { @state = :VALUE; [:tGREATER_THAN_OR_EQUAL, text] }
186
- when text = ss.scan(/<=/) then
187
- action { @state = :VALUE; [:tLESS_THAN_OR_EQUAL, text] }
188
- when text = ss.scan(/>/) then
189
- action { @state = :VALUE; [:tGREATER_THAN, text] }
190
- when text = ss.scan(/</) then
191
- action { @state = :VALUE; [:tLESS_THAN, text] }
192
- when text = ss.scan(/=/) then
193
- action { @state = :VALUE; [:tEQUAL, text] }
194
- when text = ss.scan(/includes/i) then
195
- action { @state = :VALUE; [:tINCLUDES, text] }
196
- when text = ss.scan(/not in/i) then
197
- action { @state = :VALUE; [:tNOT_IN, text] }
198
- when text = ss.scan(/in/i) then
199
- action { @state = :VALUE; [:tIN, text] }
179
+ when ss.skip(/\^=/) then
180
+ action { @state = :VALUE; [:tOPERATOR, '^='] }
181
+ when ss.skip(/\$=/) then
182
+ action { @state = :VALUE; [:tOPERATOR, '$='] }
183
+ when ss.skip(/\*=/) then
184
+ action { @state = :VALUE; [:tOPERATOR, '*='] }
185
+ when ss.skip(/!=/) then
186
+ action { @state = :VALUE; [:tOPERATOR, '!='] }
187
+ when ss.skip(/=~/) then
188
+ action { @state = :VALUE; [:tOPERATOR, '=~'] }
189
+ when ss.skip(/!~/) then
190
+ action { @state = :VALUE; [:tOPERATOR, '!~'] }
191
+ when ss.skip(/>=/) then
192
+ action { @state = :VALUE; [:tOPERATOR, '>='] }
193
+ when ss.skip(/<=/) then
194
+ action { @state = :VALUE; [:tOPERATOR, '<='] }
195
+ when ss.skip(/>/) then
196
+ action { @state = :VALUE; [:tOPERATOR, '>'] }
197
+ when ss.skip(/</) then
198
+ action { @state = :VALUE; [:tOPERATOR, '<'] }
199
+ when ss.skip(/=/) then
200
+ action { @state = :VALUE; [:tOPERATOR, '=='] }
201
+ when ss.skip(/includes/i) then
202
+ action { @state = :VALUE; [:tOPERATOR, 'includes'] }
203
+ when ss.skip(/not in/i) then
204
+ action { @state = :VALUE; [:tOPERATOR, 'not_in'] }
205
+ when ss.skip(/in/i) then
206
+ action { @state = :VALUE; [:tOPERATOR, 'in'] }
200
207
  when text = ss.scan(/#{IDENTIFIER}/) then
201
208
  action { [:tKEY, text] }
202
209
  else
@@ -1,3 +1,4 @@
1
+ # typed: true
1
2
  #
2
3
  # DO NOT MODIFY!!!!
3
4
  # This file is automatically generated by Racc 1.6.0
@@ -25,167 +26,88 @@ module Synvert
25
26
  ##### State transition tables begin ###
26
27
 
27
28
  racc_action_table = [
28
- 8, 19, 11, 15, 53, 16, 10, 8, 20, 22,
29
- 10, 53, 45, 23, 43, 24, 8, 10, 26, 45,
30
- 53, 27, 40, 10, 63, 64, 10, 68, 45, 75,
31
- 77, 78, 79, 46, 47, 48, 49, 50, 51, 52,
32
- 46, 47, 48, 49, 50, 51, 52, 80, nil, 46,
33
- 47, 48, 49, 50, 51, 52, 8, nil, nil, nil,
34
- 53, nil, nil, 8, nil, nil, 10, 53, 45, nil,
35
- 8, nil, nil, 10, 53, 45, nil, nil, nil, nil,
36
- 10, nil, 45, nil, nil, nil, nil, nil, nil, 46,
37
- 47, 48, 49, 50, 51, 52, 46, 47, 48, 49,
38
- 50, 51, 52, 46, 47, 48, 49, 50, 51, 52,
39
- 8, nil, nil, nil, 53, nil, nil, 8, nil, nil,
40
- 10, 53, 45, nil, 8, nil, nil, 10, 53, 45,
41
- nil, 61, nil, nil, 10, nil, 45, nil, nil, nil,
42
- nil, nil, nil, 46, 47, 48, 49, 50, 51, 52,
43
- 46, 47, 48, 49, 50, 51, 52, 46, 47, 48,
44
- 49, 50, 51, 52, 8, nil, nil, nil, 53, nil,
45
- nil, 8, nil, nil, 10, 53, 45, nil, 8, 65,
46
- nil, 10, 53, 45, nil, nil, 69, nil, 10, nil,
47
- 45, nil, nil, 71, nil, nil, nil, 46, 47, 48,
48
- 49, 50, 51, 52, 46, 47, 48, 49, 50, 51,
49
- 52, 46, 47, 48, 49, 50, 51, 52, 8, nil,
50
- nil, nil, 53, nil, nil, 8, nil, nil, 10, 53,
51
- 45, nil, 8, 73, nil, 10, nil, 45, 6, 2,
52
- 3, 4, 10, nil, nil, nil, nil, nil, nil, nil,
53
- 5, 46, 47, 48, 49, 50, 51, 52, 46, 47,
54
- 48, 49, 50, 51, 52, 8, nil, nil, nil, nil,
55
- 8, 6, 2, 3, 4, 10, 6, 2, 3, 4,
56
- 10, nil, nil, 5, 8, nil, nil, nil, 5, 8,
57
- 6, 2, 3, 4, 10, 6, 2, 3, 4, 10,
58
- nil, nil, 5, 8, nil, nil, nil, 5, 8, 6,
59
- 2, 3, 4, 10, 6, 2, 3, 4, 10, nil,
60
- nil, 5, nil, nil, nil, nil, 5, 35, 28, 30,
61
- 29, 32, 31, 34, 33, 38, 37, 36 ]
29
+ 7, 8, 7, 12, 41, 10, 11, 7, 4, 5,
30
+ 33, 41, 31, 14, 16, 17, 18, 33, 6, 20,
31
+ 42, 34, 35, 36, 37, 38, 39, 40, 34, 35,
32
+ 36, 37, 38, 39, 40, 7, 7, 22, 24, 41,
33
+ 26, 27, 4, 5, 28, 33, 16, 7, 45, 46,
34
+ 48, nil, 6, 4, 5, nil, 34, 35, 36, 37,
35
+ 38, 39, 40, 6, 7, nil, 7, nil, 7, nil,
36
+ 4, 5, 4, 5, 4, 5, nil, nil, nil, nil,
37
+ 6, nil, 6, nil, 6 ]
62
38
 
63
39
  racc_action_check = [
64
- 28, 8, 1, 5, 28, 6, 8, 29, 9, 10,
65
- 28, 29, 28, 11, 28, 15, 30, 29, 18, 29,
66
- 30, 21, 25, 27, 37, 38, 30, 45, 30, 66,
67
- 68, 70, 72, 28, 28, 28, 28, 28, 28, 28,
68
- 29, 29, 29, 29, 29, 29, 29, 74, nil, 30,
69
- 30, 30, 30, 30, 30, 30, 31, nil, nil, nil,
70
- 31, nil, nil, 32, nil, nil, 31, 32, 31, nil,
71
- 33, nil, nil, 32, 33, 32, nil, nil, nil, nil,
72
- 33, nil, 33, nil, nil, nil, nil, nil, nil, 31,
73
- 31, 31, 31, 31, 31, 31, 32, 32, 32, 32,
74
- 32, 32, 32, 33, 33, 33, 33, 33, 33, 33,
75
- 34, nil, nil, nil, 34, nil, nil, 35, nil, nil,
76
- 34, 35, 34, nil, 36, nil, nil, 35, 36, 35,
77
- nil, 35, nil, nil, 36, nil, 36, nil, nil, nil,
78
- nil, nil, nil, 34, 34, 34, 34, 34, 34, 34,
79
- 35, 35, 35, 35, 35, 35, 35, 36, 36, 36,
80
- 36, 36, 36, 36, 43, nil, nil, nil, 43, nil,
81
- nil, 61, nil, nil, 43, 61, 43, nil, 63, 43,
82
- nil, 61, 63, 61, nil, nil, 61, nil, 63, nil,
83
- 63, nil, nil, 63, nil, nil, nil, 43, 43, 43,
84
- 43, 43, 43, 43, 61, 61, 61, 61, 61, 61,
85
- 61, 63, 63, 63, 63, 63, 63, 63, 64, nil,
86
- nil, nil, 64, nil, nil, 67, nil, nil, 64, 67,
87
- 64, nil, 0, 64, nil, 67, nil, 67, 0, 0,
88
- 0, 0, 0, nil, nil, nil, nil, nil, nil, nil,
89
- 0, 64, 64, 64, 64, 64, 64, 64, 67, 67,
90
- 67, 67, 67, 67, 67, 2, nil, nil, nil, nil,
91
- 3, 2, 2, 2, 2, 2, 3, 3, 3, 3,
92
- 3, nil, nil, 2, 4, nil, nil, nil, 3, 7,
93
- 4, 4, 4, 4, 4, 7, 7, 7, 7, 7,
94
- nil, nil, 4, 16, nil, nil, nil, 7, 24, 16,
95
- 16, 16, 16, 16, 24, 24, 24, 24, 24, nil,
96
- nil, 16, nil, nil, nil, nil, 24, 22, 22, 22,
97
- 22, 22, 22, 22, 22, 22, 22, 22 ]
40
+ 27, 1, 0, 4, 27, 3, 3, 31, 0, 0,
41
+ 27, 31, 27, 6, 7, 8, 11, 31, 0, 14,
42
+ 31, 27, 27, 27, 27, 27, 27, 27, 31, 31,
43
+ 31, 31, 31, 31, 31, 44, 2, 16, 19, 44,
44
+ 21, 22, 2, 2, 23, 44, 26, 5, 33, 43,
45
+ 45, nil, 2, 5, 5, nil, 44, 44, 44, 44,
46
+ 44, 44, 44, 5, 12, nil, 18, nil, 20, nil,
47
+ 12, 12, 18, 18, 20, 20, nil, nil, nil, nil,
48
+ 12, nil, 18, nil, 20 ]
98
49
 
99
50
  racc_action_pointer = [
100
- 230, 2, 263, 268, 282, -2, -13, 287, -6, 1,
101
- 5, 13, nil, nil, nil, -6, 301, nil, 11, nil,
102
- nil, 8, 305, nil, 306, 3, nil, 11, -2, 5,
103
- 14, 54, 61, 68, 108, 115, 122, 8, 9, nil,
104
- nil, nil, nil, 162, nil, -7, nil, nil, nil, nil,
105
- nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
106
- nil, 169, nil, 176, 216, nil, 12, 223, 15, nil,
107
- 14, nil, 15, nil, 30, nil, nil, nil, nil, nil,
108
- nil ]
51
+ 0, 1, 34, -2, -13, 45, 8, 4, 15, nil,
52
+ nil, 0, 62, nil, 0, nil, 33, nil, 64, 21,
53
+ 66, 29, 21, 27, nil, nil, 36, -2, nil, nil,
54
+ nil, 5, nil, 26, nil, nil, nil, nil, nil, nil,
55
+ nil, nil, nil, 34, 33, 37, nil, nil, nil ]
109
56
 
110
57
  racc_action_default = [
111
- -45, -45, -45, -45, -45, -45, -45, -7, -12, -13,
112
- -45, -45, -1, -2, -3, -45, -45, -6, -11, -9,
113
- -10, -45, -45, 81, -45, -45, -8, -15, -45, -45,
114
- -45, -45, -45, -45, -45, -45, -45, -45, -45, -4,
115
- -5, -14, -16, -45, -35, -45, -37, -38, -39, -40,
116
- -41, -42, -43, -44, -17, -18, -19, -20, -21, -22,
117
- -23, -45, -24, -45, -45, -25, -45, -34, -45, -26,
118
- -45, -27, -45, -28, -45, -29, -33, -36, -30, -31,
119
- -32 ]
58
+ -28, -28, -2, -3, -28, -28, -28, -9, -28, -1,
59
+ -4, -28, -28, -7, -28, -10, -28, 49, -28, -28,
60
+ -28, -28, -28, -28, -6, -8, -12, -28, -5, -11,
61
+ -13, -28, -18, -28, -20, -21, -22, -23, -24, -25,
62
+ -26, -27, -14, -28, -17, -28, -15, -16, -19 ]
120
63
 
121
64
  racc_goto_table = [
122
- 1, 18, 12, 13, 14, 66, 7, 17, 7, 7,
123
- 7, 21, nil, 7, nil, nil, 25, nil, nil, nil,
124
- 41, nil, 7, 70, 39, 72, 74, nil, nil, 76,
125
- 7, 42, 54, 55, 56, 57, 58, 59, 60, 62 ]
65
+ 15, 32, 13, 43, 1, 32, 9, 21, 30, 19,
66
+ nil, nil, nil, nil, nil, 23, 47, 25, 32, 29 ]
126
67
 
127
68
  racc_goto_check = [
128
- 1, 3, 1, 1, 1, 6, 2, 1, 2, 2,
129
- 2, 4, nil, 2, nil, nil, 1, nil, nil, nil,
130
- 3, nil, 2, 6, 1, 6, 6, nil, nil, 6,
131
- 2, 5, 5, 5, 5, 5, 5, 5, 5, 5 ]
69
+ 4, 3, 2, 7, 1, 3, 1, 5, 6, 2,
70
+ nil, nil, nil, nil, nil, 2, 7, 2, 3, 4 ]
132
71
 
133
72
  racc_goto_pointer = [
134
- nil, 0, 6, -7, 1, 3, -38 ]
73
+ nil, 4, -3, -26, -7, -9, -19, -28 ]
135
74
 
136
75
  racc_goto_default = [
137
- nil, nil, 44, 9, nil, 67, nil ]
76
+ nil, nil, 2, 3, nil, nil, 44, nil ]
138
77
 
139
78
  racc_reduce_table = [
140
79
  0, 0, :racc_error,
141
- 2, 43, :_reduce_1,
142
- 2, 43, :_reduce_2,
143
- 2, 43, :_reduce_3,
144
- 4, 43, :_reduce_4,
145
- 4, 43, :_reduce_5,
146
- 2, 43, :_reduce_6,
147
- 1, 43, :_reduce_7,
148
- 3, 44, :_reduce_8,
149
- 2, 44, :_reduce_9,
150
- 2, 44, :_reduce_10,
151
- 2, 44, :_reduce_11,
152
- 1, 44, :_reduce_12,
153
- 1, 44, :_reduce_13,
154
- 4, 45, :_reduce_14,
155
- 3, 45, :_reduce_15,
156
- 3, 46, :_reduce_16,
157
- 3, 46, :_reduce_17,
158
- 3, 46, :_reduce_18,
159
- 3, 46, :_reduce_19,
160
- 3, 46, :_reduce_20,
161
- 3, 46, :_reduce_21,
162
- 3, 46, :_reduce_22,
163
- 3, 46, :_reduce_23,
164
- 3, 46, :_reduce_24,
165
- 4, 46, :_reduce_25,
166
- 4, 46, :_reduce_26,
167
- 4, 46, :_reduce_27,
168
- 4, 46, :_reduce_28,
169
- 5, 46, :_reduce_29,
170
- 5, 46, :_reduce_30,
171
- 5, 46, :_reduce_31,
172
- 5, 46, :_reduce_32,
173
- 2, 48, :_reduce_33,
174
- 1, 48, :_reduce_34,
175
- 1, 47, :_reduce_none,
176
- 3, 47, :_reduce_36,
177
- 1, 47, :_reduce_37,
178
- 1, 47, :_reduce_38,
179
- 1, 47, :_reduce_39,
180
- 1, 47, :_reduce_40,
181
- 1, 47, :_reduce_41,
182
- 1, 47, :_reduce_42,
183
- 1, 47, :_reduce_43,
184
- 1, 47, :_reduce_44 ]
185
-
186
- racc_reduce_n = 45
187
-
188
- racc_shift_n = 81
80
+ 2, 31, :_reduce_1,
81
+ 1, 31, :_reduce_2,
82
+ 1, 32, :_reduce_3,
83
+ 2, 32, :_reduce_4,
84
+ 5, 32, :_reduce_5,
85
+ 4, 32, :_reduce_6,
86
+ 2, 32, :_reduce_7,
87
+ 4, 32, :_reduce_8,
88
+ 1, 33, :_reduce_9,
89
+ 2, 33, :_reduce_10,
90
+ 4, 34, :_reduce_11,
91
+ 3, 34, :_reduce_12,
92
+ 3, 35, :_reduce_13,
93
+ 4, 35, :_reduce_14,
94
+ 5, 35, :_reduce_15,
95
+ 2, 37, :_reduce_16,
96
+ 1, 37, :_reduce_17,
97
+ 1, 36, :_reduce_none,
98
+ 3, 36, :_reduce_19,
99
+ 1, 36, :_reduce_20,
100
+ 1, 36, :_reduce_21,
101
+ 1, 36, :_reduce_22,
102
+ 1, 36, :_reduce_23,
103
+ 1, 36, :_reduce_24,
104
+ 1, 36, :_reduce_25,
105
+ 1, 36, :_reduce_26,
106
+ 1, 36, :_reduce_27 ]
107
+
108
+ racc_reduce_n = 28
109
+
110
+ racc_shift_n = 49
189
111
 
190
112
  racc_token_table = {
191
113
  false => 0,
@@ -197,41 +119,29 @@ racc_token_table = {
197
119
  :tIDENTIFIER_VALUE => 6,
198
120
  :tINDEX => 7,
199
121
  :tPSEUDO_CLASS => 8,
200
- :tCHILD => 9,
201
- :tSUBSEQUENT_SIBLING => 10,
202
- :tNEXT_SIBLING => 11,
203
- :tOPEN_ATTRIBUTE => 12,
204
- :tCLOSE_ATTRIBUTE => 13,
205
- :tOPEN_DYNAMIC_ATTRIBUTE => 14,
206
- :tCLOSE_DYNAMIC_ATTRIBUTE => 15,
207
- :tOPEN_ARRAY => 16,
208
- :tCLOSE_ARRAY => 17,
209
- :tOPEN_SELECTOR => 18,
210
- :tCLOSE_SELECTOR => 19,
211
- :tOPEN_GOTO_SCOPE => 20,
212
- :tCLOSE_GOTO_SCOPE => 21,
213
- :tEQUAL => 22,
214
- :tNOT_EQUAL => 23,
215
- :tMATCH => 24,
216
- :tNOT_MATCH => 25,
217
- :tGREATER_THAN => 26,
218
- :tGREATER_THAN_OR_EQUAL => 27,
219
- :tLESS_THAN => 28,
220
- :tLESS_THAN_OR_EQUAL => 29,
221
- :tIN => 30,
222
- :tNOT_IN => 31,
223
- :tINCLUDES => 32,
224
- :tARRAY_VALUE => 33,
225
- :tDYNAMIC_ATTRIBUTE => 34,
226
- :tBOOLEAN => 35,
227
- :tFLOAT => 36,
228
- :tINTEGER => 37,
229
- :tNIL => 38,
230
- :tREGEXP => 39,
231
- :tSTRING => 40,
232
- :tSYMBOL => 41 }
233
-
234
- racc_nt_base = 42
122
+ :tRELATIONSHIP => 9,
123
+ :tOPEN_ATTRIBUTE => 10,
124
+ :tCLOSE_ATTRIBUTE => 11,
125
+ :tOPEN_DYNAMIC_ATTRIBUTE => 12,
126
+ :tCLOSE_DYNAMIC_ATTRIBUTE => 13,
127
+ :tOPEN_ARRAY => 14,
128
+ :tCLOSE_ARRAY => 15,
129
+ :tOPEN_SELECTOR => 16,
130
+ :tCLOSE_SELECTOR => 17,
131
+ :tOPEN_GOTO_SCOPE => 18,
132
+ :tCLOSE_GOTO_SCOPE => 19,
133
+ :tOPERATOR => 20,
134
+ :tARRAY_VALUE => 21,
135
+ :tDYNAMIC_ATTRIBUTE => 22,
136
+ :tBOOLEAN => 23,
137
+ :tFLOAT => 24,
138
+ :tINTEGER => 25,
139
+ :tNIL => 26,
140
+ :tREGEXP => 27,
141
+ :tSTRING => 28,
142
+ :tSYMBOL => 29 }
143
+
144
+ racc_nt_base = 30
235
145
 
236
146
  racc_use_result_var = false
237
147
 
@@ -261,9 +171,7 @@ Racc_token_to_s_table = [
261
171
  "tIDENTIFIER_VALUE",
262
172
  "tINDEX",
263
173
  "tPSEUDO_CLASS",
264
- "tCHILD",
265
- "tSUBSEQUENT_SIBLING",
266
- "tNEXT_SIBLING",
174
+ "tRELATIONSHIP",
267
175
  "tOPEN_ATTRIBUTE",
268
176
  "tCLOSE_ATTRIBUTE",
269
177
  "tOPEN_DYNAMIC_ATTRIBUTE",
@@ -274,17 +182,7 @@ Racc_token_to_s_table = [
274
182
  "tCLOSE_SELECTOR",
275
183
  "tOPEN_GOTO_SCOPE",
276
184
  "tCLOSE_GOTO_SCOPE",
277
- "tEQUAL",
278
- "tNOT_EQUAL",
279
- "tMATCH",
280
- "tNOT_MATCH",
281
- "tGREATER_THAN",
282
- "tGREATER_THAN_OR_EQUAL",
283
- "tLESS_THAN",
284
- "tLESS_THAN_OR_EQUAL",
285
- "tIN",
286
- "tNOT_IN",
287
- "tINCLUDES",
185
+ "tOPERATOR",
288
186
  "tARRAY_VALUE",
289
187
  "tDYNAMIC_ATTRIBUTE",
290
188
  "tBOOLEAN",
@@ -297,6 +195,7 @@ Racc_token_to_s_table = [
297
195
  "$start",
298
196
  "expression",
299
197
  "selector",
198
+ "simple_selector",
300
199
  "attribute_list",
301
200
  "attribute",
302
201
  "value",
@@ -309,176 +208,108 @@ Racc_debug_parser = false
309
208
  # reduce 0 omitted
310
209
 
311
210
  def _reduce_1(val, _values)
312
- Compiler::Expression.new(rest: val[1], relationship: :child)
211
+ Compiler::Expression.new(selector: val[0], rest: val[1])
313
212
  end
314
213
 
315
214
  def _reduce_2(val, _values)
316
- Compiler::Expression.new(rest: val[1], relationship: :subsequent_sibling)
215
+ Compiler::Expression.new(selector: val[0])
317
216
  end
318
217
 
319
218
  def _reduce_3(val, _values)
320
- Compiler::Expression.new(rest: val[1], relationship: :next_sibling)
219
+ Compiler::Selector.new(simple_selector: val[0])
321
220
  end
322
221
 
323
222
  def _reduce_4(val, _values)
324
- Compiler::Expression.new(goto_scope: val[1], rest: val[3])
223
+ Compiler::Selector.new(simple_selector: val[0], index: val[1])
325
224
  end
326
225
 
327
226
  def _reduce_5(val, _values)
328
- Compiler::Expression.new(relationship: val[0].to_sym, rest: val[2])
227
+ Compiler::Selector.new(simple_selector: val[0], pseudo_class: val[1], pseudo_selector: val[3])
329
228
  end
330
229
 
331
230
  def _reduce_6(val, _values)
332
- Compiler::Expression.new(selector: val[0], rest: val[1])
231
+ Compiler::Selector.new(pseudo_class: val[0], pseudo_selector: val[2])
333
232
  end
334
233
 
335
234
  def _reduce_7(val, _values)
336
- Compiler::Expression.new(selector: val[0])
235
+ Compiler::Selector.new(relationship: val[0], rest: val[1])
337
236
  end
338
237
 
339
238
  def _reduce_8(val, _values)
340
- Compiler::Selector.new(node_type: val[0], attribute_list: val[1], index: val[2])
239
+ Compiler::Selector.new(goto_scope: val[1], rest: val[3])
341
240
  end
342
241
 
343
242
  def _reduce_9(val, _values)
344
- Compiler::Selector.new(node_type: val[0], index: val[1])
243
+ Compiler::SimpleSelector.new(node_type: val[0])
345
244
  end
346
245
 
347
246
  def _reduce_10(val, _values)
348
- Compiler::Selector.new(attribute_list: val[0], index: val[1])
247
+ Compiler::SimpleSelector.new(node_type: val[0], attribute_list: val[1])
349
248
  end
350
249
 
351
250
  def _reduce_11(val, _values)
352
- Compiler::Selector.new(node_type: val[0], attribute_list: val[1])
251
+ Compiler::AttributeList.new(attribute: val[1], rest: val[3])
353
252
  end
354
253
 
355
254
  def _reduce_12(val, _values)
356
- Compiler::Selector.new(node_type: val[0])
255
+ Compiler::AttributeList.new(attribute: val[1])
357
256
  end
358
257
 
359
258
  def _reduce_13(val, _values)
360
- Compiler::Selector.new(attribute_list: val[0])
259
+ Compiler::Attribute.new(key: val[0], value: val[2], operator: val[1])
361
260
  end
362
261
 
363
262
  def _reduce_14(val, _values)
364
- Compiler::AttributeList.new(attribute: val[1], rest: val[3])
263
+ Compiler::Attribute.new(key: val[0], value: Compiler::Array.new, operator: val[1])
365
264
  end
366
265
 
367
266
  def _reduce_15(val, _values)
368
- Compiler::AttributeList.new(attribute: val[1])
267
+ Compiler::Attribute.new(key: val[0], value: val[3], operator: val[1])
369
268
  end
370
269
 
371
270
  def _reduce_16(val, _values)
372
- Compiler::Attribute.new(key: val[0], value: val[2], operator: :!=)
373
- end
374
-
375
- def _reduce_17(val, _values)
376
- Compiler::Attribute.new(key: val[0], value: val[2], operator: :!~)
377
- end
378
-
379
- def _reduce_18(val, _values)
380
- Compiler::Attribute.new(key: val[0], value: val[2], operator: :=~)
381
- end
382
-
383
- def _reduce_19(val, _values)
384
- Compiler::Attribute.new(key: val[0], value: val[2], operator: :>=)
385
- end
386
-
387
- def _reduce_20(val, _values)
388
- Compiler::Attribute.new(key: val[0], value: val[2], operator: :>)
389
- end
390
-
391
- def _reduce_21(val, _values)
392
- Compiler::Attribute.new(key: val[0], value: val[2], operator: :<=)
393
- end
394
-
395
- def _reduce_22(val, _values)
396
- Compiler::Attribute.new(key: val[0], value: val[2], operator: :<)
397
- end
398
-
399
- def _reduce_23(val, _values)
400
- Compiler::Attribute.new(key: val[0], value: val[2], operator: :==)
401
- end
402
-
403
- def _reduce_24(val, _values)
404
- Compiler::Attribute.new(key: val[0], value: val[2], operator: :includes)
405
- end
406
-
407
- def _reduce_25(val, _values)
408
- Compiler::Attribute.new(key: val[0], value: Compiler::Array.new, operator: :!=)
409
- end
410
-
411
- def _reduce_26(val, _values)
412
- Compiler::Attribute.new(key: val[0], value: Compiler::Array.new, operator: :==)
413
- end
414
-
415
- def _reduce_27(val, _values)
416
- Compiler::Attribute.new(key: val[0], value: Compiler::Array.new, operator: :not_in)
417
- end
418
-
419
- def _reduce_28(val, _values)
420
- Compiler::Attribute.new(key: val[0], value: Compiler::Array.new, operator: :in)
421
- end
422
-
423
- def _reduce_29(val, _values)
424
- Compiler::Attribute.new(key: val[0], value: val[3], operator: :!=)
425
- end
426
-
427
- def _reduce_30(val, _values)
428
- Compiler::Attribute.new(key: val[0], value: val[3], operator: :==)
429
- end
430
-
431
- def _reduce_31(val, _values)
432
- Compiler::Attribute.new(key: val[0], value: val[3], operator: :not_in)
433
- end
434
-
435
- def _reduce_32(val, _values)
436
- Compiler::Attribute.new(key: val[0], value: val[3], operator: :in)
437
- end
438
-
439
- def _reduce_33(val, _values)
440
271
  Compiler::Array.new(value: val[0], rest: val[1])
441
272
  end
442
273
 
443
- def _reduce_34(val, _values)
274
+ def _reduce_17(val, _values)
444
275
  Compiler::Array.new(value: val[0])
445
276
  end
446
277
 
447
- # reduce 35 omitted
278
+ # reduce 18 omitted
448
279
 
449
- def _reduce_36(val, _values)
280
+ def _reduce_19(val, _values)
450
281
  Compiler::DynamicAttribute.new(value: val[1])
451
282
  end
452
283
 
453
- def _reduce_37(val, _values)
284
+ def _reduce_20(val, _values)
454
285
  Compiler::Boolean.new(value: val[0])
455
286
  end
456
287
 
457
- def _reduce_38(val, _values)
288
+ def _reduce_21(val, _values)
458
289
  Compiler::Float.new(value: val[0])
459
290
  end
460
291
 
461
- def _reduce_39(val, _values)
292
+ def _reduce_22(val, _values)
462
293
  Compiler::Integer.new(value: val[0])
463
294
  end
464
295
 
465
- def _reduce_40(val, _values)
296
+ def _reduce_23(val, _values)
466
297
  Compiler::Nil.new(value: val[0])
467
298
  end
468
299
 
469
- def _reduce_41(val, _values)
300
+ def _reduce_24(val, _values)
470
301
  Compiler::Regexp.new(value: val[0])
471
302
  end
472
303
 
473
- def _reduce_42(val, _values)
304
+ def _reduce_25(val, _values)
474
305
  Compiler::String.new(value: val[0])
475
306
  end
476
307
 
477
- def _reduce_43(val, _values)
308
+ def _reduce_26(val, _values)
478
309
  Compiler::Symbol.new(value: val[0])
479
310
  end
480
311
 
481
- def _reduce_44(val, _values)
312
+ def _reduce_27(val, _values)
482
313
  Compiler::Identifier.new(value: val[0])
483
314
  end
484
315