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

Method evaluate

src/speech.rs:1127–1139  ·  view source on GitHub ↗
(&'a self, context: &'r Context<'c>, mathml: Element<'c>)

Source from the content-addressed store, hash-verified

1125 }
1126
1127 pub fn evaluate<'a, 'c>(&'a self, context: &'r Context<'c>, mathml: Element<'c>) -> Result<Value<'c>> {
1128 // debug!("evaluate: {}", self);
1129 let result = self.rc.xpath.evaluate(context, mathml);
1130 return match result {
1131 Ok(val) => Ok( val ),
1132 Err(e) => {
1133 bail!( "{}\n\n",
1134 e.to_string() // remove confusing parts of error message from xpath
1135 .replace("OwnedPrefixedName { prefix: None, local_part:", "")
1136 .replace(" }", "") );
1137 }
1138 };
1139 }
1140
1141 pub fn test_input<F>(self, f: F) -> bool where F: Fn(&str) -> bool {
1142 return f(self.rc.string.as_ref());

Callers 7

replaceMethod · 0.45
is_trueMethod · 0.45
is_matchMethod · 0.45
set_globalsMethod · 0.45
pushMethod · 0.45
replace_stringMethod · 0.45
context_get_variableFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected