getting some sof output and adding some tests. issues though. abound
This commit is contained in:
@ -19,7 +19,11 @@ module Virtual
|
||||
@codes = []
|
||||
end
|
||||
|
||||
attr_reader :name , :next , :codes , :method
|
||||
def attributes
|
||||
[:name , :codes , :branch]
|
||||
end
|
||||
|
||||
attr_reader :name , :codes , :method
|
||||
attr_accessor :branch
|
||||
|
||||
def reachable ret = []
|
||||
|
@ -12,7 +12,7 @@ module Virtual
|
||||
# This is partly because jumping over this layer and doing in straight in assember was too big a step
|
||||
class Instruction < Virtual::Object
|
||||
|
||||
# simple thought: don't recurse for labels, just check their names
|
||||
# simple thought: don't recurse for Blocks, just check their names
|
||||
def == other
|
||||
return false unless other.class == self.class
|
||||
attributes.each do |a|
|
||||
@ -27,7 +27,9 @@ module Virtual
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
def attributes
|
||||
[]
|
||||
end
|
||||
end
|
||||
|
||||
module Named
|
||||
|
@ -35,7 +35,7 @@ module Virtual
|
||||
MethodDefinition.new(:main , [] , Virtual::SelfReference )
|
||||
end
|
||||
def attributes
|
||||
[:name , :args , :receiver , :return_type , :start]
|
||||
[:name , :args , :receiver , :return_type , :blocks]
|
||||
end
|
||||
def initialize name , args , receiver = Virtual::SelfReference.new , return_type = Virtual::Mystery , start = MethodEnter.new()
|
||||
@name = name.to_sym
|
||||
|
Reference in New Issue
Block a user