pub struct TypeEnv {
    pub filenames: Vec<Arc<str>>,
    pub file_texts: Vec<Arc<str>>,
    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§

§filenames: Vec<Arc<str>>

Arena of input ISLE source filenames.

We refer to these indirectly through the Pos::file indices.

§file_texts: Vec<Arc<str>>

Arena of input ISLE source contents.

We refer to these indirectly through the Pos::file indices.

§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.

Implementations§

Construct the type environment from the AST.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.