sportdb-parser 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -1
- data/lib/sportdb/parser/parser.rb +295 -251
- data/lib/sportdb/parser/token-status.rb +15 -8
- data/lib/sportdb/parser/version.rb +1 -1
- data/lib/sportdb/parser.rb +2 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2016adc1039046c3994f4d30cfe9f6b9ab9065c22ca6b07a94429e93ddfbe1bb
|
4
|
+
data.tar.gz: ab301ed8b121015db6f196fc8a5a6988766ace5478ce8538491ed1ed2b7e21db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5fb05929a62c6e99e33d52647f71ed48fd8ec57c4db808b3b5f47d47fa78c3308407dfc3eccd8d2fe2dd37b38863ff75a060d32eb8815ebd56792f5f3edafbb5
|
7
|
+
data.tar.gz: c3b3c924cc2ff525de7c048bf25ffa2d1cf23eac84d6bf4118ec1aa41d234262aeb805515ceb7e89f32fa78fb527888d9abd6fc6d1155ba8eea3bf4779d9e42c
|
data/CHANGELOG.md
CHANGED
@@ -9,178 +9,185 @@ class RaccMatchParser < Racc::Parser
|
|
9
9
|
##### State transition tables begin ###
|
10
10
|
|
11
11
|
racc_action_table = [
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
12
|
+
95, 37, 26, 29, 112, 12, 87, 28, 58, 26,
|
13
|
+
81, 82, 41, 16, 39, 51, 113, 13, 38, 23,
|
14
|
+
14, 15, 61, 20, 22, 52, 56, 57, 12, 61,
|
15
|
+
28, 51, 26, 49, 52, 58, 16, 35, 97, 98,
|
16
|
+
13, 41, 23, 14, 15, 33, 20, 22, 34, 49,
|
17
|
+
52, 64, 54, 56, 57, 22, 68, 70, 71, 72,
|
18
|
+
42, 45, 44, 76, 36, 77, 110, 111, 47, 62,
|
19
|
+
66, 67, 79, 83, 84, 61, 85, 89, 91, 38,
|
20
|
+
92, 93, 41, 100, 41, 102, 33, 104, 105, 76,
|
21
|
+
61, 114, 115, 116, 117, 118, 119, 61, 41, 41,
|
22
|
+
33, 122, 61, 124, 125 ]
|
22
23
|
|
23
24
|
racc_action_check = [
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
0,
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
25
|
+
59, 15, 16, 1, 78, 1, 49, 1, 23, 1,
|
26
|
+
36, 36, 16, 1, 16, 19, 78, 1, 15, 1,
|
27
|
+
1, 1, 59, 1, 1, 49, 23, 23, 0, 23,
|
28
|
+
0, 46, 0, 19, 19, 47, 0, 13, 61, 61,
|
29
|
+
0, 25, 0, 0, 0, 12, 0, 0, 13, 46,
|
30
|
+
46, 25, 20, 47, 47, 20, 31, 31, 31, 31,
|
31
|
+
17, 17, 17, 33, 14, 33, 77, 77, 18, 24,
|
32
|
+
26, 29, 34, 39, 40, 41, 43, 50, 52, 54,
|
33
|
+
55, 56, 63, 64, 66, 68, 69, 71, 72, 74,
|
34
|
+
76, 80, 83, 84, 88, 90, 93, 95, 99, 101,
|
35
|
+
107, 108, 109, 118, 121 ]
|
34
36
|
|
35
37
|
racc_action_pointer = [
|
36
|
-
|
37
|
-
nil, nil,
|
38
|
-
|
39
|
-
nil, 53, nil,
|
40
|
-
|
41
|
-
nil,
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
nil, nil,
|
46
|
-
nil,
|
47
|
-
nil, nil, nil,
|
38
|
+
26, 3, nil, nil, nil, nil, nil, nil, nil, nil,
|
39
|
+
nil, nil, 38, 33, 49, -3, -4, 56, 52, 11,
|
40
|
+
34, nil, nil, 2, 65, 25, 44, nil, nil, 71,
|
41
|
+
nil, 53, nil, 55, 56, nil, -8, nil, nil, 62,
|
42
|
+
63, 48, nil, 59, nil, nil, 27, 29, nil, 2,
|
43
|
+
73, nil, 62, nil, 58, 64, 65, nil, nil, -5,
|
44
|
+
nil, 10, nil, 66, 79, nil, 68, nil, 81, 79,
|
45
|
+
nil, 83, 84, nil, 81, nil, 63, 54, 0, nil,
|
46
|
+
87, nil, nil, 88, 89, nil, nil, nil, 90, nil,
|
47
|
+
90, nil, nil, 71, nil, 70, nil, nil, nil, 82,
|
48
|
+
nil, 83, nil, nil, nil, nil, nil, 93, 90, 75,
|
49
|
+
nil, nil, nil, nil, nil, nil, nil, nil, 87, nil,
|
50
|
+
nil, 95, nil, nil, nil, nil ]
|
48
51
|
|
49
52
|
racc_action_default = [
|
50
|
-
-
|
51
|
-
-10, -11, -
|
52
|
-
-47, -49, -52, -
|
53
|
-
-2, -
|
54
|
-
-
|
55
|
-
-
|
56
|
-
-75, -
|
57
|
-
-
|
58
|
-
-
|
59
|
-
-
|
60
|
-
-
|
61
|
-
-
|
53
|
+
-83, -83, -1, -3, -4, -5, -6, -7, -8, -9,
|
54
|
+
-10, -11, -83, -83, -41, -50, -83, -83, -83, -83,
|
55
|
+
-47, -49, -52, -83, -83, -67, -83, -72, -82, -83,
|
56
|
+
-2, -83, -13, -20, -83, -39, -83, -37, -51, -83,
|
57
|
+
-83, -83, -40, -83, -43, -44, -83, -83, -46, -83,
|
58
|
+
-83, -56, -83, -48, -50, -83, -83, -63, -64, -74,
|
59
|
+
-75, -78, -66, -83, -70, -73, -83, 126, -83, -83,
|
60
|
+
-15, -16, -18, -21, -22, -24, -83, -83, -83, -32,
|
61
|
+
-83, -35, -36, -83, -83, -42, -45, -53, -83, -55,
|
62
|
+
-57, -58, -60, -61, -76, -83, -79, -80, -81, -69,
|
63
|
+
-71, -68, -12, -14, -17, -19, -23, -83, -83, -27,
|
64
|
+
-29, -30, -31, -33, -34, -38, -65, -54, -83, -62,
|
65
|
+
-77, -83, -26, -28, -59, -25 ]
|
62
66
|
|
63
67
|
racc_goto_table = [
|
64
|
-
32,
|
65
|
-
31,
|
66
|
-
|
67
|
-
nil, 86, nil, nil, nil, nil,
|
68
|
-
nil, nil, nil, nil,
|
69
|
-
nil, nil,
|
68
|
+
32, 65, 94, 75, 48, 99, 2, 30, 101, 1,
|
69
|
+
31, 69, 73, 74, 108, 109, 78, 80, 43, 107,
|
70
|
+
46, 53, 88, 90, 40, 63, 96, nil, nil, nil,
|
71
|
+
nil, 86, nil, nil, nil, nil, nil, nil, 120, nil,
|
72
|
+
nil, nil, nil, nil, 106, nil, nil, nil, nil, nil,
|
73
|
+
nil, nil, 123, nil, nil, nil, nil, 103, nil, nil,
|
70
74
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
71
|
-
nil, nil,
|
75
|
+
nil, nil, nil, nil, nil, 65, nil, 65, nil, nil,
|
72
76
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
73
|
-
nil,
|
77
|
+
nil, nil, nil, nil, nil, 121 ]
|
74
78
|
|
75
79
|
racc_goto_check = [
|
76
80
|
13, 35, 18, 17, 27, 33, 2, 2, 33, 1,
|
77
|
-
12, 14, 15, 16, 19, 20, 21, 22, 24,
|
78
|
-
|
79
|
-
nil, 27, nil, nil, nil, nil,
|
80
|
-
nil, nil, nil, nil, 17, nil, nil, nil, nil,
|
81
|
-
nil, nil, nil, nil, nil, nil, 13, nil, nil,
|
81
|
+
12, 14, 15, 16, 19, 20, 21, 22, 24, 18,
|
82
|
+
26, 28, 29, 30, 32, 34, 37, nil, nil, nil,
|
83
|
+
nil, 27, nil, nil, nil, nil, nil, nil, 18, nil,
|
84
|
+
nil, nil, nil, nil, 17, nil, nil, nil, nil, nil,
|
85
|
+
nil, nil, 18, nil, nil, nil, nil, 13, nil, nil,
|
82
86
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
83
|
-
nil, nil,
|
87
|
+
nil, nil, nil, nil, nil, 35, nil, 35, nil, nil,
|
84
88
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
85
|
-
nil, 13 ]
|
89
|
+
nil, nil, nil, nil, nil, 13 ]
|
86
90
|
|
87
91
|
racc_goto_pointer = [
|
88
92
|
nil, 9, 6, nil, nil, nil, nil, nil, nil, nil,
|
89
|
-
nil, nil, -2, -12, -20, -21, -20, -30, -
|
90
|
-
-62, -18, -19, nil, 1, nil,
|
91
|
-
-29, nil,
|
93
|
+
nil, nil, -2, -12, -20, -21, -20, -30, -57, -63,
|
94
|
+
-62, -18, -19, nil, 1, nil, 2, -15, 1, -27,
|
95
|
+
-29, nil, 8, -58, 0, -24, nil, -35 ]
|
92
96
|
|
93
97
|
racc_goto_default = [
|
94
98
|
nil, nil, nil, 3, 4, 5, 6, 7, 8, 9,
|
95
|
-
10, 11, nil, nil, nil, nil, nil, nil,
|
96
|
-
nil, nil, nil, 17, nil, 18, 19, nil, 21,
|
97
|
-
nil,
|
99
|
+
10, 11, nil, nil, nil, nil, nil, nil, 60, nil,
|
100
|
+
nil, nil, nil, 17, nil, 18, 19, nil, 21, 50,
|
101
|
+
nil, 55, 24, 25, nil, 27, 59, nil ]
|
98
102
|
|
99
103
|
racc_reduce_table = [
|
100
104
|
0, 0, :racc_error,
|
101
|
-
1, 30, :_reduce_none,
|
102
|
-
2, 30, :_reduce_none,
|
103
105
|
1, 31, :_reduce_none,
|
104
|
-
|
105
|
-
1,
|
106
|
-
1,
|
107
|
-
1,
|
108
|
-
1,
|
109
|
-
1,
|
110
|
-
1,
|
111
|
-
1,
|
112
|
-
|
113
|
-
1,
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
2,
|
118
|
-
1,
|
119
|
-
|
120
|
-
1,
|
121
|
-
2,
|
122
|
-
1,
|
123
|
-
2,
|
124
|
-
1,
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
1, 49, :
|
130
|
-
|
131
|
-
|
132
|
-
1, 50, :
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
2, 33, :
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
1, 53, :
|
144
|
-
|
145
|
-
|
146
|
-
2, 37, :_reduce_46,
|
147
|
-
1, 54, :_reduce_47,
|
148
|
-
2, 54, :_reduce_48,
|
106
|
+
2, 31, :_reduce_none,
|
107
|
+
1, 32, :_reduce_none,
|
108
|
+
1, 32, :_reduce_none,
|
109
|
+
1, 32, :_reduce_none,
|
110
|
+
1, 32, :_reduce_none,
|
111
|
+
1, 32, :_reduce_none,
|
112
|
+
1, 32, :_reduce_none,
|
113
|
+
1, 32, :_reduce_none,
|
114
|
+
1, 32, :_reduce_none,
|
115
|
+
1, 32, :_reduce_none,
|
116
|
+
4, 41, :_reduce_12,
|
117
|
+
1, 42, :_reduce_13,
|
118
|
+
3, 42, :_reduce_14,
|
119
|
+
2, 42, :_reduce_15,
|
120
|
+
1, 44, :_reduce_none,
|
121
|
+
2, 44, :_reduce_17,
|
122
|
+
1, 44, :_reduce_none,
|
123
|
+
2, 44, :_reduce_19,
|
124
|
+
1, 43, :_reduce_20,
|
125
|
+
2, 43, :_reduce_21,
|
126
|
+
1, 45, :_reduce_22,
|
127
|
+
2, 45, :_reduce_23,
|
128
|
+
1, 45, :_reduce_24,
|
129
|
+
4, 47, :_reduce_25,
|
130
|
+
3, 46, :_reduce_26,
|
131
|
+
1, 49, :_reduce_27,
|
132
|
+
2, 49, :_reduce_28,
|
133
|
+
1, 50, :_reduce_none,
|
134
|
+
1, 50, :_reduce_none,
|
135
|
+
4, 36, :_reduce_31,
|
136
|
+
1, 51, :_reduce_32,
|
137
|
+
2, 51, :_reduce_33,
|
138
|
+
4, 37, :_reduce_34,
|
139
|
+
1, 52, :_reduce_35,
|
140
|
+
1, 52, :_reduce_36,
|
141
|
+
2, 33, :_reduce_37,
|
142
|
+
4, 33, :_reduce_38,
|
143
|
+
2, 34, :_reduce_39,
|
144
|
+
2, 35, :_reduce_40,
|
145
|
+
1, 53, :_reduce_41,
|
146
|
+
3, 53, :_reduce_42,
|
147
|
+
1, 54, :_reduce_none,
|
149
148
|
1, 54, :_reduce_none,
|
150
|
-
|
151
|
-
2,
|
152
|
-
1,
|
153
|
-
2,
|
154
|
-
1,
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
1,
|
162
|
-
|
163
|
-
|
149
|
+
3, 38, :_reduce_45,
|
150
|
+
2, 38, :_reduce_46,
|
151
|
+
1, 55, :_reduce_47,
|
152
|
+
2, 55, :_reduce_48,
|
153
|
+
1, 55, :_reduce_none,
|
154
|
+
1, 58, :_reduce_50,
|
155
|
+
2, 58, :_reduce_51,
|
156
|
+
1, 58, :_reduce_52,
|
157
|
+
2, 57, :_reduce_53,
|
158
|
+
3, 57, :_reduce_54,
|
159
|
+
2, 57, :_reduce_55,
|
160
|
+
1, 57, :_reduce_56,
|
161
|
+
2, 59, :_reduce_57,
|
162
|
+
1, 60, :_reduce_58,
|
163
|
+
3, 60, :_reduce_59,
|
164
|
+
3, 56, :_reduce_60,
|
165
|
+
3, 56, :_reduce_61,
|
166
|
+
4, 56, :_reduce_62,
|
167
|
+
1, 61, :_reduce_63,
|
164
168
|
1, 61, :_reduce_64,
|
165
|
-
|
166
|
-
|
167
|
-
1,
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
2, 64, :
|
172
|
-
1,
|
173
|
-
2,
|
174
|
-
|
175
|
-
1,
|
176
|
-
2,
|
177
|
-
|
178
|
-
1,
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
169
|
+
4, 39, :_reduce_65,
|
170
|
+
2, 39, :_reduce_66,
|
171
|
+
1, 62, :_reduce_67,
|
172
|
+
3, 62, :_reduce_68,
|
173
|
+
3, 62, :_reduce_69,
|
174
|
+
1, 64, :_reduce_none,
|
175
|
+
2, 64, :_reduce_none,
|
176
|
+
1, 63, :_reduce_72,
|
177
|
+
2, 63, :_reduce_73,
|
178
|
+
2, 65, :_reduce_74,
|
179
|
+
1, 66, :_reduce_75,
|
180
|
+
2, 66, :_reduce_76,
|
181
|
+
3, 66, :_reduce_77,
|
182
|
+
1, 48, :_reduce_78,
|
183
|
+
2, 48, :_reduce_79,
|
184
|
+
1, 67, :_reduce_80,
|
185
|
+
1, 67, :_reduce_81,
|
186
|
+
1, 40, :_reduce_82 ]
|
187
|
+
|
188
|
+
racc_reduce_n = 83
|
189
|
+
|
190
|
+
racc_shift_n = 126
|
184
191
|
|
185
192
|
racc_token_table = {
|
186
193
|
false => 0,
|
@@ -190,30 +197,31 @@ racc_token_table = {
|
|
190
197
|
:NEWLINE => 4,
|
191
198
|
"," => 5,
|
192
199
|
"-" => 6,
|
193
|
-
|
194
|
-
|
195
|
-
"
|
196
|
-
"
|
197
|
-
"
|
198
|
-
|
199
|
-
:
|
200
|
-
:
|
201
|
-
|
202
|
-
|
203
|
-
:
|
204
|
-
:
|
205
|
-
:
|
206
|
-
:
|
207
|
-
:
|
208
|
-
:
|
200
|
+
:PROP_NAME => 7,
|
201
|
+
"(" => 8,
|
202
|
+
")" => 9,
|
203
|
+
"[" => 10,
|
204
|
+
"]" => 11,
|
205
|
+
:YELLOW_CARD => 12,
|
206
|
+
:RED_CARD => 13,
|
207
|
+
:GROUP => 14,
|
208
|
+
"|" => 15,
|
209
|
+
:TEXT => 16,
|
210
|
+
:ROUND => 17,
|
211
|
+
:DATE => 18,
|
212
|
+
:DURATION => 19,
|
213
|
+
:ORD => 20,
|
214
|
+
:TIME => 21,
|
215
|
+
:STATUS => 22,
|
209
216
|
"@" => 23,
|
210
|
-
:
|
211
|
-
:
|
212
|
-
|
213
|
-
:
|
214
|
-
:
|
217
|
+
:VS => 24,
|
218
|
+
:SCORE => 25,
|
219
|
+
";" => 26,
|
220
|
+
:MINUTE => 27,
|
221
|
+
:OG => 28,
|
222
|
+
:PEN => 29 }
|
215
223
|
|
216
|
-
racc_nt_base =
|
224
|
+
racc_nt_base = 30
|
217
225
|
|
218
226
|
racc_use_result_var = true
|
219
227
|
|
@@ -242,7 +250,6 @@ Racc_token_to_s_table = [
|
|
242
250
|
"NEWLINE",
|
243
251
|
"\",\"",
|
244
252
|
"\"-\"",
|
245
|
-
"\";\"",
|
246
253
|
"PROP_NAME",
|
247
254
|
"\"(\"",
|
248
255
|
"\")\"",
|
@@ -258,9 +265,11 @@ Racc_token_to_s_table = [
|
|
258
265
|
"DURATION",
|
259
266
|
"ORD",
|
260
267
|
"TIME",
|
268
|
+
"STATUS",
|
261
269
|
"\"@\"",
|
262
|
-
"SCORE",
|
263
270
|
"VS",
|
271
|
+
"SCORE",
|
272
|
+
"\";\"",
|
264
273
|
"MINUTE",
|
265
274
|
"OG",
|
266
275
|
"PEN",
|
@@ -380,9 +389,14 @@ module_eval(<<'.,.,', 'parser.y', 52)
|
|
380
389
|
|
381
390
|
# reduce 18 omitted
|
382
391
|
|
383
|
-
|
392
|
+
module_eval(<<'.,.,', 'parser.y', 54)
|
393
|
+
def _reduce_19(val, _values, result)
|
394
|
+
result = val[0]
|
395
|
+
result
|
396
|
+
end
|
397
|
+
.,.,
|
384
398
|
|
385
|
-
module_eval(<<'.,.,', 'parser.y',
|
399
|
+
module_eval(<<'.,.,', 'parser.y', 60)
|
386
400
|
def _reduce_20(val, _values, result)
|
387
401
|
result = Lineup.new( name: val[0] )
|
388
402
|
|
@@ -390,7 +404,7 @@ module_eval(<<'.,.,', 'parser.y', 58)
|
|
390
404
|
end
|
391
405
|
.,.,
|
392
406
|
|
393
|
-
module_eval(<<'.,.,', 'parser.y',
|
407
|
+
module_eval(<<'.,.,', 'parser.y', 64)
|
394
408
|
def _reduce_21(val, _values, result)
|
395
409
|
kwargs = { name: val[0] }.merge( val[1] )
|
396
410
|
result = Lineup.new( **kwargs )
|
@@ -399,7 +413,7 @@ module_eval(<<'.,.,', 'parser.y', 62)
|
|
399
413
|
end
|
400
414
|
.,.,
|
401
415
|
|
402
|
-
module_eval(<<'.,.,', 'parser.y',
|
416
|
+
module_eval(<<'.,.,', 'parser.y', 70)
|
403
417
|
def _reduce_22(val, _values, result)
|
404
418
|
result = { card: val[0] }
|
405
419
|
|
@@ -407,7 +421,7 @@ module_eval(<<'.,.,', 'parser.y', 68)
|
|
407
421
|
end
|
408
422
|
.,.,
|
409
423
|
|
410
|
-
module_eval(<<'.,.,', 'parser.y',
|
424
|
+
module_eval(<<'.,.,', 'parser.y', 74)
|
411
425
|
def _reduce_23(val, _values, result)
|
412
426
|
result = { card: val[0], sub: val[1] }
|
413
427
|
|
@@ -415,7 +429,7 @@ module_eval(<<'.,.,', 'parser.y', 72)
|
|
415
429
|
end
|
416
430
|
.,.,
|
417
431
|
|
418
|
-
module_eval(<<'.,.,', 'parser.y',
|
432
|
+
module_eval(<<'.,.,', 'parser.y', 78)
|
419
433
|
def _reduce_24(val, _values, result)
|
420
434
|
result = { sub: val[0] }
|
421
435
|
|
@@ -423,7 +437,7 @@ module_eval(<<'.,.,', 'parser.y', 76)
|
|
423
437
|
end
|
424
438
|
.,.,
|
425
439
|
|
426
|
-
module_eval(<<'.,.,', 'parser.y',
|
440
|
+
module_eval(<<'.,.,', 'parser.y', 84)
|
427
441
|
def _reduce_25(val, _values, result)
|
428
442
|
result = Sub.new( minute: val[1], sub: val[2] )
|
429
443
|
|
@@ -431,7 +445,7 @@ module_eval(<<'.,.,', 'parser.y', 82)
|
|
431
445
|
end
|
432
446
|
.,.,
|
433
447
|
|
434
|
-
module_eval(<<'.,.,', 'parser.y',
|
448
|
+
module_eval(<<'.,.,', 'parser.y', 90)
|
435
449
|
def _reduce_26(val, _values, result)
|
436
450
|
kwargs = val[1]
|
437
451
|
result = Card.new( **kwargs )
|
@@ -440,14 +454,14 @@ module_eval(<<'.,.,', 'parser.y', 88)
|
|
440
454
|
end
|
441
455
|
.,.,
|
442
456
|
|
443
|
-
module_eval(<<'.,.,', 'parser.y',
|
457
|
+
module_eval(<<'.,.,', 'parser.y', 95)
|
444
458
|
def _reduce_27(val, _values, result)
|
445
459
|
result = { name: val[0] }
|
446
460
|
result
|
447
461
|
end
|
448
462
|
.,.,
|
449
463
|
|
450
|
-
module_eval(<<'.,.,', 'parser.y',
|
464
|
+
module_eval(<<'.,.,', 'parser.y', 98)
|
451
465
|
def _reduce_28(val, _values, result)
|
452
466
|
result = { name: val[0], minute: val[1] }
|
453
467
|
result
|
@@ -458,7 +472,7 @@ module_eval(<<'.,.,', 'parser.y', 96)
|
|
458
472
|
|
459
473
|
# reduce 30 omitted
|
460
474
|
|
461
|
-
module_eval(<<'.,.,', 'parser.y',
|
475
|
+
module_eval(<<'.,.,', 'parser.y', 109)
|
462
476
|
def _reduce_31(val, _values, result)
|
463
477
|
@tree << GroupDef.new( name: val[0],
|
464
478
|
teams: val[2] )
|
@@ -467,7 +481,7 @@ module_eval(<<'.,.,', 'parser.y', 107)
|
|
467
481
|
end
|
468
482
|
.,.,
|
469
483
|
|
470
|
-
module_eval(<<'.,.,', 'parser.y',
|
484
|
+
module_eval(<<'.,.,', 'parser.y', 115)
|
471
485
|
def _reduce_32(val, _values, result)
|
472
486
|
result = val
|
473
487
|
## e.g. val is ["Austria"]
|
@@ -476,7 +490,7 @@ module_eval(<<'.,.,', 'parser.y', 113)
|
|
476
490
|
end
|
477
491
|
.,.,
|
478
492
|
|
479
|
-
module_eval(<<'.,.,', 'parser.y',
|
493
|
+
module_eval(<<'.,.,', 'parser.y', 119)
|
480
494
|
def _reduce_33(val, _values, result)
|
481
495
|
result.push( val[1] )
|
482
496
|
|
@@ -484,7 +498,7 @@ module_eval(<<'.,.,', 'parser.y', 117)
|
|
484
498
|
end
|
485
499
|
.,.,
|
486
500
|
|
487
|
-
module_eval(<<'.,.,', 'parser.y',
|
501
|
+
module_eval(<<'.,.,', 'parser.y', 128)
|
488
502
|
def _reduce_34(val, _values, result)
|
489
503
|
kwargs = { name: val[0] }.merge( val[2] )
|
490
504
|
@tree<< RoundDef.new( **kwargs )
|
@@ -493,21 +507,21 @@ module_eval(<<'.,.,', 'parser.y', 126)
|
|
493
507
|
end
|
494
508
|
.,.,
|
495
509
|
|
496
|
-
module_eval(<<'.,.,', 'parser.y',
|
510
|
+
module_eval(<<'.,.,', 'parser.y', 133)
|
497
511
|
def _reduce_35(val, _values, result)
|
498
512
|
result = { date: val[0][1] }
|
499
513
|
result
|
500
514
|
end
|
501
515
|
.,.,
|
502
516
|
|
503
|
-
module_eval(<<'.,.,', 'parser.y',
|
517
|
+
module_eval(<<'.,.,', 'parser.y', 134)
|
504
518
|
def _reduce_36(val, _values, result)
|
505
519
|
result = { duration: val[0][1] }
|
506
520
|
result
|
507
521
|
end
|
508
522
|
.,.,
|
509
523
|
|
510
|
-
module_eval(<<'.,.,', 'parser.y',
|
524
|
+
module_eval(<<'.,.,', 'parser.y', 140)
|
511
525
|
def _reduce_37(val, _values, result)
|
512
526
|
@tree << DateHeader.new( date: val[0][1] )
|
513
527
|
|
@@ -515,7 +529,7 @@ module_eval(<<'.,.,', 'parser.y', 138)
|
|
515
529
|
end
|
516
530
|
.,.,
|
517
531
|
|
518
|
-
module_eval(<<'.,.,', 'parser.y',
|
532
|
+
module_eval(<<'.,.,', 'parser.y', 144)
|
519
533
|
def _reduce_38(val, _values, result)
|
520
534
|
@tree << DateHeader.new( date: val[1][1] )
|
521
535
|
|
@@ -523,7 +537,7 @@ module_eval(<<'.,.,', 'parser.y', 142)
|
|
523
537
|
end
|
524
538
|
.,.,
|
525
539
|
|
526
|
-
module_eval(<<'.,.,', 'parser.y',
|
540
|
+
module_eval(<<'.,.,', 'parser.y', 151)
|
527
541
|
def _reduce_39(val, _values, result)
|
528
542
|
@tree << GroupHeader.new( name: val[0] )
|
529
543
|
|
@@ -531,7 +545,7 @@ module_eval(<<'.,.,', 'parser.y', 149)
|
|
531
545
|
end
|
532
546
|
.,.,
|
533
547
|
|
534
|
-
module_eval(<<'.,.,', 'parser.y',
|
548
|
+
module_eval(<<'.,.,', 'parser.y', 161)
|
535
549
|
def _reduce_40(val, _values, result)
|
536
550
|
@tree << RoundHeader.new( names: val[0] )
|
537
551
|
|
@@ -539,14 +553,14 @@ module_eval(<<'.,.,', 'parser.y', 159)
|
|
539
553
|
end
|
540
554
|
.,.,
|
541
555
|
|
542
|
-
module_eval(<<'.,.,', 'parser.y',
|
556
|
+
module_eval(<<'.,.,', 'parser.y', 164)
|
543
557
|
def _reduce_41(val, _values, result)
|
544
558
|
result = val
|
545
559
|
result
|
546
560
|
end
|
547
561
|
.,.,
|
548
562
|
|
549
|
-
module_eval(<<'.,.,', 'parser.y',
|
563
|
+
module_eval(<<'.,.,', 'parser.y', 165)
|
550
564
|
def _reduce_42(val, _values, result)
|
551
565
|
result.push( val[2] )
|
552
566
|
result
|
@@ -557,7 +571,7 @@ module_eval(<<'.,.,', 'parser.y', 163)
|
|
557
571
|
|
558
572
|
# reduce 44 omitted
|
559
573
|
|
560
|
-
module_eval(<<'.,.,', 'parser.y',
|
574
|
+
module_eval(<<'.,.,', 'parser.y', 176)
|
561
575
|
def _reduce_45(val, _values, result)
|
562
576
|
puts "match:"
|
563
577
|
pp val[1]
|
@@ -571,7 +585,7 @@ module_eval(<<'.,.,', 'parser.y', 174)
|
|
571
585
|
end
|
572
586
|
.,.,
|
573
587
|
|
574
|
-
module_eval(<<'.,.,', 'parser.y',
|
588
|
+
module_eval(<<'.,.,', 'parser.y', 186)
|
575
589
|
def _reduce_46(val, _values, result)
|
576
590
|
kwargs = {}.merge( val[0], val[1] )
|
577
591
|
@tree << MatchLine.new( **kwargs )
|
@@ -580,14 +594,14 @@ module_eval(<<'.,.,', 'parser.y', 184)
|
|
580
594
|
end
|
581
595
|
.,.,
|
582
596
|
|
583
|
-
module_eval(<<'.,.,', 'parser.y',
|
597
|
+
module_eval(<<'.,.,', 'parser.y', 191)
|
584
598
|
def _reduce_47(val, _values, result)
|
585
599
|
result = { ord: val[0][1][:value] }
|
586
600
|
result
|
587
601
|
end
|
588
602
|
.,.,
|
589
603
|
|
590
|
-
module_eval(<<'.,.,', 'parser.y',
|
604
|
+
module_eval(<<'.,.,', 'parser.y', 192)
|
591
605
|
def _reduce_48(val, _values, result)
|
592
606
|
result = { ord: val[0][1][:value] }.merge( val[1] )
|
593
607
|
result
|
@@ -596,64 +610,82 @@ module_eval(<<'.,.,', 'parser.y', 190)
|
|
596
610
|
|
597
611
|
# reduce 49 omitted
|
598
612
|
|
599
|
-
module_eval(<<'.,.,', 'parser.y',
|
613
|
+
module_eval(<<'.,.,', 'parser.y', 196)
|
600
614
|
def _reduce_50(val, _values, result)
|
601
615
|
result = { date: val[0][1]}
|
602
616
|
result
|
603
617
|
end
|
604
618
|
.,.,
|
605
619
|
|
606
|
-
module_eval(<<'.,.,', 'parser.y',
|
620
|
+
module_eval(<<'.,.,', 'parser.y', 197)
|
607
621
|
def _reduce_51(val, _values, result)
|
608
622
|
result = { date: val[0][1], time: val[1][1] }
|
609
623
|
result
|
610
624
|
end
|
611
625
|
.,.,
|
612
626
|
|
613
|
-
module_eval(<<'.,.,', 'parser.y',
|
627
|
+
module_eval(<<'.,.,', 'parser.y', 198)
|
614
628
|
def _reduce_52(val, _values, result)
|
615
629
|
result = { time: val[0][1]}
|
616
630
|
result
|
617
631
|
end
|
618
632
|
.,.,
|
619
633
|
|
620
|
-
module_eval(<<'.,.,', 'parser.y',
|
634
|
+
module_eval(<<'.,.,', 'parser.y', 204)
|
621
635
|
def _reduce_53(val, _values, result)
|
622
|
-
|
636
|
+
## todo - add possible status_notes too!!!
|
637
|
+
result = { status: val[0][1][:status] }
|
638
|
+
|
623
639
|
result
|
624
640
|
end
|
625
641
|
.,.,
|
626
642
|
|
627
|
-
module_eval(<<'.,.,', 'parser.y',
|
643
|
+
module_eval(<<'.,.,', 'parser.y', 209)
|
628
644
|
def _reduce_54(val, _values, result)
|
629
|
-
|
645
|
+
result = { status: val[0][1][:status],
|
646
|
+
geo: val[1] }
|
647
|
+
|
630
648
|
result
|
631
649
|
end
|
632
650
|
.,.,
|
633
651
|
|
634
|
-
module_eval(<<'.,.,', 'parser.y',
|
652
|
+
module_eval(<<'.,.,', 'parser.y', 212)
|
635
653
|
def _reduce_55(val, _values, result)
|
636
|
-
result = val[
|
654
|
+
result = { geo: val[0] }
|
637
655
|
result
|
638
656
|
end
|
639
657
|
.,.,
|
640
658
|
|
641
|
-
module_eval(<<'.,.,', 'parser.y',
|
659
|
+
module_eval(<<'.,.,', 'parser.y', 213)
|
642
660
|
def _reduce_56(val, _values, result)
|
643
|
-
|
661
|
+
result = {}
|
644
662
|
result
|
645
663
|
end
|
646
664
|
.,.,
|
647
665
|
|
648
|
-
module_eval(<<'.,.,', 'parser.y',
|
666
|
+
module_eval(<<'.,.,', 'parser.y', 218)
|
649
667
|
def _reduce_57(val, _values, result)
|
650
|
-
|
668
|
+
result = val[1]
|
651
669
|
result
|
652
670
|
end
|
653
671
|
.,.,
|
654
672
|
|
655
|
-
module_eval(<<'.,.,', 'parser.y',
|
673
|
+
module_eval(<<'.,.,', 'parser.y', 221)
|
656
674
|
def _reduce_58(val, _values, result)
|
675
|
+
result = val
|
676
|
+
result
|
677
|
+
end
|
678
|
+
.,.,
|
679
|
+
|
680
|
+
module_eval(<<'.,.,', 'parser.y', 222)
|
681
|
+
def _reduce_59(val, _values, result)
|
682
|
+
result.push( val[2] )
|
683
|
+
result
|
684
|
+
end
|
685
|
+
.,.,
|
686
|
+
|
687
|
+
module_eval(<<'.,.,', 'parser.y', 227)
|
688
|
+
def _reduce_60(val, _values, result)
|
657
689
|
result = { team1: val[0],
|
658
690
|
team2: val[2]
|
659
691
|
}.merge( val[1] )
|
@@ -662,29 +694,41 @@ module_eval(<<'.,.,', 'parser.y', 214)
|
|
662
694
|
end
|
663
695
|
.,.,
|
664
696
|
|
665
|
-
module_eval(<<'.,.,', 'parser.y',
|
666
|
-
def
|
667
|
-
|
697
|
+
module_eval(<<'.,.,', 'parser.y', 233)
|
698
|
+
def _reduce_61(val, _values, result)
|
699
|
+
result = { team1: val[0], team2: val[2] }
|
700
|
+
|
668
701
|
result
|
669
702
|
end
|
670
703
|
.,.,
|
671
704
|
|
672
|
-
module_eval(<<'.,.,', 'parser.y',
|
673
|
-
def
|
674
|
-
|
705
|
+
module_eval(<<'.,.,', 'parser.y', 237)
|
706
|
+
def _reduce_62(val, _values, result)
|
707
|
+
result = { team1: val[0],
|
708
|
+
team2: val[2],
|
709
|
+
score: val[3][1]
|
710
|
+
}
|
711
|
+
|
675
712
|
result
|
676
713
|
end
|
677
714
|
.,.,
|
678
715
|
|
679
|
-
module_eval(<<'.,.,', 'parser.y',
|
680
|
-
def
|
716
|
+
module_eval(<<'.,.,', 'parser.y', 243)
|
717
|
+
def _reduce_63(val, _values, result)
|
718
|
+
result = { score: val[0][1] }
|
719
|
+
result
|
720
|
+
end
|
721
|
+
.,.,
|
722
|
+
|
723
|
+
module_eval(<<'.,.,', 'parser.y', 244)
|
724
|
+
def _reduce_64(val, _values, result)
|
681
725
|
result = {}
|
682
726
|
result
|
683
727
|
end
|
684
728
|
.,.,
|
685
729
|
|
686
|
-
module_eval(<<'.,.,', 'parser.y',
|
687
|
-
def
|
730
|
+
module_eval(<<'.,.,', 'parser.y', 261)
|
731
|
+
def _reduce_65(val, _values, result)
|
688
732
|
kwargs = val[1]
|
689
733
|
@tree << GoalLine.new( **kwargs )
|
690
734
|
|
@@ -692,8 +736,8 @@ module_eval(<<'.,.,', 'parser.y', 238)
|
|
692
736
|
end
|
693
737
|
.,.,
|
694
738
|
|
695
|
-
module_eval(<<'.,.,', 'parser.y',
|
696
|
-
def
|
739
|
+
module_eval(<<'.,.,', 'parser.y', 266)
|
740
|
+
def _reduce_66(val, _values, result)
|
697
741
|
kwargs = val[0]
|
698
742
|
@tree << GoalLine.new( **kwargs )
|
699
743
|
|
@@ -701,8 +745,8 @@ module_eval(<<'.,.,', 'parser.y', 243)
|
|
701
745
|
end
|
702
746
|
.,.,
|
703
747
|
|
704
|
-
module_eval(<<'.,.,', 'parser.y',
|
705
|
-
def
|
748
|
+
module_eval(<<'.,.,', 'parser.y', 271)
|
749
|
+
def _reduce_67(val, _values, result)
|
706
750
|
result = { goals1: val[0],
|
707
751
|
goals2: [] }
|
708
752
|
|
@@ -710,8 +754,8 @@ module_eval(<<'.,.,', 'parser.y', 248)
|
|
710
754
|
end
|
711
755
|
.,.,
|
712
756
|
|
713
|
-
module_eval(<<'.,.,', 'parser.y',
|
714
|
-
def
|
757
|
+
module_eval(<<'.,.,', 'parser.y', 274)
|
758
|
+
def _reduce_68(val, _values, result)
|
715
759
|
result = { goals1: [],
|
716
760
|
goals2: val[2] }
|
717
761
|
|
@@ -719,8 +763,8 @@ module_eval(<<'.,.,', 'parser.y', 251)
|
|
719
763
|
end
|
720
764
|
.,.,
|
721
765
|
|
722
|
-
module_eval(<<'.,.,', 'parser.y',
|
723
|
-
def
|
766
|
+
module_eval(<<'.,.,', 'parser.y', 277)
|
767
|
+
def _reduce_69(val, _values, result)
|
724
768
|
result = { goals1: val[0],
|
725
769
|
goals2: val[2] }
|
726
770
|
|
@@ -728,26 +772,26 @@ module_eval(<<'.,.,', 'parser.y', 254)
|
|
728
772
|
end
|
729
773
|
.,.,
|
730
774
|
|
731
|
-
# reduce
|
775
|
+
# reduce 70 omitted
|
732
776
|
|
733
|
-
# reduce
|
777
|
+
# reduce 71 omitted
|
734
778
|
|
735
|
-
module_eval(<<'.,.,', 'parser.y',
|
736
|
-
def
|
779
|
+
module_eval(<<'.,.,', 'parser.y', 291)
|
780
|
+
def _reduce_72(val, _values, result)
|
737
781
|
result = val
|
738
782
|
result
|
739
783
|
end
|
740
784
|
.,.,
|
741
785
|
|
742
|
-
module_eval(<<'.,.,', 'parser.y',
|
743
|
-
def
|
786
|
+
module_eval(<<'.,.,', 'parser.y', 292)
|
787
|
+
def _reduce_73(val, _values, result)
|
744
788
|
result.push( val[1])
|
745
789
|
result
|
746
790
|
end
|
747
791
|
.,.,
|
748
792
|
|
749
|
-
module_eval(<<'.,.,', 'parser.y',
|
750
|
-
def
|
793
|
+
module_eval(<<'.,.,', 'parser.y', 297)
|
794
|
+
def _reduce_74(val, _values, result)
|
751
795
|
result = Goal.new( player: val[0],
|
752
796
|
minutes: val[1] )
|
753
797
|
|
@@ -755,29 +799,29 @@ module_eval(<<'.,.,', 'parser.y', 274)
|
|
755
799
|
end
|
756
800
|
.,.,
|
757
801
|
|
758
|
-
module_eval(<<'.,.,', 'parser.y',
|
759
|
-
def
|
802
|
+
module_eval(<<'.,.,', 'parser.y', 304)
|
803
|
+
def _reduce_75(val, _values, result)
|
760
804
|
result = val
|
761
805
|
result
|
762
806
|
end
|
763
807
|
.,.,
|
764
808
|
|
765
|
-
module_eval(<<'.,.,', 'parser.y',
|
766
|
-
def
|
809
|
+
module_eval(<<'.,.,', 'parser.y', 305)
|
810
|
+
def _reduce_76(val, _values, result)
|
767
811
|
result.push( val[1])
|
768
812
|
result
|
769
813
|
end
|
770
814
|
.,.,
|
771
815
|
|
772
|
-
module_eval(<<'.,.,', 'parser.y',
|
773
|
-
def
|
816
|
+
module_eval(<<'.,.,', 'parser.y', 306)
|
817
|
+
def _reduce_77(val, _values, result)
|
774
818
|
result.push( val[2])
|
775
819
|
result
|
776
820
|
end
|
777
821
|
.,.,
|
778
822
|
|
779
|
-
module_eval(<<'.,.,', 'parser.y',
|
780
|
-
def
|
823
|
+
module_eval(<<'.,.,', 'parser.y', 312)
|
824
|
+
def _reduce_78(val, _values, result)
|
781
825
|
kwargs = {}.merge( val[0][1] )
|
782
826
|
result = Minute.new( **kwargs )
|
783
827
|
|
@@ -785,8 +829,8 @@ module_eval(<<'.,.,', 'parser.y', 289)
|
|
785
829
|
end
|
786
830
|
.,.,
|
787
831
|
|
788
|
-
module_eval(<<'.,.,', 'parser.y',
|
789
|
-
def
|
832
|
+
module_eval(<<'.,.,', 'parser.y', 317)
|
833
|
+
def _reduce_79(val, _values, result)
|
790
834
|
kwargs = { }.merge( val[0][1] ).merge( val[1] )
|
791
835
|
result = Minute.new( **kwargs )
|
792
836
|
|
@@ -794,22 +838,22 @@ module_eval(<<'.,.,', 'parser.y', 294)
|
|
794
838
|
end
|
795
839
|
.,.,
|
796
840
|
|
797
|
-
module_eval(<<'.,.,', 'parser.y',
|
798
|
-
def
|
841
|
+
module_eval(<<'.,.,', 'parser.y', 321)
|
842
|
+
def _reduce_80(val, _values, result)
|
799
843
|
result = { og: true }
|
800
844
|
result
|
801
845
|
end
|
802
846
|
.,.,
|
803
847
|
|
804
|
-
module_eval(<<'.,.,', 'parser.y',
|
805
|
-
def
|
848
|
+
module_eval(<<'.,.,', 'parser.y', 322)
|
849
|
+
def _reduce_81(val, _values, result)
|
806
850
|
result = { pen: true }
|
807
851
|
result
|
808
852
|
end
|
809
853
|
.,.,
|
810
854
|
|
811
|
-
module_eval(<<'.,.,', 'parser.y',
|
812
|
-
def
|
855
|
+
module_eval(<<'.,.,', 'parser.y', 327)
|
856
|
+
def _reduce_82(val, _values, result)
|
813
857
|
puts ' MATCH empty_line'
|
814
858
|
result
|
815
859
|
end
|
@@ -1,15 +1,16 @@
|
|
1
|
-
|
1
|
+
module SportDb
|
2
|
+
class Parser
|
3
|
+
|
2
4
|
## (match) status
|
3
5
|
## note: english usage - cancelled (in UK), canceled (in US)
|
4
6
|
##
|
5
7
|
## add more variants - why? why not?
|
6
8
|
|
7
9
|
|
8
|
-
|
9
|
-
|
10
10
|
STATUS_RE = %r{
|
11
|
-
|
12
|
-
|
11
|
+
\[
|
12
|
+
(?:
|
13
|
+
### opt 1 - allow long forms with note/comment for some stati
|
13
14
|
(?: (?<status> awarded
|
14
15
|
|
|
15
16
|
annulled
|
@@ -19,7 +20,8 @@ STATUS_RE = %r{
|
|
19
20
|
[ ]*
|
20
21
|
)
|
21
22
|
|
|
22
|
-
|
23
|
+
|
24
|
+
## opt 2 - short from only (no note/comments)
|
23
25
|
(?<status>
|
24
26
|
cancelled|canceled|can\.
|
25
27
|
|
|
@@ -33,6 +35,11 @@ STATUS_RE = %r{
|
|
33
35
|
|
|
34
36
|
annulled
|
35
37
|
)
|
36
|
-
|
37
|
-
|
38
|
+
)
|
39
|
+
\]
|
40
|
+
}ix
|
41
|
+
|
38
42
|
|
43
|
+
end # class Parser
|
44
|
+
end # module SportDb
|
45
|
+
|
data/lib/sportdb/parser.rb
CHANGED
@@ -234,7 +234,8 @@ RoundHeader = Struct.new( :names ) do
|
|
234
234
|
end
|
235
235
|
|
236
236
|
MatchLine = Struct.new( :ord, :date, :time,
|
237
|
-
:team1, :team2, :score,
|
237
|
+
:team1, :team2, :score,
|
238
|
+
:status,
|
238
239
|
:geo ) do ## change to geos - why? why not?
|
239
240
|
|
240
241
|
def pretty_print( printer )
|