Add constant NO_POS.

This commit is contained in:
Stephen Chung
2020-11-02 12:50:27 +08:00
parent 6f3ce96d9d
commit d7d6f74dfd
29 changed files with 253 additions and 292 deletions

View File

@@ -10,7 +10,7 @@ use crate::fn_call::run_builtin_binary_op;
use crate::module::Module;
use crate::parser::map_dynamic_to_expr;
use crate::scope::Scope;
use crate::token::{is_valid_identifier, Position};
use crate::token::{is_valid_identifier, NO_POS};
use crate::{calc_native_fn_hash, StaticVec};
#[cfg(not(feature = "no_function"))]
@@ -726,7 +726,7 @@ fn optimize(
.iter()
.filter(|(_, typ, _)| *typ)
.for_each(|(name, _, value)| {
if let Some(val) = map_dynamic_to_expr(value, Position::none()) {
if let Some(val) = map_dynamic_to_expr(value, NO_POS) {
state.push_constant(name, val);
}
});