class SyntaxTree::YARV::Assembler::ObjectVisitor

Public Instance Methods

visit_dyna_symbol(node) click to toggle source
# File lib/syntax_tree/yarv/assembler.rb, line 7
def visit_dyna_symbol(node)
  if node.parts.empty?
    :""
  else
    raise CompilationError
  end
end
visit_string_literal(node) click to toggle source
# File lib/syntax_tree/yarv/assembler.rb, line 15
def visit_string_literal(node)
  case node.parts.length
  when 0
    ""
  when 1
    raise CompilationError unless node.parts.first.is_a?(TStringContent)
    node.parts.first.value
  else
    raise CompilationError
  end
end