Add named symbols: , , , (#4267)

This commit is contained in:
Yip Coekjan 2024-06-22 16:40:10 +08:00 committed by GitHub
parent a2c9807159
commit ddce645ef0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 3 deletions

View File

@ -187,8 +187,6 @@ pub fn module() -> Module {
math.define_elem::<PrimesElem>();
math.define_func::<abs>();
math.define_func::<norm>();
math.define_func::<floor>();
math.define_func::<ceil>();
math.define_func::<round>();
math.define_func::<sqrt>();
math.define_func::<upright>();

View File

@ -64,6 +64,14 @@ pub(crate) const SYM: &[(&str, Symbol)] = symbols! {
spheric.rev: '',
spheric.top: '',
],
ceil: [
#[call(crate::math::ceil)] l: '',
r: '',
],
floor: [
#[call(crate::math::floor)] l: '',
r: '',
],
// Punctuation.
amp: ['&', inv: ''],

View File

@ -542,7 +542,7 @@ fn group_page(
let mut outline_items = vec![];
for name in &group.filter {
let value = group.module().scope().get(name).unwrap();
let Value::Func(func) = value else { panic!("not a function") };
let Ok(ref func) = value.clone().cast::<Func>() else { panic!("not a function") };
let func = func_model(resolver, func, &path, true);
let id_base = urlify(&eco_format!("functions-{}", func.name));
let children = func_outline(&func, &id_base);