summaryrefslogtreecommitdiff
path: root/src/model/value.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-10-18 00:02:38 +0200
committerLaurenz <laurmaedje@gmail.com>2022-10-18 00:04:12 +0200
commitc0e972b91a7bf8d22cd24a38fc92a9c6214c8a0c (patch)
tree19362eb993f15ef1b9bceeac821852bb6edfe955 /src/model/value.rs
parente21822665591dc19766275da1e185215a6b945ef (diff)
Reduce dependencies from compiler on library
Diffstat (limited to 'src/model/value.rs')
-rw-r--r--src/model/value.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/model/value.rs b/src/model/value.rs
index 4075ce9c..e0d5edf3 100644
--- a/src/model/value.rs
+++ b/src/model/value.rs
@@ -4,13 +4,14 @@ use std::fmt::{self, Debug, Formatter};
use std::hash::{Hash, Hasher};
use std::sync::Arc;
+use comemo::Tracked;
use siphasher::sip128::{Hasher128, SipHasher};
use super::{ops, Args, Array, Cast, Content, Dict, Func, Layout, RawLength, Str};
use crate::diag::StrResult;
use crate::geom::{Angle, Color, Em, Fraction, Length, Ratio, Relative, RgbaColor};
-use crate::library::text::RawNode;
use crate::util::EcoString;
+use crate::World;
/// A computational value.
#[derive(Clone)]
@@ -113,7 +114,7 @@ impl Value {
}
/// Return the display representation of the value.
- pub fn display(self) -> Content {
+ pub fn display(self, world: Tracked<dyn World>) -> Content {
match self {
Value::None => Content::new(),
Value::Int(v) => Content::Text(format_eco!("{}", v)),
@@ -123,8 +124,7 @@ impl Value {
// For values which can't be shown "naturally", we return the raw
// representation with typst code syntax highlighting.
- v => Content::show(RawNode { text: v.repr().into(), block: false })
- .styled(RawNode::LANG, Some("typc".into())),
+ v => (world.config().roles.raw)(v.repr().into(), Some("typc".into()), false),
}
}
}