bin/hvm in haxor-0.3.0 vs bin/hvm in haxor-0.4.0
- old
+ new
@@ -24,13 +24,18 @@
puts 'You must specify .hax.e file to be run.'
puts parser
exit
end
-vm = Haxor::Vm::Core.new
+begin
+ vm = Haxor::Vm::Core.new
-filename = ARGV[0]
-# make life easier ;)
-filename += '.e' if filename.end_with? '.hax'
+ filename = ARGV[0]
+ # make life easier ;)
+ filename += '.e' if filename.end_with? '.hax'
-vm.load_program filename
-vm.execute
+ vm.load_program filename
+ vm.execute
+rescue => e
+ puts "An error occurred: #{e}."
+ exit 1
+end