Skip to content

Commit

Permalink
Fix comment association in comment associator. (#939)
Browse files Browse the repository at this point in the history
  • Loading branch information
akimd authored Sep 17, 2023
1 parent cb0fc45 commit a9c45c5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/parser/source/comment/associator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,22 +95,22 @@ def associate
end

##
# Same as {associate}, but compares by identity, thus producing an unambiguous
# result even in presence of equal nodes.
# Same as {associate}, but uses `node.loc` instead of `node` as
# the hash key, thus producing an unambiguous result even in presence
# of equal nodes.
#
# @return [Hash<Parser::Source::Node, Array<Parser::Source::Comment>>]
# @return [Hash<Parser::Source::Map, Array<Parser::Source::Comment>>]
#
def associate_locations
@map_using = :location
do_associate
end

##
# Same as {associate}, but uses `node.loc` instead of `node` as
# the hash key, thus producing an unambiguous result even in presence
# of equal nodes.
# Same as {associate}, but compares by identity, thus producing an unambiguous
# result even in presence of equal nodes.
#
# @return [Hash<Parser::Source::Map, Array<Parser::Source::Comment>>]
# @return [Hash<Parser::Source::Node, Array<Parser::Source::Comment>>]
#
def associate_by_identity
@map_using = :identity
Expand Down

0 comments on commit a9c45c5

Please sign in to comment.