Add beginnings of type infrastructure
This commit is contained in:
@@ -523,7 +523,15 @@ impl<R: TreeRoot<RaTypes>> CastExprNode<R> {
|
||||
}
|
||||
|
||||
|
||||
impl<'a> CastExpr<'a> {}
|
||||
impl<'a> CastExpr<'a> {
|
||||
pub fn expr(self) -> Option<Expr<'a>> {
|
||||
super::child_opt(self)
|
||||
}
|
||||
|
||||
pub fn type_ref(self) -> Option<TypeRef<'a>> {
|
||||
super::child_opt(self)
|
||||
}
|
||||
}
|
||||
|
||||
// Char
|
||||
#[derive(Debug, Clone, Copy,)]
|
||||
@@ -2312,6 +2320,10 @@ impl<'a> Param<'a> {
|
||||
pub fn pat(self) -> Option<Pat<'a>> {
|
||||
super::child_opt(self)
|
||||
}
|
||||
|
||||
pub fn type_ref(self) -> Option<TypeRef<'a>> {
|
||||
super::child_opt(self)
|
||||
}
|
||||
}
|
||||
|
||||
// ParamList
|
||||
@@ -2394,7 +2406,11 @@ impl<R: TreeRoot<RaTypes>> ParenExprNode<R> {
|
||||
}
|
||||
|
||||
|
||||
impl<'a> ParenExpr<'a> {}
|
||||
impl<'a> ParenExpr<'a> {
|
||||
pub fn expr(self) -> Option<Expr<'a>> {
|
||||
super::child_opt(self)
|
||||
}
|
||||
}
|
||||
|
||||
// ParenType
|
||||
#[derive(Debug, Clone, Copy,)]
|
||||
@@ -2829,7 +2845,11 @@ impl<R: TreeRoot<RaTypes>> PrefixExprNode<R> {
|
||||
}
|
||||
|
||||
|
||||
impl<'a> PrefixExpr<'a> {}
|
||||
impl<'a> PrefixExpr<'a> {
|
||||
pub fn expr(self) -> Option<Expr<'a>> {
|
||||
super::child_opt(self)
|
||||
}
|
||||
}
|
||||
|
||||
// RangeExpr
|
||||
#[derive(Debug, Clone, Copy,)]
|
||||
@@ -2940,7 +2960,11 @@ impl<R: TreeRoot<RaTypes>> RefExprNode<R> {
|
||||
}
|
||||
|
||||
|
||||
impl<'a> RefExpr<'a> {}
|
||||
impl<'a> RefExpr<'a> {
|
||||
pub fn expr(self) -> Option<Expr<'a>> {
|
||||
super::child_opt(self)
|
||||
}
|
||||
}
|
||||
|
||||
// RefPat
|
||||
#[derive(Debug, Clone, Copy,)]
|
||||
@@ -3088,7 +3112,11 @@ impl<R: TreeRoot<RaTypes>> ReturnExprNode<R> {
|
||||
}
|
||||
|
||||
|
||||
impl<'a> ReturnExpr<'a> {}
|
||||
impl<'a> ReturnExpr<'a> {
|
||||
pub fn expr(self) -> Option<Expr<'a>> {
|
||||
super::child_opt(self)
|
||||
}
|
||||
}
|
||||
|
||||
// SelfParam
|
||||
#[derive(Debug, Clone, Copy,)]
|
||||
@@ -3578,7 +3606,11 @@ impl<R: TreeRoot<RaTypes>> TryExprNode<R> {
|
||||
}
|
||||
|
||||
|
||||
impl<'a> TryExpr<'a> {}
|
||||
impl<'a> TryExpr<'a> {
|
||||
pub fn expr(self) -> Option<Expr<'a>> {
|
||||
super::child_opt(self)
|
||||
}
|
||||
}
|
||||
|
||||
// TupleExpr
|
||||
#[derive(Debug, Clone, Copy,)]
|
||||
|
||||
@@ -346,7 +346,7 @@ Grammar(
|
||||
|
||||
"TupleExpr": (),
|
||||
"ArrayExpr": (),
|
||||
"ParenExpr": (),
|
||||
"ParenExpr": (options: ["Expr"]),
|
||||
"PathExpr": (options: ["Path"]),
|
||||
"LambdaExpr": (
|
||||
options: [
|
||||
@@ -377,7 +377,7 @@ Grammar(
|
||||
"BlockExpr": (
|
||||
options: [ "Block" ]
|
||||
),
|
||||
"ReturnExpr": (),
|
||||
"ReturnExpr": (options: ["Expr"]),
|
||||
"MatchExpr": (
|
||||
options: [ "Expr", "MatchArmList" ],
|
||||
),
|
||||
@@ -405,10 +405,10 @@ Grammar(
|
||||
),
|
||||
"IndexExpr": (),
|
||||
"FieldExpr": (),
|
||||
"TryExpr": (),
|
||||
"CastExpr": (),
|
||||
"RefExpr": (),
|
||||
"PrefixExpr": (),
|
||||
"TryExpr": (options: ["Expr"]),
|
||||
"CastExpr": (options: ["Expr", "TypeRef"]),
|
||||
"RefExpr": (options: ["Expr"]),
|
||||
"PrefixExpr": (options: ["Expr"]),
|
||||
"RangeExpr": (),
|
||||
"BinExpr": (),
|
||||
"String": (),
|
||||
@@ -521,7 +521,7 @@ Grammar(
|
||||
),
|
||||
"SelfParam": (),
|
||||
"Param": (
|
||||
options: [ "Pat" ],
|
||||
options: [ "Pat", "TypeRef" ],
|
||||
),
|
||||
"UseItem": (
|
||||
options: [ "UseTree" ]
|
||||
|
||||
Reference in New Issue
Block a user