cddlc 0.1.1 → 0.1.2
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 +109 -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: ed5e9bd6c8caace67d29c6549fd30d59fc2c17c06b671f63868d2ecb6ea0031b
|
4
|
+
data.tar.gz: 03d6d40e1ebf19da17117ca725ba09c60c33867606953d2566fd86ace2805e9a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b1790d8845935f61f7c12070dbb95f223a6e1914c813dbf85e4ae3979b1fbcbf37abd5730a3a471c1a5777464a8fc966d36835e20df41d3e19a17203e0969f8
|
7
|
+
data.tar.gz: f0884c20358c0a7edaf9df050c79d93f3df7dfb42ceb44ee59b3cc0cb8f318a5ad5efa08964dd259d3a211dd6bcc8a1b2eed5f636cae4ca5a80b524c3a40fdab
|
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.2"
|
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"
|