Class: Riml::Compiler::StringLiteralConcatNodeVisitor

Inherits:
Visitor
  • Object
show all
Defined in:
lib/compiler.rb

Instance Method Summary collapse

Methods inherited from Visitor

#initialize, #visit

Constructor Details

This class inherits a constructor from Riml::Compiler::Visitor

Instance Method Details

#compile(nodes) ⇒ Object



218
219
220
221
222
223
224
225
226
227
# File 'lib/compiler.rb', line 218

def compile(nodes)
  nodes.each_with_index do |node, i|
    visitor = visitor_for_node(node)
    node.parent_node = nodes
    next_node = nodes.nodes[i+1]
    node.accept(visitor)
    nodes.compiled_output << ' ' if next_node
  end
  nodes.compiled_output
end