scopes
This commit is contained in:
@@ -383,6 +383,24 @@ impl<'a> AstNode<'a> for Expr<'a> {
|
||||
|
||||
impl<'a> Expr<'a> {}
|
||||
|
||||
// ExprStmt
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub struct ExprStmt<'a> {
|
||||
syntax: SyntaxNodeRef<'a>,
|
||||
}
|
||||
|
||||
impl<'a> AstNode<'a> for ExprStmt<'a> {
|
||||
fn cast(syntax: SyntaxNodeRef<'a>) -> Option<Self> {
|
||||
match syntax.kind() {
|
||||
EXPR_STMT => Some(ExprStmt { syntax }),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax }
|
||||
}
|
||||
|
||||
impl<'a> ExprStmt<'a> {}
|
||||
|
||||
// FieldExpr
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub struct FieldExpr<'a> {
|
||||
@@ -442,6 +460,10 @@ impl<'a> FnDef<'a> {
|
||||
pub fn param_list(self) -> Option<ParamList<'a>> {
|
||||
super::child_opt(self)
|
||||
}
|
||||
|
||||
pub fn body(self) -> Option<Block<'a>> {
|
||||
super::child_opt(self)
|
||||
}
|
||||
}
|
||||
|
||||
// FnPointerType
|
||||
@@ -626,6 +648,10 @@ impl<'a> LetStmt<'a> {
|
||||
pub fn pat(self) -> Option<Pat<'a>> {
|
||||
super::child_opt(self)
|
||||
}
|
||||
|
||||
pub fn initializer(self) -> Option<Expr<'a>> {
|
||||
super::child_opt(self)
|
||||
}
|
||||
}
|
||||
|
||||
// LoopExpr
|
||||
|
||||
Reference in New Issue
Block a user