Skip to content

fix(abap): fifth bug -- prism.py's unqualified '!' truncated real param syntax - #1913

Merged
squid-protocol merged 1 commit into
mainfrom
fix/abap-args-investigation
Aug 20, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
fix/abap-args-investigation

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Summary

Closes out the "not yet root-caused" args discrepancy noted as an open question in docs/language_status/abap.md §9's previous revision, rather than leaving it unresolved. Same root-cause shape as #1898, a different unqualified character.

Fixes #1911 -- prism.py's _strip_positional_comments() has a "Modern Inline Fortran (!)" branch that, unlike the " branch right above it, was not gated by abap_mode. ! has no comment meaning in ABAP at all, but ABAP uses a leading ! to escape formal parameter names in method signatures (IMPORTING !iv_url TYPE string) -- extremely common syntax. Every such line was truncated at the !, erasing the parameter name and its TYPE clause into the comment stream.

zcl_abapgit_git_porcelain.clas.abap's raw text is 26,121 chars; its code_stream was only 23,214 -- prism.py is supposed to preserve length/line structure, only blanking content in place, so that ~2,900 char loss was itself the tell. With real parameter names blanked to whitespace, the args regex's \s+ reached across the empty lines to the NEXT keyword (e.g. RETURNING) and mismatched it as the current keyword's own parameter name, producing a completely different match set (31 vs. 22, zero overlap) -- not a simple over/undercount, which is why the discrepancy didn't move in one consistent direction across files.

Fix

Gated the ! branch the same way " already was. Fortran (which legitimately uses ! for inline comments) is unaffected -- verified via its own test suite plus an isolated repro. code_stream's args match count now equals the raw-text count exactly for all 7 corpus files, and struct_args in the DB matches too. Blast radius is wider than args alone -- restoring the erased text also corrected core_var_decl/casing-classifier counts and indentation signals scanning the same code_stream.

Test plan

🤖 Generated with Claude Code

…am syntax

Closes out the "not yet root-caused" args discrepancy noted in the
previous revision of docs/language_status/abap.md, rather than leaving it
open. Same root-cause shape as #1898, different character.

Fixes #1911: prism.py's _strip_positional_comments() has a "Modern Inline
Fortran (!)" branch that, unlike the "\"" branch right above it, was not
gated by abap_mode. "!" has no comment meaning in ABAP at all, but ABAP
uses a leading "!" to escape formal parameter names in method signatures
(e.g. "IMPORTING !iv_url TYPE string") -- extremely common syntax. Every
such line was truncated at the "!", erasing the parameter name and its
TYPE clause into the comment stream.

zcl_abapgit_git_porcelain.clas.abap's raw text is 26,121 chars; its
code_stream was only 23,214 -- prism.py is supposed to preserve length/
line structure, only blanking content in place, so that ~2,900 char loss
was itself the tell. With real parameter names blanked to whitespace, the
args regex's \s+ reached across the empty lines to the NEXT keyword (e.g.
RETURNING) and mismatched it as the current keyword's own parameter name,
producing a completely different match set (31 vs 22, zero overlap) --
not a simple over/undercount, which is why the discrepancy didn't move in
one consistent direction across files.

Gated the "!" branch the same way "\"" already was. Fortran (which
legitimately uses "!" for inline comments) is unaffected, verified via
its own test suite plus an isolated repro. code_stream's args match count
now equals the raw-text count exactly for all 7 corpus files, and
struct_args in the DB matches too. Blast radius is wider than args alone
-- restoring the erased text also corrected core_var_decl/casing-
classifier counts and indentation signals scanning the same code_stream.

Full test suite (7004 tests), extraction suite (6128 tests), and both
crucible_check.py modes pass clean after regenerating both golden master
fixtures. Diff confirmed scoped to abap's own numbers plus expected
spatial-coordinate ripple in unrelated files, same as #1898/#1899.

Updated docs/language_status/abap.md (all 5 bugs now fixed and
cross-linked) and tri-comparison-ledger-sweep's SKILL.md (an "open
question, not yet root-caused" note is a lead to chase down before
closing out a sweep, not a permanent resting state -- this is the second
time in one session that going back to close an open question found a
real bug).

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol merged commit 9c8fbb9 into main Aug 20, 2026
29 checks passed
@squid-protocol
squid-protocol deleted the fix/abap-args-investigation branch August 20, 2026 13:10
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.

prism.py: unqualified '!' inline-comment branch truncates ABAP's real !param syntax, corrupting args counting

1 participant