summaryrefslogtreecommitdiff
path: root/crates/typst-eval/src
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2024-12-02 13:15:28 +0100
committerLaurenz <laurmaedje@gmail.com>2024-12-04 10:12:07 +0100
commit008b59839f276bc5563fea2ac3350da63a0355d8 (patch)
treee5e5a227e984df67ffa73d2561567e800952de7d /crates/typst-eval/src
parentf8f2ba6a5f8c8ca7dbb85cf17b73332a0c301c60 (diff)
Add some more spans
Diffstat (limited to 'crates/typst-eval/src')
-rw-r--r--crates/typst-eval/src/call.rs4
-rw-r--r--crates/typst-eval/src/code.rs2
-rw-r--r--crates/typst-eval/src/lib.rs3
3 files changed, 6 insertions, 3 deletions
diff --git a/crates/typst-eval/src/call.rs b/crates/typst-eval/src/call.rs
index f48734cb..513d1dd2 100644
--- a/crates/typst-eval/src/call.rs
+++ b/crates/typst-eval/src/call.rs
@@ -391,7 +391,9 @@ fn wrap_args_in_math(
}
Ok(Value::Content(
callee.display().spanned(callee_span)
- + LrElem::new(TextElem::packed('(') + body + TextElem::packed(')')).pack(),
+ + LrElem::new(TextElem::packed('(') + body + TextElem::packed(')'))
+ .pack()
+ .spanned(args.span),
))
}
diff --git a/crates/typst-eval/src/code.rs b/crates/typst-eval/src/code.rs
index ba5256c1..34373fd4 100644
--- a/crates/typst-eval/src/code.rs
+++ b/crates/typst-eval/src/code.rs
@@ -359,7 +359,7 @@ impl Eval for ast::Contextual<'_> {
};
let func = Func::from(closure).spanned(body.span());
- Ok(ContextElem::new(func).pack())
+ Ok(ContextElem::new(func).pack().spanned(body.span()))
}
}
diff --git a/crates/typst-eval/src/lib.rs b/crates/typst-eval/src/lib.rs
index 69c20e8c..5eae7c1d 100644
--- a/crates/typst-eval/src/lib.rs
+++ b/crates/typst-eval/src/lib.rs
@@ -148,7 +148,8 @@ pub fn eval_string(
EvalMode::Math => Value::Content(
EquationElem::new(root.cast::<ast::Math>().unwrap().eval(&mut vm)?)
.with_block(false)
- .pack(),
+ .pack()
+ .spanned(span),
),
};