pub struct TyProgram {
pub kind: TyProgramKind,
pub root: TyModule,
pub declarations: Vec<TyDeclaration>,
pub storage_slots: Vec<StorageSlot>,
pub logged_types: Vec<(LogId, TypeId)>,
pub messages_types: Vec<(MessageId, TypeId)>,
}
Fields§
§kind: TyProgramKind
§root: TyModule
§declarations: Vec<TyDeclaration>
§storage_slots: Vec<StorageSlot>
§logged_types: Vec<(LogId, TypeId)>
§messages_types: Vec<(MessageId, TypeId)>
Implementations§
source§impl TyProgram
impl TyProgram
sourcepub fn validate_root(
ty_engine: &TypeEngine,
root: &TyModule,
kind: TreeType,
module_span: Span
) -> CompileResult<(TyProgramKind, Vec<TyDeclaration>)>
pub fn validate_root(
ty_engine: &TypeEngine,
root: &TyModule,
kind: TreeType,
module_span: Span
) -> CompileResult<(TyProgramKind, Vec<TyDeclaration>)>
Validate the root module given the expected program kind.
pub fn generate_json_abi_program(
&self,
type_engine: &TypeEngine,
types: &mut Vec<TypeDeclaration>
) -> ProgramABI
sourcepub fn test_fns(
&self
) -> impl '_ + Iterator<Item = (TyFunctionDeclaration, DeclarationId)>
pub fn test_fns(
&self
) -> impl '_ + Iterator<Item = (TyFunctionDeclaration, DeclarationId)>
All test function declarations within the program.
source§impl TyProgram
impl TyProgram
sourcepub fn type_check(
type_engine: &TypeEngine,
parsed: &ParseProgram,
initial_namespace: Module
) -> CompileResult<Self>
pub fn type_check(
type_engine: &TypeEngine,
parsed: &ParseProgram,
initial_namespace: Module
) -> CompileResult<Self>
Type-check the given parsed program to produce a typed program.
The given initial_namespace
acts as an initial state for each module within this program.
It should contain a submodule for each library package dependency.