rubyx/lib/vm/tree/assignment.rb
Torsten Ruger f9824079d6 splitting assignment into three, for args, locals and ivars
The decision on which is moving up to the ruby  compiler, so it can at
the same time emit the correct assignment form.
Just another example of moving away from a language and to an
intermediate form (that has no language equivalent)
2017-01-15 13:01:28 +02:00

31 lines
460 B
Ruby

module Vm
module Tree
class Assignment < Statement
attr_accessor :name , :value
def initialize(name , value = nil )
@name , @value = name , value
end
def to_s
"#{name} = #{value}\n"
end
end
class IvarAssignment < Assignment
def to_s
"@#{name} = #{value}\n"
end
end
class ArgAssignment < Assignment
end
class LocalAssignment < Assignment
end
end
end