LesterLyu/fast-formula-parser

Wrong error codes

Closed this issue · 9 comments

Some error codes are wrongs

  1. Empty arguments - Expected FormulaError { _error: '#NA!' }
console.log(parser.parse('SUM()', {sheet: 'Sheet 1', row: 1, col: 1}));

Received - Error: Argument type 0 is missing.

  1. Unknown function - Expected FormulaError { _error: '#NAME?' }
console.log(parser.parse('SUMABC()', {sheet: 'Sheet 1', row: 1, col: 1}));

Received Error: Function SUMS is not implemented.

I'll look into it.

Opened a PR to fix this #16

Noticed that SUM(*() does not throw standard formula error

Should be fixed in the new release 👍

In the new release i get TypeError for SUM(*()

Oh. It was the dependency parser throwing TypeError.

const depParser = new DepParser()
depParser.parse('SUM(*()', { sheet: 'Sheet1', row: 1, col: 1})

Great. thanks