1use crate::ast::prelude::*;
2
3#[test]
4#[cfg(not(miri))]
5fn ast_parse() {
6 rt::<ast::ExprWhile>("while x {}");
7 rt::<ast::ExprWhile>("'label: while x {}");
8 rt::<ast::ExprWhile>("#[attr] 'label: while x {}");
9}
10
11#[derive(Debug, TryClone, PartialEq, Eq, Parse, ToTokens, Spanned)]
15#[rune(parse = "meta_only")]
16#[non_exhaustive]
17pub struct ExprWhile {
18 #[rune(iter, meta)]
20 pub attributes: Vec<ast::Attribute>,
21 #[rune(iter, meta)]
23 pub label: Option<(ast::Label, T![:])>,
24 pub while_token: T![while],
26 pub condition: Box<ast::Condition>,
28 pub body: Box<ast::Block>,
30}
31
32expr_parse!(While, ExprWhile, "while expression");