Skills 2026-09-29 23:07 UTC
lean4-skillsv4.11.3
Version [v4.11.3] committed by cameronfreer. Update Category: Feature Addition & Enhancement. Commit details: fix(unused-decls): private declarations counted per file; comments and strings never count (closes #184, #185) — v4.11.3. This update introduces new capabilities and module extensions.
CommitRaw commit message
fix(unused-decls): private declarations counted per file; comments and strings never count (closes #184, #185) — v4.11.3 (#211)
* fix(unused-decls): extract private/protected/local decls, count private ones per file (#184); analyze a comment/string-free code view built by lean_code_view.py, loud on missing python3 (#185)
* test(unused-decls): private-decls and private-collision fixtures, comments/strings fixture under both backends, no-python3 loud failure; older fixtures reference decls in real code (#184, #185)
* ci/docs: run the unused-decls self-test on Linux too; v4.11.3 (#184, #185)
* fix(unused-decls): blank char literals, raw strings and escaped newlines whole; mirror exactly the backend's file set (rg ignore metadata kept); traversal errors are loud; summary counts private decls per file (#211 review round 1)
* test(unused-decls): literals with line-number check, .ignore kept across the mirror, unreadable directory → exit 2, consistent private-count summary (#211 review round 1)
* fix(unused-decls): --files entries are cwd-relative as the backends print them (relative-dir invocation works again); interpolated strings keep their {…} code (#211 review round 2)
* test(unused-decls): interpolation fixture (live only via {…}, ghost only in text, nested), relative-directory invocation probe (#211 review round 2)
* fix(unused-decls): one lexical scanner — an interpolation's code is scanned by the same pass (stop at the unbalanced '}'), so a '}' in a comment, raw string or nested literal never ends it (#211 review round 3)
* test(unused-decls): interpolation boundary cases — '}' inside a block comment, a line comment and a raw string (#211 review round 3)
* fix(unused-decls): Lean identifier alphabet for token boundaries (literal after ⟨ recognised), «…» opaque, interpolation decided by the preceding token (ident!, core throwError/log* — whitespace/comments allowed) (#211 review round 4)
* test(unused-decls): literal after ⟨ cannot swallow later decls, escaped identifiers, s! with whitespace/comment and throwError interpolation (#211 review round 4)
* fix(unused-decls): interpolation follows Lean's syntax table — exact keywords, throwErrorAt ref / trace[cls] / named-error arguments skipped; logInfo, panic!, Lean.throwError strings are ordinary; full Lean 4.34 identifier alphabet; unit suite in CI (#211 review round 5)
* test(unused-decls): throwErrorAt/trace[] references counted, logInfo/Lean.logInfo/panic! literal text not (#211 review round 5)
* fix(unused-decls): a name is one token — escaped components (Syntax.«missing») and, in argument position, a leading dot (.missing) — so the throwErrorAt reference is skipped whole (#211 review round 6)
* test(unused-decls): throwErrorAt .missing / Syntax.«missing» references counted (#211 review round 6)
* fix(unused-decls): a Name literal (throwError { survive, quoted keywords are not keywords (#211 review round 7)
* test(unused-decls): Name literals of interpolating keywords (#211 review round 7)
A Name literal such as `throwError is one token in Lean's lexer and never
the keyword, so the string after it is ordinary. Fixture name_literal /
probe P25: the declarations and #checks after `throwError "{" survive,
and dead (referenced only as literal text) is the one finding.
The helper change and unit tests are in a8b3006, whose subject line was
mangled by shell quoting: it makes a Name literal (`x, ``x) one token,
reusing _ident_end, whose name never activates interpolation.