rune/ast/
expr_continue.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use crate::ast::prelude::*;

#[test]
#[cfg(not(miri))]
fn ast_parse() {
    rt::<ast::ExprContinue>("continue");
    rt::<ast::ExprContinue>("continue 'foo");
}

/// A `continue` statement.
///
/// * `continue [label]`.
#[derive(Debug, TryClone, PartialEq, Eq, Parse, ToTokens, Spanned)]
#[rune(parse = "meta_only")]
#[non_exhaustive]
pub struct ExprContinue {
    /// The attributes of the `break` expression
    #[rune(iter, meta)]
    pub attributes: Vec<ast::Attribute>,
    /// The return token.
    pub continue_token: T![continue],
    /// An optional label to continue to.
    #[rune(iter)]
    pub label: Option<ast::Label>,
}

expr_parse!(Continue, ExprContinue, "continue expression");