cddl 0.12.8 → 0.12.10
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/cddl.gemspec +1 -1
- data/lib/cddl.rb +18 -4
- data/test-data/decimal-warn.cddl +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49a1d0bc5804fcc0cc5d3a67b3b6754e917146021043b63fb53de148e568029b
|
4
|
+
data.tar.gz: ab3c7a943a3d8acf7f557f1f796ca30de5572417ea5bb7ad198edf6453ceed4c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e395661ff52a4dd30cfa8e22275c1a247f0ffbe24643a568c431372b7ed86a487ce6d2334cdbe07786e96e0931ed265c653e03c65917a3f82e5b5bdb1046e77b
|
7
|
+
data.tar.gz: b022f002061187c6d35312e4e9339dcc01b7b7da3a25f536e8789463f7dd0ec070df99e3ccba93e06e267a3ec938725c05301e3331f60cbb0d441f3be379fab3
|
data/cddl.gemspec
CHANGED
data/lib/cddl.rb
CHANGED
@@ -40,6 +40,7 @@ module CDDL
|
|
40
40
|
[{}, {}]
|
41
41
|
end
|
42
42
|
|
43
|
+
CDDL_UNUSED_OK = ENV["CDDL_UNUSED_OK"]
|
43
44
|
|
44
45
|
class BackTrack < Exception; end
|
45
46
|
|
@@ -248,7 +249,7 @@ module CDDL
|
|
248
249
|
r_process("used_in_cddl_prelude", @rules["used_in_cddl_prelude"])
|
249
250
|
@rules.each do |n, r|
|
250
251
|
# r_process(n, r) # debug only loop
|
251
|
-
warn "*** Unused rule #{n}" unless @stage1[n]
|
252
|
+
warn "*** Unused rule #{n}" unless @stage1[n] || CDDL_UNUSED_OK
|
252
253
|
end
|
253
254
|
if result[0] == :grpent
|
254
255
|
warn "Group at top -- first rule must be a type!"
|
@@ -625,7 +626,13 @@ module CDDL
|
|
625
626
|
end
|
626
627
|
content = JSON::dump(generate1(control))
|
627
628
|
content
|
628
|
-
when :decimal
|
629
|
+
when :decimal, :base10
|
630
|
+
if conop == :decimal
|
631
|
+
unless @decimal_warned
|
632
|
+
warn "** .decimal control operator is now called .base10"
|
633
|
+
@decimal_warned = true
|
634
|
+
end
|
635
|
+
end
|
629
636
|
unless target == [:prim, 3]
|
630
637
|
fail "Don't know yet how to generate #{where}"
|
631
638
|
end
|
@@ -1199,7 +1206,14 @@ module CDDL
|
|
1199
1206
|
end
|
1200
1207
|
when :json
|
1201
1208
|
ann if validate1((JSON::load(d) rescue :BAD_JSON), control)
|
1202
|
-
when :decimal
|
1209
|
+
when :decimal, :base10
|
1210
|
+
if conop == :decimal
|
1211
|
+
unless @decimal_warned
|
1212
|
+
warn "** .decimal control operator is now called .base10"
|
1213
|
+
@decimal_warned = true
|
1214
|
+
end
|
1215
|
+
end
|
1216
|
+
|
1203
1217
|
ann if (
|
1204
1218
|
if /\A0|-?[1-9][0-9]*\z/ === d
|
1205
1219
|
validate1((d.to_i rescue :BAD_JSON), control)
|
@@ -1740,7 +1754,7 @@ module CDDL
|
|
1740
1754
|
:within, :and,
|
1741
1755
|
:default, :lt, :le, :gt, :ge, :eq, :ne,
|
1742
1756
|
:feature, :abnf, :abnfb, :det, :cat, :plus,
|
1743
|
-
:json, :decimal, :join,
|
1757
|
+
:json, :decimal, :base10, :join,
|
1744
1758
|
:b64u, :"b64u-sloppy", :b64c, :"b64c-sloppy",
|
1745
1759
|
:b45, :b32, :h32, :hex, :hexlc, :hexuc,
|
1746
1760
|
:printf,
|
@@ -0,0 +1 @@
|
|
1
|
+
s = [text .decimal 4711, text .base10 4712]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cddl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.
|
4
|
+
version: 0.12.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carsten Bormann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cbor-diag
|
@@ -184,6 +184,7 @@ files:
|
|
184
184
|
- test-data/cose.cddl
|
185
185
|
- test-data/dcaf.cddl
|
186
186
|
- test-data/dcaf1.cddl
|
187
|
+
- test-data/decimal-warn.cddl
|
187
188
|
- test-data/decimal.cddl
|
188
189
|
- test-data/decimal2.cddl
|
189
190
|
- test-data/det1.cddl
|