Rewriting the logic to extract formulas separated by semicolon (chaining operator). Takes the nested formula separation into account. When parse tree has syntax errors (not the binding errors, which are resolved by going step by step), a best effort is made to extract the test steps as accurately as possible. Firstly, an expression is tokenized if there's a need to go step by step and the spans for formulas between tokens that represent semicolons or chaining operators are computed. These spans are the formulas separated by semicolon. Some of these spans represent formulas that are separated somewhere down the tree (depth > 1, nested separation). Parse tree is used to merge these nested spans into spans that represent formulas separated at the top most level. This logic relies on a property of these spans that they are sorted by their start indices and since they are ordered, the nested spans appear on the same path and consecutively in the spans list created after tokenization. For each span, nearest node that represents formula separation (VariadicOpNode) is found. If this nearest node is not the root then we are looking at nested formula separation. This span is then merged to the root formula separation node based on the non root nearest formula separation node. If the parse tree has syntactic error nodes then the best attempt is made to extract the formulas as correctly as possible. However a lot depends on PowerFx and which parsing algorithm it uses. This is better than what we had previously but it is not 100% correct when there are syntax errors. This is fine as syntax errors would fail the test run even if we go step by step. I've added good amount of tests
Checklist
[X] The code change is covered by unit tests. I have added tests that prove my fix is effective or that my feature works
[X] I have performed end-to-end test locally.
[X] New and existing unit tests pass locally with my changes
[X] I have commented my code, particularly in hard-to-understand areas
[X] I have made corresponding changes to the documentation
Pull Request Template
Description
Rewriting the logic to extract formulas separated by semicolon (chaining operator). Takes the nested formula separation into account. When parse tree has syntax errors (not the binding errors, which are resolved by going step by step), a best effort is made to extract the test steps as accurately as possible. Firstly, an expression is tokenized if there's a need to go step by step and the spans for formulas between tokens that represent semicolons or chaining operators are computed. These spans are the formulas separated by semicolon. Some of these spans represent formulas that are separated somewhere down the tree (depth > 1, nested separation). Parse tree is used to merge these nested spans into spans that represent formulas separated at the top most level. This logic relies on a property of these spans that they are sorted by their start indices and since they are ordered, the nested spans appear on the same path and consecutively in the spans list created after tokenization. For each span, nearest node that represents formula separation (VariadicOpNode) is found. If this nearest node is not the root then we are looking at nested formula separation. This span is then merged to the root formula separation node based on the non root nearest formula separation node. If the parse tree has syntactic error nodes then the best attempt is made to extract the formulas as correctly as possible. However a lot depends on PowerFx and which parsing algorithm it uses. This is better than what we had previously but it is not 100% correct when there are syntax errors. This is fine as syntax errors would fail the test run even if we go step by step. I've added good amount of tests
Checklist