Skip to content

Simplify grammar parsing API contract - #233

Merged
rlippmann merged 3 commits into
mainfrom
remove_validateddirective
Aug 7, 2026
Merged

Simplify grammar parsing API contract#233
rlippmann merged 3 commits into
mainfrom
remove_validateddirective

Conversation

@rlippmann

Copy link
Copy Markdown
Owner

What changed

  • Removed redundant grammar API layers:
    • removed is_canonical_directive();
    • removed ValidatedDirective and validate_directive().
  • Clarified the remaining grammar API responsibilities:
    • match_canonical_directive_start() for shallow syntax detection;
    • decompose_directive() for full directive parsing;
    • render_directive() for canonical directive serialization.
  • Clarified directive text semantics:
    • CanonicalDirective.text and related text fields preserve accepted input text;
    • canonical serialized output is produced through render_directive().
  • Strengthened grammar round-trip property coverage to verify rendered directives preserve both kind and operands.
  • Removed duplicate grammar conformance fixture coverage.
  • Bumped the development release version to 0.9.0dev7.

Why

  • Reduce redundant public grammar surface area.
  • Keep the grammar contract focused on parsing, detection, and rendering responsibilities.
  • Make the Python/TypeScript grammar API easier to keep aligned.

Checklist

  • pre-commit run (uv run pre-commit run --all-files)
  • tests pass (uv run pytest)

@rlippmann
rlippmann merged commit 66cd9df into main Aug 7, 2026
16 checks passed
@rlippmann
rlippmann deleted the remove_validateddirective branch August 7, 2026 07:37
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