summaryrefslogtreecommitdiff
path: root/src/model
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-01-27 15:09:05 +0100
committerLaurenz <laurmaedje@gmail.com>2023-01-27 15:32:05 +0100
commit2e039cb052fcb768027053cbf02ce396f6d7a6be (patch)
treeb1a1c1da0440805b296e3204fa30cd9666322a0e /src/model
parenta59b9fff93f708d5a35d2bf61c3b21efee71b7e9 (diff)
Fix math spacing bugs
Diffstat (limited to 'src/model')
-rw-r--r--src/model/eval.rs10
-rw-r--r--src/model/value.rs1
2 files changed, 3 insertions, 8 deletions
diff --git a/src/model/eval.rs b/src/model/eval.rs
index 91a9aeeb..d52b1272 100644
--- a/src/model/eval.rs
+++ b/src/model/eval.rs
@@ -9,7 +9,7 @@ use unicode_segmentation::UnicodeSegmentation;
use super::{
methods, ops, Arg, Args, Array, CapturesVisitor, Closure, Content, Dict, Func, Label,
- LangItems, Module, Recipe, Scopes, Selector, StyleMap, Transform, Value,
+ LangItems, Module, Recipe, Scopes, Selector, StyleMap, Symbol, Transform, Value,
};
use crate::diag::{
bail, error, At, SourceError, SourceResult, StrResult, Trace, Tracepoint,
@@ -421,9 +421,7 @@ impl Eval for ast::Escape {
type Output = Value;
fn eval(&self, _: &mut Vm) -> SourceResult<Self::Output> {
- // This can be in markup and math, going through a string ensure
- // that either text or atom is picked.
- Ok(Value::Str(self.get().into()))
+ Ok(Value::Symbol(Symbol::new(self.get())))
}
}
@@ -431,9 +429,7 @@ impl Eval for ast::Shorthand {
type Output = Value;
fn eval(&self, _: &mut Vm) -> SourceResult<Self::Output> {
- // This can be in markup and math, going through a string ensure
- // that either text or atom is picked.
- Ok(Value::Str(self.get().into()))
+ Ok(Value::Symbol(Symbol::new(self.get())))
}
}
diff --git a/src/model/value.rs b/src/model/value.rs
index ba3a550f..d03911c6 100644
--- a/src/model/value.rs
+++ b/src/model/value.rs
@@ -151,7 +151,6 @@ impl Value {
Self::Int(v) => item!(math_atom)(format_eco!("{}", v)),
Self::Float(v) => item!(math_atom)(format_eco!("{}", v)),
Self::Symbol(v) => item!(math_atom)(v.get().into()),
- Self::Str(v) => item!(math_atom)(v.into()),
_ => self.display(),
}
}