cddlc 0.1.1 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/cddlc +1 -44
- data/cddlc.gemspec +1 -1
- data/data/rfc8727.cddl +946 -0
- data/data/rfc8927.cddl +96 -0
- data/data/rfc8990.cddl +213 -0
- data/data/rfc9053.cddl +21 -0
- data/data/rfc9054.cddl +13 -0
- data/data/rfc9090.cddl +14 -0
- data/data/rfc9115.cddl +99 -0
- data/data/rfc9164.cddl +32 -0
- data/data/rfc9165.cddl +35 -0
- data/data/rfc9171.cddl +334 -0
- data/data/rfc9173.cddl +36 -0
- data/data/rfc9177.cddl +6 -0
- data/data/rfc9202.cddl +6 -0
- data/data/rfc9203.cddl +11 -0
- data/data/rfc9237.cddl +27 -0
- data/data/rfc9277.cddl +11 -0
- data/data/rfc9290.cddl +37 -0
- data/data/rfc9321.cddl +67 -0
- data/data/rfc9338.cddl +34 -0
- data/lib/cddlc.rb +138 -6
- data/lib/parser/cddl-util.rb +1 -1
- data/lib/processor/cddl-expander.rb +13 -10
- data/lib/processor/cddl-undefined.rb +25 -16
- data/lib/processor/cddl-visitor.rb +2 -0
- data/lib/writer/cddl-writer.rb +38 -25
- metadata +21 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0fb30da3097b44521e7c3fe12d6e061f7d4f64d9faa3c1239c22a8e76b629e5
|
4
|
+
data.tar.gz: 7cc5c141bd3833d11efb95ab25dd7649666ee6398efb3c01d95dc7cd8a220802
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d119b506cf51407c66e882df9bcc59e2019926c3843d8ad5acb0a5dede020f6ecb099284eded1a6cae912db42347edafabb3be79a789d4afd2153015258abe6c
|
7
|
+
data.tar.gz: b30fb2251c6daaba6fe3c20a85800b64af61a1908a4ab80596891bf88687f7ec2e441649d9f05d4268e24c9a77c0818cd188a8deada0642ba20fc75961445abd
|
data/bin/cddlc
CHANGED
@@ -91,46 +91,6 @@ result = if $options.rules
|
|
91
91
|
|
92
92
|
warn "** can't note undefined for target != cddl" if $options.note_undefined && $options.target != :cddl
|
93
93
|
|
94
|
-
if $options.cddl2
|
95
|
-
require_relative '../lib/processor/cddl-undefined.rb'
|
96
|
-
directives = cddl_file.lines.grep(/^;# /).map(&:chomp).map{|l| l.sub(/^;#\s+/, '')}
|
97
|
-
# puts "** Directives: <<"
|
98
|
-
# puts directives
|
99
|
-
directives.each do |di|
|
100
|
-
case di
|
101
|
-
when /\Ainclude\s+([-._a-zA-Z0-9]+)(?:\s+as\s+([-._a-zA-Z0-9]+))?\s*\z/
|
102
|
-
docref = $1
|
103
|
-
explicit_preferred_tag = $2
|
104
|
-
preferred_tag = explicit_preferred_tag || docref
|
105
|
-
puts "PREFERRED_TAG #{preferred_tag}" if $options.verbose
|
106
|
-
puts "DOCREF #{docref}" if $options.verbose
|
107
|
-
fn = docref.downcase << ".cddl"
|
108
|
-
io = File.open(fn) rescue File.open(CDDL::DATA_DIR + fn) # XXX CDDL_PATH
|
109
|
-
include_file = io.read
|
110
|
-
# XXX: processing directives recursively!
|
111
|
-
included_cddl = CDDL.from_cddl(include_file)
|
112
|
-
# XXX: Should namespace that thing now! all names -> preferred_tag.name
|
113
|
-
p included_cddl.rules.keys
|
114
|
-
# XXX: do once, first, to rename COSE_Key to RFC9052.COSE_Key
|
115
|
-
loop do
|
116
|
-
undef_rule, _undef_gen = cddl.cddl_undefined # ignore undef_gen for now
|
117
|
-
# p undef_rule
|
118
|
-
got_more = false
|
119
|
-
undef_rule.each do |name|
|
120
|
-
if rule = included_cddl.rules[name]
|
121
|
-
cddl.rules[name] = rule # XXX must be namespaced!
|
122
|
-
puts "IMPORTED #{name} from #{fn}" # ...: #{rule}... if $options.verbose
|
123
|
-
got_more = true
|
124
|
-
end
|
125
|
-
end
|
126
|
-
break unless got_more
|
127
|
-
end
|
128
|
-
else
|
129
|
-
warn "** unknown directive '#{di}' ignored"
|
130
|
-
end
|
131
|
-
end
|
132
|
-
end
|
133
|
-
|
134
94
|
case $options.target
|
135
95
|
when :basic, nil
|
136
96
|
pp result
|
@@ -160,13 +120,10 @@ when :cddl
|
|
160
120
|
require_relative '../lib/writer/cddl-writer.rb'
|
161
121
|
if $options.note_undefined
|
162
122
|
require_relative '../lib/processor/cddl-undefined.rb'
|
163
|
-
undef_rule
|
123
|
+
undef_rule = cddl.cddl_undefined
|
164
124
|
undef_rule.each do |k|
|
165
125
|
puts ";;; *** undefined: #{k}"
|
166
126
|
end
|
167
|
-
undef_gen.each do |k|
|
168
|
-
puts ";;; *** undefined: #{k}<>"
|
169
|
-
end
|
170
127
|
end
|
171
128
|
puts cddl.to_s
|
172
129
|
else
|
data/cddlc.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "cddlc"
|
3
|
-
s.version = "0.1.
|
3
|
+
s.version = "0.1.3"
|
4
4
|
s.summary = "CDDL (Concise Data Definition Language) converters and miscellaneous tools"
|
5
5
|
s.description = %q{cddlc implements converters and miscellaneous tools for CDDL, RFC 8610}
|
6
6
|
s.author = "Carsten Bormann"
|