pub trait Hooks {
    fn before_parse(&mut self, _ctx: &mut dyn Context) -> Continuation { ... }
fn after_parse(&mut self, ctx: &mut dyn AfterParseContext) -> Continuation { ... }
fn after_lowering(
        &mut self,
        ctx: &mut dyn AfterLoweringContext
    ) -> Continuation { ... }
fn after_type_checking(
        &mut self,
        ctx: &mut dyn AfterTypeCheckingContext
    ) -> Continuation { ... }
fn after_codegen(
        &mut self,
        ctx: &mut dyn AfterCodegenContext
    ) -> Continuation { ... }
fn after_compile(
        &mut self,
        ctx: &mut dyn AfterCompileContext
    ) -> Continuation { ... } }
Expand description

Callbacks that are fired at different points in the compilation process.

Each hook is optional, with the default implementation returning Continuation::Halt when Diagnostics::has_errors() indicates there were errors.

Provided methods

Callback fired before the Runefile is parsed, giving the Hooks a chance to do setup (e.g. by registering global Resources used in later steps).

Callback fired after parsing the Runefile.

Callback fired after lowering a crate::parse::Document to crate::lowering types but before any type checking is applied.

Callback fired after type checking and before codegen.

Callback fired after generating the Rust project but immediately before it is compiled to WebAssembly.

Implementors