rubyx/lib/ruby/send_statement.rb
Torsten Rüger 57b0ad2c32 Fix super as statement
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
2019-08-19 18:48:13 +03:00

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