combining sources at vool level

using ScopeStatements
(those unfortunately don't go to_mom)
This commit is contained in:
Torsten Ruger
2018-11-02 12:36:23 -07:00
parent 52f6f1eaa8
commit 1377bda641
2 changed files with 30 additions and 8 deletions

View File

@ -83,7 +83,14 @@ module RubyX
# ruby_to_vool compiles the ruby to ast, and then to vool
def ruby_to_vool(ruby_source)
ruby_tree = Ruby::RubyCompiler.compile( ruby_source )
@vool = ruby_tree.to_vool
unless(@vool)
@vool = ruby_tree.to_vool
return @vool
end
unless(@vool.is_a?(Vool::ScopeStatement))
@vool = Vool::ScopeStatement.new([@vool])
end
@vool << ruby_tree.to_vool
end