diff options
author | xuri <xuri.me@gmail.com> | 2022-03-04 00:44:50 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2022-03-04 00:44:50 +0800 |
commit | 129052ae7db0fd2c59b1ea9158df0e75450cad42 (patch) | |
tree | 6f38fd9e349f7d568d5cb17c53235479ae8b703a /calc.go | |
parent | 3971e8a48b25614dfe685c4766c1bb66cd22fe18 (diff) |
This closes #1164, fix nested formula calculation result error
Diffstat (limited to 'calc.go')
-rw-r--r-- | calc.go | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -809,6 +809,17 @@ func (f *File) evalInfixExp(sheet, cell string, tokens []efp.Token) (efp.Token, } } + if isEndParenthesesToken(token) && isBeginParenthesesToken(opftStack.Peek().(efp.Token)) { + if arg := argsStack.Peek().(*list.List).Back(); arg != nil { + opfdStack.Push(efp.Token{ + TType: efp.TokenTypeOperand, + TSubType: efp.TokenSubTypeNumber, + TValue: arg.Value.(formulaArg).Value(), + }) + argsStack.Peek().(*list.List).Remove(arg) + } + } + // check current token is opft if err = f.parseToken(sheet, token, opfdStack, opftStack); err != nil { return efp.Token{}, err |