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 28
use crate::ast::prelude::*;
/// A return statement `<expr>.await`.
///
/// # Examples
///
/// ```
/// use rune::{ast, testing};
///
/// testing::roundtrip::<ast::Expr>("(42).await");
/// testing::roundtrip::<ast::Expr>("self.await");
/// testing::roundtrip::<ast::Expr>("test.await");
/// ```
#[derive(Debug, Clone, PartialEq, Eq, ToTokens, Spanned)]
#[non_exhaustive]
pub struct ExprAwait {
/// Attributes associated with expression.
#[rune(iter)]
pub attributes: Vec<ast::Attribute>,
/// The expression being awaited.
pub expr: Box<ast::Expr>,
/// The dot separating the expression.
pub dot: T![.],
/// The await token.
pub await_token: T![await],
}
expr_parse!(Await, ExprAwait, ".await expression");