Sync with pyRegTab 0.5.1: anchor attribute moves with its values - #1
Merged
Conversation
pyRegTab 0.5.1 fixes ANCH(n)/REC(n): the transformation now moves the anchor attribute itself -- its name together with its values -- so patterns that name attributes through AVP keep every record's name-value pairs. The extension is affected through the match preview, which prints the recordset schema verbatim from the pinned core. plans/INDEX.md did not exist; it is added with entries for all three plans, modelled on pyregtab/plans/INDEX.md. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
0.5.1 fixes ANCH(n)/REC(n): the transformation now moves the anchor attribute itself -- its name together with its values -- instead of permuting only the values and returning the schema untouched. With named attributes (produced by AVP) that bug broke the name-value binding, so the column carrying the anchor's name received another attribute's values. preview.rs needs no change: run() passes rs.schema.attributes through verbatim, so the corrected schema reaches the webview on its own. But nothing in the repo exercised AVP together with ANCH(n), which is why the wrong header could ship unnoticed -- hence the test, with its data taken from pyregtab's conformance case semantic/anch_named_attrs rather than invented here. The test discriminates: against the v0.5.0 core it fails on the schema assertion (["Lokaler","Dato","Klasse"] vs ["Dato","Lokaler","Klasse"]) while the values match on both, which is exactly the binding the fix restores. Plan: plans/PYREGTAB_051_SYNC.md §3, §6. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
tools/gen_hover_data.py harvests the settings and action tables from pyregtab's docs/rtl-reference.md, and 0.5.1 rewrote exactly the two rows that describe the anchor transformation: ANCH(n) no longer "uses position n as the attribute name" but moves the anchor attribute to position n, and REC(n) says the name travels with its values. Regenerated with the script, not hand-edited -- the file is @generated. The diff is the two entries and nothing else: the generator reads only pipe tables, so 0.5.1's new prose in the "Settings prefix" section and its "Inline equivalents" admonition stay out of the dictionary. Plan: plans/PYREGTAB_051_SYNC.md §4. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
RTL.g4 is byte-identical at jRegTab v0.5.0 and v0.5.1, so grammar/UPSTREAM keeps
its sha256 line and only the commit and tag move. The commit sha is used rather
than the annotated tag object c126337 that pyregtab recorded, because
check_grammar_sync.py fetches raw.githubusercontent.com/.../<commit>/..., which
resolves a commit but not a tag object.
The "Settings prefix" snippet said the setting picks an "anchor column", which
was already the wrong mental model and is now plainly wrong: an attribute moves,
a column name is not borrowed. Only the description changes; prefix and body are
untouched, and the American spelling used elsewhere in the extension's own text
is kept.
The two fixtures come from the semantic conformance cases added in 0.5.1, copied
byte-for-byte. They close real gaps in the TextMate snapshots: no fixture
carried a genuine <ANCH(n)> setting (only <FOO> in settings_unknown.rtl), and
none carried a delimited specification {','} at all. No existing snapshot moved.
The S_delim references to 0.5.0 in CLAUDE.md and DEVELOPMENT.md are left alone --
they are the historical incident that justifies pinning, not a current version.
Plan: plans/PYREGTAB_051_SYNC.md §5, §7.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Records the plan under plans/, marked done, with the result section listing the pin changes, the discriminating check on the new preview test, and the two small deviations the implementation needed. Publishing (tag v0.8.9 -> Marketplace/Open VSX) is deliberately not part of this change. Co-Authored-By: Claude Opus 5 (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.
Ports the jRegTab 0.5.1 fix for
ANCH(n)/REC(n)into the extension bymoving the pinned core to pyRegTab
v0.5.1.What changed upstream
The post-extraction transformation used to apply the permutation only to record
values while returning the schema unchanged. For anonymous attributes that was
invisible; for named ones (produced by
AVP) the name-value binding broke —the column carrying the anchor's name received another attribute's values.
ANCH(n)now moves the attribute itself, name together with its values, so onlythe schema order changes.
RTL syntax, the grammar and ATP→RTL serialization are unchanged.
What that means here
The match preview prints the recordset schema verbatim from the core
(
preview.rspassesrs.schema.attributesstraight through), so patternscombining
AVPwithANCH(n)/REC(n)now render the correct header with nopreview code change.
Nothing in the repository exercised that combination, which is why a wrong
header could ship unnoticed — so this adds a preview test built on pyregtab's
own conformance case
semantic/anch_named_attrsrather than invented data.The test discriminates. Against the
v0.5.0core it fails on the schemaassertion (
["Lokaler","Dato","Klasse"]vs["Dato","Lokaler","Klasse"]) whilethe values match on both cores — exactly the binding the fix restores.
Also in this PR
tools/gen_hover_data.py(not hand-edited);the diff is exactly the
ANCHandREC(n)entries.snippets/rtl.json: the "Settings prefix" description said "anchor column",which is now plainly wrong — an attribute moves, a column name is not borrowed.
grammar/UPSTREAMre-pinned to jRegTab v0.5.1.RTL.g4is byte-identical atv0.5.0 and v0.5.1, so the
sha256line is untouched; the commit sha isused rather than the annotated tag object, since the sync check fetches
raw.githubusercontent.com/.../<commit>/....They close real gaps: no fixture carried a genuine
<ANCH(n)>setting (only<FOO>), and none carried a delimited specification{','}at all.plans/, and a newplans/INDEX.md.Verification
No baseline was bent:
syntaxes/,grammar/RTL.g4andserver/tests/corpus/**are untouched, all 11 existing snapshots are byte-identical (two new ones added),
and
negative_corpus_positionsstill passes, soconflict_anch_rec.rtlremainsa compile error under 0.5.1.
Known, recorded as backlog (not fixed here)
server/tests/corpus/VERSIONsays2026-07-07whiletest/grammar/fixtures/CORPUS.mdquotes it as2026-08-26.hover_data.rshas no freshness gate at all, unlikeRTL.g4.🤖 Generated with Claude Code