summaryrefslogtreecommitdiff
path: root/src/eval
diff options
context:
space:
mode:
Diffstat (limited to 'src/eval')
-rw-r--r--src/eval/func.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/eval/func.rs b/src/eval/func.rs
index 26854240..a5fa6fa1 100644
--- a/src/eval/func.rs
+++ b/src/eval/func.rs
@@ -62,9 +62,11 @@ impl Func {
self.1
}
- /// Attach a span to the function.
+ /// Attach a span to this function if it doesn't already have one.
pub fn spanned(mut self, span: Span) -> Self {
- self.1 = span;
+ if self.1.is_detached() {
+ self.1 = span;
+ }
self
}