Skip to content

livecode: no ScopeParsingRegistry entry -> Mode B brace-slice fallthrough drops 780/781 named functions #2410

Closed

Description

@squid-protocol

Summary

livecode has no ScopeParsingRegistry entry in gitgalaxy/core/detector.py,
so it silently falls through to Mode B (brace slicing). LiveCode has no braces for
scope — handler bodies run from on|command|function|getprop|setprop <name> to
end <name>, and control blocks are if…end if / repeat…end repeat /
try…end try / switch…end switch. Same failure class as MATLAB #1266
("the bug was entirely in routing, not the regex") and yacc #2351.

Impact

On language-crucible/data/livecode/ (97 ingested files):

raw regex pipeline struct_func_start pipeline function_count (named list)
func_start 847 781 1

function_data has 1 row for the entire corpus (escape, in
revliburl.livecodescript). The func_start regex itself is correct — 781 real
handler signals are counted — but _slice_by_braces finds no {/} and produces
no FunctionNodes, so every downstream consumer (named function list, per-function
complexity, per-function args count, LanguageChartData.gg_args_found) sees an
empty corpus.

This also blocks the livecode tri-comparison Func Found / Func Precision / Args
Found
chart panels from ever showing real numbers, and blocks a manual-verification
badge for the language.

Proposed fix (needs design)

A mode_d entry, e.g.:

"livecode": {
    "mode": "mode_d",
    "openers": [r"\bon\b", r"\bcommand\b", r"\bfunction\b", r"\bgetprop\b",
                r"\bsetprop\b", r"\brepeat\b", r"\btry\b", r"\bswitch\b", r"\bif\b"],
    "closers": [r"\bend\b"],
    "function_opener": r"\b(?:on|command|function|getprop|setprop)\b",
    "ignore_case": True,
},

but LiveCode needs its own guards that the generic mode_d loop doesn't have:

  • if … then <statement> one-liners (no end if) must not increment depth —
    analogous to the existing Ruby/Elixir inline-modifier guard in _slice_by_keywords.
  • else / else if are not openers.
  • next repeat / exit repeat / exit to top / pass <msg> must not affect depth.
  • function also appears as an operator in expressions (the … function of …) —
    needs a start-of-statement anchor like other mode_d langs.
  • Once # lands, handler / end handler for .lcb.

Because of these guards this is real design work, not a one-line registry add —
tracked as its own issue rather than fixed inline in the manual-verification sweep.

Found by

tri-comparison-ledger-sweep skill, livecode manual-verification pass (2026-08-28).

Activity

  1. added
    bug
    core-engine
    priority: high
    on Aug 29, 2026
  2. added 2 commits that reference this issue on Aug 29, 2026
  3. added this to the v2.4.9 milestone on Aug 31, 2026
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

    bugcore-enginepriority: high

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions