2018-07-19 13:46:51 +02:00
|
|
|
module Ruby
|
2018-09-01 14:54:25 +02:00
|
|
|
# Send and yield are very very similar, so they have a base class CallStatement
|
|
|
|
#
|
|
|
|
# The SendStatement really only provides to_s, so see CallStatement
|
|
|
|
#
|
2018-07-30 13:44:14 +02:00
|
|
|
class SendStatement < CallStatement
|
2019-08-25 13:40:59 +02:00
|
|
|
|
|
|
|
def to_vool
|
|
|
|
return super unless @receiver.is_a?(ModuleName) and @receiver.name == :X
|
|
|
|
args = @arguments.collect { |arg| arg.to_vool }
|
|
|
|
Vool::MacroExpression.new(name , args)
|
|
|
|
end
|
2019-08-16 13:09:56 +02:00
|
|
|
def to_s(depth = 0)
|
|
|
|
at_depth( depth , "#{receiver}.#{name}(#{arguments.join(', ')})")
|
2018-07-19 13:46:51 +02:00
|
|
|
end
|
|
|
|
end
|
2019-08-19 17:48:13 +02:00
|
|
|
class SuperStatement < SendStatement
|
|
|
|
def initialize(args)
|
|
|
|
super(:super , SelfExpression.new , args)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2018-07-19 13:46:51 +02:00
|
|
|
end
|