Class: Prism::Merge::FreezeNode::LocationWithOffsets
- Inherits:
-
Struct
- Object
- Struct
- Prism::Merge::FreezeNode::LocationWithOffsets
- Defined in:
- lib/prism/merge/freeze_node.rb
Overview
Extended location struct with byte offsets for compatibility with TopLevelMergeRunner's already_output? check, which compares byte offsets. Without real offsets, line numbers (e.g. 2..4) falsely fall within the byte range of real Prism nodes, causing FreezeNodes to be skipped.
Instance Attribute Summary collapse
-
#end_line ⇒ Object
Returns the value of attribute end_line.
-
#end_offset ⇒ Object
Returns the value of attribute end_offset.
-
#start_line ⇒ Object
Returns the value of attribute start_line.
-
#start_offset ⇒ Object
Returns the value of attribute start_offset.
Instance Method Summary collapse
Instance Attribute Details
#end_line ⇒ Object
Returns the value of attribute end_line
42 43 44 |
# File 'lib/prism/merge/freeze_node.rb', line 42 def end_line @end_line end |
#end_offset ⇒ Object
Returns the value of attribute end_offset
42 43 44 |
# File 'lib/prism/merge/freeze_node.rb', line 42 def end_offset @end_offset end |
#start_line ⇒ Object
Returns the value of attribute start_line
42 43 44 |
# File 'lib/prism/merge/freeze_node.rb', line 42 def start_line @start_line end |
#start_offset ⇒ Object
Returns the value of attribute start_offset
42 43 44 |
# File 'lib/prism/merge/freeze_node.rb', line 42 def start_offset @start_offset end |
Instance Method Details
#cover?(line) ⇒ Boolean
43 44 45 |
# File 'lib/prism/merge/freeze_node.rb', line 43 def cover?(line) (start_line..end_line).cover?(line) end |
#leading_comments ⇒ Object
47 48 49 |
# File 'lib/prism/merge/freeze_node.rb', line 47 def leading_comments [] end |
#trailing_comments ⇒ Object
51 52 53 |
# File 'lib/prism/merge/freeze_node.rb', line 51 def trailing_comments [] end |