move type to phial and add type to reg_ref
This commit is contained in:
@ -13,25 +13,26 @@ module Phisol
|
||||
|
||||
def on_int statement
|
||||
int = statement.first
|
||||
to = Virtual::Return.new(Virtual::Integer , int)
|
||||
# reg =
|
||||
to = Virtual::Return.new(Phisol::Integer , int)
|
||||
@method.source.add_code Virtual::Set.new( int , to )
|
||||
to
|
||||
end
|
||||
|
||||
def on_true statement
|
||||
to = Virtual::Return.new(Virtual::Reference , true )
|
||||
to = Virtual::Return.new(Phisol::Reference , true )
|
||||
@method.source.add_code Virtual::Set.new( true , to )
|
||||
to
|
||||
end
|
||||
|
||||
def on_false statement
|
||||
to = Virtual::Return.new(Virtual::Reference , false)
|
||||
to = Virtual::Return.new(Phisol::Reference , false)
|
||||
@method.source.add_code Virtual::Set.new( false , to )
|
||||
to
|
||||
end
|
||||
|
||||
def on_nil statement
|
||||
to = Virtual::Return.new(Virtual::Reference , nil)
|
||||
to = Virtual::Return.new(Phisol::Reference , nil)
|
||||
@method.source.add_code Virtual::Set.new( nil , to )
|
||||
to
|
||||
end
|
||||
@ -39,7 +40,7 @@ module Phisol
|
||||
def on_string statement
|
||||
# Clearly a TODO here to implement strings rather than reusing symbols
|
||||
value = statement.first.to_sym
|
||||
to = Virtual::Return.new(Virtual::Reference , value)
|
||||
to = Virtual::Return.new(Phisol::Reference , value)
|
||||
@method.source.constants << value
|
||||
@method.source.add_code Virtual::Set.new( value , to )
|
||||
to
|
||||
|
@ -7,7 +7,7 @@ module Phisol
|
||||
# whichever way this goes the result is stored in the return slot (as all compiles)
|
||||
def on_name statement
|
||||
name = statement.to_a.first
|
||||
return Virtual::Self.new( Virtual::Reference.new(@clazz)) if name == :self
|
||||
return Virtual::Self.new( Phisol::Reference.new(@clazz)) if name == :self
|
||||
# either an argument, so it's stored in message
|
||||
if( index = @method.has_arg(name))
|
||||
type = @method.arguments[index].type
|
||||
|
@ -8,8 +8,8 @@ module Phisol
|
||||
right_slot = process(right_e)
|
||||
puts "left #{left_slot}"
|
||||
puts "right #{right_slot}"
|
||||
tmp1 = use_reg
|
||||
tmp2 = use_reg
|
||||
tmp1 = use_reg :int
|
||||
tmp2 = use_reg :int
|
||||
get = Register.get_slot_to(statement , left_slot , tmp1 )
|
||||
get2 = Register.get_slot_to(statement , right_slot , tmp2 )
|
||||
puts "GET #{get}"
|
||||
|
Reference in New Issue
Block a user