Skip to content

Lua Mode-D: dotted / method-style function heads (function a.b.c:f()) not fully name-resolved #2438

Closed

Description

@squid-protocol

Summary

The lua function_opener added to ScopeParsingRegistry in the tri-comparison-ledger-sweep
(^[ \t]*(?:local[ \t]+)?(?:export[ \t]+)?function\b) drives the nesting-independent
second-pass extraction that recovered ~73 real lua functions
(lua/function/existence/agree[ctags,tree_sitter]_vs[gitgalaxy], 82 -> 32). The remaining gap
includes dotted / method-style declaration heads that _extract_semantic_name's lua branch and /
or the function_opener scan don't fully resolve:

function a.b.c.f1()     -- calls.lua
function a:deep()       -- calls.lua
function a:x()          -- calls.lua

tree-sitter-lua and Universal Ctags both name these (a.b.c.f1, a:deep, a:x); GitGalaxy's
own func_start regex captures [a-zA-Z_][\w.:]* so the raw signal is there, but the Mode-D
name resolution drops or mis-attributes the multi-segment head.

Scope

Small follow-on to the function_opener fix -- widen the lua branch of
_extract_semantic_name / the function_opener pattern to keep the full dotted/: path, then
re-run tri_comparison_chart.py --languages lua and confirm the shape shrinks further.

Found by

tri-comparison-ledger-sweep (lua), 2026-08-29.

Activity

  1. added
    bug
    core-engine
    on Aug 29, 2026
  2. squid-protocol commented on Aug 29, 2026

    @squid-protocol
    OwnerAuthor

    Fixed in #2444. Root cause turned out to be different from the issue's framing: _extract_semantic_name already resolves a.b.c.f1 / a:deep fine. The real gap was that a one-liner function f (...) ... end has an equal opener/closer count, so its net Mode-D scope change is <= 0 -- the primary scan filed it as global dust and the function_opener pass skipped it (depth_before_line[i] <= 0). Also affected plain names, redefinitions, and everything nested in a bare do block. Fixed by extending function_opener to top-level self-closing declarations (lua-scoped). found_functions 557 -> 618.

  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-engine

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions