Summary
This fixes incorrect line numbers for errors inside claims blocks, especially when inner expressions are on the same line.
Problem
claims child expressions were assigned line numbers using line + expr_idx + 1, which is heuristic and can produce impossible diagnostics (for example, reporting line 3 for a one-line input).
Changes
- Added source-offset tracking to parsed
SExprnodes. - Updated SPL parsing internals to preserve offsets while parsing atoms/lists/strings.
- Updated
claimsprocessing to compute each child expression line vialine_of_offset(cleaned_input, expr.offset()). - Kept existing behavior otherwise unchanged.
Regression test added
test_claims_inner_expression_single_line_reports_line_one- Verifies malformed inner
claimsexpression on a single line reportsline 1correctly.
Validation
cargo test -p spindle-parser --lib
## Summary
This fixes incorrect line numbers for errors inside `claims` blocks, especially when inner expressions are on the same line.
## Problem
`claims` child expressions were assigned line numbers using `line + expr_idx + 1`, which is heuristic and can produce impossible diagnostics (for example, reporting `line 3` for a one-line input).
## Changes
- Added source-offset tracking to parsed `SExpr` nodes.
- Updated SPL parsing internals to preserve offsets while parsing atoms/lists/strings.
- Updated `claims` processing to compute each child expression line via `line_of_offset(cleaned_input, expr.offset())`.
- Kept existing behavior otherwise unchanged.
## Regression test added
- `test_claims_inner_expression_single_line_reports_line_one`
- Verifies malformed inner `claims` expression on a single line reports `line 1` correctly.
## Validation
- `cargo test -p spindle-parser --lib`