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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 446e27ac8733454e0a3a9a9e2f24a43f600f60a414400419287fe147649a7a1f
4
- data.tar.gz: 1a4e7b41949419befd15479d0373bf3c316e22c62a6796c6453db6c3467f2b5d
3
+ metadata.gz: ed5e9bd6c8caace67d29c6549fd30d59fc2c17c06b671f63868d2ecb6ea0031b
4
+ data.tar.gz: 03d6d40e1ebf19da17117ca725ba09c60c33867606953d2566fd86ace2805e9a
5
5
  SHA512:
6
- metadata.gz: 5fce60c859d8b361973c52a9e4d0a4e18908a7978d938a91c0e50125d64db3a5d704a9cc7f6ad8d17fb7f242bed3f31bb5df2107459d9fdacc57afae9f8df53e
7
- data.tar.gz: 2c8a8e5f3653125cb719d6aeb7f46642643b561702824a4fcdd404dd40bcdf3ae362ca5cda5323b97f6da521dc555677d8f5139774a12ef9b2f599539b08850e
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, undef_gen = cddl.cddl_undefined
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.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"