diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-01-22 16:29:37 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-01-22 16:29:37 +0100 |
| commit | 6ca240508eed7288fcc317b9e167f6470a2f952c (patch) | |
| tree | b47dd8dd02c2cdf64af908fc11e01a2aaadc05b7 /src/model | |
| parent | 87a89e77e59b764b947e88490384c1c524eae157 (diff) | |
Don't throw away arguments after non-function math call
Diffstat (limited to 'src/model')
| -rw-r--r-- | src/model/eval.rs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/model/eval.rs b/src/model/eval.rs index 91112949..66ff2cd5 100644 --- a/src/model/eval.rs +++ b/src/model/eval.rs @@ -931,9 +931,16 @@ impl ast::FuncCall { if let Value::Func(callee) = callee { Ok(self.eval_with_callee(vm, callee)?.display_in_math()) } else { - Ok(callee.display_in_math() - + (vm.items.math_atom)("(".into()) - + (vm.items.math_atom)(")".into())) + let mut body = (vm.items.math_atom)('('.into()); + let mut args = self.args().eval(vm)?; + for (i, arg) in args.all::<Content>()?.into_iter().enumerate() { + if i > 0 { + body += (vm.items.math_atom)(','.into()); + } + body += arg; + } + body += (vm.items.math_atom)(')'.into()); + Ok(callee.display_in_math() + body) } } |
