The :line tracepoint event gets fired whenever the Ruby VM encounters an expression on a new line. The types of expressions that can trigger this event are:
-
if statements
-
unless statements
-
nodes that are children of statements lists
In order to keep track of the newlines, we have a list of offsets that come back from the parser. We assign these offsets to the first nodes that we find in the tree that are on those lines.
Note that the logic in this file should be kept in sync with the Java MarkNewlinesVisitor, since that visitor is responsible for marking the newlines for JRuby/TruffleRuby.
Methods
- N
- V
Class Public methods
Instance Public methods
visit_block_node(node) Link
Permit block/lambda nodes to mark newlines within themselves.
Also aliased as: visit_lambda_node
visit_statements_node(node) Link
Permit statements lists to mark newlines within themselves.