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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 446e27ac8733454e0a3a9a9e2f24a43f600f60a414400419287fe147649a7a1f
4
- data.tar.gz: 1a4e7b41949419befd15479d0373bf3c316e22c62a6796c6453db6c3467f2b5d
3
+ metadata.gz: c0fb30da3097b44521e7c3fe12d6e061f7d4f64d9faa3c1239c22a8e76b629e5
4
+ data.tar.gz: 7cc5c141bd3833d11efb95ab25dd7649666ee6398efb3c01d95dc7cd8a220802
5
5
  SHA512:
6
- metadata.gz: 5fce60c859d8b361973c52a9e4d0a4e18908a7978d938a91c0e50125d64db3a5d704a9cc7f6ad8d17fb7f242bed3f31bb5df2107459d9fdacc57afae9f8df53e
7
- data.tar.gz: 2c8a8e5f3653125cb719d6aeb7f46642643b561702824a4fcdd404dd40bcdf3ae362ca5cda5323b97f6da521dc555677d8f5139774a12ef9b2f599539b08850e
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, 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.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"