LesterLyu / fast-formula-parser

Parse and evaluate MS Excel formula in javascript.
https://www.npmjs.com/package/fast-formula-parser
MIT License
462 stars 64 forks source link

Return full argument in _callFunction #33

Closed rmdort closed 3 years ago

rmdort commented 3 years ago

Hi, Right now if we invoke a custom function =HELLO(A1)

The first argument of the function contains an object with value in the cell as per

https://github.com/LesterLyu/fast-formula-parser/blob/master/grammar/hooks.js#L151

Is there anyway i can access the position of the cell. Any possibility of changing L151 to

{
  value: res.val,
  isArray: res.isArray,
  isRangeRef: !!FormulaHelpers.isRangeRef(arg),
  isCellRef: !!FormulaHelpers.isCellRef(arg),
  position: arg.ref // New property
}