edn-abnf 0.5.15 → 0.5.17
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/bin/edn-abnf +7 -1
- data/edn-abnf.gemspec +1 -1
- data/lib/parser/edngrammar.rb +16 -76
- 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: a7428d9c37d567345cad63c6dc471c5d053267338240ea1ac3fcd14f76cb05a9
|
|
4
|
+
data.tar.gz: f76991dd9d56badebfcfa995f8b6ac4a72a7993eaf4a36760f589e696856a55f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4dea78110a5b51f5d7d116118889858314324f950f7749fe157d965649004835a3dda5de145ac70551814783bffca467badca26495ada0e1b757e67287cda93f
|
|
7
|
+
data.tar.gz: ed5cc8087dcd1d8af1bf31cd9be40153b5d5be83b6508da75d78a9dc96852f1e47e0048c3a59ad23bb645d9595212ca491385839c298886e28584b3b968b919b
|
data/bin/edn-abnf
CHANGED
|
@@ -85,6 +85,12 @@ begin
|
|
|
85
85
|
opts.on("-f", "--[no-]fallback", "use tag 999 for unknown app-extensions") do |v|
|
|
86
86
|
$options.fallback = v
|
|
87
87
|
end
|
|
88
|
+
opts.on("-wCOL", "--wrap=COL", Integer, "EDN: wrap at column COL") do |v|
|
|
89
|
+
$options.wrap = v
|
|
90
|
+
end
|
|
91
|
+
opts.on("-T", "--[no-]terminator", "Format with comma as terminator") do |v|
|
|
92
|
+
$options.terminator = v
|
|
93
|
+
end
|
|
88
94
|
end
|
|
89
95
|
op.parse!
|
|
90
96
|
rescue Exception => e
|
|
@@ -191,7 +197,7 @@ when :neat, :json
|
|
|
191
197
|
when :yaml
|
|
192
198
|
puts result.to_yaml
|
|
193
199
|
when :edn, :diag, nil
|
|
194
|
-
puts result.cbor_diagnostic
|
|
200
|
+
puts result.cbor_diagnostic(wrap: $options.wrap, terminator: $options.terminator)
|
|
195
201
|
when :pretty, :hex, :cbor
|
|
196
202
|
# XXX can't do Box yet
|
|
197
203
|
enc = if CBOR::Sequence === result
|
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.17"
|
|
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
|
@@ -5888,87 +5888,27 @@ module EDNGRAMMAR
|
|
|
5888
5888
|
return cached
|
|
5889
5889
|
end
|
|
5890
5890
|
|
|
5891
|
-
i0 = index
|
|
5892
|
-
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
|
|
5896
|
-
terminal_parse_failure('"\\n"')
|
|
5897
|
-
r1 = nil
|
|
5898
|
-
end
|
|
5899
|
-
if r1
|
|
5900
|
-
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
|
|
5901
|
-
r0 = r1
|
|
5902
|
-
else
|
|
5903
|
-
if (match_len = has_terminal?("\r", false, index))
|
|
5904
|
-
r2 = true
|
|
5905
|
-
@index += match_len
|
|
5891
|
+
s0, i0 = [], index
|
|
5892
|
+
loop do
|
|
5893
|
+
if has_terminal?(@regexps[gr = '\A[\\n\\r\\ -!\\#-&\\(-\\[\\]---]'] ||= Regexp.new(gr), :regexp, index)
|
|
5894
|
+
r1 = true
|
|
5895
|
+
@index += 1
|
|
5906
5896
|
else
|
|
5907
|
-
terminal_parse_failure('
|
|
5908
|
-
|
|
5897
|
+
terminal_parse_failure('[\\n\\r\\ -!\\#-&\\(-\\[\\]---]')
|
|
5898
|
+
r1 = nil
|
|
5909
5899
|
end
|
|
5910
|
-
if
|
|
5911
|
-
|
|
5912
|
-
r0 = r2
|
|
5900
|
+
if r1
|
|
5901
|
+
s0 << r1
|
|
5913
5902
|
else
|
|
5914
|
-
|
|
5915
|
-
r3 = true
|
|
5916
|
-
@index += 1
|
|
5917
|
-
else
|
|
5918
|
-
terminal_parse_failure('[\\ -!]')
|
|
5919
|
-
r3 = nil
|
|
5920
|
-
end
|
|
5921
|
-
if r3
|
|
5922
|
-
r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
|
|
5923
|
-
r0 = r3
|
|
5924
|
-
else
|
|
5925
|
-
if has_terminal?(@regexps[gr = '\A[\\#-&]'] ||= Regexp.new(gr), :regexp, index)
|
|
5926
|
-
r4 = true
|
|
5927
|
-
@index += 1
|
|
5928
|
-
else
|
|
5929
|
-
terminal_parse_failure('[\\#-&]')
|
|
5930
|
-
r4 = nil
|
|
5931
|
-
end
|
|
5932
|
-
if r4
|
|
5933
|
-
r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
|
|
5934
|
-
r0 = r4
|
|
5935
|
-
else
|
|
5936
|
-
if has_terminal?(@regexps[gr = '\A[\\(-\\[]'] ||= Regexp.new(gr), :regexp, index)
|
|
5937
|
-
r5 = true
|
|
5938
|
-
@index += 1
|
|
5939
|
-
else
|
|
5940
|
-
terminal_parse_failure('[\\(-\\[]')
|
|
5941
|
-
r5 = nil
|
|
5942
|
-
end
|
|
5943
|
-
if r5
|
|
5944
|
-
r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true
|
|
5945
|
-
r0 = r5
|
|
5946
|
-
else
|
|
5947
|
-
if has_terminal?(@regexps[gr = '\A[\\]-]'] ||= Regexp.new(gr), :regexp, index)
|
|
5948
|
-
r6 = true
|
|
5949
|
-
@index += 1
|
|
5950
|
-
else
|
|
5951
|
-
terminal_parse_failure('[\\]-]')
|
|
5952
|
-
r6 = nil
|
|
5953
|
-
end
|
|
5954
|
-
if r6
|
|
5955
|
-
r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true
|
|
5956
|
-
r0 = r6
|
|
5957
|
-
else
|
|
5958
|
-
r7 = _nt_NONASCII
|
|
5959
|
-
if r7
|
|
5960
|
-
r7 = SyntaxNode.new(input, (index-1)...index) if r7 == true
|
|
5961
|
-
r0 = r7
|
|
5962
|
-
else
|
|
5963
|
-
@index = i0
|
|
5964
|
-
r0 = nil
|
|
5965
|
-
end
|
|
5966
|
-
end
|
|
5967
|
-
end
|
|
5968
|
-
end
|
|
5969
|
-
end
|
|
5903
|
+
break
|
|
5970
5904
|
end
|
|
5971
5905
|
end
|
|
5906
|
+
if s0.empty?
|
|
5907
|
+
@index = i0
|
|
5908
|
+
r0 = nil
|
|
5909
|
+
else
|
|
5910
|
+
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
|
|
5911
|
+
end
|
|
5972
5912
|
|
|
5973
5913
|
node_cache[:unescaped][start_index] = r0
|
|
5974
5914
|
|