Skip to main content

microcad_lang/parse/
body.rs

1// Copyright © 2025-2026 The µcad authors <info@ucad.xyz>
2// SPDX-License-Identifier: AGPL-3.0-or-later
3
4use crate::{parse::*, parser::*, syntax::*};
5use microcad_syntax::ast;
6
7impl FromAst for Body {
8    type AstNode = ast::StatementList;
9
10    fn from_ast(node: &Self::AstNode, context: &ParseContext) -> Result<Self, ParseError> {
11        Ok(Body {
12            statements: StatementList::from_ast(node, context)?,
13            src_ref: context.src_ref(&node.span),
14        })
15    }
16}