Target only the actual operator.

Renamed `BinExpr::op()` and `PrefixExpr::op()` to `op_kind`.
Now `op()` returns the `SyntaxNode`.
This commit is contained in:
Marco Groppo 2019-03-24 22:21:22 +01:00
parent acac7415a6
commit 67055c47da
3 changed files with 58 additions and 47 deletions

View file

@ -680,7 +680,7 @@ impl ExprCollector {
}
ast::ExprKind::PrefixExpr(e) => {
let expr = self.collect_expr_opt(e.expr());
if let Some(op) = e.op() {
if let Some(op) = e.op_kind() {
self.alloc_expr(Expr::UnaryOp { expr, op }, syntax_ptr)
} else {
self.alloc_expr(Expr::Missing, syntax_ptr)
@ -703,7 +703,7 @@ impl ExprCollector {
ast::ExprKind::BinExpr(e) => {
let lhs = self.collect_expr_opt(e.lhs());
let rhs = self.collect_expr_opt(e.rhs());
let op = e.op();
let op = e.op_kind();
self.alloc_expr(Expr::BinaryOp { lhs, rhs, op }, syntax_ptr)
}
ast::ExprKind::TupleExpr(e) => {