Skip to content

scheme: recursive_block_lisp has no slicing mode of its own, falls through to Mode_B_Braces; start_line wrong beyond the first declaration #2933

Description

@squid-protocol

Found while building #2908 Phase 2 contract tests (not introduced there; present on main).

recursive_block_lisp has no ScopeParsingRegistry entry and appears in no Mode-A/Mode-C special-case tuple in _function_slice, so scheme falls through to the generic else at detector.py:3173 (mode_name = "Mode_B_Braces") — brace slicing for a language whose delimiters are parens. Confirmed: a single (define (f) 1) preceded only by blank/comment lines always reports start_idx=0 / start_line=1 regardless of true position, because Mode B has no real brace boundary to anchor on.

Consequences: per-function start_line/loc are unreliable for scheme on multi-declaration files, and #2908's header-window is_documented anchor inherits the wrong start_line. The Phase 2 contract tests route around it (single-declaration snippets only).

Fixing this moves existing extraction counts, so it is its own rule/slicer-layer PR per #2812 rule 4.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUnintended behavior or logic failure in the enginecore-engineModifications to the central physics and parsing engine

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions