diff --git a/src/twopass.rs b/src/twopass.rs index 24fa922..cb146be 100644 --- a/src/twopass.rs +++ b/src/twopass.rs @@ -2,6 +2,9 @@ use std::cell::RefCell; use crate::ast; +#[derive(Debug, Clone)] +pub struct OpenFunction(Function); + #[derive(Debug, Clone)] pub struct Function { name: Option, @@ -234,6 +237,6 @@ fn build_function(parent: &BuildContext<'_>, code: &ast::Function) -> Function { } } -pub fn build(code: &ast::Function) -> Function { - build_function(&BuildContext::new_toplevel(), &code) +pub fn build(code: &ast::Function) -> OpenFunction { + OpenFunction(build_function(&BuildContext::new_toplevel(), &code)) }