Related to #1164: fix incorrect argument count with nested func in parenthesized sub-exporessions - #2348
Merged
Merged
Conversation
… in parenthesized sub-exporessions
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2348 +/- ##
=======================================
Coverage 99.62% 99.62%
=======================================
Files 32 32
Lines 26961 26969 +8
=======================================
+ Hits 26859 26867 +8
Misses 53 53
Partials 49 49
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
xuri
requested changes
Jul 14, 2026
xuri
requested changes
Jul 14, 2026
xuri
left a comment
Member
There was a problem hiding this comment.
Great work! I've made some changes based on your code branch.
xuri
approved these changes
Jul 14, 2026
10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When a function argument contains an expression like 1+(ABS(A1)+A1)/2, the formula parser in prepareEvalInfixExp miscounts the outer function's arguments (e.g. IF or SUM), throwing errors like "IF accepts at most 3 arguments".
Root cause: when an inner function closes, the code checks whether the operand on opfdStack belongs to the current function or an outer expression by looking at the token directly below on opftStack. If a subexpression-start token "(" or another function-start token (e.g. SUM) sits between the function marker and the actual infix operator (e.g. +), this check fails and the operand gets wrongly consumed as a function argument.
Related Issue
#1164
Motivation and Context
The added unit tests would fail without this fix while they are valid in MS Excel.
How Has This Been Tested
Added unit tests
Types of changes
Checklist