You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Problems with non-functions sharing the function call syntax in math mode #7274
I'm adding this because it isn't tracked elsewhere, although most of the cases are present in the test suite.
In math mode the function call syntax needs to 'unparse' a call at runtime if the function identifier isn't actually a Typst function. E.g. $pi(x,y)$ will render like $pi\(x\,y\)$.
However, unparsing is currently broken/incomplete when using any special syntax for arguments, i.e. named arguments, argument spreading, and 2D arguments. We currently give poor/nonsense errors for these cases because we try to evaluate the arguments before realizing we need to unparse. E.g. $pi(x:y)$ gives "Error: unexpected argument: x" (this is distinct from #3802 because pi isn't a function).
Instead, we should either correctly unparse the special syntax, or give better error messages if we do recognize it being used with a non-function.
Also, when parsing a non-function identifier we have different behavior for delimiters: unclosed parentheses cause an error ( $pi(x$ is an error, but not $pi (x$ ) and parentheses don't pair with non-parentheses ($pi(2,5]$).
Activity
Add space before ( after multi-char symbol names to prevent function-…