Skip to content

Crystal: add the .cr language profile (Part of #5623) - #5695

Merged
squid-protocol merged 1 commit into
mainfrom
churn/5623-20261020T0532Z
Oct 20, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
churn/5623-20261020T0532Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #5623 (slice 2 of 2: Crystal; F# landed in #5681).

What

  • languages/crystal.py: .cr profile (def / macro / column-0 fun, class / struct / module / enum / lib / annotation), registered in language_standards/__init__.py.
  • core/detector.py: Crystal joins ruby's Mode D keyword scoping, a Crystal-only heredoc opener (<<-ID), and _extract_semantic_name (operator names, fun).
  • analysis_lens.py: strictness row and backend policy entry.
  • test_crystal_strict.py: 13 tests (spans, modifier-if, abstract def, shift-vs-heredoc, fun vs lib declaration, ReDoS).

Evidence: doo-cr @ 4e17635d (43 .cr files)

file grep def/macro/fun extracted
am_automap.cr 35 35 (was 3)
p_main.cr 247 247 (was 121)
implementation.cr 642 fun 642 (was 0)
Totals: 41 files mapped as crystal, 1509 functions. The other 2 (variables.cr, deh_bexextensions.cr) are Aperture exclusions (embedded array payload / machine-generated signature), not routing gaps.

Two real bugs found by the rescan: x << FRACBITS was read as a Ruby heredoc and blanked the rest of the file; top-level fun ... end was not a unit.

Golden

No drift: language-crucible v1.7.0 has no .cr files, so both masters are unchanged. Not blessed.

Gates

pr_gates --fast 6/6, --ratchets 8/8, audit_check clear, tree-wide guard tests 184 passed, registry/strictness tests 5537 passed.

Remaining slices

  • docs/language_status/crystal.md + README row (kept out to stay within 5 hand-written files).
  • Tree-sitter/ctags comparison row for Crystal, if a grammar exists.

Sibling gaps (class: unmapped file extensions)

.ecr (Embedded Crystal templates) is unmapped; shard.yml routes via discriminator only.

Cross-repo

None.

🤖 Generated with Claude Code

… class/struct/module/enum/lib) (Part of #5623)

Keyword-scope slicing on ruby's Mode D shape, a Crystal-only heredoc opener
(`<<-ID`; `x << FRACBITS` is a shift), column-0 `fun ... end` as a unit, and
strictness/policy rows. doo-cr @ 4e17635d: 41 of 43 .cr files mapped (the other 2
are Aperture exclusions), 1509 functions; grep def/macro/fun counts match on
am_automap (35), p_main (247) and implementation (642).

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 Oct 20, 2026
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol
squid-protocol marked this pull request as ready for review October 20, 2026 06:03
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol enabled auto-merge (squash) October 20, 2026 06:06
import sys
from pathlib import Path

import pytest
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.

2 participants