D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Prism
/
ParseResult
/
Comments
/
Filename :
cdesc-Comments.ri
back
Copy
U:RDoc::NormalClass[iI" Comments:ETI"!Prism::ParseResult::Comments;TI"Object;To:RDoc::Markup::Document:@parts[o;;[ o:RDoc::Markup::Paragraph;[I"PWhen we've parsed the source, we have both the syntax tree and the list of ;TI"Icomments that we found in the source. This class is responsible for ;TI"Nwalking the tree and finding the nearest location to attach each comment.;To:RDoc::Markup::BlankLine o; ;[ I"JIt does this by first finding the nearest locations to each comment. ;TI"NLocations can either come from nodes directly or from location fields on ;TI"Pnodes. For example, a `ClassNode` has an overall location encompassing the ;TI"Fentire class, but it also has a location for the `class` keyword.;T@o; ;[ I"MOnce the nearest locations are found, it determines which one to attach ;TI"Pto. If it's a trailing comment (a comment on the same line as other source ;TI"Ocode), it will favor attaching to the nearest location that occurs before ;TI"Lthe comment. Otherwise it will favor attaching to the nearest location ;TI"that is after the comment.;T: @fileI"'lib/prism/parse_result/comments.rb;T:0@omit_headings_from_table_of_contents_below0;0;0[[ I"parse_result;TI"R;T:publicFI"'lib/prism/parse_result/comments.rb;T[ [ [[I" class;T[[; [[I"new;T@&[:protected[ [:private[ [I" instance;T[[; [[I"attach!;T@&[;[ [;[[I"nearest_targets;T@&[ [U:RDoc::Context::Section[i 0o;;[ ;0;0[@!I"Prism::ParseResult;TcRDoc::NormalClass