summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/typst-eval/src/call.rs14
-rw-r--r--tests/ref/math-call-symbol.pngbin0 -> 703 bytes
-rw-r--r--tests/suite/math/call.typ9
3 files changed, 17 insertions, 6 deletions
diff --git a/crates/typst-eval/src/call.rs b/crates/typst-eval/src/call.rs
index 1ca7b4b8..6a57c85e 100644
--- a/crates/typst-eval/src/call.rs
+++ b/crates/typst-eval/src/call.rs
@@ -404,12 +404,14 @@ fn wrap_args_in_math(
if trailing_comma {
body += SymbolElem::packed(',');
}
- Ok(Value::Content(
- callee.display().spanned(callee_span)
- + LrElem::new(SymbolElem::packed('(') + body + SymbolElem::packed(')'))
- .pack()
- .spanned(args.span),
- ))
+
+ let formatted = callee.display().spanned(callee_span)
+ + LrElem::new(SymbolElem::packed('(') + body + SymbolElem::packed(')'))
+ .pack()
+ .spanned(args.span);
+
+ args.finish()?;
+ Ok(Value::Content(formatted))
}
/// Provide a hint if the callee is a shadowed standard library function.
diff --git a/tests/ref/math-call-symbol.png b/tests/ref/math-call-symbol.png
new file mode 100644
index 00000000..8308bece
--- /dev/null
+++ b/tests/ref/math-call-symbol.png
Binary files differ
diff --git a/tests/suite/math/call.typ b/tests/suite/math/call.typ
index 5caacfac..54b97ceb 100644
--- a/tests/suite/math/call.typ
+++ b/tests/suite/math/call.typ
@@ -221,6 +221,15 @@ $
// Hint: 4-6 or if you meant to display this as text, try placing it in quotes: `"ab"`
$ 5ab $
+--- math-call-symbol ---
+$ phi(x) $
+$ phi(x, y) $
+$ phi(1,2,,3,) $
+
+--- math-call-symbol-named-argument ---
+// Error: 10-18 unexpected argument: alpha
+$ phi(x, alpha: y) $
+
--- issue-3774-math-call-empty-2d-args ---
$ mat(;,) $
// Add some whitespace/trivia: