getting to where where the puts should be, but it aint there
This commit is contained in:
@ -3,7 +3,7 @@ module Ast
|
||||
# attr_reader :name, :params, :body , :receiver
|
||||
def compile method , message
|
||||
args = params.collect do |p|
|
||||
raise "error, arguemnt must be a identifier, not #{p}" unless p.is_a? NameExpression
|
||||
raise "error, argument must be a identifier, not #{p}" unless p.is_a? NameExpression
|
||||
p.name
|
||||
end
|
||||
r = receiver ? receiver.compile(method,message) : Virtual::Self.new()
|
||||
|
@ -6,9 +6,20 @@ module Trickle
|
||||
def run block
|
||||
block.codes.dup.each do |code|
|
||||
next unless code.is_a? Virtual::MessageSend
|
||||
puts "Found me a send #{code.me.type}"
|
||||
if( code.me.type == Virtual::Reference)
|
||||
next
|
||||
me = code.me
|
||||
next unless ( me.type == Virtual::Reference)
|
||||
if( me.is_a? Virtual::Constant)
|
||||
Boot::BootClass
|
||||
if( me.is_a? Boot::BootClass )
|
||||
raise "unimplemented"
|
||||
elsif( me.is_a? Virtual::ObjectConstant )
|
||||
clazz = me.clazz
|
||||
method = clazz.get_method_definition code.name
|
||||
puts "Found me a method #{method}"
|
||||
raise "Method not implemented #{clazz.name}.#{code.name}" unless method
|
||||
else
|
||||
raise "unimplemented"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -15,6 +15,9 @@ module Virtual
|
||||
def type
|
||||
Virtual::Reference
|
||||
end
|
||||
def claszz
|
||||
raise "abstract #{self}"
|
||||
end
|
||||
end
|
||||
|
||||
class IntegerConstant < Constant
|
||||
@ -40,6 +43,9 @@ module Virtual
|
||||
def result= value
|
||||
class_for(MoveInstruction).new(value , self , :opcode => :mov)
|
||||
end
|
||||
def clazz
|
||||
Object.space.get_or_create_class(:String)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
@ -25,7 +25,7 @@ module Virtual
|
||||
end
|
||||
|
||||
def inspect
|
||||
to_yaml
|
||||
Sof::Writer.write(self)
|
||||
end
|
||||
|
||||
def self.space
|
||||
|
Reference in New Issue
Block a user