radius 0.7.0.prerelease2 → 0.7.0.prerelease3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,1196 +1,58 @@
1
-
2
- # line 1 "scanner.rl"
3
-
4
- # line 84 "scanner.rl"
5
-
6
-
7
- module Radius
1
+ module Radius
8
2
  class Scanner
3
+
4
+ # The regular expression used to find (1) opening and self-enclosed tag names, (2) self-enclosing trailing slash,
5
+ # (3) attributes and (4) closing tag
6
+ def scanner_regex(prefix = nil)
7
+ %r{<#{prefix}:([\w:]+?)(\s+(?:\w+\s*=\s*(?:"[^"]*?"|'[^']*?')\s*)*|)(\/?)>|<\/#{prefix}:([\w:]+?)\s*>}
8
+ end
9
+
10
+ # Parses a given string and returns an array of nodes.
11
+ # The nodes consist of strings and hashes that describe a Radius tag that was found.
9
12
  def operate(prefix, data)
10
13
  data = Radius::OrdString.new data
11
- buf = ""
12
- csel = ""
13
- @prematch = ''
14
- @starttag = nil
15
- @attrs = {}
16
- @flavor = :tasteless
17
- @cursor = 0
18
- @tagstart = 0
19
14
  @nodes = ['']
20
- remainder = data.dup
21
-
22
- until remainder.length == 0
23
- p = perform_parse(prefix, remainder)
24
- remainder = remainder[p..-1]
15
+
16
+ re = scanner_regex(prefix)
17
+ if md = re.match(data)
18
+ remainder = ''
19
+ while md
20
+ start_tag, attributes, self_enclosed, end_tag = $1, $2, $3, $4
21
+
22
+ flavor = self_enclosed == '/' ? :self : (start_tag ? :open : :close)
23
+
24
+ # save the part before the current match as a string node
25
+ @nodes << md.pre_match
26
+
27
+ # save the tag that was found as a tag hash node
28
+ @nodes << {:prefix=>prefix, :name=>(start_tag || end_tag), :flavor => flavor, :attrs => parse_attributes(attributes)}
29
+
30
+ # remember the part after the current match
31
+ remainder = md.post_match
32
+
33
+ # see if we find another tag in the remaining string
34
+ md = re.match(md.post_match)
35
+ end
36
+
37
+ # add the last remaining string after the last tag that was found as a string node
38
+ @nodes << remainder
39
+ else
40
+ @nodes << data
25
41
  end
26
42
 
27
43
  return @nodes
28
44
  end
29
45
 
30
46
  private
31
- def perform_parse(prefix, data)
32
- stack = []
33
- p = 0
34
- ts = 0
35
- te = 0
36
- act = 0
37
- eof = data.length
38
-
39
- @prefix = prefix
40
-
41
- # line 42 "scanner.rb"
42
- class << self
43
- attr_accessor :_parser_trans_keys
44
- private :_parser_trans_keys, :_parser_trans_keys=
45
- end
46
- self._parser_trans_keys = [
47
- 0, 0, 45, 122, 45, 122,
48
- 9, 122, 9, 122, 9,
49
- 122, 9, 61, 9, 39,
50
- 34, 92, 34, 92, 9, 122,
51
- 9, 122, 62, 62, 34,
52
- 92, 9, 122, 9, 122,
53
- 9, 122, 9, 92, 9, 92,
54
- 9, 122, 34, 92, 34,
55
- 92, 34, 92, 9, 122,
56
- 39, 92, 39, 92, 9, 122,
57
- 9, 122, 9, 92, 9,
58
- 92, 34, 92, 34, 92,
59
- 9, 122, 9, 122, 9, 122,
60
- 9, 92, 9, 92, 9,
61
- 122, 34, 92, 9, 122,
62
- 9, 122, 39, 92, 39, 92,
63
- 45, 122, 45, 122, 45,
64
- 122, 9, 122, 9, 62,
65
- 0, 0, 60, 60, 45, 122,
66
- 0, 0, 0, 0, 34,
67
- 92, 34, 92, 34, 92,
68
- 34, 92, 39, 92, 39, 92,
69
- 0, 0, 0
70
- ]
71
-
72
- class << self
73
- attr_accessor :_parser_key_spans
74
- private :_parser_key_spans, :_parser_key_spans=
75
- end
76
- self._parser_key_spans = [
77
- 0, 78, 78, 114, 114, 114, 53, 31,
78
- 59, 59, 114, 114, 1, 59, 114, 114,
79
- 114, 84, 84, 114, 59, 59, 59, 114,
80
- 54, 54, 114, 114, 84, 84, 59, 59,
81
- 114, 114, 114, 84, 84, 114, 59, 114,
82
- 114, 54, 54, 78, 78, 78, 114, 54,
83
- 0, 1, 78, 0, 0, 59, 59, 59,
84
- 59, 54, 54, 0
85
- ]
86
-
87
- class << self
88
- attr_accessor :_parser_index_offsets
89
- private :_parser_index_offsets, :_parser_index_offsets=
90
- end
91
- self._parser_index_offsets = [
92
- 0, 0, 79, 158, 273, 388, 503, 557,
93
- 589, 649, 709, 824, 939, 941, 1001, 1116,
94
- 1231, 1346, 1431, 1516, 1631, 1691, 1751, 1811,
95
- 1926, 1981, 2036, 2151, 2266, 2351, 2436, 2496,
96
- 2556, 2671, 2786, 2901, 2986, 3071, 3186, 3246,
97
- 3361, 3476, 3531, 3586, 3665, 3744, 3823, 3938,
98
- 3993, 3994, 3996, 4075, 4076, 4077, 4137, 4197,
99
- 4257, 4317, 4372, 4427
100
- ]
101
-
102
- class << self
103
- attr_accessor :_parser_indicies
104
- private :_parser_indicies, :_parser_indicies=
105
- end
106
- self._parser_indicies = [
107
- 1, 1, 0, 1, 1, 1, 1, 1,
108
- 1, 1, 1, 1, 1, 2, 0, 0,
109
- 0, 0, 1, 0, 1, 1, 1, 1,
110
- 1, 1, 1, 1, 1, 1, 1, 1,
111
- 1, 1, 1, 1, 1, 1, 1, 1,
112
- 1, 1, 1, 1, 1, 1, 0, 0,
113
- 0, 0, 1, 0, 1, 1, 1, 1,
114
- 1, 1, 1, 1, 1, 1, 1, 1,
115
- 1, 1, 1, 1, 1, 1, 1, 1,
116
- 1, 1, 1, 1, 1, 1, 0, 3,
117
- 3, 0, 3, 3, 3, 3, 3, 3,
118
- 3, 3, 3, 3, 3, 0, 0, 0,
119
- 0, 3, 0, 3, 3, 3, 3, 3,
120
- 3, 3, 3, 3, 3, 3, 3, 3,
121
- 3, 3, 3, 3, 3, 3, 3, 3,
122
- 3, 3, 3, 3, 3, 0, 0, 0,
123
- 0, 3, 0, 3, 3, 3, 3, 3,
124
- 3, 3, 3, 3, 3, 3, 3, 3,
125
- 3, 3, 3, 3, 3, 3, 3, 3,
126
- 3, 3, 3, 3, 3, 0, 4, 4,
127
- 4, 4, 4, 0, 0, 0, 0, 0,
128
- 0, 0, 0, 0, 0, 0, 0, 0,
129
- 0, 0, 0, 0, 0, 4, 0, 0,
130
- 0, 0, 0, 0, 0, 0, 0, 0,
131
- 0, 0, 5, 5, 6, 5, 5, 5,
132
- 5, 5, 5, 5, 5, 5, 5, 5,
133
- 0, 0, 0, 7, 5, 0, 5, 5,
134
- 5, 5, 5, 5, 5, 5, 5, 5,
135
- 5, 5, 5, 5, 5, 5, 5, 5,
136
- 5, 5, 5, 5, 5, 5, 5, 5,
137
- 0, 0, 0, 0, 5, 0, 5, 5,
138
- 5, 5, 5, 5, 5, 5, 5, 5,
139
- 5, 5, 5, 5, 5, 5, 5, 5,
140
- 5, 5, 5, 5, 5, 5, 5, 5,
141
- 0, 8, 8, 8, 8, 8, 0, 0,
142
- 0, 0, 0, 0, 0, 0, 0, 0,
143
- 0, 0, 0, 0, 0, 0, 0, 0,
144
- 8, 0, 0, 0, 0, 0, 0, 0,
145
- 0, 0, 0, 0, 0, 9, 9, 10,
146
- 9, 9, 9, 9, 9, 9, 9, 9,
147
- 9, 9, 9, 0, 0, 0, 11, 9,
148
- 0, 9, 9, 9, 9, 9, 9, 9,
149
- 9, 9, 9, 9, 9, 9, 9, 9,
150
- 9, 9, 9, 9, 9, 9, 9, 9,
151
- 9, 9, 9, 0, 0, 0, 0, 9,
152
- 0, 9, 9, 9, 9, 9, 9, 9,
153
- 9, 9, 9, 9, 9, 9, 9, 9,
154
- 9, 9, 9, 9, 9, 9, 9, 9,
155
- 9, 9, 9, 0, 13, 13, 13, 13,
156
- 13, 12, 12, 12, 12, 12, 12, 12,
157
- 12, 12, 12, 12, 12, 12, 12, 12,
158
- 12, 12, 12, 13, 12, 12, 12, 12,
159
- 12, 12, 12, 12, 12, 12, 12, 12,
160
- 14, 14, 12, 14, 14, 14, 14, 14,
161
- 14, 14, 14, 14, 14, 14, 12, 12,
162
- 15, 12, 14, 12, 14, 14, 14, 14,
163
- 14, 14, 14, 14, 14, 14, 14, 14,
164
- 14, 14, 14, 14, 14, 14, 14, 14,
165
- 14, 14, 14, 14, 14, 14, 12, 12,
166
- 12, 12, 14, 12, 14, 14, 14, 14,
167
- 14, 14, 14, 14, 14, 14, 14, 14,
168
- 14, 14, 14, 14, 14, 14, 14, 14,
169
- 14, 14, 14, 14, 14, 14, 12, 16,
170
- 16, 16, 16, 16, 12, 12, 12, 12,
171
- 12, 12, 12, 12, 12, 12, 12, 12,
172
- 12, 12, 12, 12, 12, 12, 16, 12,
173
- 12, 12, 12, 12, 12, 12, 12, 12,
174
- 12, 12, 12, 12, 12, 12, 12, 12,
175
- 12, 12, 12, 12, 12, 12, 12, 12,
176
- 12, 12, 12, 17, 12, 17, 17, 17,
177
- 17, 17, 12, 12, 12, 12, 12, 12,
178
- 12, 12, 12, 12, 12, 12, 12, 12,
179
- 12, 12, 12, 12, 17, 12, 18, 12,
180
- 12, 12, 12, 19, 12, 21, 20, 20,
181
- 20, 20, 20, 20, 20, 20, 20, 20,
182
- 20, 20, 20, 20, 20, 20, 20, 20,
183
- 20, 20, 20, 20, 20, 20, 20, 20,
184
- 20, 20, 20, 20, 20, 20, 20, 20,
185
- 20, 20, 20, 20, 20, 20, 20, 20,
186
- 20, 20, 20, 20, 20, 20, 20, 20,
187
- 20, 20, 20, 20, 20, 20, 20, 22,
188
- 20, 24, 23, 23, 23, 23, 23, 23,
189
- 23, 23, 23, 23, 23, 23, 23, 23,
190
- 23, 23, 23, 23, 23, 23, 23, 23,
191
- 23, 23, 23, 23, 23, 23, 23, 23,
192
- 23, 23, 23, 23, 23, 23, 23, 23,
193
- 23, 23, 23, 23, 23, 23, 23, 23,
194
- 23, 23, 23, 23, 23, 23, 23, 23,
195
- 23, 23, 23, 25, 23, 26, 26, 26,
196
- 26, 26, 12, 12, 12, 12, 12, 12,
197
- 12, 12, 12, 12, 12, 12, 12, 12,
198
- 12, 12, 12, 12, 26, 12, 12, 12,
199
- 12, 12, 12, 12, 12, 12, 12, 12,
200
- 12, 27, 27, 28, 27, 27, 27, 27,
201
- 27, 27, 27, 27, 27, 27, 27, 12,
202
- 12, 12, 29, 27, 12, 27, 27, 27,
203
- 27, 27, 27, 27, 27, 27, 27, 27,
204
- 27, 27, 27, 27, 27, 27, 27, 27,
205
- 27, 27, 27, 27, 27, 27, 27, 12,
206
- 12, 12, 12, 27, 12, 27, 27, 27,
207
- 27, 27, 27, 27, 27, 27, 27, 27,
208
- 27, 27, 27, 27, 27, 27, 27, 27,
209
- 27, 27, 27, 27, 27, 27, 27, 12,
210
- 30, 30, 30, 30, 30, 12, 12, 12,
211
- 12, 12, 12, 12, 12, 12, 12, 12,
212
- 12, 12, 12, 12, 12, 12, 12, 30,
213
- 12, 12, 12, 12, 12, 12, 12, 12,
214
- 12, 12, 12, 12, 31, 31, 32, 31,
215
- 31, 31, 31, 31, 31, 31, 31, 31,
216
- 31, 31, 12, 12, 12, 33, 31, 12,
217
- 31, 31, 31, 31, 31, 31, 31, 31,
218
- 31, 31, 31, 31, 31, 31, 31, 31,
219
- 31, 31, 31, 31, 31, 31, 31, 31,
220
- 31, 31, 12, 12, 12, 12, 31, 12,
221
- 31, 31, 31, 31, 31, 31, 31, 31,
222
- 31, 31, 31, 31, 31, 31, 31, 31,
223
- 31, 31, 31, 31, 31, 31, 31, 31,
224
- 31, 31, 12, 34, 12, 35, 23, 23,
225
- 23, 23, 23, 23, 23, 23, 23, 23,
226
- 23, 23, 23, 23, 23, 23, 23, 23,
227
- 23, 23, 23, 23, 23, 23, 23, 23,
228
- 23, 23, 23, 23, 23, 23, 23, 23,
229
- 23, 23, 23, 23, 23, 23, 23, 23,
230
- 23, 23, 23, 23, 23, 23, 23, 23,
231
- 23, 23, 23, 23, 23, 23, 23, 25,
232
- 23, 36, 36, 36, 36, 36, 23, 23,
233
- 23, 23, 23, 23, 23, 23, 23, 23,
234
- 23, 23, 23, 23, 23, 23, 23, 23,
235
- 36, 23, 24, 23, 23, 23, 23, 23,
236
- 23, 23, 23, 23, 23, 37, 37, 38,
237
- 37, 37, 37, 37, 37, 37, 37, 37,
238
- 37, 37, 37, 23, 23, 23, 39, 37,
239
- 23, 37, 37, 37, 37, 37, 37, 37,
240
- 37, 37, 37, 37, 37, 37, 37, 37,
241
- 37, 37, 37, 37, 37, 37, 37, 37,
242
- 37, 37, 37, 23, 25, 23, 23, 37,
243
- 23, 37, 37, 37, 37, 37, 37, 37,
244
- 37, 37, 37, 37, 37, 37, 37, 37,
245
- 37, 37, 37, 37, 37, 37, 37, 37,
246
- 37, 37, 37, 23, 40, 40, 40, 40,
247
- 40, 23, 23, 23, 23, 23, 23, 23,
248
- 23, 23, 23, 23, 23, 23, 23, 23,
249
- 23, 23, 23, 40, 23, 24, 23, 23,
250
- 23, 23, 23, 23, 23, 23, 23, 23,
251
- 41, 41, 42, 41, 41, 41, 41, 41,
252
- 41, 41, 41, 41, 41, 41, 23, 23,
253
- 23, 43, 41, 23, 41, 41, 41, 41,
254
- 41, 41, 41, 41, 41, 41, 41, 41,
255
- 41, 41, 41, 41, 41, 41, 41, 41,
256
- 41, 41, 41, 41, 41, 41, 23, 25,
257
- 23, 23, 41, 23, 41, 41, 41, 41,
258
- 41, 41, 41, 41, 41, 41, 41, 41,
259
- 41, 41, 41, 41, 41, 41, 41, 41,
260
- 41, 41, 41, 41, 41, 41, 23, 44,
261
- 44, 44, 44, 44, 23, 23, 23, 23,
262
- 23, 23, 23, 23, 23, 23, 23, 23,
263
- 23, 23, 23, 23, 23, 23, 44, 23,
264
- 24, 23, 23, 23, 23, 23, 23, 23,
265
- 23, 23, 23, 45, 45, 23, 45, 45,
266
- 45, 45, 45, 45, 45, 45, 45, 45,
267
- 45, 23, 23, 46, 23, 45, 23, 45,
268
- 45, 45, 45, 45, 45, 45, 45, 45,
269
- 45, 45, 45, 45, 45, 45, 45, 45,
270
- 45, 45, 45, 45, 45, 45, 45, 45,
271
- 45, 23, 25, 23, 23, 45, 23, 45,
272
- 45, 45, 45, 45, 45, 45, 45, 45,
273
- 45, 45, 45, 45, 45, 45, 45, 45,
274
- 45, 45, 45, 45, 45, 45, 45, 45,
275
- 45, 23, 47, 47, 47, 47, 47, 23,
276
- 23, 23, 23, 23, 23, 23, 23, 23,
277
- 23, 23, 23, 23, 23, 23, 23, 23,
278
- 23, 47, 23, 24, 23, 23, 23, 23,
279
- 23, 23, 23, 23, 23, 23, 23, 23,
280
- 23, 23, 23, 23, 23, 23, 23, 23,
281
- 23, 23, 23, 23, 23, 23, 48, 23,
282
- 23, 23, 23, 23, 23, 23, 23, 23,
283
- 23, 23, 23, 23, 23, 23, 23, 23,
284
- 23, 23, 23, 23, 23, 23, 23, 23,
285
- 23, 23, 23, 23, 23, 25, 23, 48,
286
- 48, 48, 48, 48, 23, 23, 23, 23,
287
- 23, 23, 23, 23, 23, 23, 23, 23,
288
- 23, 23, 23, 23, 23, 23, 48, 23,
289
- 49, 23, 23, 23, 23, 50, 23, 23,
290
- 23, 23, 23, 23, 23, 23, 23, 23,
291
- 23, 23, 23, 23, 23, 23, 23, 23,
292
- 23, 23, 23, 23, 23, 23, 23, 23,
293
- 23, 23, 23, 23, 23, 23, 23, 23,
294
- 23, 23, 23, 23, 23, 23, 23, 23,
295
- 23, 23, 23, 23, 23, 23, 23, 23,
296
- 23, 23, 25, 23, 51, 51, 51, 51,
297
- 51, 20, 20, 20, 20, 20, 20, 20,
298
- 20, 20, 20, 20, 20, 20, 20, 20,
299
- 20, 20, 20, 51, 20, 21, 20, 20,
300
- 20, 20, 20, 20, 20, 20, 20, 20,
301
- 52, 52, 53, 52, 52, 52, 52, 52,
302
- 52, 52, 52, 52, 52, 52, 20, 20,
303
- 20, 54, 52, 20, 52, 52, 52, 52,
304
- 52, 52, 52, 52, 52, 52, 52, 52,
305
- 52, 52, 52, 52, 52, 52, 52, 52,
306
- 52, 52, 52, 52, 52, 52, 20, 22,
307
- 20, 20, 52, 20, 52, 52, 52, 52,
308
- 52, 52, 52, 52, 52, 52, 52, 52,
309
- 52, 52, 52, 52, 52, 52, 52, 52,
310
- 52, 52, 52, 52, 52, 52, 20, 24,
311
- 23, 23, 23, 23, 23, 23, 23, 23,
312
- 23, 23, 23, 23, 23, 23, 23, 23,
313
- 23, 23, 23, 23, 23, 23, 23, 23,
314
- 23, 23, 23, 55, 23, 23, 23, 23,
315
- 23, 23, 23, 23, 23, 23, 23, 23,
316
- 23, 23, 23, 23, 23, 23, 23, 23,
317
- 23, 23, 23, 23, 23, 23, 23, 23,
318
- 23, 25, 23, 57, 56, 56, 56, 56,
319
- 58, 56, 56, 56, 56, 56, 56, 56,
320
- 56, 56, 56, 56, 56, 56, 56, 56,
321
- 56, 56, 56, 56, 56, 56, 56, 56,
322
- 56, 56, 56, 56, 56, 56, 56, 56,
323
- 56, 56, 56, 56, 56, 56, 56, 56,
324
- 56, 56, 56, 56, 56, 56, 56, 56,
325
- 56, 56, 56, 56, 56, 59, 56, 61,
326
- 60, 60, 60, 60, 35, 60, 60, 60,
327
- 60, 60, 60, 60, 60, 60, 60, 60,
328
- 60, 60, 60, 60, 60, 60, 60, 60,
329
- 60, 60, 60, 60, 60, 60, 60, 60,
330
- 60, 60, 60, 60, 60, 60, 60, 60,
331
- 60, 60, 60, 60, 60, 60, 60, 60,
332
- 60, 60, 60, 60, 60, 60, 60, 60,
333
- 60, 62, 60, 64, 64, 64, 64, 64,
334
- 63, 63, 63, 63, 63, 63, 63, 63,
335
- 63, 63, 63, 63, 63, 63, 63, 63,
336
- 63, 63, 64, 63, 63, 63, 63, 63,
337
- 63, 24, 63, 63, 63, 63, 63, 65,
338
- 65, 66, 65, 65, 65, 65, 65, 65,
339
- 65, 65, 65, 65, 65, 63, 63, 63,
340
- 67, 65, 63, 65, 65, 65, 65, 65,
341
- 65, 65, 65, 65, 65, 65, 65, 65,
342
- 65, 65, 65, 65, 65, 65, 65, 65,
343
- 65, 65, 65, 65, 65, 63, 68, 63,
344
- 63, 65, 63, 65, 65, 65, 65, 65,
345
- 65, 65, 65, 65, 65, 65, 65, 65,
346
- 65, 65, 65, 65, 65, 65, 65, 65,
347
- 65, 65, 65, 65, 65, 63, 24, 63,
348
- 63, 63, 63, 63, 63, 63, 63, 63,
349
- 63, 63, 63, 63, 63, 63, 63, 63,
350
- 63, 63, 63, 63, 63, 63, 63, 63,
351
- 63, 63, 63, 63, 63, 63, 63, 63,
352
- 63, 63, 63, 63, 63, 63, 63, 63,
353
- 63, 63, 63, 63, 63, 63, 63, 63,
354
- 63, 63, 63, 68, 63, 61, 63, 63,
355
- 63, 63, 63, 63, 63, 63, 63, 63,
356
- 63, 63, 63, 63, 63, 63, 63, 63,
357
- 63, 63, 63, 63, 63, 63, 63, 63,
358
- 63, 63, 63, 63, 63, 63, 63, 63,
359
- 63, 63, 63, 63, 63, 63, 63, 63,
360
- 63, 63, 63, 63, 63, 63, 63, 63,
361
- 63, 63, 68, 63, 69, 69, 69, 69,
362
- 69, 63, 63, 63, 63, 63, 63, 63,
363
- 63, 63, 63, 63, 63, 63, 63, 63,
364
- 63, 63, 63, 69, 63, 63, 63, 63,
365
- 63, 63, 24, 63, 63, 63, 63, 63,
366
- 70, 70, 71, 70, 70, 70, 70, 70,
367
- 70, 70, 70, 70, 70, 70, 63, 63,
368
- 63, 72, 70, 63, 70, 70, 70, 70,
369
- 70, 70, 70, 70, 70, 70, 70, 70,
370
- 70, 70, 70, 70, 70, 70, 70, 70,
371
- 70, 70, 70, 70, 70, 70, 63, 68,
372
- 63, 63, 70, 63, 70, 70, 70, 70,
373
- 70, 70, 70, 70, 70, 70, 70, 70,
374
- 70, 70, 70, 70, 70, 70, 70, 70,
375
- 70, 70, 70, 70, 70, 70, 63, 73,
376
- 73, 73, 73, 73, 63, 63, 63, 63,
377
- 63, 63, 63, 63, 63, 63, 63, 63,
378
- 63, 63, 63, 63, 63, 63, 73, 63,
379
- 63, 63, 63, 63, 63, 24, 63, 63,
380
- 63, 63, 63, 74, 74, 63, 74, 74,
381
- 74, 74, 74, 74, 74, 74, 74, 74,
382
- 74, 63, 63, 75, 63, 74, 63, 74,
383
- 74, 74, 74, 74, 74, 74, 74, 74,
384
- 74, 74, 74, 74, 74, 74, 74, 74,
385
- 74, 74, 74, 74, 74, 74, 74, 74,
386
- 74, 63, 68, 63, 63, 74, 63, 74,
387
- 74, 74, 74, 74, 74, 74, 74, 74,
388
- 74, 74, 74, 74, 74, 74, 74, 74,
389
- 74, 74, 74, 74, 74, 74, 74, 74,
390
- 74, 63, 76, 76, 76, 76, 76, 63,
391
- 63, 63, 63, 63, 63, 63, 63, 63,
392
- 63, 63, 63, 63, 63, 63, 63, 63,
393
- 63, 76, 63, 63, 63, 63, 63, 63,
394
- 24, 63, 63, 63, 63, 63, 63, 63,
395
- 63, 63, 63, 63, 63, 63, 63, 63,
396
- 63, 63, 63, 63, 63, 63, 77, 63,
397
- 63, 63, 63, 63, 63, 63, 63, 63,
398
- 63, 63, 63, 63, 63, 63, 63, 63,
399
- 63, 63, 63, 63, 63, 63, 63, 63,
400
- 63, 63, 63, 63, 63, 68, 63, 77,
401
- 77, 77, 77, 77, 63, 63, 63, 63,
402
- 63, 63, 63, 63, 63, 63, 63, 63,
403
- 63, 63, 63, 63, 63, 63, 77, 63,
404
- 78, 63, 63, 63, 63, 79, 63, 63,
405
- 63, 63, 63, 63, 63, 63, 63, 63,
406
- 63, 63, 63, 63, 63, 63, 63, 63,
407
- 63, 63, 63, 63, 63, 63, 63, 63,
408
- 63, 63, 63, 63, 63, 63, 63, 63,
409
- 63, 63, 63, 63, 63, 63, 63, 63,
410
- 63, 63, 63, 63, 63, 63, 63, 63,
411
- 63, 63, 68, 63, 80, 56, 56, 56,
412
- 56, 58, 56, 56, 56, 56, 56, 56,
413
- 56, 56, 56, 56, 56, 56, 56, 56,
414
- 56, 56, 56, 56, 56, 56, 56, 56,
415
- 56, 56, 56, 56, 56, 56, 56, 56,
416
- 56, 56, 56, 56, 56, 56, 56, 56,
417
- 56, 56, 56, 56, 56, 56, 56, 56,
418
- 56, 56, 56, 56, 56, 56, 59, 56,
419
- 81, 60, 60, 60, 60, 81, 60, 60,
420
- 60, 60, 60, 60, 60, 60, 60, 60,
421
- 60, 60, 60, 60, 60, 60, 60, 60,
422
- 60, 60, 60, 60, 60, 60, 60, 60,
423
- 60, 60, 60, 60, 60, 60, 60, 60,
424
- 60, 60, 60, 60, 60, 60, 60, 60,
425
- 60, 60, 60, 60, 60, 60, 60, 60,
426
- 60, 60, 62, 60, 82, 82, 82, 82,
427
- 82, 60, 60, 60, 60, 60, 60, 60,
428
- 60, 60, 60, 60, 60, 60, 60, 60,
429
- 60, 60, 60, 82, 60, 61, 60, 60,
430
- 60, 60, 35, 60, 60, 60, 60, 60,
431
- 83, 83, 84, 83, 83, 83, 83, 83,
432
- 83, 83, 83, 83, 83, 83, 60, 60,
433
- 60, 85, 83, 60, 83, 83, 83, 83,
434
- 83, 83, 83, 83, 83, 83, 83, 83,
435
- 83, 83, 83, 83, 83, 83, 83, 83,
436
- 83, 83, 83, 83, 83, 83, 60, 62,
437
- 60, 60, 83, 60, 83, 83, 83, 83,
438
- 83, 83, 83, 83, 83, 83, 83, 83,
439
- 83, 83, 83, 83, 83, 83, 83, 83,
440
- 83, 83, 83, 83, 83, 83, 60, 86,
441
- 86, 86, 86, 86, 60, 60, 60, 60,
442
- 60, 60, 60, 60, 60, 60, 60, 60,
443
- 60, 60, 60, 60, 60, 60, 86, 60,
444
- 61, 60, 60, 60, 60, 35, 60, 60,
445
- 60, 60, 60, 87, 87, 88, 87, 87,
446
- 87, 87, 87, 87, 87, 87, 87, 87,
447
- 87, 60, 60, 60, 89, 87, 60, 87,
448
- 87, 87, 87, 87, 87, 87, 87, 87,
449
- 87, 87, 87, 87, 87, 87, 87, 87,
450
- 87, 87, 87, 87, 87, 87, 87, 87,
451
- 87, 60, 62, 60, 60, 87, 60, 87,
452
- 87, 87, 87, 87, 87, 87, 87, 87,
453
- 87, 87, 87, 87, 87, 87, 87, 87,
454
- 87, 87, 87, 87, 87, 87, 87, 87,
455
- 87, 60, 90, 90, 90, 90, 90, 60,
456
- 60, 60, 60, 60, 60, 60, 60, 60,
457
- 60, 60, 60, 60, 60, 60, 60, 60,
458
- 60, 90, 60, 61, 60, 60, 60, 60,
459
- 35, 60, 60, 60, 60, 60, 91, 91,
460
- 60, 91, 91, 91, 91, 91, 91, 91,
461
- 91, 91, 91, 91, 60, 60, 92, 60,
462
- 91, 60, 91, 91, 91, 91, 91, 91,
463
- 91, 91, 91, 91, 91, 91, 91, 91,
464
- 91, 91, 91, 91, 91, 91, 91, 91,
465
- 91, 91, 91, 91, 60, 62, 60, 60,
466
- 91, 60, 91, 91, 91, 91, 91, 91,
467
- 91, 91, 91, 91, 91, 91, 91, 91,
468
- 91, 91, 91, 91, 91, 91, 91, 91,
469
- 91, 91, 91, 91, 60, 93, 93, 93,
470
- 93, 93, 60, 60, 60, 60, 60, 60,
471
- 60, 60, 60, 60, 60, 60, 60, 60,
472
- 60, 60, 60, 60, 93, 60, 61, 60,
473
- 60, 60, 60, 35, 60, 60, 60, 60,
474
- 60, 60, 60, 60, 60, 60, 60, 60,
475
- 60, 60, 60, 60, 60, 60, 60, 60,
476
- 60, 94, 60, 60, 60, 60, 60, 60,
477
- 60, 60, 60, 60, 60, 60, 60, 60,
478
- 60, 60, 60, 60, 60, 60, 60, 60,
479
- 60, 60, 60, 60, 60, 60, 60, 60,
480
- 62, 60, 94, 94, 94, 94, 94, 60,
481
- 60, 60, 60, 60, 60, 60, 60, 60,
482
- 60, 60, 60, 60, 60, 60, 60, 60,
483
- 60, 94, 60, 95, 60, 60, 60, 60,
484
- 96, 60, 60, 60, 60, 60, 60, 60,
485
- 60, 60, 60, 60, 60, 60, 60, 60,
486
- 60, 60, 60, 60, 60, 60, 60, 60,
487
- 60, 60, 60, 60, 60, 60, 60, 60,
488
- 60, 60, 60, 60, 60, 60, 60, 60,
489
- 60, 60, 60, 60, 60, 60, 60, 60,
490
- 60, 60, 60, 60, 60, 62, 60, 97,
491
- 97, 97, 97, 97, 56, 56, 56, 56,
492
- 56, 56, 56, 56, 56, 56, 56, 56,
493
- 56, 56, 56, 56, 56, 56, 97, 56,
494
- 80, 56, 56, 56, 56, 58, 56, 56,
495
- 56, 56, 56, 98, 98, 99, 98, 98,
496
- 98, 98, 98, 98, 98, 98, 98, 98,
497
- 98, 56, 56, 56, 100, 98, 56, 98,
498
- 98, 98, 98, 98, 98, 98, 98, 98,
499
- 98, 98, 98, 98, 98, 98, 98, 98,
500
- 98, 98, 98, 98, 98, 98, 98, 98,
501
- 98, 56, 59, 56, 56, 98, 56, 98,
502
- 98, 98, 98, 98, 98, 98, 98, 98,
503
- 98, 98, 98, 98, 98, 98, 98, 98,
504
- 98, 98, 98, 98, 98, 98, 98, 98,
505
- 98, 56, 61, 60, 60, 60, 60, 35,
506
- 60, 60, 60, 60, 60, 60, 60, 60,
507
- 60, 60, 60, 60, 60, 60, 60, 60,
508
- 60, 60, 60, 60, 60, 60, 101, 60,
509
- 60, 60, 60, 60, 60, 60, 60, 60,
510
- 60, 60, 60, 60, 60, 60, 60, 60,
511
- 60, 60, 60, 60, 60, 60, 60, 60,
512
- 60, 60, 60, 60, 62, 60, 97, 97,
513
- 97, 97, 97, 56, 56, 56, 56, 56,
514
- 56, 56, 56, 56, 56, 56, 56, 56,
515
- 56, 56, 56, 56, 56, 97, 56, 57,
516
- 56, 56, 56, 56, 58, 56, 56, 56,
517
- 56, 56, 98, 98, 99, 98, 98, 98,
518
- 98, 98, 98, 98, 98, 98, 98, 98,
519
- 56, 56, 56, 100, 98, 56, 98, 98,
520
- 98, 98, 98, 98, 98, 98, 98, 98,
521
- 98, 98, 98, 98, 98, 98, 98, 98,
522
- 98, 98, 98, 98, 98, 98, 98, 98,
523
- 56, 59, 56, 56, 98, 56, 98, 98,
524
- 98, 98, 98, 98, 98, 98, 98, 98,
525
- 98, 98, 98, 98, 98, 98, 98, 98,
526
- 98, 98, 98, 98, 98, 98, 98, 98,
527
- 56, 103, 103, 103, 103, 103, 102, 102,
528
- 102, 102, 102, 102, 102, 102, 102, 102,
529
- 102, 102, 102, 102, 102, 102, 102, 102,
530
- 103, 102, 102, 102, 102, 102, 102, 21,
531
- 102, 102, 102, 102, 102, 104, 104, 105,
532
- 104, 104, 104, 104, 104, 104, 104, 104,
533
- 104, 104, 104, 102, 102, 102, 106, 104,
534
- 102, 104, 104, 104, 104, 104, 104, 104,
535
- 104, 104, 104, 104, 104, 104, 104, 104,
536
- 104, 104, 104, 104, 104, 104, 104, 104,
537
- 104, 104, 104, 102, 107, 102, 102, 104,
538
- 102, 104, 104, 104, 104, 104, 104, 104,
539
- 104, 104, 104, 104, 104, 104, 104, 104,
540
- 104, 104, 104, 104, 104, 104, 104, 104,
541
- 104, 104, 104, 102, 24, 63, 63, 63,
542
- 63, 63, 63, 63, 63, 63, 63, 63,
543
- 63, 63, 63, 63, 63, 63, 63, 63,
544
- 63, 63, 63, 108, 63, 63, 63, 63,
545
- 63, 63, 63, 63, 63, 63, 63, 63,
546
- 63, 63, 63, 63, 63, 63, 63, 63,
547
- 63, 63, 63, 63, 63, 63, 63, 63,
548
- 63, 68, 63, 21, 102, 102, 102, 102,
549
- 102, 102, 102, 102, 102, 102, 102, 102,
550
- 102, 102, 102, 102, 102, 102, 102, 102,
551
- 102, 102, 102, 102, 102, 102, 102, 102,
552
- 102, 102, 102, 102, 102, 102, 102, 102,
553
- 102, 102, 102, 102, 102, 102, 102, 102,
554
- 102, 102, 102, 102, 102, 102, 102, 102,
555
- 107, 102, 109, 109, 0, 109, 109, 109,
556
- 109, 109, 109, 109, 109, 109, 109, 0,
557
- 0, 0, 0, 0, 109, 0, 109, 109,
558
- 109, 109, 109, 109, 109, 109, 109, 109,
559
- 109, 109, 109, 109, 109, 109, 109, 109,
560
- 109, 109, 109, 109, 109, 109, 109, 109,
561
- 0, 0, 0, 0, 109, 0, 109, 109,
562
- 109, 109, 109, 109, 109, 109, 109, 109,
563
- 109, 109, 109, 109, 109, 109, 109, 109,
564
- 109, 109, 109, 109, 109, 109, 109, 109,
565
- 0, 110, 110, 0, 110, 110, 110, 110,
566
- 110, 110, 110, 110, 110, 110, 111, 0,
567
- 0, 0, 0, 110, 0, 110, 110, 110,
568
- 110, 110, 110, 110, 110, 110, 110, 110,
569
- 110, 110, 110, 110, 110, 110, 110, 110,
570
- 110, 110, 110, 110, 110, 110, 110, 0,
571
- 0, 0, 0, 110, 0, 110, 110, 110,
572
- 110, 110, 110, 110, 110, 110, 110, 110,
573
- 110, 110, 110, 110, 110, 110, 110, 110,
574
- 110, 110, 110, 110, 110, 110, 110, 0,
575
- 112, 112, 0, 112, 112, 112, 112, 112,
576
- 112, 112, 112, 112, 112, 112, 0, 0,
577
- 0, 0, 112, 0, 112, 112, 112, 112,
578
- 112, 112, 112, 112, 112, 112, 112, 112,
579
- 112, 112, 112, 112, 112, 112, 112, 112,
580
- 112, 112, 112, 112, 112, 112, 0, 0,
581
- 0, 0, 112, 0, 112, 112, 112, 112,
582
- 112, 112, 112, 112, 112, 112, 112, 112,
583
- 112, 112, 112, 112, 112, 112, 112, 112,
584
- 112, 112, 112, 112, 112, 112, 0, 113,
585
- 113, 113, 113, 113, 0, 0, 0, 0,
586
- 0, 0, 0, 0, 0, 0, 0, 0,
587
- 0, 0, 0, 0, 0, 0, 113, 0,
588
- 0, 0, 0, 0, 0, 0, 0, 0,
589
- 0, 0, 0, 114, 114, 0, 114, 114,
590
- 114, 114, 114, 114, 114, 114, 114, 114,
591
- 114, 0, 0, 0, 115, 114, 0, 114,
592
- 114, 114, 114, 114, 114, 114, 114, 114,
593
- 114, 114, 114, 114, 114, 114, 114, 114,
594
- 114, 114, 114, 114, 114, 114, 114, 114,
595
- 114, 0, 0, 0, 0, 114, 0, 114,
596
- 114, 114, 114, 114, 114, 114, 114, 114,
597
- 114, 114, 114, 114, 114, 114, 114, 114,
598
- 114, 114, 114, 114, 114, 114, 114, 114,
599
- 114, 0, 116, 116, 116, 116, 116, 0,
600
- 0, 0, 0, 0, 0, 0, 0, 0,
601
- 0, 0, 0, 0, 0, 0, 0, 0,
602
- 0, 116, 0, 0, 0, 0, 0, 0,
603
- 0, 0, 0, 0, 0, 0, 0, 0,
604
- 0, 0, 0, 0, 0, 0, 0, 0,
605
- 0, 0, 0, 0, 0, 0, 0, 117,
606
- 0, 118, 120, 119, 122, 122, 123, 122,
607
- 122, 122, 122, 122, 122, 122, 122, 122,
608
- 122, 121, 121, 121, 121, 121, 122, 121,
609
- 122, 122, 122, 122, 122, 122, 122, 122,
610
- 122, 122, 122, 122, 122, 122, 122, 122,
611
- 122, 122, 122, 122, 122, 122, 122, 122,
612
- 122, 122, 121, 121, 121, 121, 122, 121,
613
- 122, 122, 122, 122, 122, 122, 122, 122,
614
- 122, 122, 122, 122, 122, 122, 122, 122,
615
- 122, 122, 122, 122, 122, 122, 122, 122,
616
- 122, 122, 121, 124, 125, 24, 23, 23,
617
- 23, 23, 23, 23, 23, 23, 23, 23,
618
- 23, 23, 23, 23, 23, 23, 23, 23,
619
- 23, 23, 23, 23, 23, 23, 23, 23,
620
- 23, 23, 23, 23, 23, 23, 23, 23,
621
- 23, 23, 23, 23, 23, 23, 23, 23,
622
- 23, 23, 23, 23, 23, 23, 23, 23,
623
- 23, 23, 23, 23, 23, 23, 23, 25,
624
- 23, 24, 23, 23, 23, 23, 23, 23,
625
- 23, 23, 23, 23, 23, 23, 23, 23,
626
- 23, 23, 23, 23, 23, 23, 23, 23,
627
- 23, 23, 23, 23, 23, 23, 23, 23,
628
- 23, 23, 23, 23, 23, 23, 23, 23,
629
- 23, 23, 23, 23, 23, 23, 23, 23,
630
- 23, 23, 23, 23, 23, 23, 23, 23,
631
- 23, 23, 23, 25, 23, 61, 60, 60,
632
- 60, 60, 35, 60, 60, 60, 60, 60,
633
- 60, 60, 60, 60, 60, 60, 60, 60,
634
- 60, 60, 60, 60, 60, 60, 60, 60,
635
- 60, 60, 60, 60, 60, 60, 60, 60,
636
- 60, 60, 60, 60, 60, 60, 60, 60,
637
- 60, 60, 60, 60, 60, 60, 60, 60,
638
- 60, 60, 60, 60, 60, 60, 60, 62,
639
- 60, 61, 60, 60, 60, 60, 35, 60,
640
- 60, 60, 60, 60, 60, 60, 60, 60,
641
- 60, 60, 60, 60, 60, 60, 60, 60,
642
- 60, 60, 60, 60, 60, 60, 60, 60,
643
- 60, 60, 60, 60, 60, 60, 60, 60,
644
- 60, 60, 60, 60, 60, 60, 60, 60,
645
- 60, 60, 60, 60, 60, 60, 60, 60,
646
- 60, 60, 60, 62, 60, 24, 63, 63,
647
- 63, 63, 63, 63, 63, 63, 63, 63,
648
- 63, 63, 63, 63, 63, 63, 63, 63,
649
- 63, 63, 63, 63, 63, 63, 63, 63,
650
- 63, 63, 63, 63, 63, 63, 63, 63,
651
- 63, 63, 63, 63, 63, 63, 63, 63,
652
- 63, 63, 63, 63, 63, 63, 63, 63,
653
- 63, 63, 68, 63, 24, 63, 63, 63,
654
- 63, 63, 63, 63, 63, 63, 63, 63,
655
- 63, 63, 63, 63, 63, 63, 63, 63,
656
- 63, 63, 63, 63, 63, 63, 63, 63,
657
- 63, 63, 63, 63, 63, 63, 63, 63,
658
- 63, 63, 63, 63, 63, 63, 63, 63,
659
- 63, 63, 63, 63, 63, 63, 63, 63,
660
- 63, 68, 63, 126, 0
661
- ]
662
-
663
- class << self
664
- attr_accessor :_parser_trans_targs
665
- private :_parser_trans_targs, :_parser_trans_targs=
666
- end
667
- self._parser_trans_targs = [
668
- 49, 1, 2, 3, 4, 3, 12, 52,
669
- 4, 5, 12, 52, 49, 6, 5, 7,
670
- 6, 7, 8, 42, 9, 10, 13, 9,
671
- 10, 13, 11, 5, 12, 52, 11, 5,
672
- 12, 52, 51, 14, 15, 16, 20, 54,
673
- 15, 16, 20, 54, 17, 16, 18, 17,
674
- 18, 19, 21, 15, 16, 20, 54, 53,
675
- 22, 23, 14, 31, 22, 23, 31, 24,
676
- 26, 27, 41, 58, 25, 26, 27, 41,
677
- 58, 28, 27, 29, 28, 29, 30, 40,
678
- 23, 32, 33, 34, 38, 56, 33, 34,
679
- 38, 56, 35, 34, 36, 35, 36, 37,
680
- 39, 33, 34, 38, 56, 55, 24, 26,
681
- 27, 41, 58, 25, 57, 44, 44, 45,
682
- 46, 47, 46, 59, 47, 59, 0, 49,
683
- 50, 49, 1, 43, 49, 49, 49
684
- ]
685
-
686
- class << self
687
- attr_accessor :_parser_trans_actions
688
- private :_parser_trans_actions, :_parser_trans_actions=
689
- end
690
- self._parser_trans_actions = [
691
- 1, 0, 2, 3, 4, 0, 4, 4,
692
- 0, 5, 0, 0, 6, 7, 0, 7,
693
- 0, 0, 0, 0, 8, 9, 8, 0,
694
- 10, 0, 11, 12, 13, 13, 0, 14,
695
- 15, 15, 0, 10, 11, 12, 13, 16,
696
- 0, 14, 15, 17, 7, 0, 7, 0,
697
- 0, 10, 0, 18, 19, 20, 21, 22,
698
- 8, 23, 9, 8, 0, 10, 0, 0,
699
- 11, 12, 13, 16, 0, 0, 14, 15,
700
- 17, 7, 0, 7, 0, 0, 0, 10,
701
- 9, 10, 11, 12, 13, 16, 0, 14,
702
- 15, 17, 7, 0, 7, 0, 0, 10,
703
- 10, 18, 19, 20, 21, 22, 8, 18,
704
- 19, 20, 21, 8, 22, 24, 0, 2,
705
- 3, 4, 0, 4, 0, 0, 0, 27,
706
- 28, 29, 24, 0, 30, 31, 32
707
- ]
708
-
709
- class << self
710
- attr_accessor :_parser_to_state_actions
711
- private :_parser_to_state_actions, :_parser_to_state_actions=
712
- end
713
- self._parser_to_state_actions = [
714
- 0, 0, 0, 0, 0, 0, 0, 0,
715
- 0, 0, 0, 0, 0, 0, 0, 0,
716
- 0, 0, 0, 0, 0, 0, 0, 0,
717
- 0, 0, 0, 0, 0, 0, 0, 0,
718
- 0, 0, 0, 0, 0, 0, 0, 0,
719
- 0, 0, 0, 0, 0, 0, 0, 0,
720
- 25, 25, 0, 0, 0, 0, 0, 0,
721
- 0, 0, 0, 0
722
- ]
723
-
724
- class << self
725
- attr_accessor :_parser_from_state_actions
726
- private :_parser_from_state_actions, :_parser_from_state_actions=
727
- end
728
- self._parser_from_state_actions = [
729
- 0, 0, 0, 0, 0, 0, 0, 0,
730
- 0, 0, 0, 0, 0, 0, 0, 0,
731
- 0, 0, 0, 0, 0, 0, 0, 0,
732
- 0, 0, 0, 0, 0, 0, 0, 0,
733
- 0, 0, 0, 0, 0, 0, 0, 0,
734
- 0, 0, 0, 0, 0, 0, 0, 0,
735
- 0, 26, 0, 0, 0, 0, 0, 0,
736
- 0, 0, 0, 0
737
- ]
738
-
739
- class << self
740
- attr_accessor :_parser_eof_trans
741
- private :_parser_eof_trans, :_parser_eof_trans=
742
- end
743
- self._parser_eof_trans = [
744
- 0, 1, 1, 1, 1, 13, 13, 13,
745
- 13, 13, 13, 13, 13, 13, 13, 13,
746
- 13, 13, 13, 13, 13, 13, 13, 13,
747
- 13, 13, 13, 13, 13, 13, 13, 13,
748
- 13, 13, 13, 13, 13, 13, 13, 13,
749
- 13, 13, 13, 1, 1, 1, 1, 1,
750
- 0, 0, 122, 125, 126, 125, 126, 125,
751
- 126, 125, 126, 127
752
- ]
753
-
754
- class << self
755
- attr_accessor :parser_start
756
- end
757
- self.parser_start = 49;
758
- class << self
759
- attr_accessor :parser_first_final
760
- end
761
- self.parser_first_final = 49;
762
- class << self
763
- attr_accessor :parser_error
764
- end
765
- self.parser_error = 0;
766
-
767
- class << self
768
- attr_accessor :parser_en_Closeout
769
- end
770
- self.parser_en_Closeout = 48;
771
- class << self
772
- attr_accessor :parser_en_main
773
- end
774
- self.parser_en_main = 49;
775
-
776
-
777
- # line 120 "scanner.rl"
778
-
779
- # line 780 "scanner.rb"
780
- begin
781
- p ||= 0
782
- pe ||= data.length
783
- cs = parser_start
784
- ts = nil
785
- te = nil
786
- act = 0
787
- end
788
47
 
789
- # line 121 "scanner.rl"
790
-
791
- # line 792 "scanner.rb"
792
- begin
793
- testEof = false
794
- _slen, _trans, _keys, _inds, _acts, _nacts = nil
795
- _goto_level = 0
796
- _resume = 10
797
- _eof_trans = 15
798
- _again = 20
799
- _test_eof = 30
800
- _out = 40
801
- while true
802
- if _goto_level <= 0
803
- if p == pe
804
- _goto_level = _test_eof
805
- next
806
- end
807
- if cs == 0
808
- _goto_level = _out
809
- next
810
- end
811
- end
812
- if _goto_level <= _resume
813
- case _parser_from_state_actions[cs]
814
- when 26 then
815
- # line 1 "NONE"
816
- begin
817
- ts = p
818
- end
819
- # line 820 "scanner.rb"
820
- end
821
- _keys = cs << 1
822
- _inds = _parser_index_offsets[cs]
823
- _slen = _parser_key_spans[cs]
824
- _trans = if ( _slen > 0 &&
825
- _parser_trans_keys[_keys] <= data[p].ord &&
826
- data[p].ord <= _parser_trans_keys[_keys + 1]
827
- ) then
828
- _parser_indicies[ _inds + data[p].ord - _parser_trans_keys[_keys] ]
829
- else
830
- _parser_indicies[ _inds + _slen ]
831
- end
832
- end
833
- if _goto_level <= _eof_trans
834
- cs = _parser_trans_targs[_trans]
835
- if _parser_trans_actions[_trans] != 0
836
- case _parser_trans_actions[_trans]
837
- when 24 then
838
- # line 5 "scanner.rl"
839
- begin
840
- mark_pfx = p end
841
- when 2 then
842
- # line 6 "scanner.rl"
843
- begin
844
-
845
- if data[mark_pfx..p-1] != @prefix
846
- closing = data[mark_pfx-1,1] == '/'
847
- @nodes.last << data[mark_pfx-(closing ? 2 : 1)..p]
848
- begin
849
- p += 1
850
- _goto_level = _out
851
- next
852
- end
853
-
854
- end
855
- end
856
- when 3 then
857
- # line 13 "scanner.rl"
858
- begin
859
- mark_stg = p end
860
- when 4 then
861
- # line 14 "scanner.rl"
862
- begin
863
- @starttag = data[mark_stg..p-1] end
864
- when 11 then
865
- # line 15 "scanner.rl"
866
- begin
867
- mark_attr = p end
868
- when 15 then
869
- # line 16 "scanner.rl"
870
- begin
871
-
872
- @attrs[@nat] = @vat
873
- end
874
- when 5 then
875
- # line 25 "scanner.rl"
876
- begin
877
- mark_nat = p end
878
- when 7 then
879
- # line 26 "scanner.rl"
880
- begin
881
- @nat = data[mark_nat..p-1] end
882
- when 8 then
883
- # line 27 "scanner.rl"
884
- begin
885
- mark_vat = p end
886
- when 10 then
887
- # line 28 "scanner.rl"
888
- begin
889
- @vat = data[mark_vat..p-1] end
890
- when 27 then
891
- # line 79 "scanner.rl"
892
- begin
893
- te = p+1
894
- begin
895
- @nodes.last << data[p]
896
- @tagstart = p
897
- end
898
- end
899
- when 29 then
900
- # line 79 "scanner.rl"
901
- begin
902
- te = p
903
- p = p - 1; begin
904
- @nodes.last << data[p]
905
- @tagstart = p
906
- end
907
- end
908
- when 1 then
909
- # line 79 "scanner.rl"
910
- begin
911
- begin p = ((te))-1; end
912
- begin
913
- @nodes.last << data[p]
914
- @tagstart = p
915
- end
916
- end
917
- when 6 then
918
- # line 1 "NONE"
919
- begin
920
- case act
921
- when 1 then
922
- begin begin p = ((te))-1; end
923
-
924
- tag = {:prefix=>@prefix, :name=>@starttag, :flavor => @flavor, :attrs => @attrs}
925
- @prefix = nil
926
- @name = nil
927
- @flavor = :tasteless
928
- @attrs = {}
929
- @nodes << tag << ''
930
- begin
931
- p += 1
932
- _goto_level = _out
933
- next
934
- end
935
-
936
- end
937
- when 2 then
938
- begin begin p = ((te))-1; end
939
-
940
- @nodes.last << data[p]
941
- @tagstart = p
942
- end
943
- end
944
- end
945
- when 13 then
946
- # line 15 "scanner.rl"
947
- begin
948
- mark_attr = p end
949
- # line 16 "scanner.rl"
950
- begin
951
-
952
- @attrs[@nat] = @vat
953
- end
954
- when 14 then
955
- # line 16 "scanner.rl"
956
- begin
957
-
958
- @attrs[@nat] = @vat
959
- end
960
- # line 25 "scanner.rl"
961
- begin
962
- mark_nat = p end
963
- when 18 then
964
- # line 27 "scanner.rl"
965
- begin
966
- mark_vat = p end
967
- # line 15 "scanner.rl"
968
- begin
969
- mark_attr = p end
970
- when 9 then
971
- # line 27 "scanner.rl"
972
- begin
973
- mark_vat = p end
974
- # line 28 "scanner.rl"
975
- begin
976
- @vat = data[mark_vat..p-1] end
977
- when 23 then
978
- # line 28 "scanner.rl"
979
- begin
980
- @vat = data[mark_vat..p-1] end
981
- # line 27 "scanner.rl"
982
- begin
983
- mark_vat = p end
984
- when 31 then
985
- # line 30 "scanner.rl"
986
- begin
987
- @flavor = :open end
988
- # line 70 "scanner.rl"
989
- begin
990
- te = p
991
- p = p - 1; begin
992
- tag = {:prefix=>@prefix, :name=>@starttag, :flavor => @flavor, :attrs => @attrs}
993
- @prefix = nil
994
- @name = nil
995
- @flavor = :tasteless
996
- @attrs = {}
997
- @nodes << tag << ''
998
- begin
999
- p += 1
1000
- _goto_level = _out
1001
- next
1002
- end
1003
-
1004
- end
1005
- end
1006
- when 30 then
1007
- # line 31 "scanner.rl"
1008
- begin
1009
- @flavor = :self end
1010
- # line 70 "scanner.rl"
1011
- begin
1012
- te = p
1013
- p = p - 1; begin
1014
- tag = {:prefix=>@prefix, :name=>@starttag, :flavor => @flavor, :attrs => @attrs}
1015
- @prefix = nil
1016
- @name = nil
1017
- @flavor = :tasteless
1018
- @attrs = {}
1019
- @nodes << tag << ''
1020
- begin
1021
- p += 1
1022
- _goto_level = _out
1023
- next
1024
- end
1025
-
1026
- end
1027
- end
1028
- when 32 then
1029
- # line 32 "scanner.rl"
1030
- begin
1031
- @flavor = :close end
1032
- # line 70 "scanner.rl"
1033
- begin
1034
- te = p
1035
- p = p - 1; begin
1036
- tag = {:prefix=>@prefix, :name=>@starttag, :flavor => @flavor, :attrs => @attrs}
1037
- @prefix = nil
1038
- @name = nil
1039
- @flavor = :tasteless
1040
- @attrs = {}
1041
- @nodes << tag << ''
1042
- begin
1043
- p += 1
1044
- _goto_level = _out
1045
- next
1046
- end
1047
-
1048
- end
1049
- end
1050
- when 22 then
1051
- # line 1 "NONE"
1052
- begin
1053
- te = p+1
1054
- end
1055
- # line 70 "scanner.rl"
1056
- begin
1057
- act = 1; end
1058
- when 28 then
1059
- # line 1 "NONE"
1060
- begin
1061
- te = p+1
1062
- end
1063
- # line 79 "scanner.rl"
1064
- begin
1065
- act = 2; end
1066
- when 12 then
1067
- # line 15 "scanner.rl"
1068
- begin
1069
- mark_attr = p end
1070
- # line 16 "scanner.rl"
1071
- begin
1072
-
1073
- @attrs[@nat] = @vat
1074
- end
1075
- # line 25 "scanner.rl"
1076
- begin
1077
- mark_nat = p end
1078
- when 20 then
1079
- # line 27 "scanner.rl"
1080
- begin
1081
- mark_vat = p end
1082
- # line 15 "scanner.rl"
1083
- begin
1084
- mark_attr = p end
1085
- # line 16 "scanner.rl"
1086
- begin
1087
-
1088
- @attrs[@nat] = @vat
1089
- end
1090
- when 17 then
1091
- # line 1 "NONE"
1092
- begin
1093
- te = p+1
1094
- end
1095
- # line 16 "scanner.rl"
1096
- begin
1097
-
1098
- @attrs[@nat] = @vat
1099
- end
1100
- # line 70 "scanner.rl"
1101
- begin
1102
- act = 1; end
1103
- when 19 then
1104
- # line 27 "scanner.rl"
1105
- begin
1106
- mark_vat = p end
1107
- # line 15 "scanner.rl"
1108
- begin
1109
- mark_attr = p end
1110
- # line 16 "scanner.rl"
1111
- begin
1112
-
1113
- @attrs[@nat] = @vat
1114
- end
1115
- # line 25 "scanner.rl"
1116
- begin
1117
- mark_nat = p end
1118
- when 16 then
1119
- # line 1 "NONE"
1120
- begin
1121
- te = p+1
1122
- end
1123
- # line 15 "scanner.rl"
1124
- begin
1125
- mark_attr = p end
1126
- # line 16 "scanner.rl"
1127
- begin
1128
-
1129
- @attrs[@nat] = @vat
1130
- end
1131
- # line 70 "scanner.rl"
1132
- begin
1133
- act = 1; end
1134
- when 21 then
1135
- # line 1 "NONE"
1136
- begin
1137
- te = p+1
1138
- end
1139
- # line 27 "scanner.rl"
1140
- begin
1141
- mark_vat = p end
1142
- # line 15 "scanner.rl"
1143
- begin
1144
- mark_attr = p end
1145
- # line 16 "scanner.rl"
1146
- begin
1147
-
1148
- @attrs[@nat] = @vat
1149
- end
1150
- # line 70 "scanner.rl"
1151
- begin
1152
- act = 1; end
1153
- # line 1154 "scanner.rb"
1154
- end
1155
- end
1156
- end
1157
- if _goto_level <= _again
1158
- case _parser_to_state_actions[cs]
1159
- when 25 then
1160
- # line 1 "NONE"
1161
- begin
1162
- ts = nil; end
1163
- # line 1164 "scanner.rb"
1164
- end
1165
-
1166
- if cs == 0
1167
- _goto_level = _out
1168
- next
1169
- end
1170
- p += 1
1171
- if p != pe
1172
- _goto_level = _resume
1173
- next
1174
- end
1175
- end
1176
- if _goto_level <= _test_eof
1177
- if p == eof
1178
- if _parser_eof_trans[cs] > 0
1179
- _trans = _parser_eof_trans[cs] - 1;
1180
- _goto_level = _eof_trans
1181
- next;
1182
- end
1183
- end
1184
-
1185
- end
1186
- if _goto_level <= _out
1187
- break
1188
- end
1189
- end
1190
- end
1191
-
1192
- # line 122 "scanner.rl"
1193
- return p
48
+ def parse_attributes(text) # :nodoc:
49
+ attr = {}
50
+ re = /(\w+?)\s*=\s*('|")(.*?)\2/
51
+ while md = re.match(text)
52
+ attr[$1] = $3
53
+ text = md.post_match
54
+ end
55
+ attr
1194
56
  end
1195
57
  end
1196
- end
58
+ end