languages.py

clew/languages.py

WHAT CLEW INDEXES, DERIVED FROM THE ROUTERS RATHER THAN WRITTEN DOWN.

harvested_phrase

str clew.languages.harvested_phrase()

The harvested languages as one human-readable clause.

clew/languages.py:79

Show on the map →

Called by clause, test_the_served_instructions_are_interpolated

Calls none

Source · 13 lines
def harvested_phrase() -> str:
    """AN OXFORD-FREE `and` BEFORE THE LAST ITEM, because this lands mid-sentence in the served
    MCP instructions and in a PyPI description, where a trailing comma reads as truncation.

    @brief Join the harvested language names.
    @return The clause.
    @version 1
    """
    if len(HARVESTED) < 2:
        return "".join(HARVESTED)
    return f"{', '.join(HARVESTED[:-1])} and {HARVESTED[-1]}"

Activity · 3 steps
lines 87–87◇ if len(HARVESTED) < 2lines 88–88return "".join(HARVESTED)lines 89–89return f"{', '.join(HARVESTED[:-1])} and {HARVESTED[-1]}"

Flows

registered_phrase

str clew.languages.registered_phrase()

The registered-but-unharvested types as one human-readable clause.

clew/languages.py:96

Show on the map →

Called by clause

Calls none

Source · 10 lines
def registered_phrase() -> str:
    """@brief Join the registered-only type names.
    @return The clause.
    @version 1
    """
    if len(REGISTERED_ONLY) < 2:
        return "".join(REGISTERED_ONLY)
    return f"{', '.join(REGISTERED_ONLY[:-1])} and {REGISTERED_ONLY[-1]}"

Activity · 3 steps
lines 101–101◇ if len(REGISTERED_ONLY) < 2lines 102–102return "".join(REGISTERED_ONLY)lines 103–103return f"{', '.join(REGISTERED_ONLY[:-1])} and {REGISTERED_ONLY[-1]}"

Flows

support_table

str clew.languages.support_table()

The language support table, as markdown.

clew/languages.py:166

Show on the map →

Called by main

Calls none

Source · 24 lines
def support_table() -> str:
    """GENERATED, NEVER HAND-EDITED — `scripts/sync_metadata.py` writes it between markers and its
    `--check` hook fails a commit that lets it drift. Each language links to its integration page,
    so the table is also the README's index into the per-language detail.

    REGISTERED-ONLY TYPES GET ONE ROW, honestly labelled: they are in the file set and findable by
    name, and contribute no symbols — `dossier` on a Perl subroutine has nothing to return.

    @brief Render the support table.
    @return Markdown table text.
    @version 1
    """
    head = "| Language | " + " | ".join(title for _, title in SUPPORT_COLUMNS) + " |"
    rule = "|---|" + "|".join(":-:" for _ in SUPPORT_COLUMNS) + "|"
    rows = [head, rule]
    for name, caps in CAPABILITIES.items():
        cells = " | ".join("✓" if key in caps else "—" for key, _ in SUPPORT_COLUMNS)
        rows.append(f"| [{name}]({REPO_URL}{DOC_PAGE[name]}) | {cells} |")
    if REGISTERED_ONLY:
        rest = " | ".join("—" for _ in SUPPORT_COLUMNS[1:])
        rows.append(f"| {', '.join(REGISTERED_ONLY)} | name only | {rest} |")
    return "\n".join(rows)

Activity · 10 steps
lines 178–178head = "| Language | " + " | ".join(title for _, title in SUPPORT_COLUMNS) + " |"lines 179–179rule = "|---|" + "|".join(":-:" for _ in SUPPORT_COLUMNS) + "|"lines 180–180rows = [head, rule]lines 181–181◇ for name, caps in CAPABILITIES.items()lines 182–182cells = " | ".join("✓" if key in caps else "—" for key, _ in SUPPORT_COLUMNS)lines 183–183rows.append(f"| [{name}]({REPO_URL}{DOC_PAGE[name]}) | {cells} |")lines 184–184◇ if REGISTERED_ONLYlines 185–185rest = " | ".join("—" for _ in SUPPORT_COLUMNS[1:])lines 186–186rows.append(f"| {', '.join(REGISTERED_ONLY)} | name only | {rest} |")lines 187–187return "\n".join(rows)

Flows