microcad_lang/eval/
module_definition.rs

1// Copyright © 2025 The µcad authors <info@ucad.xyz>
2// SPDX-License-Identifier: AGPL-3.0-or-later
3
4use crate::eval::*;
5
6impl Eval for ModuleDefinition {
7    fn eval(&self, context: &mut Context) -> EvalResult<Value> {
8        context.grant(self)?;
9        context.scope(
10            StackFrame::Module(self.id.clone(), Default::default()),
11            |context| {
12                // avoid body frame
13                self.body.statements.eval(context)
14            },
15        )
16    }
17}