Skip to content

tooling(codemod): instrumented parser + #{ record-migration codemod#312

Closed
hyperpolymath wants to merge 1 commit into
mainfrom
stage-c/codemod
Closed

tooling(codemod): instrumented parser + #{ record-migration codemod#312
hyperpolymath wants to merge 1 commit into
mainfrom
stage-c/codemod

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

Branch-only tooling for affinescript#218 (do NOT merge into main — the Codemod_hook instrumentation is for the migration sweep only).

lib/codemod_hook.ml records every record-literal LBRACE byte offset; parser.mly ExprRecord productions call Codemod_hook.note; codemod/ exe inserts '#' at exactly those offsets ({->#{, Foo {->Foo #{). Safety: refuses to rewrite unless every recorded offset is really '{'. Hardened to catch per-file parser exceptions so one bad file can't abort the sweep.

Known limitation (recorded on #218): Affinescript.Parse.parse_file hits a pre-existing Match_failure (parse.ml:49) on stdlib + ~95/261 .affine that the 257 AOT harness parses fine — fix that parse-API bug (next) before the stdlib sweep.

Refs #218

Branch-only tooling for affinescript#218 (do NOT merge into main —
the Codemod_hook instrumentation is for the migration sweep only).

lib/codemod_hook.ml records every record-literal LBRACE byte offset;
parser.mly ExprRecord productions call Codemod_hook.note; codemod/
exe inserts '#' at exactly those offsets (`{`->`#{`, `Foo {`->`Foo #{`).
Safety: refuses to rewrite unless every recorded offset is really '{'.
Hardened to catch per-file parser exceptions so one bad file can't
abort the sweep.

Known limitation (recorded on #218): Affinescript.Parse.parse_file
hits a pre-existing Match_failure (parse.ml:49) on stdlib + ~95/261
.affine that the 257 AOT harness parses fine — fix that parse-API
bug (next) before the stdlib sweep.

Refs #218

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hyperpolymath
Copy link
Copy Markdown
Owner Author

Closing as superseded.

The #{ record-syntax migration epic #218 already landed on main:

This PR's body itself states "do NOT merge into main — the Codemod_hook instrumentation is for the migration sweep only." The migration sweep is done; the instrumented-parser tooling has no remaining purpose on main. Issue #218 is CLOSED.

Sibling PR #310 (the application of the codemod's output) is also being closed as superseded by #222.

No salvage — the lib/codemod_hook.ml + codemod/ tree is branch-only by design.

@hyperpolymath hyperpolymath deleted the stage-c/codemod branch May 20, 2026 23: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