rune/ast/expr_vec.rs
1use crate::ast::prelude::*;
2
3#[test]
4#[cfg(not(miri))]
5fn ast_parse() {
6 rt::<ast::ExprVec>("[1, \"two\"]");
7 rt::<ast::ExprVec>("[1, 2,]");
8 rt::<ast::ExprVec>("[1, 2, foo()]");
9}
10
11/// A literal vector.
12///
13/// * `[<expr>,*]`
14#[derive(Debug, TryClone, PartialEq, Eq, Parse, ToTokens, Spanned)]
15#[non_exhaustive]
16pub struct ExprVec {
17 /// Attributes associated with vector.
18 #[rune(iter, meta)]
19 pub attributes: Vec<ast::Attribute>,
20 /// Items in the vector.
21 pub items: ast::Bracketed<ast::Expr, T![,]>,
22}