@leankylin-sheet/formula-parser 3.1.30 → 3.1.32
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/dist/index.esm.js +82 -161
- package/dist/index.js +82 -161
- package/package.json +1 -1
- package/dist/packages/core/src/api/cell.d.ts +0 -10
- package/dist/packages/core/src/api/common.d.ts +0 -57
- package/dist/packages/core/src/api/errors.d.ts +0 -2
- package/dist/packages/core/src/api/index.d.ts +0 -9
- package/dist/packages/core/src/api/merge.d.ts +0 -5
- package/dist/packages/core/src/api/range.d.ts +0 -22
- package/dist/packages/core/src/api/rowcol.d.ts +0 -14
- package/dist/packages/core/src/api/sheet.d.ts +0 -10
- package/dist/packages/core/src/api/workbook.d.ts +0 -15
- package/dist/packages/core/src/canvas.d.ts +0 -56
- package/dist/packages/core/src/context.d.ts +0 -193
- package/dist/packages/core/src/events/copy.d.ts +0 -2
- package/dist/packages/core/src/events/index.d.ts +0 -4
- package/dist/packages/core/src/events/keyboard.d.ts +0 -6
- package/dist/packages/core/src/events/mouse.d.ts +0 -25
- package/dist/packages/core/src/events/paste.d.ts +0 -5
- package/dist/packages/core/src/index.d.ts +0 -10
- package/dist/packages/core/src/locale/en.d.ts +0 -1028
- package/dist/packages/core/src/locale/es.d.ts +0 -1132
- package/dist/packages/core/src/locale/index.d.ts +0 -1046
- package/dist/packages/core/src/locale/zh.d.ts +0 -1045
- package/dist/packages/core/src/locale/zh_tw.d.ts +0 -1185
- package/dist/packages/core/src/modules/ConditionFormat.d.ts +0 -17
- package/dist/packages/core/src/modules/border.d.ts +0 -3
- package/dist/packages/core/src/modules/cell.d.ts +0 -32
- package/dist/packages/core/src/modules/clipboard.d.ts +0 -3
- package/dist/packages/core/src/modules/color.d.ts +0 -1
- package/dist/packages/core/src/modules/comment.d.ts +0 -96
- package/dist/packages/core/src/modules/conditionalFormat.d.ts +0 -2
- package/dist/packages/core/src/modules/cursor.d.ts +0 -3
- package/dist/packages/core/src/modules/dataVerification.d.ts +0 -11
- package/dist/packages/core/src/modules/dropCell.d.ts +0 -10
- package/dist/packages/core/src/modules/filter.d.ts +0 -45
- package/dist/packages/core/src/modules/format.d.ts +0 -6
- package/dist/packages/core/src/modules/formula.d.ts +0 -53
- package/dist/packages/core/src/modules/freeze.d.ts +0 -5
- package/dist/packages/core/src/modules/hyperlink.d.ts +0 -21
- package/dist/packages/core/src/modules/image.d.ts +0 -31
- package/dist/packages/core/src/modules/index.d.ts +0 -35
- package/dist/packages/core/src/modules/inline-string.d.ts +0 -36
- package/dist/packages/core/src/modules/location.d.ts +0 -6
- package/dist/packages/core/src/modules/locationCondition.d.ts +0 -21
- package/dist/packages/core/src/modules/merge.d.ts +0 -3
- package/dist/packages/core/src/modules/mobile.d.ts +0 -5
- package/dist/packages/core/src/modules/moveCells.d.ts +0 -5
- package/dist/packages/core/src/modules/protection.d.ts +0 -5
- package/dist/packages/core/src/modules/refresh.d.ts +0 -3
- package/dist/packages/core/src/modules/rowcol.d.ts +0 -19
- package/dist/packages/core/src/modules/screenshot.d.ts +0 -2
- package/dist/packages/core/src/modules/searchReplace.d.ts +0 -36
- package/dist/packages/core/src/modules/selection.d.ts +0 -47
- package/dist/packages/core/src/modules/sheet.d.ts +0 -10
- package/dist/packages/core/src/modules/sort.d.ts +0 -7
- package/dist/packages/core/src/modules/splitColumn.d.ts +0 -5
- package/dist/packages/core/src/modules/ssf.d.ts +0 -2
- package/dist/packages/core/src/modules/text.d.ts +0 -10
- package/dist/packages/core/src/modules/toolbar.d.ts +0 -32
- package/dist/packages/core/src/modules/validation.d.ts +0 -19
- package/dist/packages/core/src/modules/zoom.d.ts +0 -3
- package/dist/packages/core/src/settings.d.ts +0 -132
- package/dist/packages/core/src/types.d.ts +0 -351
- package/dist/packages/core/src/utils/index.d.ts +0 -17
- package/dist/packages/core/src/utils/patch.d.ts +0 -37
- package/dist/packages/react/src/components/CellOptions/index.d.ts +0 -4
- package/dist/packages/react/src/components/ChangeColor/index.d.ts +0 -7
- package/dist/packages/react/src/components/ConditionFormat/ConditionRules.d.ts +0 -6
- package/dist/packages/react/src/components/ConditionFormat/index.d.ts +0 -7
- package/dist/packages/react/src/components/ContextMenu/Divider.d.ts +0 -3
- package/dist/packages/react/src/components/ContextMenu/FilterMenu.d.ts +0 -3
- package/dist/packages/react/src/components/ContextMenu/Menu.d.ts +0 -8
- package/dist/packages/react/src/components/ContextMenu/SheetTab.d.ts +0 -4
- package/dist/packages/react/src/components/ContextMenu/index.d.ts +0 -4
- package/dist/packages/react/src/components/CustomSort/index.d.ts +0 -4
- package/dist/packages/react/src/components/DataVerification/DropdownList.d.ts +0 -4
- package/dist/packages/react/src/components/DataVerification/RangeDialog.d.ts +0 -4
- package/dist/packages/react/src/components/DataVerification/index.d.ts +0 -4
- package/dist/packages/react/src/components/Dialog/index.d.ts +0 -12
- package/dist/packages/react/src/components/FilterOption/index.d.ts +0 -5
- package/dist/packages/react/src/components/FormatSearch/index.d.ts +0 -6
- package/dist/packages/react/src/components/FormulaSearch/index.d.ts +0 -5
- package/dist/packages/react/src/components/FxEditor/CalcInfo.d.ts +0 -3
- package/dist/packages/react/src/components/FxEditor/NameBox.d.ts +0 -3
- package/dist/packages/react/src/components/FxEditor/index.d.ts +0 -4
- package/dist/packages/react/src/components/ImgBoxs/index.d.ts +0 -3
- package/dist/packages/react/src/components/LinkEidtCard/index.d.ts +0 -5
- package/dist/packages/react/src/components/LocationCondition/index.d.ts +0 -3
- package/dist/packages/react/src/components/MessageBox/index.d.ts +0 -9
- package/dist/packages/react/src/components/NotationBoxes/index.d.ts +0 -3
- package/dist/packages/react/src/components/SVGDefines.d.ts +0 -3
- package/dist/packages/react/src/components/SVGIcon.d.ts +0 -9
- package/dist/packages/react/src/components/SearchReplace/index.d.ts +0 -4
- package/dist/packages/react/src/components/Sheet/index.d.ts +0 -8
- package/dist/packages/react/src/components/SheetList/SheetHiddenButton.d.ts +0 -8
- package/dist/packages/react/src/components/SheetList/SheetListItem.d.ts +0 -9
- package/dist/packages/react/src/components/SheetList/index.d.ts +0 -4
- package/dist/packages/react/src/components/SheetOverlay/ColumnHeader.d.ts +0 -3
- package/dist/packages/react/src/components/SheetOverlay/ContentEditable.d.ts +0 -11
- package/dist/packages/react/src/components/SheetOverlay/FormulaHint/index.d.ts +0 -4
- package/dist/packages/react/src/components/SheetOverlay/FormulaSearch/index.d.ts +0 -4
- package/dist/packages/react/src/components/SheetOverlay/InputBox.d.ts +0 -3
- package/dist/packages/react/src/components/SheetOverlay/RowHeader.d.ts +0 -3
- package/dist/packages/react/src/components/SheetOverlay/ScrollBar/index.d.ts +0 -7
- package/dist/packages/react/src/components/SheetOverlay/index.d.ts +0 -4
- package/dist/packages/react/src/components/SheetTab/SheetItem.d.ts +0 -8
- package/dist/packages/react/src/components/SheetTab/index.d.ts +0 -4
- package/dist/packages/react/src/components/SplitColumn/index.d.ts +0 -3
- package/dist/packages/react/src/components/Toolbar/Button.d.ts +0 -11
- package/dist/packages/react/src/components/Toolbar/ColorPicker.d.ts +0 -6
- package/dist/packages/react/src/components/Toolbar/Combo.d.ts +0 -10
- package/dist/packages/react/src/components/Toolbar/CustomBorder.d.ts +0 -7
- package/dist/packages/react/src/components/Toolbar/CustomButton.d.ts +0 -11
- package/dist/packages/react/src/components/Toolbar/CustomColor.d.ts +0 -8
- package/dist/packages/react/src/components/Toolbar/CustomIcon.d.ts +0 -9
- package/dist/packages/react/src/components/Toolbar/Divider.d.ts +0 -4
- package/dist/packages/react/src/components/Toolbar/MoreItemsContainer.d.ts +0 -6
- package/dist/packages/react/src/components/Toolbar/Select.d.ts +0 -14
- package/dist/packages/react/src/components/Toolbar/index.d.ts +0 -7
- package/dist/packages/react/src/components/Workbook/api.d.ts +0 -121
- package/dist/packages/react/src/components/Workbook/index.d.ts +0 -130
- package/dist/packages/react/src/components/ZoomControl/index.d.ts +0 -4
- package/dist/packages/react/src/components/index.d.ts +0 -3
- package/dist/packages/react/src/context/index.d.ts +0 -25
- package/dist/packages/react/src/context/modal.d.ts +0 -10
- package/dist/packages/react/src/hooks/useAlert.d.ts +0 -4
- package/dist/packages/react/src/hooks/useDialog.d.ts +0 -5
- package/dist/packages/react/src/hooks/useOutsideClick.d.ts +0 -2
- package/dist/packages/react/src/hooks/usePrevious.d.ts +0 -2
- package/dist/packages/react/src/index.d.ts +0 -1
- package/dist/stories/data/cell.d.ts +0 -1180
- package/dist/stories/data/dataVerification.d.ts +0 -131
- package/dist/stories/data/empty.d.ts +0 -10
- package/dist/stories/data/formula.d.ts +0 -362
- package/dist/stories/data/freeze.d.ts +0 -34
- package/dist/stories/data/protected.d.ts +0 -40
- package/dist/stories/utils.d.ts +0 -1
- /package/dist/{packages/formula-parser/src/error.d.ts → error.d.ts} +0 -0
- /package/dist/{packages/formula-parser/src/evaluate-by-operator → evaluate-by-operator}/evaluate-by-operator.d.ts +0 -0
- /package/dist/{packages/formula-parser/src/evaluate-by-operator → evaluate-by-operator}/operator/add.d.ts +0 -0
- /package/dist/{packages/formula-parser/src/evaluate-by-operator → evaluate-by-operator}/operator/ampersand.d.ts +0 -0
- /package/dist/{packages/formula-parser/src/evaluate-by-operator → evaluate-by-operator}/operator/divide.d.ts +0 -0
- /package/dist/{packages/formula-parser/src/evaluate-by-operator → evaluate-by-operator}/operator/equal.d.ts +0 -0
- /package/dist/{packages/formula-parser/src/evaluate-by-operator → evaluate-by-operator}/operator/formula-function.d.ts +0 -0
- /package/dist/{packages/formula-parser/src/evaluate-by-operator → evaluate-by-operator}/operator/greater-than-or-equal.d.ts +0 -0
- /package/dist/{packages/formula-parser/src/evaluate-by-operator → evaluate-by-operator}/operator/greater-than.d.ts +0 -0
- /package/dist/{packages/formula-parser/src/evaluate-by-operator → evaluate-by-operator}/operator/less-than-or-equal.d.ts +0 -0
- /package/dist/{packages/formula-parser/src/evaluate-by-operator → evaluate-by-operator}/operator/less-than.d.ts +0 -0
- /package/dist/{packages/formula-parser/src/evaluate-by-operator → evaluate-by-operator}/operator/minus.d.ts +0 -0
- /package/dist/{packages/formula-parser/src/evaluate-by-operator → evaluate-by-operator}/operator/multiply.d.ts +0 -0
- /package/dist/{packages/formula-parser/src/evaluate-by-operator → evaluate-by-operator}/operator/not-equal.d.ts +0 -0
- /package/dist/{packages/formula-parser/src/evaluate-by-operator → evaluate-by-operator}/operator/power.d.ts +0 -0
- /package/dist/{packages/formula-parser/src/grammar-parser → grammar-parser}/grammar-parser.d.ts +0 -0
- /package/dist/{packages/formula-parser/src/helper → helper}/cell.d.ts +0 -0
- /package/dist/{packages/formula-parser/src/helper → helper}/number.d.ts +0 -0
- /package/dist/{packages/formula-parser/src/helper → helper}/string.d.ts +0 -0
- /package/dist/{packages/formula-parser/src/index.d.ts → index.d.ts} +0 -0
- /package/dist/{packages/formula-parser/src/parser.d.ts → parser.d.ts} +0 -0
- /package/dist/{packages/formula-parser/src/supported-formulas.d.ts → supported-formulas.d.ts} +0 -0
package/dist/index.esm.js
CHANGED
|
@@ -447,82 +447,7 @@ registerOperation(func$a.SYMBOL, func$a);
|
|
|
447
447
|
registerOperation(func$b.SYMBOL, func$b);
|
|
448
448
|
registerOperation(func$9.SYMBOL, func$9);
|
|
449
449
|
|
|
450
|
-
|
|
451
|
-
/*
|
|
452
|
-
Returns a Parser object of the following structure:
|
|
453
|
-
|
|
454
|
-
Parser: {
|
|
455
|
-
yy: {}
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
Parser.prototype: {
|
|
459
|
-
yy: {},
|
|
460
|
-
trace: function(),
|
|
461
|
-
symbols_: {associative list: name ==> number},
|
|
462
|
-
terminals_: {associative list: number ==> name},
|
|
463
|
-
productions_: [...],
|
|
464
|
-
performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
|
|
465
|
-
table: [...],
|
|
466
|
-
defaultActions: {...},
|
|
467
|
-
parseError: function(str, hash),
|
|
468
|
-
parse: function(input),
|
|
469
|
-
|
|
470
|
-
lexer: {
|
|
471
|
-
EOF: 1,
|
|
472
|
-
parseError: function(str, hash),
|
|
473
|
-
setInput: function(input),
|
|
474
|
-
input: function(),
|
|
475
|
-
unput: function(str),
|
|
476
|
-
more: function(),
|
|
477
|
-
less: function(n),
|
|
478
|
-
pastInput: function(),
|
|
479
|
-
upcomingInput: function(),
|
|
480
|
-
showPosition: function(),
|
|
481
|
-
test_match: function(regex_match_array, rule_index),
|
|
482
|
-
next: function(),
|
|
483
|
-
lex: function(),
|
|
484
|
-
begin: function(condition),
|
|
485
|
-
popState: function(),
|
|
486
|
-
_currentRules: function(),
|
|
487
|
-
topState: function(),
|
|
488
|
-
pushState: function(condition),
|
|
489
|
-
|
|
490
|
-
options: {
|
|
491
|
-
ranges: boolean (optional: true ==> token location info will include a .range[] member)
|
|
492
|
-
flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
|
|
493
|
-
backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)
|
|
494
|
-
},
|
|
495
|
-
|
|
496
|
-
performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
|
|
497
|
-
rules: [...],
|
|
498
|
-
conditions: {associative list: name ==> set},
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
token location info (@$, _$, etc.): {
|
|
504
|
-
first_line: n,
|
|
505
|
-
last_line: n,
|
|
506
|
-
first_column: n,
|
|
507
|
-
last_column: n,
|
|
508
|
-
range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
the parseError function receives a 'hash' object with these members for lexer and parser errors: {
|
|
513
|
-
text: (matched text)
|
|
514
|
-
token: (the produced terminal token, if any)
|
|
515
|
-
line: (yylineno)
|
|
516
|
-
}
|
|
517
|
-
while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
|
|
518
|
-
loc: (yylloc)
|
|
519
|
-
expected: (string describing the set of expected tokens)
|
|
520
|
-
recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
|
|
521
|
-
}
|
|
522
|
-
*/
|
|
523
|
-
|
|
524
|
-
/* addresses */
|
|
525
|
-
var simpleSheetName = "[A-Za-z0-9_\xC0-\u02AF]+";
|
|
450
|
+
var simpleSheetName = "[A-Za-z0-9_\u4E00-\u9FFF]+";
|
|
526
451
|
var quotedSheetName = "'(?:(?!').|'')*'";
|
|
527
452
|
var sheetNameRegexp = "(?:".concat(simpleSheetName, "|").concat(quotedSheetName, ")!");
|
|
528
453
|
var ABSOLUTE_CELL = new RegExp("^(?:".concat(sheetNameRegexp, ")?(?:[$][A-Za-z]+[$][0-9]+)"));
|
|
@@ -567,13 +492,13 @@ var parser = {
|
|
|
567
492
|
trace: function trace() {},
|
|
568
493
|
yy: {},
|
|
569
494
|
symbols_: {
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
495
|
+
error: 2,
|
|
496
|
+
expressions: 3,
|
|
497
|
+
expression: 4,
|
|
498
|
+
EOF: 5,
|
|
499
|
+
variableSequence: 6,
|
|
500
|
+
number: 7,
|
|
501
|
+
STRING: 8,
|
|
577
502
|
"&": 9,
|
|
578
503
|
"=": 10,
|
|
579
504
|
"+": 11,
|
|
@@ -581,28 +506,28 @@ var parser = {
|
|
|
581
506
|
")": 13,
|
|
582
507
|
"<": 14,
|
|
583
508
|
">": 15,
|
|
584
|
-
|
|
509
|
+
NOT: 16,
|
|
585
510
|
"-": 17,
|
|
586
511
|
"*": 18,
|
|
587
512
|
"/": 19,
|
|
588
513
|
"^": 20,
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
514
|
+
FUNCTION: 21,
|
|
515
|
+
expseq: 22,
|
|
516
|
+
cell: 23,
|
|
517
|
+
ABSOLUTE_CELL: 24,
|
|
518
|
+
RELATIVE_CELL: 25,
|
|
519
|
+
MIXED_CELL: 26,
|
|
595
520
|
":": 27,
|
|
596
|
-
|
|
521
|
+
ARRAY: 28,
|
|
597
522
|
";": 29,
|
|
598
523
|
",": 30,
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
524
|
+
VARIABLE: 31,
|
|
525
|
+
DECIMAL: 32,
|
|
526
|
+
NUMBER: 33,
|
|
602
527
|
"%": 34,
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
528
|
+
ERROR: 35,
|
|
529
|
+
$accept: 0,
|
|
530
|
+
$end: 1
|
|
606
531
|
},
|
|
607
532
|
terminals_: {
|
|
608
533
|
5: "EOF",
|
|
@@ -651,46 +576,46 @@ var parser = {
|
|
|
651
576
|
this.$ = yy.trimEdges($$[$0]);
|
|
652
577
|
break;
|
|
653
578
|
case 5:
|
|
654
|
-
this.$ = yy.evaluateByOperator(
|
|
579
|
+
this.$ = yy.evaluateByOperator("&", [$$[$0 - 2], $$[$0]]);
|
|
655
580
|
break;
|
|
656
581
|
case 6:
|
|
657
|
-
this.$ = yy.evaluateByOperator(
|
|
582
|
+
this.$ = yy.evaluateByOperator("=", [$$[$0 - 2], $$[$0]]);
|
|
658
583
|
break;
|
|
659
584
|
case 7:
|
|
660
|
-
this.$ = yy.evaluateByOperator(
|
|
585
|
+
this.$ = yy.evaluateByOperator("+", [$$[$0 - 2], $$[$0]]);
|
|
661
586
|
break;
|
|
662
587
|
case 8:
|
|
663
588
|
this.$ = $$[$0 - 1];
|
|
664
589
|
break;
|
|
665
590
|
case 9:
|
|
666
|
-
this.$ = yy.evaluateByOperator(
|
|
591
|
+
this.$ = yy.evaluateByOperator("<=", [$$[$0 - 3], $$[$0]]);
|
|
667
592
|
break;
|
|
668
593
|
case 10:
|
|
669
|
-
this.$ = yy.evaluateByOperator(
|
|
594
|
+
this.$ = yy.evaluateByOperator(">=", [$$[$0 - 3], $$[$0]]);
|
|
670
595
|
break;
|
|
671
596
|
case 11:
|
|
672
|
-
this.$ = yy.evaluateByOperator(
|
|
597
|
+
this.$ = yy.evaluateByOperator("<>", [$$[$0 - 3], $$[$0]]);
|
|
673
598
|
break;
|
|
674
599
|
case 12:
|
|
675
|
-
this.$ = yy.evaluateByOperator(
|
|
600
|
+
this.$ = yy.evaluateByOperator("NOT", [$$[$0 - 2], $$[$0]]);
|
|
676
601
|
break;
|
|
677
602
|
case 13:
|
|
678
|
-
this.$ = yy.evaluateByOperator(
|
|
603
|
+
this.$ = yy.evaluateByOperator(">", [$$[$0 - 2], $$[$0]]);
|
|
679
604
|
break;
|
|
680
605
|
case 14:
|
|
681
|
-
this.$ = yy.evaluateByOperator(
|
|
606
|
+
this.$ = yy.evaluateByOperator("<", [$$[$0 - 2], $$[$0]]);
|
|
682
607
|
break;
|
|
683
608
|
case 15:
|
|
684
|
-
this.$ = yy.evaluateByOperator(
|
|
609
|
+
this.$ = yy.evaluateByOperator("-", [$$[$0 - 2], $$[$0]]);
|
|
685
610
|
break;
|
|
686
611
|
case 16:
|
|
687
|
-
this.$ = yy.evaluateByOperator(
|
|
612
|
+
this.$ = yy.evaluateByOperator("*", [$$[$0 - 2], $$[$0]]);
|
|
688
613
|
break;
|
|
689
614
|
case 17:
|
|
690
|
-
this.$ = yy.evaluateByOperator(
|
|
615
|
+
this.$ = yy.evaluateByOperator("/", [$$[$0 - 2], $$[$0]]);
|
|
691
616
|
break;
|
|
692
617
|
case 18:
|
|
693
|
-
this.$ = yy.evaluateByOperator(
|
|
618
|
+
this.$ = yy.evaluateByOperator("^", [$$[$0 - 2], $$[$0]]);
|
|
694
619
|
break;
|
|
695
620
|
case 19:
|
|
696
621
|
var n1 = yy.invertNumber($$[$0]);
|
|
@@ -733,7 +658,7 @@ var parser = {
|
|
|
733
658
|
this.$ = [$$[$0]];
|
|
734
659
|
break;
|
|
735
660
|
case 39:
|
|
736
|
-
this.$ = yy.trimEdges(yytext).split(
|
|
661
|
+
this.$ = yy.trimEdges(yytext).split(",");
|
|
737
662
|
break;
|
|
738
663
|
case 40:
|
|
739
664
|
case 41:
|
|
@@ -748,7 +673,7 @@ var parser = {
|
|
|
748
673
|
this.$ = $$[$0];
|
|
749
674
|
break;
|
|
750
675
|
case 45:
|
|
751
|
-
this.$ = ($$[$0 - 2] +
|
|
676
|
+
this.$ = ($$[$0 - 2] + "." + $$[$0]) * 1;
|
|
752
677
|
break;
|
|
753
678
|
case 46:
|
|
754
679
|
this.$ = $$[$0 - 1] * 0.01;
|
|
@@ -1308,7 +1233,7 @@ var parser = {
|
|
|
1308
1233
|
lstack = [],
|
|
1309
1234
|
// location stack
|
|
1310
1235
|
table = this.table,
|
|
1311
|
-
yytext =
|
|
1236
|
+
yytext = "",
|
|
1312
1237
|
yylineno = 0,
|
|
1313
1238
|
yyleng = 0,
|
|
1314
1239
|
recovering = 0,
|
|
@@ -1317,7 +1242,6 @@ var parser = {
|
|
|
1317
1242
|
var args = lstack.slice.call(arguments, 1);
|
|
1318
1243
|
|
|
1319
1244
|
//this.reductionCount = this.shiftCount = 0;
|
|
1320
|
-
|
|
1321
1245
|
var lexer = Object.create(this.lexer);
|
|
1322
1246
|
var sharedState = {
|
|
1323
1247
|
yy: {}
|
|
@@ -1331,13 +1255,13 @@ var parser = {
|
|
|
1331
1255
|
lexer.setInput(input, sharedState.yy);
|
|
1332
1256
|
sharedState.yy.lexer = lexer;
|
|
1333
1257
|
sharedState.yy.parser = this;
|
|
1334
|
-
if (typeof lexer.yylloc ==
|
|
1258
|
+
if (typeof lexer.yylloc == "undefined") {
|
|
1335
1259
|
lexer.yylloc = {};
|
|
1336
1260
|
}
|
|
1337
1261
|
var yyloc = lexer.yylloc;
|
|
1338
1262
|
lstack.push(yyloc);
|
|
1339
1263
|
var ranges = lexer.options && lexer.options.ranges;
|
|
1340
|
-
if (typeof sharedState.yy.parseError ===
|
|
1264
|
+
if (typeof sharedState.yy.parseError === "function") {
|
|
1341
1265
|
this.parseError = sharedState.yy.parseError;
|
|
1342
1266
|
} else {
|
|
1343
1267
|
this.parseError = Object.getPrototypeOf(this).parseError;
|
|
@@ -1351,7 +1275,7 @@ var parser = {
|
|
|
1351
1275
|
var token;
|
|
1352
1276
|
token = lexer.lex() || EOF;
|
|
1353
1277
|
// if token isn't its numeric value, convert
|
|
1354
|
-
if (typeof token !==
|
|
1278
|
+
if (typeof token !== "number") {
|
|
1355
1279
|
token = self.symbols_[token] || token;
|
|
1356
1280
|
}
|
|
1357
1281
|
return token;
|
|
@@ -1372,18 +1296,18 @@ var parser = {
|
|
|
1372
1296
|
state = stack[stack.length - 1];
|
|
1373
1297
|
|
|
1374
1298
|
// use default actions if available
|
|
1299
|
+
|
|
1375
1300
|
if (_this.defaultActions[state]) {
|
|
1376
1301
|
action = _this.defaultActions[state];
|
|
1377
1302
|
} else {
|
|
1378
|
-
if (symbol === null || typeof symbol ==
|
|
1303
|
+
if (symbol === null || typeof symbol == "undefined") {
|
|
1379
1304
|
symbol = lex();
|
|
1380
1305
|
}
|
|
1381
1306
|
// read action for current state and first input
|
|
1382
1307
|
action = table[state] && table[state][symbol];
|
|
1383
1308
|
}
|
|
1384
|
-
|
|
1385
1309
|
// handle parse error
|
|
1386
|
-
if (typeof action ===
|
|
1310
|
+
if (typeof action === "undefined" || !action.length || !action[0]) {
|
|
1387
1311
|
// Return the rule stack depth where the nearest error rule can be found.
|
|
1388
1312
|
// Return FALSE when no error recovery rule was found.
|
|
1389
1313
|
var locateNearestErrorRecoveryRule = function locateNearestErrorRecoveryRule(state) {
|
|
@@ -1404,7 +1328,7 @@ var parser = {
|
|
|
1404
1328
|
++depth;
|
|
1405
1329
|
}
|
|
1406
1330
|
};
|
|
1407
|
-
errStr =
|
|
1331
|
+
errStr = "";
|
|
1408
1332
|
if (!recovering) {
|
|
1409
1333
|
// first see if there's any chance at hitting an error recovery rule:
|
|
1410
1334
|
error_rule_depth = locateNearestErrorRecoveryRule(state);
|
|
@@ -1417,9 +1341,9 @@ var parser = {
|
|
|
1417
1341
|
}
|
|
1418
1342
|
}
|
|
1419
1343
|
if (lexer.showPosition) {
|
|
1420
|
-
errStr =
|
|
1344
|
+
errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (_this.terminals_[symbol] || symbol) + "'";
|
|
1421
1345
|
} else {
|
|
1422
|
-
errStr =
|
|
1346
|
+
errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (_this.terminals_[symbol] || symbol) + "'");
|
|
1423
1347
|
}
|
|
1424
1348
|
_this.parseError(errStr, {
|
|
1425
1349
|
text: lexer.match,
|
|
@@ -1436,7 +1360,7 @@ var parser = {
|
|
|
1436
1360
|
// just recovered from another error
|
|
1437
1361
|
if (recovering == 3) {
|
|
1438
1362
|
if (symbol === EOF || preErrorSymbol === EOF) {
|
|
1439
|
-
throw new Error(errStr ||
|
|
1363
|
+
throw new Error(errStr || "Parsing halted while starting to recover from another error.");
|
|
1440
1364
|
}
|
|
1441
1365
|
|
|
1442
1366
|
// discard current lookahead and grab another
|
|
@@ -1449,7 +1373,7 @@ var parser = {
|
|
|
1449
1373
|
|
|
1450
1374
|
// try to recover from error
|
|
1451
1375
|
if (error_rule_depth === false) {
|
|
1452
|
-
throw new Error(errStr ||
|
|
1376
|
+
throw new Error(errStr || "Parsing halted. No suitable error recovery rule available.");
|
|
1453
1377
|
}
|
|
1454
1378
|
popStack(error_rule_depth);
|
|
1455
1379
|
preErrorSymbol = symbol == TERROR ? null : symbol; // save the lookahead token
|
|
@@ -1458,10 +1382,9 @@ var parser = {
|
|
|
1458
1382
|
action = table[state] && table[state][TERROR];
|
|
1459
1383
|
recovering = 3; // allow 3 real symbols to be shifted before reporting a new error
|
|
1460
1384
|
}
|
|
1461
|
-
|
|
1462
1385
|
// this shouldn't happen, unless resolve defaults are off
|
|
1463
1386
|
if (action[0] instanceof Array && action.length > 1) {
|
|
1464
|
-
throw new Error(
|
|
1387
|
+
throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
|
|
1465
1388
|
}
|
|
1466
1389
|
switch (action[0]) {
|
|
1467
1390
|
case 1:
|
|
@@ -1491,7 +1414,6 @@ var parser = {
|
|
|
1491
1414
|
case 2:
|
|
1492
1415
|
// reduce
|
|
1493
1416
|
//this.reductionCount++;
|
|
1494
|
-
|
|
1495
1417
|
len = _this.productions_[action[1]][1];
|
|
1496
1418
|
|
|
1497
1419
|
// perform semantic action
|
|
@@ -1507,7 +1429,7 @@ var parser = {
|
|
|
1507
1429
|
yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
|
|
1508
1430
|
}
|
|
1509
1431
|
r = _this.performAction.apply(yyval, [yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack].concat(args));
|
|
1510
|
-
if (typeof r !==
|
|
1432
|
+
if (typeof r !== "undefined") {
|
|
1511
1433
|
return {
|
|
1512
1434
|
v: r
|
|
1513
1435
|
};
|
|
@@ -1561,8 +1483,8 @@ var lexer = function () {
|
|
|
1561
1483
|
this._input = input;
|
|
1562
1484
|
this._more = this._backtrack = this.done = false;
|
|
1563
1485
|
this.yylineno = this.yyleng = 0;
|
|
1564
|
-
this.yytext = this.matched = this.match =
|
|
1565
|
-
this.conditionStack = [
|
|
1486
|
+
this.yytext = this.matched = this.match = "";
|
|
1487
|
+
this.conditionStack = ["INITIAL"];
|
|
1566
1488
|
this.yylloc = {
|
|
1567
1489
|
first_line: 1,
|
|
1568
1490
|
first_column: 0,
|
|
@@ -1633,7 +1555,7 @@ var lexer = function () {
|
|
|
1633
1555
|
if (this.options.backtrack_lexer) {
|
|
1634
1556
|
this._backtrack = true;
|
|
1635
1557
|
} else {
|
|
1636
|
-
return this.parseError(
|
|
1558
|
+
return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), {
|
|
1637
1559
|
text: "",
|
|
1638
1560
|
token: null,
|
|
1639
1561
|
line: this.yylineno
|
|
@@ -1648,7 +1570,7 @@ var lexer = function () {
|
|
|
1648
1570
|
// displays already matched input, i.e. for error messages
|
|
1649
1571
|
pastInput: function pastInput() {
|
|
1650
1572
|
var past = this.matched.substr(0, this.matched.length - this.match.length);
|
|
1651
|
-
return (past.length > 20 ?
|
|
1573
|
+
return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
|
|
1652
1574
|
},
|
|
1653
1575
|
// displays upcoming input, i.e. for error messages
|
|
1654
1576
|
upcomingInput: function upcomingInput() {
|
|
@@ -1656,7 +1578,7 @@ var lexer = function () {
|
|
|
1656
1578
|
if (next.length < 20) {
|
|
1657
1579
|
next += this._input.substr(0, 20 - next.length);
|
|
1658
1580
|
}
|
|
1659
|
-
return (next.substr(0, 20) + (next.length > 20 ?
|
|
1581
|
+
return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
|
|
1660
1582
|
},
|
|
1661
1583
|
// displays the character position where the lexing error occurred, i.e. for error messages
|
|
1662
1584
|
showPosition: function showPosition() {
|
|
@@ -1739,8 +1661,8 @@ var lexer = function () {
|
|
|
1739
1661
|
}
|
|
1740
1662
|
var token, match, tempMatch, index;
|
|
1741
1663
|
if (!this._more) {
|
|
1742
|
-
this.yytext =
|
|
1743
|
-
this.match =
|
|
1664
|
+
this.yytext = "";
|
|
1665
|
+
this.match = "";
|
|
1744
1666
|
}
|
|
1745
1667
|
var rules = this._currentRules();
|
|
1746
1668
|
for (var i = 0; i < rules.length; i++) {
|
|
@@ -1780,7 +1702,7 @@ var lexer = function () {
|
|
|
1780
1702
|
if (this._input === "") {
|
|
1781
1703
|
return this.EOF;
|
|
1782
1704
|
} else {
|
|
1783
|
-
return this.parseError(
|
|
1705
|
+
return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
|
|
1784
1706
|
text: "",
|
|
1785
1707
|
token: null,
|
|
1786
1708
|
line: this.yylineno
|
|
@@ -1837,8 +1759,7 @@ var lexer = function () {
|
|
|
1837
1759
|
options: {},
|
|
1838
1760
|
performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
|
|
1839
1761
|
switch ($avoiding_name_collisions) {
|
|
1840
|
-
case 0
|
|
1841
|
-
/* skip whitespace */
|
|
1762
|
+
case 0 /* skip whitespace */:
|
|
1842
1763
|
break;
|
|
1843
1764
|
case 1:
|
|
1844
1765
|
return 8;
|
|
@@ -1869,7 +1790,7 @@ var lexer = function () {
|
|
|
1869
1790
|
case 14:
|
|
1870
1791
|
return 9;
|
|
1871
1792
|
case 15:
|
|
1872
|
-
return
|
|
1793
|
+
return " ";
|
|
1873
1794
|
case 16:
|
|
1874
1795
|
return 32;
|
|
1875
1796
|
case 17:
|
|
@@ -1909,16 +1830,16 @@ var lexer = function () {
|
|
|
1909
1830
|
case 34:
|
|
1910
1831
|
return 34;
|
|
1911
1832
|
case 35:
|
|
1912
|
-
return
|
|
1833
|
+
return "#";
|
|
1913
1834
|
case 36:
|
|
1914
1835
|
return 5;
|
|
1915
1836
|
}
|
|
1916
1837
|
},
|
|
1917
1838
|
rules: [/^(?:\s+)/, /^(?:"(\\["]|[^"])*")/, /^(?:'(\\[']|[^'])*'[^'!])/, /^(?:[A-Za-z]{1,}[A-Za-z_0-9\.]+(?=[(]))/, /^(?:#[A-Z0-9\/]+(!|\?)?)/, ABSOLUTE_CELL, MIXED_CELL_COL, MIXED_CELL_ROW, RELATIVE_CELL, /^(?:[A-Za-z\.]+(?=[(]))/, /^(?:[A-Za-z]{1,}[A-Za-z_0-9]+)/, /^(?:[A-Za-z_]+)/, /^(?:[0-9]+)/, /^(?:\[(.*)?\])/, /^(?:&)/, /^(?: )/, /^(?:[.])/, /^(?::)/, /^(?:;)/, /^(?:,)/, /^(?:\*)/, /^(?:\/)/, /^(?:-)/, /^(?:\+)/, /^(?:\^)/, /^(?:\()/, /^(?:\))/, /^(?:>)/, /^(?:<)/, /^(?:NOT\b)/, /^(?:")/, /^(?:')/, /^(?:!)/, /^(?:=)/, /^(?:%)/, /^(?:[#])/, /^(?:$)/],
|
|
1918
1839
|
conditions: {
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1840
|
+
INITIAL: {
|
|
1841
|
+
rules: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36],
|
|
1842
|
+
inclusive: true
|
|
1922
1843
|
}
|
|
1923
1844
|
}
|
|
1924
1845
|
};
|
|
@@ -1968,13 +1889,13 @@ function rowLabelToIndex(label) {
|
|
|
1968
1889
|
* @returns {String} Returns row label (eq. '1', '7').
|
|
1969
1890
|
*/
|
|
1970
1891
|
function rowIndexToLabel(row) {
|
|
1971
|
-
var result =
|
|
1892
|
+
var result = "";
|
|
1972
1893
|
if (row >= 0) {
|
|
1973
1894
|
result = "".concat(row + 1);
|
|
1974
1895
|
}
|
|
1975
1896
|
return result;
|
|
1976
1897
|
}
|
|
1977
|
-
var COLUMN_LABEL_BASE =
|
|
1898
|
+
var COLUMN_LABEL_BASE = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
1978
1899
|
var COLUMN_LABEL_BASE_LENGTH = COLUMN_LABEL_BASE.length;
|
|
1979
1900
|
|
|
1980
1901
|
/**
|
|
@@ -1985,7 +1906,7 @@ var COLUMN_LABEL_BASE_LENGTH = COLUMN_LABEL_BASE.length;
|
|
|
1985
1906
|
*/
|
|
1986
1907
|
function columnLabelToIndex(label) {
|
|
1987
1908
|
var result = 0;
|
|
1988
|
-
if (typeof label ===
|
|
1909
|
+
if (typeof label === "string") {
|
|
1989
1910
|
label = label.toUpperCase();
|
|
1990
1911
|
for (var i = 0, j = label.length - 1; i < label.length; i += 1, j -= 1) {
|
|
1991
1912
|
result += Math.pow(COLUMN_LABEL_BASE_LENGTH, j) * (COLUMN_LABEL_BASE.indexOf(label[i]) + 1);
|
|
@@ -2002,14 +1923,14 @@ function columnLabelToIndex(label) {
|
|
|
2002
1923
|
* @returns {String} Returns column label (eq. 'ABB', 'CNQ').
|
|
2003
1924
|
*/
|
|
2004
1925
|
function columnIndexToLabel(column) {
|
|
2005
|
-
var result =
|
|
1926
|
+
var result = "";
|
|
2006
1927
|
while (column >= 0) {
|
|
2007
1928
|
result = String.fromCharCode(column % COLUMN_LABEL_BASE_LENGTH + 97) + result;
|
|
2008
1929
|
column = Math.floor(column / COLUMN_LABEL_BASE_LENGTH) - 1;
|
|
2009
1930
|
}
|
|
2010
1931
|
return result.toUpperCase();
|
|
2011
1932
|
}
|
|
2012
|
-
var simpleSheetName$1 = "[A-Za-z0-9_\
|
|
1933
|
+
var simpleSheetName$1 = "[A-Za-z0-9_\u4E00-\u9FFF]+";
|
|
2013
1934
|
var quotedSheetName$1 = "'(?:(?!').|'')*'";
|
|
2014
1935
|
var sheetNameRegexp$1 = "(".concat(simpleSheetName$1, "|").concat(quotedSheetName$1, ")!");
|
|
2015
1936
|
var LABEL_EXTRACT_REGEXP = new RegExp("^(?:".concat(sheetNameRegexp$1, ")?([$])?([A-Za-z]*)([$])?([0-9]*)$"));
|
|
@@ -2021,7 +1942,7 @@ var LABEL_EXTRACT_REGEXP = new RegExp("^(?:".concat(sheetNameRegexp$1, ")?([$])?
|
|
|
2021
1942
|
* @returns {Array} Returns an array of objects.
|
|
2022
1943
|
*/
|
|
2023
1944
|
function extractLabel(label) {
|
|
2024
|
-
if (typeof label !==
|
|
1945
|
+
if (typeof label !== "string" || !LABEL_EXTRACT_REGEXP.test(label)) {
|
|
2025
1946
|
return [];
|
|
2026
1947
|
}
|
|
2027
1948
|
var _label$toUpperCase$ma = label.toUpperCase().match(LABEL_EXTRACT_REGEXP),
|
|
@@ -2036,11 +1957,11 @@ function extractLabel(label) {
|
|
|
2036
1957
|
return [{
|
|
2037
1958
|
index: rowLabelToIndex(row),
|
|
2038
1959
|
label: row,
|
|
2039
|
-
isAbsolute: rowAbs ===
|
|
1960
|
+
isAbsolute: rowAbs === "$"
|
|
2040
1961
|
}, {
|
|
2041
1962
|
index: columnLabelToIndex(column),
|
|
2042
1963
|
label: column,
|
|
2043
|
-
isAbsolute: columnAbs ===
|
|
1964
|
+
isAbsolute: columnAbs === "$"
|
|
2044
1965
|
}, sheetName];
|
|
2045
1966
|
}
|
|
2046
1967
|
|
|
@@ -2052,8 +1973,8 @@ function extractLabel(label) {
|
|
|
2052
1973
|
* @returns {String} Returns cell label.
|
|
2053
1974
|
*/
|
|
2054
1975
|
function toLabel(row, column) {
|
|
2055
|
-
var rowLabel = (row.isAbsolute ?
|
|
2056
|
-
var columnLabel = (column.isAbsolute ?
|
|
1976
|
+
var rowLabel = (row.isAbsolute ? "$" : "") + rowIndexToLabel(row.index);
|
|
1977
|
+
var columnLabel = (column.isAbsolute ? "$" : "") + columnIndexToLabel(column.index);
|
|
2057
1978
|
return columnLabel + rowLabel;
|
|
2058
1979
|
}
|
|
2059
1980
|
|
|
@@ -2090,7 +2011,7 @@ var Parser$1 = /*#__PURE__*/function (_Emitter) {
|
|
|
2090
2011
|
_this.variables = Object.create(null);
|
|
2091
2012
|
_this.functions = Object.create(null);
|
|
2092
2013
|
_this.options = Object.create(null);
|
|
2093
|
-
_this.setVariable(
|
|
2014
|
+
_this.setVariable("TRUE", true).setVariable("FALSE", false).setVariable("NULL", null);
|
|
2094
2015
|
return _this;
|
|
2095
2016
|
}
|
|
2096
2017
|
|
|
@@ -2110,8 +2031,8 @@ var Parser$1 = /*#__PURE__*/function (_Emitter) {
|
|
|
2110
2031
|
var error$1 = null;
|
|
2111
2032
|
this.options = options;
|
|
2112
2033
|
try {
|
|
2113
|
-
if (expression ===
|
|
2114
|
-
result =
|
|
2034
|
+
if (expression === "") {
|
|
2035
|
+
result = "";
|
|
2115
2036
|
} else {
|
|
2116
2037
|
result = this.parser.parse(expression);
|
|
2117
2038
|
}
|
|
@@ -2170,7 +2091,7 @@ var Parser$1 = /*#__PURE__*/function (_Emitter) {
|
|
|
2170
2091
|
key: "_callVariable",
|
|
2171
2092
|
value: function _callVariable(name) {
|
|
2172
2093
|
var value = this.getVariable(name);
|
|
2173
|
-
this.emit(
|
|
2094
|
+
this.emit("callVariable", name, function (newValue) {
|
|
2174
2095
|
if (newValue !== void 0) {
|
|
2175
2096
|
value = newValue;
|
|
2176
2097
|
}
|
|
@@ -2224,7 +2145,7 @@ var Parser$1 = /*#__PURE__*/function (_Emitter) {
|
|
|
2224
2145
|
if (fn) {
|
|
2225
2146
|
value = fn(params);
|
|
2226
2147
|
}
|
|
2227
|
-
this.emit(
|
|
2148
|
+
this.emit("callFunction", name, params, function (newValue) {
|
|
2228
2149
|
if (newValue !== void 0) {
|
|
2229
2150
|
value = newValue;
|
|
2230
2151
|
}
|
|
@@ -2256,7 +2177,7 @@ var Parser$1 = /*#__PURE__*/function (_Emitter) {
|
|
|
2256
2177
|
throw Error(ERROR_NAME);
|
|
2257
2178
|
}
|
|
2258
2179
|
var value = void 0;
|
|
2259
|
-
this.emit(
|
|
2180
|
+
this.emit("callCellValue", {
|
|
2260
2181
|
label: label,
|
|
2261
2182
|
row: row,
|
|
2262
2183
|
column: column,
|
|
@@ -2311,7 +2232,7 @@ var Parser$1 = /*#__PURE__*/function (_Emitter) {
|
|
|
2311
2232
|
startCell.label = toLabel(startCell.row, startCell.column);
|
|
2312
2233
|
endCell.label = toLabel(endCell.row, endCell.column);
|
|
2313
2234
|
var value = [];
|
|
2314
|
-
this.emit(
|
|
2235
|
+
this.emit("callRangeValue", startCell, endCell, this.options, function () {
|
|
2315
2236
|
var _value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
2316
2237
|
value = _value;
|
|
2317
2238
|
});
|