Torsten Rüger
57b0ad2c32
Super is a statement, a send really. Not an expression (as maybe in c++) The actual implementation will be a bit tricky, like raise, a bit of stack walking, but not impossible. Still, later
18 lines
451 B
Ruby
18 lines
451 B
Ruby
module Ruby
|
|
# Send and yield are very very similar, so they have a base class CallStatement
|
|
#
|
|
# The SendStatement really only provides to_s, so see CallStatement
|
|
#
|
|
class SendStatement < CallStatement
|
|
def to_s(depth = 0)
|
|
at_depth( depth , "#{receiver}.#{name}(#{arguments.join(', ')})")
|
|
end
|
|
end
|
|
class SuperStatement < SendStatement
|
|
def initialize(args)
|
|
super(:super , SelfExpression.new , args)
|
|
end
|
|
end
|
|
|
|
end
|