2017-09-06 11:33:46 +02:00
|
|
|
module Mom
|
|
|
|
class Statements < Statement
|
|
|
|
include Common::Statements
|
|
|
|
|
2018-03-12 13:43:07 +01:00
|
|
|
def flatten( options = {} )
|
|
|
|
flat = @statements.shift.flatten(options)
|
|
|
|
while( nekst = @statements.shift )
|
|
|
|
flat.append nekst.flatten(options)
|
2017-09-08 12:12:24 +02:00
|
|
|
end
|
|
|
|
flat
|
2017-09-06 11:33:46 +02:00
|
|
|
end
|
2017-09-08 12:12:24 +02:00
|
|
|
|
2018-03-13 11:46:06 +01:00
|
|
|
def initialize(arr)
|
|
|
|
super(arr)
|
|
|
|
arr.each {|s|
|
|
|
|
raise "Not a Statement #{s}" unless s.is_a?( Statement) or s.is_a?(Instruction)
|
|
|
|
}
|
|
|
|
end
|
2017-09-06 11:33:46 +02:00
|
|
|
end
|
|
|
|
end
|