Repository navigation
fix(abap): args counts declared parameter surfaces, not call sites (#2824 contract corollary 1) - #2886
Merged
Conversation
… statement-scoped filter (#2824 contract corollary 1) ABAP passes actuals with the same six binding keywords its declarations use, and the owning statement can start an unbounded distance before the clause, so the decision cannot live in the rule regex (re has no variable-width lookbehind). New abap_declaration_statement scope filter (#2674 mechanism): tokenize statements at unquoted periods, keep clauses owned by METHODS/CLASS-METHODS/FORM/FUNCTION/MODULE. Crucible 167 -> 121, all 46 drops verified call sites (CALL FUNCTION ... EXPORTING/EXCEPTIONS, RAISE EXCEPTION ... EXPORTING, CREATE OBJECT ... EXPORTING, functional calls -- the bulk #2824's 3% statement-level estimate missed). Rosetta 16 -> 13: exactly the three PERFORM clauses #2806 planted. Golden masters re-blessed; bless_scope: abap only, Function Parameters + derived formulas, newly parsed/excluded none. The opener skip is plain code, not a regex loop -- the first draft was the #631 nested-quantifier shape and the strict suite's detonation caught it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012zPD39y58Bfrr2Q45Z6djL
Contributor
…cktracked exponentially (CodeQL on #2886) The string-template arm's escape alternative and ordinary-character alternative could both consume a backslash, so an unterminated template holding a backslash run had exponentially many parses. The arms are now disjoint on the backslash; token spans are identical on every real corpus and crucible abap file (verified), so no re-bless moves. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012zPD39y58Bfrr2Q45Z6djL
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.
ABAP passes actuals with the same six binding keywords its declarations use (
CALL FUNCTION ... EXPORTING/EXCEPTIONS,PERFORM ... CHANGING,RAISE EXCEPTION ... EXPORTING,walk( EXPORTING ... )), so abap'sargsrule scored call sites as declared parameter lists — corollary 1 of the stated contract (docs/args_rule_contract.md), the same failure shape #2786/#2790 fixed for objective-c/typescript/groovy/apex. abap audited clean in #2773 only because neither corpus then contained a call site using them; the #2806PERFORMplants exposed it (rosetta abapargs16 vs planted 13).The fix
The owning statement can start an unbounded distance before the clause and
rehas no variable-width lookbehind, so the decision cannot live in the rule regex. Newabap_declaration_statementscope filter (the #2674 registry mechanism, 4th filter): tokenize statements at unquoted periods (literals/templates/comments skipped), keep only clauses whose statement opens withMETHODS/CLASS-METHODS/FORM/FUNCTION/MODULE. The opener/comment skip is plain code, not a regex loop — the first draft's(?:[ \t\r\n]+|...)*was the #631 nested-quantifier ReDoS shape and the strict suite's detonation caught it before it shipped.Measured
CALLforms only; the functional-method-call form is the bulk in OO abapGit).a/f1.35 → 0.98.args16 → 13 (the planted median) — exactly the threePERFORM ... CHANGINGclauses. Per-function args unchanged (1 per FORM, verified via one-file--db-onlyscan).Function Parameters+ its derived formulas, newly parsed/excluded none.audit_checkclear;rosetta_auditvs the re-blessed corpus branch 46/46, 0 regressions.Docs:
args_rule_contract.mdabap rows updated (fallback family + audit table);how_to_add_a_language.md§17 gains the statement-scope example.Cross-repo
Corpus PR: squid-protocol/keyword-rosetta#105 (abap
argsre-bless 16 → 13, ledger entryabap-args-counts-call-site-keywordsresolved). Merge order: engine first; the corpus PR goes green when engine main carries this.bias-history.ymlre-runs after both.Also in this wave: #2804 (cobol args) was verified complete on current data and closed — engine half #2830, corpus half keyword-rosetta#97, window fix #2864; both cobol cells in band.
Closes #2824
🤖 Generated with Claude Code
https://claude.ai/code/session_012zPD39y58Bfrr2Q45Z6djL