Class: Parser::Source::Comment
Overview
A comment in the source code.
source://parser//lib/parser/source/comment.rb#17
Defined Under Namespace
Classes: Associator
Class Method Summary collapse
- .associate(ast, comments) ⇒ Hash<Parser::AST::Node, Array<Comment>> deprecated Deprecated.
- .associate_by_identity(ast, comments) ⇒ Hash<Parser::Source::Node, Array<Comment>>
Associate
commentswithastnodes using identity. - .associate_locations(ast, comments) ⇒ Hash<Parser::Source::Map, Array<Comment>>
Associate
commentswithastnodes by their location in the source.
Instance Method Summary collapse
- #document? ⇒ Boolean
source://parser//lib/parser/source/comment.rb#109.
- #initialize(range) ⇒ Comment constructor
source://parser//lib/parser/source/comment.rb#67.
- #inline? ⇒ Boolean
source://parser//lib/parser/source/comment.rb#101.
- #loc ⇒ Parser::Source::Range
source://parser//lib/parser/source/comment.rb#20.
- #location ⇒ Parser::Source::Range
source://parser//lib/parser/source/comment.rb#20.
- #text ⇒ String
source://parser//lib/parser/source/comment.rb#18.
- #type ⇒ Symbol
Type of this comment.
Constructor Details
#initialize(range) ⇒ Comment
source://parser//lib/parser/source/comment.rb#67
5365 | # File 'sorbet/rbi/parser@3.3.8.0.rbi', line 5365 def initialize(range); end |
Class Method Details
.associate(ast, comments) ⇒ Hash<Parser::AST::Node, Array<Comment>>
Use associate_locations.
Associate comments with ast nodes by their corresponding node.
source://parser//lib/parser/source/comment.rb#32
5444 | # File 'sorbet/rbi/parser@3.3.8.0.rbi', line 5444 def associate(ast, comments); end |
.associate_by_identity(ast, comments) ⇒ Hash<Parser::Source::Node, Array<Comment>>
Associate comments with ast nodes using identity.
source://parser//lib/parser/source/comment.rb#59
5455 | # File 'sorbet/rbi/parser@3.3.8.0.rbi', line 5455 def associate_by_identity(ast, comments); end |
.associate_locations(ast, comments) ⇒ Hash<Parser::Source::Map, Array<Comment>>
Associate comments with ast nodes by their location in the source.
source://parser//lib/parser/source/comment.rb#46
5467 | # File 'sorbet/rbi/parser@3.3.8.0.rbi', line 5467 def associate_locations(ast, comments); end |
Instance Method Details
#document? ⇒ Boolean
source://parser//lib/parser/source/comment.rb#109
5382 | # File 'sorbet/rbi/parser@3.3.8.0.rbi', line 5382 def document?; end |
#inline? ⇒ Boolean
source://parser//lib/parser/source/comment.rb#101
5389 | # File 'sorbet/rbi/parser@3.3.8.0.rbi', line 5389 def inline?; end |
#loc ⇒ Parser::Source::Range
source://parser//lib/parser/source/comment.rb#20
5401 | # File 'sorbet/rbi/parser@3.3.8.0.rbi', line 5401 def loc; end |
#location ⇒ Parser::Source::Range
source://parser//lib/parser/source/comment.rb#20
5407 | # File 'sorbet/rbi/parser@3.3.8.0.rbi', line 5407 def location; end |
#text ⇒ String
source://parser//lib/parser/source/comment.rb#18
5413 | # File 'sorbet/rbi/parser@3.3.8.0.rbi', line 5413 def text; end |
© 2009–present Homebrew contributors
Licensed under the BSD 2-Clause License.
https://docs.brew.sh/rubydoc/Parser/Source/Comment.html