own statements class for mom
so we don’t have to deal with arrays (as a special case) and use method sending as is good oo
This commit is contained in:
@ -1,33 +1,13 @@
|
||||
module Vool
|
||||
class Statements < Statement
|
||||
attr_reader :statements
|
||||
def initialize(statements)
|
||||
@statements = statements
|
||||
end
|
||||
include Common::Statements
|
||||
|
||||
# create machine instructions
|
||||
def to_mom( method )
|
||||
@statements.collect do |statement|
|
||||
all = @statements.collect do |statement|
|
||||
statement.to_mom( method )
|
||||
end
|
||||
end
|
||||
|
||||
def empty?
|
||||
@statements.empty?
|
||||
end
|
||||
def single?
|
||||
@statements.length == 1
|
||||
end
|
||||
def first
|
||||
@statements.first
|
||||
end
|
||||
def length
|
||||
@statements.length
|
||||
end
|
||||
|
||||
def collect(arr)
|
||||
@statements.each { |s| s.collect(arr) }
|
||||
super
|
||||
Mom::Statements.new(all)
|
||||
end
|
||||
|
||||
def create_objects
|
||||
|
Reference in New Issue
Block a user