rune/ast/
expr_break.rs
1use crate::ast::prelude::*;
2
3#[test]
4#[cfg(not(miri))]
5fn ast_parse() {
6 rt::<ast::ExprBreak>("break");
7 rt::<ast::ExprBreak>("break 42");
8 rt::<ast::ExprBreak>("#[attr] break 42");
9}
10
11#[derive(Debug, TryClone, PartialEq, Eq, Parse, ToTokens, Spanned)]
15#[rune(parse = "meta_only")]
16#[non_exhaustive]
17pub struct ExprBreak {
18 #[rune(iter, meta)]
20 pub attributes: Vec<ast::Attribute>,
21 pub break_token: T![break],
23 #[rune(iter)]
25 pub label: Option<ast::Label>,
26 #[rune(iter)]
28 pub expr: Option<Box<ast::Expr>>,
29}
30
31expr_parse!(Break, ExprBreak, "break expression");