Expand description
Reserved identifiers and type names. Reserved identifiers and type names for Maat.
This module centralizes all name-reservation logic, preventing user code from shadowing language keywords, future keywords, or builtin type names.
§Categories
-
Reserved keywords: Rust keywords that are not yet Maat lexer keywords but must be reserved for forward compatibility. These cannot be used as variable names, function names, parameter names, struct field names, or any other binding site.
-
Reserved type names: Primitive types and standard-library types that cannot be redefined by user code via
struct,enum, ortraitdeclarations.
§Lookup strategy
Both tables are compile-time sorted slices searched via binary search, giving O(log n) lookups with zero allocation.
Constants§
- RESERVED_
KEYWORDS - Rust keywords that are not yet Maat lexer keywords.
- RESERVED_
TYPE_ NAMES - Builtin type names that cannot be redefined by user declarations.
Functions§
- is_
reserved_ keyword - Returns
trueifnameis a reserved keyword that cannot appear as a binding identifier. - is_
reserved_ type_ name - Returns
trueifnameis a reserved type name that cannot be used for user-definedstruct,enum, ortraitdeclarations.