edn-abnf 0.5.36pre1 → 0.5.36pre2
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/edn-abnf.gemspec +1 -1
- data/lib/parser/edngrammar.rb +142 -28
- 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: ffe8e904ee5a50ead60bd3583dc0280908528c42d0d9def2c6d957a76a37412c
|
|
4
|
+
data.tar.gz: 7cc0afc1c2be87aad5d61006cf186209fba5ff9f5519e9b4de301f4713adfdff
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4b22f6dc393b06caf005b9a912570c710face625647d710c5ec34ebc26d2c2be64d6f7e5c292f6bada972b3f4cb4375a114fea0e6196b388eeba6eedd36a4fde
|
|
7
|
+
data.tar.gz: fc1d29a21c85fb0e16beb271df70397a930aaebc6155f9dd348c9e8494d09b03904d811472fcb65123f0fad01461c3b0b458a36858bf964725de099192684031
|
data/edn-abnf.gemspec
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Gem::Specification.new do |s|
|
|
2
2
|
s.name = "edn-abnf"
|
|
3
|
-
s.version = "0.5.
|
|
3
|
+
s.version = "0.5.36pre2"
|
|
4
4
|
s.summary = "CBOR Extended Diagnostic Notation (EDN) implemented in ABNF"
|
|
5
5
|
s.description = %q{edn-abnf implements converters and miscellaneous tools for CBOR EDN's ABNF}
|
|
6
6
|
s.author = "Carsten Bormann"
|
data/lib/parser/edngrammar.rb
CHANGED
|
@@ -1976,13 +1976,16 @@ module EDNGRAMMAR
|
|
|
1976
1976
|
end
|
|
1977
1977
|
|
|
1978
1978
|
module AppString1
|
|
1979
|
+
end
|
|
1980
|
+
|
|
1981
|
+
module AppString2
|
|
1979
1982
|
def ast # XXX ignoring h and b64
|
|
1980
|
-
data = sqstr.ast.force_encoding(Encoding::UTF_8) # XXX undo .b
|
|
1981
|
-
app = app_prefix.text_value
|
|
1983
|
+
data = elements[0].sqstr.ast.force_encoding(Encoding::UTF_8) # XXX undo .b
|
|
1984
|
+
app = elements[0].app_prefix.text_value
|
|
1982
1985
|
begin
|
|
1983
1986
|
::EDNGRAMMAR::APPS[app].decode(app, data)
|
|
1984
1987
|
rescue CBOR_DIAG::AppParseError => e
|
|
1985
|
-
app_parser_level1_diagnostics(e, elements[1].elements[1])
|
|
1988
|
+
app_parser_level1_diagnostics(e, elements[0].elements[1].elements[1])
|
|
1986
1989
|
raise e
|
|
1987
1990
|
end
|
|
1988
1991
|
end
|
|
@@ -2000,16 +2003,42 @@ module EDNGRAMMAR
|
|
|
2000
2003
|
end
|
|
2001
2004
|
|
|
2002
2005
|
i0, s0 = index, []
|
|
2003
|
-
|
|
2006
|
+
i1, s1 = index, []
|
|
2007
|
+
r2 = _nt_app_prefix
|
|
2008
|
+
s1 << r2
|
|
2009
|
+
if r2
|
|
2010
|
+
r3 = _nt_sqstr
|
|
2011
|
+
s1 << r3
|
|
2012
|
+
end
|
|
2013
|
+
if s1.last
|
|
2014
|
+
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
|
|
2015
|
+
r1.extend(AppString0)
|
|
2016
|
+
else
|
|
2017
|
+
@index = i1
|
|
2018
|
+
r1 = nil
|
|
2019
|
+
end
|
|
2004
2020
|
s0 << r1
|
|
2005
2021
|
if r1
|
|
2006
|
-
|
|
2007
|
-
|
|
2022
|
+
i4 = index
|
|
2023
|
+
r5 = lambda {|x| pref = x[0].app_prefix.text_value
|
|
2024
|
+
ret = !$options.integrated || !["h", "b64", "dt"].include?(pref)
|
|
2025
|
+
ret}.call(s0)
|
|
2026
|
+
if !r5
|
|
2027
|
+
terminal_parse_failure("<semantic predicate>")
|
|
2028
|
+
end
|
|
2029
|
+
if r5
|
|
2030
|
+
@index = i4
|
|
2031
|
+
r4 = instantiate_node(SyntaxNode,input, index...index)
|
|
2032
|
+
else
|
|
2033
|
+
@index = i4
|
|
2034
|
+
r4 = nil
|
|
2035
|
+
end
|
|
2036
|
+
s0 << r4
|
|
2008
2037
|
end
|
|
2009
2038
|
if s0.last
|
|
2010
2039
|
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
|
2011
|
-
r0.extend(AppString0)
|
|
2012
2040
|
r0.extend(AppString1)
|
|
2041
|
+
r0.extend(AppString2)
|
|
2013
2042
|
else
|
|
2014
2043
|
@index = i0
|
|
2015
2044
|
r0 = nil
|
|
@@ -2103,13 +2132,17 @@ module EDNGRAMMAR
|
|
|
2103
2132
|
end
|
|
2104
2133
|
|
|
2105
2134
|
module AppRstring1
|
|
2135
|
+
end
|
|
2136
|
+
|
|
2137
|
+
module AppRstring2
|
|
2138
|
+
|
|
2106
2139
|
def ast # XXX ignoring h and b64
|
|
2107
|
-
data = rawstring.ast.force_encoding(Encoding::UTF_8) # XXX undo .b
|
|
2108
|
-
app = app_prefix.text_value
|
|
2140
|
+
data = elements[0].rawstring.ast.force_encoding(Encoding::UTF_8) # XXX undo .b
|
|
2141
|
+
app = elements[0].app_prefix.text_value
|
|
2109
2142
|
begin
|
|
2110
2143
|
::EDNGRAMMAR::APPS[app].decode(app, data)
|
|
2111
2144
|
rescue CBOR_DIAG::AppParseError => e
|
|
2112
|
-
app_parser_level1_raw_diagnostics(e, elements[1].elements[1])
|
|
2145
|
+
app_parser_level1_raw_diagnostics(e, elements[0].elements[1].elements[1])
|
|
2113
2146
|
raise e
|
|
2114
2147
|
end
|
|
2115
2148
|
end
|
|
@@ -2127,16 +2160,42 @@ module EDNGRAMMAR
|
|
|
2127
2160
|
end
|
|
2128
2161
|
|
|
2129
2162
|
i0, s0 = index, []
|
|
2130
|
-
|
|
2163
|
+
i1, s1 = index, []
|
|
2164
|
+
r2 = _nt_app_prefix
|
|
2165
|
+
s1 << r2
|
|
2166
|
+
if r2
|
|
2167
|
+
r3 = _nt_rawstring
|
|
2168
|
+
s1 << r3
|
|
2169
|
+
end
|
|
2170
|
+
if s1.last
|
|
2171
|
+
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
|
|
2172
|
+
r1.extend(AppRstring0)
|
|
2173
|
+
else
|
|
2174
|
+
@index = i1
|
|
2175
|
+
r1 = nil
|
|
2176
|
+
end
|
|
2131
2177
|
s0 << r1
|
|
2132
2178
|
if r1
|
|
2133
|
-
|
|
2134
|
-
|
|
2179
|
+
i4 = index
|
|
2180
|
+
r5 = lambda {|x| pref = x[0].app_prefix.text_value
|
|
2181
|
+
ret = !$options.integrated || !["h", "b64", "dt"].include?(pref)
|
|
2182
|
+
ret}.call(s0)
|
|
2183
|
+
if !r5
|
|
2184
|
+
terminal_parse_failure("<semantic predicate>")
|
|
2185
|
+
end
|
|
2186
|
+
if r5
|
|
2187
|
+
@index = i4
|
|
2188
|
+
r4 = instantiate_node(SyntaxNode,input, index...index)
|
|
2189
|
+
else
|
|
2190
|
+
@index = i4
|
|
2191
|
+
r4 = nil
|
|
2192
|
+
end
|
|
2193
|
+
s0 << r4
|
|
2135
2194
|
end
|
|
2136
2195
|
if s0.last
|
|
2137
2196
|
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
|
2138
|
-
r0.extend(AppRstring0)
|
|
2139
2197
|
r0.extend(AppRstring1)
|
|
2198
|
+
r0.extend(AppRstring2)
|
|
2140
2199
|
else
|
|
2141
2200
|
@index = i0
|
|
2142
2201
|
r0 = nil
|
|
@@ -12178,6 +12237,17 @@ module EDNGRAMMAR
|
|
|
12178
12237
|
def ast; elements[1].ast; end
|
|
12179
12238
|
end
|
|
12180
12239
|
|
|
12240
|
+
module AppStringDtRaw22
|
|
12241
|
+
def app_string_dt
|
|
12242
|
+
elements[1]
|
|
12243
|
+
end
|
|
12244
|
+
|
|
12245
|
+
end
|
|
12246
|
+
|
|
12247
|
+
module AppStringDtRaw23
|
|
12248
|
+
def ast; elements[1].ast; end
|
|
12249
|
+
end
|
|
12250
|
+
|
|
12181
12251
|
def _nt_app_string_dt_raw2
|
|
12182
12252
|
start_index = index
|
|
12183
12253
|
if node_cache[:app_string_dt_raw2].has_key?(index)
|
|
@@ -12189,25 +12259,69 @@ module EDNGRAMMAR
|
|
|
12189
12259
|
return cached
|
|
12190
12260
|
end
|
|
12191
12261
|
|
|
12192
|
-
i0
|
|
12193
|
-
|
|
12262
|
+
i0 = index
|
|
12263
|
+
i1, s1 = index, []
|
|
12264
|
+
r3 = _nt_newline
|
|
12265
|
+
if r3
|
|
12266
|
+
r2 = r3
|
|
12267
|
+
else
|
|
12268
|
+
r2 = instantiate_node(SyntaxNode,input, index...index)
|
|
12269
|
+
end
|
|
12270
|
+
s1 << r2
|
|
12194
12271
|
if r2
|
|
12195
|
-
|
|
12272
|
+
r4 = _nt_app_string_dt
|
|
12273
|
+
s1 << r4
|
|
12274
|
+
end
|
|
12275
|
+
if s1.last
|
|
12276
|
+
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
|
|
12277
|
+
r1.extend(AppStringDtRaw20)
|
|
12278
|
+
r1.extend(AppStringDtRaw21)
|
|
12196
12279
|
else
|
|
12197
|
-
|
|
12280
|
+
@index = i1
|
|
12281
|
+
r1 = nil
|
|
12198
12282
|
end
|
|
12199
|
-
s0 << r1
|
|
12200
12283
|
if r1
|
|
12201
|
-
|
|
12202
|
-
|
|
12203
|
-
end
|
|
12204
|
-
if s0.last
|
|
12205
|
-
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
|
12206
|
-
r0.extend(AppStringDtRaw20)
|
|
12207
|
-
r0.extend(AppStringDtRaw21)
|
|
12284
|
+
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
12285
|
+
r0 = r1
|
|
12208
12286
|
else
|
|
12209
|
-
|
|
12210
|
-
|
|
12287
|
+
i5, s5 = index, []
|
|
12288
|
+
if (match_len = has_terminal?(" ", false, index))
|
|
12289
|
+
r6 = true
|
|
12290
|
+
@index += match_len
|
|
12291
|
+
else
|
|
12292
|
+
terminal_parse_failure('" "')
|
|
12293
|
+
r6 = nil
|
|
12294
|
+
end
|
|
12295
|
+
s5 << r6
|
|
12296
|
+
if r6
|
|
12297
|
+
r7 = _nt_app_string_dt
|
|
12298
|
+
s5 << r7
|
|
12299
|
+
if r7
|
|
12300
|
+
if (match_len = has_terminal?(" ", false, index))
|
|
12301
|
+
r8 = true
|
|
12302
|
+
@index += match_len
|
|
12303
|
+
else
|
|
12304
|
+
terminal_parse_failure('" "')
|
|
12305
|
+
r8 = nil
|
|
12306
|
+
end
|
|
12307
|
+
s5 << r8
|
|
12308
|
+
end
|
|
12309
|
+
end
|
|
12310
|
+
if s5.last
|
|
12311
|
+
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
|
|
12312
|
+
r5.extend(AppStringDtRaw22)
|
|
12313
|
+
r5.extend(AppStringDtRaw23)
|
|
12314
|
+
else
|
|
12315
|
+
@index = i5
|
|
12316
|
+
r5 = nil
|
|
12317
|
+
end
|
|
12318
|
+
if r5
|
|
12319
|
+
r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true
|
|
12320
|
+
r0 = r5
|
|
12321
|
+
else
|
|
12322
|
+
@index = i0
|
|
12323
|
+
r0 = nil
|
|
12324
|
+
end
|
|
12211
12325
|
end
|
|
12212
12326
|
|
|
12213
12327
|
node_cache[:app_string_dt_raw2][start_index] = r0
|