Class: Riml::Compiler::ElseifNodeVisitor

Inherits:
Visitor
  • Object
show all
Defined in:
lib/riml/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(node) ⇒ Object



137
138
139
140
141
142
143
144
145
146
# File 'lib/riml/compiler.rb', line 137

def compile(node)
  node.compiled_output = "elseif "
  node.condition.parent_node = node
  node.condition.force_newline = true
  node.condition.accept(visitor_for_node(node.condition))
  node.expressions.parent_node = node
  node.expressions.accept(visitor_for_node(node.expressions))
  node.force_newline = true
  node.compiled_output
end