Skip to content

[codex] Add parser pretty-print round-trip tests#575

Merged
jsiek merged 1 commit into
mainfrom
codex/issue-473-parser-roundtrip
May 15, 2026
Merged

[codex] Add parser pretty-print round-trip tests#575
jsiek merged 1 commit into
mainfrom
codex/issue-473-parser-roundtrip

Conversation

@jsiek
Copy link
Copy Markdown
Owner

@jsiek jsiek commented May 15, 2026

Summary

  • Add a parser pretty-print round-trip check to the existing --equiv harness mode.
  • Round-trip representative accepted programs by parsing with RD/LALR, pretty-printing the AST, then re-parsing the generated source with both parsers and comparing canonical ASTs.
  • Keep the fixture set curated because the current pretty-printer is not parse-preserving for the full corpus yet.
  • Add mypy ignores for Markdown extension base classes in gh_pages/scripts/convert.py, which are imported as Any and block the required make tests gate.

Validation

  • python3 test-deduce.py --equiv --serial
  • python3 -m ruff check test-deduce.py gh_pages/scripts/convert.py
  • python3 -m mypy .
  • make tests

Draft PR for #473. This completes the round-trip parser test slice; the issue should remain open for broader grammar-fragment migration and any future expansion of the round-trip corpus.

@jsiek jsiek marked this pull request as ready for review May 15, 2026 21:17
@jsiek jsiek merged commit 70a8bb6 into main May 15, 2026
7 checks passed
@jsiek jsiek deleted the codex/issue-473-parser-roundtrip branch May 15, 2026 21:18
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