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.
- checksums.yaml +4 -4
- data/edn-abnf.gemspec +1 -1
- data/lib/edn-abnf.rb +4 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8eb52693cd7d9aef79f242492135b2e923c156d91aac9d193023ba8ee5c3f5b3
|
4
|
+
data.tar.gz: 76c8893695b10b13c351d93de8132c63238d295c95eb6b8aec565ae73a2169df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
+
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
|
9
|
-
|
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
|
-
|
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.
|
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-
|
11
|
+
date: 2023-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|