From 1325b1cf08b77e08f401bbfb241635c81b273ad5 Mon Sep 17 00:00:00 2001 From: numzero Date: Sat, 19 Apr 2025 13:44:48 +0300 Subject: [PATCH] split Function and OpenFunction --- src/twopass.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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)) }