Skip to content

Post-vtable-refactor cleanup: docs + relocate plx_diag_prefix into the engine#3

Merged
jdatcmd merged 3 commits into
masterfrom
chore/post-vtable-cleanup
Jul 17, 2026
Merged

Post-vtable-refactor cleanup: docs + relocate plx_diag_prefix into the engine#3
jdatcmd merged 3 commits into
masterfrom
chore/post-vtable-cleanup

Conversation

@jdatcmd

@jdatcmd jdatcmd commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #2 (the PlxSurface.parse_body vtable 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-dialect parse_body vtable split (introducing plx_engine.h and plx_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 an Unreleased entry covering Refactor dialect front ends behind a PlxSurface.parse_body vtable #2 and this follow-up.

Code cleanups (all no-op)

  • Relocated plx_diag_prefix() out of src/plx_dialect_ruby.c back into the engine (src/plx_transpile.c). It's declared in plx_engine.h and 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.
  • Tightened linkage: the six single-dialect plx_*_parse_body front ends (ruby/python/cobol/plsql/tsql/go) are only referenced by their own surface in their own TU, so they're now static and dropped from plx_engine.h. Only the shared plx_brace_parse_body (php/js/ts) keeps a prototype.
  • Dropped dead code: the write-only Ctx.nt field (set once in plx_lex, never read).
  • Fixed a stale comment: COBOL's surface carries no keyword table (.kws = NULL); the header comment claimed one was "kept for consistency".

Verification

  • Clean rebuild, zero warnings, at each commit.
  • installcheck: 13/13 pass (all dialects) against unchanged goldens — no behavior change.

🤖 Generated with Claude Code

plx and others added 3 commits July 17, 2026 16:30
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>
@jdatcmd
jdatcmd merged commit afe63de into master Jul 17, 2026
6 checks passed
@jdatcmd
jdatcmd deleted the chore/post-vtable-cleanup branch July 17, 2026 23:12
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