mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
implement accessors for IndexExpr
This commit is contained in:
parent
fd4c083e42
commit
8919aa8065
1 changed files with 9 additions and 0 deletions
|
@ -195,6 +195,15 @@ impl ast::BinExpr {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl ast::IndexExpr {
|
||||||
|
pub fn base(&self) -> Option<ast::Expr> {
|
||||||
|
children(self).nth(0)
|
||||||
|
}
|
||||||
|
pub fn index(&self) -> Option<ast::Expr> {
|
||||||
|
children(self).nth(1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub enum ArrayExprKind {
|
pub enum ArrayExprKind {
|
||||||
Repeat { initializer: Option<ast::Expr>, repeat: Option<ast::Expr> },
|
Repeat { initializer: Option<ast::Expr>, repeat: Option<ast::Expr> },
|
||||||
ElementList(AstChildren<ast::Expr>),
|
ElementList(AstChildren<ast::Expr>),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue