Commit 9cfb7ea
committed
fix: preserve matrix data for range refs in function infix expressions
When a range token (e.g. Ledger!H:H) was the first operand in an infix
expression inside a function argument (e.g. IF(Ledger!H:H="TRANSFER",...)),
there was no handler for the case where nextToken is an infix operator.
The range fell through to parseToken which converted the ArgMatrix to a
scalar string via formulaArgToToken, losing all matrix data.
This caused formulas like MAX(IF(Sheet!Col:Col="X",ABS(Sheet!Col:Col)))
to always return 0 because the column reference was reduced to its first
cell value before comparison.
Add a condition in evalInfixExp to parse the reference directly and push
it to opfdStack when a range token inside a function is followed by an
infix operator, preserving the full matrix data for element-wise operations.1 parent 3e9bc14 commit 9cfb7ea
1 file changed
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1033 | 1033 | | |
1034 | 1034 | | |
1035 | 1035 | | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
1036 | 1050 | | |
1037 | 1051 | | |
1038 | 1052 | | |
| |||
0 commit comments