Skip to content

feat(parser): rework diagnostics and harden parser for v1#413

Merged
zharinov merged 1 commit into
masterfrom
parser-production-cleanup
Jun 12, 2026
Merged

feat(parser): rework diagnostics and harden parser for v1#413
zharinov merged 1 commit into
masterfrom
parser-production-cleanup

Conversation

@zharinov

Copy link
Copy Markdown
Member

Summary

  • Refactor parser/: remove dead API surface, restore lossless-CST guarantees, drop allocations in hot paths, correct misleading lexer comments (verified against vendored logos/rowan/annotate-snippets sources)
  • Rework parser diagnostics: consolidate naming-convention kinds, make fix patches verbatim-valid, polish all messages; cascade-suppressed rendering is now the user-facing default
  • New diagnostics: unterminated strings, quantified/captured anchors (previously type-unsound — a captured anchor produced a phantom typed field), tree-sitter style dotted/hyphenated captures; enforce strict snake_case capture names; remove XML-garbage tokens

Why

Pre-v1 cleanup so upcoming syntax extensions land on a solid base. Strict snake_case captures chosen deliberately: capture names become Rust struct fields under the planned proc-macro compilation.

Notes

  • CLI previously rendered unfiltered diagnostics — suppression only applied in tests; render/render_colored are now filtered, render_unfiltered kept for debugging
  • Fix replacements previously didn't match their spans (e.g. (a) @Name suggested (a) name); all patches now substitute the annotated range verbatim
  • Suppression rule added: a warning never outranks an error
  • UnclosedString ranks above other unclosed kinds: a missing quote swallows closing delimiters, so it is the root cause

@zharinov
zharinov enabled auto-merge (squash) June 12, 2026 19:27
@zharinov
zharinov merged commit de08554 into master Jun 12, 2026
4 checks passed
@zharinov
zharinov deleted the parser-production-cleanup branch June 12, 2026 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant