use crate::ast::prelude::*;
#[test]
#[cfg(not(miri))]
fn ast_parse() {
rt::<ast::ExprYield>("yield");
rt::<ast::ExprYield>("yield 42");
rt::<ast::ExprYield>("#[attr] yield 42");
}
#[derive(Debug, TryClone, PartialEq, Eq, Parse, ToTokens, Spanned)]
#[rune(parse = "meta_only")]
#[non_exhaustive]
pub struct ExprYield {
#[rune(iter, meta)]
pub attributes: Vec<ast::Attribute>,
pub yield_token: T![yield],
#[rune(iter)]
pub expr: Option<Box<ast::Expr>>,
}
expr_parse!(Yield, ExprYield, "yield expression");