Class: RuboCop::AST::NodePattern::Lexer
- 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
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
-
#comments ⇒ Object
readonly
Returns the value of attribute comments.
-
#source_buffer ⇒ Object
readonly
Returns the value of attribute source_buffer.
-
#tokens ⇒ Object
readonly
Returns the value of attribute tokens.
Attributes inherited from LexerRex
Instance Method Summary collapse
-
#initialize(source) ⇒ Lexer
constructor
A new instance of Lexer.
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
#comments ⇒ Object (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_buffer ⇒ Object (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 |
#tokens ⇒ Object (readonly)
Returns the value of attribute tokens.
29 30 31 |
# File 'lib/rubocop/ast/node_pattern/lexer.rb', line 29 def tokens @tokens end |