Skip to main content

Module registry

Module registry 

Source
Expand description

Which languages this process can name, and which of those it can paint.

[LANGS] seeds the registry; register adds to it at runtime. A name with no grammar is still an entry — Known::Named — so a caller can tell a language this build cannot paint from a file extension nobody has written a grammar for.

Registrations are leaked. A language lives for the process, and the strings are a few hundred bytes against grammar bytes that are refcounted.

Structs§

Entry
One language the registry knows of.

Enums§

Known
What the registry knows about a name.

Functions§

names
Every name the registry holds, painted or not.
of_path
The language path is written in.
of_tag
The language a fence tag names. Tags are the raw first word of the fence info string — rust {.numberLines}, rust,foo, Rust — so they are trimmed at the first space or comma and case-folded before lookup.
ready
Every name this build can paint.
register
Add a language, or replace the entry of the same name. Leaks: see the module note.