Skip to content

Code directive syntax diagnostics - #1323

Draft
danielporterda wants to merge 1 commit into
snippet-classify-syntax-errorsfrom
snippet-syntax-error-diagnostics
Draft

Code directive syntax diagnostics#1323
danielporterda wants to merge 1 commit into
snippet-classify-syntax-errorsfrom
snippet-syntax-error-diagnostics

Conversation

@danielporterda

@danielporterda danielporterda commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

What changed

Maps classified directive parser failures to stable diagnostics: malformed/duplicate attributes SNIP013, non-self-closing <Snippet> SNIP014, self-closing <IfVersion> SNIP019, invalid <Else> forms SNIP024, and attributes on closing tags SNIP011.

This PR assigns codes only and does not change parsing or syntax classification.

Why

Syntax diagnostics are separate from successful syntax parsing and from semantic validation diagnostics.

Validation

  • python -m pytest tests/test_directive_syntax_diagnostics.py tests/test_directive_syntax_error_classification.py (14 passed)
  • python -m ruff check scripts/snippets/diagnostics.py tests/test_directive_syntax_diagnostics.py
  • python -m mypy scripts/snippets/diagnostics.py
  • git diff --check

Signed-off-by: danielporterda <daniel.porter@digitalasset.com>
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