Skip to main content

Module keywords

Module keywords 

Source
Expand description

The RIDL family reserved-word registry (typl reference §1.4).

The family maintains one reserved-word registry across every profile: every word in it is reserved in every profile, including words a profile does not accept. The ADR-0012 domain spellings are not in it: a spelling is a keyword only as the first token of an interface member, in a profile that implements it. This module is the single source of truth the lexer maps identifiers against, and the source a governance test can read.

An identifier that matches a keyword the active Profile uses lexes to that keyword’s SyntaxKind; one that matches any other registry word lexes to SyntaxKind::ReservedWord; anything else stays an Ident.

Enums§

Profile
The profile a source file is lexed and parsed under (ridl reference §2, ADR-0008): which member of the family the file is written in. The profile selects which registry words are active keywords — every other registry word stays SyntaxKind::ReservedWord — and where the parser draws its profile-boundary diagnostics (TYPL-304 / RIDL-403).

Constants§

FAMILY_RESERVED
The full family reserved-word registry (typl reference §1.4): the words the typl profile uses, followed by the words reserved family-wide for the other profiles but rejected by .typl. This is the governance source of truth — every word here is reserved in every profile and may not be an identifier.

Functions§

is_reserved
Whether text is reserved anywhere in the family — a keyword the typl profile uses or a word reserved for another profile. A reserved word may not be used as an identifier in any profile.
keyword_in
The SyntaxKind text lexes to as an active keyword of profile, or None when the profile does not use it — it may still be a reserved word of another profile (is_reserved) or an ordinary identifier.
ridl_keyword
The SyntaxKind one of the nine ridl words lexes to under Profile::Ridl, or None if text is not one of them. The parser also uses this table to spot an interaction keyword in a typl parse (TYPL-304).
rsdl_keyword
The SyntaxKind one of the eight rsdl words lexes to under Profile::Rsdl, or None if text is not one of them.
typl_keyword
The SyntaxKind a typl keyword lexes to, or None if text is not a keyword the typl profile uses (it may still be a reserved word — see is_reserved).