Class: RuboCop::AST::NodePattern::Parser::WithMeta

Inherits:
RuboCop::AST::NodePattern::Parser show all
Defined in:
lib/rubocop/ast/node_pattern/with_meta.rb

Overview

Overrides Parser to use ‘WithMeta` variants and provide additional methods

Defined Under Namespace

Classes: Builder, Lexer

Constant Summary

Constants inherited from RuboCop::AST::NodePattern::Parser

Builder, Lexer

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from RuboCop::AST::NodePattern::Parser

#initialize, #inspect, #parse

Methods included from SimpleForwardable

#def_delegators

Constructor Details

This class inherits a constructor from RuboCop::AST::NodePattern::Parser

Instance Attribute Details

#commentsObject (readonly)

Returns the value of attribute comments.



98
99
100
# File 'lib/rubocop/ast/node_pattern/with_meta.rb', line 98

def comments
  @comments
end

#tokensObject (readonly)

Returns the value of attribute tokens.



98
99
100
# File 'lib/rubocop/ast/node_pattern/with_meta.rb', line 98

def tokens
  @tokens
end

Instance Method Details

#do_parseObject



100
101
102
103
104
105
# File 'lib/rubocop/ast/node_pattern/with_meta.rb', line 100

def do_parse
  r = super
  @comments = @lexer.comments
  @tokens = @lexer.tokens
  r
end