Method: Parser::Source::Comment.associate_by_identity

Defined in:
lib/parser/source/comment.rb

.associate_by_identity(ast, comments) ⇒ Hash<Parser::Source::Node, Array<Comment>>

Associate comments with ast nodes using identity.

Parameters:

Returns:

  • (Hash<Parser::Source::Node, Array<Comment>>)

See Also:



59
60
61
62
# File 'lib/parser/source/comment.rb', line 59

def self.associate_by_identity(ast, comments)
  associator = Associator.new(ast, comments)
  associator.associate_by_identity
end