MCPcopy Create free account
hub / github.com/daisy/MathCAT / top

Function top

src/canonicalize.rs:3768–3770  ·  view source on GitHub ↗

---------------- useful utility functions --------------------

(vec: &'s[StackInfo<'a, 'op>])

Source from the content-addressed store, hash-verified

3766
3767// ---------------- useful utility functions --------------------
3768fn top<'s, 'a:'s, 'op:'a>(vec: &'s[StackInfo<'a, 'op>]) -> &'s StackInfo<'a, 'op> {
3769 return &vec[vec.len()-1];
3770}
3771// Replace the attrs of 'mathml' with 'attrs' and keep the global attrs of 'mathml' (i.e, lift 'attrs' to 'mathml' for replacing children)
3772pub fn add_attrs<'a>(mathml: Element<'a>, attrs: Vec<Attribute>) -> Element<'a> {
3773 static GLOBAL_ATTRS: phf::Set<&str> = phf_set! {

Callers 5

shift_stackMethod · 0.85
reduce_stackMethod · 0.85
is_trig_argMethod · 0.85

Calls 1

lenMethod · 0.80

Tested by

no test coverage detected