Skip to main content

Module lang

Module lang 

Source
Expand description

The compiled-in registry of supported languages.

Each Language pairs a front-end adapter’s analyze_source/DEFAULT_EXTS with a user-facing name (and aliases). The unified cccc binary discovers a file’s language by its extension and dispatches to the matching adapter, so a single run can analyze a mixed-language tree. Adding a language is now just one entry here plus the adapter dependency — no new binary crate.

Structs§

Language
One supported language: how to name it on the command line, which file extensions it claims, and how to analyze a file of that language.

Constants§

LANGUAGES
Every language compiled into the unified binary, in display order.

Functions§

build_dispatch
Build an extension → language map for the given languages (the language carries both its analyzer and its canonical name, which the results cache records per entry).
canonical_name
The canonical name for the language named by query (its own name or an alias), or None if no registered language matches.
require_canonical
Like canonical_name but returns a user-facing error (naming context, e.g. "--ext" or "[ext] config") when the language is unknown.
resolve_languages
Resolve the active languages from an include (--lang) and an exclude (--exclude-lang) filter.