From 308e0fc50c53aca9aa385351262009b3f553bcf5 Mon Sep 17 00:00:00 2001 From: James Owen Date: Fri, 31 May 2024 16:25:00 +0100 Subject: [PATCH 1/7] Use consistent variable names in get_entry_or_junk Prior to this change, variables were using _index and _pos suffixes (or no suffix) to all refer to stream indexes. This change switches all of them to use _index, which will make future refactors clearer. --- fluent.syntax/fluent/syntax/parser.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/fluent.syntax/fluent/syntax/parser.py b/fluent.syntax/fluent/syntax/parser.py index 7b41f314..c1df9dee 100644 --- a/fluent.syntax/fluent/syntax/parser.py +++ b/fluent.syntax/fluent/syntax/parser.py @@ -111,7 +111,7 @@ def parse_entry(self, source: str) -> ast.EntryType: return self.get_entry_or_junk(ps) def get_entry_or_junk(self, ps: FluentParserStream) -> ast.EntryType: - entry_start_pos = ps.index + entry_start_index = ps.index try: entry = self.get_entry(ps) @@ -119,17 +119,18 @@ def get_entry_or_junk(self, ps: FluentParserStream) -> ast.EntryType: return entry except ParseError as err: error_index = ps.index - ps.skip_to_next_entry_start(entry_start_pos) - next_entry_start = ps.index - if next_entry_start < error_index: + + ps.skip_to_next_entry_start(entry_start_index) + next_entry_start_index = ps.index + if next_entry_start_index < error_index: # The position of the error must be inside of the Junk's span. - error_index = next_entry_start + error_index = next_entry_start_index # Create a Junk instance - slice = ps.string[entry_start_pos:next_entry_start] + slice = ps.string[entry_start_index:next_entry_start_index] junk = ast.Junk(slice) if self.with_spans: - junk.add_span(entry_start_pos, next_entry_start) + junk.add_span(entry_start_index, next_entry_start_index) annot = ast.Annotation( err.code, list(err.args) if err.args else None, err.message ) From eaee17ac97a08895d1f6cb8041e886d8eb7147dd Mon Sep 17 00:00:00 2001 From: James Owen Date: Sun, 2 Jun 2024 12:43:38 +0100 Subject: [PATCH 2/7] Track source position information in Streams Prior to this change, the only positional variables which were tracked when moving through the stream was the current index in the stream. We would like to start reporting richer positional information from the parser, specifically the position (in terms of row/column) in the source object. This change allows this by updating the Stream class to additionally track its current (zero-indexed) row and column while moving through the stream. We will persist this information into the syntax tree in the following commits. --- fluent.syntax/fluent/syntax/stream.py | 31 +++++++ fluent.syntax/tests/syntax/test_stream.py | 102 ++++++++++++++++++++++ 2 files changed, 133 insertions(+) diff --git a/fluent.syntax/fluent/syntax/stream.py b/fluent.syntax/fluent/syntax/stream.py index 0e276fc3..f6ea9162 100644 --- a/fluent.syntax/fluent/syntax/stream.py +++ b/fluent.syntax/fluent/syntax/stream.py @@ -9,7 +9,11 @@ class ParserStream: def __init__(self, string: str): self.string = string self.index = 0 + self.row_index = 0 + self.column_index = 0 self.peek_offset = 0 + self._peek_row_offset = 0 + self._peek_column_offset = 0 def get(self, offset: int) -> Union[str, None]: try: @@ -37,9 +41,19 @@ def current_peek(self) -> Union[str, None]: def next(self) -> Union[str, None]: self.peek_offset = 0 + self._peek_row_offset = 0 + self._peek_column_offset = 0 + # Skip over CRLF as if it was a single character. if self.get(self.index) == "\r" and self.get(self.index + 1) == "\n": self.index += 1 + # If we have reached a newline reset the position + if self.get(self.index) == "\n": + self.row_index += 1 + self.column_index = 0 + else: + self.column_index += 1 + self.index += 1 return self.get(self.index) @@ -50,6 +64,13 @@ def peek(self) -> Union[str, None]: and self.get(self.index + self.peek_offset + 1) == "\n" ): self.peek_offset += 1 + + if self.get(self.index + self.peek_offset) == "\n": + self._peek_row_offset += 1 + self._peek_column_offset = 0 + else: + self._peek_column_offset += 1 + self.peek_offset += 1 return self.get(self.index + self.peek_offset) @@ -58,7 +79,17 @@ def reset_peek(self, offset: int = 0) -> None: def skip_to_peek(self) -> None: self.index += self.peek_offset + self.row_index += self._peek_row_offset + if self._peek_row_offset: + # There have been newlines during the peek, so the column offset is the column index + # since the last newline + self.column_index = self._peek_column_offset + else: + self.column_index += self._peek_column_offset + self.peek_offset = 0 + self._peek_row_offset = 0 + self._peek_column_offset = 0 EOL = "\n" diff --git a/fluent.syntax/tests/syntax/test_stream.py b/fluent.syntax/tests/syntax/test_stream.py index d8bef4bb..cbc277df 100644 --- a/fluent.syntax/tests/syntax/test_stream.py +++ b/fluent.syntax/tests/syntax/test_stream.py @@ -159,3 +159,105 @@ def test_reset_peek(self): self.assertEqual("d", ps.peek()) self.assertEqual(None, ps.peek()) + + def test_source_position_over_newline(self): + ps = ParserStream("ab\nc") + + # Initially we should start at 0,0 + self.assertEqual("a", ps.current_char) + self.assertEqual(0, ps.row_index) + self.assertEqual(0, ps.column_index) + + # Advancing within a line should increase the columm + self.assertEqual("b", ps.next()) + self.assertEqual(0, ps.row_index) + self.assertEqual(1, ps.column_index) + + # Advancing to the newline should increase the column + self.assertEqual("\n", ps.next()) + self.assertEqual(0, ps.row_index) + self.assertEqual(2, ps.column_index) + + # Advancing past the newline should increase the row and reset the column + self.assertEqual("c", ps.next()) + self.assertEqual(1, ps.row_index) + self.assertEqual(0, ps.column_index) + + def test_source_position_over_crlf(self): + ps = ParserStream("a\r\nb") + + # Initially we should start at 0,0 + self.assertEqual("a", ps.current_char) + self.assertEqual(0, ps.row_index) + self.assertEqual(0, ps.column_index) + + # Advancing to the CRLF should increase the column + self.assertEqual("\r", ps.next()) + self.assertEqual(0, ps.row_index) + self.assertEqual(1, ps.column_index) + + # Advancing past the CRLF should increase the row and reset the column + self.assertEqual("b", ps.next()) + self.assertEqual(1, ps.row_index) + self.assertEqual(0, ps.column_index) + + def test_skip_to_peek_over_newline(self): + ps = ParserStream("ab\nc") + + # Initially we should start at 0,0 + self.assertEqual("a", ps.current_char) + self.assertEqual(0, ps.row_index) + self.assertEqual(0, ps.column_index) + + # Peeking then advancing within a line should increase the columm + self.assertEqual("b", ps.peek()) + self.assertEqual(0, ps.row_index) + self.assertEqual(0, ps.column_index) + + ps.skip_to_peek() + self.assertEqual(0, ps.row_index) + self.assertEqual(1, ps.column_index) + + # Peeking then advancing to the newline should increase the column + self.assertEqual("\n", ps.peek()) + self.assertEqual(0, ps.row_index) + self.assertEqual(1, ps.column_index) + + ps.skip_to_peek() + self.assertEqual(0, ps.row_index) + self.assertEqual(2, ps.column_index) + + # Peeking then advancing past the newline should increase the row and reset the column + self.assertEqual("c", ps.peek()) + self.assertEqual(0, ps.row_index) + self.assertEqual(2, ps.column_index) + + ps.skip_to_peek() + self.assertEqual(1, ps.row_index) + self.assertEqual(0, ps.column_index) + + def test_skip_to_peek_over_crlf(self): + ps = ParserStream("a\r\nb") + + # Initially we should start at 0,0 + self.assertEqual("a", ps.current_char) + self.assertEqual(0, ps.row_index) + self.assertEqual(0, ps.column_index) + + # Peeking then advancing to the CRLF should increase the column + self.assertEqual("\r", ps.peek()) + self.assertEqual(0, ps.row_index) + self.assertEqual(0, ps.column_index) + + ps.skip_to_peek() + self.assertEqual(0, ps.row_index) + self.assertEqual(1, ps.column_index) + + # Peeking then advancing past the CRLF should increase the row and reset the column + self.assertEqual("b", ps.peek()) + self.assertEqual(0, ps.row_index) + self.assertEqual(1, ps.column_index) + + ps.skip_to_peek() + self.assertEqual(1, ps.row_index) + self.assertEqual(0, ps.column_index) From 8e08c30f4b8480ebcbcf31c59626b72469da5b90 Mon Sep 17 00:00:00 2001 From: James Owen Date: Fri, 31 May 2024 16:11:30 +0100 Subject: [PATCH 3/7] Add a type alias for stream location Prior to this change, the location in the parser stream was represented by the current index. We would like to update the parser stream to also return the source position (row/column) as part of the location information. This change adds a type alias to represent a location in the parser stream, and a property to return it. Currently, this is just the index, but we will update it in future commits. This allows us to break up the change to make it easier to review, as we can switch code paths which create span information to use locations before making any functional changes. --- fluent.syntax/fluent/syntax/stream.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/fluent.syntax/fluent/syntax/stream.py b/fluent.syntax/fluent/syntax/stream.py index f6ea9162..ae9e958d 100644 --- a/fluent.syntax/fluent/syntax/stream.py +++ b/fluent.syntax/fluent/syntax/stream.py @@ -1,10 +1,15 @@ -from typing import Callable, Union +from typing import Callable, TypeAlias, Union from typing_extensions import Literal from .errors import ParseError +# Represents a location in the parser stream (for convenience) +# - Index +Location: TypeAlias = int + + class ParserStream: def __init__(self, string: str): self.string = string @@ -31,6 +36,10 @@ def char_at(self, offset: int) -> Union[str, None]: return self.get(offset) + @property + def current_location(self) -> Location: + return self.index + @property def current_char(self) -> Union[str, None]: return self.char_at(self.index) From c263139aa61ff87a5f530ffa972cfa6cf52afe21 Mon Sep 17 00:00:00 2001 From: James Owen Date: Fri, 31 May 2024 16:33:15 +0100 Subject: [PATCH 4/7] Use Locations when adding spans Prior to this change, we were passing around integers when creating span information. This change uses locations instead. This has no functional change, but will make it easier to start passing through source position information in the following commit. --- fluent.syntax/fluent/syntax/ast.py | 14 +++++++++-- fluent.syntax/fluent/syntax/parser.py | 34 ++++++++++++++------------- 2 files changed, 30 insertions(+), 18 deletions(-) diff --git a/fluent.syntax/fluent/syntax/ast.py b/fluent.syntax/fluent/syntax/ast.py index c47244e5..98a0c769 100644 --- a/fluent.syntax/fluent/syntax/ast.py +++ b/fluent.syntax/fluent/syntax/ast.py @@ -3,6 +3,8 @@ import sys from typing import Any, Callable, Dict, List, TypeVar, Union, cast +from .stream import Location + Node = TypeVar("Node", bound="BaseNode") ToJsonFn = Callable[[Dict[str, Any]], Any] @@ -121,7 +123,7 @@ def __init__(self, span: Union["Span", None] = None, **kwargs: Any): super().__init__(**kwargs) self.span = span - def add_span(self, start: int, end: int) -> None: + def add_span(self, start: Location, end: Location) -> None: self.span = Span(start, end) @@ -378,11 +380,19 @@ def add_annotation(self, annot: "Annotation") -> None: class Span(BaseNode): - def __init__(self, start: int, end: int, **kwargs: Any): + def __init__(self, start: Location, end: Location, **kwargs: Any): super().__init__(**kwargs) self.start = start self.end = end + @property + def start_location(self) -> Location: + return self.start + + @property + def end_location(self) -> Location: + return self.end + class Annotation(SyntaxNode): def __init__( diff --git a/fluent.syntax/fluent/syntax/parser.py b/fluent.syntax/fluent/syntax/parser.py index c1df9dee..e69d0056 100644 --- a/fluent.syntax/fluent/syntax/parser.py +++ b/fluent.syntax/fluent/syntax/parser.py @@ -3,7 +3,7 @@ from . import ast from .errors import ParseError -from .stream import EOL, FluentParserStream +from .stream import EOL, FluentParserStream, Location R = TypeVar("R", bound=ast.SyntaxNode) @@ -15,7 +15,7 @@ def decorated( if not self.with_spans: return fn(self, ps, *args, **kwargs) - start = ps.index + start = ps.current_location node = fn(self, ps, *args, **kwargs) # Don't re-add the span if the node already has it. This may happen @@ -23,7 +23,7 @@ def decorated( if node.span is not None: return node - end = ps.index + end = ps.current_location node.add_span(start, end) return node @@ -85,7 +85,7 @@ def parse(self, source: str) -> ast.Resource: res = ast.Resource(entries) if self.with_spans: - res.add_span(0, ps.index) + res.add_span(0, ps.current_location) return res @@ -112,6 +112,7 @@ def parse_entry(self, source: str) -> ast.EntryType: def get_entry_or_junk(self, ps: FluentParserStream) -> ast.EntryType: entry_start_index = ps.index + entry_start_location = ps.current_location try: entry = self.get_entry(ps) @@ -119,22 +120,23 @@ def get_entry_or_junk(self, ps: FluentParserStream) -> ast.EntryType: return entry except ParseError as err: error_index = ps.index + error_location = ps.current_location ps.skip_to_next_entry_start(entry_start_index) next_entry_start_index = ps.index if next_entry_start_index < error_index: # The position of the error must be inside of the Junk's span. - error_index = next_entry_start_index + error_location = ps.current_location # Create a Junk instance slice = ps.string[entry_start_index:next_entry_start_index] junk = ast.Junk(slice) if self.with_spans: - junk.add_span(entry_start_index, next_entry_start_index) + junk.add_span(entry_start_location, ps.current_location) annot = ast.Annotation( err.code, list(err.args) if err.args else None, err.message ) - annot.add_span(error_index, error_index) + annot.add_span(error_location, error_location) junk.add_annotation(annot) return junk @@ -380,9 +382,9 @@ def get_pattern(self, ps: FluentParserStream, is_block: bool) -> ast.Pattern: if is_block: # A block pattern is a pattern which starts on a new line. Measure # the indent of this first line for the dedentation logic. - blank_start = ps.index + blank_start = ps.current_location first_indent = ps.skip_blank_inline() - elements.append(self.Indent(first_indent, blank_start, ps.index)) + elements.append(self.Indent(first_indent, blank_start, ps.current_location)) common_indent_length = len(first_indent) else: # Should get fixed by the subsequent min() operation @@ -390,14 +392,14 @@ def get_pattern(self, ps: FluentParserStream, is_block: bool) -> ast.Pattern: while ps.current_char: if ps.current_char == EOL: - blank_start = ps.index + blank_start = ps.current_location blank_lines = ps.peek_blank_block() if ps.is_value_continuation(): ps.skip_to_peek() indent = ps.skip_blank_inline() common_indent_length = min(common_indent_length, len(indent)) elements.append( - self.Indent(blank_lines + indent, blank_start, ps.index) + self.Indent(blank_lines + indent, blank_start, ps.current_location) ) continue @@ -421,7 +423,7 @@ def get_pattern(self, ps: FluentParserStream, is_block: bool) -> ast.Pattern: return ast.Pattern(dedented) class Indent(ast.SyntaxNode): - def __init__(self, value: str, start: int, end: int): + def __init__(self, value: str, start: Location, end: Location): super(FluentParser.Indent, self).__init__() self.value = value self.add_span(start, end) @@ -454,8 +456,8 @@ def dedent( sum = ast.TextElement(prev.value + element.value) if self.with_spans: sum.add_span( - cast(ast.Span, prev.span).start, - cast(ast.Span, element.span).end, + cast(ast.Span, prev.span).start_location, + cast(ast.Span, element.span).end_location, ) trimmed[-1] = sum continue @@ -466,8 +468,8 @@ def dedent( text_element = ast.TextElement(element.value) if self.with_spans: text_element.add_span( - cast(ast.Span, element.span).start, - cast(ast.Span, element.span).end, + cast(ast.Span, element.span).start_location, + cast(ast.Span, element.span).end_location, ) element = text_element From b94039f19230e5a3207fe428f0b8d0642eb75f3a Mon Sep 17 00:00:00 2001 From: James Owen Date: Fri, 31 May 2024 16:33:30 +0100 Subject: [PATCH 5/7] Add an ast node to represent a position in the source stream --- fluent.syntax/fluent/syntax/ast.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fluent.syntax/fluent/syntax/ast.py b/fluent.syntax/fluent/syntax/ast.py index 98a0c769..aa193b09 100644 --- a/fluent.syntax/fluent/syntax/ast.py +++ b/fluent.syntax/fluent/syntax/ast.py @@ -378,6 +378,14 @@ def __init__( def add_annotation(self, annot: "Annotation") -> None: self.annotations.append(annot) +class SourcePosition(BaseNode): + """ + Represents a zero-indexed row/column position in the source string. + """ + def __init__(self, row_index: int, column_index: int, **kwargs: Any): + super().__init__(**kwargs) + self.row_index = row_index + self.column_index = column_index class Span(BaseNode): def __init__(self, start: Location, end: Location, **kwargs: Any): From a34e52ba873c7db07bdf88853720cb877676d14f Mon Sep 17 00:00:00 2001 From: James Owen Date: Fri, 31 May 2024 16:34:11 +0100 Subject: [PATCH 6/7] Pass through source position information in spans Prior to this change, we were tracking source position information in the stream, but were not storing it in the resulting spans. This change adds start_position and end_position SourcePosition attributes to Span nodes. To make this work we end up complicating the constructor for Span nodes, so that it can either take a location or an index/position combo (for JSON deserialization). --- fluent.syntax/fluent/syntax/ast.py | 39 +++++++++++++++++++--- fluent.syntax/fluent/syntax/parser.py | 2 +- fluent.syntax/fluent/syntax/stream.py | 6 ++-- fluent.syntax/tests/syntax/test_entry.py | 32 ++++++++++++++++-- fluent.syntax/tests/syntax/test_visitor.py | 1 + 5 files changed, 70 insertions(+), 10 deletions(-) diff --git a/fluent.syntax/fluent/syntax/ast.py b/fluent.syntax/fluent/syntax/ast.py index aa193b09..7ccdd4f0 100644 --- a/fluent.syntax/fluent/syntax/ast.py +++ b/fluent.syntax/fluent/syntax/ast.py @@ -388,18 +388,47 @@ def __init__(self, row_index: int, column_index: int, **kwargs: Any): self.column_index = column_index class Span(BaseNode): - def __init__(self, start: Location, end: Location, **kwargs: Any): + def __init__( + self, + start: Location | int, + end: Location | int, + start_position: SourcePosition | None = None, + end_position: SourcePosition | None = None, + **kwargs: Any, + ): super().__init__(**kwargs) - self.start = start - self.end = end + + # We support two forms of arguments to the constructor. This is to allow the parser to use + # Location tuples for convenience, but to allow position objects to be passed during json + # deserialization + start_index, start_position = self._coerce_location_and_position(start, start_position) + end_index, end_position = self._coerce_location_and_position(end, end_position) + + self.start = start_index + self.end = end_index + self.start_position = start_position + self.end_position = end_position + + def _coerce_location_and_position( + self, + location_or_index: Location | int, + position: SourcePosition | None, + ) -> tuple[int, SourcePosition]: + if isinstance(location_or_index, int): + assert position is not None, "position must be passed if location is not passed" + return location_or_index, position + else: + assert position is None, "position must not be passed if location is passed" + index, row, column = location_or_index + return index, SourcePosition(row, column) @property def start_location(self) -> Location: - return self.start + return self.start, self.start_position.row_index, self.start_position.column_index @property def end_location(self) -> Location: - return self.end + return self.end, self.end_position.row_index, self.end_position.column_index class Annotation(SyntaxNode): diff --git a/fluent.syntax/fluent/syntax/parser.py b/fluent.syntax/fluent/syntax/parser.py index e69d0056..665b3d92 100644 --- a/fluent.syntax/fluent/syntax/parser.py +++ b/fluent.syntax/fluent/syntax/parser.py @@ -85,7 +85,7 @@ def parse(self, source: str) -> ast.Resource: res = ast.Resource(entries) if self.with_spans: - res.add_span(0, ps.current_location) + res.add_span((0, 0, 0), ps.current_location) return res diff --git a/fluent.syntax/fluent/syntax/stream.py b/fluent.syntax/fluent/syntax/stream.py index ae9e958d..819ac239 100644 --- a/fluent.syntax/fluent/syntax/stream.py +++ b/fluent.syntax/fluent/syntax/stream.py @@ -7,7 +7,9 @@ # Represents a location in the parser stream (for convenience) # - Index -Location: TypeAlias = int +# - Row index (in source) +# - Column index (in source) +Location: TypeAlias = tuple[int, int, int] class ParserStream: @@ -38,7 +40,7 @@ def char_at(self, offset: int) -> Union[str, None]: @property def current_location(self) -> Location: - return self.index + return self.index, self.row_index, self.column_index @property def current_char(self) -> Union[str, None]: diff --git a/fluent.syntax/tests/syntax/test_entry.py b/fluent.syntax/tests/syntax/test_entry.py index 060c5240..2da9b6f3 100644 --- a/fluent.syntax/tests/syntax/test_entry.py +++ b/fluent.syntax/tests/syntax/test_entry.py @@ -65,7 +65,21 @@ def test_return_junk(self): "arguments": ["="], "code": "E0003", "message": 'Expected token: "="', - "span": {"end": 23, "start": 23, "type": "Span"}, + "span": { + "end": 23, + "start": 23, + "end_position": { + "column_index": 4, + "row_index": 1, + "type": "SourcePosition", + }, + "start_position": { + "column_index": 4, + "row_index": 1, + "type": "SourcePosition", + }, + "type": "Span" + }, "type": "Annotation", } ], @@ -111,7 +125,21 @@ def test_do_not_ignore_invalid_comments(self): "arguments": [" "], "code": "E0003", "message": 'Expected token: " "', - "span": {"end": 21, "start": 21, "type": "Span"}, + "span": { + "end": 21, + "start": 21, + "end_position": { + "column_index": 2, + "row_index": 1, + "type": "SourcePosition", + }, + "start_position": { + "column_index": 2, + "row_index": 1, + "type": "SourcePosition", + }, + "type": "Span", + }, "type": "Annotation", } ], diff --git a/fluent.syntax/tests/syntax/test_visitor.py b/fluent.syntax/tests/syntax/test_visitor.py index 1b3f4f16..4954e225 100644 --- a/fluent.syntax/tests/syntax/test_visitor.py +++ b/fluent.syntax/tests/syntax/test_visitor.py @@ -44,6 +44,7 @@ def test_resource(self): "Identifier": 4, "Attribute": 1, "Span": 10, + "SourcePosition": 20, }, ) From 314ca90db4d5746e676743b6a47196303d38d958 Mon Sep 17 00:00:00 2001 From: James Owen Date: Fri, 31 May 2024 17:13:06 +0100 Subject: [PATCH 7/7] Add position information to all syntax fixtures --- .../attribute_expression_with_wrong_attr.json | 60 +- .../attribute_of_private_as_placeable.json | 36 +- .../attribute_of_public_as_selector.json | 36 +- .../attribute_starts_from_nl.json | 108 +- .../attribute_with_empty_pattern.json | 132 +- .../attribute_without_equal_sign.json | 36 +- .../fixtures_structure/blank_lines.json | 348 ++++- .../fixtures_structure/broken_number.json | 132 +- .../call_expression_errors.json | 84 +- .../fixtures_structure/comment_with_eof.json | 24 +- .../tests/syntax/fixtures_structure/crlf.json | 228 +++- .../fixtures_structure/dash_at_eof.json | 48 +- .../fixtures_structure/elements_indent.json | 252 +++- .../fixtures_structure/empty_resource.json | 12 +- .../empty_resource_with_ws.json | 12 +- .../fixtures_structure/escape_sequences.json | 852 +++++++++++- .../expressions_call_args.json | 168 ++- .../syntax/fixtures_structure/indent.json | 264 +++- .../tests/syntax/fixtures_structure/junk.json | 252 +++- .../fixtures_structure/leading_dots.json | 1176 +++++++++++++++-- .../leading_empty_lines.json | 60 +- .../leading_empty_lines_with_ws.json | 60 +- .../message_reference_as_selector.json | 36 +- .../message_with_empty_multiline_pattern.json | 72 +- .../message_with_empty_pattern.json | 240 +++- .../fixtures_structure/multiline-comment.json | 72 +- .../fixtures_structure/multiline_pattern.json | 300 ++++- .../fixtures_structure/multiline_string.json | 36 +- .../multiline_with_non_empty_first_line.json | 60 +- .../multiline_with_placeables.json | 108 +- .../non_id_attribute_name.json | 36 +- .../fixtures_structure/placeable_at_eol.json | 276 +++- .../placeable_at_line_extremes.json | 252 +++- .../placeable_in_placeable.json | 312 ++++- .../placeable_without_close_bracket.json | 36 +- .../fixtures_structure/resource_comment.json | 24 +- .../resource_comment_trailing_line.json | 24 +- .../second_attribute_starts_from_nl.json | 156 ++- .../select_expression_with_two_selectors.json | 36 +- .../select_expression_without_arrow.json | 36 +- .../select_expression_without_variants.json | 84 +- .../select_expressions.json | 84 +- .../fixtures_structure/simple_message.json | 60 +- .../fixtures_structure/single_char_id.json | 108 +- .../fixtures_structure/sparse-messages.json | 588 ++++++++- .../standalone_comment.json | 72 +- .../standalone_identifier.json | 48 +- .../tests/syntax/fixtures_structure/term.json | 936 +++++++++++-- .../term_with_empty_pattern.json | 84 +- .../syntax/fixtures_structure/unclosed.json | 180 ++- .../unclosed_empty_placeable_error.json | 108 +- .../unknown_entry_start.json | 36 +- .../variant_ends_abruptly.json | 48 +- .../fixtures_structure/variant_keys.json | 564 +++++++- .../variant_starts_from_nl.json | 144 +- .../variant_with_digit_key.json | 144 +- .../variant_with_empty_pattern.json | 168 ++- .../variant_with_leading_space_in_name.json | 144 +- .../variant_with_symbol_with_space.json | 36 +- .../variants_with_two_defaults.json | 36 +- .../whitespace_leading.json | 276 +++- .../whitespace_trailing.json | 300 ++++- 62 files changed, 9845 insertions(+), 895 deletions(-) diff --git a/fluent.syntax/tests/syntax/fixtures_structure/attribute_expression_with_wrong_attr.json b/fluent.syntax/tests/syntax/fixtures_structure/attribute_expression_with_wrong_attr.json index 23bca440..1e7e8ef0 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/attribute_expression_with_wrong_attr.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/attribute_expression_with_wrong_attr.json @@ -14,7 +14,17 @@ "span": { "type": "Span", "start": 13, - "end": 13 + "end": 13, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 13 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 13 + } } } ], @@ -22,7 +32,17 @@ "span": { "type": "Span", "start": 0, - "end": 18 + "end": 18, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 0 + } } }, { @@ -38,7 +58,17 @@ "span": { "type": "Span", "start": 31, - "end": 31 + "end": 31, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 13 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 13 + } } } ], @@ -46,13 +76,33 @@ "span": { "type": "Span", "start": 18, - "end": 34 + "end": 34, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + } } } ], "span": { "type": "Span", "start": 0, - "end": 34 + "end": 34, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 1 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/attribute_of_private_as_placeable.json b/fluent.syntax/tests/syntax/fixtures_structure/attribute_of_private_as_placeable.json index 38219792..df07ccb2 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/attribute_of_private_as_placeable.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/attribute_of_private_as_placeable.json @@ -12,7 +12,17 @@ "span": { "type": "Span", "start": 23, - "end": 23 + "end": 23, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 23 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 23 + } } } ], @@ -20,13 +30,33 @@ "span": { "type": "Span", "start": 0, - "end": 25 + "end": 25, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 0 + } } } ], "span": { "type": "Span", "start": 0, - "end": 25 + "end": 25, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 1 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/attribute_of_public_as_selector.json b/fluent.syntax/tests/syntax/fixtures_structure/attribute_of_public_as_selector.json index 7adaaeb1..1f6b933c 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/attribute_of_public_as_selector.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/attribute_of_public_as_selector.json @@ -12,7 +12,17 @@ "span": { "type": "Span", "start": 21, - "end": 21 + "end": 21, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 22 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 22 + } } } ], @@ -20,13 +30,33 @@ "span": { "type": "Span", "start": 0, - "end": 62 + "end": 62, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 0 + } } } ], "span": { "type": "Span", "start": 0, - "end": 62 + "end": 62, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 1 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/attribute_starts_from_nl.json b/fluent.syntax/tests/syntax/fixtures_structure/attribute_starts_from_nl.json index d7d64c44..8853fb5e 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/attribute_starts_from_nl.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/attribute_starts_from_nl.json @@ -9,7 +9,17 @@ "span": { "type": "Span", "start": 0, - "end": 3 + "end": 3, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 3 + } } }, "value": { @@ -21,14 +31,34 @@ "span": { "type": "Span", "start": 6, - "end": 11 + "end": 11, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 6 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 11 + } } } ], "span": { "type": "Span", "start": 6, - "end": 11 + "end": 11, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 6 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 11 + } } }, "attributes": [ @@ -40,7 +70,17 @@ "span": { "type": "Span", "start": 13, - "end": 17 + "end": 17, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 1 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 5 + } } }, "value": { @@ -52,20 +92,50 @@ "span": { "type": "Span", "start": 20, - "end": 27 + "end": 27, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 15 + } } } ], "span": { "type": "Span", "start": 20, - "end": 27 + "end": 27, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 15 + } } }, "span": { "type": "Span", "start": 12, - "end": 27 + "end": 27, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 15 + } } } ], @@ -73,13 +143,33 @@ "span": { "type": "Span", "start": 0, - "end": 27 + "end": 27, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 15 + } } } ], "span": { "type": "Span", "start": 0, - "end": 28 + "end": 28, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 0 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/attribute_with_empty_pattern.json b/fluent.syntax/tests/syntax/fixtures_structure/attribute_with_empty_pattern.json index d08648e7..7cbdf1b9 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/attribute_with_empty_pattern.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/attribute_with_empty_pattern.json @@ -12,7 +12,17 @@ "span": { "type": "Span", "start": 26, - "end": 26 + "end": 26, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 11 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 11 + } } } ], @@ -20,7 +30,17 @@ "span": { "type": "Span", "start": 0, - "end": 28 + "end": 28, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 0 + } } }, { @@ -34,7 +54,17 @@ "span": { "type": "Span", "start": 46, - "end": 46 + "end": 46, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 15 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 15 + } } } ], @@ -42,7 +72,17 @@ "span": { "type": "Span", "start": 28, - "end": 48 + "end": 48, + "start_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 0 + } } }, { @@ -56,7 +96,17 @@ "span": { "type": "Span", "start": 87, - "end": 87 + "end": 87, + "start_position": { + "type": "SourcePosition", + "row_index": 12, + "column_index": 12 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 12, + "column_index": 12 + } } } ], @@ -64,7 +114,17 @@ "span": { "type": "Span", "start": 48, - "end": 89 + "end": 89, + "start_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 15, + "column_index": 0 + } } }, { @@ -78,7 +138,17 @@ "span": { "type": "Span", "start": 108, - "end": 108 + "end": 108, + "start_position": { + "type": "SourcePosition", + "row_index": 16, + "column_index": 16 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 16, + "column_index": 16 + } } } ], @@ -86,7 +156,17 @@ "span": { "type": "Span", "start": 89, - "end": 130 + "end": 130, + "start_position": { + "type": "SourcePosition", + "row_index": 15, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 20, + "column_index": 0 + } } }, { @@ -100,7 +180,17 @@ "span": { "type": "Span", "start": 149, - "end": 149 + "end": 149, + "start_position": { + "type": "SourcePosition", + "row_index": 21, + "column_index": 16 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 21, + "column_index": 16 + } } } ], @@ -108,13 +198,33 @@ "span": { "type": "Span", "start": 130, - "end": 163 + "end": 163, + "start_position": { + "type": "SourcePosition", + "row_index": 20, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 24, + "column_index": 0 + } } } ], "span": { "type": "Span", "start": 0, - "end": 163 + "end": 163, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 24, + "column_index": 1 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/attribute_without_equal_sign.json b/fluent.syntax/tests/syntax/fixtures_structure/attribute_without_equal_sign.json index 5a81df00..13c1bb6a 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/attribute_without_equal_sign.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/attribute_without_equal_sign.json @@ -14,7 +14,17 @@ "span": { "type": "Span", "start": 22, - "end": 22 + "end": 22, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 10 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 10 + } } } ], @@ -22,13 +32,33 @@ "span": { "type": "Span", "start": 0, - "end": 23 + "end": 23, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 0 + } } } ], "span": { "type": "Span", "start": 0, - "end": 23 + "end": 23, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 1 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/blank_lines.json b/fluent.syntax/tests/syntax/fixtures_structure/blank_lines.json index 998e7da6..3b2031e7 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/blank_lines.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/blank_lines.json @@ -7,7 +7,17 @@ "span": { "type": "Span", "start": 0, - "end": 78 + "end": 78, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 78 + } } }, { @@ -18,7 +28,17 @@ "span": { "type": "Span", "start": 80, - "end": 85 + "end": 85, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 5 + } } }, "value": { @@ -30,14 +50,34 @@ "span": { "type": "Span", "start": 88, - "end": 96 + "end": 96, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 16 + } } } ], "span": { "type": "Span", "start": 88, - "end": 96 + "end": 96, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 16 + } } }, "attributes": [], @@ -45,7 +85,17 @@ "span": { "type": "Span", "start": 80, - "end": 96 + "end": 96, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 16 + } } }, { @@ -56,7 +106,17 @@ "span": { "type": "Span", "start": 98, - "end": 103 + "end": 103, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 5 + } } }, "value": { @@ -68,14 +128,34 @@ "span": { "type": "Span", "start": 106, - "end": 114 + "end": 114, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 16 + } } } ], "span": { "type": "Span", "start": 106, - "end": 114 + "end": 114, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 16 + } } }, "attributes": [], @@ -83,7 +163,17 @@ "span": { "type": "Span", "start": 98, - "end": 114 + "end": 114, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 16 + } } }, { @@ -94,7 +184,17 @@ "span": { "type": "Span", "start": 117, - "end": 122 + "end": 122, + "start_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 5 + } } }, "value": { @@ -106,14 +206,34 @@ "span": { "type": "Span", "start": 130, - "end": 153 + "end": 153, + "start_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 12 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 11, + "column_index": 21 + } } } ], "span": { "type": "Span", "start": 126, - "end": 153 + "end": 153, + "start_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 11, + "column_index": 21 + } } }, "attributes": [], @@ -121,7 +241,17 @@ "span": { "type": "Span", "start": 117, - "end": 153 + "end": 153, + "start_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 11, + "column_index": 21 + } } }, { @@ -132,7 +262,17 @@ "span": { "type": "Span", "start": 227, - "end": 232 + "end": 232, + "start_position": { + "type": "SourcePosition", + "row_index": 14, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 14, + "column_index": 5 + } } }, "value": { @@ -144,14 +284,34 @@ "span": { "type": "Span", "start": 240, - "end": 267 + "end": 267, + "start_position": { + "type": "SourcePosition", + "row_index": 16, + "column_index": 12 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 18, + "column_index": 21 + } } } ], "span": { "type": "Span", "start": 236, - "end": 267 + "end": 267, + "start_position": { + "type": "SourcePosition", + "row_index": 16, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 18, + "column_index": 21 + } } }, "attributes": [], @@ -161,13 +321,33 @@ "span": { "type": "Span", "start": 155, - "end": 226 + "end": 226, + "start_position": { + "type": "SourcePosition", + "row_index": 13, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 13, + "column_index": 71 + } } }, "span": { "type": "Span", "start": 155, - "end": 267 + "end": 267, + "start_position": { + "type": "SourcePosition", + "row_index": 14, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 18, + "column_index": 21 + } } }, { @@ -178,7 +358,17 @@ "span": { "type": "Span", "start": 327, - "end": 332 + "end": 332, + "start_position": { + "type": "SourcePosition", + "row_index": 21, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 21, + "column_index": 5 + } } }, "value": { @@ -190,14 +380,34 @@ "span": { "type": "Span", "start": 339, - "end": 347 + "end": 347, + "start_position": { + "type": "SourcePosition", + "row_index": 22, + "column_index": 12 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 22, + "column_index": 20 + } } } ], "span": { "type": "Span", "start": 335, - "end": 347 + "end": 347, + "start_position": { + "type": "SourcePosition", + "row_index": 22, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 22, + "column_index": 20 + } } }, "attributes": [], @@ -207,13 +417,33 @@ "span": { "type": "Span", "start": 269, - "end": 326 + "end": 326, + "start_position": { + "type": "SourcePosition", + "row_index": 20, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 20, + "column_index": 57 + } } }, "span": { "type": "Span", "start": 269, - "end": 347 + "end": 347, + "start_position": { + "type": "SourcePosition", + "row_index": 21, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 22, + "column_index": 20 + } } }, { @@ -224,7 +454,17 @@ "span": { "type": "Span", "start": 411, - "end": 416 + "end": 416, + "start_position": { + "type": "SourcePosition", + "row_index": 25, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 25, + "column_index": 5 + } } }, "value": { @@ -236,14 +476,34 @@ "span": { "type": "Span", "start": 419, - "end": 427 + "end": 427, + "start_position": { + "type": "SourcePosition", + "row_index": 25, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 25, + "column_index": 16 + } } } ], "span": { "type": "Span", "start": 419, - "end": 427 + "end": 427, + "start_position": { + "type": "SourcePosition", + "row_index": 25, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 25, + "column_index": 16 + } } }, "attributes": [], @@ -253,19 +513,49 @@ "span": { "type": "Span", "start": 353, - "end": 410 + "end": 410, + "start_position": { + "type": "SourcePosition", + "row_index": 24, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 24, + "column_index": 57 + } } }, "span": { "type": "Span", "start": 353, - "end": 427 + "end": 427, + "start_position": { + "type": "SourcePosition", + "row_index": 25, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 25, + "column_index": 16 + } } } ], "span": { "type": "Span", "start": 0, - "end": 432 + "end": 432, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 26, + "column_index": 4 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/broken_number.json b/fluent.syntax/tests/syntax/fixtures_structure/broken_number.json index f0270d56..fba2c9b5 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/broken_number.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/broken_number.json @@ -14,7 +14,17 @@ "span": { "type": "Span", "start": 14, - "end": 14 + "end": 14, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 14 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 14 + } } } ], @@ -22,7 +32,17 @@ "span": { "type": "Span", "start": 0, - "end": 19 + "end": 19, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 0 + } } }, { @@ -38,7 +58,17 @@ "span": { "type": "Span", "start": 33, - "end": 33 + "end": 33, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 14 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 14 + } } } ], @@ -46,7 +76,17 @@ "span": { "type": "Span", "start": 19, - "end": 37 + "end": 37, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + } } }, { @@ -62,7 +102,17 @@ "span": { "type": "Span", "start": 48, - "end": 48 + "end": 48, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 11 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 11 + } } } ], @@ -70,7 +120,17 @@ "span": { "type": "Span", "start": 37, - "end": 53 + "end": 53, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 0 + } } }, { @@ -86,7 +146,17 @@ "span": { "type": "Span", "start": 66, - "end": 66 + "end": 66, + "start_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 13 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 13 + } } } ], @@ -94,7 +164,17 @@ "span": { "type": "Span", "start": 53, - "end": 71 + "end": 71, + "start_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 0 + } } }, { @@ -110,7 +190,17 @@ "span": { "type": "Span", "start": 83, - "end": 83 + "end": 83, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 12 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 12 + } } } ], @@ -118,13 +208,33 @@ "span": { "type": "Span", "start": 71, - "end": 87 + "end": 87, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 0 + } } } ], "span": { "type": "Span", "start": 0, - "end": 87 + "end": 87, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 1 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/call_expression_errors.json b/fluent.syntax/tests/syntax/fixtures_structure/call_expression_errors.json index 3710025d..5c1f6533 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/call_expression_errors.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/call_expression_errors.json @@ -12,7 +12,17 @@ "span": { "type": "Span", "start": 22, - "end": 22 + "end": 22, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 22 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 22 + } } } ], @@ -20,7 +30,17 @@ "span": { "type": "Span", "start": 0, - "end": 27 + "end": 27, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 0 + } } }, { @@ -34,7 +54,17 @@ "span": { "type": "Span", "start": 46, - "end": 46 + "end": 46, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 19 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 19 + } } } ], @@ -42,7 +72,17 @@ "span": { "type": "Span", "start": 27, - "end": 57 + "end": 57, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + } } }, { @@ -56,7 +96,17 @@ "span": { "type": "Span", "start": 80, - "end": 80 + "end": 80, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 23 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 23 + } } } ], @@ -64,13 +114,33 @@ "span": { "type": "Span", "start": 57, - "end": 87 + "end": 87, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 0 + } } } ], "span": { "type": "Span", "start": 0, - "end": 87 + "end": 87, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 1 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/comment_with_eof.json b/fluent.syntax/tests/syntax/fixtures_structure/comment_with_eof.json index 30b602a1..0922fa33 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/comment_with_eof.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/comment_with_eof.json @@ -7,13 +7,33 @@ "span": { "type": "Span", "start": 0, - "end": 36 + "end": 36, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 36 + } } } ], "span": { "type": "Span", "start": 0, - "end": 36 + "end": 36, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 36 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/crlf.json b/fluent.syntax/tests/syntax/fixtures_structure/crlf.json index 313d75f3..62a60b02 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/crlf.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/crlf.json @@ -9,7 +9,17 @@ "span": { "type": "Span", "start": 2, - "end": 7 + "end": 7, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 5 + } } }, "value": { @@ -21,14 +31,34 @@ "span": { "type": "Span", "start": 10, - "end": 18 + "end": 18, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 16 + } } } ], "span": { "type": "Span", "start": 10, - "end": 18 + "end": 18, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 16 + } } }, "attributes": [], @@ -36,7 +66,17 @@ "span": { "type": "Span", "start": 2, - "end": 18 + "end": 18, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 16 + } } }, { @@ -47,7 +87,17 @@ "span": { "type": "Span", "start": 20, - "end": 25 + "end": 25, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 5 + } } }, "value": { @@ -59,14 +109,34 @@ "span": { "type": "Span", "start": 35, - "end": 58 + "end": 58, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 12 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 21 + } } } ], "span": { "type": "Span", "start": 31, - "end": 58 + "end": 58, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 21 + } } }, "attributes": [ @@ -78,7 +148,17 @@ "span": { "type": "Span", "start": 67, - "end": 72 + "end": 72, + "start_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 5 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 10 + } } }, "value": { @@ -90,20 +170,50 @@ "span": { "type": "Span", "start": 75, - "end": 80 + "end": 80, + "start_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 13 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 18 + } } } ], "span": { "type": "Span", "start": 75, - "end": 80 + "end": 80, + "start_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 13 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 18 + } } }, "span": { "type": "Span", "start": 66, - "end": 80 + "end": 80, + "start_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 4 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 18 + } } } ], @@ -111,7 +221,17 @@ "span": { "type": "Span", "start": 20, - "end": 80 + "end": 80, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 18 + } } }, { @@ -120,7 +240,17 @@ "span": { "type": "Span", "start": 84, - "end": 114 + "end": 114, + "start_position": { + "type": "SourcePosition", + "row_index": 11, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 11, + "column_index": 30 + } } }, { @@ -134,7 +264,17 @@ "span": { "type": "Span", "start": 130, - "end": 130 + "end": 130, + "start_position": { + "type": "SourcePosition", + "row_index": 12, + "column_index": 14 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 12, + "column_index": 14 + } } } ], @@ -142,7 +282,17 @@ "span": { "type": "Span", "start": 116, - "end": 134 + "end": 134, + "start_position": { + "type": "SourcePosition", + "row_index": 12, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 14, + "column_index": 0 + } } }, { @@ -151,7 +301,17 @@ "span": { "type": "Span", "start": 134, - "end": 167 + "end": 167, + "start_position": { + "type": "SourcePosition", + "row_index": 14, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 14, + "column_index": 33 + } } }, { @@ -167,7 +327,17 @@ "span": { "type": "Span", "start": 187, - "end": 187 + "end": 187, + "start_position": { + "type": "SourcePosition", + "row_index": 15, + "column_index": 18 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 15, + "column_index": 18 + } } } ], @@ -175,13 +345,33 @@ "span": { "type": "Span", "start": 169, - "end": 190 + "end": 190, + "start_position": { + "type": "SourcePosition", + "row_index": 15, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 16, + "column_index": 0 + } } } ], "span": { "type": "Span", "start": 0, - "end": 190 + "end": 190, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 16, + "column_index": 1 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/dash_at_eof.json b/fluent.syntax/tests/syntax/fixtures_structure/dash_at_eof.json index b71ac42f..31836988 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/dash_at_eof.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/dash_at_eof.json @@ -7,7 +7,17 @@ "span": { "type": "Span", "start": 0, - "end": 298 + "end": 298, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 62 + } } }, { @@ -23,7 +33,17 @@ "span": { "type": "Span", "start": 309, - "end": 309 + "end": 309, + "start_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 9 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 9 + } } } ], @@ -31,13 +51,33 @@ "span": { "type": "Span", "start": 300, - "end": 309 + "end": 309, + "start_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 9 + } } } ], "span": { "type": "Span", "start": 0, - "end": 309 + "end": 309, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 9 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/elements_indent.json b/fluent.syntax/tests/syntax/fixtures_structure/elements_indent.json index 6a23cc27..5d4d3e89 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/elements_indent.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/elements_indent.json @@ -9,7 +9,17 @@ "span": { "type": "Span", "start": 0, - "end": 3 + "end": 3, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 3 + } } }, "value": { @@ -21,14 +31,34 @@ "span": { "type": "Span", "start": 6, - "end": 9 + "end": 9, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 6 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 9 + } } } ], "span": { "type": "Span", "start": 6, - "end": 9 + "end": 9, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 6 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 9 + } } }, "attributes": [ @@ -40,7 +70,17 @@ "span": { "type": "Span", "start": 11, - "end": 15 + "end": 15, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 1 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 5 + } } }, "value": { @@ -52,20 +92,50 @@ "span": { "type": "Span", "start": 18, - "end": 26 + "end": 26, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 16 + } } } ], "span": { "type": "Span", "start": 18, - "end": 26 + "end": 26, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 16 + } } }, "span": { "type": "Span", "start": 10, - "end": 26 + "end": 26, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 16 + } } } ], @@ -73,7 +143,17 @@ "span": { "type": "Span", "start": 0, - "end": 26 + "end": 26, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 16 + } } }, { @@ -84,7 +164,17 @@ "span": { "type": "Span", "start": 28, - "end": 31 + "end": 31, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 3 + } } }, "value": { @@ -96,14 +186,34 @@ "span": { "type": "Span", "start": 34, - "end": 37 + "end": 37, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 6 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 9 + } } } ], "span": { "type": "Span", "start": 34, - "end": 37 + "end": 37, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 6 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 9 + } } }, "attributes": [ @@ -115,7 +225,17 @@ "span": { "type": "Span", "start": 43, - "end": 48 + "end": 48, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 5 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 10 + } } }, "value": { @@ -127,20 +247,50 @@ "span": { "type": "Span", "start": 51, - "end": 61 + "end": 61, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 13 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 23 + } } } ], "span": { "type": "Span", "start": 51, - "end": 61 + "end": 61, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 13 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 23 + } } }, "span": { "type": "Span", "start": 42, - "end": 61 + "end": 61, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 4 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 23 + } } }, { @@ -151,7 +301,17 @@ "span": { "type": "Span", "start": 63, - "end": 68 + "end": 68, + "start_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 1 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 6 + } } }, "value": { @@ -163,20 +323,50 @@ "span": { "type": "Span", "start": 71, - "end": 81 + "end": 81, + "start_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 9 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 19 + } } } ], "span": { "type": "Span", "start": 71, - "end": 81 + "end": 81, + "start_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 9 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 19 + } } }, "span": { "type": "Span", "start": 62, - "end": 81 + "end": 81, + "start_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 19 + } } } ], @@ -184,13 +374,33 @@ "span": { "type": "Span", "start": 28, - "end": 81 + "end": 81, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 19 + } } } ], "span": { "type": "Span", "start": 0, - "end": 82 + "end": 82, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 0 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/empty_resource.json b/fluent.syntax/tests/syntax/fixtures_structure/empty_resource.json index 603a5bb1..8c3ea305 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/empty_resource.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/empty_resource.json @@ -4,6 +4,16 @@ "span": { "type": "Span", "start": 0, - "end": 0 + "end": 0, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/empty_resource_with_ws.json b/fluent.syntax/tests/syntax/fixtures_structure/empty_resource_with_ws.json index 4d3a2b70..f28227b7 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/empty_resource_with_ws.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/empty_resource_with_ws.json @@ -4,6 +4,16 @@ "span": { "type": "Span", "start": 0, - "end": 10 + "end": 10, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/escape_sequences.json b/fluent.syntax/tests/syntax/fixtures_structure/escape_sequences.json index 68cacb18..946bd2b6 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/escape_sequences.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/escape_sequences.json @@ -7,7 +7,17 @@ "span": { "type": "Span", "start": 0, - "end": 15 + "end": 15, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 15 + } } }, { @@ -18,7 +28,17 @@ "span": { "type": "Span", "start": 16, - "end": 34 + "end": 34, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 18 + } } }, "value": { @@ -30,14 +50,34 @@ "span": { "type": "Span", "start": 37, - "end": 61 + "end": 61, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 21 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 45 + } } } ], "span": { "type": "Span", "start": 37, - "end": 61 + "end": 61, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 21 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 45 + } } }, "attributes": [], @@ -45,7 +85,17 @@ "span": { "type": "Span", "start": 16, - "end": 61 + "end": 61, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 45 + } } }, { @@ -56,7 +106,17 @@ "span": { "type": "Span", "start": 62, - "end": 80 + "end": 80, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 18 + } } }, "value": { @@ -68,14 +128,34 @@ "span": { "type": "Span", "start": 83, - "end": 112 + "end": 112, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 21 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 50 + } } } ], "span": { "type": "Span", "start": 83, - "end": 112 + "end": 112, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 21 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 50 + } } }, "attributes": [], @@ -83,7 +163,17 @@ "span": { "type": "Span", "start": 62, - "end": 112 + "end": 112, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 50 + } } }, { @@ -94,7 +184,17 @@ "span": { "type": "Span", "start": 113, - "end": 133 + "end": 133, + "start_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 20 + } } }, "value": { @@ -106,7 +206,17 @@ "span": { "type": "Span", "start": 136, - "end": 148 + "end": 148, + "start_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 23 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 35 + } } }, { @@ -119,27 +229,67 @@ "span": { "type": "Span", "start": 149, - "end": 158 + "end": 158, + "start_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 36 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 45 + } } }, "attribute": null, "span": { "type": "Span", "start": 149, - "end": 158 + "end": 158, + "start_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 36 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 45 + } } }, "span": { "type": "Span", "start": 148, - "end": 159 + "end": 159, + "start_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 35 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 46 + } } } ], "span": { "type": "Span", "start": 136, - "end": 159 + "end": 159, + "start_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 23 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 46 + } } }, "attributes": [], @@ -147,7 +297,17 @@ "span": { "type": "Span", "start": 113, - "end": 159 + "end": 159, + "start_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 46 + } } }, { @@ -158,7 +318,17 @@ "span": { "type": "Span", "start": 160, - "end": 176 + "end": 176, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 16 + } } }, "value": { @@ -170,14 +340,34 @@ "span": { "type": "Span", "start": 179, - "end": 185 + "end": 185, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 19 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 25 + } } } ], "span": { "type": "Span", "start": 179, - "end": 185 + "end": 185, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 19 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 25 + } } }, "attributes": [], @@ -185,7 +375,17 @@ "span": { "type": "Span", "start": 160, - "end": 185 + "end": 185, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 25 + } } }, { @@ -196,7 +396,17 @@ "span": { "type": "Span", "start": 186, - "end": 212 + "end": 212, + "start_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 26 + } } }, "value": { @@ -208,14 +418,34 @@ "span": { "type": "Span", "start": 215, - "end": 222 + "end": 222, + "start_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 29 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 36 + } } } ], "span": { "type": "Span", "start": 215, - "end": 222 + "end": 222, + "start_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 29 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 36 + } } }, "attributes": [], @@ -223,7 +453,17 @@ "span": { "type": "Span", "start": 186, - "end": 222 + "end": 222, + "start_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 36 + } } }, { @@ -232,7 +472,17 @@ "span": { "type": "Span", "start": 224, - "end": 242 + "end": 242, + "start_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 18 + } } }, { @@ -243,7 +493,17 @@ "span": { "type": "Span", "start": 243, - "end": 258 + "end": 258, + "start_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 15 + } } }, "value": { @@ -257,20 +517,50 @@ "span": { "type": "Span", "start": 262, - "end": 266 + "end": 266, + "start_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 19 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 23 + } } }, "span": { "type": "Span", "start": 261, - "end": 267 + "end": 267, + "start_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 18 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 24 + } } } ], "span": { "type": "Span", "start": 261, - "end": 267 + "end": 267, + "start_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 18 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 24 + } } }, "attributes": [], @@ -278,7 +568,17 @@ "span": { "type": "Span", "start": 243, - "end": 267 + "end": 267, + "start_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 24 + } } }, { @@ -289,7 +589,17 @@ "span": { "type": "Span", "start": 268, - "end": 287 + "end": 287, + "start_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 19 + } } }, "value": { @@ -303,20 +613,50 @@ "span": { "type": "Span", "start": 291, - "end": 295 + "end": 295, + "start_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 23 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 27 + } } }, "span": { "type": "Span", "start": 290, - "end": 296 + "end": 296, + "start_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 22 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 28 + } } } ], "span": { "type": "Span", "start": 290, - "end": 296 + "end": 296, + "start_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 22 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 28 + } } }, "attributes": [], @@ -324,7 +664,17 @@ "span": { "type": "Span", "start": 268, - "end": 296 + "end": 296, + "start_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 28 + } } }, { @@ -333,7 +683,17 @@ "span": { "type": "Span", "start": 297, - "end": 321 + "end": 321, + "start_position": { + "type": "SourcePosition", + "row_index": 10, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 10, + "column_index": 24 + } } }, { @@ -349,7 +709,17 @@ "span": { "type": "Span", "start": 346, - "end": 346 + "end": 346, + "start_position": { + "type": "SourcePosition", + "row_index": 11, + "column_index": 24 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 11, + "column_index": 24 + } } } ], @@ -357,7 +727,17 @@ "span": { "type": "Span", "start": 322, - "end": 349 + "end": 349, + "start_position": { + "type": "SourcePosition", + "row_index": 11, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 12, + "column_index": 0 + } } }, { @@ -366,7 +746,17 @@ "span": { "type": "Span", "start": 349, - "end": 371 + "end": 371, + "start_position": { + "type": "SourcePosition", + "row_index": 12, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 12, + "column_index": 22 + } } }, { @@ -382,7 +772,17 @@ "span": { "type": "Span", "start": 392, - "end": 392 + "end": 392, + "start_position": { + "type": "SourcePosition", + "row_index": 13, + "column_index": 20 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 13, + "column_index": 20 + } } } ], @@ -390,7 +790,17 @@ "span": { "type": "Span", "start": 372, - "end": 397 + "end": 397, + "start_position": { + "type": "SourcePosition", + "row_index": 13, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 15, + "column_index": 0 + } } }, { @@ -399,7 +809,17 @@ "span": { "type": "Span", "start": 397, - "end": 415 + "end": 415, + "start_position": { + "type": "SourcePosition", + "row_index": 15, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 15, + "column_index": 18 + } } }, { @@ -410,7 +830,17 @@ "span": { "type": "Span", "start": 416, - "end": 439 + "end": 439, + "start_position": { + "type": "SourcePosition", + "row_index": 16, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 16, + "column_index": 23 + } } }, "value": { @@ -424,20 +854,50 @@ "span": { "type": "Span", "start": 443, - "end": 451 + "end": 451, + "start_position": { + "type": "SourcePosition", + "row_index": 16, + "column_index": 27 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 16, + "column_index": 35 + } } }, "span": { "type": "Span", "start": 442, - "end": 452 + "end": 452, + "start_position": { + "type": "SourcePosition", + "row_index": 16, + "column_index": 26 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 16, + "column_index": 36 + } } } ], "span": { "type": "Span", "start": 442, - "end": 452 + "end": 452, + "start_position": { + "type": "SourcePosition", + "row_index": 16, + "column_index": 26 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 16, + "column_index": 36 + } } }, "attributes": [], @@ -445,7 +905,17 @@ "span": { "type": "Span", "start": 416, - "end": 452 + "end": 452, + "start_position": { + "type": "SourcePosition", + "row_index": 16, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 16, + "column_index": 36 + } } }, { @@ -456,7 +926,17 @@ "span": { "type": "Span", "start": 453, - "end": 475 + "end": 475, + "start_position": { + "type": "SourcePosition", + "row_index": 17, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 17, + "column_index": 22 + } } }, "value": { @@ -470,20 +950,50 @@ "span": { "type": "Span", "start": 479, - "end": 488 + "end": 488, + "start_position": { + "type": "SourcePosition", + "row_index": 17, + "column_index": 26 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 17, + "column_index": 35 + } } }, "span": { "type": "Span", "start": 478, - "end": 489 + "end": 489, + "start_position": { + "type": "SourcePosition", + "row_index": 17, + "column_index": 25 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 17, + "column_index": 36 + } } } ], "span": { "type": "Span", "start": 478, - "end": 489 + "end": 489, + "start_position": { + "type": "SourcePosition", + "row_index": 17, + "column_index": 25 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 17, + "column_index": 36 + } } }, "attributes": [], @@ -491,7 +1001,17 @@ "span": { "type": "Span", "start": 453, - "end": 489 + "end": 489, + "start_position": { + "type": "SourcePosition", + "row_index": 17, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 17, + "column_index": 36 + } } }, { @@ -500,7 +1020,17 @@ "span": { "type": "Span", "start": 490, - "end": 512 + "end": 512, + "start_position": { + "type": "SourcePosition", + "row_index": 18, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 18, + "column_index": 22 + } } }, { @@ -516,7 +1046,17 @@ "span": { "type": "Span", "start": 538, - "end": 538 + "end": 538, + "start_position": { + "type": "SourcePosition", + "row_index": 19, + "column_index": 25 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 19, + "column_index": 25 + } } } ], @@ -524,7 +1064,17 @@ "span": { "type": "Span", "start": 513, - "end": 543 + "end": 543, + "start_position": { + "type": "SourcePosition", + "row_index": 19, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 21, + "column_index": 0 + } } }, { @@ -533,7 +1083,17 @@ "span": { "type": "Span", "start": 543, - "end": 560 + "end": 560, + "start_position": { + "type": "SourcePosition", + "row_index": 21, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 21, + "column_index": 17 + } } }, { @@ -544,7 +1104,17 @@ "span": { "type": "Span", "start": 561, - "end": 571 + "end": 571, + "start_position": { + "type": "SourcePosition", + "row_index": 22, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 22, + "column_index": 10 + } } }, "value": { @@ -556,7 +1126,17 @@ "span": { "type": "Span", "start": 574, - "end": 585 + "end": 585, + "start_position": { + "type": "SourcePosition", + "row_index": 22, + "column_index": 13 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 22, + "column_index": 24 + } } }, { @@ -567,13 +1147,33 @@ "span": { "type": "Span", "start": 586, - "end": 589 + "end": 589, + "start_position": { + "type": "SourcePosition", + "row_index": 22, + "column_index": 25 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 22, + "column_index": 28 + } } }, "span": { "type": "Span", "start": 585, - "end": 590 + "end": 590, + "start_position": { + "type": "SourcePosition", + "row_index": 22, + "column_index": 24 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 22, + "column_index": 29 + } } }, { @@ -582,14 +1182,34 @@ "span": { "type": "Span", "start": 590, - "end": 597 + "end": 597, + "start_position": { + "type": "SourcePosition", + "row_index": 22, + "column_index": 29 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 22, + "column_index": 36 + } } } ], "span": { "type": "Span", "start": 574, - "end": 597 + "end": 597, + "start_position": { + "type": "SourcePosition", + "row_index": 22, + "column_index": 13 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 22, + "column_index": 36 + } } }, "attributes": [], @@ -597,7 +1217,17 @@ "span": { "type": "Span", "start": 561, - "end": 597 + "end": 597, + "start_position": { + "type": "SourcePosition", + "row_index": 22, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 22, + "column_index": 36 + } } }, { @@ -608,7 +1238,17 @@ "span": { "type": "Span", "start": 598, - "end": 609 + "end": 609, + "start_position": { + "type": "SourcePosition", + "row_index": 23, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 23, + "column_index": 11 + } } }, "value": { @@ -620,7 +1260,17 @@ "span": { "type": "Span", "start": 612, - "end": 622 + "end": 622, + "start_position": { + "type": "SourcePosition", + "row_index": 23, + "column_index": 14 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 23, + "column_index": 24 + } } }, { @@ -631,13 +1281,33 @@ "span": { "type": "Span", "start": 623, - "end": 626 + "end": 626, + "start_position": { + "type": "SourcePosition", + "row_index": 23, + "column_index": 25 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 23, + "column_index": 28 + } } }, "span": { "type": "Span", "start": 622, - "end": 627 + "end": 627, + "start_position": { + "type": "SourcePosition", + "row_index": 23, + "column_index": 24 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 23, + "column_index": 29 + } } }, { @@ -646,14 +1316,34 @@ "span": { "type": "Span", "start": 627, - "end": 634 + "end": 634, + "start_position": { + "type": "SourcePosition", + "row_index": 23, + "column_index": 29 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 23, + "column_index": 36 + } } } ], "span": { "type": "Span", "start": 612, - "end": 634 + "end": 634, + "start_position": { + "type": "SourcePosition", + "row_index": 23, + "column_index": 14 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 23, + "column_index": 36 + } } }, "attributes": [], @@ -661,13 +1351,33 @@ "span": { "type": "Span", "start": 598, - "end": 634 + "end": 634, + "start_position": { + "type": "SourcePosition", + "row_index": 23, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 23, + "column_index": 36 + } } } ], "span": { "type": "Span", "start": 0, - "end": 635 + "end": 635, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 24, + "column_index": 0 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/expressions_call_args.json b/fluent.syntax/tests/syntax/fixtures_structure/expressions_call_args.json index 3fd9bc08..956038fa 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/expressions_call_args.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/expressions_call_args.json @@ -9,7 +9,17 @@ "span": { "type": "Span", "start": 0, - "end": 3 + "end": 3, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 3 + } } }, "value": { @@ -25,7 +35,17 @@ "span": { "type": "Span", "start": 8, - "end": 11 + "end": 11, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 11 + } } }, "arguments": { @@ -40,7 +60,17 @@ "span": { "type": "Span", "start": 12, - "end": 16 + "end": 16, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 12 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 16 + } } }, "value": { @@ -49,13 +79,33 @@ "span": { "type": "Span", "start": 18, - "end": 19 + "end": 19, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 18 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 19 + } } }, "span": { "type": "Span", "start": 12, - "end": 19 + "end": 19, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 12 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 19 + } } }, { @@ -66,7 +116,17 @@ "span": { "type": "Span", "start": 33, - "end": 37 + "end": 37, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 12 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 16 + } } }, "value": { @@ -75,39 +135,99 @@ "span": { "type": "Span", "start": 39, - "end": 40 + "end": 40, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 18 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 19 + } } }, "span": { "type": "Span", "start": 33, - "end": 40 + "end": 40, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 12 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 19 + } } } ], "span": { "type": "Span", "start": 11, - "end": 41 + "end": 41, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 11 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 20 + } } }, "span": { "type": "Span", "start": 8, - "end": 41 + "end": 41, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 20 + } } }, "span": { "type": "Span", "start": 6, - "end": 43 + "end": 43, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 6 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 22 + } } } ], "span": { "type": "Span", "start": 6, - "end": 43 + "end": 43, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 6 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 22 + } } }, "attributes": [], @@ -115,13 +235,33 @@ "span": { "type": "Span", "start": 0, - "end": 43 + "end": 43, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 22 + } } } ], "span": { "type": "Span", "start": 0, - "end": 44 + "end": 44, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/indent.json b/fluent.syntax/tests/syntax/fixtures_structure/indent.json index 91c21991..0bfa8e88 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/indent.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/indent.json @@ -12,7 +12,17 @@ "span": { "type": "Span", "start": 0, - "end": 0 + "end": 0, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 2 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 2 + } } } ], @@ -20,7 +30,17 @@ "span": { "type": "Span", "start": 0, - "end": 13 + "end": 13, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 2 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + } } }, { @@ -31,7 +51,17 @@ "span": { "type": "Span", "start": 13, - "end": 17 + "end": 17, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 4 + } } }, "value": { @@ -47,27 +77,67 @@ "span": { "type": "Span", "start": 22, - "end": 23 + "end": 23, + "start_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 1 + } } }, "attribute": null, "span": { "type": "Span", "start": 22, - "end": 23 + "end": 23, + "start_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 1 + } } }, "span": { "type": "Span", "start": 20, - "end": 25 + "end": 25, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 7 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 3 + } } } ], "span": { "type": "Span", "start": 20, - "end": 25 + "end": 25, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 7 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 3 + } } }, "attributes": [], @@ -75,7 +145,17 @@ "span": { "type": "Span", "start": 13, - "end": 25 + "end": 25, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 3 + } } }, { @@ -86,7 +166,17 @@ "span": { "type": "Span", "start": 27, - "end": 31 + "end": 31, + "start_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 4 + } } }, "value": { @@ -102,27 +192,67 @@ "span": { "type": "Span", "start": 36, - "end": 37 + "end": 37, + "start_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 9 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 10 + } } }, "attribute": null, "span": { "type": "Span", "start": 36, - "end": 37 + "end": 37, + "start_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 9 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 10 + } } }, "span": { "type": "Span", "start": 34, - "end": 39 + "end": 39, + "start_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 7 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 1 + } } } ], "span": { "type": "Span", "start": 34, - "end": 39 + "end": 39, + "start_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 7 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 1 + } } }, "attributes": [], @@ -130,7 +260,17 @@ "span": { "type": "Span", "start": 27, - "end": 39 + "end": 39, + "start_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 1 + } } }, { @@ -141,7 +281,17 @@ "span": { "type": "Span", "start": 41, - "end": 45 + "end": 45, + "start_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 4 + } } }, "value": { @@ -159,33 +309,83 @@ "span": { "type": "Span", "start": 52, - "end": 53 + "end": 53, + "start_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 2 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 3 + } } }, "attribute": null, "span": { "type": "Span", "start": 52, - "end": 53 + "end": 53, + "start_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 2 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 3 + } } }, "span": { "type": "Span", "start": 50, - "end": 55 + "end": 55, + "start_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 5 + } } }, "span": { "type": "Span", "start": 48, - "end": 56 + "end": 56, + "start_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 7 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 6 + } } } ], "span": { "type": "Span", "start": 48, - "end": 56 + "end": 56, + "start_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 7 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 6 + } } }, "attributes": [], @@ -193,13 +393,33 @@ "span": { "type": "Span", "start": 41, - "end": 56 + "end": 56, + "start_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 6 + } } } ], "span": { "type": "Span", "start": 0, - "end": 57 + "end": 57, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 10, + "column_index": 0 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/junk.json b/fluent.syntax/tests/syntax/fixtures_structure/junk.json index df2c096c..665cb1bd 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/junk.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/junk.json @@ -14,7 +14,17 @@ "span": { "type": "Span", "start": 10, - "end": 10 + "end": 10, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 10 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 10 + } } } ], @@ -22,7 +32,17 @@ "span": { "type": "Span", "start": 0, - "end": 14 + "end": 14, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 0 + } } }, { @@ -38,7 +58,17 @@ "span": { "type": "Span", "start": 24, - "end": 24 + "end": 24, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 10 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 10 + } } } ], @@ -46,7 +76,17 @@ "span": { "type": "Span", "start": 14, - "end": 29 + "end": 29, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 0 + } } }, { @@ -62,7 +102,17 @@ "span": { "type": "Span", "start": 39, - "end": 39 + "end": 39, + "start_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 10 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 10 + } } } ], @@ -70,7 +120,17 @@ "span": { "type": "Span", "start": 29, - "end": 48 + "end": 48, + "start_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 0 + } } }, { @@ -86,7 +146,17 @@ "span": { "type": "Span", "start": 58, - "end": 58 + "end": 58, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 10 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 10 + } } } ], @@ -94,7 +164,17 @@ "span": { "type": "Span", "start": 48, - "end": 68 + "end": 68, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 10, + "column_index": 0 + } } }, { @@ -110,7 +190,17 @@ "span": { "type": "Span", "start": 80, - "end": 80 + "end": 80, + "start_position": { + "type": "SourcePosition", + "row_index": 12, + "column_index": 1 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 12, + "column_index": 1 + } } } ], @@ -118,7 +208,17 @@ "span": { "type": "Span", "start": 68, - "end": 84 + "end": 84, + "start_position": { + "type": "SourcePosition", + "row_index": 10, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 15, + "column_index": 0 + } } }, { @@ -134,7 +234,17 @@ "span": { "type": "Span", "start": 94, - "end": 94 + "end": 94, + "start_position": { + "type": "SourcePosition", + "row_index": 15, + "column_index": 10 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 15, + "column_index": 10 + } } } ], @@ -142,7 +252,17 @@ "span": { "type": "Span", "start": 84, - "end": 117 + "end": 117, + "start_position": { + "type": "SourcePosition", + "row_index": 15, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 19, + "column_index": 0 + } } }, { @@ -158,7 +278,17 @@ "span": { "type": "Span", "start": 128, - "end": 128 + "end": 128, + "start_position": { + "type": "SourcePosition", + "row_index": 22, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 22, + "column_index": 0 + } } } ], @@ -166,7 +296,17 @@ "span": { "type": "Span", "start": 117, - "end": 128 + "end": 128, + "start_position": { + "type": "SourcePosition", + "row_index": 19, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 22, + "column_index": 0 + } } }, { @@ -177,7 +317,17 @@ "span": { "type": "Span", "start": 128, - "end": 133 + "end": 133, + "start_position": { + "type": "SourcePosition", + "row_index": 22, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 22, + "column_index": 5 + } } }, "value": { @@ -189,14 +339,34 @@ "span": { "type": "Span", "start": 136, - "end": 141 + "end": 141, + "start_position": { + "type": "SourcePosition", + "row_index": 22, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 22, + "column_index": 13 + } } } ], "span": { "type": "Span", "start": 136, - "end": 141 + "end": 141, + "start_position": { + "type": "SourcePosition", + "row_index": 22, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 22, + "column_index": 13 + } } }, "attributes": [], @@ -204,7 +374,17 @@ "span": { "type": "Span", "start": 128, - "end": 141 + "end": 141, + "start_position": { + "type": "SourcePosition", + "row_index": 22, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 22, + "column_index": 13 + } } }, { @@ -218,7 +398,17 @@ "span": { "type": "Span", "start": 153, - "end": 153 + "end": 153, + "start_position": { + "type": "SourcePosition", + "row_index": 25, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 25, + "column_index": 0 + } } } ], @@ -226,13 +416,33 @@ "span": { "type": "Span", "start": 143, - "end": 153 + "end": 153, + "start_position": { + "type": "SourcePosition", + "row_index": 24, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 26, + "column_index": 0 + } } } ], "span": { "type": "Span", "start": 0, - "end": 153 + "end": 153, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 26, + "column_index": 1 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/leading_dots.json b/fluent.syntax/tests/syntax/fixtures_structure/leading_dots.json index 4cc4bf2b..b2cf7121 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/leading_dots.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/leading_dots.json @@ -9,7 +9,17 @@ "span": { "type": "Span", "start": 0, - "end": 5 + "end": 5, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 5 + } } }, "value": { @@ -21,14 +31,34 @@ "span": { "type": "Span", "start": 8, - "end": 14 + "end": 14, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 14 + } } } ], "span": { "type": "Span", "start": 8, - "end": 14 + "end": 14, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 14 + } } }, "attributes": [], @@ -36,7 +66,17 @@ "span": { "type": "Span", "start": 0, - "end": 14 + "end": 14, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 14 + } } }, { @@ -47,7 +87,17 @@ "span": { "type": "Span", "start": 15, - "end": 20 + "end": 20, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 5 + } } }, "value": { @@ -59,14 +109,34 @@ "span": { "type": "Span", "start": 23, - "end": 29 + "end": 29, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 14 + } } } ], "span": { "type": "Span", "start": 23, - "end": 29 + "end": 29, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 14 + } } }, "attributes": [], @@ -74,7 +144,17 @@ "span": { "type": "Span", "start": 15, - "end": 29 + "end": 29, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 14 + } } }, { @@ -85,7 +165,17 @@ "span": { "type": "Span", "start": 30, - "end": 35 + "end": 35, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 5 + } } }, "value": { @@ -99,13 +189,33 @@ "span": { "type": "Span", "start": 39, - "end": 42 + "end": 42, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 9 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 12 + } } }, "span": { "type": "Span", "start": 38, - "end": 43 + "end": 43, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 13 + } } }, { @@ -114,14 +224,34 @@ "span": { "type": "Span", "start": 43, - "end": 48 + "end": 48, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 13 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 18 + } } } ], "span": { "type": "Span", "start": 38, - "end": 48 + "end": 48, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 18 + } } }, "attributes": [], @@ -129,7 +259,17 @@ "span": { "type": "Span", "start": 30, - "end": 48 + "end": 48, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 18 + } } }, { @@ -140,7 +280,17 @@ "span": { "type": "Span", "start": 49, - "end": 54 + "end": 54, + "start_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 5 + } } }, "value": { @@ -154,13 +304,33 @@ "span": { "type": "Span", "start": 62, - "end": 65 + "end": 65, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 13 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 16 + } } }, "span": { "type": "Span", "start": 61, - "end": 66 + "end": 66, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 12 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 17 + } } }, { @@ -169,14 +339,34 @@ "span": { "type": "Span", "start": 66, - "end": 71 + "end": 71, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 17 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 22 + } } } ], "span": { "type": "Span", "start": 57, - "end": 71 + "end": 71, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 22 + } } }, "attributes": [], @@ -184,7 +374,17 @@ "span": { "type": "Span", "start": 49, - "end": 71 + "end": 71, + "start_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 22 + } } }, { @@ -195,7 +395,17 @@ "span": { "type": "Span", "start": 73, - "end": 78 + "end": 78, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 5 + } } }, "value": { @@ -207,7 +417,17 @@ "span": { "type": "Span", "start": 81, - "end": 91 + "end": 91, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 12 + } } }, { @@ -218,13 +438,33 @@ "span": { "type": "Span", "start": 92, - "end": 95 + "end": 95, + "start_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 13 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 16 + } } }, "span": { "type": "Span", "start": 91, - "end": 96 + "end": 96, + "start_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 12 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 17 + } } }, { @@ -233,14 +473,34 @@ "span": { "type": "Span", "start": 96, - "end": 105 + "end": 105, + "start_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 17 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 26 + } } } ], "span": { "type": "Span", "start": 81, - "end": 105 + "end": 105, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 26 + } } }, "attributes": [], @@ -248,7 +508,17 @@ "span": { "type": "Span", "start": 73, - "end": 105 + "end": 105, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 26 + } } }, { @@ -259,7 +529,17 @@ "span": { "type": "Span", "start": 107, - "end": 112 + "end": 112, + "start_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 5 + } } }, "value": { @@ -271,7 +551,17 @@ "span": { "type": "Span", "start": 115, - "end": 126 + "end": 126, + "start_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 10, + "column_index": 12 + } } }, { @@ -282,13 +572,33 @@ "span": { "type": "Span", "start": 127, - "end": 130 + "end": 130, + "start_position": { + "type": "SourcePosition", + "row_index": 10, + "column_index": 13 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 10, + "column_index": 16 + } } }, "span": { "type": "Span", "start": 126, - "end": 131 + "end": 131, + "start_position": { + "type": "SourcePosition", + "row_index": 10, + "column_index": 12 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 10, + "column_index": 17 + } } }, { @@ -297,14 +607,34 @@ "span": { "type": "Span", "start": 131, - "end": 140 + "end": 140, + "start_position": { + "type": "SourcePosition", + "row_index": 10, + "column_index": 17 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 10, + "column_index": 26 + } } } ], "span": { "type": "Span", "start": 115, - "end": 140 + "end": 140, + "start_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 10, + "column_index": 26 + } } }, "attributes": [], @@ -312,7 +642,17 @@ "span": { "type": "Span", "start": 107, - "end": 140 + "end": 140, + "start_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 10, + "column_index": 26 + } } }, { @@ -321,7 +661,17 @@ "span": { "type": "Span", "start": 142, - "end": 185 + "end": 185, + "start_position": { + "type": "SourcePosition", + "row_index": 12, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 12, + "column_index": 43 + } } }, { @@ -337,7 +687,17 @@ "span": { "type": "Span", "start": 214, - "end": 214 + "end": 214, + "start_position": { + "type": "SourcePosition", + "row_index": 15, + "column_index": 14 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 15, + "column_index": 14 + } } } ], @@ -345,7 +705,17 @@ "span": { "type": "Span", "start": 186, - "end": 216 + "end": 216, + "start_position": { + "type": "SourcePosition", + "row_index": 13, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 18, + "column_index": 0 + } } }, { @@ -354,7 +724,17 @@ "span": { "type": "Span", "start": 216, - "end": 255 + "end": 255, + "start_position": { + "type": "SourcePosition", + "row_index": 18, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 18, + "column_index": 39 + } } }, { @@ -370,7 +750,17 @@ "span": { "type": "Span", "start": 274, - "end": 274 + "end": 274, + "start_position": { + "type": "SourcePosition", + "row_index": 20, + "column_index": 14 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 20, + "column_index": 14 + } } } ], @@ -378,7 +768,17 @@ "span": { "type": "Span", "start": 256, - "end": 276 + "end": 276, + "start_position": { + "type": "SourcePosition", + "row_index": 19, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 23, + "column_index": 0 + } } }, { @@ -387,7 +787,17 @@ "span": { "type": "Span", "start": 276, - "end": 315 + "end": 315, + "start_position": { + "type": "SourcePosition", + "row_index": 23, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 23, + "column_index": 39 + } } }, { @@ -403,7 +813,17 @@ "span": { "type": "Span", "start": 334, - "end": 334 + "end": 334, + "start_position": { + "type": "SourcePosition", + "row_index": 25, + "column_index": 14 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 25, + "column_index": 14 + } } } ], @@ -411,7 +831,17 @@ "span": { "type": "Span", "start": 316, - "end": 350 + "end": 350, + "start_position": { + "type": "SourcePosition", + "row_index": 24, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 29, + "column_index": 0 + } } }, { @@ -422,7 +852,17 @@ "span": { "type": "Span", "start": 350, - "end": 355 + "end": 355, + "start_position": { + "type": "SourcePosition", + "row_index": 29, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 29, + "column_index": 5 + } } }, "value": null, @@ -435,7 +875,17 @@ "span": { "type": "Span", "start": 363, - "end": 368 + "end": 368, + "start_position": { + "type": "SourcePosition", + "row_index": 30, + "column_index": 9 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 30, + "column_index": 14 + } } }, "value": { @@ -447,20 +897,50 @@ "span": { "type": "Span", "start": 371, - "end": 414 + "end": 414, + "start_position": { + "type": "SourcePosition", + "row_index": 30, + "column_index": 17 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 31, + "column_index": 21 + } } } ], "span": { "type": "Span", "start": 371, - "end": 414 + "end": 414, + "start_position": { + "type": "SourcePosition", + "row_index": 30, + "column_index": 17 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 31, + "column_index": 21 + } } }, "span": { "type": "Span", "start": 362, - "end": 414 + "end": 414, + "start_position": { + "type": "SourcePosition", + "row_index": 30, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 31, + "column_index": 21 + } } } ], @@ -468,7 +948,17 @@ "span": { "type": "Span", "start": 350, - "end": 414 + "end": 414, + "start_position": { + "type": "SourcePosition", + "row_index": 29, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 31, + "column_index": 21 + } } }, { @@ -479,7 +969,17 @@ "span": { "type": "Span", "start": 416, - "end": 421 + "end": 421, + "start_position": { + "type": "SourcePosition", + "row_index": 33, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 33, + "column_index": 5 + } } }, "value": { @@ -493,13 +993,33 @@ "span": { "type": "Span", "start": 429, - "end": 432 + "end": 432, + "start_position": { + "type": "SourcePosition", + "row_index": 34, + "column_index": 13 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 34, + "column_index": 16 + } } }, "span": { "type": "Span", "start": 428, - "end": 433 + "end": 433, + "start_position": { + "type": "SourcePosition", + "row_index": 34, + "column_index": 12 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 34, + "column_index": 17 + } } }, { @@ -508,14 +1028,34 @@ "span": { "type": "Span", "start": 433, - "end": 484 + "end": 484, + "start_position": { + "type": "SourcePosition", + "row_index": 34, + "column_index": 17 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 35, + "column_index": 21 + } } } ], "span": { "type": "Span", "start": 424, - "end": 484 + "end": 484, + "start_position": { + "type": "SourcePosition", + "row_index": 34, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 35, + "column_index": 21 + } } }, "attributes": [], @@ -523,7 +1063,17 @@ "span": { "type": "Span", "start": 416, - "end": 484 + "end": 484, + "start_position": { + "type": "SourcePosition", + "row_index": 33, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 35, + "column_index": 21 + } } }, { @@ -534,7 +1084,17 @@ "span": { "type": "Span", "start": 486, - "end": 491 + "end": 491, + "start_position": { + "type": "SourcePosition", + "row_index": 37, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 37, + "column_index": 5 + } } }, "value": null, @@ -547,7 +1107,17 @@ "span": { "type": "Span", "start": 499, - "end": 508 + "end": 508, + "start_position": { + "type": "SourcePosition", + "row_index": 38, + "column_index": 9 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 38, + "column_index": 18 + } } }, "value": { @@ -559,20 +1129,50 @@ "span": { "type": "Span", "start": 515, - "end": 516 + "end": 516, + "start_position": { + "type": "SourcePosition", + "row_index": 39, + "column_index": 12 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 39, + "column_index": 13 + } } } ], "span": { "type": "Span", "start": 511, - "end": 516 + "end": 516, + "start_position": { + "type": "SourcePosition", + "row_index": 39, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 39, + "column_index": 13 + } } }, "span": { "type": "Span", "start": 498, - "end": 516 + "end": 516, + "start_position": { + "type": "SourcePosition", + "row_index": 38, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 39, + "column_index": 13 + } } } ], @@ -580,7 +1180,17 @@ "span": { "type": "Span", "start": 486, - "end": 516 + "end": 516, + "start_position": { + "type": "SourcePosition", + "row_index": 37, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 39, + "column_index": 13 + } } }, { @@ -591,7 +1201,17 @@ "span": { "type": "Span", "start": 522, - "end": 527 + "end": 527, + "start_position": { + "type": "SourcePosition", + "row_index": 41, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 41, + "column_index": 5 + } } }, "value": null, @@ -604,7 +1224,17 @@ "span": { "type": "Span", "start": 535, - "end": 544 + "end": 544, + "start_position": { + "type": "SourcePosition", + "row_index": 42, + "column_index": 9 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 42, + "column_index": 18 + } } }, "value": { @@ -616,20 +1246,50 @@ "span": { "type": "Span", "start": 547, - "end": 553 + "end": 553, + "start_position": { + "type": "SourcePosition", + "row_index": 42, + "column_index": 21 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 42, + "column_index": 27 + } } } ], "span": { "type": "Span", "start": 547, - "end": 553 + "end": 553, + "start_position": { + "type": "SourcePosition", + "row_index": 42, + "column_index": 21 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 42, + "column_index": 27 + } } }, "span": { "type": "Span", "start": 534, - "end": 553 + "end": 553, + "start_position": { + "type": "SourcePosition", + "row_index": 42, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 42, + "column_index": 27 + } } } ], @@ -637,7 +1297,17 @@ "span": { "type": "Span", "start": 522, - "end": 553 + "end": 553, + "start_position": { + "type": "SourcePosition", + "row_index": 41, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 42, + "column_index": 27 + } } }, { @@ -648,7 +1318,17 @@ "span": { "type": "Span", "start": 555, - "end": 560 + "end": 560, + "start_position": { + "type": "SourcePosition", + "row_index": 44, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 44, + "column_index": 5 + } } }, "value": null, @@ -661,7 +1341,17 @@ "span": { "type": "Span", "start": 568, - "end": 577 + "end": 577, + "start_position": { + "type": "SourcePosition", + "row_index": 45, + "column_index": 9 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 45, + "column_index": 18 + } } }, "value": { @@ -675,13 +1365,33 @@ "span": { "type": "Span", "start": 590, - "end": 593 + "end": 593, + "start_position": { + "type": "SourcePosition", + "row_index": 46, + "column_index": 28 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 46, + "column_index": 31 + } } }, "span": { "type": "Span", "start": 589, - "end": 594 + "end": 594, + "start_position": { + "type": "SourcePosition", + "row_index": 46, + "column_index": 27 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 46, + "column_index": 32 + } } }, { @@ -690,20 +1400,50 @@ "span": { "type": "Span", "start": 594, - "end": 599 + "end": 599, + "start_position": { + "type": "SourcePosition", + "row_index": 46, + "column_index": 32 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 46, + "column_index": 37 + } } } ], "span": { "type": "Span", "start": 580, - "end": 599 + "end": 599, + "start_position": { + "type": "SourcePosition", + "row_index": 46, + "column_index": 18 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 46, + "column_index": 37 + } } }, "span": { "type": "Span", "start": 567, - "end": 599 + "end": 599, + "start_position": { + "type": "SourcePosition", + "row_index": 45, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 46, + "column_index": 37 + } } } ], @@ -711,7 +1451,17 @@ "span": { "type": "Span", "start": 555, - "end": 599 + "end": 599, + "start_position": { + "type": "SourcePosition", + "row_index": 44, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 46, + "column_index": 37 + } } }, { @@ -722,7 +1472,17 @@ "span": { "type": "Span", "start": 601, - "end": 606 + "end": 606, + "start_position": { + "type": "SourcePosition", + "row_index": 48, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 48, + "column_index": 5 + } } }, "value": { @@ -738,7 +1498,17 @@ "span": { "type": "Span", "start": 615, - "end": 616 + "end": 616, + "start_position": { + "type": "SourcePosition", + "row_index": 49, + "column_index": 14 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 49, + "column_index": 15 + } } }, "variants": [ @@ -750,7 +1520,17 @@ "span": { "type": "Span", "start": 629, - "end": 632 + "end": 632, + "start_position": { + "type": "SourcePosition", + "row_index": 50, + "column_index": 9 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 50, + "column_index": 12 + } } }, "value": { @@ -762,21 +1542,51 @@ "span": { "type": "Span", "start": 634, - "end": 640 + "end": 640, + "start_position": { + "type": "SourcePosition", + "row_index": 50, + "column_index": 14 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 50, + "column_index": 20 + } } } ], "span": { "type": "Span", "start": 634, - "end": 640 + "end": 640, + "start_position": { + "type": "SourcePosition", + "row_index": 50, + "column_index": 14 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 50, + "column_index": 20 + } } }, "default": false, "span": { "type": "Span", "start": 628, - "end": 640 + "end": 640, + "start_position": { + "type": "SourcePosition", + "row_index": 50, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 50, + "column_index": 20 + } } }, { @@ -787,7 +1597,17 @@ "span": { "type": "Span", "start": 650, - "end": 655 + "end": 655, + "start_position": { + "type": "SourcePosition", + "row_index": 51, + "column_index": 9 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 51, + "column_index": 14 + } } }, "value": { @@ -801,13 +1621,33 @@ "span": { "type": "Span", "start": 670, - "end": 673 + "end": 673, + "start_position": { + "type": "SourcePosition", + "row_index": 52, + "column_index": 37 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 52, + "column_index": 40 + } } }, "span": { "type": "Span", "start": 669, - "end": 674 + "end": 674, + "start_position": { + "type": "SourcePosition", + "row_index": 52, + "column_index": 36 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 52, + "column_index": 41 + } } }, { @@ -816,41 +1656,101 @@ "span": { "type": "Span", "start": 674, - "end": 679 + "end": 679, + "start_position": { + "type": "SourcePosition", + "row_index": 52, + "column_index": 41 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 52, + "column_index": 46 + } } } ], "span": { "type": "Span", "start": 657, - "end": 679 + "end": 679, + "start_position": { + "type": "SourcePosition", + "row_index": 52, + "column_index": 24 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 52, + "column_index": 46 + } } }, "default": true, "span": { "type": "Span", "start": 648, - "end": 679 + "end": 679, + "start_position": { + "type": "SourcePosition", + "row_index": 51, + "column_index": 7 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 52, + "column_index": 46 + } } } ], "span": { "type": "Span", "start": 615, - "end": 684 + "end": 684, + "start_position": { + "type": "SourcePosition", + "row_index": 49, + "column_index": 14 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 53, + "column_index": 4 + } } }, "span": { "type": "Span", "start": 613, - "end": 685 + "end": 685, + "start_position": { + "type": "SourcePosition", + "row_index": 49, + "column_index": 12 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 53, + "column_index": 5 + } } } ], "span": { "type": "Span", "start": 609, - "end": 685 + "end": 685, + "start_position": { + "type": "SourcePosition", + "row_index": 49, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 53, + "column_index": 5 + } } }, "attributes": [], @@ -858,7 +1758,17 @@ "span": { "type": "Span", "start": 601, - "end": 685 + "end": 685, + "start_position": { + "type": "SourcePosition", + "row_index": 48, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 53, + "column_index": 5 + } } }, { @@ -867,7 +1777,17 @@ "span": { "type": "Span", "start": 687, - "end": 722 + "end": 722, + "start_position": { + "type": "SourcePosition", + "row_index": 55, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 55, + "column_index": 35 + } } }, { @@ -881,7 +1801,17 @@ "span": { "type": "Span", "start": 755, - "end": 755 + "end": 755, + "start_position": { + "type": "SourcePosition", + "row_index": 58, + "column_index": 13 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 58, + "column_index": 13 + } } } ], @@ -889,7 +1819,17 @@ "span": { "type": "Span", "start": 723, - "end": 781 + "end": 781, + "start_position": { + "type": "SourcePosition", + "row_index": 56, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 63, + "column_index": 0 + } } }, { @@ -898,7 +1838,17 @@ "span": { "type": "Span", "start": 781, - "end": 809 + "end": 809, + "start_position": { + "type": "SourcePosition", + "row_index": 63, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 63, + "column_index": 28 + } } }, { @@ -914,7 +1864,17 @@ "span": { "type": "Span", "start": 860, - "end": 860 + "end": 860, + "start_position": { + "type": "SourcePosition", + "row_index": 67, + "column_index": 11 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 67, + "column_index": 11 + } } } ], @@ -922,13 +1882,33 @@ "span": { "type": "Span", "start": 810, - "end": 877 + "end": 877, + "start_position": { + "type": "SourcePosition", + "row_index": 64, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 70, + "column_index": 0 + } } } ], "span": { "type": "Span", "start": 0, - "end": 877 + "end": 877, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 70, + "column_index": 1 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/leading_empty_lines.json b/fluent.syntax/tests/syntax/fixtures_structure/leading_empty_lines.json index 904b9738..3a43c335 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/leading_empty_lines.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/leading_empty_lines.json @@ -9,7 +9,17 @@ "span": { "type": "Span", "start": 2, - "end": 7 + "end": 7, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 5 + } } }, "value": { @@ -21,14 +31,34 @@ "span": { "type": "Span", "start": 10, - "end": 15 + "end": 15, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 13 + } } } ], "span": { "type": "Span", "start": 10, - "end": 15 + "end": 15, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 13 + } } }, "attributes": [], @@ -36,13 +66,33 @@ "span": { "type": "Span", "start": 2, - "end": 15 + "end": 15, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 13 + } } } ], "span": { "type": "Span", "start": 0, - "end": 16 + "end": 16, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 0 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/leading_empty_lines_with_ws.json b/fluent.syntax/tests/syntax/fixtures_structure/leading_empty_lines_with_ws.json index 3e14614c..f73a2800 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/leading_empty_lines_with_ws.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/leading_empty_lines_with_ws.json @@ -9,7 +9,17 @@ "span": { "type": "Span", "start": 10, - "end": 15 + "end": 15, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 5 + } } }, "value": { @@ -21,14 +31,34 @@ "span": { "type": "Span", "start": 18, - "end": 23 + "end": 23, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 13 + } } } ], "span": { "type": "Span", "start": 18, - "end": 23 + "end": 23, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 13 + } } }, "attributes": [], @@ -36,13 +66,33 @@ "span": { "type": "Span", "start": 10, - "end": 23 + "end": 23, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 13 + } } } ], "span": { "type": "Span", "start": 0, - "end": 24 + "end": 24, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 0 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/message_reference_as_selector.json b/fluent.syntax/tests/syntax/fixtures_structure/message_reference_as_selector.json index 392c1a33..28395d0c 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/message_reference_as_selector.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/message_reference_as_selector.json @@ -12,7 +12,17 @@ "span": { "type": "Span", "start": 17, - "end": 17 + "end": 17, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 18 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 18 + } } } ], @@ -20,13 +30,33 @@ "span": { "type": "Span", "start": 0, - "end": 42 + "end": 42, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 0 + } } } ], "span": { "type": "Span", "start": 0, - "end": 42 + "end": 42, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 1 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/message_with_empty_multiline_pattern.json b/fluent.syntax/tests/syntax/fixtures_structure/message_with_empty_multiline_pattern.json index 7cedf490..816f9888 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/message_with_empty_multiline_pattern.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/message_with_empty_multiline_pattern.json @@ -7,7 +7,17 @@ "span": { "type": "Span", "start": 0, - "end": 316 + "end": 316, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 70 + } } }, { @@ -23,7 +33,17 @@ "span": { "type": "Span", "start": 324, - "end": 324 + "end": 324, + "start_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 6 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 6 + } } } ], @@ -31,7 +51,17 @@ "span": { "type": "Span", "start": 318, - "end": 329 + "end": 329, + "start_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 11, + "column_index": 0 + } } }, { @@ -47,7 +77,17 @@ "span": { "type": "Span", "start": 335, - "end": 335 + "end": 335, + "start_position": { + "type": "SourcePosition", + "row_index": 11, + "column_index": 6 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 11, + "column_index": 6 + } } } ], @@ -55,13 +95,33 @@ "span": { "type": "Span", "start": 329, - "end": 338 + "end": 338, + "start_position": { + "type": "SourcePosition", + "row_index": 11, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 13, + "column_index": 1 + } } } ], "span": { "type": "Span", "start": 0, - "end": 338 + "end": 338, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 13, + "column_index": 1 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/message_with_empty_pattern.json b/fluent.syntax/tests/syntax/fixtures_structure/message_with_empty_pattern.json index 18b78ba5..28bab427 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/message_with_empty_pattern.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/message_with_empty_pattern.json @@ -7,7 +7,17 @@ "span": { "type": "Span", "start": 0, - "end": 327 + "end": 327, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 62 + } } }, { @@ -23,7 +33,17 @@ "span": { "type": "Span", "start": 335, - "end": 335 + "end": 335, + "start_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 6 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 6 + } } } ], @@ -31,7 +51,17 @@ "span": { "type": "Span", "start": 329, - "end": 337 + "end": 337, + "start_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 0 + } } }, { @@ -47,7 +77,17 @@ "span": { "type": "Span", "start": 343, - "end": 343 + "end": 343, + "start_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 6 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 6 + } } } ], @@ -55,7 +95,17 @@ "span": { "type": "Span", "start": 337, - "end": 346 + "end": 346, + "start_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 11, + "column_index": 0 + } } }, { @@ -66,7 +116,17 @@ "span": { "type": "Span", "start": 346, - "end": 350 + "end": 350, + "start_position": { + "type": "SourcePosition", + "row_index": 11, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 11, + "column_index": 4 + } } }, "value": null, @@ -79,7 +139,17 @@ "span": { "type": "Span", "start": 358, - "end": 362 + "end": 362, + "start_position": { + "type": "SourcePosition", + "row_index": 12, + "column_index": 9 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 12, + "column_index": 13 + } } }, "value": { @@ -91,20 +161,50 @@ "span": { "type": "Span", "start": 365, - "end": 369 + "end": 369, + "start_position": { + "type": "SourcePosition", + "row_index": 12, + "column_index": 16 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 12, + "column_index": 20 + } } } ], "span": { "type": "Span", "start": 365, - "end": 369 + "end": 369, + "start_position": { + "type": "SourcePosition", + "row_index": 12, + "column_index": 16 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 12, + "column_index": 20 + } } }, "span": { "type": "Span", "start": 357, - "end": 369 + "end": 369, + "start_position": { + "type": "SourcePosition", + "row_index": 12, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 12, + "column_index": 20 + } } } ], @@ -112,7 +212,17 @@ "span": { "type": "Span", "start": 346, - "end": 369 + "end": 369, + "start_position": { + "type": "SourcePosition", + "row_index": 11, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 12, + "column_index": 20 + } } }, { @@ -123,7 +233,17 @@ "span": { "type": "Span", "start": 371, - "end": 375 + "end": 375, + "start_position": { + "type": "SourcePosition", + "row_index": 14, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 14, + "column_index": 4 + } } }, "value": null, @@ -136,7 +256,17 @@ "span": { "type": "Span", "start": 384, - "end": 388 + "end": 388, + "start_position": { + "type": "SourcePosition", + "row_index": 15, + "column_index": 9 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 15, + "column_index": 13 + } } }, "value": { @@ -148,20 +278,50 @@ "span": { "type": "Span", "start": 391, - "end": 395 + "end": 395, + "start_position": { + "type": "SourcePosition", + "row_index": 15, + "column_index": 16 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 15, + "column_index": 20 + } } } ], "span": { "type": "Span", "start": 391, - "end": 395 + "end": 395, + "start_position": { + "type": "SourcePosition", + "row_index": 15, + "column_index": 16 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 15, + "column_index": 20 + } } }, "span": { "type": "Span", "start": 383, - "end": 395 + "end": 395, + "start_position": { + "type": "SourcePosition", + "row_index": 15, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 15, + "column_index": 20 + } } } ], @@ -169,7 +329,17 @@ "span": { "type": "Span", "start": 371, - "end": 395 + "end": 395, + "start_position": { + "type": "SourcePosition", + "row_index": 14, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 15, + "column_index": 20 + } } }, { @@ -185,7 +355,17 @@ "span": { "type": "Span", "start": 403, - "end": 403 + "end": 403, + "start_position": { + "type": "SourcePosition", + "row_index": 17, + "column_index": 6 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 17, + "column_index": 6 + } } } ], @@ -193,13 +373,33 @@ "span": { "type": "Span", "start": 397, - "end": 403 + "end": 403, + "start_position": { + "type": "SourcePosition", + "row_index": 17, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 17, + "column_index": 6 + } } } ], "span": { "type": "Span", "start": 0, - "end": 403 + "end": 403, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 17, + "column_index": 6 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/multiline-comment.json b/fluent.syntax/tests/syntax/fixtures_structure/multiline-comment.json index d59abe20..c33a1c64 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/multiline-comment.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/multiline-comment.json @@ -7,7 +7,17 @@ "span": { "type": "Span", "start": 1, - "end": 48 + "end": 48, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 35 + } } }, { @@ -18,7 +28,17 @@ "span": { "type": "Span", "start": 50, - "end": 53 + "end": 53, + "start_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 3 + } } }, "value": { @@ -30,14 +50,34 @@ "span": { "type": "Span", "start": 56, - "end": 61 + "end": 61, + "start_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 6 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 11 + } } } ], "span": { "type": "Span", "start": 56, - "end": 61 + "end": 61, + "start_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 6 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 11 + } } }, "attributes": [], @@ -45,13 +85,33 @@ "span": { "type": "Span", "start": 50, - "end": 61 + "end": 61, + "start_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 11 + } } } ], "span": { "type": "Span", "start": 0, - "end": 62 + "end": 62, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 0 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/multiline_pattern.json b/fluent.syntax/tests/syntax/fixtures_structure/multiline_pattern.json index c54b4fd8..7da612d8 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/multiline_pattern.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/multiline_pattern.json @@ -9,7 +9,17 @@ "span": { "type": "Span", "start": 0, - "end": 5 + "end": 5, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 5 + } } }, "value": { @@ -21,14 +31,34 @@ "span": { "type": "Span", "start": 8, - "end": 33 + "end": 33, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 27 + } } } ], "span": { "type": "Span", "start": 8, - "end": 33 + "end": 33, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 27 + } } }, "attributes": [], @@ -36,7 +66,17 @@ "span": { "type": "Span", "start": 0, - "end": 33 + "end": 33, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 27 + } } }, { @@ -47,7 +87,17 @@ "span": { "type": "Span", "start": 35, - "end": 40 + "end": 40, + "start_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 5 + } } }, "value": { @@ -59,14 +109,34 @@ "span": { "type": "Span", "start": 47, - "end": 72 + "end": 72, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 12 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 27 + } } } ], "span": { "type": "Span", "start": 43, - "end": 72 + "end": 72, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 27 + } } }, "attributes": [], @@ -74,7 +144,17 @@ "span": { "type": "Span", "start": 35, - "end": 72 + "end": 72, + "start_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 27 + } } }, { @@ -85,7 +165,17 @@ "span": { "type": "Span", "start": 159, - "end": 164 + "end": 164, + "start_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 5 + } } }, "value": { @@ -97,14 +187,34 @@ "span": { "type": "Span", "start": 171, - "end": 176 + "end": 176, + "start_position": { + "type": "SourcePosition", + "row_index": 10, + "column_index": 12 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 10, + "column_index": 17 + } } } ], "span": { "type": "Span", "start": 167, - "end": 176 + "end": 176, + "start_position": { + "type": "SourcePosition", + "row_index": 10, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 10, + "column_index": 17 + } } }, "attributes": [], @@ -114,13 +224,33 @@ "span": { "type": "Span", "start": 74, - "end": 158 + "end": 158, + "start_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 38 + } } }, "span": { "type": "Span", "start": 74, - "end": 176 + "end": 176, + "start_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 10, + "column_index": 17 + } } }, { @@ -136,7 +266,17 @@ "span": { "type": "Span", "start": 187, - "end": 187 + "end": 187, + "start_position": { + "type": "SourcePosition", + "row_index": 11, + "column_index": 10 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 11, + "column_index": 10 + } } } ], @@ -144,7 +284,17 @@ "span": { "type": "Span", "start": 177, - "end": 207 + "end": 207, + "start_position": { + "type": "SourcePosition", + "row_index": 11, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 14, + "column_index": 0 + } } }, { @@ -155,7 +305,17 @@ "span": { "type": "Span", "start": 299, - "end": 304 + "end": 304, + "start_position": { + "type": "SourcePosition", + "row_index": 16, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 16, + "column_index": 5 + } } }, "value": { @@ -167,14 +327,34 @@ "span": { "type": "Span", "start": 311, - "end": 316 + "end": 316, + "start_position": { + "type": "SourcePosition", + "row_index": 17, + "column_index": 12 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 17, + "column_index": 17 + } } } ], "span": { "type": "Span", "start": 307, - "end": 316 + "end": 316, + "start_position": { + "type": "SourcePosition", + "row_index": 17, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 17, + "column_index": 17 + } } }, "attributes": [], @@ -184,13 +364,33 @@ "span": { "type": "Span", "start": 207, - "end": 298 + "end": 298, + "start_position": { + "type": "SourcePosition", + "row_index": 14, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 15, + "column_index": 38 + } } }, "span": { "type": "Span", "start": 207, - "end": 316 + "end": 316, + "start_position": { + "type": "SourcePosition", + "row_index": 16, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 17, + "column_index": 17 + } } }, { @@ -206,7 +406,17 @@ "span": { "type": "Span", "start": 327, - "end": 327 + "end": 327, + "start_position": { + "type": "SourcePosition", + "row_index": 18, + "column_index": 10 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 18, + "column_index": 10 + } } } ], @@ -214,7 +424,17 @@ "span": { "type": "Span", "start": 317, - "end": 332 + "end": 332, + "start_position": { + "type": "SourcePosition", + "row_index": 18, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 19, + "column_index": 0 + } } }, { @@ -230,7 +450,17 @@ "span": { "type": "Span", "start": 336, - "end": 336 + "end": 336, + "start_position": { + "type": "SourcePosition", + "row_index": 19, + "column_index": 4 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 19, + "column_index": 4 + } } } ], @@ -238,13 +468,33 @@ "span": { "type": "Span", "start": 332, - "end": 347 + "end": 347, + "start_position": { + "type": "SourcePosition", + "row_index": 19, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 20, + "column_index": 0 + } } } ], "span": { "type": "Span", "start": 0, - "end": 347 + "end": 347, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 20, + "column_index": 1 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/multiline_string.json b/fluent.syntax/tests/syntax/fixtures_structure/multiline_string.json index 431307d7..633501c9 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/multiline_string.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/multiline_string.json @@ -12,7 +12,17 @@ "span": { "type": "Span", "start": 24, - "end": 24 + "end": 24, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 24 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 24 + } } } ], @@ -20,13 +30,33 @@ "span": { "type": "Span", "start": 0, - "end": 40 + "end": 40, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 0 + } } } ], "span": { "type": "Span", "start": 0, - "end": 40 + "end": 40, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 1 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/multiline_with_non_empty_first_line.json b/fluent.syntax/tests/syntax/fixtures_structure/multiline_with_non_empty_first_line.json index 53275453..cbf58422 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/multiline_with_non_empty_first_line.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/multiline_with_non_empty_first_line.json @@ -9,7 +9,17 @@ "span": { "type": "Span", "start": 0, - "end": 3 + "end": 3, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 3 + } } }, "value": { @@ -21,14 +31,34 @@ "span": { "type": "Span", "start": 6, - "end": 23 + "end": 23, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 6 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 19 + } } } ], "span": { "type": "Span", "start": 6, - "end": 23 + "end": 23, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 6 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 19 + } } }, "attributes": [], @@ -36,13 +66,33 @@ "span": { "type": "Span", "start": 0, - "end": 23 + "end": 23, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 19 + } } } ], "span": { "type": "Span", "start": 0, - "end": 24 + "end": 24, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/multiline_with_placeables.json b/fluent.syntax/tests/syntax/fixtures_structure/multiline_with_placeables.json index 8268bd5f..51b1e084 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/multiline_with_placeables.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/multiline_with_placeables.json @@ -9,7 +9,17 @@ "span": { "type": "Span", "start": 0, - "end": 3 + "end": 3, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 3 + } } }, "value": { @@ -21,7 +31,17 @@ "span": { "type": "Span", "start": 10, - "end": 14 + "end": 14, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 12 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 16 + } } }, { @@ -34,20 +54,50 @@ "span": { "type": "Span", "start": 16, - "end": 19 + "end": 19, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 18 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 21 + } } }, "attribute": null, "span": { "type": "Span", "start": 16, - "end": 19 + "end": 19, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 18 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 21 + } } }, "span": { "type": "Span", "start": 14, - "end": 21 + "end": 21, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 16 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 23 + } } }, { @@ -56,14 +106,34 @@ "span": { "type": "Span", "start": 21, - "end": 29 + "end": 29, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 23 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 15 + } } } ], "span": { "type": "Span", "start": 6, - "end": 29 + "end": 29, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 15 + } } }, "attributes": [], @@ -71,13 +141,33 @@ "span": { "type": "Span", "start": 0, - "end": 29 + "end": 29, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 15 + } } } ], "span": { "type": "Span", "start": 0, - "end": 30 + "end": 30, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 0 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/non_id_attribute_name.json b/fluent.syntax/tests/syntax/fixtures_structure/non_id_attribute_name.json index 90c10445..f90d7721 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/non_id_attribute_name.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/non_id_attribute_name.json @@ -14,7 +14,17 @@ "span": { "type": "Span", "start": 19, - "end": 19 + "end": 19, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 5 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 5 + } } } ], @@ -22,13 +32,33 @@ "span": { "type": "Span", "start": 0, - "end": 27 + "end": 27, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 0 + } } } ], "span": { "type": "Span", "start": 0, - "end": 27 + "end": 27, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 1 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/placeable_at_eol.json b/fluent.syntax/tests/syntax/fixtures_structure/placeable_at_eol.json index 523a2da2..bfe1ff67 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/placeable_at_eol.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/placeable_at_eol.json @@ -9,7 +9,17 @@ "span": { "type": "Span", "start": 0, - "end": 4 + "end": 4, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 4 + } } }, "value": { @@ -21,7 +31,17 @@ "span": { "type": "Span", "start": 11, - "end": 38 + "end": 38, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 12 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 39 + } } }, { @@ -34,20 +54,50 @@ "span": { "type": "Span", "start": 40, - "end": 49 + "end": 49, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 41 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 50 + } } }, "attribute": null, "span": { "type": "Span", "start": 40, - "end": 49 + "end": 49, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 41 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 50 + } } }, "span": { "type": "Span", "start": 38, - "end": 51 + "end": 51, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 39 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 52 + } } }, { @@ -56,14 +106,34 @@ "span": { "type": "Span", "start": 51, - "end": 131 + "end": 131, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 52 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 43 + } } } ], "span": { "type": "Span", "start": 7, - "end": 131 + "end": 131, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 43 + } } }, "attributes": [], @@ -71,7 +141,17 @@ "span": { "type": "Span", "start": 0, - "end": 131 + "end": 131, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 43 + } } }, { @@ -82,7 +162,17 @@ "span": { "type": "Span", "start": 133, - "end": 137 + "end": 137, + "start_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 4 + } } }, "value": { @@ -94,7 +184,17 @@ "span": { "type": "Span", "start": 144, - "end": 171 + "end": 171, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 12 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 39 + } } }, { @@ -107,27 +207,67 @@ "span": { "type": "Span", "start": 173, - "end": 182 + "end": 182, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 41 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 50 + } } }, "attribute": null, "span": { "type": "Span", "start": 173, - "end": 182 + "end": 182, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 41 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 50 + } } }, "span": { "type": "Span", "start": 171, - "end": 184 + "end": 184, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 39 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 52 + } } } ], "span": { "type": "Span", "start": 140, - "end": 184 + "end": 184, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 52 + } } }, "attributes": [], @@ -135,7 +275,17 @@ "span": { "type": "Span", "start": 133, - "end": 184 + "end": 184, + "start_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 52 + } } }, { @@ -146,7 +296,17 @@ "span": { "type": "Span", "start": 186, - "end": 190 + "end": 190, + "start_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 4 + } } }, "value": { @@ -158,7 +318,17 @@ "span": { "type": "Span", "start": 193, - "end": 221 + "end": 221, + "start_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 7 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 35 + } } }, { @@ -171,27 +341,67 @@ "span": { "type": "Span", "start": 223, - "end": 232 + "end": 232, + "start_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 37 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 46 + } } }, "attribute": null, "span": { "type": "Span", "start": 223, - "end": 232 + "end": 232, + "start_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 37 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 46 + } } }, "span": { "type": "Span", "start": 221, - "end": 234 + "end": 234, + "start_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 35 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 48 + } } } ], "span": { "type": "Span", "start": 193, - "end": 234 + "end": 234, + "start_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 7 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 48 + } } }, "attributes": [], @@ -199,13 +409,33 @@ "span": { "type": "Span", "start": 186, - "end": 234 + "end": 234, + "start_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 48 + } } } ], "span": { "type": "Span", "start": 0, - "end": 235 + "end": 235, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 0 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/placeable_at_line_extremes.json b/fluent.syntax/tests/syntax/fixtures_structure/placeable_at_line_extremes.json index 35a30a39..1c30010f 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/placeable_at_line_extremes.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/placeable_at_line_extremes.json @@ -9,7 +9,17 @@ "span": { "type": "Span", "start": 0, - "end": 4 + "end": 4, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 4 + } } }, "value": { @@ -25,27 +35,67 @@ "span": { "type": "Span", "start": 13, - "end": 16 + "end": 16, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 14 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 17 + } } }, "attribute": null, "span": { "type": "Span", "start": 13, - "end": 16 + "end": 16, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 14 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 17 + } } }, "span": { "type": "Span", "start": 11, - "end": 18 + "end": 18, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 12 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 19 + } } } ], "span": { "type": "Span", "start": 7, - "end": 18 + "end": 18, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 19 + } } }, "attributes": [], @@ -53,7 +103,17 @@ "span": { "type": "Span", "start": 0, - "end": 18 + "end": 18, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 19 + } } }, { @@ -64,7 +124,17 @@ "span": { "type": "Span", "start": 20, - "end": 24 + "end": 24, + "start_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 4 + } } }, "value": { @@ -76,7 +146,17 @@ "span": { "type": "Span", "start": 31, - "end": 35 + "end": 35, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 12 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 16 + } } }, { @@ -89,27 +169,67 @@ "span": { "type": "Span", "start": 37, - "end": 40 + "end": 40, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 18 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 21 + } } }, "attribute": null, "span": { "type": "Span", "start": 37, - "end": 40 + "end": 40, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 18 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 21 + } } }, "span": { "type": "Span", "start": 35, - "end": 42 + "end": 42, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 16 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 23 + } } } ], "span": { "type": "Span", "start": 27, - "end": 42 + "end": 42, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 23 + } } }, "attributes": [], @@ -117,7 +237,17 @@ "span": { "type": "Span", "start": 20, - "end": 42 + "end": 42, + "start_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 23 + } } }, { @@ -128,7 +258,17 @@ "span": { "type": "Span", "start": 44, - "end": 48 + "end": 48, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 4 + } } }, "value": { @@ -144,20 +284,50 @@ "span": { "type": "Span", "start": 57, - "end": 60 + "end": 60, + "start_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 14 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 17 + } } }, "attribute": null, "span": { "type": "Span", "start": 57, - "end": 60 + "end": 60, + "start_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 14 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 17 + } } }, "span": { "type": "Span", "start": 55, - "end": 62 + "end": 62, + "start_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 12 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 19 + } } }, { @@ -166,14 +336,34 @@ "span": { "type": "Span", "start": 62, - "end": 66 + "end": 66, + "start_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 19 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 23 + } } } ], "span": { "type": "Span", "start": 51, - "end": 66 + "end": 66, + "start_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 23 + } } }, "attributes": [], @@ -181,13 +371,33 @@ "span": { "type": "Span", "start": 44, - "end": 66 + "end": 66, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 23 + } } } ], "span": { "type": "Span", "start": 0, - "end": 67 + "end": 67, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 0 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/placeable_in_placeable.json b/fluent.syntax/tests/syntax/fixtures_structure/placeable_in_placeable.json index 97ff7b72..2f3e0eaf 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/placeable_in_placeable.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/placeable_in_placeable.json @@ -9,7 +9,17 @@ "span": { "type": "Span", "start": 0, - "end": 4 + "end": 4, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 4 + } } }, "value": { @@ -27,33 +37,83 @@ "span": { "type": "Span", "start": 10, - "end": 13 + "end": 13, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 10 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 13 + } } }, "attribute": null, "span": { "type": "Span", "start": 10, - "end": 13 + "end": 13, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 10 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 13 + } } }, "span": { "type": "Span", "start": 8, - "end": 15 + "end": 15, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 15 + } } }, "span": { "type": "Span", "start": 7, - "end": 16 + "end": 16, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 7 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 16 + } } } ], "span": { "type": "Span", "start": 7, - "end": 16 + "end": 16, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 7 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 16 + } } }, "attributes": [], @@ -61,7 +121,17 @@ "span": { "type": "Span", "start": 0, - "end": 16 + "end": 16, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 16 + } } }, { @@ -72,7 +142,17 @@ "span": { "type": "Span", "start": 18, - "end": 22 + "end": 22, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 4 + } } }, "value": { @@ -90,33 +170,83 @@ "span": { "type": "Span", "start": 30, - "end": 33 + "end": 33, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 12 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 15 + } } }, "attribute": null, "span": { "type": "Span", "start": 30, - "end": 33 + "end": 33, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 12 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 15 + } } }, "span": { "type": "Span", "start": 28, - "end": 35 + "end": 35, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 10 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 17 + } } }, "span": { "type": "Span", "start": 25, - "end": 38 + "end": 38, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 7 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 20 + } } } ], "span": { "type": "Span", "start": 25, - "end": 38 + "end": 38, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 7 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 20 + } } }, "attributes": [], @@ -124,7 +254,17 @@ "span": { "type": "Span", "start": 18, - "end": 38 + "end": 38, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 20 + } } }, { @@ -135,7 +275,17 @@ "span": { "type": "Span", "start": 40, - "end": 44 + "end": 44, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 4 + } } }, "value": { @@ -153,33 +303,83 @@ "span": { "type": "Span", "start": 59, - "end": 62 + "end": 62, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 7 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 10 + } } }, "attribute": null, "span": { "type": "Span", "start": 59, - "end": 62 + "end": 62, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 7 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 10 + } } }, "span": { "type": "Span", "start": 57, - "end": 64 + "end": 64, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 5 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 12 + } } }, "span": { "type": "Span", "start": 50, - "end": 69 + "end": 69, + "start_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 9 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 4 + } } } ], "span": { "type": "Span", "start": 47, - "end": 69 + "end": 69, + "start_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 6 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 4 + } } }, "attributes": [], @@ -187,7 +387,17 @@ "span": { "type": "Span", "start": 40, - "end": 69 + "end": 69, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 4 + } } }, { @@ -203,7 +413,17 @@ "span": { "type": "Span", "start": 90, - "end": 90 + "end": 90, + "start_position": { + "type": "SourcePosition", + "row_index": 11, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 11, + "column_index": 0 + } } } ], @@ -211,7 +431,17 @@ "span": { "type": "Span", "start": 71, - "end": 90 + "end": 90, + "start_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 12, + "column_index": 0 + } } }, { @@ -225,7 +455,17 @@ "span": { "type": "Span", "start": 105, - "end": 105 + "end": 105, + "start_position": { + "type": "SourcePosition", + "row_index": 12, + "column_index": 15 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 12, + "column_index": 15 + } } } ], @@ -233,13 +473,33 @@ "span": { "type": "Span", "start": 90, - "end": 107 + "end": 107, + "start_position": { + "type": "SourcePosition", + "row_index": 12, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 13, + "column_index": 0 + } } } ], "span": { "type": "Span", "start": 0, - "end": 107 + "end": 107, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 13, + "column_index": 1 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/placeable_without_close_bracket.json b/fluent.syntax/tests/syntax/fixtures_structure/placeable_without_close_bracket.json index 7e9d6daa..d50ab6d4 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/placeable_without_close_bracket.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/placeable_without_close_bracket.json @@ -14,7 +14,17 @@ "span": { "type": "Span", "start": 15, - "end": 15 + "end": 15, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 0 + } } } ], @@ -22,13 +32,33 @@ "span": { "type": "Span", "start": 0, - "end": 15 + "end": 15, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + } } } ], "span": { "type": "Span", "start": 0, - "end": 15 + "end": 15, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 1 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/resource_comment.json b/fluent.syntax/tests/syntax/fixtures_structure/resource_comment.json index e5bf6656..cc8cb967 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/resource_comment.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/resource_comment.json @@ -7,13 +7,33 @@ "span": { "type": "Span", "start": 0, - "end": 54 + "end": 54, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 18 + } } } ], "span": { "type": "Span", "start": 0, - "end": 55 + "end": 55, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/resource_comment_trailing_line.json b/fluent.syntax/tests/syntax/fixtures_structure/resource_comment_trailing_line.json index dd2e29d3..1e80a7ae 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/resource_comment_trailing_line.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/resource_comment_trailing_line.json @@ -7,13 +7,33 @@ "span": { "type": "Span", "start": 0, - "end": 55 + "end": 55, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 3 + } } } ], "span": { "type": "Span", "start": 0, - "end": 56 + "end": 56, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 0 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/second_attribute_starts_from_nl.json b/fluent.syntax/tests/syntax/fixtures_structure/second_attribute_starts_from_nl.json index 9331bf1b..c89617fc 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/second_attribute_starts_from_nl.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/second_attribute_starts_from_nl.json @@ -9,7 +9,17 @@ "span": { "type": "Span", "start": 0, - "end": 3 + "end": 3, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 3 + } } }, "value": { @@ -21,14 +31,34 @@ "span": { "type": "Span", "start": 6, - "end": 11 + "end": 11, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 6 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 11 + } } } ], "span": { "type": "Span", "start": 6, - "end": 11 + "end": 11, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 6 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 11 + } } }, "attributes": [ @@ -40,7 +70,17 @@ "span": { "type": "Span", "start": 17, - "end": 22 + "end": 22, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 5 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 10 + } } }, "value": { @@ -52,20 +92,50 @@ "span": { "type": "Span", "start": 25, - "end": 30 + "end": 30, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 13 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 18 + } } } ], "span": { "type": "Span", "start": 25, - "end": 30 + "end": 30, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 13 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 18 + } } }, "span": { "type": "Span", "start": 16, - "end": 30 + "end": 30, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 4 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 18 + } } }, { @@ -76,7 +146,17 @@ "span": { "type": "Span", "start": 32, - "end": 41 + "end": 41, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 1 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 10 + } } }, "value": { @@ -88,20 +168,50 @@ "span": { "type": "Span", "start": 44, - "end": 45 + "end": 45, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 13 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 14 + } } } ], "span": { "type": "Span", "start": 44, - "end": 45 + "end": 45, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 13 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 14 + } } }, "span": { "type": "Span", "start": 31, - "end": 45 + "end": 45, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 14 + } } } ], @@ -109,13 +219,33 @@ "span": { "type": "Span", "start": 0, - "end": 45 + "end": 45, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 14 + } } } ], "span": { "type": "Span", "start": 0, - "end": 46 + "end": 46, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 0 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/select_expression_with_two_selectors.json b/fluent.syntax/tests/syntax/fixtures_structure/select_expression_with_two_selectors.json index 3967220b..054efbaf 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/select_expression_with_two_selectors.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/select_expression_with_two_selectors.json @@ -14,7 +14,17 @@ "span": { "type": "Span", "start": 15, - "end": 15 + "end": 15, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 15 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 15 + } } } ], @@ -22,13 +32,33 @@ "span": { "type": "Span", "start": 0, - "end": 22 + "end": 22, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 0 + } } } ], "span": { "type": "Span", "start": 0, - "end": 22 + "end": 22, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 1 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/select_expression_without_arrow.json b/fluent.syntax/tests/syntax/fixtures_structure/select_expression_without_arrow.json index 0182c800..1f3b84b8 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/select_expression_without_arrow.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/select_expression_without_arrow.json @@ -14,7 +14,17 @@ "span": { "type": "Span", "start": 15, - "end": 15 + "end": 15, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 15 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 15 + } } } ], @@ -22,13 +32,33 @@ "span": { "type": "Span", "start": 0, - "end": 19 + "end": 19, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 0 + } } } ], "span": { "type": "Span", "start": 0, - "end": 19 + "end": 19, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 1 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/select_expression_without_variants.json b/fluent.syntax/tests/syntax/fixtures_structure/select_expression_without_variants.json index 0be70101..2f77d26e 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/select_expression_without_variants.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/select_expression_without_variants.json @@ -14,7 +14,17 @@ "span": { "type": "Span", "start": 18, - "end": 18 + "end": 18, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 18 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 18 + } } } ], @@ -22,7 +32,17 @@ "span": { "type": "Span", "start": 0, - "end": 21 + "end": 21, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + } } }, { @@ -36,7 +56,17 @@ "span": { "type": "Span", "start": 43, - "end": 43 + "end": 43, + "start_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 4 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 4 + } } } ], @@ -44,7 +74,17 @@ "span": { "type": "Span", "start": 21, - "end": 46 + "end": 46, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 0 + } } }, { @@ -58,7 +98,17 @@ "span": { "type": "Span", "start": 64, - "end": 64 + "end": 64, + "start_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 0 + } } } ], @@ -66,13 +116,33 @@ "span": { "type": "Span", "start": 46, - "end": 64 + "end": 64, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 0 + } } } ], "span": { "type": "Span", "start": 0, - "end": 64 + "end": 64, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 1 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/select_expressions.json b/fluent.syntax/tests/syntax/fixtures_structure/select_expressions.json index ff87be9f..60e93b45 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/select_expressions.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/select_expressions.json @@ -7,7 +7,17 @@ "span": { "type": "Span", "start": 0, - "end": 46 + "end": 46, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 46 + } } }, { @@ -21,7 +31,17 @@ "span": { "type": "Span", "start": 69, - "end": 69 + "end": 69, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 4 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 4 + } } } ], @@ -29,7 +49,17 @@ "span": { "type": "Span", "start": 47, - "end": 87 + "end": 87, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 0 + } } }, { @@ -38,7 +68,17 @@ "span": { "type": "Span", "start": 87, - "end": 119 + "end": 119, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 32 + } } }, { @@ -52,7 +92,17 @@ "span": { "type": "Span", "start": 154, - "end": 154 + "end": 154, + "start_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 0 + } } } ], @@ -60,13 +110,33 @@ "span": { "type": "Span", "start": 120, - "end": 156 + "end": 156, + "start_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 11, + "column_index": 0 + } } } ], "span": { "type": "Span", "start": 0, - "end": 156 + "end": 156, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 11, + "column_index": 1 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/simple_message.json b/fluent.syntax/tests/syntax/fixtures_structure/simple_message.json index 0774ae50..dac6c746 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/simple_message.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/simple_message.json @@ -9,7 +9,17 @@ "span": { "type": "Span", "start": 0, - "end": 3 + "end": 3, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 3 + } } }, "value": { @@ -21,14 +31,34 @@ "span": { "type": "Span", "start": 6, - "end": 9 + "end": 9, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 6 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 9 + } } } ], "span": { "type": "Span", "start": 6, - "end": 9 + "end": 9, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 6 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 9 + } } }, "attributes": [], @@ -36,13 +66,33 @@ "span": { "type": "Span", "start": 0, - "end": 9 + "end": 9, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 9 + } } } ], "span": { "type": "Span", "start": 0, - "end": 10 + "end": 10, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 0 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/single_char_id.json b/fluent.syntax/tests/syntax/fixtures_structure/single_char_id.json index 1f77c705..74c9414d 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/single_char_id.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/single_char_id.json @@ -9,7 +9,17 @@ "span": { "type": "Span", "start": 0, - "end": 1 + "end": 1, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 1 + } } }, "value": { @@ -21,14 +31,34 @@ "span": { "type": "Span", "start": 4, - "end": 9 + "end": 9, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 4 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 9 + } } } ], "span": { "type": "Span", "start": 4, - "end": 9 + "end": 9, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 4 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 9 + } } }, "attributes": [ @@ -40,7 +70,17 @@ "span": { "type": "Span", "start": 15, - "end": 16 + "end": 16, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 5 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 6 + } } }, "value": { @@ -52,20 +92,50 @@ "span": { "type": "Span", "start": 19, - "end": 22 + "end": 22, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 9 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 12 + } } } ], "span": { "type": "Span", "start": 19, - "end": 22 + "end": 22, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 9 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 12 + } } }, "span": { "type": "Span", "start": 14, - "end": 22 + "end": 22, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 4 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 12 + } } } ], @@ -73,13 +143,33 @@ "span": { "type": "Span", "start": 0, - "end": 22 + "end": 22, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 12 + } } } ], "span": { "type": "Span", "start": 0, - "end": 23 + "end": 23, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 0 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/sparse-messages.json b/fluent.syntax/tests/syntax/fixtures_structure/sparse-messages.json index d6f61a16..9f01bd4d 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/sparse-messages.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/sparse-messages.json @@ -9,7 +9,17 @@ "span": { "type": "Span", "start": 0, - "end": 3 + "end": 3, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 3 + } } }, "value": { @@ -21,14 +31,34 @@ "span": { "type": "Span", "start": 12, - "end": 17 + "end": 17, + "start_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 12 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 17 + } } } ], "span": { "type": "Span", "start": 8, - "end": 17 + "end": 17, + "start_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 17 + } } }, "attributes": [], @@ -36,7 +66,17 @@ "span": { "type": "Span", "start": 0, - "end": 17 + "end": 17, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 17 + } } }, { @@ -47,7 +87,17 @@ "span": { "type": "Span", "start": 19, - "end": 23 + "end": 23, + "start_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 4 + } } }, "value": null, @@ -60,7 +110,17 @@ "span": { "type": "Span", "start": 33, - "end": 37 + "end": 37, + "start_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 9 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 13 + } } }, "value": { @@ -72,20 +132,50 @@ "span": { "type": "Span", "start": 40, - "end": 49 + "end": 49, + "start_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 16 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 25 + } } } ], "span": { "type": "Span", "start": 40, - "end": 49 + "end": 49, + "start_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 16 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 25 + } } }, "span": { "type": "Span", "start": 32, - "end": 49 + "end": 49, + "start_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 25 + } } } ], @@ -93,7 +183,17 @@ "span": { "type": "Span", "start": 19, - "end": 49 + "end": 49, + "start_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 25 + } } }, { @@ -104,7 +204,17 @@ "span": { "type": "Span", "start": 52, - "end": 56 + "end": 56, + "start_position": { + "type": "SourcePosition", + "row_index": 11, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 11, + "column_index": 4 + } } }, "value": { @@ -116,14 +226,34 @@ "span": { "type": "Span", "start": 63, - "end": 104 + "end": 104, + "start_position": { + "type": "SourcePosition", + "row_index": 12, + "column_index": 12 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 17, + "column_index": 18 + } } } ], "span": { "type": "Span", "start": 59, - "end": 104 + "end": 104, + "start_position": { + "type": "SourcePosition", + "row_index": 12, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 17, + "column_index": 18 + } } }, "attributes": [ @@ -135,7 +265,17 @@ "span": { "type": "Span", "start": 113, - "end": 118 + "end": 118, + "start_position": { + "type": "SourcePosition", + "row_index": 25, + "column_index": 5 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 25, + "column_index": 10 + } } }, "value": { @@ -147,20 +287,50 @@ "span": { "type": "Span", "start": 121, - "end": 127 + "end": 127, + "start_position": { + "type": "SourcePosition", + "row_index": 25, + "column_index": 13 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 25, + "column_index": 19 + } } } ], "span": { "type": "Span", "start": 121, - "end": 127 + "end": 127, + "start_position": { + "type": "SourcePosition", + "row_index": 25, + "column_index": 13 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 25, + "column_index": 19 + } } }, "span": { "type": "Span", "start": 112, - "end": 127 + "end": 127, + "start_position": { + "type": "SourcePosition", + "row_index": 25, + "column_index": 4 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 25, + "column_index": 19 + } } } ], @@ -168,7 +338,17 @@ "span": { "type": "Span", "start": 52, - "end": 127 + "end": 127, + "start_position": { + "type": "SourcePosition", + "row_index": 11, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 25, + "column_index": 19 + } } }, { @@ -179,7 +359,17 @@ "span": { "type": "Span", "start": 130, - "end": 134 + "end": 134, + "start_position": { + "type": "SourcePosition", + "row_index": 28, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 28, + "column_index": 4 + } } }, "value": { @@ -191,14 +381,34 @@ "span": { "type": "Span", "start": 137, - "end": 144 + "end": 144, + "start_position": { + "type": "SourcePosition", + "row_index": 28, + "column_index": 7 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 28, + "column_index": 14 + } } } ], "span": { "type": "Span", "start": 137, - "end": 144 + "end": 144, + "start_position": { + "type": "SourcePosition", + "row_index": 28, + "column_index": 7 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 28, + "column_index": 14 + } } }, "attributes": [], @@ -206,7 +416,17 @@ "span": { "type": "Span", "start": 130, - "end": 144 + "end": 144, + "start_position": { + "type": "SourcePosition", + "row_index": 28, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 28, + "column_index": 14 + } } }, { @@ -217,7 +437,17 @@ "span": { "type": "Span", "start": 146, - "end": 150 + "end": 150, + "start_position": { + "type": "SourcePosition", + "row_index": 30, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 30, + "column_index": 4 + } } }, "value": { @@ -235,13 +465,33 @@ "span": { "type": "Span", "start": 156, - "end": 159 + "end": 159, + "start_position": { + "type": "SourcePosition", + "row_index": 30, + "column_index": 10 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 30, + "column_index": 13 + } } }, "span": { "type": "Span", "start": 155, - "end": 159 + "end": 159, + "start_position": { + "type": "SourcePosition", + "row_index": 30, + "column_index": 9 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 30, + "column_index": 13 + } } }, "variants": [ @@ -253,7 +503,17 @@ "span": { "type": "Span", "start": 174, - "end": 177 + "end": 177, + "start_position": { + "type": "SourcePosition", + "row_index": 32, + "column_index": 10 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 32, + "column_index": 13 + } } }, "value": { @@ -265,21 +525,51 @@ "span": { "type": "Span", "start": 179, - "end": 182 + "end": 182, + "start_position": { + "type": "SourcePosition", + "row_index": 32, + "column_index": 15 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 32, + "column_index": 18 + } } } ], "span": { "type": "Span", "start": 179, - "end": 182 + "end": 182, + "start_position": { + "type": "SourcePosition", + "row_index": 32, + "column_index": 15 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 32, + "column_index": 18 + } } }, "default": false, "span": { "type": "Span", "start": 173, - "end": 182 + "end": 182, + "start_position": { + "type": "SourcePosition", + "row_index": 32, + "column_index": 9 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 32, + "column_index": 18 + } } }, { @@ -290,7 +580,17 @@ "span": { "type": "Span", "start": 194, - "end": 197 + "end": 197, + "start_position": { + "type": "SourcePosition", + "row_index": 34, + "column_index": 10 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 34, + "column_index": 13 + } } }, "value": { @@ -302,41 +602,101 @@ "span": { "type": "Span", "start": 199, - "end": 202 + "end": 202, + "start_position": { + "type": "SourcePosition", + "row_index": 34, + "column_index": 15 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 34, + "column_index": 18 + } } } ], "span": { "type": "Span", "start": 199, - "end": 202 + "end": 202, + "start_position": { + "type": "SourcePosition", + "row_index": 34, + "column_index": 15 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 34, + "column_index": 18 + } } }, "default": true, "span": { "type": "Span", "start": 192, - "end": 202 + "end": 202, + "start_position": { + "type": "SourcePosition", + "row_index": 34, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 34, + "column_index": 18 + } } } ], "span": { "type": "Span", "start": 155, - "end": 208 + "end": 208, + "start_position": { + "type": "SourcePosition", + "row_index": 30, + "column_index": 9 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 36, + "column_index": 4 + } } }, "span": { "type": "Span", "start": 153, - "end": 209 + "end": 209, + "start_position": { + "type": "SourcePosition", + "row_index": 30, + "column_index": 7 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 36, + "column_index": 5 + } } } ], "span": { "type": "Span", "start": 153, - "end": 209 + "end": 209, + "start_position": { + "type": "SourcePosition", + "row_index": 30, + "column_index": 7 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 36, + "column_index": 5 + } } }, "attributes": [], @@ -344,7 +704,17 @@ "span": { "type": "Span", "start": 146, - "end": 209 + "end": 209, + "start_position": { + "type": "SourcePosition", + "row_index": 30, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 36, + "column_index": 5 + } } }, { @@ -355,7 +725,17 @@ "span": { "type": "Span", "start": 211, - "end": 215 + "end": 215, + "start_position": { + "type": "SourcePosition", + "row_index": 38, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 38, + "column_index": 4 + } } }, "value": { @@ -373,13 +753,33 @@ "span": { "type": "Span", "start": 231, - "end": 234 + "end": 234, + "start_position": { + "type": "SourcePosition", + "row_index": 42, + "column_index": 7 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 42, + "column_index": 10 + } } }, "span": { "type": "Span", "start": 230, - "end": 234 + "end": 234, + "start_position": { + "type": "SourcePosition", + "row_index": 42, + "column_index": 6 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 42, + "column_index": 10 + } } }, "variants": [ @@ -391,7 +791,17 @@ "span": { "type": "Span", "start": 257, - "end": 260 + "end": 260, + "start_position": { + "type": "SourcePosition", + "row_index": 46, + "column_index": 11 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 46, + "column_index": 14 + } } }, "value": { @@ -403,41 +813,101 @@ "span": { "type": "Span", "start": 262, - "end": 265 + "end": 265, + "start_position": { + "type": "SourcePosition", + "row_index": 46, + "column_index": 16 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 46, + "column_index": 19 + } } } ], "span": { "type": "Span", "start": 262, - "end": 265 + "end": 265, + "start_position": { + "type": "SourcePosition", + "row_index": 46, + "column_index": 16 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 46, + "column_index": 19 + } } }, "default": true, "span": { "type": "Span", "start": 255, - "end": 265 + "end": 265, + "start_position": { + "type": "SourcePosition", + "row_index": 46, + "column_index": 9 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 46, + "column_index": 19 + } } } ], "span": { "type": "Span", "start": 230, - "end": 271 + "end": 271, + "start_position": { + "type": "SourcePosition", + "row_index": 42, + "column_index": 6 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 48, + "column_index": 4 + } } }, "span": { "type": "Span", "start": 221, - "end": 272 + "end": 272, + "start_position": { + "type": "SourcePosition", + "row_index": 40, + "column_index": 6 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 48, + "column_index": 5 + } } } ], "span": { "type": "Span", "start": 219, - "end": 272 + "end": 272, + "start_position": { + "type": "SourcePosition", + "row_index": 40, + "column_index": 4 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 48, + "column_index": 5 + } } }, "attributes": [], @@ -445,13 +915,33 @@ "span": { "type": "Span", "start": 211, - "end": 272 + "end": 272, + "start_position": { + "type": "SourcePosition", + "row_index": 38, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 48, + "column_index": 5 + } } } ], "span": { "type": "Span", "start": 0, - "end": 273 + "end": 273, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 49, + "column_index": 0 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/standalone_comment.json b/fluent.syntax/tests/syntax/fixtures_structure/standalone_comment.json index fbdd8c7a..b7e7ffda 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/standalone_comment.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/standalone_comment.json @@ -9,7 +9,17 @@ "span": { "type": "Span", "start": 0, - "end": 3 + "end": 3, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 3 + } } }, "value": { @@ -21,14 +31,34 @@ "span": { "type": "Span", "start": 6, - "end": 11 + "end": 11, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 6 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 11 + } } } ], "span": { "type": "Span", "start": 6, - "end": 11 + "end": 11, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 6 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 11 + } } }, "attributes": [], @@ -36,7 +66,17 @@ "span": { "type": "Span", "start": 0, - "end": 11 + "end": 11, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 11 + } } }, { @@ -45,13 +85,33 @@ "span": { "type": "Span", "start": 13, - "end": 43 + "end": 43, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 30 + } } } ], "span": { "type": "Span", "start": 0, - "end": 44 + "end": 44, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 0 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/standalone_identifier.json b/fluent.syntax/tests/syntax/fixtures_structure/standalone_identifier.json index 42b34440..947b9515 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/standalone_identifier.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/standalone_identifier.json @@ -14,7 +14,17 @@ "span": { "type": "Span", "start": 3, - "end": 3 + "end": 3, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 3 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 3 + } } } ], @@ -22,7 +32,17 @@ "span": { "type": "Span", "start": 0, - "end": 4 + "end": 4, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 0 + } } }, { @@ -31,13 +51,33 @@ "span": { "type": "Span", "start": 4, - "end": 35 + "end": 35, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 31 + } } } ], "span": { "type": "Span", "start": 0, - "end": 36 + "end": 36, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/term.json b/fluent.syntax/tests/syntax/fixtures_structure/term.json index b5b17d67..d4f269e5 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/term.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/term.json @@ -9,7 +9,17 @@ "span": { "type": "Span", "start": 1, - "end": 5 + "end": 5, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 1 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 5 + } } }, "value": { @@ -27,13 +37,33 @@ "span": { "type": "Span", "start": 15, - "end": 19 + "end": 19, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 15 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 19 + } } }, "span": { "type": "Span", "start": 14, - "end": 19 + "end": 19, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 14 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 19 + } } }, "variants": [ @@ -45,7 +75,17 @@ "span": { "type": "Span", "start": 32, - "end": 41 + "end": 41, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 9 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 18 + } } }, "value": { @@ -57,21 +97,51 @@ "span": { "type": "Span", "start": 43, - "end": 47 + "end": 47, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 20 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 24 + } } } ], "span": { "type": "Span", "start": 43, - "end": 47 + "end": 47, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 20 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 24 + } } }, "default": true, "span": { "type": "Span", "start": 30, - "end": 47 + "end": 47, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 7 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 24 + } } }, { @@ -82,7 +152,17 @@ "span": { "type": "Span", "start": 57, - "end": 66 + "end": 66, + "start_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 9 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 18 + } } }, "value": { @@ -94,41 +174,101 @@ "span": { "type": "Span", "start": 68, - "end": 72 + "end": 72, + "start_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 20 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 24 + } } } ], "span": { "type": "Span", "start": 68, - "end": 72 + "end": 72, + "start_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 20 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 24 + } } }, "default": false, "span": { "type": "Span", "start": 56, - "end": 72 + "end": 72, + "start_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 24 + } } } ], "span": { "type": "Span", "start": 14, - "end": 77 + "end": 77, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 14 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 4 + } } }, "span": { "type": "Span", "start": 12, - "end": 78 + "end": 78, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 12 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 5 + } } } ], "span": { "type": "Span", "start": 8, - "end": 78 + "end": 78, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 5 + } } }, "attributes": [ @@ -140,7 +280,17 @@ "span": { "type": "Span", "start": 84, - "end": 88 + "end": 88, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 5 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 9 + } } }, "value": { @@ -152,20 +302,50 @@ "span": { "type": "Span", "start": 91, - "end": 92 + "end": 92, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 12 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 13 + } } } ], "span": { "type": "Span", "start": 91, - "end": 92 + "end": 92, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 12 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 13 + } } }, "span": { "type": "Span", "start": 83, - "end": 92 + "end": 92, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 4 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 13 + } } } ], @@ -173,7 +353,17 @@ "span": { "type": "Span", "start": 0, - "end": 92 + "end": 92, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 13 + } } }, { @@ -184,7 +374,17 @@ "span": { "type": "Span", "start": 94, - "end": 99 + "end": 99, + "start_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 5 + } } }, "value": { @@ -200,7 +400,17 @@ "span": { "type": "Span", "start": 104, - "end": 108 + "end": 108, + "start_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 10 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 14 + } } }, "attribute": null, @@ -208,20 +418,50 @@ "span": { "type": "Span", "start": 103, - "end": 108 + "end": 108, + "start_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 9 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 14 + } } }, "span": { "type": "Span", "start": 102, - "end": 109 + "end": 109, + "start_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 15 + } } } ], "span": { "type": "Span", "start": 102, - "end": 109 + "end": 109, + "start_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 15 + } } }, "attributes": [], @@ -229,7 +469,17 @@ "span": { "type": "Span", "start": 94, - "end": 109 + "end": 109, + "start_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 15 + } } }, { @@ -240,7 +490,17 @@ "span": { "type": "Span", "start": 110, - "end": 115 + "end": 115, + "start_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 5 + } } }, "value": { @@ -256,7 +516,17 @@ "span": { "type": "Span", "start": 120, - "end": 124 + "end": 124, + "start_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 10 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 14 + } } }, "attribute": null, @@ -267,26 +537,66 @@ "span": { "type": "Span", "start": 124, - "end": 126 + "end": 126, + "start_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 14 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 16 + } } }, "span": { "type": "Span", "start": 119, - "end": 126 + "end": 126, + "start_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 9 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 16 + } } }, "span": { "type": "Span", "start": 118, - "end": 127 + "end": 127, + "start_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 17 + } } } ], "span": { "type": "Span", "start": 118, - "end": 127 + "end": 127, + "start_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 17 + } } }, "attributes": [], @@ -294,7 +604,17 @@ "span": { "type": "Span", "start": 110, - "end": 127 + "end": 127, + "start_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 9, + "column_index": 17 + } } }, { @@ -305,7 +625,17 @@ "span": { "type": "Span", "start": 128, - "end": 133 + "end": 133, + "start_position": { + "type": "SourcePosition", + "row_index": 10, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 10, + "column_index": 5 + } } }, "value": { @@ -321,7 +651,17 @@ "span": { "type": "Span", "start": 138, - "end": 142 + "end": 142, + "start_position": { + "type": "SourcePosition", + "row_index": 10, + "column_index": 10 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 10, + "column_index": 14 + } } }, "attribute": null, @@ -337,7 +677,17 @@ "span": { "type": "Span", "start": 143, - "end": 147 + "end": 147, + "start_position": { + "type": "SourcePosition", + "row_index": 10, + "column_index": 15 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 10, + "column_index": 19 + } } }, "value": { @@ -346,39 +696,99 @@ "span": { "type": "Span", "start": 149, - "end": 160 + "end": 160, + "start_position": { + "type": "SourcePosition", + "row_index": 10, + "column_index": 21 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 10, + "column_index": 32 + } } }, "span": { "type": "Span", "start": 143, - "end": 160 + "end": 160, + "start_position": { + "type": "SourcePosition", + "row_index": 10, + "column_index": 15 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 10, + "column_index": 32 + } } } ], "span": { "type": "Span", "start": 142, - "end": 161 + "end": 161, + "start_position": { + "type": "SourcePosition", + "row_index": 10, + "column_index": 14 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 10, + "column_index": 33 + } } }, "span": { "type": "Span", "start": 137, - "end": 161 + "end": 161, + "start_position": { + "type": "SourcePosition", + "row_index": 10, + "column_index": 9 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 10, + "column_index": 33 + } } }, "span": { "type": "Span", "start": 136, - "end": 162 + "end": 162, + "start_position": { + "type": "SourcePosition", + "row_index": 10, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 10, + "column_index": 34 + } } } ], "span": { "type": "Span", "start": 136, - "end": 162 + "end": 162, + "start_position": { + "type": "SourcePosition", + "row_index": 10, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 10, + "column_index": 34 + } } }, "attributes": [], @@ -386,7 +796,17 @@ "span": { "type": "Span", "start": 128, - "end": 162 + "end": 162, + "start_position": { + "type": "SourcePosition", + "row_index": 10, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 10, + "column_index": 34 + } } }, { @@ -397,7 +817,17 @@ "span": { "type": "Span", "start": 165, - "end": 170 + "end": 170, + "start_position": { + "type": "SourcePosition", + "row_index": 13, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 13, + "column_index": 5 + } } }, "value": { @@ -415,7 +845,17 @@ "span": { "type": "Span", "start": 180, - "end": 184 + "end": 184, + "start_position": { + "type": "SourcePosition", + "row_index": 14, + "column_index": 15 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 14, + "column_index": 19 + } } }, "attribute": { @@ -424,14 +864,34 @@ "span": { "type": "Span", "start": 185, - "end": 189 + "end": 189, + "start_position": { + "type": "SourcePosition", + "row_index": 14, + "column_index": 20 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 14, + "column_index": 24 + } } }, "arguments": null, "span": { "type": "Span", "start": 179, - "end": 189 + "end": 189, + "start_position": { + "type": "SourcePosition", + "row_index": 14, + "column_index": 14 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 14, + "column_index": 24 + } } }, "variants": [ @@ -443,7 +903,17 @@ "span": { "type": "Span", "start": 202, - "end": 203 + "end": 203, + "start_position": { + "type": "SourcePosition", + "row_index": 15, + "column_index": 9 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 15, + "column_index": 10 + } } }, "value": { @@ -459,7 +929,17 @@ "span": { "type": "Span", "start": 208, - "end": 212 + "end": 212, + "start_position": { + "type": "SourcePosition", + "row_index": 15, + "column_index": 15 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 15, + "column_index": 19 + } } }, "attribute": null, @@ -467,13 +947,33 @@ "span": { "type": "Span", "start": 207, - "end": 212 + "end": 212, + "start_position": { + "type": "SourcePosition", + "row_index": 15, + "column_index": 14 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 15, + "column_index": 19 + } } }, "span": { "type": "Span", "start": 205, - "end": 214 + "end": 214, + "start_position": { + "type": "SourcePosition", + "row_index": 15, + "column_index": 12 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 15, + "column_index": 21 + } } }, { @@ -482,21 +982,51 @@ "span": { "type": "Span", "start": 214, - "end": 216 + "end": 216, + "start_position": { + "type": "SourcePosition", + "row_index": 15, + "column_index": 21 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 15, + "column_index": 23 + } } } ], "span": { "type": "Span", "start": 205, - "end": 216 + "end": 216, + "start_position": { + "type": "SourcePosition", + "row_index": 15, + "column_index": 12 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 15, + "column_index": 23 + } } }, "default": false, "span": { "type": "Span", "start": 201, - "end": 216 + "end": 216, + "start_position": { + "type": "SourcePosition", + "row_index": 15, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 15, + "column_index": 23 + } } }, { @@ -507,7 +1037,17 @@ "span": { "type": "Span", "start": 226, - "end": 227 + "end": 227, + "start_position": { + "type": "SourcePosition", + "row_index": 16, + "column_index": 9 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 16, + "column_index": 10 + } } }, "value": { @@ -523,7 +1063,17 @@ "span": { "type": "Span", "start": 232, - "end": 236 + "end": 236, + "start_position": { + "type": "SourcePosition", + "row_index": 16, + "column_index": 15 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 16, + "column_index": 19 + } } }, "attribute": null, @@ -534,19 +1084,49 @@ "span": { "type": "Span", "start": 236, - "end": 238 + "end": 238, + "start_position": { + "type": "SourcePosition", + "row_index": 16, + "column_index": 19 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 16, + "column_index": 21 + } } }, "span": { "type": "Span", "start": 231, - "end": 238 + "end": 238, + "start_position": { + "type": "SourcePosition", + "row_index": 16, + "column_index": 14 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 16, + "column_index": 21 + } } }, "span": { "type": "Span", "start": 229, - "end": 240 + "end": 240, + "start_position": { + "type": "SourcePosition", + "row_index": 16, + "column_index": 12 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 16, + "column_index": 23 + } } }, { @@ -555,21 +1135,51 @@ "span": { "type": "Span", "start": 240, - "end": 242 + "end": 242, + "start_position": { + "type": "SourcePosition", + "row_index": 16, + "column_index": 23 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 16, + "column_index": 25 + } } } ], "span": { "type": "Span", "start": 229, - "end": 242 + "end": 242, + "start_position": { + "type": "SourcePosition", + "row_index": 16, + "column_index": 12 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 16, + "column_index": 25 + } } }, "default": false, "span": { "type": "Span", "start": 225, - "end": 242 + "end": 242, + "start_position": { + "type": "SourcePosition", + "row_index": 16, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 16, + "column_index": 25 + } } }, { @@ -580,7 +1190,17 @@ "span": { "type": "Span", "start": 252, - "end": 253 + "end": 253, + "start_position": { + "type": "SourcePosition", + "row_index": 17, + "column_index": 9 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 17, + "column_index": 10 + } } }, "value": { @@ -592,41 +1212,101 @@ "span": { "type": "Span", "start": 255, - "end": 256 + "end": 256, + "start_position": { + "type": "SourcePosition", + "row_index": 17, + "column_index": 12 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 17, + "column_index": 13 + } } } ], "span": { "type": "Span", "start": 255, - "end": 256 + "end": 256, + "start_position": { + "type": "SourcePosition", + "row_index": 17, + "column_index": 12 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 17, + "column_index": 13 + } } }, "default": true, "span": { "type": "Span", "start": 250, - "end": 256 + "end": 256, + "start_position": { + "type": "SourcePosition", + "row_index": 17, + "column_index": 7 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 17, + "column_index": 13 + } } } ], "span": { "type": "Span", "start": 179, - "end": 261 + "end": 261, + "start_position": { + "type": "SourcePosition", + "row_index": 14, + "column_index": 14 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 18, + "column_index": 4 + } } }, "span": { "type": "Span", "start": 177, - "end": 262 + "end": 262, + "start_position": { + "type": "SourcePosition", + "row_index": 14, + "column_index": 12 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 18, + "column_index": 5 + } } } ], "span": { "type": "Span", "start": 173, - "end": 262 + "end": 262, + "start_position": { + "type": "SourcePosition", + "row_index": 14, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 18, + "column_index": 5 + } } }, "attributes": [], @@ -634,7 +1314,17 @@ "span": { "type": "Span", "start": 165, - "end": 262 + "end": 262, + "start_position": { + "type": "SourcePosition", + "row_index": 13, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 18, + "column_index": 5 + } } }, { @@ -650,7 +1340,17 @@ "span": { "type": "Span", "start": 271, - "end": 271 + "end": 271, + "start_position": { + "type": "SourcePosition", + "row_index": 20, + "column_index": 7 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 20, + "column_index": 7 + } } } ], @@ -658,7 +1358,17 @@ "span": { "type": "Span", "start": 264, - "end": 272 + "end": 272, + "start_position": { + "type": "SourcePosition", + "row_index": 20, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 21, + "column_index": 0 + } } }, { @@ -674,7 +1384,17 @@ "span": { "type": "Span", "start": 279, - "end": 279 + "end": 279, + "start_position": { + "type": "SourcePosition", + "row_index": 21, + "column_index": 7 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 21, + "column_index": 7 + } } } ], @@ -682,7 +1402,17 @@ "span": { "type": "Span", "start": 272, - "end": 302 + "end": 302, + "start_position": { + "type": "SourcePosition", + "row_index": 21, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 23, + "column_index": 0 + } } }, { @@ -698,7 +1428,17 @@ "span": { "type": "Span", "start": 303, - "end": 303 + "end": 303, + "start_position": { + "type": "SourcePosition", + "row_index": 23, + "column_index": 1 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 23, + "column_index": 1 + } } } ], @@ -706,7 +1446,17 @@ "span": { "type": "Span", "start": 302, - "end": 317 + "end": 317, + "start_position": { + "type": "SourcePosition", + "row_index": 23, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 24, + "column_index": 0 + } } }, { @@ -722,7 +1472,17 @@ "span": { "type": "Span", "start": 327, - "end": 327 + "end": 327, + "start_position": { + "type": "SourcePosition", + "row_index": 24, + "column_index": 10 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 24, + "column_index": 10 + } } } ], @@ -730,13 +1490,33 @@ "span": { "type": "Span", "start": 317, - "end": 335 + "end": 335, + "start_position": { + "type": "SourcePosition", + "row_index": 24, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 25, + "column_index": 0 + } } } ], "span": { "type": "Span", "start": 0, - "end": 335 + "end": 335, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 25, + "column_index": 1 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/term_with_empty_pattern.json b/fluent.syntax/tests/syntax/fixtures_structure/term_with_empty_pattern.json index 7f5392f5..f840ddb8 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/term_with_empty_pattern.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/term_with_empty_pattern.json @@ -14,7 +14,17 @@ "span": { "type": "Span", "start": 6, - "end": 6 + "end": 6, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 6 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 6 + } } } ], @@ -22,7 +32,17 @@ "span": { "type": "Span", "start": 0, - "end": 30 + "end": 30, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 0 + } } }, { @@ -38,7 +58,17 @@ "span": { "type": "Span", "start": 36, - "end": 36 + "end": 36, + "start_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 6 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 6 + } } } ], @@ -46,7 +76,17 @@ "span": { "type": "Span", "start": 30, - "end": 38 + "end": 38, + "start_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 0 + } } }, { @@ -62,7 +102,17 @@ "span": { "type": "Span", "start": 42, - "end": 42 + "end": 42, + "start_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 4 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 4 + } } } ], @@ -70,13 +120,33 @@ "span": { "type": "Span", "start": 38, - "end": 43 + "end": 43, + "start_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 0 + } } } ], "span": { "type": "Span", "start": 0, - "end": 43 + "end": 43, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 1 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/unclosed.json b/fluent.syntax/tests/syntax/fixtures_structure/unclosed.json index 678a058f..6f8854d4 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/unclosed.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/unclosed.json @@ -14,7 +14,17 @@ "span": { "type": "Span", "start": 10, - "end": 10 + "end": 10, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + } } } ], @@ -22,7 +32,17 @@ "span": { "type": "Span", "start": 0, - "end": 10 + "end": 10, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + } } }, { @@ -33,7 +53,17 @@ "span": { "type": "Span", "start": 10, - "end": 15 + "end": 15, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 5 + } } }, "value": { @@ -45,14 +75,34 @@ "span": { "type": "Span", "start": 18, - "end": 26 + "end": 26, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 16 + } } } ], "span": { "type": "Span", "start": 18, - "end": 26 + "end": 26, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 16 + } } }, "attributes": [], @@ -60,7 +110,17 @@ "span": { "type": "Span", "start": 10, - "end": 26 + "end": 26, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 16 + } } }, { @@ -74,7 +134,17 @@ "span": { "type": "Span", "start": 70, - "end": 70 + "end": 70, + "start_position": { + "type": "SourcePosition", + "row_index": 11, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 11, + "column_index": 0 + } } } ], @@ -82,7 +152,17 @@ "span": { "type": "Span", "start": 28, - "end": 70 + "end": 70, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 11, + "column_index": 0 + } } }, { @@ -93,7 +173,17 @@ "span": { "type": "Span", "start": 70, - "end": 75 + "end": 75, + "start_position": { + "type": "SourcePosition", + "row_index": 11, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 11, + "column_index": 5 + } } }, "value": { @@ -105,14 +195,34 @@ "span": { "type": "Span", "start": 78, - "end": 86 + "end": 86, + "start_position": { + "type": "SourcePosition", + "row_index": 11, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 11, + "column_index": 16 + } } } ], "span": { "type": "Span", "start": 78, - "end": 86 + "end": 86, + "start_position": { + "type": "SourcePosition", + "row_index": 11, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 11, + "column_index": 16 + } } }, "attributes": [], @@ -120,7 +230,17 @@ "span": { "type": "Span", "start": 70, - "end": 86 + "end": 86, + "start_position": { + "type": "SourcePosition", + "row_index": 11, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 11, + "column_index": 16 + } } }, { @@ -134,7 +254,17 @@ "span": { "type": "Span", "start": 87, - "end": 87 + "end": 87, + "start_position": { + "type": "SourcePosition", + "row_index": 12, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 12, + "column_index": 0 + } } } ], @@ -142,13 +272,33 @@ "span": { "type": "Span", "start": 87, - "end": 91 + "end": 91, + "start_position": { + "type": "SourcePosition", + "row_index": 12, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 14, + "column_index": 0 + } } } ], "span": { "type": "Span", "start": 0, - "end": 91 + "end": 91, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 14, + "column_index": 1 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/unclosed_empty_placeable_error.json b/fluent.syntax/tests/syntax/fixtures_structure/unclosed_empty_placeable_error.json index 8fedae5f..48ad3fc4 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/unclosed_empty_placeable_error.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/unclosed_empty_placeable_error.json @@ -14,7 +14,17 @@ "span": { "type": "Span", "start": 10, - "end": 10 + "end": 10, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + } } } ], @@ -22,7 +32,17 @@ "span": { "type": "Span", "start": 0, - "end": 10 + "end": 10, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + } } }, { @@ -33,7 +53,17 @@ "span": { "type": "Span", "start": 10, - "end": 15 + "end": 15, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 5 + } } }, "value": { @@ -45,14 +75,34 @@ "span": { "type": "Span", "start": 18, - "end": 21 + "end": 21, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 11 + } } } ], "span": { "type": "Span", "start": 18, - "end": 21 + "end": 21, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 11 + } } }, "attributes": [], @@ -60,7 +110,17 @@ "span": { "type": "Span", "start": 10, - "end": 21 + "end": 21, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 11 + } } }, { @@ -74,7 +134,17 @@ "span": { "type": "Span", "start": 32, - "end": 32 + "end": 32, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 0 + } } } ], @@ -82,13 +152,33 @@ "span": { "type": "Span", "start": 22, - "end": 32 + "end": 32, + "start_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 0 + } } } ], "span": { "type": "Span", "start": 0, - "end": 32 + "end": 32, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 1 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/unknown_entry_start.json b/fluent.syntax/tests/syntax/fixtures_structure/unknown_entry_start.json index 41222d59..96f5319b 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/unknown_entry_start.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/unknown_entry_start.json @@ -12,7 +12,17 @@ "span": { "type": "Span", "start": 1, - "end": 1 + "end": 1, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 0 + } } } ], @@ -20,13 +30,33 @@ "span": { "type": "Span", "start": 1, - "end": 12 + "end": 12, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + } } } ], "span": { "type": "Span", "start": 0, - "end": 12 + "end": 12, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 1 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/variant_ends_abruptly.json b/fluent.syntax/tests/syntax/fixtures_structure/variant_ends_abruptly.json index d209b8a5..b020e144 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/variant_ends_abruptly.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/variant_ends_abruptly.json @@ -14,7 +14,17 @@ "span": { "type": "Span", "start": 23, - "end": 23 + "end": 23, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 0 + } } } ], @@ -22,7 +32,17 @@ "span": { "type": "Span", "start": 0, - "end": 23 + "end": 23, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 0 + } } }, { @@ -31,13 +51,33 @@ "span": { "type": "Span", "start": 23, - "end": 45 + "end": 45, + "start_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 22 + } } } ], "span": { "type": "Span", "start": 0, - "end": 46 + "end": 46, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 0 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/variant_keys.json b/fluent.syntax/tests/syntax/fixtures_structure/variant_keys.json index 3a935766..f8b42352 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/variant_keys.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/variant_keys.json @@ -9,7 +9,17 @@ "span": { "type": "Span", "start": 0, - "end": 5 + "end": 5, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 5 + } } }, "value": { @@ -27,13 +37,33 @@ "span": { "type": "Span", "start": 11, - "end": 14 + "end": 14, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 11 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 14 + } } }, "span": { "type": "Span", "start": 10, - "end": 14 + "end": 14, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 10 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 14 + } } }, "variants": [ @@ -45,7 +75,17 @@ "span": { "type": "Span", "start": 33, - "end": 36 + "end": 36, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 11 + } } }, "value": { @@ -57,41 +97,101 @@ "span": { "type": "Span", "start": 43, - "end": 48 + "end": 48, + "start_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 6 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 11 + } } } ], "span": { "type": "Span", "start": 43, - "end": 48 + "end": 48, + "start_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 6 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 11 + } } }, "default": true, "span": { "type": "Span", "start": 22, - "end": 48 + "end": 48, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 4 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 11 + } } } ], "span": { "type": "Span", "start": 10, - "end": 49 + "end": 49, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 10 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 0 + } } }, "span": { "type": "Span", "start": 8, - "end": 50 + "end": 50, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 1 + } } } ], "span": { "type": "Span", "start": 8, - "end": 50 + "end": 50, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 1 + } } }, "attributes": [], @@ -99,7 +199,17 @@ "span": { "type": "Span", "start": 0, - "end": 50 + "end": 50, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 1 + } } }, { @@ -110,7 +220,17 @@ "span": { "type": "Span", "start": 52, - "end": 57 + "end": 57, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 5 + } } }, "value": { @@ -128,13 +248,33 @@ "span": { "type": "Span", "start": 63, - "end": 66 + "end": 66, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 11 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 14 + } } }, "span": { "type": "Span", "start": 62, - "end": 66 + "end": 66, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 10 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 14 + } } }, "variants": [ @@ -146,7 +286,17 @@ "span": { "type": "Span", "start": 85, - "end": 88 + "end": 88, + "start_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 11 + } } }, "value": { @@ -158,41 +308,101 @@ "span": { "type": "Span", "start": 104, - "end": 109 + "end": 109, + "start_position": { + "type": "SourcePosition", + "row_index": 11, + "column_index": 12 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 11, + "column_index": 17 + } } } ], "span": { "type": "Span", "start": 100, - "end": 109 + "end": 109, + "start_position": { + "type": "SourcePosition", + "row_index": 11, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 11, + "column_index": 17 + } } }, "default": true, "span": { "type": "Span", "start": 74, - "end": 109 + "end": 109, + "start_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 4 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 11, + "column_index": 17 + } } } ], "span": { "type": "Span", "start": 62, - "end": 110 + "end": 110, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 10 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 12, + "column_index": 0 + } } }, "span": { "type": "Span", "start": 60, - "end": 111 + "end": 111, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 12, + "column_index": 1 + } } } ], "span": { "type": "Span", "start": 60, - "end": 111 + "end": 111, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 12, + "column_index": 1 + } } }, "attributes": [], @@ -200,7 +410,17 @@ "span": { "type": "Span", "start": 52, - "end": 111 + "end": 111, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 12, + "column_index": 1 + } } }, { @@ -216,7 +436,17 @@ "span": { "type": "Span", "start": 137, - "end": 137 + "end": 137, + "start_position": { + "type": "SourcePosition", + "row_index": 15, + "column_index": 6 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 15, + "column_index": 6 + } } } ], @@ -224,7 +454,17 @@ "span": { "type": "Span", "start": 113, - "end": 153 + "end": 153, + "start_position": { + "type": "SourcePosition", + "row_index": 14, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 19, + "column_index": 0 + } } }, { @@ -240,7 +480,17 @@ "span": { "type": "Span", "start": 178, - "end": 178 + "end": 178, + "start_position": { + "type": "SourcePosition", + "row_index": 20, + "column_index": 7 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 20, + "column_index": 7 + } } } ], @@ -248,7 +498,17 @@ "span": { "type": "Span", "start": 153, - "end": 192 + "end": 192, + "start_position": { + "type": "SourcePosition", + "row_index": 19, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 24, + "column_index": 0 + } } }, { @@ -264,7 +524,17 @@ "span": { "type": "Span", "start": 217, - "end": 217 + "end": 217, + "start_position": { + "type": "SourcePosition", + "row_index": 25, + "column_index": 7 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 25, + "column_index": 7 + } } } ], @@ -272,7 +542,17 @@ "span": { "type": "Span", "start": 192, - "end": 236 + "end": 236, + "start_position": { + "type": "SourcePosition", + "row_index": 24, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 29, + "column_index": 0 + } } }, { @@ -288,7 +568,17 @@ "span": { "type": "Span", "start": 261, - "end": 261 + "end": 261, + "start_position": { + "type": "SourcePosition", + "row_index": 30, + "column_index": 7 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 30, + "column_index": 7 + } } } ], @@ -296,7 +586,17 @@ "span": { "type": "Span", "start": 236, - "end": 277 + "end": 277, + "start_position": { + "type": "SourcePosition", + "row_index": 29, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 34, + "column_index": 0 + } } }, { @@ -312,7 +612,17 @@ "span": { "type": "Span", "start": 302, - "end": 302 + "end": 302, + "start_position": { + "type": "SourcePosition", + "row_index": 35, + "column_index": 7 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 35, + "column_index": 7 + } } } ], @@ -320,7 +630,17 @@ "span": { "type": "Span", "start": 277, - "end": 323 + "end": 323, + "start_position": { + "type": "SourcePosition", + "row_index": 34, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 39, + "column_index": 0 + } } }, { @@ -336,7 +656,17 @@ "span": { "type": "Span", "start": 350, - "end": 350 + "end": 350, + "start_position": { + "type": "SourcePosition", + "row_index": 40, + "column_index": 9 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 40, + "column_index": 9 + } } } ], @@ -344,7 +674,17 @@ "span": { "type": "Span", "start": 323, - "end": 366 + "end": 366, + "start_position": { + "type": "SourcePosition", + "row_index": 39, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 44, + "column_index": 0 + } } }, { @@ -360,7 +700,17 @@ "span": { "type": "Span", "start": 390, - "end": 390 + "end": 390, + "start_position": { + "type": "SourcePosition", + "row_index": 45, + "column_index": 6 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 45, + "column_index": 6 + } } } ], @@ -368,7 +718,17 @@ "span": { "type": "Span", "start": 366, - "end": 405 + "end": 405, + "start_position": { + "type": "SourcePosition", + "row_index": 44, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 49, + "column_index": 0 + } } }, { @@ -384,7 +744,17 @@ "span": { "type": "Span", "start": 433, - "end": 433 + "end": 433, + "start_position": { + "type": "SourcePosition", + "row_index": 50, + "column_index": 10 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 50, + "column_index": 10 + } } } ], @@ -392,7 +762,17 @@ "span": { "type": "Span", "start": 405, - "end": 446 + "end": 446, + "start_position": { + "type": "SourcePosition", + "row_index": 49, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 54, + "column_index": 0 + } } }, { @@ -408,7 +788,17 @@ "span": { "type": "Span", "start": 470, - "end": 470 + "end": 470, + "start_position": { + "type": "SourcePosition", + "row_index": 55, + "column_index": 6 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 55, + "column_index": 6 + } } } ], @@ -416,7 +806,17 @@ "span": { "type": "Span", "start": 446, - "end": 486 + "end": 486, + "start_position": { + "type": "SourcePosition", + "row_index": 54, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 59, + "column_index": 0 + } } }, { @@ -432,7 +832,17 @@ "span": { "type": "Span", "start": 510, - "end": 510 + "end": 510, + "start_position": { + "type": "SourcePosition", + "row_index": 60, + "column_index": 6 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 60, + "column_index": 6 + } } } ], @@ -440,7 +850,17 @@ "span": { "type": "Span", "start": 486, - "end": 528 + "end": 528, + "start_position": { + "type": "SourcePosition", + "row_index": 59, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 64, + "column_index": 0 + } } }, { @@ -456,7 +876,17 @@ "span": { "type": "Span", "start": 552, - "end": 552 + "end": 552, + "start_position": { + "type": "SourcePosition", + "row_index": 65, + "column_index": 6 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 65, + "column_index": 6 + } } } ], @@ -464,7 +894,17 @@ "span": { "type": "Span", "start": 528, - "end": 569 + "end": 569, + "start_position": { + "type": "SourcePosition", + "row_index": 64, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 69, + "column_index": 0 + } } }, { @@ -480,7 +920,17 @@ "span": { "type": "Span", "start": 593, - "end": 593 + "end": 593, + "start_position": { + "type": "SourcePosition", + "row_index": 70, + "column_index": 6 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 70, + "column_index": 6 + } } } ], @@ -488,13 +938,33 @@ "span": { "type": "Span", "start": 569, - "end": 609 + "end": 609, + "start_position": { + "type": "SourcePosition", + "row_index": 69, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 73, + "column_index": 0 + } } } ], "span": { "type": "Span", "start": 0, - "end": 609 + "end": 609, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 73, + "column_index": 1 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/variant_starts_from_nl.json b/fluent.syntax/tests/syntax/fixtures_structure/variant_starts_from_nl.json index 4d982ad6..1095568b 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/variant_starts_from_nl.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/variant_starts_from_nl.json @@ -9,7 +9,17 @@ "span": { "type": "Span", "start": 1, - "end": 5 + "end": 5, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 1 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 5 + } } }, "value": { @@ -27,13 +37,33 @@ "span": { "type": "Span", "start": 11, - "end": 14 + "end": 14, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 11 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 14 + } } }, "span": { "type": "Span", "start": 10, - "end": 14 + "end": 14, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 10 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 14 + } } }, "variants": [ @@ -45,7 +75,17 @@ "span": { "type": "Span", "start": 20, - "end": 23 + "end": 23, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 2 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 5 + } } }, "value": { @@ -57,41 +97,101 @@ "span": { "type": "Span", "start": 25, - "end": 30 + "end": 30, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 7 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 12 + } } } ], "span": { "type": "Span", "start": 25, - "end": 30 + "end": 30, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 7 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 12 + } } }, "default": true, "span": { "type": "Span", "start": 18, - "end": 30 + "end": 30, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 12 + } } } ], "span": { "type": "Span", "start": 10, - "end": 35 + "end": 35, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 10 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 4 + } } }, "span": { "type": "Span", "start": 8, - "end": 36 + "end": 36, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 5 + } } } ], "span": { "type": "Span", "start": 8, - "end": 36 + "end": 36, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 5 + } } }, "attributes": [], @@ -99,13 +199,33 @@ "span": { "type": "Span", "start": 0, - "end": 36 + "end": 36, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 5 + } } } ], "span": { "type": "Span", "start": 0, - "end": 37 + "end": 37, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 0 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/variant_with_digit_key.json b/fluent.syntax/tests/syntax/fixtures_structure/variant_with_digit_key.json index cf96f843..9470ad2f 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/variant_with_digit_key.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/variant_with_digit_key.json @@ -9,7 +9,17 @@ "span": { "type": "Span", "start": 1, - "end": 5 + "end": 5, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 1 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 5 + } } }, "value": { @@ -27,13 +37,33 @@ "span": { "type": "Span", "start": 11, - "end": 14 + "end": 14, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 11 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 14 + } } }, "span": { "type": "Span", "start": 10, - "end": 14 + "end": 14, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 10 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 14 + } } }, "variants": [ @@ -45,7 +75,17 @@ "span": { "type": "Span", "start": 28, - "end": 30 + "end": 30, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 10 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 12 + } } }, "value": { @@ -57,41 +97,101 @@ "span": { "type": "Span", "start": 32, - "end": 35 + "end": 35, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 14 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 17 + } } } ], "span": { "type": "Span", "start": 32, - "end": 35 + "end": 35, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 14 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 17 + } } }, "default": true, "span": { "type": "Span", "start": 26, - "end": 35 + "end": 35, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 17 + } } } ], "span": { "type": "Span", "start": 10, - "end": 40 + "end": 40, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 10 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 4 + } } }, "span": { "type": "Span", "start": 8, - "end": 41 + "end": 41, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 5 + } } } ], "span": { "type": "Span", "start": 8, - "end": 41 + "end": 41, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 5 + } } }, "attributes": [], @@ -99,13 +199,33 @@ "span": { "type": "Span", "start": 0, - "end": 41 + "end": 41, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 5 + } } } ], "span": { "type": "Span", "start": 0, - "end": 42 + "end": 42, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 0 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/variant_with_empty_pattern.json b/fluent.syntax/tests/syntax/fixtures_structure/variant_with_empty_pattern.json index c46c71e8..ef2f8fbb 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/variant_with_empty_pattern.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/variant_with_empty_pattern.json @@ -9,7 +9,17 @@ "span": { "type": "Span", "start": 0, - "end": 4 + "end": 4, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 4 + } } }, "value": { @@ -25,7 +35,17 @@ "span": { "type": "Span", "start": 13, - "end": 14 + "end": 14, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 14 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 15 + } } }, "variants": [ @@ -37,7 +57,17 @@ "span": { "type": "Span", "start": 27, - "end": 30 + "end": 30, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 9 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 12 + } } }, "value": { @@ -51,47 +81,117 @@ "span": { "type": "Span", "start": 33, - "end": 35 + "end": 35, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 15 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 17 + } } }, "span": { "type": "Span", "start": 32, - "end": 36 + "end": 36, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 14 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 18 + } } } ], "span": { "type": "Span", "start": 32, - "end": 36 + "end": 36, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 14 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 18 + } } }, "default": true, "span": { "type": "Span", "start": 25, - "end": 36 + "end": 36, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 7 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 18 + } } } ], "span": { "type": "Span", "start": 13, - "end": 41 + "end": 41, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 14 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 4 + } } }, "span": { "type": "Span", "start": 11, - "end": 42 + "end": 42, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 12 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 5 + } } } ], "span": { "type": "Span", "start": 7, - "end": 42 + "end": 42, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 5 + } } }, "attributes": [], @@ -99,7 +199,17 @@ "span": { "type": "Span", "start": 0, - "end": 42 + "end": 42, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 5 + } } }, { @@ -113,7 +223,17 @@ "span": { "type": "Span", "start": 78, - "end": 78 + "end": 78, + "start_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 13 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 13 + } } } ], @@ -121,13 +241,33 @@ "span": { "type": "Span", "start": 44, - "end": 85 + "end": 85, + "start_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 10, + "column_index": 0 + } } } ], "span": { "type": "Span", "start": 0, - "end": 85 + "end": 85, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 10, + "column_index": 1 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/variant_with_leading_space_in_name.json b/fluent.syntax/tests/syntax/fixtures_structure/variant_with_leading_space_in_name.json index 5a99158d..a0e0e4ad 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/variant_with_leading_space_in_name.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/variant_with_leading_space_in_name.json @@ -9,7 +9,17 @@ "span": { "type": "Span", "start": 1, - "end": 5 + "end": 5, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 1 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 5 + } } }, "value": { @@ -27,13 +37,33 @@ "span": { "type": "Span", "start": 11, - "end": 14 + "end": 14, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 11 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 14 + } } }, "span": { "type": "Span", "start": 10, - "end": 14 + "end": 14, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 10 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 14 + } } }, "variants": [ @@ -45,7 +75,17 @@ "span": { "type": "Span", "start": 30, - "end": 33 + "end": 33, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 12 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 15 + } } }, "value": { @@ -57,41 +97,101 @@ "span": { "type": "Span", "start": 35, - "end": 38 + "end": 38, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 17 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 20 + } } } ], "span": { "type": "Span", "start": 35, - "end": 38 + "end": 38, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 17 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 20 + } } }, "default": true, "span": { "type": "Span", "start": 26, - "end": 38 + "end": 38, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 20 + } } } ], "span": { "type": "Span", "start": 10, - "end": 43 + "end": 43, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 10 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 4 + } } }, "span": { "type": "Span", "start": 8, - "end": 44 + "end": 44, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 5 + } } } ], "span": { "type": "Span", "start": 8, - "end": 44 + "end": 44, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 5 + } } }, "attributes": [], @@ -99,13 +199,33 @@ "span": { "type": "Span", "start": 0, - "end": 44 + "end": 44, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 5 + } } } ], "span": { "type": "Span", "start": 0, - "end": 45 + "end": 45, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 0 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/variant_with_symbol_with_space.json b/fluent.syntax/tests/syntax/fixtures_structure/variant_with_symbol_with_space.json index 601d0dd1..a9f74a2c 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/variant_with_symbol_with_space.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/variant_with_symbol_with_space.json @@ -14,7 +14,17 @@ "span": { "type": "Span", "start": 33, - "end": 33 + "end": 33, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 14 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 14 + } } } ], @@ -22,13 +32,33 @@ "span": { "type": "Span", "start": 0, - "end": 55 + "end": 55, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 0 + } } } ], "span": { "type": "Span", "start": 0, - "end": 55 + "end": 55, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 1 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/variants_with_two_defaults.json b/fluent.syntax/tests/syntax/fixtures_structure/variants_with_two_defaults.json index 636147e5..51116840 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/variants_with_two_defaults.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/variants_with_two_defaults.json @@ -12,7 +12,17 @@ "span": { "type": "Span", "start": 38, - "end": 38 + "end": 38, + "start_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 4 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 2, + "column_index": 4 + } } } ], @@ -20,13 +30,33 @@ "span": { "type": "Span", "start": 0, - "end": 55 + "end": 55, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 0 + } } } ], "span": { "type": "Span", "start": 0, - "end": 55 + "end": 55, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 5, + "column_index": 1 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/whitespace_leading.json b/fluent.syntax/tests/syntax/fixtures_structure/whitespace_leading.json index 7678a603..27252ab1 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/whitespace_leading.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/whitespace_leading.json @@ -9,7 +9,17 @@ "span": { "type": "Span", "start": 21, - "end": 25 + "end": 25, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 4 + } } }, "value": { @@ -21,14 +31,34 @@ "span": { "type": "Span", "start": 41, - "end": 46 + "end": 46, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 20 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 25 + } } } ], "span": { "type": "Span", "start": 41, - "end": 46 + "end": 46, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 20 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 25 + } } }, "attributes": [], @@ -38,13 +68,33 @@ "span": { "type": "Span", "start": 0, - "end": 20 + "end": 20, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 20 + } } }, "span": { "type": "Span", "start": 0, - "end": 46 + "end": 46, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 25 + } } }, { @@ -55,7 +105,17 @@ "span": { "type": "Span", "start": 65, - "end": 69 + "end": 69, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 4 + } } }, "value": { @@ -67,14 +127,34 @@ "span": { "type": "Span", "start": 75, - "end": 84 + "end": 84, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 10 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 19 + } } } ], "span": { "type": "Span", "start": 75, - "end": 84 + "end": 84, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 10 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 19 + } } }, "attributes": [], @@ -84,13 +164,33 @@ "span": { "type": "Span", "start": 48, - "end": 64 + "end": 64, + "start_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 16 + } } }, "span": { "type": "Span", "start": 48, - "end": 84 + "end": 84, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 19 + } } }, { @@ -101,7 +201,17 @@ "span": { "type": "Span", "start": 86, - "end": 90 + "end": 90, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 4 + } } }, "value": { @@ -115,13 +225,33 @@ "span": { "type": "Span", "start": 94, - "end": 96 + "end": 96, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 10 + } } }, "span": { "type": "Span", "start": 93, - "end": 97 + "end": 97, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 7 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 11 + } } }, { @@ -130,14 +260,34 @@ "span": { "type": "Span", "start": 97, - "end": 111 + "end": 111, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 11 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 25 + } } } ], "span": { "type": "Span", "start": 93, - "end": 111 + "end": 111, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 7 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 25 + } } }, "attributes": [], @@ -145,7 +295,17 @@ "span": { "type": "Span", "start": 86, - "end": 111 + "end": 111, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 25 + } } }, { @@ -156,7 +316,17 @@ "span": { "type": "Span", "start": 112, - "end": 116 + "end": 116, + "start_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 4 + } } }, "value": { @@ -170,13 +340,33 @@ "span": { "type": "Span", "start": 120, - "end": 131 + "end": 131, + "start_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 8 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 19 + } } }, "span": { "type": "Span", "start": 119, - "end": 132 + "end": 132, + "start_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 7 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 20 + } } }, { @@ -185,14 +375,34 @@ "span": { "type": "Span", "start": 132, - "end": 137 + "end": 137, + "start_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 20 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 25 + } } } ], "span": { "type": "Span", "start": 119, - "end": 137 + "end": 137, + "start_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 7 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 25 + } } }, "attributes": [], @@ -200,13 +410,33 @@ "span": { "type": "Span", "start": 112, - "end": 137 + "end": 137, + "start_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 25 + } } } ], "span": { "type": "Span", "start": 0, - "end": 138 + "end": 138, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 0 + } } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/whitespace_trailing.json b/fluent.syntax/tests/syntax/fixtures_structure/whitespace_trailing.json index 592d877c..208e768e 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/whitespace_trailing.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/whitespace_trailing.json @@ -9,7 +9,17 @@ "span": { "type": "Span", "start": 27, - "end": 31 + "end": 31, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 4 + } } }, "value": { @@ -21,14 +31,34 @@ "span": { "type": "Span", "start": 34, - "end": 53 + "end": 53, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 7 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 26 + } } } ], "span": { "type": "Span", "start": 34, - "end": 53 + "end": 53, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 7 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 26 + } } }, "attributes": [], @@ -38,13 +68,33 @@ "span": { "type": "Span", "start": 0, - "end": 26 + "end": 26, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 26 + } } }, "span": { "type": "Span", "start": 0, - "end": 53 + "end": 53, + "start_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 1, + "column_index": 26 + } } }, { @@ -55,7 +105,17 @@ "span": { "type": "Span", "start": 77, - "end": 81 + "end": 81, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 4 + } } }, "value": { @@ -67,14 +127,34 @@ "span": { "type": "Span", "start": 84, - "end": 96 + "end": 96, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 7 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 19 + } } } ], "span": { "type": "Span", "start": 84, - "end": 96 + "end": 96, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 7 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 19 + } } }, "attributes": [], @@ -84,13 +164,33 @@ "span": { "type": "Span", "start": 55, - "end": 76 + "end": 76, + "start_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 3, + "column_index": 21 + } } }, "span": { "type": "Span", "start": 55, - "end": 96 + "end": 96, + "start_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 4, + "column_index": 19 + } } }, { @@ -101,7 +201,17 @@ "span": { "type": "Span", "start": 98, - "end": 102 + "end": 102, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 4 + } } }, "value": { @@ -113,7 +223,17 @@ "span": { "type": "Span", "start": 105, - "end": 124 + "end": 124, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 7 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 26 + } } }, { @@ -126,20 +246,50 @@ "span": { "type": "Span", "start": 125, - "end": 134 + "end": 134, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 27 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 36 + } } }, "attribute": null, "span": { "type": "Span", "start": 125, - "end": 134 + "end": 134, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 27 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 36 + } } }, "span": { "type": "Span", "start": 124, - "end": 135 + "end": 135, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 26 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 37 + } } }, { @@ -148,14 +298,34 @@ "span": { "type": "Span", "start": 135, - "end": 136 + "end": 136, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 37 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 38 + } } } ], "span": { "type": "Span", "start": 105, - "end": 136 + "end": 136, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 7 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 38 + } } }, "attributes": [], @@ -163,7 +333,17 @@ "span": { "type": "Span", "start": 98, - "end": 136 + "end": 136, + "start_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 6, + "column_index": 38 + } } }, { @@ -174,7 +354,17 @@ "span": { "type": "Span", "start": 137, - "end": 141 + "end": 141, + "start_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 4 + } } }, "value": { @@ -186,7 +376,17 @@ "span": { "type": "Span", "start": 144, - "end": 149 + "end": 149, + "start_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 7 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 12 + } } }, { @@ -197,20 +397,50 @@ "span": { "type": "Span", "start": 150, - "end": 163 + "end": 163, + "start_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 13 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 26 + } } }, "span": { "type": "Span", "start": 149, - "end": 164 + "end": 164, + "start_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 12 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 27 + } } } ], "span": { "type": "Span", "start": 144, - "end": 164 + "end": 164, + "start_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 7 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 27 + } } }, "attributes": [], @@ -218,13 +448,33 @@ "span": { "type": "Span", "start": 137, - "end": 164 + "end": 164, + "start_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 7, + "column_index": 27 + } } } ], "span": { "type": "Span", "start": 0, - "end": 165 + "end": 165, + "start_position": { + "type": "SourcePosition", + "row_index": 0, + "column_index": 0 + }, + "end_position": { + "type": "SourcePosition", + "row_index": 8, + "column_index": 0 + } } }