Skip to content

livecode func_start/args miss LiveCode Builder (.lcb) 'handler' syntax entirely (0 of 471 handlers detected) #2409

Description

@squid-protocol

Summary

livecode's func_start / args rules only recognize LiveCode Script handler
syntax (on|command|function|getprop|setprop <name>). They match nothing in
LiveCode Builder (.lcb) files, which declare callables with the handler
keyword: handler, public handler, private handler, foreign handler,
public foreign handler.

Across language-crucible/data/livecode/ the 35 .lcb files contain 471 handler
declarations, 0 detected
(struct_func_start = 0 for every .lcb file; all 781
detected func_start signals come from the 63 .livecodescript files).

Evidence

language-crucible/data/livecode/livecode/array.lcb:

21: module com.livecode.array
25: public foreign handler MCArrayEvalKeysOf(in Target as Array, out Value as List) returns nothing binds to "<builtin>"
...

language-crucible/data/livecode/livecode/assert.lcb and every other .lcb file
has real public handler / private handler definitions with bodies
(... end handler).

Regex check (current func_start, gitgalaxy/standards/language_standards.py):

"public foreign handler MCArrayEvalKeysOf(...)"   -> no match
"public handler MyHandler(in x as String)"        -> no match
"private handler _helper()"                       -> no match

Handler-form breakdown in the corpus:

form count
public foreign handler 302
public handler 80
foreign handler (bare + indented) 42
handler (bare + indented) 36
private handler 11

foreign handler (341 of the 471) are FFI binding declarations
(... binds to "<builtin>"), C-prototype shaped with no body — arguably these
should not count as functions (parallel to how a C header prototype isn't a
definition). The other 130 (handler / public handler / private handler) are
real definitions with ... end handler bodies and clearly should.

Scope / design notes

  • .lcb handlers use a parenthesized, typed parameter list
    (handler Foo(in x as String, out y as Integer)), unlike LiveCode Script's
    unparenthesized command Foo pA, pB. func_start's current trailing lookahead
    (?=[ \t\r\n]|--|//|#|/\*|$) deliberately rejects name( (see the
    ("function TargetFunc()", None) invalid case in test_livecode.py), so
    supporting .lcb means a dedicated branch, not just adding a keyword.
  • args for .lcb is a separate granularity question (typed in/out/inout
    clauses vs. bare identifiers) — likely a proxy/dedicated-counter case like
    ABAP's _count_abap_declared_params (detector.py: per-function args count wrong for ABAP -- wrong search span, wrong counting shape #1918).
  • class_start already handles .lcb correctly (module com.x.y, 33/33).

Found by

tri-comparison-ledger-sweep skill, livecode manual-verification pass
(2026-08-28). livecode is a gg_only language (no tree-sitter, no ctags), verified
by direct source cross-check.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUnintended behavior or logic failure in the enginecore-engineModifications to the central physics and parsing enginepriority: highCore feature broken, but workarounds exist

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions