edn-abnf 0.5.30 → 0.5.31

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2ebeb1470b1565a31939bfbca8e695d4376220f29ad26b3e299b870358f4e063
4
- data.tar.gz: 6c9947fa5ca0f670c952ef8a180f4712220bf8a142488f5f040a412b8209f53f
3
+ metadata.gz: 13451876d6da0efdac4b2d724c6f8fca316ec0ae321e58fd6b878803e6afa9f0
4
+ data.tar.gz: 73d0f5f2eec9db0bba4f64c38c91ae387cb9b30f6b620c06f20752b06a932c13
5
5
  SHA512:
6
- metadata.gz: 3d16fd0184ae65329b09eac63f2a27d24ccf7609bc6f2da5993272e844f58667d87dcd31163481323858fe92049dbc41beed7a7ad8ba33595ab65acf6cc2e492
7
- data.tar.gz: dc225c8629265f47e3921ae6db088534e337f215d7de5f5f7152e493090fb15b740884fd4b3d0fdca35912e833355943aa259e67ba3f972fb3f3f3bedf53a653
6
+ metadata.gz: 3873c6f64421e73775676dea23c9bdc3bd5f195997f81e1f9d3098da06b67450c103ccdad42d4dc2fc11bf379f0f0df023a0955d806b43deca5cca7ff5dd1d56
7
+ data.tar.gz: 7000b01b9221e1282bb4fd0e4e67fa3f8a396ca34a9f9f3e4798b3f9a57e1fa3f9b07f36a3eb9b762a8622dc4ab668c61236979822b6f73b6b3b7d01bcfa9045
data/bin/edn-abnf CHANGED
@@ -115,11 +115,12 @@ if $options.lines
115
115
  exit 1
116
116
  end
117
117
  CSV.parse(edn_file) do |ok, ednin, out|
118
- if ok[0] == "#"
118
+ if !ok || ok[0] == "#" || ok == "op"
119
119
  puts "# #{ok}, #{ednin.inspect}, #{out}" if $options.verbose
120
120
  next
121
121
  end
122
122
  if ok[0] == "x"
123
+ warn "#{[ok, ednin, out].inspect}" unless ednin
123
124
  result = tree_from_edn_possibly_hex(ednin)
124
125
  result_hex = result.to_cbor.hexi
125
126
  result_diag = result.cbor_diagnostic
@@ -136,8 +137,8 @@ if $options.lines
136
137
  end
137
138
  begin
138
139
  ok = ok == "="
139
- puts "➔ #{ok}, #{ednin}, #{out}" if $options.verbose
140
- result = tree_from_edn_possibly_hex(ednin)
140
+ puts "➔ #{ok.inspect}, #{ednin.inspect}, #{out.inspect}" if $options.verbose
141
+ result = tree_from_edn_possibly_hex(ednin || "")
141
142
  diag = result.cbor_diagnostic
142
143
  if out == diag && !ok
143
144
  puts "** ≠ / #{diag.inspect} / #{out.inspect}"
@@ -151,7 +152,7 @@ if $options.lines
151
152
  end
152
153
  puts "reparsed / #{diag.inspect} / #{out.inspect}" if $options.verbose
153
154
  end
154
- rescue ArgumentError => e
155
+ rescue CBOR_DIAG::AppParseError, ArgumentError => e
155
156
  if ok
156
157
  puts "** #{e} / #{result.inspect} / #{out.inspect}"
157
158
  $error += 1
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.30"
3
+ s.version = "0.5.31"
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"
@@ -0,0 +1,13 @@
1
+ require "cbor-diagnostic-app/0"
2
+
3
+ class CBOR_DIAG::App_zzz
4
+ def self.decode(app_prefix, s)
5
+ CBOR::Tagged.new(999, [app_prefix, s])
6
+ end
7
+ end
8
+
9
+ class CBOR_DIAG::App_yyy
10
+ def self.decode(app_prefix, s)
11
+ CBOR::Tagged.new(999, [app_prefix, s])
12
+ end
13
+ end
@@ -356,7 +356,7 @@ module EDNGRAMMAR
356
356
  join1(s)
357
357
  else
358
358
  unless c == CBOR::Tagged && s.first.tag == 888 && s.first.value == nil # XXX check all values?
359
- raise "*** unjoinable chunks #{c.inspect} #{s.inspect}" if s.size != 1
359
+ raise ArgumentError, "*** unjoinable chunks #{c.inspect} #{s.inspect}" if s.size != 1
360
360
  end
361
361
  s.first
362
362
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: edn-abnf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.30
4
+ version: 0.5.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carsten Bormann
@@ -112,6 +112,7 @@ files:
112
112
  - lib/cbor-diagnostic-app/hgrammar.rb
113
113
  - lib/cbor-diagnostic-app/ip.rb
114
114
  - lib/cbor-diagnostic-app/ipgrammar.rb
115
+ - lib/cbor-diagnostic-app/zzz.rb
115
116
  - lib/edn-abnf.rb
116
117
  - lib/parser/edn-util.rb
117
118
  - lib/parser/edngrammar.rb