Repository navigation
Description
What is wrong
Mapping crystal, erlang, nim, julia, r and fsharp in the tree-sitter accuracy audit (PR linked below) measured their function extraction against tree-sitter for the first time. Besides two grammar limits, it exposed four engine gaps. Each repro below was run in isolation with galaxyscope ... --db-only and the rows read from function_data.
1. Definitions with the body on the same line are not extracted (Julia short form, Nim, F#)
function foo(x)
x + 1
end
square(x) = x * x # not in function_data (also `index(df) = ...`, `nrow(df) = ...`)proc multi(x: int): int =
result = x + 1
proc oneLiner(x: int): int = x * 2 # not extractedlet multi (x: int) =
x + 1
let oneLiner (x: int) = x * 2 # not extractedIn all three the multi-line definitions are found and the one-liners are not, although the func_start rules (julia.py "a short-form f(x) = ...", nim.py, fsharp.py) match them. Effect on the new baselines: julia function recall 43.0% (422 of 981; short-form definitions are about half of the reference), fsharp 45.8% (120 of 262), nim 82.3%.
2. Erlang: a function directly after a -spec that contains a record type is dropped
-module(t).
-record(state, {}).
start() -> ok.
-spec init([]) -> {ok, #state{}}.
init([]) ->
ok.
foo(X) -> X.function_data has start and foo, not init. Without the #state{} in the spec, or without the spec, init is found. gen_server callbacks (init, handle_call, handle_cast, handle_info, code_change, terminate) are spec'd with #state{} as a rule, which is most of the 53 missed Erlang functions (erlang recall 90.3%, 494 of 547).
3. Nim: a backticked operator proc is extracted but unnamed
proc `+`(a, b: Foo): Foo =
aThe row is named Unknown_Block (a synthetic name the audit ignores), so $, ==, [], * and friends never match by name. nim.py says a backticked operator "keeps its backticks"; the pipeline does not keep it.
4. Not a bug, a follow-up: named class extraction is off for these languages
detector.py (#1264) names classes only for an allowlisted set of languages; crystal, erlang, nim, julia, r and fsharp are not on it, so their class names come from the generic fallback (Crystal's class HTTP::Client is read as HTTP). The audit now measures classes for crystal and erlang (23 of 54 and 0 of 52 found) and leaves the other four unmapped. Enrolling a language means hardening its class_start, then verifying it with this audit.
Expected
1 and 2 are extraction defects; 3 is a naming defect; each should get a test from the repro above. After each fix, regenerate the language's baseline in the CI-matched environment (tests/tools/tree_sitter_accuracy_audit.py --lang X --regenerate) so the improvement is locked in.
Filed as one issue under the class-sweep rule; found while building the node maps.
Activity
DOOM-rosetta re-bless: fsharp-doom finds three one-line let functions…
Extraction: Erlang record sigil, one-line Nim/F#/OCaml units, Nim ope…
Golden re-bless: F# capitalised let functions are extracted (Part of #…
Golden re-bless after merging main (Part of #9200)
Julia short-form f(x) = expr definitions become one-line function uni…
Golden re-bless after merging main (Part of #9200)
F#: a capitalised let binding is a function; fsharp/nim/erlang tree-s…
squid-protocol commentedon Nov 25, 2026
Churn run
9200-20261125T0751Z(host melek) ended without a PR. Filler run denied: fix committed locally on churn/9200-20261125T0751Z (F#/OCaml indentation-stream lifetime pattern); fsharp accuracy baseline regenerate refused (extra_functions 6->7, real 'and' binding the tree-sitter node map misses). Needs owner call: accept the extra or teach the audit's node map 'and' bindings. Filler is terminal; not requeued.Audit: the F# node map counts each `and` binding of a let rec chain (…
F#: a parameter list that starts on the next line makes the binding a…
Merge origin/main; re-bless goldens and the doo-cr DOOM-rosetta golde…