passing values to macros
conceptually still a bit open, leaving the hack in for now passing values to the macro instead of sol instances
This commit is contained in:
@ -9,7 +9,22 @@ module Sol
|
||||
def to_slot(compiler)
|
||||
parts = name.to_s.split("_")
|
||||
class_name = "SlotMachine::#{parts.collect{|s| s.capitalize}.join}"
|
||||
eval(class_name).new( self , *arguments)
|
||||
# Hmm, slightly open issue how to pass args from sol to macro
|
||||
# WIP, hack for comparison
|
||||
args = arguments.collect {|arg|
|
||||
case arg
|
||||
when Sol::SymbolConstant
|
||||
arg.value
|
||||
when Sol::IntegerConstant
|
||||
arg.value
|
||||
when Sol::LocalVariable
|
||||
arg.name
|
||||
else
|
||||
puts "unhandled #{arg}:#{arg.class}"
|
||||
arg
|
||||
end
|
||||
}
|
||||
eval(class_name).new( self , *args)
|
||||
end
|
||||
|
||||
# When used as right hand side, this tells what data to move to get the result into
|
||||
|
Reference in New Issue
Block a user