Method: RuboCop::AST::NodePattern::Parser::WithMeta::Lexer#initialize

Defined in:
lib/rubocop/ast/node_pattern/with_meta.rb

#initialize(str_or_buffer) ⇒ Lexer

Returns a new instance of Lexer.



13
14
15
16
17
18
19
20
21
# File 'lib/rubocop/ast/node_pattern/with_meta.rb', line 13

def initialize(str_or_buffer)
  @source_buffer = if str_or_buffer.respond_to?(:source)
                     str_or_buffer
                   else
                     ::Parser::Source::Buffer.new('(string)', source: str_or_buffer)
                   end
  @comments = []
  super(@source_buffer.source)
end