cddlc 0.1.0 → 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: 119d5084051bfbc6889d6a9b36e22308cbb580c9d71b738e4c99ea2f908496cb
4
- data.tar.gz: 33fafda14412916c5883260cb64bea2793785e359d833e6d9cee37cf76260186
3
+ metadata.gz: ed5e9bd6c8caace67d29c6549fd30d59fc2c17c06b671f63868d2ecb6ea0031b
4
+ data.tar.gz: 03d6d40e1ebf19da17117ca725ba09c60c33867606953d2566fd86ace2805e9a
5
5
  SHA512:
6
- metadata.gz: c5936c13d4bca770fbcd628851f14a604e27a95e5c1c76329eb81932e7d9c7e72edf898d4989176baffa1d99a88f827e981fad338bb731560eb5547dba69342b
7
- data.tar.gz: d3fe1f230d47841385cc12dd7cf3092c0feae0326ca6889eefb889ceb55903cac6919075cfaf2879961c185adf695df218cb2e1df418a781e6098bf4269d4d49
6
+ metadata.gz: 2b1790d8845935f61f7c12070dbb95f223a6e1914c813dbf85e4ae3979b1fbcbf37abd5730a3a471c1a5777464a8fc966d36835e20df41d3e19a17203e0969f8
7
+ data.tar.gz: f0884c20358c0a7edaf9df050c79d93f3df7dfb42ceb44ee59b3cc0cb8f318a5ad5efa08964dd259d3a211dd6bcc8a1b2eed5f636cae4ca5a80b524c3a40fdab
data/bin/cddlc CHANGED
@@ -58,6 +58,9 @@ begin
58
58
  opts.on("-u", "--[no-]undefined", "Note undefined names") do |v|
59
59
  $options.note_undefined = v
60
60
  end
61
+ opts.on("-2", "--[no-]cddl2", "Perform some CDDL 2.0 processing") do |v|
62
+ $options.cddl2 = v
63
+ end
61
64
  opts.on("-tFMT", "--to=FMT", [:basic, :neat, :json, :yaml, :enum, :cddl], "Target format") do |v|
62
65
  $options.target = v
63
66
  end
@@ -116,32 +119,10 @@ when :enum
116
119
  when :cddl
117
120
  require_relative '../lib/writer/cddl-writer.rb'
118
121
  if $options.note_undefined
119
- require_relative "../lib/processor/cddl-visitor.rb"
120
- used = {}
121
- gen_used = {}
122
- def_gen = {}
123
- cddl.rules.each do |k, v|
124
- def_gen[k[0]] = true if Array === k
125
- cddl.visit(v) do |p, &block|
126
- case p
127
- in ["gen", name, *_gen_args]
128
- gen_used[name] = true
129
- in ["name", name]
130
- used[name] = true
131
- else
132
- false
133
- end
134
- end
135
- end
136
- used.each do |k, v|
137
- unless cddl.rules[k] || cddl.prelude.rules[k]
138
- puts ";;; *** undefined: #{k}"
139
- end
140
- end
141
- gen_used.each do |k, v|
142
- unless def_gen[k]
143
- puts ";;; *** undefined: #{k}<>"
144
- end
122
+ require_relative '../lib/processor/cddl-undefined.rb'
123
+ undef_rule = cddl.cddl_undefined
124
+ undef_rule.each do |k|
125
+ puts ";;; *** undefined: #{k}"
145
126
  end
146
127
  end
147
128
  puts cddl.to_s
data/cddlc.gemspec CHANGED
@@ -1,13 +1,13 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "cddlc"
3
- s.version = "0.1.0"
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"
7
7
  s.email = "cabo@tzi.org"
8
8
  s.license = "MIT"
9
9
  s.homepage = "http://github.com/cabo/cddlc"
10
- s.files = Dir['lib/**/*.rb'] + %w(cddlc.gemspec data/prelude.cddl) + Dir['bin/**/*.rb']
10
+ s.files = Dir['lib/**/*.rb'] + %w(cddlc.gemspec) + Dir['data/*.cddl'] + Dir['bin/**/*.rb']
11
11
  s.executables = Dir['bin/*'].map {|x| File.basename(x)}
12
12
  s.required_ruby_version = '>= 1.9.2'
13
13