pub struct CompilerState {
pub ast: Ast,
pub handler: Handler,
pub type_table: TypeTable,
pub node_builder: NodeBuilder,
pub assigner: Assigner,
pub symbol_table: SymbolTable,
pub struct_graph: StructGraph,
pub call_graph: CallGraph,
pub warnings: HashSet<LeoWarning>,
pub is_test: bool,
}
Expand description
Contains data share by many compiler passes.
Fields§
§ast: Ast
The Abstract Syntax Tree.
handler: Handler
The error Handler.
type_table: TypeTable
Maps node IDs to types.
node_builder: NodeBuilder
Creates incrementing node IDs.
assigner: Assigner
Creates unique symbols and definitions.
symbol_table: SymbolTable
Contains data about the variables and other entities in the program.
struct_graph: StructGraph
A graph of which structs refer to each other.
call_graph: CallGraph
A graph of which functions call each other.
warnings: HashSet<LeoWarning>
A set of the warnings collected. This is used to make sure we don’t emit the same exact warning twice.
is_test: bool
Is this a test program?
Trait Implementations§
Source§impl Default for CompilerState
impl Default for CompilerState
Source§fn default() -> CompilerState
fn default() -> CompilerState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for CompilerState
impl !RefUnwindSafe for CompilerState
impl !Send for CompilerState
impl !Sync for CompilerState
impl Unpin for CompilerState
impl !UnwindSafe for CompilerState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more