diff --git a/crates/typst-eval/src/call.rs b/crates/typst-eval/src/call.rs index 1ca7b4b8f..6a57c85e8 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 000000000..8308bece1 Binary files /dev/null and b/tests/ref/math-call-symbol.png differ diff --git a/tests/suite/math/call.typ b/tests/suite/math/call.typ index 5caacfac6..54b97ceb0 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: