mediacloth 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,7 +12,7 @@ require 'mediacloth/mediawikiast'
12
12
 
13
13
  class MediaWikiParser < Racc::Parser
14
14
 
15
- module_eval <<'..end mediawikiparser.y modeval..id823eb1450e', 'mediawikiparser.y', 186
15
+ module_eval <<'..end mediawikiparser.y modeval..id2fa3e0400b', 'mediawikiparser.y', 354
16
16
 
17
17
  attr_accessor :lexer
18
18
 
@@ -33,124 +33,248 @@ end
33
33
  def next_token
34
34
  return @lexer.lex
35
35
  end
36
- ..end mediawikiparser.y modeval..id823eb1450e
36
+ ..end mediawikiparser.y modeval..id2fa3e0400b
37
37
 
38
38
  ##### racc 1.4.5 generates ###
39
39
 
40
40
  racc_reduce_table = [
41
41
  0, 0, :racc_error,
42
- 1, 27, :_reduce_1,
43
- 1, 29, :_reduce_2,
44
- 1, 29, :_reduce_3,
45
- 1, 29, :_reduce_4,
46
- 1, 29, :_reduce_5,
47
- 1, 29, :_reduce_6,
48
- 3, 29, :_reduce_7,
49
- 0, 35, :_reduce_8,
50
- 1, 35, :_reduce_9,
51
- 1, 28, :_reduce_10,
52
- 2, 28, :_reduce_11,
53
- 1, 30, :_reduce_12,
54
- 1, 30, :_reduce_13,
55
- 3, 36, :_reduce_14,
56
- 3, 36, :_reduce_15,
57
- 1, 36, :_reduce_16,
58
- 1, 36, :_reduce_17,
59
- 1, 36, :_reduce_18,
60
- 1, 36, :_reduce_19,
61
- 1, 36, :_reduce_20,
62
- 3, 37, :_reduce_21,
63
- 3, 37, :_reduce_22,
64
- 4, 31, :_reduce_23,
65
- 4, 32, :_reduce_24,
66
- 0, 40, :_reduce_25,
67
- 3, 39, :_reduce_26,
68
- 0, 39, :_reduce_27,
69
- 3, 38, :_reduce_28,
70
- 1, 33, :_reduce_29,
71
- 3, 34, :_reduce_30 ]
72
-
73
- racc_reduce_n = 31
74
-
75
- racc_shift_n = 53
42
+ 1, 38, :_reduce_1,
43
+ 1, 40, :_reduce_2,
44
+ 1, 40, :_reduce_3,
45
+ 1, 40, :_reduce_4,
46
+ 1, 40, :_reduce_5,
47
+ 1, 40, :_reduce_6,
48
+ 3, 40, :_reduce_7,
49
+ 3, 40, :_reduce_8,
50
+ 6, 40, :_reduce_9,
51
+ 4, 40, :_reduce_10,
52
+ 1, 40, :_reduce_none,
53
+ 0, 46, :_reduce_12,
54
+ 1, 46, :_reduce_13,
55
+ 1, 47, :_reduce_14,
56
+ 3, 47, :_reduce_15,
57
+ 1, 51, :_reduce_16,
58
+ 3, 51, :_reduce_17,
59
+ 0, 49, :_reduce_18,
60
+ 2, 49, :_reduce_19,
61
+ 0, 48, :_reduce_20,
62
+ 2, 48, :_reduce_21,
63
+ 3, 48, :_reduce_22,
64
+ 1, 39, :_reduce_23,
65
+ 2, 39, :_reduce_24,
66
+ 1, 41, :_reduce_25,
67
+ 1, 41, :_reduce_26,
68
+ 3, 50, :_reduce_27,
69
+ 4, 50, :_reduce_28,
70
+ 0, 54, :_reduce_29,
71
+ 4, 54, :_reduce_30,
72
+ 5, 54, :_reduce_31,
73
+ 0, 55, :_reduce_32,
74
+ 3, 55, :_reduce_33,
75
+ 4, 55, :_reduce_34,
76
+ 3, 55, :_reduce_35,
77
+ 4, 55, :_reduce_36,
78
+ 1, 52, :_reduce_37,
79
+ 1, 52, :_reduce_38,
80
+ 1, 52, :_reduce_39,
81
+ 1, 52, :_reduce_40,
82
+ 1, 52, :_reduce_41,
83
+ 2, 53, :_reduce_42,
84
+ 2, 53, :_reduce_43,
85
+ 3, 53, :_reduce_44,
86
+ 3, 53, :_reduce_45,
87
+ 4, 42, :_reduce_46,
88
+ 4, 43, :_reduce_47,
89
+ 0, 58, :_reduce_48,
90
+ 3, 57, :_reduce_49,
91
+ 0, 57, :_reduce_50,
92
+ 2, 56, :_reduce_51,
93
+ 3, 56, :_reduce_52,
94
+ 1, 44, :_reduce_53,
95
+ 3, 45, :_reduce_54 ]
96
+
97
+ racc_reduce_n = 55
98
+
99
+ racc_shift_n = 100
76
100
 
77
101
  racc_action_table = [
78
- 6, 36, 10, -27, 16, 35, 20, 26, 23, 41,
79
- 3, 5, 8, 11, 13, 15, 18, 6, 32, 10,
80
- 1, 16, 7, 20, 31, 23, 43, 3, 5, 8,
81
- 11, 13, 15, 18, 44, -27, 50, 1, 6, 7,
82
- 10, 46, 16, 47, 20, 48, 23, 26, 3, 5,
83
- 8, 11, 13, 15, 18, 6, 26, 10, 1, 16,
84
- 7, 20, 51, 23, -25, 3, 5, 8, 11, 13,
85
- 15, 18, 6, nil, 10, 1, 16, 7, 20, nil,
86
- 23, nil, 3, 5, 8, 11, 13, 15, 18, nil,
87
- nil, nil, 1, 6, 7, 10, 42, 16, nil, 20,
88
- nil, 23, nil, 3, 5, 8, 11, 13, 15, 18,
89
- 6, nil, 10, 1, 16, 7, 20, nil, 23, nil,
90
- 3, 5, 8, 11, 13, 15, 18, 6, nil, 10,
91
- 1, 16, 7, 20, nil, 23, nil, 3, 5, 8,
92
- 11, 13, 15, 18, 6, nil, 10, 1, 16, 7,
93
- 20, nil, 23, nil, 3, 5, 8, 11, 13, 15,
94
- 18, 6, 40, 10, 1, 16, 7, 20, nil, 23,
95
- nil, 3, 5, 8, 11, 13, 15, 18, nil, nil,
96
- nil, 1, nil, 7 ]
102
+ 4, 57, 7, 54, 14, -48, 36, 23, 57, 72,
103
+ 54, 3, 32, 8, 9, 12, 16, 18, 21, 25,
104
+ 37, 62, 63, 6, 4, 10, 7, 57, 14, 54,
105
+ 56, 23, 57, 5, 54, 3, 37, 8, 9, 12,
106
+ 16, 18, 21, 25, -50, 47, 57, 6, 54, 10,
107
+ 79, 4, 28, 7, 57, 14, 54, 5, 23, 80,
108
+ 81, 69, 3, 58, 8, 9, 12, 16, 18, 21,
109
+ 25, 32, 37, 86, 6, 4, 10, 7, 43, 14,
110
+ 59, 41, 23, 39, 5, 90, 3, -50, 8, 9,
111
+ 12, 16, 18, 21, 25, 37, 60, 61, 6, 32,
112
+ 10, 98, 4, 67, 7, nil, 14, nil, 5, 23,
113
+ nil, 90, nil, 3, nil, 8, 9, 12, 16, 18,
114
+ 21, 25, nil, nil, nil, 6, 4, 10, 7, 34,
115
+ 14, nil, nil, 23, nil, 5, nil, 3, nil, 8,
116
+ 9, 12, 16, 18, 21, 25, nil, nil, nil, 6,
117
+ 4, 10, 7, nil, 14, nil, nil, 23, nil, 5,
118
+ nil, 3, nil, 8, 9, 12, 16, 18, 21, 25,
119
+ nil, nil, nil, 6, 4, 10, 7, nil, 14, nil,
120
+ nil, 23, nil, 5, nil, 3, nil, 8, 9, 12,
121
+ 16, 18, 21, 25, nil, nil, nil, 6, 4, 10,
122
+ 7, nil, 14, nil, 89, 23, nil, 5, nil, 3,
123
+ nil, 8, 9, 12, 16, 18, 21, 25, nil, nil,
124
+ nil, 6, 4, 10, 7, nil, 14, nil, nil, 23,
125
+ nil, 5, nil, 3, nil, 8, 9, 12, 16, 18,
126
+ 21, 25, nil, nil, nil, 6, 4, 10, 7, nil,
127
+ 14, nil, nil, 23, nil, 5, nil, 3, nil, 8,
128
+ 9, 12, 16, 18, 21, 25, nil, nil, nil, 6,
129
+ 4, 10, 7, nil, 14, nil, 87, 23, nil, 5,
130
+ nil, 3, nil, 8, 9, 12, 16, 18, 21, 25,
131
+ nil, nil, nil, 6, 4, 10, 7, nil, 14, nil,
132
+ nil, 23, 84, 5, nil, 3, 45, 8, 9, 12,
133
+ 16, 18, 21, 25, nil, nil, nil, 6, nil, 10,
134
+ nil, 4, 46, 7, nil, 14, nil, 5, 23, nil,
135
+ nil, nil, 3, nil, 8, 9, 12, 16, 18, 21,
136
+ 25, nil, nil, nil, 6, 4, 10, 7, nil, 14,
137
+ nil, nil, 23, nil, 5, nil, 3, nil, 8, 9,
138
+ 12, 16, 18, 21, 25, nil, nil, nil, 6, 4,
139
+ 10, 7, nil, 14, nil, nil, 23, nil, 5, nil,
140
+ 3, nil, 8, 9, 12, 16, 18, 21, 25, nil,
141
+ nil, nil, 6, 4, 10, 7, nil, 14, nil, nil,
142
+ 23, nil, 5, nil, 3, nil, 8, 9, 12, 16,
143
+ 18, 21, 25, nil, nil, 48, 6, 4, 10, 7,
144
+ nil, 14, nil, nil, 23, nil, 5, nil, 3, nil,
145
+ 8, 9, 12, 16, 18, 21, 25, nil, nil, nil,
146
+ 6, 4, 10, 7, 52, 14, nil, nil, 23, nil,
147
+ 5, nil, 3, nil, 8, 9, 12, 16, 18, 21,
148
+ 25, nil, nil, nil, 6, 4, 10, 7, nil, 14,
149
+ nil, nil, 23, nil, 5, nil, 3, nil, 8, 9,
150
+ 12, 16, 18, 21, 25, nil, nil, nil, 6, 4,
151
+ 10, 7, nil, 14, nil, 75, 23, nil, 5, nil,
152
+ 3, nil, 8, 9, 12, 16, 18, 21, 25, nil,
153
+ nil, nil, 6, 4, 10, 7, nil, 14, nil, nil,
154
+ 23, 70, 5, nil, 3, nil, 8, 9, 12, 16,
155
+ 18, 21, 25, nil, nil, 66, 6, nil, 10, nil,
156
+ 4, nil, 7, nil, 14, nil, 5, 23, nil, 90,
157
+ nil, 3, nil, 8, 9, 12, 16, 18, 21, 25,
158
+ nil, nil, nil, 6, nil, 10, nil, nil, nil, nil,
159
+ nil, nil, nil, 5 ]
97
160
 
98
161
  racc_action_check = [
99
- 0, 23, 0, 25, 0, 20, 0, 18, 0, 28,
100
- 0, 0, 0, 0, 0, 0, 0, 39, 16, 39,
101
- 0, 39, 0, 39, 14, 39, 31, 39, 39, 39,
102
- 39, 39, 39, 39, 32, 34, 39, 39, 6, 39,
103
- 6, 35, 6, 36, 6, 37, 6, 38, 6, 6,
104
- 6, 6, 6, 6, 6, 7, 1, 7, 6, 7,
105
- 6, 7, 45, 7, 49, 7, 7, 7, 7, 7,
106
- 7, 7, 10, nil, 10, 7, 10, 7, 10, nil,
107
- 10, nil, 10, 10, 10, 10, 10, 10, 10, nil,
108
- nil, nil, 10, 30, 10, 30, 30, 30, nil, 30,
109
- nil, 30, nil, 30, 30, 30, 30, 30, 30, 30,
110
- 29, nil, 29, 30, 29, 30, 29, nil, 29, nil,
111
- 29, 29, 29, 29, 29, 29, 29, 17, nil, 17,
112
- 29, 17, 29, 17, nil, 17, nil, 17, 17, 17,
113
- 17, 17, 17, 17, 26, nil, 26, 17, 26, 17,
114
- 26, nil, 26, nil, 26, 26, 26, 26, 26, 26,
115
- 26, 27, 27, 27, 26, 27, 26, 27, nil, 27,
116
- nil, 27, 27, 27, 27, 27, 27, 27, nil, nil,
117
- nil, 27, nil, 27 ]
162
+ 0, 84, 0, 84, 0, 68, 10, 0, 87, 55,
163
+ 87, 0, 51, 0, 0, 0, 0, 0, 0, 0,
164
+ 10, 43, 43, 0, 3, 0, 3, 56, 3, 56,
165
+ 37, 3, 70, 0, 70, 3, 36, 3, 3, 3,
166
+ 3, 3, 3, 3, 33, 30, 37, 3, 37, 3,
167
+ 63, 4, 4, 4, 75, 4, 75, 3, 4, 64,
168
+ 65, 53, 4, 38, 4, 4, 4, 4, 4, 4,
169
+ 4, 25, 72, 73, 4, 5, 4, 5, 23, 5,
170
+ 39, 14, 5, 11, 4, 79, 5, 44, 5, 5,
171
+ 5, 5, 5, 5, 5, 86, 40, 41, 5, 6,
172
+ 5, 91, 90, 50, 90, nil, 90, nil, 5, 90,
173
+ nil, 90, nil, 90, nil, 90, 90, 90, 90, 90,
174
+ 90, 90, nil, nil, nil, 90, 7, 90, 7, 7,
175
+ 7, nil, nil, 7, nil, 90, nil, 7, nil, 7,
176
+ 7, 7, 7, 7, 7, 7, nil, nil, nil, 7,
177
+ 89, 7, 89, nil, 89, nil, nil, 89, nil, 7,
178
+ nil, 89, nil, 89, 89, 89, 89, 89, 89, 89,
179
+ nil, nil, nil, 89, 78, 89, 78, nil, 78, nil,
180
+ nil, 78, nil, 89, nil, 78, nil, 78, 78, 78,
181
+ 78, 78, 78, 78, nil, nil, nil, 78, 76, 78,
182
+ 76, nil, 76, nil, 76, 76, nil, 78, nil, 76,
183
+ nil, 76, 76, 76, 76, 76, 76, 76, nil, nil,
184
+ nil, 76, 15, 76, 15, nil, 15, nil, nil, 15,
185
+ nil, 76, nil, 15, nil, 15, 15, 15, 15, 15,
186
+ 15, 15, nil, nil, nil, 15, 74, 15, 74, nil,
187
+ 74, nil, nil, 74, nil, 15, nil, 74, nil, 74,
188
+ 74, 74, 74, 74, 74, 74, nil, nil, nil, 74,
189
+ 71, 74, 71, nil, 71, nil, 74, 71, nil, 74,
190
+ nil, 71, nil, 71, 71, 71, 71, 71, 71, 71,
191
+ nil, nil, nil, 71, 27, 71, 27, nil, 27, nil,
192
+ nil, 27, 71, 71, nil, 27, 27, 27, 27, 27,
193
+ 27, 27, 27, 27, nil, nil, nil, 27, nil, 27,
194
+ nil, 29, 29, 29, nil, 29, nil, 27, 29, nil,
195
+ nil, nil, 29, nil, 29, 29, 29, 29, 29, 29,
196
+ 29, nil, nil, nil, 29, 62, 29, 62, nil, 62,
197
+ nil, nil, 62, nil, 29, nil, 62, nil, 62, 62,
198
+ 62, 62, 62, 62, 62, nil, nil, nil, 62, 31,
199
+ 62, 31, nil, 31, nil, nil, 31, nil, 62, nil,
200
+ 31, nil, 31, 31, 31, 31, 31, 31, 31, nil,
201
+ nil, nil, 31, 32, 31, 32, nil, 32, nil, nil,
202
+ 32, nil, 31, nil, 32, nil, 32, 32, 32, 32,
203
+ 32, 32, 32, nil, nil, 32, 32, 61, 32, 61,
204
+ nil, 61, nil, nil, 61, nil, 32, nil, 61, nil,
205
+ 61, 61, 61, 61, 61, 61, 61, nil, nil, nil,
206
+ 61, 35, 61, 35, 35, 35, nil, nil, 35, nil,
207
+ 61, nil, 35, nil, 35, 35, 35, 35, 35, 35,
208
+ 35, nil, nil, nil, 35, 57, 35, 57, nil, 57,
209
+ nil, nil, 57, nil, 35, nil, 57, nil, 57, 57,
210
+ 57, 57, 57, 57, 57, nil, nil, nil, 57, 54,
211
+ 57, 54, nil, 54, nil, 57, 54, nil, 57, nil,
212
+ 54, nil, 54, 54, 54, 54, 54, 54, 54, nil,
213
+ nil, nil, 54, 49, 54, 49, nil, 49, nil, nil,
214
+ 49, 54, 54, nil, 49, nil, 49, 49, 49, 49,
215
+ 49, 49, 49, nil, nil, 49, 49, nil, 49, nil,
216
+ 97, nil, 97, nil, 97, nil, 49, 97, nil, 97,
217
+ nil, 97, nil, 97, 97, 97, 97, 97, 97, 97,
218
+ nil, nil, nil, 97, nil, 97, nil, nil, nil, nil,
219
+ nil, nil, nil, 97 ]
118
220
 
119
221
  racc_action_pointer = [
120
- -2, 36, nil, nil, nil, nil, 36, 53, nil, nil,
121
- 70, nil, nil, nil, 24, nil, 6, 125, -13, nil,
122
- -7, nil, nil, -11, nil, -20, 142, 159, -16, 108,
123
- 91, 26, 27, nil, 16, 32, 32, 22, 27, 15,
124
- nil, nil, nil, nil, nil, 43, nil, nil, nil, 44,
125
- nil, nil, nil ]
222
+ -2, nil, nil, 22, 49, 73, 76, 124, nil, nil,
223
+ -9, 83, nil, nil, 66, 220, nil, nil, nil, nil,
224
+ nil, nil, nil, 63, nil, 48, nil, 292, nil, 319,
225
+ 9, 367, 391, 18, nil, 439, 7, 15, 35, 80,
226
+ 89, 89, nil, 10, 65, nil, nil, nil, nil, 511,
227
+ 77, -11, nil, 33, 487, -21, -4, 463, nil, nil,
228
+ nil, 415, 343, 35, 49, 38, nil, nil, -18, nil,
229
+ 1, 268, 43, 43, 244, 23, 196, nil, 172, 74,
230
+ nil, nil, nil, nil, -30, nil, 66, -23, nil, 148,
231
+ 100, 91, nil, nil, nil, nil, nil, 538, nil, nil ]
126
232
 
127
233
  racc_action_default = [
128
- -31, -31, -5, -16, -6, -29, -31, -8, -17, -12,
129
- -31, -19, -13, -18, -31, -20, -31, -1, -31, -10,
130
- -31, -2, -3, -31, -4, -25, -31, -31, -31, -9,
131
- -31, -31, -31, -11, -25, -31, -31, -31, -31, -31,
132
- -21, -7, -22, 53, -14, -31, -15, -30, -24, -27,
133
- -28, -23, -26 ]
234
+ -55, -5, -6, -55, -55, -12, -55, -55, -37, -53,
235
+ -29, -55, -38, -11, -55, -1, -40, -23, -39, -25,
236
+ -2, -41, -26, -55, -3, -55, -4, -55, -42, -55,
237
+ -55, -13, -55, -48, -43, -55, -29, -32, -55, -55,
238
+ -55, -14, -24, -18, -48, -54, -44, -7, -51, -55,
239
+ -55, -55, -45, -55, -55, -55, -32, -55, -27, 100,
240
+ -8, -55, -55, -55, -55, -55, -52, -47, -50, -28,
241
+ -32, -55, -29, -55, -55, -32, -16, -15, -19, -20,
242
+ -10, -46, -49, -35, -32, -30, -29, -32, -33, -55,
243
+ -20, -55, -36, -31, -34, -17, -21, -20, -9, -22 ]
134
244
 
135
245
  racc_goto_table = [
136
- 25, 17, 33, 28, 37, 14, nil, 27, 29, nil,
137
- nil, 30, 33, 45, 33, 33, nil, 34, nil, nil,
138
- nil, nil, nil, nil, 33, nil, nil, 39, 52, nil,
139
- nil, nil, nil, nil, nil, nil, nil, 49 ]
246
+ 15, 55, 42, 27, 29, 31, 50, 35, 33, 38,
247
+ 77, 64, 91, 40, 42, 30, 42, 65, 42, 11,
248
+ 73, nil, 42, 96, nil, nil, nil, 44, nil, nil,
249
+ 99, nil, 49, nil, 83, 53, 42, nil, 95, 88,
250
+ nil, 82, nil, nil, nil, nil, nil, nil, 92, nil,
251
+ nil, 94, nil, 68, 71, nil, nil, 74, 42, nil,
252
+ nil, 42, 78, 42, nil, 42, nil, nil, nil, nil,
253
+ nil, 85, nil, nil, nil, nil, nil, nil, nil, nil,
254
+ nil, nil, nil, nil, 42, 93, nil, nil, nil, nil,
255
+ 97 ]
140
256
 
141
257
  racc_goto_check = [
142
- 12, 2, 3, 9, 13, 1, nil, 2, 2, nil,
143
- nil, 2, 3, 13, 3, 3, nil, 12, nil, nil,
144
- nil, nil, nil, nil, 3, nil, nil, 2, 13, nil,
145
- nil, nil, nil, nil, nil, nil, nil, 12 ]
258
+ 2, 18, 3, 2, 2, 2, 20, 2, 19, 17,
259
+ 14, 12, 11, 10, 3, 9, 3, 20, 3, 1,
260
+ 18, nil, 3, 11, nil, nil, nil, 19, nil, nil,
261
+ 11, nil, 2, nil, 18, 17, 3, nil, 14, 18,
262
+ nil, 20, nil, nil, nil, nil, nil, nil, 18, nil,
263
+ nil, 18, nil, 19, 2, nil, nil, 2, 3, nil,
264
+ nil, 3, 2, 3, nil, 3, nil, nil, nil, nil,
265
+ nil, 17, nil, nil, nil, nil, nil, nil, nil, nil,
266
+ nil, nil, nil, nil, 3, 17, nil, nil, nil, nil,
267
+ 2 ]
146
268
 
147
269
  racc_goto_pointer = [
148
- nil, 5, 1, -15, nil, nil, nil, nil, nil, -4,
149
- nil, nil, -1, -21, nil ]
270
+ nil, 19, 0, -13, nil, nil, nil, nil, nil, 10,
271
+ -1, -67, -32, nil, -51, nil, nil, -1, -36, 2,
272
+ -27, nil ]
150
273
 
151
274
  racc_goto_default = [
152
- nil, nil, nil, 19, 21, 22, 24, 2, 4, nil,
153
- 9, 12, nil, nil, 38 ]
275
+ nil, nil, 76, 17, 20, 24, 26, 1, 2, nil,
276
+ nil, nil, nil, 13, nil, 19, 22, nil, nil, nil,
277
+ nil, 51 ]
154
278
 
155
279
  racc_token_table = {
156
280
  false => 0,
@@ -161,28 +285,39 @@ racc_token_table = {
161
285
  :ITALICEND => 5,
162
286
  :LINKSTART => 6,
163
287
  :LINKEND => 7,
164
- :INTLINKSTART => 8,
165
- :INTLINKEND => 9,
166
- :SECTION_START => 10,
167
- :SECTION_END => 11,
168
- :TEXT => 12,
169
- :PRE => 13,
170
- :HLINE => 14,
171
- :SIGNATURE_NAME => 15,
172
- :SIGNATURE_DATE => 16,
173
- :SIGNATURE_FULL => 17,
174
- :UL_START => 18,
175
- :UL_END => 19,
176
- :LI_START => 20,
177
- :LI_END => 21,
178
- :OL_START => 22,
179
- :OL_END => 23,
180
- :PARA_START => 24,
181
- :PARA_END => 25 }
288
+ :LINKSEP => 8,
289
+ :INTLINKSTART => 9,
290
+ :INTLINKEND => 10,
291
+ :INTLINKSEP => 11,
292
+ :RESOURCE_SEP => 12,
293
+ :SECTION_START => 13,
294
+ :SECTION_END => 14,
295
+ :TEXT => 15,
296
+ :PRE => 16,
297
+ :HLINE => 17,
298
+ :SIGNATURE_NAME => 18,
299
+ :SIGNATURE_DATE => 19,
300
+ :SIGNATURE_FULL => 20,
301
+ :UL_START => 21,
302
+ :UL_END => 22,
303
+ :LI_START => 23,
304
+ :LI_END => 24,
305
+ :OL_START => 25,
306
+ :OL_END => 26,
307
+ :TABLE_START => 27,
308
+ :TABLE_END => 28,
309
+ :ROW_START => 29,
310
+ :ROW_END => 30,
311
+ :HEAD_START => 31,
312
+ :HEAD_END => 32,
313
+ :CELL_START => 33,
314
+ :CELL_END => 34,
315
+ :PARA_START => 35,
316
+ :PARA_END => 36 }
182
317
 
183
318
  racc_use_result_var = true
184
319
 
185
- racc_nt_base = 26
320
+ racc_nt_base = 37
186
321
 
187
322
  Racc_arg = [
188
323
  racc_action_table,
@@ -209,8 +344,11 @@ Racc_token_to_s_table = [
209
344
  'ITALICEND',
210
345
  'LINKSTART',
211
346
  'LINKEND',
347
+ 'LINKSEP',
212
348
  'INTLINKSTART',
213
349
  'INTLINKEND',
350
+ 'INTLINKSEP',
351
+ 'RESOURCE_SEP',
214
352
  'SECTION_START',
215
353
  'SECTION_END',
216
354
  'TEXT',
@@ -225,6 +363,14 @@ Racc_token_to_s_table = [
225
363
  'LI_END',
226
364
  'OL_START',
227
365
  'OL_END',
366
+ 'TABLE_START',
367
+ 'TABLE_END',
368
+ 'ROW_START',
369
+ 'ROW_END',
370
+ 'HEAD_START',
371
+ 'HEAD_END',
372
+ 'CELL_START',
373
+ 'CELL_END',
228
374
  'PARA_START',
229
375
  'PARA_END',
230
376
  '$start',
@@ -237,8 +383,15 @@ Racc_token_to_s_table = [
237
383
  'preformatted',
238
384
  'section',
239
385
  'para_contents',
386
+ 'link_contents',
387
+ 'reslink_repeated_contents',
388
+ 'intlink_repeated_contents',
389
+ 'table',
390
+ 'link_repeated_contents',
240
391
  'element',
241
392
  'formatted_element',
393
+ 'table_contents',
394
+ 'row_contents',
242
395
  'list_item',
243
396
  'list_contents',
244
397
  '@1']
@@ -249,7 +402,7 @@ Racc_debug_parser = false
249
402
 
250
403
  # reduce 0 omitted
251
404
 
252
- module_eval <<'.,.,', 'mediawikiparser.y', 26
405
+ module_eval <<'.,.,', 'mediawikiparser.y', 29
253
406
  def _reduce_1( val, _values, result )
254
407
  @nodes.push WikiAST.new
255
408
  #@nodes.last.children.insert(0, val[0])
@@ -259,28 +412,28 @@ module_eval <<'.,.,', 'mediawikiparser.y', 26
259
412
  end
260
413
  .,.,
261
414
 
262
- module_eval <<'.,.,', 'mediawikiparser.y', 33
415
+ module_eval <<'.,.,', 'mediawikiparser.y', 36
263
416
  def _reduce_2( val, _values, result )
264
417
  result = val[0]
265
418
  result
266
419
  end
267
420
  .,.,
268
421
 
269
- module_eval <<'.,.,', 'mediawikiparser.y', 37
422
+ module_eval <<'.,.,', 'mediawikiparser.y', 40
270
423
  def _reduce_3( val, _values, result )
271
424
  result = val[0]
272
425
  result
273
426
  end
274
427
  .,.,
275
428
 
276
- module_eval <<'.,.,', 'mediawikiparser.y', 41
429
+ module_eval <<'.,.,', 'mediawikiparser.y', 44
277
430
  def _reduce_4( val, _values, result )
278
431
  result = val[0]
279
432
  result
280
433
  end
281
434
  .,.,
282
435
 
283
- module_eval <<'.,.,', 'mediawikiparser.y', 47
436
+ module_eval <<'.,.,', 'mediawikiparser.y', 50
284
437
  def _reduce_5( val, _values, result )
285
438
  p = PreformattedAST.new
286
439
  p.contents = val[0]
@@ -291,10 +444,7 @@ module_eval <<'.,.,', 'mediawikiparser.y', 47
291
444
 
292
445
  module_eval <<'.,.,', 'mediawikiparser.y', 54
293
446
  def _reduce_6( val, _values, result )
294
- s = SectionAST.new
295
- s.contents = val[0][0]
296
- s.level = val[0][1]
297
- result = s
447
+ result = val[0]
298
448
  result
299
449
  end
300
450
  .,.,
@@ -312,28 +462,129 @@ module_eval <<'.,.,', 'mediawikiparser.y', 62
312
462
 
313
463
  module_eval <<'.,.,', 'mediawikiparser.y', 69
314
464
  def _reduce_8( val, _values, result )
315
- result = nil
465
+ l = LinkAST.new
466
+ l.url = val[1][0]
467
+ l.children += val[1][1..-1] if val[1].length > 1
468
+ result = l
316
469
  result
317
470
  end
318
471
  .,.,
319
472
 
320
- module_eval <<'.,.,', 'mediawikiparser.y', 73
473
+ module_eval <<'.,.,', 'mediawikiparser.y', 77
321
474
  def _reduce_9( val, _values, result )
322
- result = val[0]
475
+ l = ResourceLinkAST.new
476
+ l.prefix = val[1]
477
+ l.locator = val[3]
478
+ l.children = val[4] unless val[4].nil? or val[4].empty?
479
+ result = l
323
480
  result
324
481
  end
325
482
  .,.,
326
483
 
327
- module_eval <<'.,.,', 'mediawikiparser.y', 79
484
+ module_eval <<'.,.,', 'mediawikiparser.y', 84
328
485
  def _reduce_10( val, _values, result )
486
+ l = InternalLinkAST.new
487
+ l.locator = val[1]
488
+ l.children = val[2] unless val[2].nil? or val[2].empty?
489
+ result = l
490
+ result
491
+ end
492
+ .,.,
493
+
494
+ # reduce 11 omitted
495
+
496
+ module_eval <<'.,.,', 'mediawikiparser.y', 92
497
+ def _reduce_12( val, _values, result )
498
+ result = nil
499
+ result
500
+ end
501
+ .,.,
502
+
503
+ module_eval <<'.,.,', 'mediawikiparser.y', 96
504
+ def _reduce_13( val, _values, result )
505
+ result = val[0]
506
+ result
507
+ end
508
+ .,.,
509
+
510
+ module_eval <<'.,.,', 'mediawikiparser.y', 103
511
+ def _reduce_14( val, _values, result )
512
+ result = val
513
+ result
514
+ end
515
+ .,.,
516
+
517
+ module_eval <<'.,.,', 'mediawikiparser.y', 108
518
+ def _reduce_15( val, _values, result )
519
+ result = [val[0]]
520
+ result += val[2]
521
+ result
522
+ end
523
+ .,.,
524
+
525
+ module_eval <<'.,.,', 'mediawikiparser.y', 116
526
+ def _reduce_16( val, _values, result )
527
+ result = val[0]
528
+ result
529
+ end
530
+ .,.,
531
+
532
+ module_eval <<'.,.,', 'mediawikiparser.y', 121
533
+ def _reduce_17( val, _values, result )
534
+ result = val[0]
535
+ result += val[2] if val[2]
536
+ result
537
+ end
538
+ .,.,
539
+
540
+ module_eval <<'.,.,', 'mediawikiparser.y', 128
541
+ def _reduce_18( val, _values, result )
542
+ result = nil
543
+ result
544
+ end
545
+ .,.,
546
+
547
+ module_eval <<'.,.,', 'mediawikiparser.y', 132
548
+ def _reduce_19( val, _values, result )
549
+ result = val[1]
550
+ result
551
+ end
552
+ .,.,
553
+
554
+ module_eval <<'.,.,', 'mediawikiparser.y', 138
555
+ def _reduce_20( val, _values, result )
556
+ result = nil
557
+ result
558
+ end
559
+ .,.,
560
+
561
+ module_eval <<'.,.,', 'mediawikiparser.y', 142
562
+ def _reduce_21( val, _values, result )
563
+ result = val[1]
564
+ result
565
+ end
566
+ .,.,
567
+
568
+ module_eval <<'.,.,', 'mediawikiparser.y', 149
569
+ def _reduce_22( val, _values, result )
570
+ i = InternalLinkItemAST.new
571
+ i.children = val[1]
572
+ result = [i]
573
+ result += val[2] if val[2]
574
+ result
575
+ end
576
+ .,.,
577
+
578
+ module_eval <<'.,.,', 'mediawikiparser.y', 156
579
+ def _reduce_23( val, _values, result )
329
580
  result = []
330
581
  result << val[0]
331
582
  result
332
583
  end
333
584
  .,.,
334
585
 
335
- module_eval <<'.,.,', 'mediawikiparser.y', 85
336
- def _reduce_11( val, _values, result )
586
+ module_eval <<'.,.,', 'mediawikiparser.y', 162
587
+ def _reduce_24( val, _values, result )
337
588
  result = []
338
589
  result += val[0]
339
590
  result << val[1]
@@ -341,8 +592,8 @@ module_eval <<'.,.,', 'mediawikiparser.y', 85
341
592
  end
342
593
  .,.,
343
594
 
344
- module_eval <<'.,.,', 'mediawikiparser.y', 94
345
- def _reduce_12( val, _values, result )
595
+ module_eval <<'.,.,', 'mediawikiparser.y', 171
596
+ def _reduce_25( val, _values, result )
346
597
  p = TextAST.new
347
598
  p.formatting = val[0][0]
348
599
  p.contents = val[0][1]
@@ -351,64 +602,164 @@ module_eval <<'.,.,', 'mediawikiparser.y', 94
351
602
  end
352
603
  .,.,
353
604
 
354
- module_eval <<'.,.,', 'mediawikiparser.y', 98
355
- def _reduce_13( val, _values, result )
605
+ module_eval <<'.,.,', 'mediawikiparser.y', 175
606
+ def _reduce_26( val, _values, result )
356
607
  result = val[0]
357
608
  result
358
609
  end
359
610
  .,.,
360
611
 
361
- module_eval <<'.,.,', 'mediawikiparser.y', 101
362
- def _reduce_14( val, _values, result )
363
- return [:Link, val[1]]
612
+ module_eval <<'.,.,', 'mediawikiparser.y', 184
613
+ def _reduce_27( val, _values, result )
614
+ table = TableAST.new
615
+ table.children = val[1] unless val[1].nil? or val[1].empty?
616
+ result = table
364
617
  result
365
618
  end
366
619
  .,.,
367
620
 
368
- module_eval <<'.,.,', 'mediawikiparser.y', 103
369
- def _reduce_15( val, _values, result )
370
- return [:InternalLink, val[1]]
621
+ module_eval <<'.,.,', 'mediawikiparser.y', 191
622
+ def _reduce_28( val, _values, result )
623
+ table = TableAST.new
624
+ table.options = val[1]
625
+ table.children = val[2] unless val[2].nil? or val[2].empty?
626
+ result = table
371
627
  result
372
628
  end
373
629
  .,.,
374
630
 
375
- module_eval <<'.,.,', 'mediawikiparser.y', 105
376
- def _reduce_16( val, _values, result )
631
+ module_eval <<'.,.,', 'mediawikiparser.y', 196
632
+ def _reduce_29( val, _values, result )
633
+ result = nil
634
+ result
635
+ end
636
+ .,.,
637
+
638
+ module_eval <<'.,.,', 'mediawikiparser.y', 203
639
+ def _reduce_30( val, _values, result )
640
+ row = TableRowAST.new
641
+ row.children = val[1] unless val[1].nil? or val[1].empty?
642
+ result = [row]
643
+ result += val[3] unless val[3].nil? or val[3].empty?
644
+ result
645
+ end
646
+ .,.,
647
+
648
+ module_eval <<'.,.,', 'mediawikiparser.y', 211
649
+ def _reduce_31( val, _values, result )
650
+ row = TableRowAST.new
651
+ row.children = val[2] unless val[2].nil? or val[2].empty?
652
+ row.options = val[1]
653
+ result = [row]
654
+ result += val[4] unless val[4].nil? or val[4].empty?
655
+ result
656
+ end
657
+ .,.,
658
+
659
+ module_eval <<'.,.,', 'mediawikiparser.y', 216
660
+ def _reduce_32( val, _values, result )
661
+ result = nil
662
+ result
663
+ end
664
+ .,.,
665
+
666
+ module_eval <<'.,.,', 'mediawikiparser.y', 223
667
+ def _reduce_33( val, _values, result )
668
+ cell = TableCellAST.new
669
+ cell.type = :head
670
+ result = [cell]
671
+ result += val[2] unless val[2].nil? or val[2].empty?
672
+ result
673
+ end
674
+ .,.,
675
+
676
+ module_eval <<'.,.,', 'mediawikiparser.y', 231
677
+ def _reduce_34( val, _values, result )
678
+ cell = TableCellAST.new
679
+ cell.children = val[1] unless val[1].nil? or val[1].empty?
680
+ cell.type = :head
681
+ result = [cell]
682
+ result += val[3] unless val[3].nil? or val[3].empty?
683
+ result
684
+ end
685
+ .,.,
686
+
687
+ module_eval <<'.,.,', 'mediawikiparser.y', 238
688
+ def _reduce_35( val, _values, result )
689
+ cell = TableCellAST.new
690
+ cell.type = :body
691
+ result = [cell]
692
+ result += val[2] unless val[2].nil? or val[2].empty?
693
+ result
694
+ end
695
+ .,.,
696
+
697
+ module_eval <<'.,.,', 'mediawikiparser.y', 246
698
+ def _reduce_36( val, _values, result )
699
+ cell = TableCellAST.new
700
+ cell.children = val[1] unless val[1].nil? or val[1].empty?
701
+ cell.type = :body
702
+ result = [cell]
703
+ result += val[3] unless val[3].nil? or val[3].empty?
704
+ result
705
+ end
706
+ .,.,
707
+
708
+ module_eval <<'.,.,', 'mediawikiparser.y', 250
709
+ def _reduce_37( val, _values, result )
377
710
  return [:None, val[0]]
378
711
  result
379
712
  end
380
713
  .,.,
381
714
 
382
- module_eval <<'.,.,', 'mediawikiparser.y', 107
383
- def _reduce_17( val, _values, result )
715
+ module_eval <<'.,.,', 'mediawikiparser.y', 252
716
+ def _reduce_38( val, _values, result )
384
717
  return [:HLine, val[0]]
385
718
  result
386
719
  end
387
720
  .,.,
388
721
 
389
- module_eval <<'.,.,', 'mediawikiparser.y', 109
390
- def _reduce_18( val, _values, result )
722
+ module_eval <<'.,.,', 'mediawikiparser.y', 254
723
+ def _reduce_39( val, _values, result )
391
724
  return [:SignatureDate, val[0]]
392
725
  result
393
726
  end
394
727
  .,.,
395
728
 
396
- module_eval <<'.,.,', 'mediawikiparser.y', 111
397
- def _reduce_19( val, _values, result )
729
+ module_eval <<'.,.,', 'mediawikiparser.y', 256
730
+ def _reduce_40( val, _values, result )
398
731
  return [:SignatureName, val[0]]
399
732
  result
400
733
  end
401
734
  .,.,
402
735
 
403
- module_eval <<'.,.,', 'mediawikiparser.y', 113
404
- def _reduce_20( val, _values, result )
736
+ module_eval <<'.,.,', 'mediawikiparser.y', 258
737
+ def _reduce_41( val, _values, result )
405
738
  return [:SignatureFull, val[0]]
406
739
  result
407
740
  end
408
741
  .,.,
409
742
 
410
- module_eval <<'.,.,', 'mediawikiparser.y', 123
411
- def _reduce_21( val, _values, result )
743
+ module_eval <<'.,.,', 'mediawikiparser.y', 268
744
+ def _reduce_42( val, _values, result )
745
+ result = FormattedAST.new
746
+ result.formatting = :Bold
747
+ result
748
+ result
749
+ end
750
+ .,.,
751
+
752
+ module_eval <<'.,.,', 'mediawikiparser.y', 274
753
+ def _reduce_43( val, _values, result )
754
+ result = FormattedAST.new
755
+ result.formatting = :Italic
756
+ result
757
+ result
758
+ end
759
+ .,.,
760
+
761
+ module_eval <<'.,.,', 'mediawikiparser.y', 281
762
+ def _reduce_44( val, _values, result )
412
763
  p = FormattedAST.new
413
764
  p.formatting = :Bold
414
765
  p.children += val[1]
@@ -417,8 +768,8 @@ module_eval <<'.,.,', 'mediawikiparser.y', 123
417
768
  end
418
769
  .,.,
419
770
 
420
- module_eval <<'.,.,', 'mediawikiparser.y', 130
421
- def _reduce_22( val, _values, result )
771
+ module_eval <<'.,.,', 'mediawikiparser.y', 288
772
+ def _reduce_45( val, _values, result )
422
773
  p = FormattedAST.new
423
774
  p.formatting = :Italic
424
775
  p.children += val[1]
@@ -427,8 +778,8 @@ module_eval <<'.,.,', 'mediawikiparser.y', 130
427
778
  end
428
779
  .,.,
429
780
 
430
- module_eval <<'.,.,', 'mediawikiparser.y', 140
431
- def _reduce_23( val, _values, result )
781
+ module_eval <<'.,.,', 'mediawikiparser.y', 298
782
+ def _reduce_46( val, _values, result )
432
783
  list = ListAST.new
433
784
  list.list_type = :Bulleted
434
785
  list.children << val[1]
@@ -438,8 +789,8 @@ module_eval <<'.,.,', 'mediawikiparser.y', 140
438
789
  end
439
790
  .,.,
440
791
 
441
- module_eval <<'.,.,', 'mediawikiparser.y', 150
442
- def _reduce_24( val, _values, result )
792
+ module_eval <<'.,.,', 'mediawikiparser.y', 308
793
+ def _reduce_47( val, _values, result )
443
794
  list = ListAST.new
444
795
  list.list_type = :Numbered
445
796
  list.children << val[1]
@@ -449,30 +800,37 @@ module_eval <<'.,.,', 'mediawikiparser.y', 150
449
800
  end
450
801
  .,.,
451
802
 
452
- module_eval <<'.,.,', 'mediawikiparser.y', 153
453
- def _reduce_25( val, _values, result )
803
+ module_eval <<'.,.,', 'mediawikiparser.y', 311
804
+ def _reduce_48( val, _values, result )
454
805
  result = []
455
806
  result
456
807
  end
457
808
  .,.,
458
809
 
459
- module_eval <<'.,.,', 'mediawikiparser.y', 159
460
- def _reduce_26( val, _values, result )
810
+ module_eval <<'.,.,', 'mediawikiparser.y', 317
811
+ def _reduce_49( val, _values, result )
461
812
  result << val[1]
462
813
  result += val[2]
463
814
  result
464
815
  end
465
816
  .,.,
466
817
 
467
- module_eval <<'.,.,', 'mediawikiparser.y', 160
468
- def _reduce_27( val, _values, result )
818
+ module_eval <<'.,.,', 'mediawikiparser.y', 318
819
+ def _reduce_50( val, _values, result )
469
820
  result = []
470
821
  result
471
822
  end
472
823
  .,.,
473
824
 
474
- module_eval <<'.,.,', 'mediawikiparser.y', 169
475
- def _reduce_28( val, _values, result )
825
+ module_eval <<'.,.,', 'mediawikiparser.y', 326
826
+ def _reduce_51( val, _values, result )
827
+ result = ListItemAST.new
828
+ result
829
+ end
830
+ .,.,
831
+
832
+ module_eval <<'.,.,', 'mediawikiparser.y', 332
833
+ def _reduce_52( val, _values, result )
476
834
  li = ListItemAST.new
477
835
  li.children += val[1]
478
836
  result = li
@@ -480,16 +838,20 @@ module_eval <<'.,.,', 'mediawikiparser.y', 169
480
838
  end
481
839
  .,.,
482
840
 
483
- module_eval <<'.,.,', 'mediawikiparser.y', 172
484
- def _reduce_29( val, _values, result )
841
+ module_eval <<'.,.,', 'mediawikiparser.y', 335
842
+ def _reduce_53( val, _values, result )
485
843
  result = val[0]
486
844
  result
487
845
  end
488
846
  .,.,
489
847
 
490
- module_eval <<'.,.,', 'mediawikiparser.y', 176
491
- def _reduce_30( val, _values, result )
492
- result = [val[1], val[0].length]
848
+ module_eval <<'.,.,', 'mediawikiparser.y', 344
849
+ def _reduce_54( val, _values, result )
850
+ result = [val[1], val[0].length]
851
+ s = SectionAST.new
852
+ s.children = val[1]
853
+ s.level = val[0].length
854
+ result = s
493
855
  result
494
856
  end
495
857
  .,.,