Repository navigation
Description
Summary
detector.py's _function_slice() routes each segment to a function-body-slicing "integration mode" based on ScopeParsingRegistry.get_mode(lang_id) and, for languages with no registry entry, a fallback based on lexical_family/an explicit language allowlist (gitgalaxy/core/detector.py:1744 onward). ABAP has no entry at all in ScopeParsingRegistry.DEFINITIONS (gitgalaxy/core/detector.py:150, confirmed via grep -n '"abap"' gitgalaxy/core/detector.py → zero matches), and its lexical_family (positional_abap) doesn't match any of the fallback's special cases either (column_sensitive, single_line_only, multi_style_dash, or the explicit python/yaml/haskell list) — so it silently falls through to the final else branch: mode_name = "Mode_B_Braces" (gitgalaxy/core/detector.py:1776), i.e. _slice_by_braces().
ABAP has no brace-delimited function bodies at all — methods are delimited by METHOD <name>. ... ENDMETHOD. (period-terminated, like COBOL's paragraph structure), never {/}. Routing ABAP through brace-slicing means _slice_by_braces can only successfully bound a function body when a stray {/}-like character happens to appear somewhere near it by coincidence.
Evidence
Corpus: language-crucible/data/abap/abapGit/ (7 files, 4,006 lines). The raw func_start regex is correct — running it directly against each file's text (or checking file_data.struct_func_start from an actual galaxyscope scan, which is computed independently of _function_slice) finds all 124 real METHOD <name>. implementations, matching an independent grep -nE "^\s*METHOD\s+[a-zA-Z]" cross-check exactly, file by file. But the named function list that actually reaches the function_data DB table (file_data.function_count, populated via _function_slice's sats/all_satellites) is drastically undercounted:
| File | struct_func_start (raw regex, correct) |
function_count (named list, via Mode_B_Braces) |
|---|---|---|
zcl_abapgit_ajson.clas.abap |
47 | 4 |
zcl_abapgit_git_porcelain.clas.abap |
19 | 5 |
zcl_abapgit_http_client.clas.abap |
10 | 1 |
zcl_abapgit_objects.clas.abap |
30 | 5 |
zcl_abapgit_persistence_db.clas.abap |
13 | 1 |
zcl_abapgit_xml_output.clas.abap |
5 | 0 |
| Total | 124 | 16 (13%) |
(Reproduced via galaxyscope language-crucible/data/abap --config .galaxyscope.yaml --db-only then querying the resulting sqlite DB's file_data/function_data tables.)
This is also why docs/self_scan/tri_comparison_chart.svg shows abap at Functions Found: 16 / Func Precision: 0/16 — the "16" itself is already wrong (should be ~124), before even considering that ABAP has no second tool to corroborate against.
Downstream consequences
Everything built on _function_slice's named function list is affected for ABAP: function_data/function_count in the recorder DB, orphan/duplicate-logic detection (orphaned_logic/duplicate_logic equations, computed by iterating functions), class→method linkage and state_entanglement (blocked twice over — see the companion class_start bug, #1898), and any LLM-brief function listing.
Suggested fix direction
ABAP needs its own registered integration mode — most likely a new/adapted terminator-based mode matching ENDMETHOD./ENDFORM./ENDFUNCTION./ENDMODULE. (conceptually closer to Mode E's terminator-delimiting than Mode A's label-based COBOL/assembly handling, but ABAP's terminators are keyword+period rather than a bare label). This is a real, scoped detector-logic change (not just a config/registry one-liner, since the existing modes don't have an off-the-shelf match for "keyword ... ENDKEYWORD." pairing) and should go through the Differential Scan / crucible_check.py verification protocol before shipping, same as any parsing-logic PR.
How this was found
Same manual-verification pass as #1898 — ABAP has neither a tree-sitter grammar nor a ctags parser, so it's outside the normal tri-comparison-ledger pipeline; this surfaced while root-causing why the tri-comparison chart's Functions Found: 16 for abap didn't match a from-scratch manual count of 124.
Activity
fix(docs): correct abap.md -- 2 real engine bugs found, not zero (#1900)
fix(abap): two more real bugs found regenerating the tri-comparison c…
fix(abap): fifth bug -- prism.py's unqualified '!' truncated real par…
feat(tri-comparison): manual-verification precision marker for gg-onl…
feat(tri-comparison): badge for verified Args Found, document gg-only…
fix(yacc): route grammar-rule slicing through Mode A; map ctags 'l' k…