Class: RuboCop::AST::NodePattern::Lexer

Inherits:
LexerRex
  • Object
show all
Defined in:
lib/rubocop/ast/node_pattern/lexer.rb

Overview

Lexer class for ‘NodePattern`

Doc on how this fits in the compiling process:

/docs/modules/ROOT/pages/node_pattern.adoc

Direct Known Subclasses

Parser::WithMeta::Lexer

Constant Summary collapse

Error =
ScanError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source) ⇒ Lexer

Returns a new instance of Lexer.



31
32
33
34
35
# File 'lib/rubocop/ast/node_pattern/lexer.rb', line 31

def initialize(source)
  @tokens = []
  super()
  parse(source)
end

Instance Attribute Details

#commentsObject (readonly)

Returns the value of attribute comments.



29
30
31
# File 'lib/rubocop/ast/node_pattern/lexer.rb', line 29

def comments
  @comments
end

#source_bufferObject (readonly)

Returns the value of attribute source_buffer.



29
30
31
# File 'lib/rubocop/ast/node_pattern/lexer.rb', line 29

def source_buffer
  @source_buffer
end

#tokensObject (readonly)

Returns the value of attribute tokens.



29
30
31
# File 'lib/rubocop/ast/node_pattern/lexer.rb', line 29

def tokens
  @tokens
end