pub struct TypeEnv {
pub syms: Vec<String>,
pub sym_map: StableMap<String, Sym>,
pub types: Vec<Type>,
pub type_map: StableMap<Sym, TypeId>,
pub const_types: StableMap<Sym, TypeId>,
pub errors: Vec<Error>,
}Expand description
The type environment.
Keeps track of which symbols and rules have which types.
Fields§
§syms: Vec<String>Arena of interned symbol names.
Referred to indirectly via Sym indices.
sym_map: StableMap<String, Sym>Map of already-interned symbol names to their Sym ids.
types: Vec<Type>Arena of type definitions.
Referred to indirectly via TypeIds.
type_map: StableMap<Sym, TypeId>A map from a type name symbol to its TypeId.
const_types: StableMap<Sym, TypeId>The types of constant symbols.
errors: Vec<Error>Type errors that we’ve found so far during type checking.