Class: TurboTest::StaticAnalysis::ActiveRecord::LineStackSexpBuilder

Inherits:
Ripper::SexpBuilder
  • Object
show all
Defined in:
lib/turbo_test_static_analysis/active_record_schema/sexp_builder/line_stack_sexp_builder.rb

Direct Known Subclasses

SexpBuilder

Constant Summary collapse

EVENTS_TO_REJECT =
[:magic_comment].freeze
ARITIES =
["()", "(a)", "(a,b)", "(a,b,c)", "(a,b,c,d)",
"(a,b,c,d,e)", "(a,b,c,d,e,f)", "(a,b,c,d,e,f,g)",
"(a,b,c,d,e,f,g,h)"].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, filename = "-", lineno = 1) ⇒ LineStackSexpBuilder

Returns a new instance of LineStackSexpBuilder.



29
30
31
32
# File 'lib/turbo_test_static_analysis/active_record_schema/sexp_builder/line_stack_sexp_builder.rb', line 29

def initialize(path, filename = "-", lineno = 1)
  super
  @stack = LineColumnStack.new
end

Instance Attribute Details

#stackObject (readonly)

Returns the value of attribute stack.



27
28
29
# File 'lib/turbo_test_static_analysis/active_record_schema/sexp_builder/line_stack_sexp_builder.rb', line 27

def stack
  @stack
end

Instance Method Details

#stack_lineObject



34
35
36
# File 'lib/turbo_test_static_analysis/active_record_schema/sexp_builder/line_stack_sexp_builder.rb', line 34

def stack_line
  @stack.push lineno, column
end