minor housekeeping
This commit is contained in:
parent
5b95319191
commit
e33a20dd41
@ -13,7 +13,7 @@ module Register
|
|||||||
class RegisterTransfer < Instruction
|
class RegisterTransfer < Instruction
|
||||||
# initialize with from and to registers.
|
# initialize with from and to registers.
|
||||||
# First argument from
|
# First argument from
|
||||||
# second arguemnt to
|
# second argument to
|
||||||
#
|
#
|
||||||
# Note: this may be reversed from some assembler notations (also arm)
|
# Note: this may be reversed from some assembler notations (also arm)
|
||||||
def initialize source , from , to
|
def initialize source , from , to
|
||||||
|
@ -4,11 +4,14 @@ require 'parslet/convenience'
|
|||||||
module CompilerHelper
|
module CompilerHelper
|
||||||
|
|
||||||
Phisol::Compiler.class_eval do
|
Phisol::Compiler.class_eval do
|
||||||
def set_main
|
def set_main main
|
||||||
@clazz = Virtual.machine.space.get_class_by_name :Object
|
@clazz = Virtual.machine.space.get_class_by_name :Object
|
||||||
@method = Virtual.machine.space.get_main
|
@method = main
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
def set_main compiler
|
||||||
|
compiler.set_main Virtual.machine.space.get_main
|
||||||
|
end
|
||||||
def check
|
def check
|
||||||
machine = Virtual.machine
|
machine = Virtual.machine
|
||||||
machine.boot unless machine.booted
|
machine.boot unless machine.booted
|
||||||
@ -18,7 +21,7 @@ module CompilerHelper
|
|||||||
parts = Parser::Transform.new.apply(syntax)
|
parts = Parser::Transform.new.apply(syntax)
|
||||||
#puts parts.inspect
|
#puts parts.inspect
|
||||||
compiler = Phisol::Compiler.new
|
compiler = Phisol::Compiler.new
|
||||||
compiler.set_main
|
set_main(compiler)
|
||||||
produced = compiler.process( parts )
|
produced = compiler.process( parts )
|
||||||
assert @output , "No output given"
|
assert @output , "No output given"
|
||||||
assert_equal produced.class, @output , "Wrong class"
|
assert_equal produced.class, @output , "Wrong class"
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
require_relative "test_basic"
|
require_relative "test_basic"
|
||||||
|
require_relative "test_call"
|
||||||
require_relative "test_compiler"
|
require_relative "test_compiler"
|
||||||
require_relative "test_field_access"
|
require_relative "test_field_access"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
require_relative "compiler_helper"
|
require_relative "../helper"
|
||||||
|
|
||||||
class HelloTest < MiniTest::Test
|
class HelloTest < MiniTest::Test
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user