Sha256: 4dd2ef7a38832da0006d35917617073978b28dd39ae2a95fd589e1f6015073bb

Contents?: true

Size: 1.03 KB

Versions: 2

Compression:

Stored size: 1.03 KB

Contents

#! /usr/bin/env ruby

require_relative '../lib/haxor'
require 'optparse'

parser = OptionParser.new do |opts|
  opts.banner = 'Usage: hcc [options] [file.hax]'

  opts.on_tail('-h', '--help', 'Show this message') do
    puts opts
    exit
  end

  opts.on_tail('-v', '--version', 'Show version') do
    puts "Haxor, version #{Haxor::Consts::GEM_VERSION}, version id #{Haxor::Consts::VERSION}."
    exit
  end
end

parser.parse!

if ARGV.empty?
  puts 'You must specify .hax file to be compiled.'
  puts parser
  exit
end

source = File.absolute_path ARGV[0]

compiler = Haxor::Compiler::Core.new
compiler.register_unit Haxor::Compiler::Component::Arithmetic.new
compiler.register_unit Haxor::Compiler::Component::Data.new
compiler.register_unit Haxor::Compiler::Component::Jumps.new
compiler.register_unit Haxor::Compiler::Component::Logical.new
compiler.register_unit Haxor::Compiler::Component::Other.new
compiler.register_unit Haxor::Compiler::Component::Transfer.new
compiler.register_unit Haxor::Compiler::Component::Various.new

compiler.compile source

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
haxor-0.3.0 bin/hcc
haxor-0.2.0 bin/hcc