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

Constants inherited from LexerRex

RuboCop::AST::NodePattern::LexerRex::CALL, RuboCop::AST::NodePattern::LexerRex::CONST_NAME, RuboCop::AST::NodePattern::LexerRex::IDENTIFIER, RuboCop::AST::NodePattern::LexerRex::NODE_TYPE, RuboCop::AST::NodePattern::LexerRex::REGEXP, RuboCop::AST::NodePattern::LexerRex::REGEXP_BODY, RuboCop::AST::NodePattern::LexerRex::SYMBOL_NAME

Instance Attribute Summary collapse

Attributes inherited from LexerRex

#filename, #ss, #state

Instance Method Summary collapse

Methods inherited from LexerRex

#action, #location, #matches, #next_token, #parse, #parse_file, #scanner_class

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