Add fast-ops feature.

This commit is contained in:
Stephen Chung
2022-09-02 23:45:25 +08:00
parent 7dbc605d0b
commit 0516e8088c
7 changed files with 71 additions and 13 deletions

View File

@@ -190,6 +190,8 @@ pub struct FnCallExpr {
pub args: StaticVec<Expr>,
/// Does this function call capture the parent scope?
pub capture_parent_scope: bool,
/// Is this function call a simple symbol-based operator?
pub is_standard_operator: bool,
/// [Position] of the function name.
pub pos: Position,
}
@@ -204,6 +206,9 @@ impl fmt::Debug for FnCallExpr {
if self.capture_parent_scope {
ff.field("capture_parent_scope", &self.capture_parent_scope);
}
if self.is_standard_operator {
ff.field("is_standard_operator", &self.is_standard_operator);
}
ff.field("hash", &self.hashes)
.field("name", &self.name)
.field("args", &self.args);
@@ -662,6 +667,7 @@ impl Expr {
hashes: calc_fn_hash(f.fn_name(), 1).into(),
args: once(Self::StringConstant(f.fn_name().into(), pos)).collect(),
capture_parent_scope: false,
is_standard_operator: false,
pos,
}
.into(),