summaryrefslogtreecommitdiff
path: root/src/model/cast.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/model/cast.rs')
-rw-r--r--src/model/cast.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/model/cast.rs b/src/model/cast.rs
index cbb2952d..7a466b72 100644
--- a/src/model/cast.rs
+++ b/src/model/cast.rs
@@ -1,7 +1,7 @@
use std::num::NonZeroUsize;
use std::str::FromStr;
-use super::{Pattern, Regex, Value};
+use super::{Content, Pattern, Regex, Transform, Value};
use crate::diag::{with_alternative, StrResult};
use crate::font::{FontStretch, FontStyle, FontWeight};
use crate::frame::{Destination, Lang, Location, Region};
@@ -189,6 +189,15 @@ castable! {
@regex: Regex => Self::Regex(regex.clone()),
}
+castable! {
+ Transform,
+ Expected: "content or function",
+ Value::None => Self::Content(Content::empty()),
+ Value::Str(text) => Self::Content(item!(text)(text.into())),
+ Value::Content(content) => Self::Content(content),
+ Value::Func(func) => Self::Func(func),
+}
+
dynamic! {
Dir: "direction",
}