Type field accesses

This commit is contained in:
Florian Diebold
2018-12-25 13:54:38 +01:00
parent 07a7285965
commit 55c941cd9f
5 changed files with 54 additions and 5 deletions

View File

@@ -1123,7 +1123,15 @@ impl<R: TreeRoot<RaTypes>> FieldExprNode<R> {
}
impl<'a> FieldExpr<'a> {}
impl<'a> FieldExpr<'a> {
pub fn expr(self) -> Option<Expr<'a>> {
super::child_opt(self)
}
pub fn name_ref(self) -> Option<NameRef<'a>> {
super::child_opt(self)
}
}
// FieldPatList
#[derive(Debug, Clone, Copy,)]

View File

@@ -406,7 +406,7 @@ Grammar(
options: [ "Expr" ],
),
"IndexExpr": (),
"FieldExpr": (),
"FieldExpr": (options: ["Expr", "NameRef"]),
"TryExpr": (options: ["Expr"]),
"CastExpr": (options: ["Expr", "TypeRef"]),
"RefExpr": (options: ["Expr"]),