Class: Foxtail::Syntax::Parser::AST::Span
- Defined in:
- lib/foxtail/syntax/parser/ast/span.rb
Overview
Represents a source code span with start and end positions Used to track the location of AST nodes in the original source text
Instance Attribute Summary collapse
-
#end ⇒ Object
Returns the value of attribute end.
-
#start ⇒ Object
Returns the value of attribute start.
Attributes inherited from BaseNode
Instance Method Summary collapse
-
#initialize(start_pos, end_pos) ⇒ Span
constructor
A new instance of Span.
Methods inherited from BaseNode
#==, #accept, #children, #to_h
Constructor Details
#initialize(start_pos, end_pos) ⇒ Span
Returns a new instance of Span.
13 14 15 16 17 |
# File 'lib/foxtail/syntax/parser/ast/span.rb', line 13 def initialize(start_pos, end_pos) super() @start = start_pos @end = end_pos end |
Instance Attribute Details
#end ⇒ Object
Returns the value of attribute end.
11 12 13 |
# File 'lib/foxtail/syntax/parser/ast/span.rb', line 11 def end @end end |
#start ⇒ Object
Returns the value of attribute start.
10 11 12 |
# File 'lib/foxtail/syntax/parser/ast/span.rb', line 10 def start @start end |