rune/ast/
expr_continue.rs

1use crate::ast::prelude::*;
2
3#[test]
4#[cfg(not(miri))]
5fn ast_parse() {
6    rt::<ast::ExprContinue>("continue");
7    rt::<ast::ExprContinue>("continue 'foo");
8}
9
10/// A `continue` statement.
11///
12/// * `continue [label]`.
13#[derive(Debug, TryClone, PartialEq, Eq, Parse, ToTokens, Spanned)]
14#[rune(parse = "meta_only")]
15#[non_exhaustive]
16pub struct ExprContinue {
17    /// The attributes of the `break` expression
18    #[rune(iter, meta)]
19    pub attributes: Vec<ast::Attribute>,
20    /// The return token.
21    pub continue_token: T![continue],
22    /// An optional label to continue to.
23    #[rune(iter)]
24    pub label: Option<ast::Label>,
25}
26
27expr_parse!(Continue, ExprContinue, "continue expression");