cddl 0.8.10 → 0.8.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/cddl.gemspec +1 -1
- data/lib/cddl.rb +14 -3
- data/test-data/feat1.cddl +4 -0
- data/test-data/test-gen.cddl +3 -0
- metadata +8 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77b28f069a663ccb82301ec6db8cf42db6b00127b36272020baf874416029a2b
|
4
|
+
data.tar.gz: c37387e5d6b1009d054cb9a345d337e43fbc2a9bcc826d009aa0b1cdfeded437
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7818289a708b07c08a58c8b114730777d70a4dbfb43ec94f10fbcacfae21cdbdcd72b11dd225e52471963e1570d30cb5703790f424b470015ab67064cc48ae8
|
7
|
+
data.tar.gz: 301eb0733448db7eae4dff9404d51b436c018ede13ed9a2288a6285d783e58d479186e80193e90e38ed075bd24b33fccf1ed2055eb57fd99cd99594621aa1df7
|
data/cddl.gemspec
CHANGED
data/lib/cddl.rb
CHANGED
@@ -439,6 +439,8 @@ module CDDL
|
|
439
439
|
$default_warned = true
|
440
440
|
end
|
441
441
|
generate1(target, inmap)
|
442
|
+
when :feature
|
443
|
+
generate1(target, inmap)
|
442
444
|
when :eq
|
443
445
|
content = generate1(control)
|
444
446
|
if validate1(content, where)
|
@@ -551,9 +553,14 @@ module CDDL
|
|
551
553
|
|
552
554
|
def validate(d, warn=true)
|
553
555
|
@recursion = 0
|
556
|
+
$features = Hash.new {|h, k| h[k] = {}}
|
554
557
|
result = validate1a(d, rules)
|
555
|
-
|
556
|
-
if
|
558
|
+
if warn
|
559
|
+
if result
|
560
|
+
if $features != {}
|
561
|
+
warn "** Features potentially used: #{$features.map {|k, v| "#{k}: #{v.keys}"}.join(", ")}"
|
562
|
+
end
|
563
|
+
else
|
557
564
|
warn "CDDL validation failure (#{result.inspect} for #{d.inspect}):"
|
558
565
|
PP::pp(validate_diag, STDERR)
|
559
566
|
puts(validate_diag.cbor_diagnostic)
|
@@ -797,6 +804,10 @@ module CDDL
|
|
797
804
|
$default_warned = true
|
798
805
|
end
|
799
806
|
ann
|
807
|
+
when :feature
|
808
|
+
ok, v, vt = extract_value(control)
|
809
|
+
$features[v][d] = true
|
810
|
+
ann
|
800
811
|
when :lt, :le, :gt, :ge, :eq, :ne
|
801
812
|
op = OPERATORS[where[1]]
|
802
813
|
ok, v, _vt = extract_value(control)
|
@@ -1168,7 +1179,7 @@ module CDDL
|
|
1168
1179
|
BRACE = {"{" => :map, "[" => :array}
|
1169
1180
|
RANGE_EXCLUDE_END = {".." => false, "..." => true}
|
1170
1181
|
SUPPORTED_ANNOTATIONS = [:bits, :size, :regexp, :cbor, :cborseq, :within, :and,
|
1171
|
-
:default, :lt, :le, :gt, :ge, :eq, :ne]
|
1182
|
+
:default, :lt, :le, :gt, :ge, :eq, :ne, :feature]
|
1172
1183
|
|
1173
1184
|
def type1(n, canbegroup = false)
|
1174
1185
|
# puts "NVALUE #{n.value.inspect}"
|
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.8.
|
4
|
+
version: 0.8.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carsten Bormann
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-06-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cbor-diag
|
@@ -117,6 +117,7 @@ files:
|
|
117
117
|
- test-data/dcaf1.cddl
|
118
118
|
- test-data/dotsize.cddl
|
119
119
|
- test-data/extractor-demo.cddl
|
120
|
+
- test-data/feat1.cddl
|
120
121
|
- test-data/foo.cddl
|
121
122
|
- test-data/grasp-01-extract.cddl
|
122
123
|
- test-data/grasp-01-test.cddl
|
@@ -149,6 +150,7 @@ files:
|
|
149
150
|
- test-data/patch1.cddl
|
150
151
|
- test-data/reused_named_group.cddl
|
151
152
|
- test-data/structure.cddl
|
153
|
+
- test-data/test-gen.cddl
|
152
154
|
- test-data/toerless0.cddl
|
153
155
|
- test-data/toerless1.cddl
|
154
156
|
- test-data/two_anonymous_groups.cddl
|
@@ -162,7 +164,7 @@ homepage: http://github.com/cabo/cddl
|
|
162
164
|
licenses:
|
163
165
|
- MIT
|
164
166
|
metadata: {}
|
165
|
-
post_install_message:
|
167
|
+
post_install_message:
|
166
168
|
rdoc_options: []
|
167
169
|
require_paths:
|
168
170
|
- lib
|
@@ -177,8 +179,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
177
179
|
- !ruby/object:Gem::Version
|
178
180
|
version: '0'
|
179
181
|
requirements: []
|
180
|
-
rubygems_version: 3.
|
181
|
-
signing_key:
|
182
|
+
rubygems_version: 3.1.2
|
183
|
+
signing_key:
|
182
184
|
specification_version: 4
|
183
185
|
summary: CDDL generator and validator.
|
184
186
|
test_files: []
|