slight rename tremours
This commit is contained in:
parent
1ff7ae2b0a
commit
4185758532
@ -17,7 +17,7 @@ module Virtual
|
|||||||
def attributes
|
def attributes
|
||||||
[:name , :args , :receiver , :return_type , :start]
|
[:name , :args , :receiver , :return_type , :start]
|
||||||
end
|
end
|
||||||
def initialize name , args , receiver = Virtual::SelfReference.new , return_type = Virtual::Mystery , start = MethodDefinitionEnter.new
|
def initialize name , args , receiver = Virtual::SelfReference.new , return_type = Virtual::Mystery , start = MethodEnter.new
|
||||||
@name = name.to_sym
|
@name = name.to_sym
|
||||||
@args = args
|
@args = args
|
||||||
@locals = []
|
@locals = []
|
||||||
@ -28,7 +28,7 @@ module Virtual
|
|||||||
@current = @start
|
@current = @start
|
||||||
end
|
end
|
||||||
attr_reader :name , :args , :receiver , :start
|
attr_reader :name , :args , :receiver , :start
|
||||||
attr_accessor :return_type
|
attr_accessor :return_type , :current
|
||||||
|
|
||||||
def add instruction
|
def add instruction
|
||||||
raise instruction.inspect unless instruction.is_a? Instruction
|
raise instruction.inspect unless instruction.is_a? Instruction
|
||||||
|
@ -9,7 +9,7 @@ def foo(x)
|
|||||||
5
|
5
|
||||||
end
|
end
|
||||||
HERE
|
HERE
|
||||||
@output = [Virtual::MethodDefinition.new(:foo,[Virtual::Argument.new(:x,Virtual::Mystery.new())],Virtual::SelfReference.new(nil),Virtual::IntegerConstant.new(5),Virtual::MethodDefinitionEnter.new(nil))]
|
@output = [Virtual::MethodDefinition.new(:foo,[Virtual::Argument.new(:x,Virtual::Mystery.new())],Virtual::SelfReference.new(nil),Virtual::IntegerConstant.new(5),Virtual::MethodEnter.new(nil))]
|
||||||
check
|
check
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ def String.length(x)
|
|||||||
@length
|
@length
|
||||||
end
|
end
|
||||||
HERE
|
HERE
|
||||||
@output = [Virtual::MethodDefinition.new(:length,[Virtual::Argument.new(:x,Virtual::Mystery.new())],Boot::BootClass.new(:String,:Object),Virtual::Return.new(Virtual::Mystery.new()),Virtual::MethodDefinitionEnter.new(Virtual::ObjectGet.new(:length,nil)))]
|
@output = [Virtual::MethodDefinition.new(:length,[Virtual::Argument.new(:x,Virtual::Mystery.new())],Boot::BootClass.new(:String,:Object),Virtual::Return.new(Virtual::Mystery.new()),Virtual::MethodEnter.new(Virtual::ObjectGet.new(:length,nil)))]
|
||||||
check
|
check
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -30,7 +30,7 @@ def foo(x)
|
|||||||
2 + 5
|
2 + 5
|
||||||
end
|
end
|
||||||
HERE
|
HERE
|
||||||
@output = [Virtual::MethodDefinition.new(:foo,[Virtual::Argument.new(:x,Virtual::Mystery.new())],Virtual::SelfReference.new(nil),Virtual::Return.new(Virtual::Mystery),Virtual::MethodDefinitionEnter.new(Virtual::FrameSet.new(:abba,Virtual::IntegerConstant.new(5),Virtual::LoadSelf.new(Virtual::IntegerConstant.new(2),Virtual::FrameSend.new(:+,[Virtual::IntegerConstant.new(5)],nil)))))]
|
@output = [Virtual::MethodDefinition.new(:foo,[Virtual::Argument.new(:x,Virtual::Mystery.new())],Virtual::SelfReference.new(nil),Virtual::Return.new(Virtual::Mystery),Virtual::MethodEnter.new(Virtual::FrameSet.new(:abba,Virtual::IntegerConstant.new(5),Virtual::LoadSelf.new(Virtual::IntegerConstant.new(2),Virtual::FrameSend.new(:+,[Virtual::IntegerConstant.new(5)],nil)))))]
|
||||||
check
|
check
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -40,7 +40,7 @@ def foo()
|
|||||||
2 + 5
|
2 + 5
|
||||||
end
|
end
|
||||||
HERE
|
HERE
|
||||||
@output = [Virtual::MethodDefinition.new(:foo,[],Virtual::SelfReference.new(nil),Virtual::Return.new(Virtual::Mystery),Virtual::MethodDefinitionEnter.new(Virtual::LoadSelf.new(Virtual::IntegerConstant.new(2),Virtual::FrameSend.new(:+,[Virtual::IntegerConstant.new(5)],nil))))]
|
@output = [Virtual::MethodDefinition.new(:foo,[],Virtual::SelfReference.new(nil),Virtual::Return.new(Virtual::Mystery),Virtual::MethodEnter.new(Virtual::LoadSelf.new(Virtual::IntegerConstant.new(2),Virtual::FrameSend.new(:+,[Virtual::IntegerConstant.new(5)],nil))))]
|
||||||
check
|
check
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user