Class: RuboCop::AST::NodePattern::Compiler::Debug

Inherits:
Compiler
  • Object
show all
Defined in:
lib/rubocop/ast/node_pattern/compiler/debug.rb

Overview

Variant of the Compiler with tracing information for nodes

Defined Under Namespace

Modules: InstrumentationSubcompiler Classes: Colorizer, NodePatternSubcompiler, SequenceSubcompiler, Trace

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDebug

Returns a new instance of Debug.



118
119
120
121
# File 'lib/rubocop/ast/node_pattern/compiler/debug.rb', line 118

def initialize
  super
  @node_ids = Hash.new { |h, k| h[k] = h.size }.compare_by_identity
end

Instance Attribute Details

#node_idsObject (readonly)

Returns the value of attribute node_ids.



35
36
37
# File 'lib/rubocop/ast/node_pattern/compiler/debug.rb', line 35

def node_ids
  @node_ids
end

Instance Method Details

#named_parametersObject



123
124
125
# File 'lib/rubocop/ast/node_pattern/compiler/debug.rb', line 123

def named_parameters
  super << :trace
end

#parserObject



127
128
129
# File 'lib/rubocop/ast/node_pattern/compiler/debug.rb', line 127

def parser
  @parser ||= Parser::WithMeta.new
end