class Opal::AST::Matcher

def cap(capture)

def cap(capture)
  Node.new(:capture, [capture])
end

def initialize(&block)

def initialize(&block)
  @root = instance_exec(&block)
end

def inspect

def inspect
  "#<Opal::AST::Matcher: #{@root.inspect}>"
end

def match(ast)

def match(ast)
  @captures = []
  @root.match(ast, self) || (return false)
  @captures
end

def s(type, *children)

def s(type, *children)
  Node.new(type, children)
end