microcad_lang/eval/
sources.rs

1// Copyright © 2025 The µcad authors <info@ucad.xyz>
2// SPDX-License-Identifier: AGPL-3.0-or-later
3
4//! Evaluation all sources.
5
6use crate::{eval::*, resolve::*};
7
8impl Eval for Sources {
9    fn eval(&self, context: &mut EvalContext) -> EvalResult<Value> {
10        self.source_files
11            .iter()
12            // skip root
13            .filter(|source| source.hash != self.root().hash)
14            .map(|source_file| source_file.eval(context))
15            .collect()
16    }
17}