Add HIR Expr machinery
This commit is contained in:
@@ -378,7 +378,11 @@ impl<R: TreeRoot<RaTypes>> BreakExprNode<R> {
|
||||
}
|
||||
|
||||
|
||||
impl<'a> BreakExpr<'a> {}
|
||||
impl<'a> BreakExpr<'a> {
|
||||
pub fn expr(self) -> Option<Expr<'a>> {
|
||||
super::child_opt(self)
|
||||
}
|
||||
}
|
||||
|
||||
// Byte
|
||||
#[derive(Debug, Clone, Copy,)]
|
||||
@@ -3880,6 +3884,10 @@ impl<'a> StructLit<'a> {
|
||||
pub fn named_field_list(self) -> Option<NamedFieldList<'a>> {
|
||||
super::child_opt(self)
|
||||
}
|
||||
|
||||
pub fn spread(self) -> Option<Expr<'a>> {
|
||||
super::child_opt(self)
|
||||
}
|
||||
}
|
||||
|
||||
// StructPat
|
||||
|
||||
@@ -384,7 +384,7 @@ Grammar(
|
||||
options: [ "Condition" ]
|
||||
),
|
||||
"ContinueExpr": (),
|
||||
"BreakExpr": (),
|
||||
"BreakExpr": (options: ["Expr"]),
|
||||
"Label": (),
|
||||
"BlockExpr": (
|
||||
options: [ "Block" ]
|
||||
@@ -404,7 +404,7 @@ Grammar(
|
||||
collections: [ [ "pats", "Pat" ] ]
|
||||
),
|
||||
"MatchGuard": (),
|
||||
"StructLit": (options: ["Path", "NamedFieldList"]),
|
||||
"StructLit": (options: ["Path", "NamedFieldList", ["spread", "Expr"]]),
|
||||
"NamedFieldList": (collections: [ ["fields", "NamedField"] ]),
|
||||
"NamedField": (options: ["NameRef", "Expr"]),
|
||||
"CallExpr": (
|
||||
|
||||
Reference in New Issue
Block a user