| Class | Parser::Source::Comment |
| In: |
lib/parser/source/comment.rb
|
| Parent: | Object |
A comment in the source code.
@!attribute [r] text
@return [String]
@!attribute [r] location
@return [Parser::Source::Map]
@api public
| location | -> | loc |
| location | [R] | |
| text | [R] |
Associate `comments` with `ast` nodes by their corresponding node.
@param [Parser::AST::Node] ast @param [Array(Comment)] comments @return [Hash(Parser::AST::Node, Array(Comment))] @see Parser::Source::Comment::Associator#associate @deprecated Use {associate_locations}.
Associate `comments` with `ast` nodes by their location in the source.
@param [Parser::AST::Node] ast @param [Array(Comment)] comments @return [Hash(Parser::Source::Map, Array(Comment))] @see Parser::Source::Comment::Associator#associate_locations
Compares comments. Two comments are equal if they correspond to the same source range.
@param [Object] other @return [Boolean]