rune/ast/
expr_field_access.rsuse crate::ast::prelude::*;
#[test]
#[cfg(not(miri))]
fn ast_parse() {
rt::<ast::ExprFieldAccess>("foo.bar");
rt::<ast::ExprFieldAccess>("foo.bar::<A, B>");
rt::<ast::ExprFieldAccess>("foo.0.bar");
rt::<ast::ExprFieldAccess>("(foo.0).1");
}
#[derive(Debug, TryClone, PartialEq, Eq, ToTokens, Spanned)]
#[non_exhaustive]
pub struct ExprFieldAccess {
#[rune(iter)]
pub attributes: Vec<ast::Attribute>,
pub expr: Box<ast::Expr>,
pub dot: T![.],
pub expr_field: ExprField,
}
expr_parse!(FieldAccess, ExprFieldAccess, "field access expression");
#[derive(Debug, TryClone, PartialEq, Eq, ToTokens, Spanned)]
#[non_exhaustive]
pub enum ExprField {
Path(ast::Path),
LitNumber(ast::LitNumber),
}