edn-abnf 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/edn-abnf.gemspec +1 -1
  3. data/lib/edn-abnf.rb +4 -3
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 17ca8476ccb59a567d0c72fa1eb3be96a637901add2544a545a5e87f8781bd8f
4
- data.tar.gz: c88bba22e17635f44acbe1705cd8cb6a9c37ca4c91806e729341cfd347aa8eed
3
+ metadata.gz: 8eb52693cd7d9aef79f242492135b2e923c156d91aac9d193023ba8ee5c3f5b3
4
+ data.tar.gz: 76c8893695b10b13c351d93de8132c63238d295c95eb6b8aec565ae73a2169df
5
5
  SHA512:
6
- metadata.gz: baac80d34ad740d44e18907bda40ee83f50ab858441d61a70b44ec9f9786fa90c2d24cb988327c44f9ad19762d89af2dffb5b77b2817b1f1c23688a9390bda01
7
- data.tar.gz: a6a086be5922adf1ce51f51f5dc009719ed985729efb2c94c4d27bed097054f5490c2d04ca33e32e6a9239bd5c987a31860dc24aa05e46dcdedf7c2293c37f04
6
+ metadata.gz: fc9855abe0afd6f8fda6026d31a2f611ebabfce7125278604c1c6e1a56093ded138b9e0cf5e34bba73a4365cc66fad21cf185fb09a3d7ca4f393683d76c14214
7
+ data.tar.gz: d83a6154649f595a6da5e3f8f4ae40445157c7face9e54fae984df32b6e1e22e0c8c276aa2e04e9587a7ac4b7114f340d485c0d1e73016737bf61485be143c85
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.0.3"
3
+ s.version = "0.0.4"
4
4
  s.summary = "CDDL (Concise Data Definition Language) converters and miscellaneous tools"
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/edn-abnf.rb CHANGED
@@ -5,9 +5,10 @@ class EDN
5
5
 
6
6
  def self.reason(parser, s)
7
7
  reason = [parser.failure_reason]
8
- parser.failure_reason =~ /^(Expected .+) after/m
9
- reason << "#{$1.gsub("\n", '<<<NEWLINE>>>')}:" if $1
8
+ parser.failure_reason =~ /^(Expected .+) after ./m
9
+ expected = $1
10
10
  if line = s.lines.to_a[parser.failure_line - 1]
11
+ reason << "#{$1.gsub("\n", '<<<NEWLINE>>>')}:" if expected
11
12
  reason << line
12
13
  reason << "#{'~' * (parser.failure_column - 1)}^"
13
14
  end
@@ -17,7 +18,7 @@ class EDN
17
18
  def self.from_edn(s)
18
19
  ast = @@parser.parse s
19
20
  if !ast
20
- fail self.reason(@@parser, s)
21
+ raise ArgumentError, "Parse Error:\n" << self.reason(@@parser, s)
21
22
  end
22
23
  ret = EDN.new(ast)
23
24
  ret
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: edn-abnf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carsten Bormann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-25 00:00:00.000000000 Z
11
+ date: 2023-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler