sportdb-parser 0.6.8 → 0.6.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -1
- data/lib/sportdb/parser/lexer.rb +72 -4
- data/lib/sportdb/parser/parser.rb +613 -575
- data/lib/sportdb/parser/racc_tree.rb +7 -0
- data/lib/sportdb/parser/token-prop.rb +31 -0
- data/lib/sportdb/parser/version.rb +1 -1
- metadata +2 -2
@@ -13,6 +13,13 @@ RefereeLine = Struct.new( :name, :country ) do
|
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
+
AttendanceLine = Struct.new( :att ) do
|
17
|
+
def pretty_print( printer )
|
18
|
+
printer.text( "<AttendanceLine #{self.att}>" )
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
|
16
23
|
|
17
24
|
PenaltiesLine = Struct.new( :penalties ) do
|
18
25
|
def pretty_print( printer )
|
@@ -149,8 +149,24 @@ PROP_NAME_RE = %r{
|
|
149
149
|
}ix
|
150
150
|
|
151
151
|
|
152
|
+
PROP_NUM_RE = %r{
|
153
|
+
\b
|
154
|
+
(?<num>
|
155
|
+
## note allow underscore inline or space e.g.
|
156
|
+
## 5_000
|
157
|
+
## allow space inline (e.g. 5 000) - why? why not?
|
158
|
+
(?<value> [1-9]
|
159
|
+
(?: _?
|
160
|
+
[0-9]+
|
161
|
+
)*
|
162
|
+
)
|
163
|
+
)
|
164
|
+
\b
|
165
|
+
}ix
|
166
|
+
|
152
167
|
### todo/fix - allow more chars in enclosed name - why? why not?
|
153
168
|
## e.g. (') - Cote D'Ivore etc.
|
169
|
+
## change to PAREN_NAME or PARENTHESIS or such - why? why not?
|
154
170
|
ENCLOSED_NAME_RE = %r{
|
155
171
|
(?<enclosed_name>
|
156
172
|
\(
|
@@ -203,6 +219,21 @@ PROP_PENALTIES_RE = Regexp.union(
|
|
203
219
|
)
|
204
220
|
|
205
221
|
|
222
|
+
PROP_REFEREE_RE = Regexp.union(
|
223
|
+
ENCLOSED_NAME_RE, # e.g. (sold out) etc. why? why not?
|
224
|
+
PROP_NUM_RE, # e.g. 28 000 or 28_000 (NOT 28,000 is not valid!!!)
|
225
|
+
PROP_KEY_INLINE_RE,
|
226
|
+
PROP_NAME_RE,
|
227
|
+
PROP_BASICS_RE,
|
228
|
+
## todo/fix - add ANY_RE here too!!!
|
229
|
+
)
|
230
|
+
|
231
|
+
PROP_ATTENDANCE_RE = Regexp.union(
|
232
|
+
ENCLOSED_NAME_RE, # e.g. (sold out) etc. why? why not?
|
233
|
+
PROP_NUM_RE, # e.g. 28 000 or 28_000 (NOT 28,000 is not valid!!!)
|
234
|
+
PROP_BASICS_RE,
|
235
|
+
## todo/fix - add ANY_RE here too!!!
|
236
|
+
)
|
206
237
|
|
207
238
|
end # class Lexer
|
208
239
|
end # module SportDb
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sportdb-parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gerald Bauer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-03-
|
11
|
+
date: 2025-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cocos
|