Make Expr::position const.

This commit is contained in:
Stephen Chung
2021-06-29 18:41:03 +08:00
parent 08828dd8c1
commit 0346bb874b
5 changed files with 24 additions and 35 deletions

View File

@@ -67,13 +67,13 @@ impl Expression<'_> {
/// Get the expression.
#[inline(always)]
#[must_use]
pub(crate) fn expr(&self) -> &Expr {
pub(crate) const fn expr(&self) -> &Expr {
&self.0
}
/// Get the position of this expression.
#[inline(always)]
#[must_use]
pub fn position(&self) -> Position {
pub const fn position(&self) -> Position {
self.0.position()
}
/// Get the value of this expression if it is a literal constant.