rune/ast/expr_await.rs
1use crate::ast::prelude::*;
2
3#[test]
4#[cfg(not(miri))]
5fn ast_parse() {
6 rt::<ast::Expr>("(42).await");
7 rt::<ast::Expr>("self.await");
8 rt::<ast::Expr>("test.await");
9}
10
11/// An await expression.
12///
13/// * `<expr>.await`.
14#[derive(Debug, TryClone, PartialEq, Eq, ToTokens, Spanned)]
15#[non_exhaustive]
16pub struct ExprAwait {
17 /// Attributes associated with expression.
18 #[rune(iter)]
19 pub attributes: Vec<ast::Attribute>,
20 /// The expression being awaited.
21 pub expr: Box<ast::Expr>,
22 /// The dot separating the expression.
23 pub dot: T![.],
24 /// The await token.
25 pub await_token: T![await],
26}
27
28expr_parse!(Await, ExprAwait, ".await expression");