@ricsam/formula-engine 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +100 -0
- package/dist/cjs/core/ast-traverser.cjs +124 -0
- package/dist/cjs/core/ast-traverser.cjs.map +10 -0
- package/dist/cjs/core/autofill-utils.cjs +304 -0
- package/dist/cjs/core/autofill-utils.cjs.map +10 -0
- package/dist/cjs/core/engine.cjs +390 -0
- package/dist/cjs/core/engine.cjs.map +10 -0
- package/dist/cjs/core/managers/cache-manager.cjs +58 -0
- package/dist/cjs/core/managers/cache-manager.cjs.map +10 -0
- package/dist/cjs/core/managers/dependency-manager.cjs +620 -0
- package/dist/cjs/core/managers/dependency-manager.cjs.map +10 -0
- package/dist/cjs/core/managers/dependency-node.cjs +24 -0
- package/dist/cjs/core/managers/dependency-node.cjs.map +9 -0
- package/dist/cjs/core/managers/evaluation-manager.cjs +433 -0
- package/dist/cjs/core/managers/evaluation-manager.cjs.map +10 -0
- package/dist/cjs/core/managers/event-manager.cjs +49 -0
- package/dist/cjs/core/managers/event-manager.cjs.map +10 -0
- package/dist/cjs/core/managers/frontier-dependency-manager.cjs +181 -0
- package/dist/cjs/core/managers/frontier-dependency-manager.cjs.map +10 -0
- package/dist/cjs/core/managers/index.cjs +49 -0
- package/dist/cjs/core/managers/index.cjs.map +10 -0
- package/dist/cjs/core/managers/isDependencyNode.cjs +44 -0
- package/dist/cjs/core/managers/isDependencyNode.cjs.map +10 -0
- package/dist/cjs/core/managers/named-expression-manager.cjs +379 -0
- package/dist/cjs/core/managers/named-expression-manager.cjs.map +10 -0
- package/dist/cjs/core/managers/range-eval-order-builder.cjs +644 -0
- package/dist/cjs/core/managers/range-eval-order-builder.cjs.map +10 -0
- package/dist/cjs/core/managers/table-manager.cjs +254 -0
- package/dist/cjs/core/managers/table-manager.cjs.map +10 -0
- package/dist/cjs/core/managers/workbook-manager.cjs +474 -0
- package/dist/cjs/core/managers/workbook-manager.cjs.map +10 -0
- package/dist/cjs/core/map-serializer.cjs +69 -0
- package/dist/cjs/core/map-serializer.cjs.map +10 -0
- package/dist/cjs/core/named-expression-renamer.cjs +88 -0
- package/dist/cjs/core/named-expression-renamer.cjs.map +10 -0
- package/dist/cjs/core/sheet-renamer.cjs +89 -0
- package/dist/cjs/core/sheet-renamer.cjs.map +10 -0
- package/dist/cjs/core/sheet-utils.cjs +39 -0
- package/dist/cjs/core/sheet-utils.cjs.map +10 -0
- package/dist/cjs/core/table-renamer.cjs +88 -0
- package/dist/cjs/core/table-renamer.cjs.map +10 -0
- package/dist/cjs/core/types.cjs +48 -0
- package/dist/cjs/core/types.cjs.map +10 -0
- package/dist/cjs/core/utils/range-serializer.cjs +65 -0
- package/dist/cjs/core/utils/range-serializer.cjs.map +10 -0
- package/dist/cjs/core/utils/spreadsheet-visualizer.cjs +142 -0
- package/dist/cjs/core/utils/spreadsheet-visualizer.cjs.map +10 -0
- package/dist/cjs/core/utils.cjs +434 -0
- package/dist/cjs/core/utils.cjs.map +10 -0
- package/dist/cjs/core/workbook-renamer.cjs +106 -0
- package/dist/cjs/core/workbook-renamer.cjs.map +10 -0
- package/dist/cjs/debug/flags.cjs +47 -0
- package/dist/cjs/debug/flags.cjs.map +10 -0
- package/dist/cjs/evaluator/arithmetic/add/add.cjs +82 -0
- package/dist/cjs/evaluator/arithmetic/add/add.cjs.map +10 -0
- package/dist/cjs/evaluator/arithmetic/divide/divide.cjs +107 -0
- package/dist/cjs/evaluator/arithmetic/divide/divide.cjs.map +10 -0
- package/dist/cjs/evaluator/arithmetic/multiply/multiply.cjs +93 -0
- package/dist/cjs/evaluator/arithmetic/multiply/multiply.cjs.map +10 -0
- package/dist/cjs/evaluator/arithmetic/power/power.cjs +125 -0
- package/dist/cjs/evaluator/arithmetic/power/power.cjs.map +10 -0
- package/dist/cjs/evaluator/arithmetic/subtract/subtract.cjs +84 -0
- package/dist/cjs/evaluator/arithmetic/subtract/subtract.cjs.map +10 -0
- package/dist/cjs/evaluator/comparison/equals.cjs +64 -0
- package/dist/cjs/evaluator/comparison/equals.cjs.map +10 -0
- package/dist/cjs/evaluator/comparison/greater-than-or-equal.cjs +61 -0
- package/dist/cjs/evaluator/comparison/greater-than-or-equal.cjs.map +10 -0
- package/dist/cjs/evaluator/comparison/greater-than.cjs +61 -0
- package/dist/cjs/evaluator/comparison/greater-than.cjs.map +10 -0
- package/dist/cjs/evaluator/comparison/less-than-or-equal.cjs +69 -0
- package/dist/cjs/evaluator/comparison/less-than-or-equal.cjs.map +10 -0
- package/dist/cjs/evaluator/comparison/less-than.cjs +68 -0
- package/dist/cjs/evaluator/comparison/less-than.cjs.map +10 -0
- package/dist/cjs/evaluator/comparison/not-equals.cjs +53 -0
- package/dist/cjs/evaluator/comparison/not-equals.cjs.map +10 -0
- package/dist/cjs/evaluator/concatenation/concatenate.cjs +72 -0
- package/dist/cjs/evaluator/concatenation/concatenate.cjs.map +10 -0
- package/dist/cjs/evaluator/dependency-nodes/ast-evaluation-node.cjs +58 -0
- package/dist/cjs/evaluator/dependency-nodes/ast-evaluation-node.cjs.map +10 -0
- package/dist/cjs/evaluator/dependency-nodes/base-eval-node.cjs +112 -0
- package/dist/cjs/evaluator/dependency-nodes/base-eval-node.cjs.map +10 -0
- package/dist/cjs/evaluator/dependency-nodes/cell-value-node.cjs +54 -0
- package/dist/cjs/evaluator/dependency-nodes/cell-value-node.cjs.map +10 -0
- package/dist/cjs/evaluator/dependency-nodes/empty-cell-evaluation-node.cjs +108 -0
- package/dist/cjs/evaluator/dependency-nodes/empty-cell-evaluation-node.cjs.map +10 -0
- package/dist/cjs/evaluator/dependency-nodes/spill-meta-node.cjs +50 -0
- package/dist/cjs/evaluator/dependency-nodes/spill-meta-node.cjs.map +10 -0
- package/dist/cjs/evaluator/evaluate-scalar-operator.cjs +254 -0
- package/dist/cjs/evaluator/evaluate-scalar-operator.cjs.map +10 -0
- package/dist/cjs/evaluator/evaluation-context.cjs +154 -0
- package/dist/cjs/evaluator/evaluation-context.cjs.map +10 -0
- package/dist/cjs/evaluator/evaluation-error.cjs +75 -0
- package/dist/cjs/evaluator/evaluation-error.cjs.map +10 -0
- package/dist/cjs/evaluator/formula-evaluator.cjs +797 -0
- package/dist/cjs/evaluator/formula-evaluator.cjs.map +10 -0
- package/dist/cjs/evaluator/range-evaluation-node.cjs +88 -0
- package/dist/cjs/evaluator/range-evaluation-node.cjs.map +10 -0
- package/dist/cjs/functions/_template/template.cjs +42 -0
- package/dist/cjs/functions/_template/template.cjs.map +10 -0
- package/dist/cjs/functions/array/sequence/sequence.cjs +315 -0
- package/dist/cjs/functions/array/sequence/sequence.cjs.map +10 -0
- package/dist/cjs/functions/criteria-parser.cjs +217 -0
- package/dist/cjs/functions/criteria-parser.cjs.map +10 -0
- package/dist/cjs/functions/criteria-utils.cjs +291 -0
- package/dist/cjs/functions/criteria-utils.cjs.map +10 -0
- package/dist/cjs/functions/function-utils.cjs +63 -0
- package/dist/cjs/functions/function-utils.cjs.map +10 -0
- package/dist/cjs/functions/index.cjs +125 -0
- package/dist/cjs/functions/index.cjs.map +10 -0
- package/dist/cjs/functions/information/cell/cell.cjs +196 -0
- package/dist/cjs/functions/information/cell/cell.cjs.map +10 -0
- package/dist/cjs/functions/information/column/column.cjs +144 -0
- package/dist/cjs/functions/information/column/column.cjs.map +10 -0
- package/dist/cjs/functions/information/row/row.cjs +150 -0
- package/dist/cjs/functions/information/row/row.cjs.map +10 -0
- package/dist/cjs/functions/logical/and/and.cjs +112 -0
- package/dist/cjs/functions/logical/and/and.cjs.map +10 -0
- package/dist/cjs/functions/logical/if/if.cjs +195 -0
- package/dist/cjs/functions/logical/if/if.cjs.map +10 -0
- package/dist/cjs/functions/logical/iferror/iferror.cjs +126 -0
- package/dist/cjs/functions/logical/iferror/iferror.cjs.map +10 -0
- package/dist/cjs/functions/logical/or/or.cjs +112 -0
- package/dist/cjs/functions/logical/or/or.cjs.map +10 -0
- package/dist/cjs/functions/lookup/count/count-utils.cjs +65 -0
- package/dist/cjs/functions/lookup/count/count-utils.cjs.map +10 -0
- package/dist/cjs/functions/lookup/count/count.cjs +48 -0
- package/dist/cjs/functions/lookup/count/count.cjs.map +10 -0
- package/dist/cjs/functions/lookup/count/countif.cjs +94 -0
- package/dist/cjs/functions/lookup/count/countif.cjs.map +10 -0
- package/dist/cjs/functions/lookup/count/countifs.cjs +63 -0
- package/dist/cjs/functions/lookup/count/countifs.cjs.map +10 -0
- package/dist/cjs/functions/lookup/index-lookup/index-lookup.cjs +187 -0
- package/dist/cjs/functions/lookup/index-lookup/index-lookup.cjs.map +10 -0
- package/dist/cjs/functions/lookup/match/match.cjs +168 -0
- package/dist/cjs/functions/lookup/match/match.cjs.map +10 -0
- package/dist/cjs/functions/lookup/xlookup/xlookup.cjs +410 -0
- package/dist/cjs/functions/lookup/xlookup/xlookup.cjs.map +10 -0
- package/dist/cjs/functions/math/average/average-utils.cjs +72 -0
- package/dist/cjs/functions/math/average/average-utils.cjs.map +10 -0
- package/dist/cjs/functions/math/average/average.cjs +48 -0
- package/dist/cjs/functions/math/average/average.cjs.map +10 -0
- package/dist/cjs/functions/math/average/averageif.cjs +83 -0
- package/dist/cjs/functions/math/average/averageif.cjs.map +10 -0
- package/dist/cjs/functions/math/average/averageifs.cjs +61 -0
- package/dist/cjs/functions/math/average/averageifs.cjs.map +10 -0
- package/dist/cjs/functions/math/ceiling/ceiling.cjs +219 -0
- package/dist/cjs/functions/math/ceiling/ceiling.cjs.map +10 -0
- package/dist/cjs/functions/math/max/max-utils.cjs +71 -0
- package/dist/cjs/functions/math/max/max-utils.cjs.map +10 -0
- package/dist/cjs/functions/math/max/max.cjs +48 -0
- package/dist/cjs/functions/math/max/max.cjs.map +10 -0
- package/dist/cjs/functions/math/max/maxif.cjs +83 -0
- package/dist/cjs/functions/math/max/maxif.cjs.map +10 -0
- package/dist/cjs/functions/math/max/maxifs.cjs +61 -0
- package/dist/cjs/functions/math/max/maxifs.cjs.map +10 -0
- package/dist/cjs/functions/math/min/min-utils.cjs +71 -0
- package/dist/cjs/functions/math/min/min-utils.cjs.map +10 -0
- package/dist/cjs/functions/math/min/min.cjs +48 -0
- package/dist/cjs/functions/math/min/min.cjs.map +10 -0
- package/dist/cjs/functions/math/min/minif.cjs +83 -0
- package/dist/cjs/functions/math/min/minif.cjs.map +10 -0
- package/dist/cjs/functions/math/min/minifs.cjs +61 -0
- package/dist/cjs/functions/math/min/minifs.cjs.map +10 -0
- package/dist/cjs/functions/math/sum/sum.cjs +48 -0
- package/dist/cjs/functions/math/sum/sum.cjs.map +10 -0
- package/dist/cjs/functions/math/sum/sumif.cjs +83 -0
- package/dist/cjs/functions/math/sum/sumif.cjs.map +10 -0
- package/dist/cjs/functions/math/sum/sumifs.cjs +60 -0
- package/dist/cjs/functions/math/sum/sumifs.cjs.map +10 -0
- package/dist/cjs/functions/math/sum/summation-utils.cjs +57 -0
- package/dist/cjs/functions/math/sum/summation-utils.cjs.map +10 -0
- package/dist/cjs/functions/reference/address/address.cjs +163 -0
- package/dist/cjs/functions/reference/address/address.cjs.map +10 -0
- package/dist/cjs/functions/reference/indirect/indirect.cjs +102 -0
- package/dist/cjs/functions/reference/indirect/indirect.cjs.map +10 -0
- package/dist/cjs/functions/reference/offset/offset.cjs +233 -0
- package/dist/cjs/functions/reference/offset/offset.cjs.map +10 -0
- package/dist/cjs/functions/text/concatenate/concatenate.cjs +167 -0
- package/dist/cjs/functions/text/concatenate/concatenate.cjs.map +10 -0
- package/dist/cjs/functions/text/exact/exact.cjs +171 -0
- package/dist/cjs/functions/text/exact/exact.cjs.map +10 -0
- package/dist/cjs/functions/text/find/find.cjs +397 -0
- package/dist/cjs/functions/text/find/find.cjs.map +10 -0
- package/dist/cjs/functions/text/left/left.cjs +109 -0
- package/dist/cjs/functions/text/left/left.cjs.map +10 -0
- package/dist/cjs/functions/text/len/len.cjs +119 -0
- package/dist/cjs/functions/text/len/len.cjs.map +10 -0
- package/dist/cjs/functions/text/mid/mid.cjs +103 -0
- package/dist/cjs/functions/text/mid/mid.cjs.map +10 -0
- package/dist/cjs/functions/text/right/right.cjs +167 -0
- package/dist/cjs/functions/text/right/right.cjs.map +10 -0
- package/dist/cjs/functions/text/text-helpers.cjs +179 -0
- package/dist/cjs/functions/text/text-helpers.cjs.map +10 -0
- package/dist/cjs/functions/text/textjoin/textjoin.cjs +173 -0
- package/dist/cjs/functions/text/textjoin/textjoin.cjs.map +10 -0
- package/dist/cjs/package.json +5 -0
- package/dist/cjs/parser/ast.cjs +175 -0
- package/dist/cjs/parser/ast.cjs.map +10 -0
- package/dist/cjs/parser/formatter.cjs +319 -0
- package/dist/cjs/parser/formatter.cjs.map +10 -0
- package/dist/cjs/parser/grammar.cjs +375 -0
- package/dist/cjs/parser/grammar.cjs.map +10 -0
- package/dist/cjs/parser/lexer.cjs +443 -0
- package/dist/cjs/parser/lexer.cjs.map +10 -0
- package/dist/cjs/parser/parser.cjs +1700 -0
- package/dist/cjs/parser/parser.cjs.map +10 -0
- package/dist/cjs/react/hooks.cjs +59 -0
- package/dist/cjs/react/hooks.cjs.map +10 -0
- package/dist/mjs/core/ast-traverser.mjs +94 -0
- package/dist/mjs/core/ast-traverser.mjs.map +10 -0
- package/dist/mjs/core/autofill-utils.mjs +274 -0
- package/dist/mjs/core/autofill-utils.mjs.map +10 -0
- package/dist/mjs/core/engine.mjs +366 -0
- package/dist/mjs/core/engine.mjs.map +10 -0
- package/dist/mjs/core/managers/cache-manager.mjs +27 -0
- package/dist/mjs/core/managers/cache-manager.mjs.map +10 -0
- package/dist/mjs/core/managers/dependency-manager.mjs +593 -0
- package/dist/mjs/core/managers/dependency-manager.mjs.map +10 -0
- package/dist/mjs/core/managers/dependency-node.mjs +2 -0
- package/dist/mjs/core/managers/dependency-node.mjs.map +9 -0
- package/dist/mjs/core/managers/evaluation-manager.mjs +415 -0
- package/dist/mjs/core/managers/evaluation-manager.mjs.map +10 -0
- package/dist/mjs/core/managers/event-manager.mjs +18 -0
- package/dist/mjs/core/managers/event-manager.mjs.map +10 -0
- package/dist/mjs/core/managers/frontier-dependency-manager.mjs +151 -0
- package/dist/mjs/core/managers/frontier-dependency-manager.mjs.map +10 -0
- package/dist/mjs/core/managers/index.mjs +21 -0
- package/dist/mjs/core/managers/index.mjs.map +10 -0
- package/dist/mjs/core/managers/isDependencyNode.mjs +14 -0
- package/dist/mjs/core/managers/isDependencyNode.mjs.map +10 -0
- package/dist/mjs/core/managers/named-expression-manager.mjs +348 -0
- package/dist/mjs/core/managers/named-expression-manager.mjs.map +10 -0
- package/dist/mjs/core/managers/range-eval-order-builder.mjs +618 -0
- package/dist/mjs/core/managers/range-eval-order-builder.mjs.map +10 -0
- package/dist/mjs/core/managers/table-manager.mjs +224 -0
- package/dist/mjs/core/managers/table-manager.mjs.map +10 -0
- package/dist/mjs/core/managers/workbook-manager.mjs +447 -0
- package/dist/mjs/core/managers/workbook-manager.mjs.map +10 -0
- package/dist/mjs/core/map-serializer.mjs +39 -0
- package/dist/mjs/core/map-serializer.mjs.map +10 -0
- package/dist/mjs/core/named-expression-renamer.mjs +58 -0
- package/dist/mjs/core/named-expression-renamer.mjs.map +10 -0
- package/dist/mjs/core/sheet-renamer.mjs +59 -0
- package/dist/mjs/core/sheet-renamer.mjs.map +10 -0
- package/dist/mjs/core/sheet-utils.mjs +8 -0
- package/dist/mjs/core/sheet-utils.mjs.map +10 -0
- package/dist/mjs/core/table-renamer.mjs +58 -0
- package/dist/mjs/core/table-renamer.mjs.map +10 -0
- package/dist/mjs/core/types.mjs +18 -0
- package/dist/mjs/core/types.mjs.map +10 -0
- package/dist/mjs/core/utils/range-serializer.mjs +35 -0
- package/dist/mjs/core/utils/range-serializer.mjs.map +10 -0
- package/dist/mjs/core/utils/spreadsheet-visualizer.mjs +112 -0
- package/dist/mjs/core/utils/spreadsheet-visualizer.mjs.map +10 -0
- package/dist/mjs/core/utils.mjs +409 -0
- package/dist/mjs/core/utils.mjs.map +10 -0
- package/dist/mjs/core/workbook-renamer.mjs +76 -0
- package/dist/mjs/core/workbook-renamer.mjs.map +10 -0
- package/dist/mjs/debug/flags.mjs +17 -0
- package/dist/mjs/debug/flags.mjs.map +10 -0
- package/dist/mjs/evaluator/arithmetic/add/add.mjs +52 -0
- package/dist/mjs/evaluator/arithmetic/add/add.mjs.map +10 -0
- package/dist/mjs/evaluator/arithmetic/divide/divide.mjs +77 -0
- package/dist/mjs/evaluator/arithmetic/divide/divide.mjs.map +10 -0
- package/dist/mjs/evaluator/arithmetic/multiply/multiply.mjs +63 -0
- package/dist/mjs/evaluator/arithmetic/multiply/multiply.mjs.map +10 -0
- package/dist/mjs/evaluator/arithmetic/power/power.mjs +95 -0
- package/dist/mjs/evaluator/arithmetic/power/power.mjs.map +10 -0
- package/dist/mjs/evaluator/arithmetic/subtract/subtract.mjs +54 -0
- package/dist/mjs/evaluator/arithmetic/subtract/subtract.mjs.map +10 -0
- package/dist/mjs/evaluator/comparison/equals.mjs +34 -0
- package/dist/mjs/evaluator/comparison/equals.mjs.map +10 -0
- package/dist/mjs/evaluator/comparison/greater-than-or-equal.mjs +31 -0
- package/dist/mjs/evaluator/comparison/greater-than-or-equal.mjs.map +10 -0
- package/dist/mjs/evaluator/comparison/greater-than.mjs +31 -0
- package/dist/mjs/evaluator/comparison/greater-than.mjs.map +10 -0
- package/dist/mjs/evaluator/comparison/less-than-or-equal.mjs +39 -0
- package/dist/mjs/evaluator/comparison/less-than-or-equal.mjs.map +10 -0
- package/dist/mjs/evaluator/comparison/less-than.mjs +38 -0
- package/dist/mjs/evaluator/comparison/less-than.mjs.map +10 -0
- package/dist/mjs/evaluator/comparison/not-equals.mjs +23 -0
- package/dist/mjs/evaluator/comparison/not-equals.mjs.map +10 -0
- package/dist/mjs/evaluator/concatenation/concatenate.mjs +42 -0
- package/dist/mjs/evaluator/concatenation/concatenate.mjs.map +10 -0
- package/dist/mjs/evaluator/dependency-nodes/ast-evaluation-node.mjs +28 -0
- package/dist/mjs/evaluator/dependency-nodes/ast-evaluation-node.mjs.map +10 -0
- package/dist/mjs/evaluator/dependency-nodes/base-eval-node.mjs +81 -0
- package/dist/mjs/evaluator/dependency-nodes/base-eval-node.mjs.map +10 -0
- package/dist/mjs/evaluator/dependency-nodes/cell-value-node.mjs +24 -0
- package/dist/mjs/evaluator/dependency-nodes/cell-value-node.mjs.map +10 -0
- package/dist/mjs/evaluator/dependency-nodes/empty-cell-evaluation-node.mjs +78 -0
- package/dist/mjs/evaluator/dependency-nodes/empty-cell-evaluation-node.mjs.map +10 -0
- package/dist/mjs/evaluator/dependency-nodes/spill-meta-node.mjs +20 -0
- package/dist/mjs/evaluator/dependency-nodes/spill-meta-node.mjs.map +10 -0
- package/dist/mjs/evaluator/evaluate-scalar-operator.mjs +226 -0
- package/dist/mjs/evaluator/evaluate-scalar-operator.mjs.map +10 -0
- package/dist/mjs/evaluator/evaluation-context.mjs +123 -0
- package/dist/mjs/evaluator/evaluation-context.mjs.map +10 -0
- package/dist/mjs/evaluator/evaluation-error.mjs +44 -0
- package/dist/mjs/evaluator/evaluation-error.mjs.map +10 -0
- package/dist/mjs/evaluator/formula-evaluator.mjs +780 -0
- package/dist/mjs/evaluator/formula-evaluator.mjs.map +10 -0
- package/dist/mjs/evaluator/range-evaluation-node.mjs +58 -0
- package/dist/mjs/evaluator/range-evaluation-node.mjs.map +10 -0
- package/dist/mjs/functions/_template/template.mjs +12 -0
- package/dist/mjs/functions/_template/template.mjs.map +10 -0
- package/dist/mjs/functions/array/sequence/sequence.mjs +287 -0
- package/dist/mjs/functions/array/sequence/sequence.mjs.map +10 -0
- package/dist/mjs/functions/criteria-parser.mjs +187 -0
- package/dist/mjs/functions/criteria-parser.mjs.map +10 -0
- package/dist/mjs/functions/criteria-utils.mjs +268 -0
- package/dist/mjs/functions/criteria-utils.mjs.map +10 -0
- package/dist/mjs/functions/function-utils.mjs +33 -0
- package/dist/mjs/functions/function-utils.mjs.map +10 -0
- package/dist/mjs/functions/index.mjs +95 -0
- package/dist/mjs/functions/index.mjs.map +10 -0
- package/dist/mjs/functions/information/cell/cell.mjs +168 -0
- package/dist/mjs/functions/information/cell/cell.mjs.map +10 -0
- package/dist/mjs/functions/information/column/column.mjs +120 -0
- package/dist/mjs/functions/information/column/column.mjs.map +10 -0
- package/dist/mjs/functions/information/row/row.mjs +126 -0
- package/dist/mjs/functions/information/row/row.mjs.map +10 -0
- package/dist/mjs/functions/logical/and/and.mjs +84 -0
- package/dist/mjs/functions/logical/and/and.mjs.map +10 -0
- package/dist/mjs/functions/logical/if/if.mjs +167 -0
- package/dist/mjs/functions/logical/if/if.mjs.map +10 -0
- package/dist/mjs/functions/logical/iferror/iferror.mjs +98 -0
- package/dist/mjs/functions/logical/iferror/iferror.mjs.map +10 -0
- package/dist/mjs/functions/logical/or/or.mjs +84 -0
- package/dist/mjs/functions/logical/or/or.mjs.map +10 -0
- package/dist/mjs/functions/lookup/count/count-utils.mjs +35 -0
- package/dist/mjs/functions/lookup/count/count-utils.mjs.map +10 -0
- package/dist/mjs/functions/lookup/count/count.mjs +18 -0
- package/dist/mjs/functions/lookup/count/count.mjs.map +10 -0
- package/dist/mjs/functions/lookup/count/countif.mjs +68 -0
- package/dist/mjs/functions/lookup/count/countif.mjs.map +10 -0
- package/dist/mjs/functions/lookup/count/countifs.mjs +37 -0
- package/dist/mjs/functions/lookup/count/countifs.mjs.map +10 -0
- package/dist/mjs/functions/lookup/index-lookup/index-lookup.mjs +159 -0
- package/dist/mjs/functions/lookup/index-lookup/index-lookup.mjs.map +10 -0
- package/dist/mjs/functions/lookup/match/match.mjs +140 -0
- package/dist/mjs/functions/lookup/match/match.mjs.map +10 -0
- package/dist/mjs/functions/lookup/xlookup/xlookup.mjs +382 -0
- package/dist/mjs/functions/lookup/xlookup/xlookup.mjs.map +10 -0
- package/dist/mjs/functions/math/average/average-utils.mjs +44 -0
- package/dist/mjs/functions/math/average/average-utils.mjs.map +10 -0
- package/dist/mjs/functions/math/average/average.mjs +18 -0
- package/dist/mjs/functions/math/average/average.mjs.map +10 -0
- package/dist/mjs/functions/math/average/averageif.mjs +58 -0
- package/dist/mjs/functions/math/average/averageif.mjs.map +10 -0
- package/dist/mjs/functions/math/average/averageifs.mjs +35 -0
- package/dist/mjs/functions/math/average/averageifs.mjs.map +10 -0
- package/dist/mjs/functions/math/ceiling/ceiling.mjs +191 -0
- package/dist/mjs/functions/math/ceiling/ceiling.mjs.map +10 -0
- package/dist/mjs/functions/math/max/max-utils.mjs +43 -0
- package/dist/mjs/functions/math/max/max-utils.mjs.map +10 -0
- package/dist/mjs/functions/math/max/max.mjs +18 -0
- package/dist/mjs/functions/math/max/max.mjs.map +10 -0
- package/dist/mjs/functions/math/max/maxif.mjs +58 -0
- package/dist/mjs/functions/math/max/maxif.mjs.map +10 -0
- package/dist/mjs/functions/math/max/maxifs.mjs +35 -0
- package/dist/mjs/functions/math/max/maxifs.mjs.map +10 -0
- package/dist/mjs/functions/math/min/min-utils.mjs +43 -0
- package/dist/mjs/functions/math/min/min-utils.mjs.map +10 -0
- package/dist/mjs/functions/math/min/min.mjs +18 -0
- package/dist/mjs/functions/math/min/min.mjs.map +10 -0
- package/dist/mjs/functions/math/min/minif.mjs +58 -0
- package/dist/mjs/functions/math/min/minif.mjs.map +10 -0
- package/dist/mjs/functions/math/min/minifs.mjs +35 -0
- package/dist/mjs/functions/math/min/minifs.mjs.map +10 -0
- package/dist/mjs/functions/math/sum/sum.mjs +18 -0
- package/dist/mjs/functions/math/sum/sum.mjs.map +10 -0
- package/dist/mjs/functions/math/sum/sumif.mjs +58 -0
- package/dist/mjs/functions/math/sum/sumif.mjs.map +10 -0
- package/dist/mjs/functions/math/sum/sumifs.mjs +34 -0
- package/dist/mjs/functions/math/sum/sumifs.mjs.map +10 -0
- package/dist/mjs/functions/math/sum/summation-utils.mjs +27 -0
- package/dist/mjs/functions/math/sum/summation-utils.mjs.map +10 -0
- package/dist/mjs/functions/reference/address/address.mjs +135 -0
- package/dist/mjs/functions/reference/address/address.mjs.map +10 -0
- package/dist/mjs/functions/reference/indirect/indirect.mjs +74 -0
- package/dist/mjs/functions/reference/indirect/indirect.mjs.map +10 -0
- package/dist/mjs/functions/reference/offset/offset.mjs +205 -0
- package/dist/mjs/functions/reference/offset/offset.mjs.map +10 -0
- package/dist/mjs/functions/text/concatenate/concatenate.mjs +139 -0
- package/dist/mjs/functions/text/concatenate/concatenate.mjs.map +10 -0
- package/dist/mjs/functions/text/exact/exact.mjs +143 -0
- package/dist/mjs/functions/text/exact/exact.mjs.map +10 -0
- package/dist/mjs/functions/text/find/find.mjs +369 -0
- package/dist/mjs/functions/text/find/find.mjs.map +10 -0
- package/dist/mjs/functions/text/left/left.mjs +81 -0
- package/dist/mjs/functions/text/left/left.mjs.map +10 -0
- package/dist/mjs/functions/text/len/len.mjs +91 -0
- package/dist/mjs/functions/text/len/len.mjs.map +10 -0
- package/dist/mjs/functions/text/mid/mid.mjs +75 -0
- package/dist/mjs/functions/text/mid/mid.mjs.map +10 -0
- package/dist/mjs/functions/text/right/right.mjs +143 -0
- package/dist/mjs/functions/text/right/right.mjs.map +10 -0
- package/dist/mjs/functions/text/text-helpers.mjs +151 -0
- package/dist/mjs/functions/text/text-helpers.mjs.map +10 -0
- package/dist/mjs/functions/text/textjoin/textjoin.mjs +145 -0
- package/dist/mjs/functions/text/textjoin/textjoin.mjs.map +10 -0
- package/dist/mjs/package.json +5 -0
- package/dist/mjs/parser/ast.mjs +145 -0
- package/dist/mjs/parser/ast.mjs.map +10 -0
- package/dist/mjs/parser/formatter.mjs +289 -0
- package/dist/mjs/parser/formatter.mjs.map +10 -0
- package/dist/mjs/parser/grammar.mjs +345 -0
- package/dist/mjs/parser/grammar.mjs.map +10 -0
- package/dist/mjs/parser/lexer.mjs +412 -0
- package/dist/mjs/parser/lexer.mjs.map +10 -0
- package/dist/mjs/parser/parser.mjs +1692 -0
- package/dist/mjs/parser/parser.mjs.map +10 -0
- package/dist/mjs/react/hooks.mjs +16 -0
- package/dist/mjs/react/hooks.mjs.map +10 -0
- package/dist/types/core/ast-traverser.d.ts +28 -0
- package/dist/types/core/autofill-utils.d.ts +32 -0
- package/dist/types/core/engine.d.ts +184 -0
- package/dist/types/core/managers/cache-manager.d.ts +14 -0
- package/dist/types/core/managers/dependency-manager.d.ts +147 -0
- package/dist/types/core/managers/dependency-node.d.ts +13 -0
- package/dist/types/core/managers/evaluation-manager.d.ts +30 -0
- package/dist/types/core/managers/event-manager.d.ts +8 -0
- package/dist/types/core/managers/frontier-dependency-manager.d.ts +69 -0
- package/dist/types/core/managers/index.d.ts +7 -0
- package/dist/types/core/managers/isDependencyNode.d.ts +2 -0
- package/dist/types/core/managers/named-expression-manager.d.ts +101 -0
- package/dist/types/core/managers/range-eval-order-builder.d.ts +33 -0
- package/dist/types/core/managers/table-manager.d.ts +84 -0
- package/dist/types/core/managers/workbook-manager.d.ts +136 -0
- package/dist/types/core/map-serializer.d.ts +4 -0
- package/dist/types/core/named-expression-renamer.d.ts +21 -0
- package/dist/types/core/sheet-renamer.d.ts +28 -0
- package/dist/types/core/sheet-utils.d.ts +2 -0
- package/dist/types/core/table-renamer.d.ts +21 -0
- package/dist/types/core/types.d.ts +272 -0
- package/dist/types/core/utils/cell-address-parsing.test.d.ts +1 -0
- package/dist/types/core/utils/range-serializer.d.ts +22 -0
- package/dist/types/core/utils/range-serializer.test.d.ts +1 -0
- package/dist/types/core/utils/spreadsheet-visualizer.d.ts +30 -0
- package/dist/types/core/utils.d.ts +48 -0
- package/dist/types/core/workbook-renamer.d.ts +28 -0
- package/dist/types/debug/flags.d.ts +11 -0
- package/dist/types/evaluator/arithmetic/add/add.d.ts +2 -0
- package/dist/types/evaluator/arithmetic/add/add.test.d.ts +1 -0
- package/dist/types/evaluator/arithmetic/divide/divide.d.ts +2 -0
- package/dist/types/evaluator/arithmetic/divide/divide.test.d.ts +1 -0
- package/dist/types/evaluator/arithmetic/multiply/multiply.d.ts +2 -0
- package/dist/types/evaluator/arithmetic/multiply/multiply.test.d.ts +1 -0
- package/dist/types/evaluator/arithmetic/power/power.d.ts +2 -0
- package/dist/types/evaluator/arithmetic/power/power.test.d.ts +1 -0
- package/dist/types/evaluator/arithmetic/subtract/subtract.d.ts +2 -0
- package/dist/types/evaluator/arithmetic/subtract/subtract.test.d.ts +1 -0
- package/dist/types/evaluator/comparison/comparison-operators.test.d.ts +1 -0
- package/dist/types/evaluator/comparison/equals.d.ts +6 -0
- package/dist/types/evaluator/comparison/greater-than-or-equal.d.ts +6 -0
- package/dist/types/evaluator/comparison/greater-than.d.ts +6 -0
- package/dist/types/evaluator/comparison/less-than-or-equal.d.ts +6 -0
- package/dist/types/evaluator/comparison/less-than.d.ts +6 -0
- package/dist/types/evaluator/comparison/not-equals.d.ts +6 -0
- package/dist/types/evaluator/concatenation/concatenate.d.ts +6 -0
- package/dist/types/evaluator/concatenation/concatenate.test.d.ts +1 -0
- package/dist/types/evaluator/dependency-nodes/ast-evaluation-node.d.ts +12 -0
- package/dist/types/evaluator/dependency-nodes/base-eval-node.d.ts +31 -0
- package/dist/types/evaluator/dependency-nodes/cell-value-node.d.ts +10 -0
- package/dist/types/evaluator/dependency-nodes/empty-cell-evaluation-node.d.ts +17 -0
- package/dist/types/evaluator/dependency-nodes/spill-meta-node.d.ts +7 -0
- package/dist/types/evaluator/evaluate-scalar-operator.d.ts +12 -0
- package/dist/types/evaluator/evaluation-context.d.ts +66 -0
- package/dist/types/evaluator/evaluation-error.d.ts +20 -0
- package/dist/types/evaluator/formula-evaluator.d.ts +67 -0
- package/dist/types/evaluator/open-range-evaluator.test.d.ts +1 -0
- package/dist/types/evaluator/range-evaluation-node.d.ts +16 -0
- package/dist/types/functions/_template/template.d.ts +5 -0
- package/dist/types/functions/_template/template.test.d.ts +1 -0
- package/dist/types/functions/array/sequence/performance-test.d.ts +1 -0
- package/dist/types/functions/array/sequence/sequence.d.ts +14 -0
- package/dist/types/functions/array/sequence/sequence.test.d.ts +1 -0
- package/dist/types/functions/criteria-parser.d.ts +27 -0
- package/dist/types/functions/criteria-utils.d.ts +61 -0
- package/dist/types/functions/function-utils.d.ts +21 -0
- package/dist/types/functions/index.d.ts +2 -0
- package/dist/types/functions/information/cell/cell.d.ts +24 -0
- package/dist/types/functions/information/cell/cell.test.d.ts +1 -0
- package/dist/types/functions/information/column/column.d.ts +14 -0
- package/dist/types/functions/information/column/column.test.d.ts +1 -0
- package/dist/types/functions/information/row/row.d.ts +14 -0
- package/dist/types/functions/information/row/row.test.d.ts +1 -0
- package/dist/types/functions/logical/and/and.d.ts +5 -0
- package/dist/types/functions/logical/and/and.test.d.ts +1 -0
- package/dist/types/functions/logical/if/if.d.ts +5 -0
- package/dist/types/functions/logical/if/if.test.d.ts +1 -0
- package/dist/types/functions/logical/iferror/iferror.d.ts +5 -0
- package/dist/types/functions/logical/iferror/iferror.test.d.ts +1 -0
- package/dist/types/functions/logical/or/or.d.ts +5 -0
- package/dist/types/functions/logical/or/or.test.d.ts +1 -0
- package/dist/types/functions/lookup/count/count-utils.d.ts +14 -0
- package/dist/types/functions/lookup/count/count.d.ts +21 -0
- package/dist/types/functions/lookup/count/count.test.d.ts +1 -0
- package/dist/types/functions/lookup/count/countif.d.ts +26 -0
- package/dist/types/functions/lookup/count/countif.test.d.ts +1 -0
- package/dist/types/functions/lookup/count/countifs.d.ts +21 -0
- package/dist/types/functions/lookup/count/countifs.test.d.ts +1 -0
- package/dist/types/functions/lookup/index-lookup/index-lookup.d.ts +2 -0
- package/dist/types/functions/lookup/index-lookup/index-lookup.test.d.ts +1 -0
- package/dist/types/functions/lookup/match/match.d.ts +2 -0
- package/dist/types/functions/lookup/match/match.test.d.ts +1 -0
- package/dist/types/functions/lookup/xlookup/xlookup.d.ts +2 -0
- package/dist/types/functions/lookup/xlookup/xlookup.test.d.ts +1 -0
- package/dist/types/functions/math/average/average-utils.d.ts +10 -0
- package/dist/types/functions/math/average/average.d.ts +18 -0
- package/dist/types/functions/math/average/average.test.d.ts +1 -0
- package/dist/types/functions/math/average/averageif.d.ts +23 -0
- package/dist/types/functions/math/average/averageif.test.d.ts +1 -0
- package/dist/types/functions/math/average/averageifs.d.ts +21 -0
- package/dist/types/functions/math/average/averageifs.test.d.ts +1 -0
- package/dist/types/functions/math/ceiling/ceiling.d.ts +5 -0
- package/dist/types/functions/math/ceiling/ceiling.test.d.ts +1 -0
- package/dist/types/functions/math/max/max-utils.d.ts +20 -0
- package/dist/types/functions/math/max/max.d.ts +18 -0
- package/dist/types/functions/math/max/max.test.d.ts +1 -0
- package/dist/types/functions/math/max/maxif.d.ts +23 -0
- package/dist/types/functions/math/max/maxif.test.d.ts +1 -0
- package/dist/types/functions/math/max/maxifs.d.ts +21 -0
- package/dist/types/functions/math/max/maxifs.test.d.ts +1 -0
- package/dist/types/functions/math/min/min-utils.d.ts +20 -0
- package/dist/types/functions/math/min/min.d.ts +5 -0
- package/dist/types/functions/math/min/min.test.d.ts +1 -0
- package/dist/types/functions/math/min/minif.d.ts +23 -0
- package/dist/types/functions/math/min/minif.test.d.ts +1 -0
- package/dist/types/functions/math/min/minifs.d.ts +21 -0
- package/dist/types/functions/math/min/minifs.test.d.ts +1 -0
- package/dist/types/functions/math/sum/sum.d.ts +5 -0
- package/dist/types/functions/math/sum/sum.test.d.ts +1 -0
- package/dist/types/functions/math/sum/sumif.d.ts +23 -0
- package/dist/types/functions/math/sum/sumif.test.d.ts +1 -0
- package/dist/types/functions/math/sum/sumifs.d.ts +21 -0
- package/dist/types/functions/math/sum/sumifs.test.d.ts +1 -0
- package/dist/types/functions/math/sum/summation-utils.d.ts +19 -0
- package/dist/types/functions/reference/address/address.d.ts +18 -0
- package/dist/types/functions/reference/address/address.test.d.ts +1 -0
- package/dist/types/functions/reference/indirect/indirect.d.ts +20 -0
- package/dist/types/functions/reference/indirect/indirect.test.d.ts +1 -0
- package/dist/types/functions/reference/offset/offset.d.ts +23 -0
- package/dist/types/functions/reference/offset/offset.test.d.ts +1 -0
- package/dist/types/functions/text/concatenate/concatenate.d.ts +5 -0
- package/dist/types/functions/text/concatenate/concatenate.test.d.ts +1 -0
- package/dist/types/functions/text/exact/exact.d.ts +5 -0
- package/dist/types/functions/text/exact/exact.test.d.ts +1 -0
- package/dist/types/functions/text/find/find.d.ts +20 -0
- package/dist/types/functions/text/find/find.test.d.ts +1 -0
- package/dist/types/functions/text/left/left.d.ts +19 -0
- package/dist/types/functions/text/left/left.test.d.ts +1 -0
- package/dist/types/functions/text/len/len.d.ts +16 -0
- package/dist/types/functions/text/len/len.test.d.ts +1 -0
- package/dist/types/functions/text/mid/mid.d.ts +20 -0
- package/dist/types/functions/text/mid/mid.test.d.ts +1 -0
- package/dist/types/functions/text/right/right.d.ts +2 -0
- package/dist/types/functions/text/right/right.test.d.ts +1 -0
- package/dist/types/functions/text/text-helpers.d.ts +27 -0
- package/dist/types/functions/text/textjoin/textjoin.d.ts +5 -0
- package/dist/types/functions/text/textjoin/textjoin.test.d.ts +1 -0
- package/dist/types/parser/ast.d.ts +275 -0
- package/dist/types/parser/formatter.d.ts +6 -0
- package/dist/types/parser/grammar.d.ts +203 -0
- package/dist/types/parser/lexer.d.ts +144 -0
- package/dist/types/parser/parser.d.ts +159 -0
- package/dist/types/react/hooks.d.ts +5 -0
- package/package.json +41 -0
|
@@ -0,0 +1,443 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __moduleCache = /* @__PURE__ */ new WeakMap;
|
|
6
|
+
var __toCommonJS = (from) => {
|
|
7
|
+
var entry = __moduleCache.get(from), desc;
|
|
8
|
+
if (entry)
|
|
9
|
+
return entry;
|
|
10
|
+
entry = __defProp({}, "__esModule", { value: true });
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function")
|
|
12
|
+
__getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
|
|
13
|
+
get: () => from[key],
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
}));
|
|
16
|
+
__moduleCache.set(from, entry);
|
|
17
|
+
return entry;
|
|
18
|
+
};
|
|
19
|
+
var __export = (target, all) => {
|
|
20
|
+
for (var name in all)
|
|
21
|
+
__defProp(target, name, {
|
|
22
|
+
get: all[name],
|
|
23
|
+
enumerable: true,
|
|
24
|
+
configurable: true,
|
|
25
|
+
set: (newValue) => all[name] = () => newValue
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// src/parser/lexer.ts
|
|
30
|
+
var exports_lexer = {};
|
|
31
|
+
__export(exports_lexer, {
|
|
32
|
+
tokenize: () => tokenize,
|
|
33
|
+
TokenStream: () => TokenStream,
|
|
34
|
+
Lexer: () => Lexer
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(exports_lexer);
|
|
37
|
+
|
|
38
|
+
class Lexer {
|
|
39
|
+
input;
|
|
40
|
+
position;
|
|
41
|
+
tokens;
|
|
42
|
+
constructor(input) {
|
|
43
|
+
this.input = input;
|
|
44
|
+
this.position = 0;
|
|
45
|
+
this.tokens = [];
|
|
46
|
+
}
|
|
47
|
+
tokenize() {
|
|
48
|
+
this.tokens = [];
|
|
49
|
+
this.position = 0;
|
|
50
|
+
while (this.position < this.input.length) {
|
|
51
|
+
const token = this.nextToken();
|
|
52
|
+
if (token && token.type !== "WHITESPACE") {
|
|
53
|
+
this.tokens.push(token);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
this.tokens.push({
|
|
57
|
+
type: "EOF",
|
|
58
|
+
value: "",
|
|
59
|
+
position: { start: this.position, end: this.position }
|
|
60
|
+
});
|
|
61
|
+
return this.tokens;
|
|
62
|
+
}
|
|
63
|
+
nextToken() {
|
|
64
|
+
const start = this.position;
|
|
65
|
+
const char = this.input[this.position];
|
|
66
|
+
if (char === undefined) {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
if (this.isWhitespace()) {
|
|
70
|
+
return this.readWhitespace();
|
|
71
|
+
}
|
|
72
|
+
switch (char) {
|
|
73
|
+
case "(":
|
|
74
|
+
this.position++;
|
|
75
|
+
return { type: "LPAREN", value: char, position: { start, end: this.position } };
|
|
76
|
+
case ")":
|
|
77
|
+
this.position++;
|
|
78
|
+
return { type: "RPAREN", value: char, position: { start, end: this.position } };
|
|
79
|
+
case "{":
|
|
80
|
+
this.position++;
|
|
81
|
+
return { type: "LBRACE", value: char, position: { start, end: this.position } };
|
|
82
|
+
case "}":
|
|
83
|
+
this.position++;
|
|
84
|
+
return { type: "RBRACE", value: char, position: { start, end: this.position } };
|
|
85
|
+
case "[":
|
|
86
|
+
this.position++;
|
|
87
|
+
return { type: "LBRACKET", value: char, position: { start, end: this.position } };
|
|
88
|
+
case "]":
|
|
89
|
+
this.position++;
|
|
90
|
+
return { type: "RBRACKET", value: char, position: { start, end: this.position } };
|
|
91
|
+
case ",":
|
|
92
|
+
this.position++;
|
|
93
|
+
return { type: "COMMA", value: char, position: { start, end: this.position } };
|
|
94
|
+
case ";":
|
|
95
|
+
this.position++;
|
|
96
|
+
return { type: "SEMICOLON", value: char, position: { start, end: this.position } };
|
|
97
|
+
case ":":
|
|
98
|
+
this.position++;
|
|
99
|
+
return { type: "COLON", value: char, position: { start, end: this.position } };
|
|
100
|
+
case "$":
|
|
101
|
+
this.position++;
|
|
102
|
+
return { type: "DOLLAR", value: char, position: { start, end: this.position } };
|
|
103
|
+
case "!":
|
|
104
|
+
this.position++;
|
|
105
|
+
return { type: "EXCLAMATION", value: char, position: { start, end: this.position } };
|
|
106
|
+
case "@":
|
|
107
|
+
this.position++;
|
|
108
|
+
return { type: "AT", value: char, position: { start, end: this.position } };
|
|
109
|
+
case '"':
|
|
110
|
+
return this.readString();
|
|
111
|
+
case "'":
|
|
112
|
+
return this.readSheetName();
|
|
113
|
+
case "#":
|
|
114
|
+
if (this.position + 1 < this.input.length) {
|
|
115
|
+
const nextChar = this.input[this.position + 1];
|
|
116
|
+
if (nextChar && this.isAlpha(nextChar)) {
|
|
117
|
+
const lookahead = this.peekSelector();
|
|
118
|
+
if (lookahead) {
|
|
119
|
+
this.position++;
|
|
120
|
+
return { type: "HASH", value: char, position: { start, end: this.position } };
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return this.readError();
|
|
125
|
+
case "+":
|
|
126
|
+
case "-":
|
|
127
|
+
this.position++;
|
|
128
|
+
return { type: "OPERATOR", value: char, position: { start, end: this.position } };
|
|
129
|
+
case "*":
|
|
130
|
+
case "/":
|
|
131
|
+
case "^":
|
|
132
|
+
case "&":
|
|
133
|
+
case "%":
|
|
134
|
+
this.position++;
|
|
135
|
+
return { type: "OPERATOR", value: char, position: { start, end: this.position } };
|
|
136
|
+
case "=":
|
|
137
|
+
this.position++;
|
|
138
|
+
return { type: "OPERATOR", value: char, position: { start, end: this.position } };
|
|
139
|
+
case "<":
|
|
140
|
+
if (this.position + 1 < this.input.length && this.input[this.position + 1] === ">") {
|
|
141
|
+
this.position += 2;
|
|
142
|
+
return { type: "OPERATOR", value: "<>", position: { start, end: this.position } };
|
|
143
|
+
}
|
|
144
|
+
if (this.position + 1 < this.input.length && this.input[this.position + 1] === "=") {
|
|
145
|
+
this.position += 2;
|
|
146
|
+
return { type: "OPERATOR", value: "<=", position: { start, end: this.position } };
|
|
147
|
+
}
|
|
148
|
+
this.position++;
|
|
149
|
+
return { type: "OPERATOR", value: char, position: { start, end: this.position } };
|
|
150
|
+
case ">":
|
|
151
|
+
if (this.position + 1 < this.input.length && this.input[this.position + 1] === "=") {
|
|
152
|
+
this.position += 2;
|
|
153
|
+
return { type: "OPERATOR", value: ">=", position: { start, end: this.position } };
|
|
154
|
+
}
|
|
155
|
+
this.position++;
|
|
156
|
+
return { type: "OPERATOR", value: char, position: { start, end: this.position } };
|
|
157
|
+
}
|
|
158
|
+
if (char && this.isDigit(char)) {
|
|
159
|
+
return this.readNumber();
|
|
160
|
+
}
|
|
161
|
+
if (char === ".") {
|
|
162
|
+
const nextChar = this.input[this.position + 1];
|
|
163
|
+
if (this.position + 1 < this.input.length && nextChar !== undefined && this.isDigit(nextChar)) {
|
|
164
|
+
return this.readNumber();
|
|
165
|
+
}
|
|
166
|
+
this.position++;
|
|
167
|
+
return { type: "ERROR", value: char, position: { start, end: this.position } };
|
|
168
|
+
}
|
|
169
|
+
if (char && (this.isAlpha(char) || char === "_" || this.isIdentifierChar(char))) {
|
|
170
|
+
return this.readIdentifier();
|
|
171
|
+
}
|
|
172
|
+
this.position++;
|
|
173
|
+
return { type: "ERROR", value: char, position: { start, end: this.position } };
|
|
174
|
+
}
|
|
175
|
+
readWhitespace() {
|
|
176
|
+
const start = this.position;
|
|
177
|
+
while (this.position < this.input.length && this.isWhitespace()) {
|
|
178
|
+
this.position++;
|
|
179
|
+
}
|
|
180
|
+
return {
|
|
181
|
+
type: "WHITESPACE",
|
|
182
|
+
value: this.input.substring(start, this.position),
|
|
183
|
+
position: { start, end: this.position }
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
readNumber() {
|
|
187
|
+
const start = this.position;
|
|
188
|
+
let hasDecimal = false;
|
|
189
|
+
let hasExponent = false;
|
|
190
|
+
let currentChar = this.input[this.position];
|
|
191
|
+
if (currentChar === "+" || currentChar === "-") {
|
|
192
|
+
this.position++;
|
|
193
|
+
}
|
|
194
|
+
while (this.position < this.input.length) {
|
|
195
|
+
currentChar = this.input[this.position];
|
|
196
|
+
if (currentChar && this.isDigit(currentChar)) {
|
|
197
|
+
this.position++;
|
|
198
|
+
} else {
|
|
199
|
+
break;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
if (this.position < this.input.length) {
|
|
203
|
+
currentChar = this.input[this.position];
|
|
204
|
+
if (currentChar === ".") {
|
|
205
|
+
hasDecimal = true;
|
|
206
|
+
this.position++;
|
|
207
|
+
while (this.position < this.input.length) {
|
|
208
|
+
currentChar = this.input[this.position];
|
|
209
|
+
if (currentChar && this.isDigit(currentChar)) {
|
|
210
|
+
this.position++;
|
|
211
|
+
} else {
|
|
212
|
+
break;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
if (this.position < this.input.length) {
|
|
218
|
+
currentChar = this.input[this.position];
|
|
219
|
+
if (currentChar === "E" || currentChar === "e") {
|
|
220
|
+
hasExponent = true;
|
|
221
|
+
this.position++;
|
|
222
|
+
if (this.position < this.input.length) {
|
|
223
|
+
currentChar = this.input[this.position];
|
|
224
|
+
if (currentChar === "+" || currentChar === "-") {
|
|
225
|
+
this.position++;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
while (this.position < this.input.length) {
|
|
229
|
+
currentChar = this.input[this.position];
|
|
230
|
+
if (currentChar && this.isDigit(currentChar)) {
|
|
231
|
+
this.position++;
|
|
232
|
+
} else {
|
|
233
|
+
break;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
const value = this.input.substring(start, this.position);
|
|
239
|
+
return { type: "NUMBER", value, position: { start, end: this.position } };
|
|
240
|
+
}
|
|
241
|
+
readString() {
|
|
242
|
+
const start = this.position;
|
|
243
|
+
this.position++;
|
|
244
|
+
let value = "";
|
|
245
|
+
while (this.position < this.input.length) {
|
|
246
|
+
const char = this.input[this.position];
|
|
247
|
+
if (char === '"') {
|
|
248
|
+
if (this.position + 1 < this.input.length && this.input[this.position + 1] === '"') {
|
|
249
|
+
value += '"';
|
|
250
|
+
this.position += 2;
|
|
251
|
+
} else {
|
|
252
|
+
this.position++;
|
|
253
|
+
break;
|
|
254
|
+
}
|
|
255
|
+
} else {
|
|
256
|
+
value += char;
|
|
257
|
+
this.position++;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
return { type: "STRING", value, position: { start, end: this.position } };
|
|
261
|
+
}
|
|
262
|
+
readSheetName() {
|
|
263
|
+
const start = this.position;
|
|
264
|
+
this.position++;
|
|
265
|
+
let value = "'";
|
|
266
|
+
while (this.position < this.input.length) {
|
|
267
|
+
const char = this.input[this.position];
|
|
268
|
+
if (char === "'") {
|
|
269
|
+
if (this.position + 1 < this.input.length && this.input[this.position + 1] === "'") {
|
|
270
|
+
value += "''";
|
|
271
|
+
this.position += 2;
|
|
272
|
+
} else {
|
|
273
|
+
value += char;
|
|
274
|
+
this.position++;
|
|
275
|
+
break;
|
|
276
|
+
}
|
|
277
|
+
} else {
|
|
278
|
+
value += char;
|
|
279
|
+
this.position++;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
return { type: "IDENTIFIER", value, position: { start, end: this.position } };
|
|
283
|
+
}
|
|
284
|
+
readError() {
|
|
285
|
+
const start = this.position;
|
|
286
|
+
this.position++;
|
|
287
|
+
while (this.position < this.input.length) {
|
|
288
|
+
const char = this.input[this.position];
|
|
289
|
+
if (char && (this.isAlnum(char) || char === "/" || char === "!" || char === "?")) {
|
|
290
|
+
this.position++;
|
|
291
|
+
} else {
|
|
292
|
+
break;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
const value = this.input.substring(start, this.position);
|
|
296
|
+
return { type: "ERROR", value, position: { start, end: this.position } };
|
|
297
|
+
}
|
|
298
|
+
readIdentifier() {
|
|
299
|
+
const start = this.position;
|
|
300
|
+
while (this.position < this.input.length) {
|
|
301
|
+
const char = this.input[this.position];
|
|
302
|
+
if (char && (this.isAlnum(char) || char === "_" || char === "." || this.isIdentifierChar(char))) {
|
|
303
|
+
this.position++;
|
|
304
|
+
} else {
|
|
305
|
+
break;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
const value = this.input.substring(start, this.position);
|
|
309
|
+
let lookahead = this.position;
|
|
310
|
+
while (lookahead < this.input.length) {
|
|
311
|
+
const lookChar = this.input[lookahead];
|
|
312
|
+
if (lookChar && this.isWhitespaceChar(lookChar)) {
|
|
313
|
+
lookahead++;
|
|
314
|
+
} else {
|
|
315
|
+
break;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
if (lookahead < this.input.length) {
|
|
319
|
+
const lookChar = this.input[lookahead];
|
|
320
|
+
if (lookChar === "(") {
|
|
321
|
+
return { type: "FUNCTION", value: value.toUpperCase(), position: { start, end: this.position } };
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
if (value.toUpperCase() === "TRUE" || value.toUpperCase() === "FALSE") {
|
|
325
|
+
return { type: "BOOLEAN", value: value.toUpperCase(), position: { start, end: this.position } };
|
|
326
|
+
}
|
|
327
|
+
if (value.toUpperCase() === "INFINITY") {
|
|
328
|
+
return { type: "INFINITY", value: value.toUpperCase(), position: { start, end: this.position } };
|
|
329
|
+
}
|
|
330
|
+
return { type: "IDENTIFIER", value, position: { start, end: this.position } };
|
|
331
|
+
}
|
|
332
|
+
isWhitespace() {
|
|
333
|
+
const char = this.input[this.position];
|
|
334
|
+
return this.position < this.input.length && char !== undefined && this.isWhitespaceChar(char);
|
|
335
|
+
}
|
|
336
|
+
isWhitespaceChar(char) {
|
|
337
|
+
return char === " " || char === "\t" || char === `
|
|
338
|
+
` || char === "\r";
|
|
339
|
+
}
|
|
340
|
+
isDigit(char) {
|
|
341
|
+
return char >= "0" && char <= "9";
|
|
342
|
+
}
|
|
343
|
+
isAlpha(char) {
|
|
344
|
+
if (char >= "A" && char <= "Z" || char >= "a" && char <= "z") {
|
|
345
|
+
return true;
|
|
346
|
+
}
|
|
347
|
+
return /\p{L}/u.test(char);
|
|
348
|
+
}
|
|
349
|
+
isAlnum(char) {
|
|
350
|
+
return this.isAlpha(char) || this.isDigit(char);
|
|
351
|
+
}
|
|
352
|
+
isIdentifierChar(char) {
|
|
353
|
+
const code = char.charCodeAt(0);
|
|
354
|
+
if (code === 181)
|
|
355
|
+
return true;
|
|
356
|
+
if (code === 176)
|
|
357
|
+
return true;
|
|
358
|
+
if (/\p{Sc}/u.test(char) && char !== "$")
|
|
359
|
+
return true;
|
|
360
|
+
if (code > 127 && /\p{L}/u.test(char))
|
|
361
|
+
return true;
|
|
362
|
+
return false;
|
|
363
|
+
}
|
|
364
|
+
peekSelector() {
|
|
365
|
+
const selectors = ["All", "Data", "Headers", "ThisRow"];
|
|
366
|
+
const currentPos = this.position + 1;
|
|
367
|
+
for (const selector of selectors) {
|
|
368
|
+
if (this.input.substring(currentPos, currentPos + selector.length).toUpperCase() === selector.toUpperCase()) {
|
|
369
|
+
const nextPos = currentPos + selector.length;
|
|
370
|
+
if (nextPos >= this.input.length || !this.isAlnum(this.input[nextPos])) {
|
|
371
|
+
return true;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
return false;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
function tokenize(input) {
|
|
379
|
+
const lexer = new Lexer(input);
|
|
380
|
+
return lexer.tokenize();
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
class TokenStream {
|
|
384
|
+
tokens;
|
|
385
|
+
position;
|
|
386
|
+
constructor(tokens) {
|
|
387
|
+
this.tokens = tokens;
|
|
388
|
+
this.position = 0;
|
|
389
|
+
}
|
|
390
|
+
peek() {
|
|
391
|
+
if (this.position >= this.tokens.length || this.tokens.length === 0) {
|
|
392
|
+
return { type: "EOF", value: "", position: { start: 0, end: 0 } };
|
|
393
|
+
}
|
|
394
|
+
return this.tokens[this.position];
|
|
395
|
+
}
|
|
396
|
+
peekAhead(n) {
|
|
397
|
+
const pos = this.position + n;
|
|
398
|
+
if (pos >= this.tokens.length || pos < 0) {
|
|
399
|
+
return null;
|
|
400
|
+
}
|
|
401
|
+
return this.tokens[pos] ?? null;
|
|
402
|
+
}
|
|
403
|
+
peekNext() {
|
|
404
|
+
const pos = this.position + 1;
|
|
405
|
+
if (pos >= this.tokens.length) {
|
|
406
|
+
return null;
|
|
407
|
+
}
|
|
408
|
+
return this.tokens[pos] ?? null;
|
|
409
|
+
}
|
|
410
|
+
consume() {
|
|
411
|
+
const token = this.peek();
|
|
412
|
+
if (this.position < this.tokens.length - 1) {
|
|
413
|
+
this.position++;
|
|
414
|
+
}
|
|
415
|
+
return token;
|
|
416
|
+
}
|
|
417
|
+
match(type) {
|
|
418
|
+
return this.peek().type === type;
|
|
419
|
+
}
|
|
420
|
+
matchValue(value) {
|
|
421
|
+
return this.peek().value === value;
|
|
422
|
+
}
|
|
423
|
+
consumeIf(type) {
|
|
424
|
+
if (this.match(type)) {
|
|
425
|
+
return this.consume();
|
|
426
|
+
}
|
|
427
|
+
return null;
|
|
428
|
+
}
|
|
429
|
+
isAtEnd() {
|
|
430
|
+
return this.peek().type === "EOF";
|
|
431
|
+
}
|
|
432
|
+
getPosition() {
|
|
433
|
+
return this.position;
|
|
434
|
+
}
|
|
435
|
+
setPosition(position) {
|
|
436
|
+
this.position = Math.max(0, Math.min(position, this.tokens.length - 1));
|
|
437
|
+
}
|
|
438
|
+
getTokens() {
|
|
439
|
+
return this.tokens;
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
//# debugId=7D8B3D76E666735964756E2164756E21
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/parser/lexer.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"/**\n * Lexer for tokenizing formula strings\n */\n\nimport type { FormulaError } from '../core/types.cjs';\n\n/**\n * Token types for formula lexing\n */\nexport type TokenType =\n | 'NUMBER'\n | 'STRING'\n | 'BOOLEAN'\n | 'IDENTIFIER'\n | 'FUNCTION'\n | 'OPERATOR'\n | 'LPAREN'\n | 'RPAREN'\n | 'LBRACE'\n | 'RBRACE'\n | 'LBRACKET'\n | 'RBRACKET'\n | 'COMMA'\n | 'SEMICOLON'\n | 'COLON'\n | 'DOLLAR'\n | 'EXCLAMATION'\n | 'AT'\n | 'HASH'\n | 'INFINITY'\n | 'ERROR'\n | 'EOF'\n | 'WHITESPACE';\n\n/**\n * Token interface\n */\nexport interface Token {\n type: TokenType;\n value: string;\n position: {\n start: number;\n end: number;\n };\n}\n\n/**\n * Lexer class for tokenizing formula strings\n */\nexport class Lexer {\n private input: string;\n private position: number;\n private tokens: Token[];\n \n constructor(input: string) {\n this.input = input;\n this.position = 0;\n this.tokens = [];\n }\n \n /**\n * Tokenize the entire input string\n */\n tokenize(): Token[] {\n this.tokens = [];\n this.position = 0;\n \n while (this.position < this.input.length) {\n const token = this.nextToken();\n if (token && token.type !== 'WHITESPACE') {\n this.tokens.push(token);\n }\n }\n \n // Add EOF token\n this.tokens.push({\n type: 'EOF',\n value: '',\n position: { start: this.position, end: this.position }\n });\n \n return this.tokens;\n }\n \n /**\n * Get the next token from the input\n */\n private nextToken(): Token | null {\n const start = this.position;\n \n // Check for single-character tokens\n const char = this.input[this.position];\n if (char === undefined) {\n return null;\n }\n \n // Skip whitespace\n if (this.isWhitespace()) {\n return this.readWhitespace();\n }\n \n switch (char) {\n case '(':\n this.position++;\n return { type: 'LPAREN', value: char, position: { start, end: this.position } };\n case ')':\n this.position++;\n return { type: 'RPAREN', value: char, position: { start, end: this.position } };\n case '{':\n this.position++;\n return { type: 'LBRACE', value: char, position: { start, end: this.position } };\n case '}':\n this.position++;\n return { type: 'RBRACE', value: char, position: { start, end: this.position } };\n case '[':\n this.position++;\n return { type: 'LBRACKET', value: char, position: { start, end: this.position } };\n case ']':\n this.position++;\n return { type: 'RBRACKET', value: char, position: { start, end: this.position } };\n case ',':\n this.position++;\n return { type: 'COMMA', value: char, position: { start, end: this.position } };\n case ';':\n this.position++;\n return { type: 'SEMICOLON', value: char, position: { start, end: this.position } };\n case ':':\n this.position++;\n return { type: 'COLON', value: char, position: { start, end: this.position } };\n case '$':\n this.position++;\n return { type: 'DOLLAR', value: char, position: { start, end: this.position } };\n case '!':\n this.position++;\n return { type: 'EXCLAMATION', value: char, position: { start, end: this.position } };\n case '@':\n this.position++;\n return { type: 'AT', value: char, position: { start, end: this.position } };\n case '\"':\n return this.readString();\n case \"'\":\n return this.readSheetName();\n case '#':\n // Check if it's a table selector or an error\n if (this.position + 1 < this.input.length) {\n const nextChar = this.input[this.position + 1];\n if (nextChar && this.isAlpha(nextChar)) {\n // Might be a table selector (#Headers, #Data, etc.) or error\n const lookahead = this.peekSelector();\n if (lookahead) {\n this.position++;\n return { type: 'HASH', value: char, position: { start, end: this.position } };\n }\n }\n }\n return this.readError();\n case '+':\n case '-':\n // Always treat as operator - parser will handle unary operators\n this.position++;\n return { type: 'OPERATOR', value: char, position: { start, end: this.position } };\n case '*':\n case '/':\n case '^':\n case '&':\n case '%':\n this.position++;\n return { type: 'OPERATOR', value: char, position: { start, end: this.position } };\n case '=':\n this.position++;\n return { type: 'OPERATOR', value: char, position: { start, end: this.position } };\n case '<':\n if (this.position + 1 < this.input.length && this.input[this.position + 1] === '>') {\n this.position += 2;\n return { type: 'OPERATOR', value: '<>', position: { start, end: this.position } };\n }\n if (this.position + 1 < this.input.length && this.input[this.position + 1] === '=') {\n this.position += 2;\n return { type: 'OPERATOR', value: '<=', position: { start, end: this.position } };\n }\n this.position++;\n return { type: 'OPERATOR', value: char, position: { start, end: this.position } };\n case '>':\n if (this.position + 1 < this.input.length && this.input[this.position + 1] === '=') {\n this.position += 2;\n return { type: 'OPERATOR', value: '>=', position: { start, end: this.position } };\n }\n this.position++;\n return { type: 'OPERATOR', value: char, position: { start, end: this.position } };\n }\n \n // Check for numbers\n if (char && this.isDigit(char)) {\n return this.readNumber();\n }\n \n // Check for decimal numbers starting with .\n if (char === '.') {\n const nextChar = this.input[this.position + 1];\n if (this.position + 1 < this.input.length && nextChar !== undefined && this.isDigit(nextChar)) {\n return this.readNumber();\n }\n // Otherwise it's an error\n this.position++;\n return { type: 'ERROR', value: char, position: { start, end: this.position } };\n }\n \n // Check for identifiers (cell references, function names, boolean values)\n if (char && (this.isAlpha(char) || char === '_' || this.isIdentifierChar(char))) {\n return this.readIdentifier();\n }\n \n // Unknown character\n this.position++;\n return { type: 'ERROR', value: char, position: { start, end: this.position } };\n }\n \n /**\n * Read a whitespace token\n */\n private readWhitespace(): Token {\n const start = this.position;\n while (this.position < this.input.length && this.isWhitespace()) {\n this.position++;\n }\n return {\n type: 'WHITESPACE',\n value: this.input.substring(start, this.position),\n position: { start, end: this.position }\n };\n }\n \n /**\n * Read a number token\n */\n private readNumber(): Token {\n const start = this.position;\n let hasDecimal = false;\n let hasExponent = false;\n \n // Check for sign\n let currentChar = this.input[this.position];\n if (currentChar === '+' || currentChar === '-') {\n this.position++;\n }\n \n // Read integer part\n while (this.position < this.input.length) {\n currentChar = this.input[this.position];\n if (currentChar && this.isDigit(currentChar)) {\n this.position++;\n } else {\n break;\n }\n }\n \n // Read decimal part\n if (this.position < this.input.length) {\n currentChar = this.input[this.position];\n if (currentChar === '.') {\n hasDecimal = true;\n this.position++;\n while (this.position < this.input.length) {\n currentChar = this.input[this.position];\n if (currentChar && this.isDigit(currentChar)) {\n this.position++;\n } else {\n break;\n }\n }\n }\n }\n \n // Read exponent part\n if (this.position < this.input.length) {\n currentChar = this.input[this.position];\n if (currentChar === 'E' || currentChar === 'e') {\n hasExponent = true;\n this.position++;\n \n // Optional sign\n if (this.position < this.input.length) {\n currentChar = this.input[this.position];\n if (currentChar === '+' || currentChar === '-') {\n this.position++;\n }\n }\n \n // Exponent digits\n while (this.position < this.input.length) {\n currentChar = this.input[this.position];\n if (currentChar && this.isDigit(currentChar)) {\n this.position++;\n } else {\n break;\n }\n }\n }\n }\n \n const value = this.input.substring(start, this.position);\n return { type: 'NUMBER', value, position: { start, end: this.position } };\n }\n \n /**\n * Read a string token (enclosed in double quotes)\n */\n private readString(): Token {\n const start = this.position;\n this.position++; // Skip opening quote\n \n let value = '';\n while (this.position < this.input.length) {\n const char = this.input[this.position];\n \n if (char === '\"') {\n // Check for escaped quote\n if (this.position + 1 < this.input.length && this.input[this.position + 1] === '\"') {\n value += '\"';\n this.position += 2;\n } else {\n // End of string\n this.position++;\n break;\n }\n } else {\n value += char;\n this.position++;\n }\n }\n \n return { type: 'STRING', value, position: { start, end: this.position } };\n }\n \n /**\n * Read a sheet name (enclosed in single quotes)\n */\n private readSheetName(): Token {\n const start = this.position;\n this.position++; // Skip opening quote\n \n let value = \"'\";\n while (this.position < this.input.length) {\n const char = this.input[this.position];\n \n if (char === \"'\") {\n // Check for escaped quote\n if (this.position + 1 < this.input.length && this.input[this.position + 1] === \"'\") {\n value += \"''\";\n this.position += 2;\n } else {\n // End of sheet name\n value += char;\n this.position++;\n break;\n }\n } else {\n value += char;\n this.position++;\n }\n }\n \n // This is actually part of an identifier (sheet reference)\n return { type: 'IDENTIFIER', value: value, position: { start, end: this.position } };\n }\n \n /**\n * Read an error token (e.g., #DIV/0!)\n */\n private readError(): Token {\n const start = this.position;\n this.position++; // Skip #\n \n // Read until we hit a non-alphanumeric character or special error characters\n while (this.position < this.input.length) {\n const char = this.input[this.position];\n if (char && (this.isAlnum(char) || char === '/' || char === '!' || char === '?')) {\n this.position++;\n } else {\n break;\n }\n }\n \n const value = this.input.substring(start, this.position);\n return { type: 'ERROR', value, position: { start, end: this.position } };\n }\n \n /**\n * Read an identifier (cell reference, function name, boolean)\n */\n private readIdentifier(): Token {\n const start = this.position;\n \n // Read identifier characters\n while (this.position < this.input.length) {\n const char = this.input[this.position];\n if (char && (this.isAlnum(char) || char === '_' || char === '.' || this.isIdentifierChar(char))) {\n this.position++;\n } else {\n break;\n }\n }\n \n const value = this.input.substring(start, this.position);\n \n // Check if it's followed by an opening parenthesis (function call)\n let lookahead = this.position;\n while (lookahead < this.input.length) {\n const lookChar = this.input[lookahead];\n if (lookChar && this.isWhitespaceChar(lookChar)) {\n lookahead++;\n } else {\n break;\n }\n }\n \n if (lookahead < this.input.length) {\n const lookChar = this.input[lookahead];\n if (lookChar === '(') {\n return { type: 'FUNCTION', value: value.toUpperCase(), position: { start, end: this.position } };\n }\n }\n \n // Check if it's a boolean (only if not a function)\n if (value.toUpperCase() === 'TRUE' || value.toUpperCase() === 'FALSE') {\n return { type: 'BOOLEAN', value: value.toUpperCase(), position: { start, end: this.position } };\n }\n \n // Check if it's INFINITY\n if (value.toUpperCase() === 'INFINITY') {\n return { type: 'INFINITY', value: value.toUpperCase(), position: { start, end: this.position } };\n }\n \n return { type: 'IDENTIFIER', value, position: { start, end: this.position } };\n }\n \n /**\n * Check if current position is whitespace\n */\n private isWhitespace(): boolean {\n const char = this.input[this.position];\n return this.position < this.input.length && char !== undefined && this.isWhitespaceChar(char);\n }\n \n /**\n * Check if a character is whitespace\n */\n private isWhitespaceChar(char: string): boolean {\n return char === ' ' || char === '\\t' || char === '\\n' || char === '\\r';\n }\n \n /**\n * Check if a character is a digit\n */\n private isDigit(char: string): boolean {\n return char >= '0' && char <= '9';\n }\n \n /**\n * Check if a character is alphabetic\n */\n private isAlpha(char: string): boolean {\n // Basic ASCII letters\n if ((char >= 'A' && char <= 'Z') || (char >= 'a' && char <= 'z')) {\n return true;\n }\n \n // Unicode letter categories using regex\n // This includes letters from all languages and special symbols like µ\n return /\\p{L}/u.test(char);\n }\n \n /**\n * Check if a character is alphanumeric\n */\n private isAlnum(char: string): boolean {\n return this.isAlpha(char) || this.isDigit(char);\n }\n \n /**\n * Check if a character can be part of an identifier\n * This includes letters, certain symbols that are commonly used in column names\n */\n private isIdentifierChar(char: string): boolean {\n // Check for specific Unicode symbols that are commonly used in column names\n // We need to be very selective to avoid breaking operator parsing\n // Include: µ (micro), ° (degree), currency symbols, Greek letters, and other common scientific symbols\n // Exclude: mathematical operators like +, -, =, <, >, etc.\n const code = char.charCodeAt(0);\n \n // µ (micro symbol)\n if (code === 0x00B5) return true;\n \n // ° (degree symbol)\n if (code === 0x00B0) return true;\n \n // Currency symbols (but not $ which is handled separately)\n if (/\\p{Sc}/u.test(char) && char !== '$') return true;\n \n // Greek letters and other letter-like symbols that aren't basic ASCII\n // This excludes mathematical operators\n if (code > 127 && /\\p{L}/u.test(char)) return true;\n \n return false;\n }\n \n /**\n * Peek ahead to check if we have a table selector\n */\n private peekSelector(): boolean {\n const selectors = ['All', 'Data', 'Headers', 'ThisRow'];\n const currentPos = this.position + 1; // Skip the #\n \n for (const selector of selectors) {\n if (this.input.substring(currentPos, currentPos + selector.length).toUpperCase() === selector.toUpperCase()) {\n // Check that the next character is not alphanumeric (to avoid matching #DataSomething)\n const nextPos = currentPos + selector.length;\n if (nextPos >= this.input.length || !this.isAlnum(this.input[nextPos]!)) {\n return true;\n }\n }\n }\n \n return false;\n }\n}\n\n/**\n * Quick tokenization function\n */\nexport function tokenize(input: string): Token[] {\n const lexer = new Lexer(input);\n return lexer.tokenize();\n}\n\n/**\n * Token stream for parser consumption\n */\nexport class TokenStream {\n private tokens: Token[];\n private position: number;\n \n constructor(tokens: Token[]) {\n this.tokens = tokens;\n this.position = 0;\n }\n \n /**\n * Peek at current token without consuming\n */\n peek(): Token {\n if (this.position >= this.tokens.length || this.tokens.length === 0) {\n // Return a default EOF token if no tokens\n return { type: 'EOF', value: '', position: { start: 0, end: 0 } };\n }\n return this.tokens[this.position]!;\n }\n \n /**\n * Peek ahead by n tokens\n */\n peekAhead(n: number): Token | null {\n const pos = this.position + n;\n if (pos >= this.tokens.length || pos < 0) {\n return null;\n }\n return this.tokens[pos] ?? null;\n }\n \n /**\n * Peek at the next token without consuming\n */\n peekNext(): Token | null {\n const pos = this.position + 1;\n if (pos >= this.tokens.length) {\n return null;\n }\n return this.tokens[pos] ?? null;\n }\n \n /**\n * Consume current token and advance\n */\n consume(): Token {\n const token = this.peek();\n if (this.position < this.tokens.length - 1) {\n this.position++;\n }\n return token;\n }\n \n /**\n * Check if current token matches type\n */\n match(type: TokenType): boolean {\n return this.peek().type === type;\n }\n \n /**\n * Check if current token matches value\n */\n matchValue(value: string): boolean {\n return this.peek().value === value;\n }\n \n /**\n * Consume token if it matches type\n */\n consumeIf(type: TokenType): Token | null {\n if (this.match(type)) {\n return this.consume();\n }\n return null;\n }\n \n /**\n * Check if at end of stream\n */\n isAtEnd(): boolean {\n return this.peek().type === 'EOF';\n }\n \n /**\n * Get current position in stream\n */\n getPosition(): number {\n return this.position;\n }\n \n /**\n * Set position in stream\n */\n setPosition(position: number): void {\n this.position = Math.max(0, Math.min(position, this.tokens.length - 1));\n }\n \n /**\n * Get all tokens\n */\n getTokens(): Token[] {\n return this.tokens;\n }\n}\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDO,MAAM,MAAM;AAAA,EACT;AAAA,EACA;AAAA,EACA;AAAA,EAER,WAAW,CAAC,OAAe;AAAA,IACzB,KAAK,QAAQ;AAAA,IACb,KAAK,WAAW;AAAA,IAChB,KAAK,SAAS,CAAC;AAAA;AAAA,EAMjB,QAAQ,GAAY;AAAA,IAClB,KAAK,SAAS,CAAC;AAAA,IACf,KAAK,WAAW;AAAA,IAEhB,OAAO,KAAK,WAAW,KAAK,MAAM,QAAQ;AAAA,MACxC,MAAM,QAAQ,KAAK,UAAU;AAAA,MAC7B,IAAI,SAAS,MAAM,SAAS,cAAc;AAAA,QACxC,KAAK,OAAO,KAAK,KAAK;AAAA,MACxB;AAAA,IACF;AAAA,IAGA,KAAK,OAAO,KAAK;AAAA,MACf,MAAM;AAAA,MACN,OAAO;AAAA,MACP,UAAU,EAAE,OAAO,KAAK,UAAU,KAAK,KAAK,SAAS;AAAA,IACvD,CAAC;AAAA,IAED,OAAO,KAAK;AAAA;AAAA,EAMN,SAAS,GAAiB;AAAA,IAChC,MAAM,QAAQ,KAAK;AAAA,IAGnB,MAAM,OAAO,KAAK,MAAM,KAAK;AAAA,IAC7B,IAAI,SAAS,WAAW;AAAA,MACtB,OAAO;AAAA,IACT;AAAA,IAGA,IAAI,KAAK,aAAa,GAAG;AAAA,MACvB,OAAO,KAAK,eAAe;AAAA,IAC7B;AAAA,IAEA,QAAQ;AAAA,WACD;AAAA,QACH,KAAK;AAAA,QACL,OAAO,EAAE,MAAM,UAAU,OAAO,MAAM,UAAU,EAAE,OAAO,KAAK,KAAK,SAAS,EAAE;AAAA,WAC3E;AAAA,QACH,KAAK;AAAA,QACL,OAAO,EAAE,MAAM,UAAU,OAAO,MAAM,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