Class: Ast::Merge::AstNode::Location
- Inherits:
-
Struct
- Object
- Struct
- Ast::Merge::AstNode::Location
- Defined in:
- lib/ast/merge/ast_node.rb
Overview
Location struct for tracking source positions Compatible with TreeHaver location expectations
Instance Attribute Summary collapse
-
#end_column ⇒ Object
Returns the value of attribute end_column.
-
#end_line ⇒ Object
Returns the value of attribute end_line.
-
#start_column ⇒ Object
Returns the value of attribute start_column.
-
#start_line ⇒ Object
Returns the value of attribute start_line.
Instance Method Summary collapse
-
#cover?(line_number) ⇒ Boolean
Check if a line number falls within this location.
Instance Attribute Details
#end_column ⇒ Object
Returns the value of attribute end_column
71 72 73 |
# File 'lib/ast/merge/ast_node.rb', line 71 def end_column @end_column end |
#end_line ⇒ Object
Returns the value of attribute end_line
71 72 73 |
# File 'lib/ast/merge/ast_node.rb', line 71 def end_line @end_line end |
#start_column ⇒ Object
Returns the value of attribute start_column
71 72 73 |
# File 'lib/ast/merge/ast_node.rb', line 71 def start_column @start_column end |
#start_line ⇒ Object
Returns the value of attribute start_line
71 72 73 |
# File 'lib/ast/merge/ast_node.rb', line 71 def start_line @start_line end |
Instance Method Details
#cover?(line_number) ⇒ Boolean
Check if a line number falls within this location
75 76 77 |
# File 'lib/ast/merge/ast_node.rb', line 75 def cover?(line_number) line_number.between?(start_line, end_line) end |