summaryrefslogtreecommitdiff
path: root/tool/insns2vm.rb
diff options
context:
space:
mode:
Diffstat (limited to 'tool/insns2vm.rb')
-rwxr-xr-xtool/insns2vm.rb15
1 files changed, 5 insertions, 10 deletions
diff --git a/tool/insns2vm.rb b/tool/insns2vm.rb
index ecbbb52..e6fe64d 100755
--- a/tool/insns2vm.rb
+++ b/tool/insns2vm.rb
@@ -3,16 +3,11 @@
# This is used by Makefile.in to generate .inc files.
# See Makefile.in for details.
-require 'optparse'
-
-Version = %w$Revision: 11626 $[1..-1]
-
-require "#{File.join(File.dirname(__FILE__), 'instruction')}"
+require_relative 'ruby_vm/scripts/insns2vm'
if $0 == __FILE__
- opts = ARGV.options
- maker = RubyVM::SourceCodeGenerator.def_options(opts)
- files = opts.parse!
- generator = maker.call
- generator.generate(files)
+ router(ARGV).each do |(path, generator)|
+ str = generator.generate path
+ path.write str, mode: 'wb:utf-8'
+ end
end