Post-vtable-refactor cleanup: docs + relocate plx_diag_prefix into the engine#3
Merged
Conversation
Follow-up to #2 (the PlxSurface.parse_body vtable refactor). Docs: - ARCHITECTURE.md: rewrite "The transpiler" to describe the engine + per-dialect parse_body vtable split (plx_engine.h, plx_parse_brace.c); refresh the file list and dialect list to the current 9 dialects; add the missing per-dialect chapter links. - CHANGELOG.md: add an Unreleased entry for the refactor + this follow-up. Code: - Move the dialect-neutral plx_diag_prefix() helper out of plx_dialect_ruby.c and back into the engine (plx_transpile.c), where its other callers (plx_dialect_python.c, plx_parse_brace.c) already reach it. The refactor had parked this shared engine helper in a dialect front end. Pure relocation, no functional change. Verified: clean rebuild (zero warnings) and 13/13 installcheck pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Follow-on cleanup from the post-merge audit of #2, in the same spirit as the plx_diag_prefix relocation: - Linkage (#2): the six single-dialect front ends (ruby/python/cobol/plsql/ tsql/go plx_*_parse_body) are only ever referenced by their own surface's .parse_body in their own translation unit, so make them static and drop their prototypes from plx_engine.h. Only plx_brace_parse_body is genuinely shared (php/js/ts) and keeps its prototype. - Dead code (#3): drop the write-only Ctx.nt field (set once in plx_lex, never read; the standalone tokenizers track their own token counts on their own structs). - Comment (#4): COBOL's surface carries no keyword table (.kws = NULL); fix the header comment that claimed a table was "kept for consistency". No functional change. Clean rebuild (zero warnings), 13/13 installcheck pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The existing docs use no em-dashes; the follow-up edits introduced four. Replace with a semicolon / parentheses per the house style. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #2 (the
PlxSurface.parse_bodyvtable refactor): documentation catch-up plus the structural cleanups surfaced by a post-merge static audit. Two commits.Docs
doc/ARCHITECTURE.md— rewrote "The transpiler" to describe the dialect-neutral engine + per-dialectparse_bodyvtable split (introducingplx_engine.handplx_parse_brace.c); refreshed the "Files" list and intro dialect list to the current 9 dialects; added the missing per-dialect chapter links (ts/go/cobol/plsql/tsql).CHANGELOG.md— added anUnreleasedentry covering Refactor dialect front ends behind a PlxSurface.parse_body vtable #2 and this follow-up.Code cleanups (all no-op)
plx_diag_prefix()out ofsrc/plx_dialect_ruby.cback into the engine (src/plx_transpile.c). It's declared inplx_engine.hand called from Python and the brace front end as well as Ruby — an engine helper Refactor dialect front ends behind a PlxSurface.parse_body vtable #2 had parked in a dialect front end.plx_*_parse_bodyfront ends (ruby/python/cobol/plsql/tsql/go) are only referenced by their own surface in their own TU, so they're nowstaticand dropped fromplx_engine.h. Only the sharedplx_brace_parse_body(php/js/ts) keeps a prototype.Ctx.ntfield (set once inplx_lex, never read)..kws = NULL); the header comment claimed one was "kept for consistency".Verification
installcheck: 13/13 pass (all dialects) against unchanged goldens — no behavior change.🤖 Generated with Claude Code