Skip to content

lang-python: fix unparse roundtrip check in bench.ts#583

Merged
pdubroy merged 1 commit intomainfrom
pdubroy/fix-python-unparse
Mar 5, 2026
Merged

lang-python: fix unparse roundtrip check in bench.ts#583
pdubroy merged 1 commit intomainfrom
pdubroy/fix-python-unparse

Conversation

@pdubroy
Copy link
Contributor

@pdubroy pdubroy commented Mar 5, 2026

Fixed the unparse roundtrip check in the Python benchmark. The CST is built from tokenized input (where comments are replaced with spaces), so reconstructing the full source now correctly uses the tokenized input for the prefix before the root node instead of the raw input.

The CST is built from tokenized input (where comments are replaced with spaces),
so reconstructing the full source requires using tokenizedInput for the prefix
before the root node, not the raw input.
@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 5, 2026

Open in StackBlitz

npm i https://pkg.pr.new/ohmjs/ohm/@ohm-js/compiler@583
npm i https://pkg.pr.new/ohmjs/ohm/ohm-js@583
npm i https://pkg.pr.new/ohmjs/ohm/@ohm-js/to-ast-compat@583

commit: 2ddf997

@pdubroy pdubroy force-pushed the pdubroy/fix-python-unparse branch from 5d879b9 to b4a49b8 Compare March 5, 2026 20:25
@pdubroy pdubroy merged commit 84a0785 into main Mar 5, 2026
4 checks passed
@pdubroy pdubroy deleted the pdubroy/fix-python-unparse branch March 5, 2026 20:27
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