From c79f1e44e45efa8a0b9294a7b9fd3fe0e07ad35a Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Tue, 25 Jan 2022 10:56:22 +0800 Subject: [PATCH] Refine position display of indexing. --- src/ast/expr.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ast/expr.rs b/src/ast/expr.rs index b7cb4a52..3edfddc6 100644 --- a/src/ast/expr.rs +++ b/src/ast/expr.rs @@ -646,15 +646,14 @@ impl Expr { | Self::Variable(_, pos, _) | Self::Stack(_, pos) | Self::FnCall(_, pos) + | Self::Index(_, _, pos) | Self::Custom(_, pos) | Self::InterpolatedString(_, pos) => *pos, Self::Property(x) => (x.2).1, Self::Stmt(x) => x.position(), - Self::And(x, _) | Self::Or(x, _) | Self::Dot(x, _, _) | Self::Index(x, _, _) => { - x.lhs.position() - } + Self::And(x, _) | Self::Or(x, _) | Self::Dot(x, _, _) => x.lhs.position(), } } /// Override the [position][Position] of the expression.