split Function and OpenFunction

This commit is contained in:
numzero 2025-04-19 13:44:48 +03:00
parent 995122f1e0
commit 1325b1cf08

View File

@ -2,6 +2,9 @@ use std::cell::RefCell;
use crate::ast; use crate::ast;
#[derive(Debug, Clone)]
pub struct OpenFunction(Function);
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct Function { pub struct Function {
name: Option<ast::Ident>, name: Option<ast::Ident>,
@ -234,6 +237,6 @@ fn build_function(parent: &BuildContext<'_>, code: &ast::Function) -> Function {
} }
} }
pub fn build(code: &ast::Function) -> Function { pub fn build(code: &ast::Function) -> OpenFunction {
build_function(&BuildContext::new_toplevel(), &code) OpenFunction(build_function(&BuildContext::new_toplevel(), &code))
} }