Skip to content

Track opening spans for unclosed delimiters#112

Merged
leynos merged 12 commits intomainfrom
codex/improve-span-tracking-for-unclosed-delimiters
Aug 12, 2025
Merged

Track opening spans for unclosed delimiters#112
leynos merged 12 commits intomainfrom
codex/improve-span-tracking-for-unclosed-delimiters

Conversation

@leynos
Copy link
Copy Markdown
Owner

@leynos leynos commented Aug 8, 2025

Summary

  • record spans when opening delimiters and surface them in ParseError::UnclosedDelimiter
  • expose span-aware open_delimiter helper
  • document that unclosed delimiter errors point to the opening token

Testing

  • make fmt
  • make lint
  • make test
  • make markdownlint

https://chatgpt.com/codex/tasks/task_e_689553fd1f5083229549543ef2561574

Summary by Sourcery

Track and report the spans of opening delimiters in the parser to improve UnclosedDelimiter diagnostics and expose a span-aware open_delimiter helper.

New Features:

  • Expose a span-aware open_delimiter helper for recording opening token ranges

Enhancements:

  • Record opening delimiter spans in DelimStack entries and return them in unclosed error reporting
  • Surface the correct opening token span in ParseError::UnclosedDelimiter
  • Refactor handle_opening_delimiter to pass token text ranges to the delimiter stack

Documentation:

  • Document that unclosed delimiter errors highlight the opening delimiter’s position

Tests:

  • Update unclosed_angle_error test to assert the reported span matches the opening token

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant