Class: Riml::Compiler::CatchNodeVisitor

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

regexp, block



694
695
696
697
698
699
700
701
702
703
704
705
706
# File 'lib/riml/compiler.rb', line 694

def compile(node)
  regexp, exprs = node.regexp, node.expressions
  node.compiled_output = "catch"
  exprs.parent_node = node
  if regexp
    regexp.parent_node = node
    node.compiled_output << " "
    regexp.accept(visitor_for_node(regexp))
  end
  node.compiled_output << "\n"
  exprs.accept(visitor_for_node(exprs))
  node.compiled_output
end