summaryrefslogtreecommitdiff
path: root/src/eval
diff options
context:
space:
mode:
Diffstat (limited to 'src/eval')
-rw-r--r--src/eval/library.rs14
-rw-r--r--src/eval/mod.rs6
-rw-r--r--src/eval/scope.rs2
3 files changed, 11 insertions, 11 deletions
diff --git a/src/eval/library.rs b/src/eval/library.rs
index 0e0b38aa..485a766b 100644
--- a/src/eval/library.rs
+++ b/src/eval/library.rs
@@ -77,18 +77,18 @@ pub struct LangItems {
pub enum_item: fn(number: Option<NonZeroUsize>, body: Content) -> Content,
/// An item in a term list: `/ Term: Details`.
pub term_item: fn(term: Content, description: Content) -> Content,
- /// A mathematical formula: `$x$`, `$ x^2 $`.
- pub formula: fn(body: Content, block: bool) -> Content,
- /// An alignment point in a formula: `&`.
+ /// A mathematical equation: `$x$`, `$ x^2 $`.
+ pub equation: fn(body: Content, block: bool) -> Content,
+ /// An alignment point in math: `&`.
pub math_align_point: fn() -> Content,
- /// Matched delimiters surrounding math in a formula: `[x + y]`.
+ /// Matched delimiters in math: `[x + y]`.
pub math_delimited: fn(open: Content, body: Content, close: Content) -> Content,
- /// A base with optional attachments in a formula: `a_1^2`.
+ /// A base with optional attachments in math: `a_1^2`.
pub math_attach:
fn(base: Content, bottom: Option<Content>, top: Option<Content>) -> Content,
/// A base with an accent: `arrow(x)`.
pub math_accent: fn(base: Content, accent: char) -> Content,
- /// A fraction in a formula: `x/2`.
+ /// A fraction in math: `x/2`.
pub math_frac: fn(num: Content, denom: Content) -> Content,
/// Dispatch a method on a library value.
pub library_method: fn(
@@ -126,7 +126,7 @@ impl Hash for LangItems {
self.list_item.hash(state);
self.enum_item.hash(state);
self.term_item.hash(state);
- self.formula.hash(state);
+ self.equation.hash(state);
self.math_align_point.hash(state);
self.math_delimited.hash(state);
self.math_attach.hash(state);
diff --git a/src/eval/mod.rs b/src/eval/mod.rs
index 27ed85e5..74c5f0b3 100644
--- a/src/eval/mod.rs
+++ b/src/eval/mod.rs
@@ -426,7 +426,7 @@ impl Eval for ast::Expr {
Self::List(v) => v.eval(vm).map(Value::Content),
Self::Enum(v) => v.eval(vm).map(Value::Content),
Self::Term(v) => v.eval(vm).map(Value::Content),
- Self::Formula(v) => v.eval(vm).map(Value::Content),
+ Self::Equation(v) => v.eval(vm).map(Value::Content),
Self::Math(v) => v.eval(vm).map(Value::Content),
Self::MathIdent(v) => v.eval(vm),
Self::MathAlignPoint(v) => v.eval(vm).map(Value::Content),
@@ -626,13 +626,13 @@ impl Eval for ast::TermItem {
}
}
-impl Eval for ast::Formula {
+impl Eval for ast::Equation {
type Output = Content;
fn eval(&self, vm: &mut Vm) -> SourceResult<Self::Output> {
let body = self.body().eval(vm)?;
let block = self.block();
- Ok((vm.items.formula)(body, block))
+ Ok((vm.items.equation)(body, block))
}
}
diff --git a/src/eval/scope.rs b/src/eval/scope.rs
index d1590063..d4338b5c 100644
--- a/src/eval/scope.rs
+++ b/src/eval/scope.rs
@@ -45,7 +45,7 @@ impl<'a> Scopes<'a> {
.ok_or("unknown variable")?)
}
- /// Try to access a variable immutably from within a math formula.
+ /// Try to access a variable immutably in math.
pub fn get_in_math(&self, var: &str) -> StrResult<&Value> {
Ok(std::iter::once(&self.top)
.chain(self.scopes.iter().rev())