psalaets/excel-formula-ast

Contribution request

Closed this issue · 4 comments

Hi Alex,

I've been evaluating a number of excel formula parsers (including writing my own) for a project I'm working on, when I discovered your parser.

The design of the AST builder is elegant and I'm wondering if you're open to contributions to the excel-formula-ast and excel-formula-tokenizer? Also, is github's issues the best way to reach you?

Thanks!

if you're open to contributions to the excel-formula-ast and excel-formula-tokenizer?

What kind of things did you have in mind?

is github's issues the best way to reach you?

Yes github is the best place to reach me for discussing this project.

Thanks for responding so quickly.

I'm looking to add two sets of changes

  • Support for dynamic arrays (implicit intersection and spill range)
  • Allow hooks to be injected into the tokenizer and treebuilder, to customize/change what's returned for each token and node

On the tokenizer:

  • Support for two dynamic array tokens (implicit intersection and spill range).
  • Hooks within the tokenizer, to customize the return behavior of individual tokens (e.g., retaining the value instead of wiping it out).

For the ast/treebuilder:

  • Hooks to inject different node builders and treebuilders; in order to process the decorated tokens.

Sure I'm open to those changes. My only request is that you include reasonable test coverage for new features/capabilities.

To provide a little background, I originally put these modules together to prototype something for a project that ended up being scrapped. Since I never used them for anything, I'm not heavily invested or opinionated.

I found the tokenizer code somewhere on the internet and cleaned it up a bit. I feel like it's still pretty hard to understand and maybe some kind of state machine solution would work better. I also think these modules would benefit from a TypeScript rewrite.

Anyhow, those are just two things on my "maybe someday" todo list. I am not implying that you should consider doing them.

Much appreciated!

Just a fair warning that it'll be a couple of months before I revisit this, as this is all in the research phase.

-John