fix module handling at ruby level

Was returning arrays instead of Statements, which messed things up
This commit is contained in:
2019-09-06 21:00:37 +03:00
parent 646797301e
commit 363d1cb36f
5 changed files with 29 additions and 13 deletions

View File

@ -2,7 +2,8 @@ module Ruby
class Statements < Statement
attr_reader :statements
def initialize(statements)
@statements = statements
@statements = []
statements.each{|st| self << st}
end
def empty?
@ -30,6 +31,7 @@ module Ruby
@statements[i]
end
def <<(o)
raise "Not Statement #{o.class}=#{o.to_s[0..100]}" unless o.is_a?(Statement)
@statements << o
self
end