rubyx/lib/vool/statements/block_statement.rb

30 lines
524 B
Ruby
Raw Normal View History

2018-06-26 19:28:27 +02:00
module Vool
class BlockStatement < Statement
attr_reader :args , :body , :clazz
def initialize( args , body , clazz = nil)
@args , @body = args , body
raise "no bod" unless @body
@clazz = clazz
end
def to_mom( _ )
raise "should not be called (call create_objects)"
end
def each(&block)
block.call(self)
@body.each(&block)
end
def normalize
BlockStatement.new( @args , @body.normalize)
end
def create_objects(clazz)
end
end
end