diff options
Diffstat (limited to 'tools/genruby.rb')
-rwxr-xr-x | tools/genruby.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/genruby.rb b/tools/genruby.rb index 2315da0..58e5f91 100755 --- a/tools/genruby.rb +++ b/tools/genruby.rb @@ -169,6 +169,13 @@ def gen_enums path, indent elsif v.nil? h[s]=i i+=1 + elsif v=~/\|/ + els = v.gsub(/[\(\)]/,'').split(/\|/) + puts h.inspect + puts els.inspect + v = els.inject('') { |s,e| s+="#{h[e]}|" }[0..-2] + h[s]=v + i=eval(v).to_i+1 else h[s]=v i=eval(v).to_i+1 |