Skip to content

Commit b94039f

Browse files
committed
Add an ast node to represent a position in the source stream
1 parent c263139 commit b94039f

File tree

1 file changed

+8
-0
lines changed
  • fluent.syntax/fluent/syntax

1 file changed

+8
-0
lines changed

fluent.syntax/fluent/syntax/ast.py

+8
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,14 @@ def __init__(
378378
def add_annotation(self, annot: "Annotation") -> None:
379379
self.annotations.append(annot)
380380

381+
class SourcePosition(BaseNode):
382+
"""
383+
Represents a zero-indexed row/column position in the source string.
384+
"""
385+
def __init__(self, row_index: int, column_index: int, **kwargs: Any):
386+
super().__init__(**kwargs)
387+
self.row_index = row_index
388+
self.column_index = column_index
381389

382390
class Span(BaseNode):
383391
def __init__(self, start: Location, end: Location, **kwargs: Any):

0 commit comments

Comments
 (0)