Repository navigation
fix(abap): fifth bug -- prism.py's unqualified '!' truncated real param syntax - #1913
Merged
Merged
Conversation
…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]>
Contributor
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.
Summary
Closes out the "not yet root-caused"
argsdiscrepancy noted as an open question indocs/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 byabap_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 itsTYPEclause into the comment stream.zcl_abapgit_git_porcelain.clas.abap's raw text is 26,121 chars; itscode_streamwas 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, theargsregex'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'sargsmatch count now equals the raw-text count exactly for all 7 corpus files, andstruct_argsin the DB matches too. Blast radius is wider thanargsalone -- restoring the erased text also correctedcore_var_decl/casing-classifier counts and indentation signals scanning the samecode_stream.Test plan
tests/extraction/languages/(6128 tests) pass, including COBOL/Fortran (409 tests, the other users of this shared code path).python -m pytest tests/-- 7004 passed, 2 skipped, 11 xfailed, 3 xpassed.python tests/tools/crucible_check.py-- both modes pass after regenerating both golden master fixtures. Full un-capped diff confirmed scoped to abap's own numbers plus expected spatial-coordinate ripple in unrelated files (same shape as prism.py: ABAP's positional comment stripper reuses Fortran/COBOL's column-1 anchor set, erasing real code as comments #1898/detector.py: ABAP unregistered in ScopeParsingRegistry falls through to brace-based function slicing, dropping ~87% of real methods #1899), no other language's own signals moved.python tests/tools/audit_check.py-- ruff/mypy/dead-key/ast-accuracy all clear.docs/language_status/abap.mdupdated -- all 5 bugs found in this investigation now fixed and cross-linked.tri-comparison-ledger-sweep'sSKILL.mdupdated -- an "open question, not yet root-caused" note is a lead to chase down before closing out a sweep, not a permanent resting state.🤖 Generated with Claude Code