class RuboCop::AST::NodePattern::Parser

def parse(source)

Returns:
  • (NodePattern::Node) -

Parameters:
  • source_buffer (Parser::Source::Buffer, String) -- The source buffer to parse.
def parse(source)
  @lexer = self.class::Lexer.new(source)
  do_parse
rescue Lexer::Error => e
  raise NodePattern::Invalid, e.message
ensure
  @lexer = nil # Don't keep references
end