summaryrefslogtreecommitdiff
path: root/macros/src
diff options
context:
space:
mode:
Diffstat (limited to 'macros/src')
-rw-r--r--macros/src/element.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/macros/src/element.rs b/macros/src/element.rs
index dd837754..37ca19eb 100644
--- a/macros/src/element.rs
+++ b/macros/src/element.rs
@@ -204,6 +204,11 @@ fn create(element: &Elem) -> TokenStream {
pub fn span(&self) -> ::typst::syntax::Span {
self.0.span()
}
+
+ /// Set the element's span.
+ pub fn spanned(self, span: ::typst::syntax::Span) -> Self {
+ Self(self.0.spanned(span))
+ }
}
#element_impl