psalaets/excel-formula-ast

german excel: WAHR/FALSCH

Opened this issue · 3 comments

In german excel, you have 'WAHR' and 'FALSCH' instead of 'TRUE' and 'FALSE'. The library will output a logicalNode only if the name is 'TRUE' or 'FALSE'. 'WAHR' and 'FALSCH' will be handled as 'cell'-Node. I am not sure if this is a lower-level (tokenizer) or ast problem.

It is easy to work around, but I think this could be handled better, e.g. a list of names for logical true, and a list of strings for logical false. I don't have any idea what this looks like in spanish, for example.

This seems like the same kind of problem as #4. Do you think some kind of i18n support would cover it?

For each supported language, the bundle would contain:

  • symbols for true/false
  • argument separator
  • number parsing

and whatever other differences there are.

It's been a while since I thought about these excel modules, so I sort of forget, but I think this may be a tokenizer issue.

Yes, I think that would solve it. Excel saves the formulas in an language independent mode (which basically means always english) and to display it, it switches the symbols. What's missing is a function to print the formula out of the AST tree.

I think I have this working. The changes are in psalaets/excel-formula-tokenizer version 2.3.0.

Can you try running your code with excel-formula-tokenizer@2.3.0 and excel-formula-ast (latest)?

Edit: okay I'm wrong, still not fully working. Your formula from #4 doesn't tokenize correctly.