microcad_lang/parse/
body.rs

1// Copyright © 2025 The µcad authors <info@ucad.xyz>
2// SPDX-License-Identifier: AGPL-3.0-or-later
3
4use crate::{parse::*, parser::*, syntax::*};
5
6impl Parse for Body {
7    fn parse(pair: Pair) -> ParseResult<Self> {
8        Parser::ensure_rule(&pair, Rule::body);
9        Ok(Body {
10            statements: crate::find_rule!(pair, statement_list)?,
11            src_ref: pair.into(),
12        })
13    }
14}