Refine position display of indexing.

This commit is contained in:
Stephen Chung 2022-01-25 10:56:22 +08:00
parent d8a6b93f43
commit c79f1e44e4

View File

@ -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.