Skip to content

assembly/fortran/haskell/livecode dead_code: count a keyword-led comment only when it has a statement's shape (Part of #7207) - #7393

Merged
squid-shepherd[bot] merged 2 commits into
mainfrom
churn/7207-20261101T0511Z
Nov 1, 2026
Merged

squid-shepherd[bot] merged 2 commits into
mainfrom
churn/7207-20261101T0511Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #7207, slice 10 (assembly, fortran, haskell, livecode). Copies the shape of merged slice 9 (#7381): dead_code counts a keyword-led comment only when the rest of the line has a statement's shape, via commented_keyword_statement(marker=, extra=) from _shared_patterns.py.

What changed

  • assembly.py: mnemonic plus operands (register or [mem] destination, symbol-like jmp/call target, pushed/popped register). ; add the values together no longer counts.
  • fortran.py: (...), assignment, if (..) then, bare call name / subroutine name.
  • haskell.py: = binding, ... where, import Mod, putStrLn "..."; the marker now excludes --- and operator runs, and \s* (which could span a newline) is [ \t]*.
  • livecode.py: camelCase handler header, end if, put <value> into, if <comparison> then, repeat with/for each/N times, set the X of Y to. Variable convention checked case-sensitively via (?-i:).
  • test_script_dead_code_shape_7207.py: prose negatives and real-statement positives for all four (382 cases pass with the existing ones, plus the long-line ReDoS check).

Golden re-bless

Via golden-lock.sh crucible_check.py --update --yes. scope_check.py --base origin/main --expect assembly,fortran,haskell,livecode: assembly 637, livecode 331, fortran 100, haskell 10 differences; the other 169 are repo-wide rollup fields (column digests, groups, fingerprint) that those per-file changes move, as in #7381. No other language moved.

Class / Sibling gaps

Class: dead_code rules that match a comment marker plus a bare keyword with no check on what follows. Slices 1-9 are merged; this covers assembly, fortran, haskell, livecode (same mechanism, 4 files + test). Members handled: those four. Sibling gaps: (1) fortran ^[cC*] (F77 column-1 comment) has no re.M, so it only matches at the start of the file; fixing it widens counts beyond the shape rule, so it needs its own bless. (2) Bare single-word forms (; call foo, -- on mouseUp lowercase, ! call overhead) are ambiguous with prose and stay on the conservative side in assembly/livecode (missed rather than over-counted); fortran accepts a bare call name. (3) Any language whose dead_code is still keyword-only after slices 1-10: re-run the sweep over languages/*.py for dead_code rules not using commented_keyword_statement; not enumerated here.

Gates

Targeted tests (tests/extraction/languages -k "assembly or fortran or haskell or livecode or dead_code") pass; ruff format and ruff check clean on changed source. NOT run: pr_gates --fast / --ratchets (left to CI), per-language gauntlet beyond the matched tests.

🤖 Generated with Claude Code

squid-protocol and others added 2 commits November 1, 2026 01:14
…ent only when it has a statement's shape (Part of #7207)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Nov 1, 2026
@squid-shepherd

squid-shepherd Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot marked this pull request as ready for review November 1, 2026 05:27
@squid-shepherd

squid-shepherd Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 1, 2026 05:32
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant