Method: RBI::Parser::TreeBuilder#initialize

Defined in:
lib/rbi/parser.rb

#initialize(source, comments:, file:) ⇒ TreeBuilder

: (String source, comments: Array, file: String) -> void



162
163
164
165
166
167
168
169
170
171
# File 'lib/rbi/parser.rb', line 162

def initialize(source, comments:, file:)
  super(source, file: file)

  @comments_by_line = comments.to_h { |c| [c.location.start_line, c] } #: Hash[Integer, Prism::Comment]
  @tree = Tree.new #: Tree

  @scopes_stack = [@tree] #: Array[Tree]
  @last_node = nil #: Prism::Node?
  @last_sigs = [] #: Array[RBI::Sig]
end