D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Prism
/
ParseResult
/
Newlines
/
Filename :
cdesc-Newlines.ri
back
Copy
U:RDoc::NormalClass[iI" Newlines:ETI"!Prism::ParseResult::Newlines;TI"Visitor;To:RDoc::Markup::Document:@parts[o;;[ o:RDoc::Markup::Paragraph;[I"NThe :line tracepoint event gets fired whenever the Ruby VM encounters an ;TI"Nexpression on a new line. The types of expressions that can trigger this ;TI"event are:;To:RDoc::Markup::BlankLine o:RDoc::Markup::List: @type:BULLET:@items[o:RDoc::Markup::ListItem:@label0;[o; ;[I"if statements;To;;0;[o; ;[I"unless statements;To;;0;[o; ;[I"0nodes that are children of statements lists;T@o; ;[I"LIn order to keep track of the newlines, we have a list of offsets that ;TI"Pcome back from the parser. We assign these offsets to the first nodes that ;TI"1we find in the tree that are on those lines.;T@o; ;[I"KNote that the logic in this file should be kept in sync with the Java ;TI"LMarkNewlinesVisitor, since that visitor is responsible for marking the ;TI"$newlines for JRuby/TruffleRuby.;T@o; ;[ I"JThis file is autoloaded only when `mark_newlines!` is called, so the ;TI"Lre-opening of the various nodes in this file will only be performed in ;TI"Jthat case. We do that to avoid storing the extra `@newline` instance ;TI"0variable on every node if we don't need it.;T: @fileI"'lib/prism/parse_result/newlines.rb;T:0@omit_headings_from_table_of_contents_below0;0;0[ [ [ [[I" class;T[[:public[[I"new;TI"'lib/prism/parse_result/newlines.rb;T[:protected[ [:private[ [I" instance;T[[;[ [I"visit_block_node;T@A[I"visit_if_node;T@A[I"visit_lambda_node;T@A[I"visit_statements_node;T@A[I"visit_unless_node;T@A[;[ [;[ [ [U:RDoc::Context::Section[i 0o;;[ ;0;0[@5I"Prism::ParseResult;TcRDoc::NormalClass