mediacloth 0.0.3 → 0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +36 -0
- data/lib/mediacloth/mediawikiast.rb +58 -1
- data/lib/mediacloth/mediawikihtmlgenerator.rb +229 -73
- data/lib/mediacloth/mediawikilexer.rb +1030 -656
- data/lib/mediacloth/mediawikilinkhandler.rb +89 -0
- data/lib/mediacloth/mediawikiparams.rb +1 -10
- data/lib/mediacloth/mediawikiparser.rb +939 -409
- data/lib/mediacloth/mediawikiparser.tab.rb +1357 -0
- data/lib/mediacloth/mediawikiparser.y +256 -52
- data/lib/mediacloth/mediawikisignedwikigenerator.rb +42 -0
- data/lib/mediacloth/mediawikitemplatehandler.rb +8 -0
- data/lib/mediacloth/mediawikiwalker.rb +72 -1
- data/lib/mediacloth.rb +33 -10
- data/test/data/ast1 +68 -0
- data/test/data/ast10 +196 -0
- data/test/data/ast11 +34 -0
- data/test/data/ast12 +39 -0
- data/test/data/ast13 +25 -0
- data/test/data/ast14 +13 -0
- data/test/data/ast15 +25 -0
- data/test/data/ast16 +17 -0
- data/test/data/ast17 +9 -0
- data/test/data/ast18 +21 -0
- data/test/data/ast19 +32 -0
- data/test/data/ast2 +4 -0
- data/test/data/ast20 +10 -0
- data/test/data/ast21 +27 -0
- data/test/data/ast22 +22 -0
- data/test/data/ast23 +5 -0
- data/test/data/ast3 +6 -0
- data/test/data/ast4 +122 -0
- data/test/data/ast5 +122 -0
- data/test/data/ast6 +22 -0
- data/test/data/ast7 +143 -0
- data/test/data/ast8 +3 -0
- data/test/data/ast9 +11 -0
- data/test/data/html1 +33 -5
- data/test/data/html10 +31 -27
- data/test/data/html11 +19 -0
- data/test/data/html12 +32 -0
- data/test/data/html13 +29 -0
- data/test/data/html14 +4 -0
- data/test/data/html15 +29 -0
- data/test/data/html16 +28 -0
- data/test/data/html17 +10 -0
- data/test/data/html18 +8 -0
- data/test/data/html19 +27 -0
- data/test/data/html2 +1 -1
- data/test/data/html20 +7 -0
- data/test/data/html21 +5 -0
- data/test/data/html22 +24 -0
- data/test/data/html23 +7 -0
- data/test/data/html3 +1 -1
- data/test/data/html4 +60 -11
- data/test/data/html5 +45 -6
- data/test/data/html6 +5 -5
- data/test/data/html7 +59 -1
- data/test/data/html8 +1 -1
- data/test/data/html9 +10 -2
- data/test/data/input1 +4 -0
- data/test/data/input11 +19 -0
- data/test/data/input12 +32 -0
- data/test/data/input13 +10 -0
- data/test/data/input14 +8 -0
- data/test/data/input15 +10 -0
- data/test/data/input16 +28 -0
- data/test/data/input17 +10 -0
- data/test/data/input18 +16 -0
- data/test/data/input19 +29 -0
- data/test/data/input20 +8 -0
- data/test/data/input21 +18 -0
- data/test/data/input22 +20 -0
- data/test/data/input23 +8 -0
- data/test/data/input4 +13 -1
- data/test/data/input5 +45 -4
- data/test/data/input7 +25 -1
- data/test/data/lex1 +17 -18
- data/test/data/lex10 +57 -87
- data/test/data/lex11 +18 -0
- data/test/data/lex12 +32 -0
- data/test/data/lex13 +3 -0
- data/test/data/lex14 +1 -0
- data/test/data/lex15 +3 -0
- data/test/data/lex16 +27 -0
- data/test/data/lex17 +9 -0
- data/test/data/lex18 +4 -0
- data/test/data/lex19 +27 -0
- data/test/data/lex2 +2 -2
- data/test/data/lex20 +7 -0
- data/test/data/lex21 +4 -0
- data/test/data/lex22 +3 -0
- data/test/data/lex23 +7 -0
- data/test/data/lex3 +1 -1
- data/test/data/lex4 +35 -29
- data/test/data/lex5 +57 -18
- data/test/data/lex6 +7 -7
- data/test/data/lex7 +42 -18
- data/test/data/lex8 +1 -1
- data/test/data/lex9 +6 -6
- data/test/dataproducers/ast.rb +24 -0
- data/test/dataproducers/html.rb +11 -12
- data/test/dataproducers/lex.rb +9 -4
- data/test/debugwalker.rb +25 -11
- data/test/htmlgenerator.rb +170 -13
- data/test/lexer.rb +626 -83
- data/test/linkhandler.rb +39 -0
- data/test/parser.rb +176 -9
- data/test/signedwikigenerator.rb +113 -0
- metadata +158 -79
- data/README +0 -37
- data/lib/mediacloth/mediawikilexer.rb~ +0 -491
- data/lib/mediacloth/mediawikiparser.y~ +0 -210
- data/test/data/result1 +0 -48
- data/test/dataproducers/html.rb~ +0 -24
- data/test/dataproducers/lex.rb~ +0 -15
@@ -0,0 +1,1357 @@
|
|
1
|
+
#
|
2
|
+
# DO NOT MODIFY!!!!
|
3
|
+
# This file is automatically generated by Racc 1.4.5
|
4
|
+
# from Racc grammer file "".
|
5
|
+
#
|
6
|
+
|
7
|
+
require 'racc/parser.rb'
|
8
|
+
|
9
|
+
require 'mediacloth/mediawikiast'
|
10
|
+
|
11
|
+
class MediaWikiParser < Racc::Parser
|
12
|
+
|
13
|
+
module_eval(<<'...end mediawikiparser.y/module_eval...', 'mediawikiparser.y', 512)
|
14
|
+
|
15
|
+
attr_accessor :lexer
|
16
|
+
|
17
|
+
def initialize
|
18
|
+
@nodes = []
|
19
|
+
super
|
20
|
+
end
|
21
|
+
|
22
|
+
#Tokenizes input string and parses it.
|
23
|
+
def parse(input)
|
24
|
+
@yydebug=true
|
25
|
+
lexer.tokenize(input)
|
26
|
+
do_parse
|
27
|
+
return @nodes.last
|
28
|
+
end
|
29
|
+
|
30
|
+
#Asks the lexer to return the next token.
|
31
|
+
def next_token
|
32
|
+
return @lexer.lex
|
33
|
+
end
|
34
|
+
...end mediawikiparser.y/module_eval...
|
35
|
+
##### State transition tables begin ###
|
36
|
+
|
37
|
+
racc_action_table = [
|
38
|
+
61, 5, 9, 52, 15, 84, 23, 86, 121, 33,
|
39
|
+
85, 60, 84, 7, 86, 16, 20, 40, 25, 30,
|
40
|
+
32, 1, 4, 84, 8, 86, 14, 84, 81, 86,
|
41
|
+
29, 84, 55, 86, 56, 80, 11, 44, 74, 44,
|
42
|
+
26, 96, 98, 106, 54, 107, 108, 77, 17, 19,
|
43
|
+
62, 5, 9, 84, 15, 86, 23, 111, -64, 33,
|
44
|
+
100, 99, 117, 7, -64, 16, 20, 64, 25, 30,
|
45
|
+
32, 1, 4, 120, 8, 101, 14, 63, 123, 124,
|
46
|
+
29, 125, 95, 77, 56, 51, 11, 93, 5, 9,
|
47
|
+
26, 15, 132, 23, 48, 56, 33, 54, 17, 19,
|
48
|
+
7, 96, 16, 20, 40, 25, 30, 32, 1, 4,
|
49
|
+
137, 8, 139, 14, 140, 44, 54, 29, 54, 83,
|
50
|
+
145, 40, 148, 11, -62, nil, nil, 26, nil, 5,
|
51
|
+
9, nil, 15, nil, 23, 17, 19, 33, nil, 137,
|
52
|
+
nil, 7, nil, 16, 20, nil, 25, 30, 32, 1,
|
53
|
+
4, nil, 8, nil, 14, nil, nil, nil, 29, nil,
|
54
|
+
nil, nil, nil, nil, 11, nil, nil, nil, 26, nil,
|
55
|
+
5, 9, 42, 15, nil, 23, 17, 19, 33, nil,
|
56
|
+
nil, nil, 7, nil, 16, 20, nil, 25, 30, 32,
|
57
|
+
1, 4, nil, 8, nil, 14, nil, nil, nil, 29,
|
58
|
+
nil, nil, nil, nil, nil, 11, nil, 5, 9, 26,
|
59
|
+
15, nil, 23, nil, nil, 33, nil, 17, 19, 7,
|
60
|
+
nil, 16, 20, nil, 25, 30, 32, 1, 4, nil,
|
61
|
+
8, nil, 14, nil, nil, nil, 29, nil, nil, nil,
|
62
|
+
nil, nil, 11, nil, 5, 9, 26, 15, nil, 23,
|
63
|
+
nil, nil, 33, nil, 17, 19, 7, nil, 16, 20,
|
64
|
+
nil, 25, 30, 32, 1, 4, nil, 8, nil, 14,
|
65
|
+
nil, nil, nil, 29, nil, nil, nil, nil, nil, 11,
|
66
|
+
nil, 5, 9, 26, 15, 47, 23, nil, nil, 33,
|
67
|
+
nil, 17, 19, 7, nil, 16, 20, nil, 25, 30,
|
68
|
+
32, 1, 4, nil, 8, nil, 14, nil, nil, nil,
|
69
|
+
29, nil, nil, nil, nil, nil, 11, nil, 5, 9,
|
70
|
+
26, 15, nil, 23, nil, nil, 33, nil, 17, 19,
|
71
|
+
7, nil, 16, 20, nil, 25, 30, 32, 1, 4,
|
72
|
+
nil, 8, nil, 14, nil, nil, nil, 29, nil, nil,
|
73
|
+
nil, nil, nil, 11, nil, 5, 9, 26, 15, nil,
|
74
|
+
23, nil, nil, 33, 133, 17, 19, 7, nil, 16,
|
75
|
+
20, nil, 25, 30, 32, 1, 4, nil, 8, nil,
|
76
|
+
14, nil, nil, nil, 29, nil, nil, nil, nil, nil,
|
77
|
+
11, nil, 5, 9, 26, 15, nil, 23, nil, nil,
|
78
|
+
33, nil, 17, 19, 7, nil, 16, 20, nil, 25,
|
79
|
+
30, 32, 1, 4, nil, 8, nil, 14, nil, nil,
|
80
|
+
nil, 29, nil, nil, nil, nil, nil, 11, nil, nil,
|
81
|
+
nil, 26, nil, nil, nil, nil, 130, nil, nil, 17,
|
82
|
+
19, 5, 9, nil, 15, nil, 23, nil, 129, 33,
|
83
|
+
nil, nil, nil, 7, nil, 16, 20, nil, 25, 30,
|
84
|
+
32, 1, 4, nil, 8, nil, 14, nil, nil, nil,
|
85
|
+
29, nil, nil, nil, nil, nil, 11, nil, 5, 9,
|
86
|
+
26, 15, nil, 23, nil, nil, 33, nil, 17, 19,
|
87
|
+
7, nil, 16, 20, nil, 25, 30, 32, 1, 4,
|
88
|
+
nil, 8, nil, 14, nil, nil, nil, 29, nil, nil,
|
89
|
+
89, nil, nil, 11, nil, 5, 9, 26, 15, nil,
|
90
|
+
23, nil, nil, 33, nil, 17, 19, 7, nil, 16,
|
91
|
+
20, nil, 25, 30, 32, 1, 4, nil, 8, nil,
|
92
|
+
14, nil, nil, nil, 29, nil, nil, nil, nil, nil,
|
93
|
+
11, nil, 5, 9, 26, 15, nil, 23, nil, nil,
|
94
|
+
33, nil, 17, 19, 7, nil, 16, 20, nil, 25,
|
95
|
+
30, 32, 1, 4, nil, 8, nil, 14, nil, nil,
|
96
|
+
nil, 29, nil, nil, nil, nil, nil, 11, nil, 5,
|
97
|
+
9, 26, 15, nil, 23, nil, nil, 33, nil, 17,
|
98
|
+
19, 7, nil, 16, 20, nil, 25, 30, 32, 1,
|
99
|
+
4, nil, 8, nil, 14, nil, nil, nil, 29, nil,
|
100
|
+
nil, nil, nil, nil, 11, nil, 5, 9, 26, 15,
|
101
|
+
nil, 23, nil, nil, 33, nil, 17, 19, 7, nil,
|
102
|
+
16, 20, nil, 25, 30, 32, 1, 4, nil, 8,
|
103
|
+
nil, 14, nil, nil, nil, 29, nil, nil, nil, nil,
|
104
|
+
119, 11, nil, 5, 9, 26, 15, nil, 23, nil,
|
105
|
+
nil, 33, nil, 17, 19, 7, 65, 16, 20, nil,
|
106
|
+
25, 30, 32, 1, 4, nil, 8, nil, 14, nil,
|
107
|
+
nil, nil, 29, nil, nil, nil, nil, nil, 11, nil,
|
108
|
+
5, 9, 26, 15, nil, 23, nil, nil, 33, nil,
|
109
|
+
17, 19, 7, nil, 16, 20, nil, 25, 30, 32,
|
110
|
+
1, 4, nil, 8, nil, 14, nil, nil, nil, 29,
|
111
|
+
nil, nil, 118, nil, nil, 11, nil, 5, 9, 26,
|
112
|
+
15, nil, 23, nil, nil, 33, nil, 17, 19, 7,
|
113
|
+
nil, 16, 20, nil, 25, 30, 32, 1, 4, nil,
|
114
|
+
8, nil, 14, nil, nil, 69, 29, nil, nil, nil,
|
115
|
+
nil, nil, 11, nil, nil, nil, 26, nil, 5, 9,
|
116
|
+
70, 15, nil, 23, 17, 19, 33, nil, nil, nil,
|
117
|
+
7, nil, 16, 20, nil, 25, 30, 32, 1, 4,
|
118
|
+
nil, 8, nil, 14, nil, nil, nil, 29, nil, nil,
|
119
|
+
nil, nil, nil, 11, nil, 5, 9, 26, 15, nil,
|
120
|
+
23, nil, nil, 33, nil, 17, 19, 7, nil, 16,
|
121
|
+
20, nil, 25, 30, 32, 1, 4, nil, 8, nil,
|
122
|
+
14, nil, nil, nil, 29, nil, nil, nil, nil, nil,
|
123
|
+
11, 72, 5, 9, 26, 15, nil, 23, nil, nil,
|
124
|
+
33, nil, 17, 19, 7, nil, 16, 20, nil, 25,
|
125
|
+
30, 32, 1, 4, nil, 8, nil, 14, nil, nil,
|
126
|
+
nil, 29, nil, nil, nil, nil, nil, 11, nil, 5,
|
127
|
+
9, 26, 15, nil, 23, nil, nil, 33, 116, 17,
|
128
|
+
19, 7, nil, 16, 20, nil, 25, 30, 32, 1,
|
129
|
+
4, nil, 8, nil, 14, nil, nil, nil, 29, nil,
|
130
|
+
nil, nil, nil, nil, 11, nil, 5, 9, 26, 15,
|
131
|
+
76, 23, nil, 113, 33, nil, 17, 19, 7, nil,
|
132
|
+
16, 20, nil, 25, 30, 32, 1, 4, nil, 8,
|
133
|
+
nil, 14, nil, nil, nil, 29, nil, nil, nil, nil,
|
134
|
+
nil, 11, nil, 5, 9, 26, 15, nil, 23, nil,
|
135
|
+
nil, 33, nil, 17, 19, 7, nil, 16, 20, nil,
|
136
|
+
25, 30, 32, 1, 4, nil, 8, nil, 14, nil,
|
137
|
+
nil, nil, 29, nil, nil, nil, nil, nil, 11, nil,
|
138
|
+
5, 9, 26, 15, nil, 23, nil, nil, 33, nil,
|
139
|
+
17, 19, 7, nil, 16, 20, 79, 25, 30, 32,
|
140
|
+
1, 4, nil, 8, nil, 14, nil, nil, nil, 29,
|
141
|
+
nil, nil, nil, nil, nil, 11, nil, 5, 9, 26,
|
142
|
+
15, nil, 23, nil, nil, 33, nil, 17, 19, 7,
|
143
|
+
nil, 16, 20, nil, 25, 30, 32, 1, 4, nil,
|
144
|
+
8, nil, 14, nil, nil, nil, 29, nil, nil, nil,
|
145
|
+
nil, nil, 11, 104, 5, 9, 26, 15, nil, 23,
|
146
|
+
nil, nil, 33, nil, 17, 19, 7, nil, 16, 20,
|
147
|
+
nil, 25, 30, 32, 1, 4, nil, 8, nil, 14,
|
148
|
+
nil, nil, 103, 29, nil, nil, nil, nil, nil, 11,
|
149
|
+
nil, 5, 9, 26, 15, nil, 23, nil, nil, 33,
|
150
|
+
nil, 17, 19, 7, nil, 16, 20, nil, 25, 30,
|
151
|
+
32, 1, 4, nil, 8, nil, 14, nil, nil, nil,
|
152
|
+
29, nil, nil, nil, nil, 91, 11, nil, nil, nil,
|
153
|
+
26, nil, 5, 9, nil, 15, nil, 23, 17, 19,
|
154
|
+
33, nil, 137, nil, 7, nil, 16, 20, nil, 25,
|
155
|
+
30, 32, 1, 4, nil, 8, nil, 14, nil, nil,
|
156
|
+
nil, 29, nil, nil, nil, nil, nil, 11, nil, nil,
|
157
|
+
nil, 26, nil, nil, nil, nil, nil, nil, nil, 17,
|
158
|
+
19 ]
|
159
|
+
|
160
|
+
racc_action_check = [
|
161
|
+
33, 96, 96, 26, 96, 130, 96, 130, 95, 96,
|
162
|
+
54, 33, 116, 96, 116, 96, 96, 67, 96, 96,
|
163
|
+
96, 96, 96, 113, 96, 113, 96, 133, 51, 133,
|
164
|
+
96, 85, 29, 85, 29, 50, 96, 44, 44, 74,
|
165
|
+
96, 61, 61, 75, 26, 77, 78, 48, 96, 96,
|
166
|
+
33, 4, 4, 54, 4, 54, 4, 82, 45, 4,
|
167
|
+
63, 62, 87, 4, 39, 4, 4, 37, 4, 4,
|
168
|
+
4, 4, 4, 92, 4, 66, 4, 34, 97, 98,
|
169
|
+
4, 99, 60, 107, 59, 23, 4, 58, 7, 7,
|
170
|
+
4, 7, 114, 7, 19, 57, 7, 117, 4, 4,
|
171
|
+
7, 121, 7, 7, 14, 7, 7, 7, 7, 7,
|
172
|
+
124, 7, 125, 7, 126, 11, 52, 7, 132, 53,
|
173
|
+
136, 8, 138, 7, 102, nil, nil, 7, nil, 137,
|
174
|
+
137, nil, 137, nil, 137, 7, 7, 137, nil, 137,
|
175
|
+
nil, 137, nil, 137, 137, nil, 137, 137, 137, 137,
|
176
|
+
137, nil, 137, nil, 137, nil, nil, nil, 137, nil,
|
177
|
+
nil, nil, nil, nil, 137, nil, nil, nil, 137, nil,
|
178
|
+
9, 9, 9, 9, nil, 9, 137, 137, 9, nil,
|
179
|
+
nil, nil, 9, nil, 9, 9, nil, 9, 9, 9,
|
180
|
+
9, 9, nil, 9, nil, 9, nil, nil, nil, 9,
|
181
|
+
nil, nil, nil, nil, nil, 9, nil, 129, 129, 9,
|
182
|
+
129, nil, 129, nil, nil, 129, nil, 9, 9, 129,
|
183
|
+
nil, 129, 129, nil, 129, 129, 129, 129, 129, nil,
|
184
|
+
129, nil, 129, nil, nil, nil, 129, nil, nil, nil,
|
185
|
+
nil, nil, 129, nil, 122, 122, 129, 122, nil, 122,
|
186
|
+
nil, nil, 122, nil, 129, 129, 122, nil, 122, 122,
|
187
|
+
nil, 122, 122, 122, 122, 122, nil, 122, nil, 122,
|
188
|
+
nil, nil, nil, 122, nil, nil, nil, nil, nil, 122,
|
189
|
+
nil, 15, 15, 122, 15, 15, 15, nil, nil, 15,
|
190
|
+
nil, 122, 122, 15, nil, 15, 15, nil, 15, 15,
|
191
|
+
15, 15, 15, nil, 15, nil, 15, nil, nil, nil,
|
192
|
+
15, nil, nil, nil, nil, nil, 15, nil, 115, 115,
|
193
|
+
15, 115, nil, 115, nil, nil, 115, nil, 15, 15,
|
194
|
+
115, nil, 115, 115, nil, 115, 115, 115, 115, 115,
|
195
|
+
nil, 115, nil, 115, nil, nil, nil, 115, nil, nil,
|
196
|
+
nil, nil, nil, 115, nil, 20, 20, 115, 20, nil,
|
197
|
+
20, nil, nil, 20, 115, 115, 115, 20, nil, 20,
|
198
|
+
20, nil, 20, 20, 20, 20, 20, nil, 20, nil,
|
199
|
+
20, nil, nil, nil, 20, nil, nil, nil, nil, nil,
|
200
|
+
20, nil, 112, 112, 20, 112, nil, 112, nil, nil,
|
201
|
+
112, nil, 20, 20, 112, nil, 112, 112, nil, 112,
|
202
|
+
112, 112, 112, 112, nil, 112, nil, 112, nil, nil,
|
203
|
+
nil, 112, nil, nil, nil, nil, nil, 112, nil, nil,
|
204
|
+
nil, 112, nil, nil, nil, nil, 112, nil, nil, 112,
|
205
|
+
112, 109, 109, nil, 109, nil, 109, nil, 109, 109,
|
206
|
+
nil, nil, nil, 109, nil, 109, 109, nil, 109, 109,
|
207
|
+
109, 109, 109, nil, 109, nil, 109, nil, nil, nil,
|
208
|
+
109, nil, nil, nil, nil, nil, 109, nil, 55, 55,
|
209
|
+
109, 55, nil, 55, nil, nil, 55, nil, 109, 109,
|
210
|
+
55, nil, 55, 55, nil, 55, 55, 55, 55, 55,
|
211
|
+
nil, 55, nil, 55, nil, nil, nil, 55, nil, nil,
|
212
|
+
55, nil, nil, 55, nil, 0, 0, 55, 0, nil,
|
213
|
+
0, nil, nil, 0, nil, 55, 55, 0, nil, 0,
|
214
|
+
0, nil, 0, 0, 0, 0, 0, nil, 0, nil,
|
215
|
+
0, nil, nil, nil, 0, nil, nil, nil, nil, nil,
|
216
|
+
0, nil, 2, 2, 0, 2, nil, 2, nil, nil,
|
217
|
+
2, nil, 0, 0, 2, nil, 2, 2, nil, 2,
|
218
|
+
2, 2, 2, 2, nil, 2, nil, 2, nil, nil,
|
219
|
+
nil, 2, nil, nil, nil, nil, nil, 2, nil, 36,
|
220
|
+
36, 2, 36, nil, 36, nil, nil, 36, nil, 2,
|
221
|
+
2, 36, nil, 36, 36, nil, 36, 36, 36, 36,
|
222
|
+
36, nil, 36, nil, 36, nil, nil, nil, 36, nil,
|
223
|
+
nil, nil, nil, nil, 36, nil, 90, 90, 36, 90,
|
224
|
+
nil, 90, nil, nil, 90, nil, 36, 36, 90, nil,
|
225
|
+
90, 90, nil, 90, 90, 90, 90, 90, nil, 90,
|
226
|
+
nil, 90, nil, nil, nil, 90, nil, nil, nil, nil,
|
227
|
+
90, 90, nil, 38, 38, 90, 38, nil, 38, nil,
|
228
|
+
nil, 38, nil, 90, 90, 38, 38, 38, 38, nil,
|
229
|
+
38, 38, 38, 38, 38, nil, 38, nil, 38, nil,
|
230
|
+
nil, nil, 38, nil, nil, nil, nil, nil, 38, nil,
|
231
|
+
88, 88, 38, 88, nil, 88, nil, nil, 88, nil,
|
232
|
+
38, 38, 88, nil, 88, 88, nil, 88, 88, 88,
|
233
|
+
88, 88, nil, 88, nil, 88, nil, nil, nil, 88,
|
234
|
+
nil, nil, 88, nil, nil, 88, nil, 40, 40, 88,
|
235
|
+
40, nil, 40, nil, nil, 40, nil, 88, 88, 40,
|
236
|
+
nil, 40, 40, nil, 40, 40, 40, 40, 40, nil,
|
237
|
+
40, nil, 40, nil, nil, 40, 40, nil, nil, nil,
|
238
|
+
nil, nil, 40, nil, nil, nil, 40, nil, 41, 41,
|
239
|
+
41, 41, nil, 41, 40, 40, 41, nil, nil, nil,
|
240
|
+
41, nil, 41, 41, nil, 41, 41, 41, 41, 41,
|
241
|
+
nil, 41, nil, 41, nil, nil, nil, 41, nil, nil,
|
242
|
+
nil, nil, nil, 41, nil, 43, 43, 41, 43, nil,
|
243
|
+
43, nil, nil, 43, nil, 41, 41, 43, nil, 43,
|
244
|
+
43, nil, 43, 43, 43, 43, 43, nil, 43, nil,
|
245
|
+
43, nil, nil, nil, 43, nil, nil, nil, nil, nil,
|
246
|
+
43, 43, 86, 86, 43, 86, nil, 86, nil, nil,
|
247
|
+
86, nil, 43, 43, 86, nil, 86, 86, nil, 86,
|
248
|
+
86, 86, 86, 86, nil, 86, nil, 86, nil, nil,
|
249
|
+
nil, 86, nil, nil, nil, nil, nil, 86, nil, 84,
|
250
|
+
84, 86, 84, nil, 84, nil, nil, 84, 86, 86,
|
251
|
+
86, 84, nil, 84, 84, nil, 84, 84, 84, 84,
|
252
|
+
84, nil, 84, nil, 84, nil, nil, nil, 84, nil,
|
253
|
+
nil, nil, nil, nil, 84, nil, 46, 46, 84, 46,
|
254
|
+
46, 46, nil, 84, 46, nil, 84, 84, 46, nil,
|
255
|
+
46, 46, nil, 46, 46, 46, 46, 46, nil, 46,
|
256
|
+
nil, 46, nil, nil, nil, 46, nil, nil, nil, nil,
|
257
|
+
nil, 46, nil, 81, 81, 46, 81, nil, 81, nil,
|
258
|
+
nil, 81, nil, 46, 46, 81, nil, 81, 81, nil,
|
259
|
+
81, 81, 81, 81, 81, nil, 81, nil, 81, nil,
|
260
|
+
nil, nil, 81, nil, nil, nil, nil, nil, 81, nil,
|
261
|
+
49, 49, 81, 49, nil, 49, nil, nil, 49, nil,
|
262
|
+
81, 81, 49, nil, 49, 49, 49, 49, 49, 49,
|
263
|
+
49, 49, nil, 49, nil, 49, nil, nil, nil, 49,
|
264
|
+
nil, nil, nil, nil, nil, 49, nil, 71, 71, 49,
|
265
|
+
71, nil, 71, nil, nil, 71, nil, 49, 49, 71,
|
266
|
+
nil, 71, 71, nil, 71, 71, 71, 71, 71, nil,
|
267
|
+
71, nil, 71, nil, nil, nil, 71, nil, nil, nil,
|
268
|
+
nil, nil, 71, 71, 68, 68, 71, 68, nil, 68,
|
269
|
+
nil, nil, 68, nil, 71, 71, 68, nil, 68, 68,
|
270
|
+
nil, 68, 68, 68, 68, 68, nil, 68, nil, 68,
|
271
|
+
nil, nil, 68, 68, nil, nil, nil, nil, nil, 68,
|
272
|
+
nil, 56, 56, 68, 56, nil, 56, nil, nil, 56,
|
273
|
+
nil, 68, 68, 56, nil, 56, 56, nil, 56, 56,
|
274
|
+
56, 56, 56, nil, 56, nil, 56, nil, nil, nil,
|
275
|
+
56, nil, nil, nil, nil, 56, 56, nil, nil, nil,
|
276
|
+
56, nil, 146, 146, nil, 146, nil, 146, 56, 56,
|
277
|
+
146, nil, 146, nil, 146, nil, 146, 146, nil, 146,
|
278
|
+
146, 146, 146, 146, nil, 146, nil, 146, nil, nil,
|
279
|
+
nil, 146, nil, nil, nil, nil, nil, 146, nil, nil,
|
280
|
+
nil, 146, nil, nil, nil, nil, nil, nil, nil, 146,
|
281
|
+
146 ]
|
282
|
+
|
283
|
+
racc_action_pointer = [
|
284
|
+
513, nil, 550, nil, 49, nil, nil, 86, 92, 168,
|
285
|
+
nil, 76, nil, nil, 75, 279, nil, nil, nil, 92,
|
286
|
+
353, nil, nil, 83, nil, nil, 1, nil, nil, -1,
|
287
|
+
nil, nil, nil, -2, 77, nil, 587, 43, 661, 38,
|
288
|
+
735, 776, nil, 813, -2, 30, 924, nil, 35, 998,
|
289
|
+
27, 19, 73, 77, 8, 476, 1109, 60, 55, 49,
|
290
|
+
30, 29, 59, 60, nil, nil, 49, -12, 1072, nil,
|
291
|
+
nil, 1035, nil, nil, 0, 15, nil, 43, -5, nil,
|
292
|
+
nil, 961, 15, nil, 887, -14, 850, 18, 698, nil,
|
293
|
+
624, nil, 41, nil, nil, 6, -1, 67, 77, 69,
|
294
|
+
nil, nil, 95, nil, nil, nil, nil, 71, nil, 439,
|
295
|
+
nil, nil, 390, -22, 48, 316, -33, 54, nil, nil,
|
296
|
+
nil, 89, 242, nil, 98, 110, 103, nil, nil, 205,
|
297
|
+
-40, nil, 75, -18, nil, nil, 109, 127, 111, nil,
|
298
|
+
nil, nil, nil, nil, nil, nil, 1150, nil, nil, nil ]
|
299
|
+
|
300
|
+
racc_action_default = [
|
301
|
+
-80, -55, -1, -36, -18, -50, -2, -80, -80, -80,
|
302
|
+
-3, -22, -17, -4, -80, -80, -52, -10, -5, -80,
|
303
|
+
-80, -6, -38, -80, -7, -51, -42, -39, -8, -72,
|
304
|
+
-54, -9, -53, -80, -80, -37, -19, -80, -80, -62,
|
305
|
+
-80, -80, -56, -80, -22, -62, -80, -57, -78, -80,
|
306
|
+
-80, -25, -42, -80, -45, -80, -80, -72, -80, -72,
|
307
|
+
-80, -29, -80, -80, -11, -75, -80, -80, -80, -65,
|
308
|
+
-58, -80, -20, -23, -22, -80, -59, -80, -80, -76,
|
309
|
+
-12, -80, -80, -40, -80, -45, -80, -80, -80, -69,
|
310
|
+
-80, -73, -80, -68, -71, -80, -80, -80, -80, -31,
|
311
|
+
150, -60, -64, -66, -21, -24, -61, -78, -77, -27,
|
312
|
+
-26, -41, -80, -45, -80, -80, -45, -42, -70, -74,
|
313
|
+
-67, -29, -30, -14, -33, -80, -80, -63, -79, -80,
|
314
|
+
-45, -46, -42, -45, -48, -43, -80, -33, -80, -32,
|
315
|
+
-15, -28, -47, -44, -49, -16, -33, -34, -13, -35 ]
|
316
|
+
|
317
|
+
racc_goto_table = [
|
318
|
+
35, 87, 53, 2, 43, 66, 78, 36, 110, 138,
|
319
|
+
38, 75, 41, 97, 37, 39, 50, 57, 46, 126,
|
320
|
+
58, 45, 147, 49, 34, nil, nil, nil, 82, nil,
|
321
|
+
nil, 149, 114, nil, 35, nil, 35, 73, nil, 35,
|
322
|
+
nil, nil, nil, 68, 35, nil, 71, 35, 92, nil,
|
323
|
+
94, nil, nil, nil, nil, nil, 141, nil, 88, 90,
|
324
|
+
131, nil, nil, 134, nil, 128, 35, 105, 127, 35,
|
325
|
+
nil, nil, nil, 136, 102, nil, nil, 142, nil, nil,
|
326
|
+
144, nil, nil, nil, nil, nil, 35, 112, 35, 115,
|
327
|
+
nil, nil, nil, 135, nil, nil, nil, nil, nil, 122,
|
328
|
+
nil, nil, nil, nil, nil, nil, nil, 35, 143, nil,
|
329
|
+
35, nil, nil, 35, nil, nil, nil, nil, nil, nil,
|
330
|
+
35, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
331
|
+
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
332
|
+
146, nil, nil, nil, 35 ]
|
333
|
+
|
334
|
+
racc_goto_check = [
|
335
|
+
3, 23, 22, 2, 18, 25, 30, 2, 19, 14,
|
336
|
+
2, 25, 2, 15, 12, 24, 13, 27, 2, 16,
|
337
|
+
28, 24, 14, 2, 1, nil, nil, nil, 22, nil,
|
338
|
+
nil, 14, 23, nil, 3, nil, 3, 18, nil, 3,
|
339
|
+
nil, nil, nil, 2, 3, nil, 2, 3, 28, nil,
|
340
|
+
28, nil, nil, nil, nil, nil, 19, nil, 2, 2,
|
341
|
+
23, nil, nil, 23, nil, 30, 3, 18, 25, 3,
|
342
|
+
nil, nil, nil, 15, 24, nil, nil, 23, nil, nil,
|
343
|
+
23, nil, nil, nil, nil, nil, 3, 2, 3, 2,
|
344
|
+
nil, nil, nil, 22, nil, nil, nil, nil, nil, 2,
|
345
|
+
nil, nil, nil, nil, nil, nil, nil, 3, 22, nil,
|
346
|
+
3, nil, nil, 3, nil, nil, nil, nil, nil, nil,
|
347
|
+
3, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
348
|
+
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
349
|
+
2, nil, nil, nil, 3 ]
|
350
|
+
|
351
|
+
racc_goto_pointer = [
|
352
|
+
nil, 24, 3, -2, nil, nil, nil, nil, nil, nil,
|
353
|
+
nil, nil, 10, -7, -115, -48, -80, nil, -7, -73,
|
354
|
+
nil, nil, -24, -53, 7, -34, nil, -12, -9, nil,
|
355
|
+
-42 ]
|
356
|
+
|
357
|
+
racc_goto_default = [
|
358
|
+
nil, nil, 109, 3, 6, 10, 13, 18, 21, 24,
|
359
|
+
28, 31, nil, nil, nil, nil, nil, 12, nil, nil,
|
360
|
+
22, 27, nil, nil, nil, nil, 67, nil, nil, 59,
|
361
|
+
nil ]
|
362
|
+
|
363
|
+
racc_reduce_table = [
|
364
|
+
0, 0, :racc_error,
|
365
|
+
1, 54, :_reduce_1,
|
366
|
+
1, 56, :_reduce_2,
|
367
|
+
1, 56, :_reduce_3,
|
368
|
+
1, 56, :_reduce_4,
|
369
|
+
1, 56, :_reduce_5,
|
370
|
+
1, 56, :_reduce_6,
|
371
|
+
1, 56, :_reduce_7,
|
372
|
+
1, 56, :_reduce_8,
|
373
|
+
1, 56, :_reduce_9,
|
374
|
+
1, 56, :_reduce_10,
|
375
|
+
3, 56, :_reduce_11,
|
376
|
+
3, 56, :_reduce_12,
|
377
|
+
6, 56, :_reduce_13,
|
378
|
+
4, 56, :_reduce_14,
|
379
|
+
5, 56, :_reduce_15,
|
380
|
+
6, 56, :_reduce_16,
|
381
|
+
1, 56, :_reduce_none,
|
382
|
+
0, 65, :_reduce_18,
|
383
|
+
1, 65, :_reduce_19,
|
384
|
+
3, 63, :_reduce_20,
|
385
|
+
4, 63, :_reduce_21,
|
386
|
+
0, 71, :_reduce_22,
|
387
|
+
2, 71, :_reduce_23,
|
388
|
+
3, 71, :_reduce_24,
|
389
|
+
1, 66, :_reduce_25,
|
390
|
+
3, 66, :_reduce_26,
|
391
|
+
1, 72, :_reduce_27,
|
392
|
+
3, 72, :_reduce_28,
|
393
|
+
0, 68, :_reduce_29,
|
394
|
+
2, 68, :_reduce_30,
|
395
|
+
0, 69, :_reduce_31,
|
396
|
+
2, 69, :_reduce_32,
|
397
|
+
0, 67, :_reduce_33,
|
398
|
+
2, 67, :_reduce_34,
|
399
|
+
3, 67, :_reduce_35,
|
400
|
+
1, 55, :_reduce_36,
|
401
|
+
2, 55, :_reduce_37,
|
402
|
+
1, 57, :_reduce_38,
|
403
|
+
1, 57, :_reduce_39,
|
404
|
+
3, 70, :_reduce_40,
|
405
|
+
4, 70, :_reduce_41,
|
406
|
+
0, 75, :_reduce_42,
|
407
|
+
4, 75, :_reduce_43,
|
408
|
+
5, 75, :_reduce_44,
|
409
|
+
0, 76, :_reduce_45,
|
410
|
+
3, 76, :_reduce_46,
|
411
|
+
4, 76, :_reduce_47,
|
412
|
+
3, 76, :_reduce_48,
|
413
|
+
4, 76, :_reduce_49,
|
414
|
+
1, 73, :_reduce_50,
|
415
|
+
1, 73, :_reduce_51,
|
416
|
+
1, 73, :_reduce_52,
|
417
|
+
1, 73, :_reduce_53,
|
418
|
+
1, 73, :_reduce_54,
|
419
|
+
1, 73, :_reduce_55,
|
420
|
+
2, 74, :_reduce_56,
|
421
|
+
2, 74, :_reduce_57,
|
422
|
+
3, 74, :_reduce_58,
|
423
|
+
3, 74, :_reduce_59,
|
424
|
+
4, 58, :_reduce_60,
|
425
|
+
4, 59, :_reduce_61,
|
426
|
+
0, 79, :_reduce_62,
|
427
|
+
3, 78, :_reduce_63,
|
428
|
+
0, 78, :_reduce_64,
|
429
|
+
2, 77, :_reduce_65,
|
430
|
+
3, 77, :_reduce_66,
|
431
|
+
4, 60, :_reduce_67,
|
432
|
+
3, 60, :_reduce_68,
|
433
|
+
2, 80, :_reduce_69,
|
434
|
+
3, 80, :_reduce_70,
|
435
|
+
2, 81, :_reduce_71,
|
436
|
+
0, 81, :_reduce_72,
|
437
|
+
2, 82, :_reduce_73,
|
438
|
+
3, 82, :_reduce_74,
|
439
|
+
3, 61, :_reduce_75,
|
440
|
+
3, 62, :_reduce_76,
|
441
|
+
4, 64, :_reduce_77,
|
442
|
+
0, 83, :_reduce_78,
|
443
|
+
3, 83, :_reduce_79 ]
|
444
|
+
|
445
|
+
racc_reduce_n = 80
|
446
|
+
|
447
|
+
racc_shift_n = 150
|
448
|
+
|
449
|
+
racc_token_table = {
|
450
|
+
false => 0,
|
451
|
+
:error => 1,
|
452
|
+
:TEXT => 2,
|
453
|
+
:BOLD_START => 3,
|
454
|
+
:BOLD_END => 4,
|
455
|
+
:ITALIC_START => 5,
|
456
|
+
:ITALIC_END => 6,
|
457
|
+
:LINK_START => 7,
|
458
|
+
:LINK_END => 8,
|
459
|
+
:LINKSEP => 9,
|
460
|
+
:INTLINK_START => 10,
|
461
|
+
:INTLINK_END => 11,
|
462
|
+
:INTLINKSEP => 12,
|
463
|
+
:RESOURCESEP => 13,
|
464
|
+
:PRE_START => 14,
|
465
|
+
:PRE_END => 15,
|
466
|
+
:CHAR_ENT => 16,
|
467
|
+
:SECTION_START => 17,
|
468
|
+
:SECTION_END => 18,
|
469
|
+
:HLINE => 19,
|
470
|
+
:SIGNATURE_NAME => 20,
|
471
|
+
:SIGNATURE_DATE => 21,
|
472
|
+
:SIGNATURE_FULL => 22,
|
473
|
+
:PARA_START => 23,
|
474
|
+
:PARA_END => 24,
|
475
|
+
:UL_START => 25,
|
476
|
+
:UL_END => 26,
|
477
|
+
:OL_START => 27,
|
478
|
+
:OL_END => 28,
|
479
|
+
:LI_START => 29,
|
480
|
+
:LI_END => 30,
|
481
|
+
:DL_START => 31,
|
482
|
+
:DL_END => 32,
|
483
|
+
:DT_START => 33,
|
484
|
+
:DT_END => 34,
|
485
|
+
:DD_START => 35,
|
486
|
+
:DD_END => 36,
|
487
|
+
:TAG_START => 37,
|
488
|
+
:TAG_END => 38,
|
489
|
+
:ATTR_NAME => 39,
|
490
|
+
:ATTR_VALUE => 40,
|
491
|
+
:TABLE_START => 41,
|
492
|
+
:TABLE_END => 42,
|
493
|
+
:ROW_START => 43,
|
494
|
+
:ROW_END => 44,
|
495
|
+
:HEAD_START => 45,
|
496
|
+
:HEAD_END => 46,
|
497
|
+
:CELL_START => 47,
|
498
|
+
:CELL_END => 48,
|
499
|
+
:KEYWORD => 49,
|
500
|
+
:TEMPLATE_START => 50,
|
501
|
+
:TEMPLATE_END => 51,
|
502
|
+
:CATEGORY => 52 }
|
503
|
+
|
504
|
+
racc_nt_base = 53
|
505
|
+
|
506
|
+
racc_use_result_var = true
|
507
|
+
|
508
|
+
Racc_arg = [
|
509
|
+
racc_action_table,
|
510
|
+
racc_action_check,
|
511
|
+
racc_action_default,
|
512
|
+
racc_action_pointer,
|
513
|
+
racc_goto_table,
|
514
|
+
racc_goto_check,
|
515
|
+
racc_goto_default,
|
516
|
+
racc_goto_pointer,
|
517
|
+
racc_nt_base,
|
518
|
+
racc_reduce_table,
|
519
|
+
racc_token_table,
|
520
|
+
racc_shift_n,
|
521
|
+
racc_reduce_n,
|
522
|
+
racc_use_result_var ]
|
523
|
+
|
524
|
+
Racc_token_to_s_table = [
|
525
|
+
"$end",
|
526
|
+
"error",
|
527
|
+
"TEXT",
|
528
|
+
"BOLD_START",
|
529
|
+
"BOLD_END",
|
530
|
+
"ITALIC_START",
|
531
|
+
"ITALIC_END",
|
532
|
+
"LINK_START",
|
533
|
+
"LINK_END",
|
534
|
+
"LINKSEP",
|
535
|
+
"INTLINK_START",
|
536
|
+
"INTLINK_END",
|
537
|
+
"INTLINKSEP",
|
538
|
+
"RESOURCESEP",
|
539
|
+
"PRE_START",
|
540
|
+
"PRE_END",
|
541
|
+
"CHAR_ENT",
|
542
|
+
"SECTION_START",
|
543
|
+
"SECTION_END",
|
544
|
+
"HLINE",
|
545
|
+
"SIGNATURE_NAME",
|
546
|
+
"SIGNATURE_DATE",
|
547
|
+
"SIGNATURE_FULL",
|
548
|
+
"PARA_START",
|
549
|
+
"PARA_END",
|
550
|
+
"UL_START",
|
551
|
+
"UL_END",
|
552
|
+
"OL_START",
|
553
|
+
"OL_END",
|
554
|
+
"LI_START",
|
555
|
+
"LI_END",
|
556
|
+
"DL_START",
|
557
|
+
"DL_END",
|
558
|
+
"DT_START",
|
559
|
+
"DT_END",
|
560
|
+
"DD_START",
|
561
|
+
"DD_END",
|
562
|
+
"TAG_START",
|
563
|
+
"TAG_END",
|
564
|
+
"ATTR_NAME",
|
565
|
+
"ATTR_VALUE",
|
566
|
+
"TABLE_START",
|
567
|
+
"TABLE_END",
|
568
|
+
"ROW_START",
|
569
|
+
"ROW_END",
|
570
|
+
"HEAD_START",
|
571
|
+
"HEAD_END",
|
572
|
+
"CELL_START",
|
573
|
+
"CELL_END",
|
574
|
+
"KEYWORD",
|
575
|
+
"TEMPLATE_START",
|
576
|
+
"TEMPLATE_END",
|
577
|
+
"CATEGORY",
|
578
|
+
"$start",
|
579
|
+
"wiki",
|
580
|
+
"repeated_contents",
|
581
|
+
"contents",
|
582
|
+
"text",
|
583
|
+
"bulleted_list",
|
584
|
+
"numbered_list",
|
585
|
+
"dictionary_list",
|
586
|
+
"preformatted",
|
587
|
+
"section",
|
588
|
+
"tag",
|
589
|
+
"template",
|
590
|
+
"para_contents",
|
591
|
+
"link_contents",
|
592
|
+
"reslink_repeated_contents",
|
593
|
+
"intlink_repeated_contents",
|
594
|
+
"cat_sort_contents",
|
595
|
+
"table",
|
596
|
+
"tag_attributes",
|
597
|
+
"link_repeated_contents",
|
598
|
+
"element",
|
599
|
+
"formatted_element",
|
600
|
+
"table_contents",
|
601
|
+
"row_contents",
|
602
|
+
"list_item",
|
603
|
+
"list_contents",
|
604
|
+
"@1",
|
605
|
+
"dictionary_term",
|
606
|
+
"dictionary_contents",
|
607
|
+
"dictionary_definition",
|
608
|
+
"template_parameters" ]
|
609
|
+
|
610
|
+
Racc_debug_parser = false
|
611
|
+
|
612
|
+
##### State transition tables end #####
|
613
|
+
|
614
|
+
# reduce 0 omitted
|
615
|
+
|
616
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 24)
|
617
|
+
def _reduce_1(val, _values, result)
|
618
|
+
@nodes.push WikiAST.new
|
619
|
+
#@nodes.last.children.insert(0, val[0])
|
620
|
+
#puts val[0]
|
621
|
+
@nodes.last.children += val[0]
|
622
|
+
|
623
|
+
result
|
624
|
+
end
|
625
|
+
.,.,
|
626
|
+
|
627
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 34)
|
628
|
+
def _reduce_2(val, _values, result)
|
629
|
+
result = val[0]
|
630
|
+
|
631
|
+
result
|
632
|
+
end
|
633
|
+
.,.,
|
634
|
+
|
635
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 38)
|
636
|
+
def _reduce_3(val, _values, result)
|
637
|
+
result = val[0]
|
638
|
+
|
639
|
+
result
|
640
|
+
end
|
641
|
+
.,.,
|
642
|
+
|
643
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 42)
|
644
|
+
def _reduce_4(val, _values, result)
|
645
|
+
result = val[0]
|
646
|
+
|
647
|
+
result
|
648
|
+
end
|
649
|
+
.,.,
|
650
|
+
|
651
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 46)
|
652
|
+
def _reduce_5(val, _values, result)
|
653
|
+
list = ListAST.new
|
654
|
+
list.list_type = :Dictionary
|
655
|
+
list.children = val[0]
|
656
|
+
result = list
|
657
|
+
|
658
|
+
result
|
659
|
+
end
|
660
|
+
.,.,
|
661
|
+
|
662
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 53)
|
663
|
+
def _reduce_6(val, _values, result)
|
664
|
+
result = val[0]
|
665
|
+
|
666
|
+
result
|
667
|
+
end
|
668
|
+
.,.,
|
669
|
+
|
670
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 57)
|
671
|
+
def _reduce_7(val, _values, result)
|
672
|
+
result = val[0]
|
673
|
+
|
674
|
+
result
|
675
|
+
end
|
676
|
+
.,.,
|
677
|
+
|
678
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 61)
|
679
|
+
def _reduce_8(val, _values, result)
|
680
|
+
result = val[0]
|
681
|
+
|
682
|
+
result
|
683
|
+
end
|
684
|
+
.,.,
|
685
|
+
|
686
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 65)
|
687
|
+
def _reduce_9(val, _values, result)
|
688
|
+
result = val[0]
|
689
|
+
|
690
|
+
result
|
691
|
+
end
|
692
|
+
.,.,
|
693
|
+
|
694
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 69)
|
695
|
+
def _reduce_10(val, _values, result)
|
696
|
+
k = KeywordAST.new
|
697
|
+
k.text = val[0]
|
698
|
+
result = k
|
699
|
+
|
700
|
+
result
|
701
|
+
end
|
702
|
+
.,.,
|
703
|
+
|
704
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 75)
|
705
|
+
def _reduce_11(val, _values, result)
|
706
|
+
p = ParagraphAST.new
|
707
|
+
p.children = val[1]
|
708
|
+
result = p
|
709
|
+
|
710
|
+
result
|
711
|
+
end
|
712
|
+
.,.,
|
713
|
+
|
714
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 81)
|
715
|
+
def _reduce_12(val, _values, result)
|
716
|
+
l = LinkAST.new
|
717
|
+
l.url = val[1][0]
|
718
|
+
l.children += val[1][1..-1] if val[1].length > 1
|
719
|
+
result = l
|
720
|
+
|
721
|
+
result
|
722
|
+
end
|
723
|
+
.,.,
|
724
|
+
|
725
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 88)
|
726
|
+
def _reduce_13(val, _values, result)
|
727
|
+
l = ResourceLinkAST.new
|
728
|
+
l.prefix = val[1]
|
729
|
+
l.locator = val[3]
|
730
|
+
l.children = val[4] unless val[4].nil? or val[4].empty?
|
731
|
+
result = l
|
732
|
+
|
733
|
+
result
|
734
|
+
end
|
735
|
+
.,.,
|
736
|
+
|
737
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 96)
|
738
|
+
def _reduce_14(val, _values, result)
|
739
|
+
l = InternalLinkAST.new
|
740
|
+
l.locator = val[1]
|
741
|
+
l.children = val[2] unless val[2].nil? or val[2].empty?
|
742
|
+
result = l
|
743
|
+
|
744
|
+
result
|
745
|
+
end
|
746
|
+
.,.,
|
747
|
+
|
748
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 103)
|
749
|
+
def _reduce_15(val, _values, result)
|
750
|
+
l = CategoryAST.new
|
751
|
+
l.locator = val[2]
|
752
|
+
l.sort_as = val[3]
|
753
|
+
result = l
|
754
|
+
|
755
|
+
result
|
756
|
+
end
|
757
|
+
.,.,
|
758
|
+
|
759
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 110)
|
760
|
+
def _reduce_16(val, _values, result)
|
761
|
+
l = CategoryLinkAST.new
|
762
|
+
l.locator = val[3]
|
763
|
+
l.children = val[4] unless val[4].nil? or val[4].empty?
|
764
|
+
result = l
|
765
|
+
|
766
|
+
result
|
767
|
+
end
|
768
|
+
.,.,
|
769
|
+
|
770
|
+
# reduce 17 omitted
|
771
|
+
|
772
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 120)
|
773
|
+
def _reduce_18(val, _values, result)
|
774
|
+
result = nil
|
775
|
+
|
776
|
+
result
|
777
|
+
end
|
778
|
+
.,.,
|
779
|
+
|
780
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 124)
|
781
|
+
def _reduce_19(val, _values, result)
|
782
|
+
result = val[0]
|
783
|
+
|
784
|
+
result
|
785
|
+
end
|
786
|
+
.,.,
|
787
|
+
|
788
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 131)
|
789
|
+
def _reduce_20(val, _values, result)
|
790
|
+
if val[0] != val[2]
|
791
|
+
raise Racc::ParseError.new("XHTML end tag #{val[2]} does not match start tag #{val[0]}")
|
792
|
+
end
|
793
|
+
elem = ElementAST.new
|
794
|
+
elem.name = val[0]
|
795
|
+
elem.attributes = val[1]
|
796
|
+
result = elem
|
797
|
+
|
798
|
+
result
|
799
|
+
end
|
800
|
+
.,.,
|
801
|
+
|
802
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 141)
|
803
|
+
def _reduce_21(val, _values, result)
|
804
|
+
if val[0] != val[3]
|
805
|
+
raise Racc::ParseError.new("XHTML end tag #{val[3]} does not match start tag #{val[0]}")
|
806
|
+
end
|
807
|
+
elem = ElementAST.new
|
808
|
+
elem.name = val[0]
|
809
|
+
elem.attributes = val[1]
|
810
|
+
elem.children += val[2]
|
811
|
+
result = elem
|
812
|
+
|
813
|
+
result
|
814
|
+
end
|
815
|
+
.,.,
|
816
|
+
|
817
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 154)
|
818
|
+
def _reduce_22(val, _values, result)
|
819
|
+
result = nil
|
820
|
+
|
821
|
+
result
|
822
|
+
end
|
823
|
+
.,.,
|
824
|
+
|
825
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 158)
|
826
|
+
def _reduce_23(val, _values, result)
|
827
|
+
attr_map = val[2] ? val[2] : {}
|
828
|
+
attr_map[val[0]] = true
|
829
|
+
result = attr_map
|
830
|
+
|
831
|
+
result
|
832
|
+
end
|
833
|
+
.,.,
|
834
|
+
|
835
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 164)
|
836
|
+
def _reduce_24(val, _values, result)
|
837
|
+
attr_map = val[2] ? val[2] : {}
|
838
|
+
attr_map[val[0]] = val[1]
|
839
|
+
result = attr_map
|
840
|
+
|
841
|
+
result
|
842
|
+
end
|
843
|
+
.,.,
|
844
|
+
|
845
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 174)
|
846
|
+
def _reduce_25(val, _values, result)
|
847
|
+
result = val
|
848
|
+
|
849
|
+
result
|
850
|
+
end
|
851
|
+
.,.,
|
852
|
+
|
853
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 178)
|
854
|
+
def _reduce_26(val, _values, result)
|
855
|
+
result = [val[0]]
|
856
|
+
result += val[2]
|
857
|
+
|
858
|
+
result
|
859
|
+
end
|
860
|
+
.,.,
|
861
|
+
|
862
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 187)
|
863
|
+
def _reduce_27(val, _values, result)
|
864
|
+
result = val[0]
|
865
|
+
|
866
|
+
result
|
867
|
+
end
|
868
|
+
.,.,
|
869
|
+
|
870
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 191)
|
871
|
+
def _reduce_28(val, _values, result)
|
872
|
+
result = val[0]
|
873
|
+
result += val[2] if val[2]
|
874
|
+
|
875
|
+
result
|
876
|
+
end
|
877
|
+
.,.,
|
878
|
+
|
879
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 199)
|
880
|
+
def _reduce_29(val, _values, result)
|
881
|
+
result = nil
|
882
|
+
|
883
|
+
result
|
884
|
+
end
|
885
|
+
.,.,
|
886
|
+
|
887
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 203)
|
888
|
+
def _reduce_30(val, _values, result)
|
889
|
+
result = val[1]
|
890
|
+
|
891
|
+
result
|
892
|
+
end
|
893
|
+
.,.,
|
894
|
+
|
895
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 209)
|
896
|
+
def _reduce_31(val, _values, result)
|
897
|
+
result = nil
|
898
|
+
|
899
|
+
result
|
900
|
+
end
|
901
|
+
.,.,
|
902
|
+
|
903
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 213)
|
904
|
+
def _reduce_32(val, _values, result)
|
905
|
+
result = val[1]
|
906
|
+
|
907
|
+
result
|
908
|
+
end
|
909
|
+
.,.,
|
910
|
+
|
911
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 219)
|
912
|
+
def _reduce_33(val, _values, result)
|
913
|
+
result = nil
|
914
|
+
|
915
|
+
result
|
916
|
+
end
|
917
|
+
.,.,
|
918
|
+
|
919
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 223)
|
920
|
+
def _reduce_34(val, _values, result)
|
921
|
+
result = val[1]
|
922
|
+
|
923
|
+
result
|
924
|
+
end
|
925
|
+
.,.,
|
926
|
+
|
927
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 227)
|
928
|
+
def _reduce_35(val, _values, result)
|
929
|
+
i = InternalLinkItemAST.new
|
930
|
+
i.children = val[1]
|
931
|
+
result = [i]
|
932
|
+
result += val[2] if val[2]
|
933
|
+
|
934
|
+
result
|
935
|
+
end
|
936
|
+
.,.,
|
937
|
+
|
938
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 236)
|
939
|
+
def _reduce_36(val, _values, result)
|
940
|
+
result = []
|
941
|
+
result << val[0]
|
942
|
+
|
943
|
+
result
|
944
|
+
end
|
945
|
+
.,.,
|
946
|
+
|
947
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 241)
|
948
|
+
def _reduce_37(val, _values, result)
|
949
|
+
result = []
|
950
|
+
result += val[0]
|
951
|
+
result << val[1]
|
952
|
+
|
953
|
+
result
|
954
|
+
end
|
955
|
+
.,.,
|
956
|
+
|
957
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 249)
|
958
|
+
def _reduce_38(val, _values, result)
|
959
|
+
p = TextAST.new
|
960
|
+
p.formatting = val[0][0]
|
961
|
+
p.contents = val[0][1]
|
962
|
+
result = p
|
963
|
+
|
964
|
+
result
|
965
|
+
end
|
966
|
+
.,.,
|
967
|
+
|
968
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 256)
|
969
|
+
def _reduce_39(val, _values, result)
|
970
|
+
result = val[0]
|
971
|
+
|
972
|
+
result
|
973
|
+
end
|
974
|
+
.,.,
|
975
|
+
|
976
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 263)
|
977
|
+
def _reduce_40(val, _values, result)
|
978
|
+
table = TableAST.new
|
979
|
+
table.children = val[1] unless val[1].nil? or val[1].empty?
|
980
|
+
result = table
|
981
|
+
|
982
|
+
result
|
983
|
+
end
|
984
|
+
.,.,
|
985
|
+
|
986
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 269)
|
987
|
+
def _reduce_41(val, _values, result)
|
988
|
+
table = TableAST.new
|
989
|
+
table.options = val[1]
|
990
|
+
table.children = val[2] unless val[2].nil? or val[2].empty?
|
991
|
+
result = table
|
992
|
+
|
993
|
+
result
|
994
|
+
end
|
995
|
+
.,.,
|
996
|
+
|
997
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 277)
|
998
|
+
def _reduce_42(val, _values, result)
|
999
|
+
result = nil
|
1000
|
+
|
1001
|
+
result
|
1002
|
+
end
|
1003
|
+
.,.,
|
1004
|
+
|
1005
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 281)
|
1006
|
+
def _reduce_43(val, _values, result)
|
1007
|
+
row = TableRowAST.new
|
1008
|
+
row.children = val[1] unless val[1].nil? or val[1].empty?
|
1009
|
+
result = [row]
|
1010
|
+
result += val[3] unless val[3].nil? or val[3].empty?
|
1011
|
+
|
1012
|
+
result
|
1013
|
+
end
|
1014
|
+
.,.,
|
1015
|
+
|
1016
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 288)
|
1017
|
+
def _reduce_44(val, _values, result)
|
1018
|
+
row = TableRowAST.new
|
1019
|
+
row.children = val[2] unless val[2].nil? or val[2].empty?
|
1020
|
+
row.options = val[1]
|
1021
|
+
result = [row]
|
1022
|
+
result += val[4] unless val[4].nil? or val[4].empty?
|
1023
|
+
|
1024
|
+
result
|
1025
|
+
end
|
1026
|
+
.,.,
|
1027
|
+
|
1028
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 297)
|
1029
|
+
def _reduce_45(val, _values, result)
|
1030
|
+
result = nil
|
1031
|
+
|
1032
|
+
result
|
1033
|
+
end
|
1034
|
+
.,.,
|
1035
|
+
|
1036
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 301)
|
1037
|
+
def _reduce_46(val, _values, result)
|
1038
|
+
cell = TableCellAST.new
|
1039
|
+
cell.type = :head
|
1040
|
+
result = [cell]
|
1041
|
+
result += val[2] unless val[2].nil? or val[2].empty?
|
1042
|
+
|
1043
|
+
result
|
1044
|
+
end
|
1045
|
+
.,.,
|
1046
|
+
|
1047
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 308)
|
1048
|
+
def _reduce_47(val, _values, result)
|
1049
|
+
cell = TableCellAST.new
|
1050
|
+
cell.children = val[1] unless val[1].nil? or val[1].empty?
|
1051
|
+
cell.type = :head
|
1052
|
+
result = [cell]
|
1053
|
+
result += val[3] unless val[3].nil? or val[3].empty?
|
1054
|
+
|
1055
|
+
result
|
1056
|
+
end
|
1057
|
+
.,.,
|
1058
|
+
|
1059
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 316)
|
1060
|
+
def _reduce_48(val, _values, result)
|
1061
|
+
cell = TableCellAST.new
|
1062
|
+
cell.type = :body
|
1063
|
+
result = [cell]
|
1064
|
+
result += val[2] unless val[2].nil? or val[2].empty?
|
1065
|
+
|
1066
|
+
result
|
1067
|
+
end
|
1068
|
+
.,.,
|
1069
|
+
|
1070
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 323)
|
1071
|
+
def _reduce_49(val, _values, result)
|
1072
|
+
cell = TableCellAST.new
|
1073
|
+
cell.children = val[1] unless val[1].nil? or val[1].empty?
|
1074
|
+
cell.type = :body
|
1075
|
+
result = [cell]
|
1076
|
+
result += val[3] unless val[3].nil? or val[3].empty?
|
1077
|
+
|
1078
|
+
result
|
1079
|
+
end
|
1080
|
+
.,.,
|
1081
|
+
|
1082
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 333)
|
1083
|
+
def _reduce_50(val, _values, result)
|
1084
|
+
return [:None, val[0]]
|
1085
|
+
result
|
1086
|
+
end
|
1087
|
+
.,.,
|
1088
|
+
|
1089
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 335)
|
1090
|
+
def _reduce_51(val, _values, result)
|
1091
|
+
return [:HLine, val[0]]
|
1092
|
+
result
|
1093
|
+
end
|
1094
|
+
.,.,
|
1095
|
+
|
1096
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 337)
|
1097
|
+
def _reduce_52(val, _values, result)
|
1098
|
+
return [:CharacterEntity, val[0]]
|
1099
|
+
result
|
1100
|
+
end
|
1101
|
+
.,.,
|
1102
|
+
|
1103
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 339)
|
1104
|
+
def _reduce_53(val, _values, result)
|
1105
|
+
return [:SignatureDate, val[0]]
|
1106
|
+
result
|
1107
|
+
end
|
1108
|
+
.,.,
|
1109
|
+
|
1110
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 341)
|
1111
|
+
def _reduce_54(val, _values, result)
|
1112
|
+
return [:SignatureName, val[0]]
|
1113
|
+
result
|
1114
|
+
end
|
1115
|
+
.,.,
|
1116
|
+
|
1117
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 343)
|
1118
|
+
def _reduce_55(val, _values, result)
|
1119
|
+
return [:SignatureFull, val[0]]
|
1120
|
+
result
|
1121
|
+
end
|
1122
|
+
.,.,
|
1123
|
+
|
1124
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 349)
|
1125
|
+
def _reduce_56(val, _values, result)
|
1126
|
+
result = FormattedAST.new
|
1127
|
+
result.formatting = :Bold
|
1128
|
+
result
|
1129
|
+
|
1130
|
+
result
|
1131
|
+
end
|
1132
|
+
.,.,
|
1133
|
+
|
1134
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 355)
|
1135
|
+
def _reduce_57(val, _values, result)
|
1136
|
+
result = FormattedAST.new
|
1137
|
+
result.formatting = :Italic
|
1138
|
+
result
|
1139
|
+
|
1140
|
+
result
|
1141
|
+
end
|
1142
|
+
.,.,
|
1143
|
+
|
1144
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 361)
|
1145
|
+
def _reduce_58(val, _values, result)
|
1146
|
+
p = FormattedAST.new
|
1147
|
+
p.formatting = :Bold
|
1148
|
+
p.children += val[1]
|
1149
|
+
result = p
|
1150
|
+
|
1151
|
+
result
|
1152
|
+
end
|
1153
|
+
.,.,
|
1154
|
+
|
1155
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 368)
|
1156
|
+
def _reduce_59(val, _values, result)
|
1157
|
+
p = FormattedAST.new
|
1158
|
+
p.formatting = :Italic
|
1159
|
+
p.children += val[1]
|
1160
|
+
result = p
|
1161
|
+
|
1162
|
+
result
|
1163
|
+
end
|
1164
|
+
.,.,
|
1165
|
+
|
1166
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 377)
|
1167
|
+
def _reduce_60(val, _values, result)
|
1168
|
+
list = ListAST.new
|
1169
|
+
list.list_type = :Bulleted
|
1170
|
+
list.children << val[1]
|
1171
|
+
list.children += val[2]
|
1172
|
+
result = list
|
1173
|
+
|
1174
|
+
result
|
1175
|
+
end
|
1176
|
+
.,.,
|
1177
|
+
|
1178
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 387)
|
1179
|
+
def _reduce_61(val, _values, result)
|
1180
|
+
list = ListAST.new
|
1181
|
+
list.list_type = :Numbered
|
1182
|
+
list.children << val[1]
|
1183
|
+
list.children += val[2]
|
1184
|
+
result = list
|
1185
|
+
|
1186
|
+
result
|
1187
|
+
end
|
1188
|
+
.,.,
|
1189
|
+
|
1190
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 396)
|
1191
|
+
def _reduce_62(val, _values, result)
|
1192
|
+
result = []
|
1193
|
+
result
|
1194
|
+
end
|
1195
|
+
.,.,
|
1196
|
+
|
1197
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 399)
|
1198
|
+
def _reduce_63(val, _values, result)
|
1199
|
+
result << val[1]
|
1200
|
+
result += val[2]
|
1201
|
+
|
1202
|
+
result
|
1203
|
+
end
|
1204
|
+
.,.,
|
1205
|
+
|
1206
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 403)
|
1207
|
+
def _reduce_64(val, _values, result)
|
1208
|
+
result = []
|
1209
|
+
result
|
1210
|
+
end
|
1211
|
+
.,.,
|
1212
|
+
|
1213
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 409)
|
1214
|
+
def _reduce_65(val, _values, result)
|
1215
|
+
result = ListItemAST.new
|
1216
|
+
|
1217
|
+
result
|
1218
|
+
end
|
1219
|
+
.,.,
|
1220
|
+
|
1221
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 413)
|
1222
|
+
def _reduce_66(val, _values, result)
|
1223
|
+
li = ListItemAST.new
|
1224
|
+
li.children += val[1]
|
1225
|
+
result = li
|
1226
|
+
|
1227
|
+
result
|
1228
|
+
end
|
1229
|
+
.,.,
|
1230
|
+
|
1231
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 422)
|
1232
|
+
def _reduce_67(val, _values, result)
|
1233
|
+
result = [val[1]]
|
1234
|
+
result += val[2]
|
1235
|
+
|
1236
|
+
result
|
1237
|
+
end
|
1238
|
+
.,.,
|
1239
|
+
|
1240
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 427)
|
1241
|
+
def _reduce_68(val, _values, result)
|
1242
|
+
result = val[1]
|
1243
|
+
|
1244
|
+
result
|
1245
|
+
end
|
1246
|
+
.,.,
|
1247
|
+
|
1248
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 434)
|
1249
|
+
def _reduce_69(val, _values, result)
|
1250
|
+
result = ListTermAST.new
|
1251
|
+
|
1252
|
+
result
|
1253
|
+
end
|
1254
|
+
.,.,
|
1255
|
+
|
1256
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 438)
|
1257
|
+
def _reduce_70(val, _values, result)
|
1258
|
+
term = ListTermAST.new
|
1259
|
+
term.children += val[1]
|
1260
|
+
result = term
|
1261
|
+
|
1262
|
+
result
|
1263
|
+
end
|
1264
|
+
.,.,
|
1265
|
+
|
1266
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 446)
|
1267
|
+
def _reduce_71(val, _values, result)
|
1268
|
+
result = [val[0]]
|
1269
|
+
result += val[1] if val[1]
|
1270
|
+
|
1271
|
+
result
|
1272
|
+
end
|
1273
|
+
.,.,
|
1274
|
+
|
1275
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 451)
|
1276
|
+
def _reduce_72(val, _values, result)
|
1277
|
+
result = []
|
1278
|
+
|
1279
|
+
result
|
1280
|
+
end
|
1281
|
+
.,.,
|
1282
|
+
|
1283
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 457)
|
1284
|
+
def _reduce_73(val, _values, result)
|
1285
|
+
result = ListDefinitionAST.new
|
1286
|
+
|
1287
|
+
result
|
1288
|
+
end
|
1289
|
+
.,.,
|
1290
|
+
|
1291
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 461)
|
1292
|
+
def _reduce_74(val, _values, result)
|
1293
|
+
term = ListDefinitionAST.new
|
1294
|
+
term.children += val[1]
|
1295
|
+
result = term
|
1296
|
+
|
1297
|
+
result
|
1298
|
+
end
|
1299
|
+
.,.,
|
1300
|
+
|
1301
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 468)
|
1302
|
+
def _reduce_75(val, _values, result)
|
1303
|
+
p = PreformattedAST.new
|
1304
|
+
p.children += val[1]
|
1305
|
+
result = p
|
1306
|
+
|
1307
|
+
result
|
1308
|
+
end
|
1309
|
+
.,.,
|
1310
|
+
|
1311
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 475)
|
1312
|
+
def _reduce_76(val, _values, result)
|
1313
|
+
result = [val[1], val[0].length]
|
1314
|
+
s = SectionAST.new
|
1315
|
+
s.children = val[1]
|
1316
|
+
s.level = val[0].length
|
1317
|
+
result = s
|
1318
|
+
|
1319
|
+
result
|
1320
|
+
end
|
1321
|
+
.,.,
|
1322
|
+
|
1323
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 485)
|
1324
|
+
def _reduce_77(val, _values, result)
|
1325
|
+
t = TemplateAST.new
|
1326
|
+
t.template_name = val[1]
|
1327
|
+
t.children = val[2] unless val[2].nil? or val[2].empty?
|
1328
|
+
result = t
|
1329
|
+
|
1330
|
+
result
|
1331
|
+
end
|
1332
|
+
.,.,
|
1333
|
+
|
1334
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 494)
|
1335
|
+
def _reduce_78(val, _values, result)
|
1336
|
+
result = nil
|
1337
|
+
|
1338
|
+
result
|
1339
|
+
end
|
1340
|
+
.,.,
|
1341
|
+
|
1342
|
+
module_eval(<<'.,.,', 'mediawikiparser.y', 498)
|
1343
|
+
def _reduce_79(val, _values, result)
|
1344
|
+
p = TemplateParameterAST.new
|
1345
|
+
p.children = val[1]
|
1346
|
+
result = [p]
|
1347
|
+
result += val[2] if val[2]
|
1348
|
+
|
1349
|
+
result
|
1350
|
+
end
|
1351
|
+
.,.,
|
1352
|
+
|
1353
|
+
def _reduce_none(val, _values, result)
|
1354
|
+
val[0]
|
1355
|
+
end
|
1356
|
+
|
1357
|
+
end # class MediaWikiParser
|