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
comments
withast
nodes using identity. -
.associate_locations(ast, comments) ⇒ Hash<Parser::Source::Map, Array<Comment>>
Associate
comments
withast
nodes 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
5359 |
# File 'sorbet/rbi/parser@3.3.7.4.rbi', line 5359 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
5438 |
# File 'sorbet/rbi/parser@3.3.7.4.rbi', line 5438 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
5449 |
# File 'sorbet/rbi/parser@3.3.7.4.rbi', line 5449 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
5461 |
# File 'sorbet/rbi/parser@3.3.7.4.rbi', line 5461 def associate_locations(ast, comments); end |
Instance Method Details
#document? ⇒ Boolean
source://parser//lib/parser/source/comment.rb#109
5376 |
# File 'sorbet/rbi/parser@3.3.7.4.rbi', line 5376 def document?; end |
#inline? ⇒ Boolean
source://parser//lib/parser/source/comment.rb#101
5383 |
# File 'sorbet/rbi/parser@3.3.7.4.rbi', line 5383 def inline?; end |
#loc ⇒ Parser::Source::Range
source://parser//lib/parser/source/comment.rb#20
5395 |
# File 'sorbet/rbi/parser@3.3.7.4.rbi', line 5395 def loc; end |
#location ⇒ Parser::Source::Range
source://parser//lib/parser/source/comment.rb#20
5401 |
# File 'sorbet/rbi/parser@3.3.7.4.rbi', line 5401 def location; end |
#text ⇒ String
source://parser//lib/parser/source/comment.rb#18
5407 |
# File 'sorbet/rbi/parser@3.3.7.4.rbi', line 5407 def text; end |