Skip to main content

Module reserved

Module reserved 

Source
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, or trait declarations.

§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 true if name is a reserved keyword that cannot appear as a binding identifier.
is_reserved_type_name
Returns true if name is a reserved type name that cannot be used for user-defined struct, enum, or trait declarations.