Skip to content

Classify directive syntax errors - #1322

Draft
danielporterda wants to merge 1 commit into
snippet-candidate-condition-diagnosticsfrom
snippet-classify-syntax-errors
Draft

Classify directive syntax errors#1322
danielporterda wants to merge 1 commit into
snippet-candidate-condition-diagnosticsfrom
snippet-classify-syntax-errors

Conversation

@danielporterda

@danielporterda danielporterda commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

What changed

Classifies directive parser failures with typed rules for malformed or duplicate attributes, non-self-closing <Snippet>, self-closing conditional tags, attributes on closing tags, and attributes on <Else>.

This PR does not assign public diagnostic codes; it only makes parser failures machine-classifiable instead of requiring message inspection.

Why

Syntax-error classification is separate from parsing successful tags and from rendering page diagnostics.

Validation

  • python -m pytest tests/test_directive_syntax_error_classification.py tests/test_snippet_tag_parser.py tests/test_if_version_tag_parser.py (20 passed)
  • python -m ruff check scripts/snippets/model.py scripts/snippets/syntax.py tests/test_directive_syntax_error_classification.py
  • python -m mypy scripts/snippets/model.py scripts/snippets/syntax.py
  • git diff --check

Signed-off-by: danielporterda <daniel.porter@digitalasset.com>
@danielporterda
danielporterda force-pushed the snippet-classify-syntax-errors branch from 9a899d3 to beb6991 Compare August 7, 2026 16:45
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