racc 1.5.2 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.ja.rdoc +0 -1
- data/README.rdoc +6 -7
- data/{rdoc → doc}/en/NEWS.en.rdoc +0 -0
- data/{rdoc → doc}/en/grammar.en.rdoc +27 -31
- data/doc/en/grammar2.en.rdoc +219 -0
- data/{rdoc → doc}/ja/NEWS.ja.rdoc +0 -0
- data/{rdoc → doc}/ja/command.ja.html +0 -0
- data/{rdoc → doc}/ja/debug.ja.rdoc +0 -0
- data/{rdoc → doc}/ja/grammar.ja.rdoc +0 -0
- data/{rdoc → doc}/ja/index.ja.html +0 -0
- data/{rdoc → doc}/ja/parser.ja.rdoc +0 -0
- data/{rdoc → doc}/ja/usage.ja.html +0 -0
- data/ext/racc/cparse/cparse.c +1 -1
- data/ext/racc/cparse/extconf.rb +1 -0
- data/lib/racc/info.rb +1 -1
- data/lib/racc/parser-text.rb +1 -1
- data/lib/racc/parser.rb +1 -1
- data/lib/racc/parserfilegenerator.rb +0 -44
- data/lib/racc/statetransitiontable.rb +2 -8
- metadata +15 -121
- data/Rakefile +0 -79
- data/ext/racc/com/headius/racc/Cparse.java +0 -849
- data/lib/racc/pre-setup +0 -13
- data/sample/array.y +0 -67
- data/sample/array2.y +0 -59
- data/sample/calc-ja.y +0 -66
- data/sample/calc.y +0 -65
- data/sample/conflict.y +0 -15
- data/sample/hash.y +0 -60
- data/sample/lalr.y +0 -17
- data/sample/lists.y +0 -57
- data/sample/syntax.y +0 -46
- data/sample/yyerr.y +0 -46
- data/test/assets/cadenza.y +0 -170
- data/test/assets/cast.y +0 -926
- data/test/assets/chk.y +0 -126
- data/test/assets/conf.y +0 -16
- data/test/assets/csspool.y +0 -729
- data/test/assets/digraph.y +0 -29
- data/test/assets/echk.y +0 -118
- data/test/assets/edtf.y +0 -583
- data/test/assets/err.y +0 -60
- data/test/assets/error_recovery.y +0 -35
- data/test/assets/expect.y +0 -7
- data/test/assets/firstline.y +0 -4
- data/test/assets/huia.y +0 -318
- data/test/assets/ichk.y +0 -102
- data/test/assets/intp.y +0 -546
- data/test/assets/journey.y +0 -47
- data/test/assets/liquor.y +0 -313
- data/test/assets/machete.y +0 -423
- data/test/assets/macruby.y +0 -2197
- data/test/assets/mailp.y +0 -437
- data/test/assets/mediacloth.y +0 -599
- data/test/assets/mof.y +0 -649
- data/test/assets/namae.y +0 -302
- data/test/assets/nasl.y +0 -626
- data/test/assets/newsyn.y +0 -25
- data/test/assets/noend.y +0 -4
- data/test/assets/nokogiri-css.y +0 -255
- data/test/assets/nonass.y +0 -41
- data/test/assets/normal.y +0 -27
- data/test/assets/norule.y +0 -4
- data/test/assets/nullbug1.y +0 -25
- data/test/assets/nullbug2.y +0 -15
- data/test/assets/opal.y +0 -1807
- data/test/assets/opt.y +0 -123
- data/test/assets/percent.y +0 -35
- data/test/assets/php_serialization.y +0 -98
- data/test/assets/recv.y +0 -97
- data/test/assets/riml.y +0 -665
- data/test/assets/rrconf.y +0 -14
- data/test/assets/ruby18.y +0 -1943
- data/test/assets/ruby19.y +0 -2174
- data/test/assets/ruby20.y +0 -2350
- data/test/assets/ruby21.y +0 -2359
- data/test/assets/ruby22.y +0 -2381
- data/test/assets/scan.y +0 -72
- data/test/assets/syntax.y +0 -50
- data/test/assets/tp_plus.y +0 -622
- data/test/assets/twowaysql.y +0 -278
- data/test/assets/unterm.y +0 -5
- data/test/assets/useless.y +0 -12
- data/test/assets/yyerr.y +0 -46
- data/test/bench.y +0 -36
- data/test/helper.rb +0 -115
- data/test/infini.y +0 -8
- data/test/regress/cadenza +0 -796
- data/test/regress/cast +0 -3428
- data/test/regress/csspool +0 -2314
- data/test/regress/edtf +0 -1794
- data/test/regress/huia +0 -1392
- data/test/regress/journey +0 -222
- data/test/regress/liquor +0 -885
- data/test/regress/machete +0 -833
- data/test/regress/mediacloth +0 -1463
- data/test/regress/mof +0 -1368
- data/test/regress/namae +0 -634
- data/test/regress/nasl +0 -2058
- data/test/regress/nokogiri-css +0 -836
- data/test/regress/opal +0 -6431
- data/test/regress/php_serialization +0 -336
- data/test/regress/riml +0 -3283
- data/test/regress/ruby18 +0 -6344
- data/test/regress/ruby22 +0 -7460
- data/test/regress/tp_plus +0 -1933
- data/test/regress/twowaysql +0 -556
- data/test/scandata/brace +0 -7
- data/test/scandata/gvar +0 -1
- data/test/scandata/normal +0 -4
- data/test/scandata/percent +0 -18
- data/test/scandata/slash +0 -10
- data/test/src.intp +0 -34
- data/test/start.y +0 -20
- data/test/test_chk_y.rb +0 -52
- data/test/test_grammar_file_parser.rb +0 -15
- data/test/test_racc_command.rb +0 -339
- data/test/test_scan_y.rb +0 -52
- data/test/testscanner.rb +0 -51
- data/web/racc.en.rhtml +0 -42
- data/web/racc.ja.rhtml +0 -51
data/test/regress/nokogiri-css
DELETED
@@ -1,836 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# DO NOT MODIFY!!!!
|
3
|
-
# This file is automatically generated by Racc 1.5.0
|
4
|
-
# from Racc grammar file "".
|
5
|
-
#
|
6
|
-
|
7
|
-
require 'racc/parser.rb'
|
8
|
-
|
9
|
-
|
10
|
-
require 'nokogiri/css/parser_extras'
|
11
|
-
module Nokogiri
|
12
|
-
module CSS
|
13
|
-
class Parser < Racc::Parser
|
14
|
-
##### State transition tables begin ###
|
15
|
-
|
16
|
-
racc_action_table = [
|
17
|
-
24, 93, 56, 57, 33, 55, 94, 23, 24, 22,
|
18
|
-
12, 93, 33, 27, 35, 52, 44, 22, -23, 25,
|
19
|
-
45, 98, 23, 33, 26, 18, 20, 25, 27, -23,
|
20
|
-
23, 24, 26, 18, 20, 33, 27, 11, 39, 24,
|
21
|
-
22, 23, 74, 33, 18, 91, 90, 27, 22, 12,
|
22
|
-
25, 24, -23, 23, 85, 26, 18, 20, 25, 27,
|
23
|
-
66, 23, 24, 26, 18, 20, 33, 27, 101, 100,
|
24
|
-
51, 22, 86, 88, 24, 26, 56, 87, 89, 60,
|
25
|
-
92, 25, 95, 46, 23, 49, 26, 18, 20, 90,
|
26
|
-
27, 33, 33, 51, 96, 99, 56, 58, 26, 60,
|
27
|
-
102, 103, 33, 33, 33, 93, 39, 39, 105, 23,
|
28
|
-
23, 108, 18, 18, 20, 27, 27, 39, 39, 39,
|
29
|
-
23, 23, 23, 18, 18, 18, 27, 27, 27, 33,
|
30
|
-
33, 56, 87, 109, 60, 22, 56, 87, nil, 60,
|
31
|
-
33, nil, nil, nil, 39, 39, nil, 23, 23, nil,
|
32
|
-
18, 18, 20, 27, 27, 39, 82, 83, 23, 56,
|
33
|
-
87, 18, 60, nil, 27, 82, 83, 78, 79, 80,
|
34
|
-
nil, 81, nil, nil, nil, 77, 78, 79, 80, nil,
|
35
|
-
81, 4, 5, 10, 77, 4, 5, 43, nil, nil,
|
36
|
-
nil, 6, nil, 8, 7, 6, nil, 8, 7, 4,
|
37
|
-
5, 10, nil, nil, nil, nil, nil, nil, nil, 6,
|
38
|
-
nil, 8, 7 ]
|
39
|
-
|
40
|
-
racc_action_check = [
|
41
|
-
3, 58, 24, 24, 3, 24, 57, 15, 9, 3,
|
42
|
-
64, 57, 9, 15, 11, 24, 18, 9, 58, 3,
|
43
|
-
21, 64, 3, 14, 3, 3, 3, 9, 3, 22,
|
44
|
-
9, 12, 9, 9, 9, 12, 9, 1, 14, 42,
|
45
|
-
12, 14, 45, 42, 14, 55, 55, 14, 42, 1,
|
46
|
-
12, 27, 46, 12, 49, 12, 12, 12, 42, 12,
|
47
|
-
27, 42, 43, 42, 42, 42, 43, 42, 76, 76,
|
48
|
-
27, 43, 50, 53, 23, 27, 51, 51, 54, 51,
|
49
|
-
56, 43, 59, 23, 43, 23, 43, 43, 43, 60,
|
50
|
-
43, 28, 25, 23, 61, 75, 25, 25, 23, 25,
|
51
|
-
84, 86, 29, 30, 31, 87, 28, 25, 91, 28,
|
52
|
-
25, 94, 28, 25, 25, 28, 25, 29, 30, 31,
|
53
|
-
29, 30, 31, 29, 30, 31, 29, 30, 31, 32,
|
54
|
-
39, 90, 90, 105, 90, 39, 92, 92, nil, 92,
|
55
|
-
62, nil, nil, nil, 32, 39, nil, 32, 39, nil,
|
56
|
-
32, 39, 39, 32, 39, 62, 47, 47, 62, 93,
|
57
|
-
93, 62, 93, nil, 62, 48, 48, 47, 47, 47,
|
58
|
-
nil, 47, nil, nil, nil, 47, 48, 48, 48, nil,
|
59
|
-
48, 0, 0, 0, 48, 17, 17, 17, nil, nil,
|
60
|
-
nil, 0, nil, 0, 0, 17, nil, 17, 17, 26,
|
61
|
-
26, 26, nil, nil, nil, nil, nil, nil, nil, 26,
|
62
|
-
nil, 26, 26 ]
|
63
|
-
|
64
|
-
racc_action_pointer = [
|
65
|
-
174, 37, nil, -2, nil, nil, nil, nil, nil, 6,
|
66
|
-
nil, 14, 29, nil, 17, -17, nil, 178, 5, nil,
|
67
|
-
nil, -9, 0, 72, -8, 86, 192, 49, 85, 96,
|
68
|
-
97, 98, 123, nil, nil, nil, nil, nil, nil, 124,
|
69
|
-
nil, nil, 37, 60, nil, 31, 23, 153, 162, 29,
|
70
|
-
43, 66, nil, 50, 55, 34, 68, -1, -11, 59,
|
71
|
-
77, 71, 134, nil, -2, nil, nil, nil, nil, nil,
|
72
|
-
nil, nil, nil, nil, nil, 70, 58, nil, nil, nil,
|
73
|
-
nil, nil, nil, nil, 75, nil, 90, 93, nil, nil,
|
74
|
-
121, 101, 126, 149, 98, nil, nil, nil, nil, nil,
|
75
|
-
nil, nil, nil, nil, nil, 120, nil, nil, nil, nil ]
|
76
|
-
|
77
|
-
racc_action_default = [
|
78
|
-
-74, -75, -2, -24, -4, -5, -6, -7, -8, -24,
|
79
|
-
-73, -75, -24, -3, -47, -10, -13, -17, -75, -19,
|
80
|
-
-20, -75, -22, -24, -75, -24, -74, -75, -53, -54,
|
81
|
-
-55, -56, -57, -58, -14, 110, -1, -9, -46, -24,
|
82
|
-
-11, -12, -24, -24, -18, -75, -29, -61, -61, -75,
|
83
|
-
-75, -75, -30, -75, -75, -38, -39, -40, -22, -75,
|
84
|
-
-38, -75, -70, -72, -75, -44, -45, -48, -49, -50,
|
85
|
-
-51, -52, -15, -16, -21, -75, -75, -62, -63, -64,
|
86
|
-
-65, -66, -67, -68, -75, -27, -75, -40, -31, -32,
|
87
|
-
-75, -43, -75, -75, -75, -33, -69, -71, -34, -25,
|
88
|
-
-59, -60, -26, -28, -35, -75, -36, -37, -42, -41 ]
|
89
|
-
|
90
|
-
racc_goto_table = [
|
91
|
-
53, 38, 13, 1, 42, 48, 62, 37, 34, 65,
|
92
|
-
40, 36, 63, 75, 84, 67, 68, 69, 70, 71,
|
93
|
-
62, 41, 50, 47, 54, nil, 63, nil, nil, 64,
|
94
|
-
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
95
|
-
nil, 72, 73, nil, nil, nil, nil, nil, nil, 97,
|
96
|
-
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
97
|
-
nil, nil, nil, nil, nil, nil, 104, nil, 106, 107 ]
|
98
|
-
|
99
|
-
racc_goto_check = [
|
100
|
-
18, 12, 2, 1, 5, 9, 7, 8, 2, 9,
|
101
|
-
10, 2, 12, 17, 17, 12, 12, 12, 12, 12,
|
102
|
-
7, 11, 15, 16, 19, nil, 12, nil, nil, 1,
|
103
|
-
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
104
|
-
nil, 2, 2, nil, nil, nil, nil, nil, nil, 12,
|
105
|
-
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
106
|
-
nil, nil, nil, nil, nil, nil, 18, nil, 18, 18 ]
|
107
|
-
|
108
|
-
racc_goto_pointer = [
|
109
|
-
nil, 3, -1, nil, nil, -13, nil, -19, -7, -18,
|
110
|
-
-5, 6, -13, nil, nil, -1, 0, -34, -24, 0,
|
111
|
-
nil, nil, nil, nil ]
|
112
|
-
|
113
|
-
racc_goto_default = [
|
114
|
-
nil, nil, nil, 2, 3, 9, 17, 14, nil, 15,
|
115
|
-
31, 30, 16, 29, 19, 21, nil, nil, 59, nil,
|
116
|
-
28, 32, 76, 61 ]
|
117
|
-
|
118
|
-
racc_reduce_table = [
|
119
|
-
0, 0, :racc_error,
|
120
|
-
3, 32, :_reduce_1,
|
121
|
-
1, 32, :_reduce_2,
|
122
|
-
2, 32, :_reduce_3,
|
123
|
-
1, 36, :_reduce_4,
|
124
|
-
1, 36, :_reduce_5,
|
125
|
-
1, 36, :_reduce_6,
|
126
|
-
1, 36, :_reduce_7,
|
127
|
-
1, 36, :_reduce_8,
|
128
|
-
2, 37, :_reduce_9,
|
129
|
-
1, 37, :_reduce_none,
|
130
|
-
2, 37, :_reduce_11,
|
131
|
-
2, 37, :_reduce_12,
|
132
|
-
1, 37, :_reduce_13,
|
133
|
-
2, 34, :_reduce_14,
|
134
|
-
3, 33, :_reduce_15,
|
135
|
-
3, 33, :_reduce_16,
|
136
|
-
1, 33, :_reduce_none,
|
137
|
-
2, 44, :_reduce_18,
|
138
|
-
1, 38, :_reduce_none,
|
139
|
-
1, 38, :_reduce_20,
|
140
|
-
3, 45, :_reduce_21,
|
141
|
-
1, 45, :_reduce_22,
|
142
|
-
1, 46, :_reduce_23,
|
143
|
-
0, 46, :_reduce_none,
|
144
|
-
4, 42, :_reduce_25,
|
145
|
-
4, 42, :_reduce_26,
|
146
|
-
3, 42, :_reduce_27,
|
147
|
-
3, 47, :_reduce_28,
|
148
|
-
1, 47, :_reduce_29,
|
149
|
-
2, 40, :_reduce_30,
|
150
|
-
3, 40, :_reduce_31,
|
151
|
-
3, 40, :_reduce_32,
|
152
|
-
3, 40, :_reduce_33,
|
153
|
-
3, 40, :_reduce_34,
|
154
|
-
3, 49, :_reduce_35,
|
155
|
-
3, 49, :_reduce_36,
|
156
|
-
3, 49, :_reduce_37,
|
157
|
-
1, 49, :_reduce_none,
|
158
|
-
1, 49, :_reduce_none,
|
159
|
-
1, 49, :_reduce_40,
|
160
|
-
4, 50, :_reduce_41,
|
161
|
-
3, 50, :_reduce_42,
|
162
|
-
2, 50, :_reduce_43,
|
163
|
-
2, 41, :_reduce_44,
|
164
|
-
2, 41, :_reduce_45,
|
165
|
-
1, 39, :_reduce_none,
|
166
|
-
0, 39, :_reduce_none,
|
167
|
-
2, 43, :_reduce_48,
|
168
|
-
2, 43, :_reduce_49,
|
169
|
-
2, 43, :_reduce_50,
|
170
|
-
2, 43, :_reduce_51,
|
171
|
-
2, 43, :_reduce_52,
|
172
|
-
1, 43, :_reduce_none,
|
173
|
-
1, 43, :_reduce_none,
|
174
|
-
1, 43, :_reduce_none,
|
175
|
-
1, 43, :_reduce_none,
|
176
|
-
1, 43, :_reduce_none,
|
177
|
-
1, 51, :_reduce_58,
|
178
|
-
2, 48, :_reduce_59,
|
179
|
-
2, 48, :_reduce_60,
|
180
|
-
0, 48, :_reduce_none,
|
181
|
-
1, 53, :_reduce_62,
|
182
|
-
1, 53, :_reduce_63,
|
183
|
-
1, 53, :_reduce_64,
|
184
|
-
1, 53, :_reduce_65,
|
185
|
-
1, 53, :_reduce_66,
|
186
|
-
1, 53, :_reduce_67,
|
187
|
-
1, 53, :_reduce_68,
|
188
|
-
3, 52, :_reduce_69,
|
189
|
-
1, 54, :_reduce_none,
|
190
|
-
2, 54, :_reduce_none,
|
191
|
-
1, 54, :_reduce_none,
|
192
|
-
1, 35, :_reduce_none,
|
193
|
-
0, 35, :_reduce_none ]
|
194
|
-
|
195
|
-
racc_reduce_n = 75
|
196
|
-
|
197
|
-
racc_shift_n = 110
|
198
|
-
|
199
|
-
racc_token_table = {
|
200
|
-
false => 0,
|
201
|
-
:error => 1,
|
202
|
-
:FUNCTION => 2,
|
203
|
-
:INCLUDES => 3,
|
204
|
-
:DASHMATCH => 4,
|
205
|
-
:LBRACE => 5,
|
206
|
-
:HASH => 6,
|
207
|
-
:PLUS => 7,
|
208
|
-
:GREATER => 8,
|
209
|
-
:S => 9,
|
210
|
-
:STRING => 10,
|
211
|
-
:IDENT => 11,
|
212
|
-
:COMMA => 12,
|
213
|
-
:NUMBER => 13,
|
214
|
-
:PREFIXMATCH => 14,
|
215
|
-
:SUFFIXMATCH => 15,
|
216
|
-
:SUBSTRINGMATCH => 16,
|
217
|
-
:TILDE => 17,
|
218
|
-
:NOT_EQUAL => 18,
|
219
|
-
:SLASH => 19,
|
220
|
-
:DOUBLESLASH => 20,
|
221
|
-
:NOT => 21,
|
222
|
-
:EQUAL => 22,
|
223
|
-
:RPAREN => 23,
|
224
|
-
:LSQUARE => 24,
|
225
|
-
:RSQUARE => 25,
|
226
|
-
:HAS => 26,
|
227
|
-
"." => 27,
|
228
|
-
"*" => 28,
|
229
|
-
"|" => 29,
|
230
|
-
":" => 30 }
|
231
|
-
|
232
|
-
racc_nt_base = 31
|
233
|
-
|
234
|
-
racc_use_result_var = true
|
235
|
-
|
236
|
-
Racc_arg = [
|
237
|
-
racc_action_table,
|
238
|
-
racc_action_check,
|
239
|
-
racc_action_default,
|
240
|
-
racc_action_pointer,
|
241
|
-
racc_goto_table,
|
242
|
-
racc_goto_check,
|
243
|
-
racc_goto_default,
|
244
|
-
racc_goto_pointer,
|
245
|
-
racc_nt_base,
|
246
|
-
racc_reduce_table,
|
247
|
-
racc_token_table,
|
248
|
-
racc_shift_n,
|
249
|
-
racc_reduce_n,
|
250
|
-
racc_use_result_var ]
|
251
|
-
|
252
|
-
Racc_token_to_s_table = [
|
253
|
-
"$end",
|
254
|
-
"error",
|
255
|
-
"FUNCTION",
|
256
|
-
"INCLUDES",
|
257
|
-
"DASHMATCH",
|
258
|
-
"LBRACE",
|
259
|
-
"HASH",
|
260
|
-
"PLUS",
|
261
|
-
"GREATER",
|
262
|
-
"S",
|
263
|
-
"STRING",
|
264
|
-
"IDENT",
|
265
|
-
"COMMA",
|
266
|
-
"NUMBER",
|
267
|
-
"PREFIXMATCH",
|
268
|
-
"SUFFIXMATCH",
|
269
|
-
"SUBSTRINGMATCH",
|
270
|
-
"TILDE",
|
271
|
-
"NOT_EQUAL",
|
272
|
-
"SLASH",
|
273
|
-
"DOUBLESLASH",
|
274
|
-
"NOT",
|
275
|
-
"EQUAL",
|
276
|
-
"RPAREN",
|
277
|
-
"LSQUARE",
|
278
|
-
"RSQUARE",
|
279
|
-
"HAS",
|
280
|
-
"\".\"",
|
281
|
-
"\"*\"",
|
282
|
-
"\"|\"",
|
283
|
-
"\":\"",
|
284
|
-
"$start",
|
285
|
-
"selector",
|
286
|
-
"simple_selector_1toN",
|
287
|
-
"prefixless_combinator_selector",
|
288
|
-
"optional_S",
|
289
|
-
"combinator",
|
290
|
-
"simple_selector",
|
291
|
-
"element_name",
|
292
|
-
"hcap_0toN",
|
293
|
-
"function",
|
294
|
-
"pseudo",
|
295
|
-
"attrib",
|
296
|
-
"hcap_1toN",
|
297
|
-
"class",
|
298
|
-
"namespaced_ident",
|
299
|
-
"namespace",
|
300
|
-
"attrib_name",
|
301
|
-
"attrib_val_0or1",
|
302
|
-
"expr",
|
303
|
-
"nth",
|
304
|
-
"attribute_id",
|
305
|
-
"negation",
|
306
|
-
"eql_incl_dash",
|
307
|
-
"negation_arg" ]
|
308
|
-
|
309
|
-
Racc_debug_parser = false
|
310
|
-
|
311
|
-
##### State transition tables end #####
|
312
|
-
|
313
|
-
# reduce 0 omitted
|
314
|
-
|
315
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 9)
|
316
|
-
def _reduce_1(val, _values, result)
|
317
|
-
result = [val.first, val.last].flatten
|
318
|
-
|
319
|
-
result
|
320
|
-
end
|
321
|
-
.,.,
|
322
|
-
|
323
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 11)
|
324
|
-
def _reduce_2(val, _values, result)
|
325
|
-
result = val.flatten
|
326
|
-
result
|
327
|
-
end
|
328
|
-
.,.,
|
329
|
-
|
330
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 12)
|
331
|
-
def _reduce_3(val, _values, result)
|
332
|
-
result = [val.last].flatten
|
333
|
-
result
|
334
|
-
end
|
335
|
-
.,.,
|
336
|
-
|
337
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 15)
|
338
|
-
def _reduce_4(val, _values, result)
|
339
|
-
result = :DIRECT_ADJACENT_SELECTOR
|
340
|
-
result
|
341
|
-
end
|
342
|
-
.,.,
|
343
|
-
|
344
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 16)
|
345
|
-
def _reduce_5(val, _values, result)
|
346
|
-
result = :CHILD_SELECTOR
|
347
|
-
result
|
348
|
-
end
|
349
|
-
.,.,
|
350
|
-
|
351
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 17)
|
352
|
-
def _reduce_6(val, _values, result)
|
353
|
-
result = :FOLLOWING_SELECTOR
|
354
|
-
result
|
355
|
-
end
|
356
|
-
.,.,
|
357
|
-
|
358
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 18)
|
359
|
-
def _reduce_7(val, _values, result)
|
360
|
-
result = :DESCENDANT_SELECTOR
|
361
|
-
result
|
362
|
-
end
|
363
|
-
.,.,
|
364
|
-
|
365
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 19)
|
366
|
-
def _reduce_8(val, _values, result)
|
367
|
-
result = :CHILD_SELECTOR
|
368
|
-
result
|
369
|
-
end
|
370
|
-
.,.,
|
371
|
-
|
372
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 23)
|
373
|
-
def _reduce_9(val, _values, result)
|
374
|
-
result = if val[1].nil?
|
375
|
-
val.first
|
376
|
-
else
|
377
|
-
Node.new(:CONDITIONAL_SELECTOR, [val.first, val[1]])
|
378
|
-
end
|
379
|
-
|
380
|
-
result
|
381
|
-
end
|
382
|
-
.,.,
|
383
|
-
|
384
|
-
# reduce 10 omitted
|
385
|
-
|
386
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 31)
|
387
|
-
def _reduce_11(val, _values, result)
|
388
|
-
result = Node.new(:CONDITIONAL_SELECTOR, val)
|
389
|
-
|
390
|
-
result
|
391
|
-
end
|
392
|
-
.,.,
|
393
|
-
|
394
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 34)
|
395
|
-
def _reduce_12(val, _values, result)
|
396
|
-
result = Node.new(:CONDITIONAL_SELECTOR, val)
|
397
|
-
|
398
|
-
result
|
399
|
-
end
|
400
|
-
.,.,
|
401
|
-
|
402
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 37)
|
403
|
-
def _reduce_13(val, _values, result)
|
404
|
-
result = Node.new(:CONDITIONAL_SELECTOR,
|
405
|
-
[Node.new(:ELEMENT_NAME, ['*']), val.first]
|
406
|
-
)
|
407
|
-
|
408
|
-
result
|
409
|
-
end
|
410
|
-
.,.,
|
411
|
-
|
412
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 44)
|
413
|
-
def _reduce_14(val, _values, result)
|
414
|
-
result = Node.new(val.first, [nil, val.last])
|
415
|
-
|
416
|
-
result
|
417
|
-
end
|
418
|
-
.,.,
|
419
|
-
|
420
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 49)
|
421
|
-
def _reduce_15(val, _values, result)
|
422
|
-
result = Node.new(val[1], [val.first, val.last])
|
423
|
-
|
424
|
-
result
|
425
|
-
end
|
426
|
-
.,.,
|
427
|
-
|
428
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 52)
|
429
|
-
def _reduce_16(val, _values, result)
|
430
|
-
result = Node.new(:DESCENDANT_SELECTOR, [val.first, val.last])
|
431
|
-
|
432
|
-
result
|
433
|
-
end
|
434
|
-
.,.,
|
435
|
-
|
436
|
-
# reduce 17 omitted
|
437
|
-
|
438
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 57)
|
439
|
-
def _reduce_18(val, _values, result)
|
440
|
-
result = Node.new(:CLASS_CONDITION, [val[1]])
|
441
|
-
result
|
442
|
-
end
|
443
|
-
.,.,
|
444
|
-
|
445
|
-
# reduce 19 omitted
|
446
|
-
|
447
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 61)
|
448
|
-
def _reduce_20(val, _values, result)
|
449
|
-
result = Node.new(:ELEMENT_NAME, val)
|
450
|
-
result
|
451
|
-
end
|
452
|
-
.,.,
|
453
|
-
|
454
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 65)
|
455
|
-
def _reduce_21(val, _values, result)
|
456
|
-
result = Node.new(:ELEMENT_NAME,
|
457
|
-
[[val.first, val.last].compact.join(':')]
|
458
|
-
)
|
459
|
-
|
460
|
-
result
|
461
|
-
end
|
462
|
-
.,.,
|
463
|
-
|
464
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 70)
|
465
|
-
def _reduce_22(val, _values, result)
|
466
|
-
name = @namespaces.key?('xmlns') ? "xmlns:#{val.first}" : val.first
|
467
|
-
result = Node.new(:ELEMENT_NAME, [name])
|
468
|
-
|
469
|
-
result
|
470
|
-
end
|
471
|
-
.,.,
|
472
|
-
|
473
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 75)
|
474
|
-
def _reduce_23(val, _values, result)
|
475
|
-
result = val[0]
|
476
|
-
result
|
477
|
-
end
|
478
|
-
.,.,
|
479
|
-
|
480
|
-
# reduce 24 omitted
|
481
|
-
|
482
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 80)
|
483
|
-
def _reduce_25(val, _values, result)
|
484
|
-
result = Node.new(:ATTRIBUTE_CONDITION,
|
485
|
-
[val[1]] + (val[2] || [])
|
486
|
-
)
|
487
|
-
|
488
|
-
result
|
489
|
-
end
|
490
|
-
.,.,
|
491
|
-
|
492
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 85)
|
493
|
-
def _reduce_26(val, _values, result)
|
494
|
-
result = Node.new(:ATTRIBUTE_CONDITION,
|
495
|
-
[val[1]] + (val[2] || [])
|
496
|
-
)
|
497
|
-
|
498
|
-
result
|
499
|
-
end
|
500
|
-
.,.,
|
501
|
-
|
502
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 90)
|
503
|
-
def _reduce_27(val, _values, result)
|
504
|
-
# Non standard, but hpricot supports it.
|
505
|
-
result = Node.new(:PSEUDO_CLASS,
|
506
|
-
[Node.new(:FUNCTION, ['nth-child(', val[1]])]
|
507
|
-
)
|
508
|
-
|
509
|
-
result
|
510
|
-
end
|
511
|
-
.,.,
|
512
|
-
|
513
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 98)
|
514
|
-
def _reduce_28(val, _values, result)
|
515
|
-
result = Node.new(:ELEMENT_NAME,
|
516
|
-
[[val.first, val.last].compact.join(':')]
|
517
|
-
)
|
518
|
-
|
519
|
-
result
|
520
|
-
end
|
521
|
-
.,.,
|
522
|
-
|
523
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 103)
|
524
|
-
def _reduce_29(val, _values, result)
|
525
|
-
# Default namespace is not applied to attributes.
|
526
|
-
# So we don't add prefix "xmlns:" as in namespaced_ident.
|
527
|
-
result = Node.new(:ELEMENT_NAME, [val.first])
|
528
|
-
|
529
|
-
result
|
530
|
-
end
|
531
|
-
.,.,
|
532
|
-
|
533
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 110)
|
534
|
-
def _reduce_30(val, _values, result)
|
535
|
-
result = Node.new(:FUNCTION, [val.first.strip])
|
536
|
-
|
537
|
-
result
|
538
|
-
end
|
539
|
-
.,.,
|
540
|
-
|
541
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 113)
|
542
|
-
def _reduce_31(val, _values, result)
|
543
|
-
result = Node.new(:FUNCTION, [val.first.strip, val[1]].flatten)
|
544
|
-
|
545
|
-
result
|
546
|
-
end
|
547
|
-
.,.,
|
548
|
-
|
549
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 116)
|
550
|
-
def _reduce_32(val, _values, result)
|
551
|
-
result = Node.new(:FUNCTION, [val.first.strip, val[1]].flatten)
|
552
|
-
|
553
|
-
result
|
554
|
-
end
|
555
|
-
.,.,
|
556
|
-
|
557
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 119)
|
558
|
-
def _reduce_33(val, _values, result)
|
559
|
-
result = Node.new(:FUNCTION, [val.first.strip, val[1]].flatten)
|
560
|
-
|
561
|
-
result
|
562
|
-
end
|
563
|
-
.,.,
|
564
|
-
|
565
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 122)
|
566
|
-
def _reduce_34(val, _values, result)
|
567
|
-
result = Node.new(:FUNCTION, [val.first.strip, val[1]].flatten)
|
568
|
-
|
569
|
-
result
|
570
|
-
end
|
571
|
-
.,.,
|
572
|
-
|
573
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 126)
|
574
|
-
def _reduce_35(val, _values, result)
|
575
|
-
result = [val.first, val.last]
|
576
|
-
result
|
577
|
-
end
|
578
|
-
.,.,
|
579
|
-
|
580
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 127)
|
581
|
-
def _reduce_36(val, _values, result)
|
582
|
-
result = [val.first, val.last]
|
583
|
-
result
|
584
|
-
end
|
585
|
-
.,.,
|
586
|
-
|
587
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 128)
|
588
|
-
def _reduce_37(val, _values, result)
|
589
|
-
result = [val.first, val.last]
|
590
|
-
result
|
591
|
-
end
|
592
|
-
.,.,
|
593
|
-
|
594
|
-
# reduce 38 omitted
|
595
|
-
|
596
|
-
# reduce 39 omitted
|
597
|
-
|
598
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 133)
|
599
|
-
def _reduce_40(val, _values, result)
|
600
|
-
case val[0]
|
601
|
-
when 'even'
|
602
|
-
result = Node.new(:NTH, ['2','n','+','0'])
|
603
|
-
when 'odd'
|
604
|
-
result = Node.new(:NTH, ['2','n','+','1'])
|
605
|
-
when 'n'
|
606
|
-
result = Node.new(:NTH, ['1','n','+','0'])
|
607
|
-
else
|
608
|
-
# This is not CSS standard. It allows us to support this:
|
609
|
-
# assert_xpath("//a[foo(., @href)]", @parser.parse('a:foo(@href)'))
|
610
|
-
# assert_xpath("//a[foo(., @a, b)]", @parser.parse('a:foo(@a, b)'))
|
611
|
-
# assert_xpath("//a[foo(., a, 10)]", @parser.parse('a:foo(a, 10)'))
|
612
|
-
result = val
|
613
|
-
end
|
614
|
-
|
615
|
-
result
|
616
|
-
end
|
617
|
-
.,.,
|
618
|
-
|
619
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 152)
|
620
|
-
def _reduce_41(val, _values, result)
|
621
|
-
if val[1] == 'n'
|
622
|
-
result = Node.new(:NTH, val)
|
623
|
-
else
|
624
|
-
raise Racc::ParseError, "parse error on IDENT '#{val[1]}'"
|
625
|
-
end
|
626
|
-
|
627
|
-
result
|
628
|
-
end
|
629
|
-
.,.,
|
630
|
-
|
631
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 158)
|
632
|
-
def _reduce_42(val, _values, result)
|
633
|
-
# n+3, -n+3
|
634
|
-
if val[0] == 'n'
|
635
|
-
val.unshift("1")
|
636
|
-
result = Node.new(:NTH, val)
|
637
|
-
elsif val[0] == '-n'
|
638
|
-
val[0] = 'n'
|
639
|
-
val.unshift("-1")
|
640
|
-
result = Node.new(:NTH, val)
|
641
|
-
else
|
642
|
-
raise Racc::ParseError, "parse error on IDENT '#{val[1]}'"
|
643
|
-
end
|
644
|
-
|
645
|
-
result
|
646
|
-
end
|
647
|
-
.,.,
|
648
|
-
|
649
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 170)
|
650
|
-
def _reduce_43(val, _values, result)
|
651
|
-
# 5n, -5n, 10n-1
|
652
|
-
n = val[1]
|
653
|
-
if n[0, 2] == 'n-'
|
654
|
-
val[1] = 'n'
|
655
|
-
val << "-"
|
656
|
-
# b is contained in n as n is the string "n-b"
|
657
|
-
val << n[2, n.size]
|
658
|
-
result = Node.new(:NTH, val)
|
659
|
-
elsif n == 'n'
|
660
|
-
val << "+"
|
661
|
-
val << "0"
|
662
|
-
result = Node.new(:NTH, val)
|
663
|
-
else
|
664
|
-
raise Racc::ParseError, "parse error on IDENT '#{val[1]}'"
|
665
|
-
end
|
666
|
-
|
667
|
-
result
|
668
|
-
end
|
669
|
-
.,.,
|
670
|
-
|
671
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 189)
|
672
|
-
def _reduce_44(val, _values, result)
|
673
|
-
result = Node.new(:PSEUDO_CLASS, [val[1]])
|
674
|
-
|
675
|
-
result
|
676
|
-
end
|
677
|
-
.,.,
|
678
|
-
|
679
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 191)
|
680
|
-
def _reduce_45(val, _values, result)
|
681
|
-
result = Node.new(:PSEUDO_CLASS, [val[1]])
|
682
|
-
result
|
683
|
-
end
|
684
|
-
.,.,
|
685
|
-
|
686
|
-
# reduce 46 omitted
|
687
|
-
|
688
|
-
# reduce 47 omitted
|
689
|
-
|
690
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 199)
|
691
|
-
def _reduce_48(val, _values, result)
|
692
|
-
result = Node.new(:COMBINATOR, val)
|
693
|
-
|
694
|
-
result
|
695
|
-
end
|
696
|
-
.,.,
|
697
|
-
|
698
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 202)
|
699
|
-
def _reduce_49(val, _values, result)
|
700
|
-
result = Node.new(:COMBINATOR, val)
|
701
|
-
|
702
|
-
result
|
703
|
-
end
|
704
|
-
.,.,
|
705
|
-
|
706
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 205)
|
707
|
-
def _reduce_50(val, _values, result)
|
708
|
-
result = Node.new(:COMBINATOR, val)
|
709
|
-
|
710
|
-
result
|
711
|
-
end
|
712
|
-
.,.,
|
713
|
-
|
714
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 208)
|
715
|
-
def _reduce_51(val, _values, result)
|
716
|
-
result = Node.new(:COMBINATOR, val)
|
717
|
-
|
718
|
-
result
|
719
|
-
end
|
720
|
-
.,.,
|
721
|
-
|
722
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 211)
|
723
|
-
def _reduce_52(val, _values, result)
|
724
|
-
result = Node.new(:COMBINATOR, val)
|
725
|
-
|
726
|
-
result
|
727
|
-
end
|
728
|
-
.,.,
|
729
|
-
|
730
|
-
# reduce 53 omitted
|
731
|
-
|
732
|
-
# reduce 54 omitted
|
733
|
-
|
734
|
-
# reduce 55 omitted
|
735
|
-
|
736
|
-
# reduce 56 omitted
|
737
|
-
|
738
|
-
# reduce 57 omitted
|
739
|
-
|
740
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 220)
|
741
|
-
def _reduce_58(val, _values, result)
|
742
|
-
result = Node.new(:ID, val)
|
743
|
-
result
|
744
|
-
end
|
745
|
-
.,.,
|
746
|
-
|
747
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 223)
|
748
|
-
def _reduce_59(val, _values, result)
|
749
|
-
result = [val.first, val[1]]
|
750
|
-
result
|
751
|
-
end
|
752
|
-
.,.,
|
753
|
-
|
754
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 224)
|
755
|
-
def _reduce_60(val, _values, result)
|
756
|
-
result = [val.first, val[1]]
|
757
|
-
result
|
758
|
-
end
|
759
|
-
.,.,
|
760
|
-
|
761
|
-
# reduce 61 omitted
|
762
|
-
|
763
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 228)
|
764
|
-
def _reduce_62(val, _values, result)
|
765
|
-
result = :equal
|
766
|
-
result
|
767
|
-
end
|
768
|
-
.,.,
|
769
|
-
|
770
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 229)
|
771
|
-
def _reduce_63(val, _values, result)
|
772
|
-
result = :prefix_match
|
773
|
-
result
|
774
|
-
end
|
775
|
-
.,.,
|
776
|
-
|
777
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 230)
|
778
|
-
def _reduce_64(val, _values, result)
|
779
|
-
result = :suffix_match
|
780
|
-
result
|
781
|
-
end
|
782
|
-
.,.,
|
783
|
-
|
784
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 231)
|
785
|
-
def _reduce_65(val, _values, result)
|
786
|
-
result = :substring_match
|
787
|
-
result
|
788
|
-
end
|
789
|
-
.,.,
|
790
|
-
|
791
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 232)
|
792
|
-
def _reduce_66(val, _values, result)
|
793
|
-
result = :not_equal
|
794
|
-
result
|
795
|
-
end
|
796
|
-
.,.,
|
797
|
-
|
798
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 233)
|
799
|
-
def _reduce_67(val, _values, result)
|
800
|
-
result = :includes
|
801
|
-
result
|
802
|
-
end
|
803
|
-
.,.,
|
804
|
-
|
805
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 234)
|
806
|
-
def _reduce_68(val, _values, result)
|
807
|
-
result = :dash_match
|
808
|
-
result
|
809
|
-
end
|
810
|
-
.,.,
|
811
|
-
|
812
|
-
module_eval(<<'.,.,', 'nokogiri-css.y', 238)
|
813
|
-
def _reduce_69(val, _values, result)
|
814
|
-
result = Node.new(:NOT, [val[1]])
|
815
|
-
|
816
|
-
result
|
817
|
-
end
|
818
|
-
.,.,
|
819
|
-
|
820
|
-
# reduce 70 omitted
|
821
|
-
|
822
|
-
# reduce 71 omitted
|
823
|
-
|
824
|
-
# reduce 72 omitted
|
825
|
-
|
826
|
-
# reduce 73 omitted
|
827
|
-
|
828
|
-
# reduce 74 omitted
|
829
|
-
|
830
|
-
def _reduce_none(val, _values, result)
|
831
|
-
val[0]
|
832
|
-
end
|
833
|
-
|
834
|
-
end # class Parser
|
835
|
-
end # module CSS
|
836
|
-
end # module Nokogiri
|