@sheetxl/sdk 0.8.0-beta.11 → 0.8.0-beta.12
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/browser/esm/{BpgskG1Er_lGQ_yS.mjs → -Jx-jNHmtIQQfLvK.mjs} +1 -1
- package/browser/esm/{BLoUBId2xZpXAK_H.mjs → 2WuhYrIpYmOR5H73.mjs} +15 -15
- package/browser/esm/{Ctjb0SsxV4K4MMqG.mjs → 2mIwPy2D2JUX-9wx.mjs} +2 -2
- package/browser/esm/{CkxWugaJFjDGZNZ-.mjs → B3wf5vZCsWfWsDbj.mjs} +1 -1
- package/browser/esm/{BjkCiv5Jz6WYKZeu.mjs → BIHrHjRGWVlJglcp.mjs} +2 -2
- package/browser/esm/{BtvLTTfSBdAKplVG.mjs → BTFBedJMRWGvZyCE.mjs} +1 -1
- package/browser/esm/{C4MqfLn9Dm-l3OIk.mjs → BdCJNawfifyPupCP.mjs} +1 -1
- package/browser/esm/{CV5EGEjG5_-CPpP0.mjs → Bg5Di9GLNAkbqQ1P.mjs} +3 -3
- package/browser/esm/{C2VbEI_XVAoseAwa.mjs → BnC4-27Igwb8oDf2.mjs} +2 -2
- package/browser/esm/{CQYjO777cmAznUzK.mjs → Bt8_m94tBdks209L.mjs} +1 -1
- package/browser/esm/{C16ycKja6zG0crV_.mjs → BudSIfXBAsTxvu-K.mjs} +17836 -15712
- package/browser/esm/{DvAaxH6z_tGvrRzl.mjs → C9u8FUewte5ugUjH.mjs} +686 -686
- package/browser/esm/{DEiPS3Dr-s4fPbVZ.mjs → CBYMTDzMf1Vh7pkw.mjs} +1 -1
- package/browser/esm/{Dyq_ivuHvlXLwPCl.mjs → CNdjyofiRu6CYOrr.mjs} +1106 -1102
- package/browser/esm/{PcHFjNzQsE54POri.mjs → CRkYR-siY2C994KV.mjs} +1 -1
- package/browser/esm/{C5E6zSGAALWf61n4.mjs → CTe2qfmIUEad6FJv.mjs} +2 -2
- package/browser/esm/{BoV6zPBnfqCBCqZ7.mjs → CUzYuYTTGsChC_kZ.mjs} +3841 -3148
- package/browser/esm/CdEO8CEee6lEhabA.mjs +117 -0
- package/browser/esm/{S2dNNx1a5ydRnARM.mjs → CfRqiPDg6RBTg1EN.mjs} +2 -2
- package/browser/esm/{ClbvFbFzFzXLBKNN.mjs → CndRBvVfQUJIYRRj.mjs} +50 -50
- package/browser/esm/{BnG31I6Oj_HEtSPS.mjs → CwOPLXU3-9ZHGyOT.mjs} +1 -1
- package/browser/esm/{CHU6iu_WGlm7fLET.mjs → Cxjxk0ncRKx80I-w.mjs} +1 -1
- package/browser/esm/D2RZh0O9neOsyLAE.mjs +281 -0
- package/browser/esm/{BkBhLS0l6z8sxI6D.mjs → D64dM68B1pKYFzdP.mjs} +2 -2
- package/browser/esm/{BVDiOXGMc5_FMGfy.mjs → D9xNz46kAfXMZzp4.mjs} +2 -2
- package/browser/esm/{zlLuW405RSguy4Kn.mjs → DK899HhWX1HINMC1.mjs} +53 -53
- package/browser/esm/{B7aUIvgUjncMMD_i.mjs → DPhGQLNGmDZwODwJ.mjs} +5 -4
- package/browser/esm/{gssVX_FH1XFN-twD.mjs → DVroRnhi-5IDXNgM.mjs} +1 -1
- package/{node/esm/CZICGK_ss0HoGHCP.mjs → browser/esm/DZiivy0NmO1Vnyzk.mjs} +2 -2
- package/browser/esm/{ClPfI4lODvCece29.mjs → DgrAuRD2qr2DvFeJ.mjs} +61 -61
- package/browser/esm/{CU3DmJ-YnVVrC1_k.mjs → DobHLF6VjHr7Xi40.mjs} +1 -1
- package/browser/esm/{CaB7J-xgfKO2uAkG.mjs → DwZCT7DZiiXoTweg.mjs} +2 -2
- package/browser/esm/{BMyDRQ716j79h_bH.mjs → DwwR3O2sEZApPSTF.mjs} +6 -6
- package/browser/esm/{DLLE0FZNsKxbBzRn.mjs → Tah7cnFb_HNZdLtj.mjs} +45 -45
- package/browser/esm/{Dlmig06rIo7cInRk.mjs → fXWUMDhZ5yMSO629.mjs} +1 -1
- package/browser/esm/{DWNzqw7DUKwoxjri.mjs → hCQJcmIzPDxDEv2q.mjs} +2 -2
- package/browser/esm/index.mjs +679 -542
- package/browser/esm/{BFagR2JeWs74iAG3.mjs → qO-ujUrgq6H3TQix.mjs} +1 -1
- package/browser/esm/w6Jea0TiclPrYZ2M.mjs +1703 -0
- package/browser/esm/yuhcOYw6SHQ-RCm3.mjs +114 -0
- package/node/esm/-TA0MneBDKdGhsib.mjs +8668 -0
- package/node/esm/{B21JjOLghRoDOrkx.mjs → B-HUPAcqvK0eeeCz.mjs} +1 -1
- package/node/esm/{DNRhGK-8Tr9xcRyc.mjs → BL2iiEoqxDEV2Xrg.mjs} +3 -3
- package/node/esm/{D1TKBVmoKGAXf37B.mjs → BNXLOEddJ6O9gYws.mjs} +2 -2
- package/node/esm/{BrCKGFRsX_ezFJ4B.mjs → BSvOluusoDM4z_dx.mjs} +15 -15
- package/node/esm/{BIwObuhTJYf0jpUa.mjs → BskP3b8vUoIOGLY6.mjs} +2 -2
- package/node/esm/{2Kihw_-5lVTEnwMa.mjs → Btw4148Ot8ifhNc1.mjs} +1 -1
- package/node/esm/{BqiexuA89caYnAPz.mjs → C14-R6tifRh7pc0p.mjs} +1 -1
- package/node/esm/{DUTskXCXref-IJnI.mjs → C99zzq8DImQXi4BQ.mjs} +47 -47
- package/node/esm/{D8zEN-6ZdDqDvTxM.mjs → CBuEu5Jk-LfaDy-H.mjs} +61 -61
- package/node/esm/{yavzZOiZW_EjG9lE.mjs → CG-qBU5BAaVz7e-P.mjs} +1 -1
- package/node/esm/CPI58duc0j0a-HpJ.mjs +115 -0
- package/node/esm/{CCN5vD410obwdz38.mjs → CRt3vXe6YmXzqk3H.mjs} +15 -14
- package/node/esm/{CzXT00vrQa1_gvW9.mjs → C_aL7CGS1lrNn1Ng.mjs} +1 -1
- package/node/esm/{CZiqiay42tFTrLI4.mjs → C_xf5Bz30VqiJjXn.mjs} +1 -1
- package/node/esm/{BIRq1kT7lLRzns9t.mjs → CiIymQN6aJCul62g.mjs} +9 -9
- package/node/esm/{CNCNJNg890KdgkWh.mjs → Ci_zLYmCD7e-C79O.mjs} +1 -1
- package/{browser/esm/D5np__Jb1euAyaLw.mjs → node/esm/CkRYLed8Mmn3giNg.mjs} +2 -2
- package/node/esm/D3ptRKzASqBut1DE.mjs +117 -0
- package/node/esm/{cGwrLA1RCE-WhJ7w.mjs → D4ROK9UwDpS6jO3Z.mjs} +1 -1
- package/node/esm/{mFiBSM7XgBHV9AY7.mjs → D8hO07ToAibIuniw.mjs} +1535 -1531
- package/node/esm/{CDHdgJXH2vS71WMc.mjs → DUTmDHbFbhLDT4F3.mjs} +1 -1
- package/node/esm/{CGp6VZL-gZa9Uezx.mjs → DV5CU37aEbFbWFL0.mjs} +1 -1
- package/node/esm/{De2IONBxQhz-Qbyh.mjs → DdoiuKg9BKubtF1V.mjs} +1 -1
- package/node/esm/{Db0v7zXNnyjBIjjI.mjs → DggQ23jKMpwhENfa.mjs} +2 -2
- package/node/esm/{CwePQwTILHHjGDkZ.mjs → DhS6yWjrrSNIJMsn.mjs} +204 -204
- package/node/esm/{D_t5AUxSm7_icjzq.mjs → DhTya_mhmN53vskv.mjs} +1 -1
- package/node/esm/{DOU54VsOjG-m-NyQ.mjs → Dn1M7YWi25DeeYUb.mjs} +1 -1
- package/node/esm/{DkwIPzKc3UwdUIfM.mjs → DrCf6ITcBhVOFpRj.mjs} +6 -6
- package/node/esm/{D2KBymQJd1XhpeQD.mjs → DxazKtROyaI51dWl.mjs} +1 -1
- package/node/esm/{D6e2z7eZpxOJXHc7.mjs → Q_S1g46ZOTrdhTae.mjs} +1 -1
- package/node/esm/{OVfaSb506tNSIvbv.mjs → Vocy-I9dKzZMr0Ct.mjs} +19038 -16822
- package/node/esm/ZXPFcsT2zrALCZux.mjs +289 -0
- package/node/esm/{857CIBgQgGpnqrXk.mjs → eimUGjiIP-b8HiM6.mjs} +55 -55
- package/node/esm/{Bbf1Pm9Gk7YpLTvg.mjs → icn2nX5Z8e_3mNAv.mjs} +1 -1
- package/node/esm/index.mjs +740 -603
- package/node/esm/{Ct3h15sCus4Tgt6M.mjs → lGJ42sHqg5if2bba.mjs} +624 -616
- package/node/esm/{CdJHUJSBRHZoryPe.mjs → pYtP7wPyS96NQyXS.mjs} +59 -59
- package/package.json +6 -6
- package/resources/locales/de/model.msg.json +8 -2
- package/resources/locales/en/model.msg.json +9 -2
- package/types/scripting-api.json +10619 -10446
- package/types/scripting-enums.json +20 -1
- package/types/scripting.d.ts +1233 -296
- package/types/src/{sheet → anomalies}/_Anomalies.d.ts +3 -3
- package/types/src/anomalies/_FocusTable.d.ts +11 -0
- package/types/src/{sheet/_AnomalyFormulaChecks.d.ts → anomalies/_FormulaChecks.d.ts} +10 -2
- package/types/src/{sheet/_AnomalyLabelChecks.d.ts → anomalies/_LabelChecks.d.ts} +1 -1
- package/types/src/anomalies/_LiteralChecks.d.ts +35 -0
- package/types/src/anomalies/_SeriesChecks.d.ts +13 -0
- package/types/src/calculation/Calculation.d.ts +47 -9
- package/types/src/calculation/ExternalBookBindings.d.ts +2 -3
- package/types/src/calculation/ICalculation.d.ts +96 -9
- package/types/src/calculation/NamedFormulaCollection.d.ts +104 -8
- package/types/src/calculation/_CloneBoundary.d.ts +1 -1
- package/types/src/calculation/compiler/ASTTypes.d.ts +6 -2
- package/types/src/calculation/compiler/Types.d.ts +8 -0
- package/types/src/calculation/engine/CalcBackend.d.ts +104 -6
- package/types/src/calculation/executor/CalcExecutor.d.ts +73 -22
- package/types/src/calculation/executor/CalcExecutorUtils.d.ts +17 -1
- package/types/src/calculation/executor/_WhatIf.d.ts +50 -0
- package/types/src/calculation/formula/FormulaBlock.d.ts +4 -3
- package/types/src/calculation/formula/IFormulaBlock.d.ts +5 -0
- package/types/src/calculation/functions/_DataTableFunction.d.ts +14 -0
- package/types/src/calculation/grid/CalcGrid.d.ts +4 -6
- package/types/src/calculation/grid/CalcGridBackend.d.ts +5 -27
- package/types/src/calculation/grid/CalcGridProxy.d.ts +0 -2
- package/types/src/calculation/grid/CalcGridUtils.d.ts +4 -2
- package/types/src/calculation/grid/ICalcGrid.d.ts +16 -12
- package/types/src/calculation/grid/_CalcRequest.d.ts +17 -5
- package/types/src/calculation/spatial/FormulaSpatialValue.d.ts +2 -0
- package/types/src/calculation/spatial/SpillEntry.d.ts +16 -2
- package/types/src/calculation/state/CalcNode.d.ts +0 -1
- package/types/src/calculation/state/CalcScope.d.ts +29 -0
- package/types/src/calculation/state/CalcState.d.ts +26 -4
- package/types/src/calculation/state/CalculationContext.d.ts +28 -1
- package/types/src/calculation/state/DeferredCalls.d.ts +260 -0
- package/types/src/calculation/state/IContextContainer.d.ts +20 -0
- package/types/src/calculation/state/_PendingOverlayGrid.d.ts +6 -0
- package/types/src/calculation/state/_WhatIfLayer.d.ts +91 -0
- package/types/src/cell/ICell.d.ts +53 -34
- package/types/src/cellControl/CellControl.d.ts +67 -0
- package/types/src/cellControl/CellControlCollection.d.ts +29 -0
- package/types/src/cellControl/CellControlRegistry.d.ts +47 -0
- package/types/src/cellControl/ICellControl.d.ts +99 -0
- package/types/src/cellControl/ICellControlCollection.d.ts +67 -0
- package/types/src/cellControl/index.d.ts +4 -0
- package/types/src/cellRange/ICellRange.d.ts +207 -59
- package/types/src/cellRange/ICellRanges.d.ts +4 -3
- package/types/src/chart/layout/ChartLayout.d.ts +5 -1
- package/types/src/chart/resolve/_Resolve.d.ts +10 -0
- package/types/src/chart/resolve/_ResolvedChart.d.ts +5 -2
- package/types/src/collections/ISparseGrid.d.ts +11 -2
- package/types/src/collections/MixedTypedArrayList.d.ts +8 -2
- package/types/src/collections/SparseGrid.d.ts +3 -8
- package/types/src/condition/AnchoredConditional.d.ts +2 -2
- package/types/src/externalBook/IExternalBook.d.ts +3 -4
- package/types/src/fetch/Fetcher.d.ts +15 -0
- package/types/src/fetch/IFetcher.d.ts +47 -0
- package/types/src/fetch/_WorkbookFetch.d.ts +43 -0
- package/types/src/fetch/index.d.ts +3 -0
- package/types/src/fill/PaintUtils.d.ts +3 -1
- package/types/src/hyperlink/IHyperlink.d.ts +10 -0
- package/types/src/hyperlink/_Hyperlink.d.ts +4 -1
- package/types/src/index.d.ts +2 -1
- package/types/src/named/INamedCollection.d.ts +36 -0
- package/types/src/named/NamedCollection.d.ts +18 -0
- package/types/src/primitives/AsyncValue.d.ts +58 -0
- package/types/src/resource/IResource.d.ts +9 -0
- package/types/src/resource/IResourceCollection.d.ts +4 -0
- package/types/src/resource/Resource.d.ts +2 -0
- package/types/src/resource/_AddResource.d.ts +13 -0
- package/types/src/richData/CellImage.d.ts +95 -0
- package/types/src/richData/Hyperlink.d.ts +49 -0
- package/types/src/richData/IRichDataCollection.d.ts +76 -0
- package/types/src/richData/IRichDataKind.d.ts +55 -11
- package/types/src/richData/RichArray.d.ts +42 -0
- package/types/src/richData/RichDataCollection.d.ts +23 -0
- package/types/src/richData/RichDataRegistry.d.ts +46 -14
- package/types/src/richData/RichDataValues.d.ts +20 -0
- package/types/src/richData/RichRecord.d.ts +68 -0
- package/types/src/richData/RichText.d.ts +5 -5
- package/types/src/richData/index.d.ts +6 -0
- package/types/src/scripting/FunctionArguments.d.ts +17 -1
- package/types/src/scripting/FunctionCollection.d.ts +8 -0
- package/types/src/scripting/Scripts.d.ts +10 -0
- package/types/src/scripting/TypedFunction.d.ts +2 -0
- package/types/src/sheet/ICellContainerOptions.d.ts +6 -0
- package/types/src/sheet/IWorksheet.d.ts +24 -17
- package/types/src/sheet/SheetCell.d.ts +17 -1
- package/types/src/sheet/SheetRange.d.ts +8 -2
- package/types/src/sheet/SheetRanges.d.ts +2 -2
- package/types/src/sheet/Worksheet.d.ts +110 -56
- package/types/src/sheet/_ListenerAnchor.d.ts +7 -1
- package/types/src/sheet/_ScalarListFactory.d.ts +54 -6
- package/types/src/sheet/_SheetMutations.d.ts +4 -1
- package/types/src/sheet/_SheetStateTypes.d.ts +23 -11
- package/types/src/workbook/IWorkbook.d.ts +40 -1
- package/types/src/workbook/Workbook.d.ts +25 -3
- package/types/src/workbook/WorkbookRanges.d.ts +1 -1
- package/browser/esm/BGOFfpxr2jPIdqmV.mjs +0 -40
- package/browser/esm/f1IoRb7tEb0QmCSt.mjs +0 -110
- package/browser/esm/nvU0ClAbf0g94YBK.mjs +0 -1695
- package/node/esm/B084DssTcdBheTp_.mjs +0 -7966
- package/node/esm/Df1bL6VFvrqIdSLB.mjs +0 -40
- package/node/esm/DrTZbfemSLq2mseG.mjs +0 -111
- package/types/src/dataTable/DataTable.d.ts +0 -67
- package/types/src/dataTable/DataTableCollection.d.ts +0 -19
- package/types/src/dataTable/IDataTable.d.ts +0 -99
- package/types/src/dataTable/IDataTableCollection.d.ts +0 -18
- package/types/src/dataTable/index.d.ts +0 -6
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.8.0-beta.
|
|
2
|
+
* @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.8.0-beta.12
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
7
|
+
import { $n as e, Bn as t, Gn as s, Hn as r, In as i, Jn as n, Kn as o, Pn as a, Qn as h, Rn as l, Un as u, Wn as c, Xn as p, Yn as g, Zn as m, ar as O, br as _, dr as E, er as L, fr as f, gr as A, hr as C, ir as T, nr as N, or as U, pr as S, qn as d, rr as x, tr as R, zn as I } from "./Vocy-I9dKzZMr0Ct.mjs";
|
|
8
8
|
import { FormulaError as M } from "@sheetxl/primitives";
|
|
9
9
|
import { EOF as P, EmbeddedActionsParser as b, Lexer as v, createToken as k, defaultParserErrorProvider as w } from "chevrotain";
|
|
10
10
|
var y = class e {
|
|
11
11
|
static shared(t) {
|
|
12
|
-
const s = t?.locale ??
|
|
12
|
+
const s = t?.locale ?? A, r = t?.maxColumn ?? D, i = t?.maxRow ?? G;
|
|
13
13
|
let n = $.get(s);
|
|
14
14
|
n || (n = /* @__PURE__ */ new Map(), $.set(s, n));
|
|
15
15
|
const o = `${r}:${i}`;
|
|
@@ -21,7 +21,7 @@ var y = class e {
|
|
|
21
21
|
}), n.set(o, a)), a;
|
|
22
22
|
}
|
|
23
23
|
constructor(e) {
|
|
24
|
-
const t = e?.maxColumn ?? D, s = e?.maxRow ?? G, r = e?.locale ??
|
|
24
|
+
const t = e?.maxColumn ?? D, s = e?.maxRow ?? G, r = e?.locale ?? A;
|
|
25
25
|
this._locale = r, this._maxColumn = t, this._maxRow = s;
|
|
26
26
|
const { separatorFunction: i, separatorColumn: n, separatorRow: o, separatorDecimal: a } = r.separators;
|
|
27
27
|
if (n === o) throw new Error(`FormulaLexer: separatorColumn and separatorRow must differ (both '${n}')`);
|
|
@@ -37,12 +37,12 @@ var y = class e {
|
|
|
37
37
|
pattern: /[a-zA-Z_\u007F-\uFFFF]+[a-zA-Z0-9_.\u007F-\uFFFF]*(?=\()/
|
|
38
38
|
}), c = k({
|
|
39
39
|
name: "TableReference",
|
|
40
|
-
pattern: { exec:
|
|
40
|
+
pattern: { exec: f },
|
|
41
41
|
line_breaks: !1,
|
|
42
42
|
start_chars_hint: B
|
|
43
43
|
}), p = k({
|
|
44
44
|
name: "BracketedString",
|
|
45
|
-
pattern: { exec:
|
|
45
|
+
pattern: { exec: E },
|
|
46
46
|
line_breaks: !1,
|
|
47
47
|
start_chars_hint: [91],
|
|
48
48
|
longer_alt: [c, l]
|
|
@@ -69,20 +69,20 @@ var y = class e {
|
|
|
69
69
|
}), _ = k({
|
|
70
70
|
name: "RefError",
|
|
71
71
|
pattern: new RegExp(g(r.errorRefs) + ["#REF!", "#NAME\\?"].map(m).join("|"))
|
|
72
|
-
}),
|
|
72
|
+
}), L = k({
|
|
73
73
|
name: "SingleQuotedString",
|
|
74
74
|
pattern: /'(''|[^'])*'/
|
|
75
|
-
}),
|
|
75
|
+
}), C = k({
|
|
76
76
|
name: "SheetQuoted",
|
|
77
77
|
pattern: /'(?:''|[^'])*?'!/
|
|
78
|
-
}),
|
|
78
|
+
}), T = k({
|
|
79
79
|
name: "Sheet",
|
|
80
80
|
pattern: /[A-Za-z_.\d\u007F-\uFFFF]*!/
|
|
81
|
-
}),
|
|
81
|
+
}), N = /[a-zA-Z_\\\u007F-\uFFFF][a-zA-Z0-9_.?\\\u007F-\uFFFF]*:?/y, U = k({
|
|
82
82
|
name: "NamedToken",
|
|
83
83
|
pattern: { exec: (e, t) => {
|
|
84
|
-
|
|
85
|
-
const s =
|
|
84
|
+
N.lastIndex = t;
|
|
85
|
+
const s = N.exec(e);
|
|
86
86
|
if (!s) return null;
|
|
87
87
|
let r = s[0];
|
|
88
88
|
const i = r.indexOf(".:");
|
|
@@ -90,24 +90,24 @@ var y = class e {
|
|
|
90
90
|
} },
|
|
91
91
|
line_breaks: !1,
|
|
92
92
|
start_chars_hint: B
|
|
93
|
-
}),
|
|
93
|
+
}), S = k({
|
|
94
94
|
name: "Cell",
|
|
95
95
|
pattern: { exec: W(t, s) },
|
|
96
96
|
line_breaks: !1,
|
|
97
97
|
start_chars_hint: [36, ...F],
|
|
98
|
-
longer_alt:
|
|
99
|
-
}),
|
|
98
|
+
longer_alt: U
|
|
99
|
+
}), d = k({
|
|
100
100
|
name: "Column",
|
|
101
101
|
pattern: { exec: z(t) },
|
|
102
102
|
line_breaks: !1,
|
|
103
103
|
start_chars_hint: [36, ...F],
|
|
104
|
-
longer_alt:
|
|
105
|
-
}),
|
|
104
|
+
longer_alt: U
|
|
105
|
+
}), x = k({
|
|
106
106
|
name: "AbsRow",
|
|
107
107
|
pattern: /[$][0-9]+/
|
|
108
|
-
}),
|
|
108
|
+
}), R = "." === a ? "\\." : a, I = k({
|
|
109
109
|
name: "NumberToken",
|
|
110
|
-
pattern: new RegExp(`[0-9]+${
|
|
110
|
+
pattern: new RegExp(`[0-9]+${R}(?!:)[0-9]*([eE][+-]?[0-9]+|\\*\\*[+-]?[0-9]+)?|${R}[0-9]+([eE][+-]?[0-9]+|\\*\\*[+-]?[0-9]+)?|[0-9]+[eE][+-]?[0-9]+`)
|
|
111
111
|
}), M = k({
|
|
112
112
|
name: "ScientificDigit",
|
|
113
113
|
pattern: /[0-9]+\*\*[+-]?[0-9]+/
|
|
@@ -134,10 +134,10 @@ var y = class e {
|
|
|
134
134
|
}), j = k({
|
|
135
135
|
name: "RangeOp",
|
|
136
136
|
pattern: /:/
|
|
137
|
-
}),
|
|
137
|
+
}), Q = k({
|
|
138
138
|
name: "RangeTrimFullOp",
|
|
139
139
|
pattern: /\.:\./
|
|
140
|
-
}),
|
|
140
|
+
}), Z = k({
|
|
141
141
|
name: "RangeTrimLeadingOp",
|
|
142
142
|
pattern: /\.:/
|
|
143
143
|
}), q = k({
|
|
@@ -198,9 +198,9 @@ var y = class e {
|
|
|
198
198
|
}), ge = [
|
|
199
199
|
h,
|
|
200
200
|
l,
|
|
201
|
+
C,
|
|
201
202
|
L,
|
|
202
|
-
|
|
203
|
-
f,
|
|
203
|
+
T,
|
|
204
204
|
u,
|
|
205
205
|
c,
|
|
206
206
|
p,
|
|
@@ -209,20 +209,20 @@ var y = class e {
|
|
|
209
209
|
y,
|
|
210
210
|
...n !== i ? [$] : [],
|
|
211
211
|
Y,
|
|
212
|
-
Z,
|
|
213
212
|
Q,
|
|
213
|
+
Z,
|
|
214
214
|
q,
|
|
215
215
|
j,
|
|
216
|
-
T,
|
|
217
|
-
w,
|
|
218
|
-
N,
|
|
219
216
|
S,
|
|
217
|
+
w,
|
|
218
|
+
d,
|
|
219
|
+
x,
|
|
220
220
|
I,
|
|
221
221
|
M,
|
|
222
222
|
P,
|
|
223
223
|
le,
|
|
224
224
|
ne,
|
|
225
|
-
|
|
225
|
+
U,
|
|
226
226
|
K,
|
|
227
227
|
H,
|
|
228
228
|
J,
|
|
@@ -355,9 +355,9 @@ function V(e) {
|
|
|
355
355
|
return new RegExp(e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
|
|
356
356
|
}
|
|
357
357
|
var j = class {
|
|
358
|
-
constructor(e =
|
|
358
|
+
constructor(e = A) {
|
|
359
359
|
const t = function(e) {
|
|
360
|
-
const t = [...
|
|
360
|
+
const t = [...a];
|
|
361
361
|
if (e) for (const s of Object.values(e)) {
|
|
362
362
|
const e = s?.trim();
|
|
363
363
|
e && !t.some((t) => t.toLowerCase() === e.toLowerCase()) && t.push(e);
|
|
@@ -403,8 +403,8 @@ var j = class {
|
|
|
403
403
|
tokenize(e) {
|
|
404
404
|
return this._lexer.tokenize(e);
|
|
405
405
|
}
|
|
406
|
-
},
|
|
407
|
-
constructor(e =
|
|
406
|
+
}, Q = class extends b {
|
|
407
|
+
constructor(e = A) {
|
|
408
408
|
const t = new j(e), s = t.getVocabulary();
|
|
409
409
|
super(s, {
|
|
410
410
|
nodeLocationTracking: "none",
|
|
@@ -412,83 +412,83 @@ var j = class {
|
|
|
412
412
|
skipValidations: !0,
|
|
413
413
|
recoveryEnabled: !1
|
|
414
414
|
}), this._lexer = t;
|
|
415
|
-
const { TableSpecifier: r, BracketedColumn: i, BareSpecifier: n, ColumnSep:
|
|
416
|
-
|
|
417
|
-
const e = [], t =
|
|
418
|
-
return
|
|
415
|
+
const { TableSpecifier: r, BracketedColumn: i, BareSpecifier: n, ColumnSep: a, ListSep: h } = s, l = this;
|
|
416
|
+
l.RULE("ruleContent", () => {
|
|
417
|
+
const e = [], t = l.SUBRULE(l.ruleItem);
|
|
418
|
+
return l.ACTION(() => {
|
|
419
419
|
t && e.push(t);
|
|
420
|
-
}),
|
|
421
|
-
|
|
422
|
-
const t =
|
|
423
|
-
|
|
420
|
+
}), l.MANY(() => {
|
|
421
|
+
l.CONSUME(h), l.OPTION(() => {
|
|
422
|
+
const t = l.SUBRULE2(l.ruleItem);
|
|
423
|
+
l.ACTION(() => {
|
|
424
424
|
t && e.push(t);
|
|
425
425
|
});
|
|
426
426
|
});
|
|
427
427
|
}), e;
|
|
428
|
-
}),
|
|
429
|
-
const t =
|
|
430
|
-
return
|
|
431
|
-
const s =
|
|
428
|
+
}), l.RULE("ruleItem", () => l.OR([{ ALT: () => l.SUBRULE(l.ruleSpecifier) }, { ALT: () => l.SUBRULE(l.ruleColumnOrRange) }])), l.RULE("ruleSpecifier", () => l.OR([{ ALT: () => {
|
|
429
|
+
const t = l.CONSUME(r);
|
|
430
|
+
return l.ACTION(() => {
|
|
431
|
+
const s = U(t.image, e);
|
|
432
432
|
return s.image = t.image, s;
|
|
433
433
|
});
|
|
434
434
|
} }, { ALT: () => {
|
|
435
|
-
const t =
|
|
436
|
-
return
|
|
437
|
-
const s =
|
|
435
|
+
const t = l.CONSUME(n);
|
|
436
|
+
return l.ACTION(() => {
|
|
437
|
+
const s = U(t.image, e);
|
|
438
438
|
return s.image = t.image, s;
|
|
439
439
|
});
|
|
440
|
-
} }])),
|
|
441
|
-
const e =
|
|
440
|
+
} }])), l.RULE("ruleColumnOrRange", () => {
|
|
441
|
+
const e = l.CONSUME(i);
|
|
442
442
|
let t, s;
|
|
443
|
-
return
|
|
444
|
-
t =
|
|
445
|
-
}),
|
|
446
|
-
const r =
|
|
443
|
+
return l.OPTION(() => {
|
|
444
|
+
t = l.CONSUME(a), s = l.CONSUME2(i);
|
|
445
|
+
}), l.ACTION(() => {
|
|
446
|
+
const r = T(e.image);
|
|
447
447
|
if (r.image = e.image, !s) return r;
|
|
448
|
-
const i =
|
|
448
|
+
const i = T(s.image);
|
|
449
449
|
i.image = s.image;
|
|
450
|
-
const n =
|
|
450
|
+
const n = o(":", r, i, !0);
|
|
451
451
|
return n.image = t?.image ?? ":", n;
|
|
452
452
|
});
|
|
453
|
-
}),
|
|
453
|
+
}), l.performSelfAnalysis();
|
|
454
454
|
}
|
|
455
455
|
_parseInner(e) {
|
|
456
456
|
const t = this._lexer.tokenize(e);
|
|
457
457
|
return t.errors.length > 0 || 0 === t.tokens.length ? [] : (this.input = t.tokens, this.reset(), this.ruleContent() ?? []);
|
|
458
458
|
}
|
|
459
|
-
_parseContent(
|
|
460
|
-
if (!e) return [];
|
|
461
|
-
const t = e.trim();
|
|
459
|
+
_parseContent(t) {
|
|
462
460
|
if (!t) return [];
|
|
463
|
-
const s = t
|
|
464
|
-
if (
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
461
|
+
const s = t.trim();
|
|
462
|
+
if (!s) return [];
|
|
463
|
+
const r = s[0];
|
|
464
|
+
if ("@" === r) {
|
|
465
|
+
const t = s.slice(1).trim();
|
|
466
|
+
if (!t) {
|
|
467
|
+
const t = e("@", null, !0);
|
|
468
|
+
return t.image = "@", [t];
|
|
469
469
|
}
|
|
470
|
-
if ("[" ===
|
|
471
|
-
const
|
|
472
|
-
if (1 ===
|
|
473
|
-
const
|
|
474
|
-
return
|
|
470
|
+
if ("[" === t.charAt(0)) {
|
|
471
|
+
const s = this._parseInner(t);
|
|
472
|
+
if (1 === s.length && "infix" === s[0].type) {
|
|
473
|
+
const t = e("@", s[0], !0);
|
|
474
|
+
return t.image = "@", [t];
|
|
475
475
|
}
|
|
476
476
|
}
|
|
477
|
-
const
|
|
478
|
-
|
|
479
|
-
const
|
|
480
|
-
return
|
|
477
|
+
const r = T(t);
|
|
478
|
+
r.image = t;
|
|
479
|
+
const i = e("@", r, !0);
|
|
480
|
+
return i.image = "@", [i];
|
|
481
481
|
}
|
|
482
|
-
if ("[" !==
|
|
483
|
-
const
|
|
484
|
-
return
|
|
482
|
+
if ("[" !== r && "#" !== r) {
|
|
483
|
+
const e = T(t);
|
|
484
|
+
return e.image = t, [e];
|
|
485
485
|
}
|
|
486
|
-
return this._parseInner(
|
|
486
|
+
return this._parseInner(s);
|
|
487
487
|
}
|
|
488
488
|
parse(e, t, s) {
|
|
489
489
|
this.reset();
|
|
490
490
|
const r = () => ({
|
|
491
|
-
root:
|
|
491
|
+
root: O("", []),
|
|
492
492
|
errors: []
|
|
493
493
|
});
|
|
494
494
|
if (!s) return r();
|
|
@@ -501,11 +501,11 @@ var j = class {
|
|
|
501
501
|
if (-1 === n) return r();
|
|
502
502
|
const o = s.slice(0, n), a = s.slice(n + 1, -1), h = this._parseContent(a);
|
|
503
503
|
return {
|
|
504
|
-
root:
|
|
504
|
+
root: O(o, h),
|
|
505
505
|
errors: this.errors.length > 0 ? [...this.errors] : []
|
|
506
506
|
};
|
|
507
507
|
}
|
|
508
|
-
},
|
|
508
|
+
}, Z = /* @__PURE__ */ new Set([
|
|
509
509
|
":",
|
|
510
510
|
".:.",
|
|
511
511
|
".:",
|
|
@@ -516,7 +516,7 @@ var j = class {
|
|
|
516
516
|
":."
|
|
517
517
|
]), K = (e) => {
|
|
518
518
|
if (!e) return null;
|
|
519
|
-
if (e.type ===
|
|
519
|
+
if (e.type === _.Cell) {
|
|
520
520
|
const t = e.value;
|
|
521
521
|
return t.rowIndex === Number.MIN_SAFE_INTEGER ? "col" : t.colIndex === Number.MIN_SAFE_INTEGER ? "row" : null;
|
|
522
522
|
}
|
|
@@ -546,53 +546,53 @@ var te = {
|
|
|
546
546
|
return e.expected === P && t ? `Unexpected '${t}'` : w.buildMismatchTokenMessage(e);
|
|
547
547
|
}
|
|
548
548
|
}, se = class extends b {
|
|
549
|
-
constructor(
|
|
550
|
-
const
|
|
551
|
-
super(
|
|
549
|
+
constructor(a) {
|
|
550
|
+
const l = a?.lexer ?? y.shared(a?.lexerOptions), O = l.getVocabulary();
|
|
551
|
+
super(O, {
|
|
552
552
|
skipValidations: !0,
|
|
553
553
|
recoveryEnabled: !0,
|
|
554
|
-
...
|
|
554
|
+
...a,
|
|
555
555
|
nodeLocationTracking: "full",
|
|
556
556
|
errorMessageProvider: te,
|
|
557
557
|
maxLookahead: 1
|
|
558
558
|
}), this._ruleInfixOp = this.RULE("ruleInfixOp", () => {
|
|
559
|
-
const { PlusOp: e, MinOp: t, MulOp:
|
|
559
|
+
const { PlusOp: e, MinOp: t, MulOp: s, DivOp: r, ExOp: n, ConcatOp: a, GtOp: h, EqOp: l, LtOp: u, NeqOp: c, GteOp: p, LteOp: g } = this._vocab, m = [];
|
|
560
560
|
return m.push({ node: this.SUBRULE(this._rulePostfixOp) }), this.MANY(() => {
|
|
561
|
-
const
|
|
561
|
+
const i = this.OR(this._c1 || (this._c1 = [
|
|
562
562
|
{ ALT: () => this.CONSUME(e).image },
|
|
563
563
|
{ ALT: () => this.CONSUME(t).image },
|
|
564
|
+
{ ALT: () => this.CONSUME(s).image },
|
|
564
565
|
{ ALT: () => this.CONSUME(r).image },
|
|
565
|
-
{ ALT: () => this.CONSUME(i).image },
|
|
566
566
|
{ ALT: () => this.CONSUME(n).image },
|
|
567
|
-
{ ALT: () => this.CONSUME(o).image },
|
|
568
567
|
{ ALT: () => this.CONSUME(a).image },
|
|
569
568
|
{ ALT: () => this.CONSUME(h).image },
|
|
569
|
+
{ ALT: () => this.CONSUME(l).image },
|
|
570
570
|
{ ALT: () => this.CONSUME(u).image },
|
|
571
571
|
{ ALT: () => this.CONSUME(c).image },
|
|
572
572
|
{ ALT: () => this.CONSUME(p).image },
|
|
573
573
|
{ ALT: () => this.CONSUME(g).image }
|
|
574
|
-
])),
|
|
575
|
-
value:
|
|
574
|
+
])), o = {
|
|
575
|
+
value: i,
|
|
576
576
|
index: this.getLexerPosition(),
|
|
577
|
-
isRange:
|
|
577
|
+
isRange: S.includes(i)
|
|
578
578
|
}, O = this.SUBRULE2(this._rulePostfixOp);
|
|
579
579
|
m.push({
|
|
580
|
-
op:
|
|
580
|
+
op: o,
|
|
581
581
|
node: O
|
|
582
582
|
});
|
|
583
583
|
}), this.ACTION(() => {
|
|
584
584
|
let e = m.length - 1;
|
|
585
|
-
const t =
|
|
586
|
-
for (let
|
|
587
|
-
const t = s
|
|
588
|
-
let
|
|
589
|
-
for (;
|
|
590
|
-
const s = m[
|
|
585
|
+
const t = i.length;
|
|
586
|
+
for (let s = 0; e > 0 && s < t; s++) {
|
|
587
|
+
const t = i[s];
|
|
588
|
+
let r = 1;
|
|
589
|
+
for (; r < m.length;) {
|
|
590
|
+
const s = m[r].op;
|
|
591
591
|
if (t.includes(s.value)) {
|
|
592
|
-
const t = m[
|
|
593
|
-
let n =
|
|
594
|
-
n = this._tag(n, s.index), m[
|
|
595
|
-
} else
|
|
592
|
+
const t = m[r - 1].node, i = m[r].node;
|
|
593
|
+
let n = o(s.value, t, i, s.isRange);
|
|
594
|
+
n = this._tag(n, s.index), m[r - 1].node = n, m.splice(r, 1), e--;
|
|
595
|
+
} else r++;
|
|
596
596
|
}
|
|
597
597
|
}
|
|
598
598
|
}), m[0].node;
|
|
@@ -611,30 +611,30 @@ var te = {
|
|
|
611
611
|
}), this.ACTION(() => {
|
|
612
612
|
const e = s.length;
|
|
613
613
|
if (0 !== e) for (let r = 0; r < e; r++) {
|
|
614
|
-
const e = s[r], i = e[0], n = e[1], o =
|
|
615
|
-
t =
|
|
614
|
+
const e = s[r], i = e[0], n = e[1], o = S.includes(i);
|
|
615
|
+
t = h(i, t, o), t = this._tag(t, n);
|
|
616
616
|
}
|
|
617
617
|
}), t;
|
|
618
618
|
}), this._rulePrefixOp = this.RULE("rulePrefixOp", () => {
|
|
619
|
-
const { PlusOp:
|
|
619
|
+
const { PlusOp: t, MinOp: s, ImplicitIntersectOp: r } = this._vocab, i = [];
|
|
620
620
|
this.MANY(() => {
|
|
621
|
-
const
|
|
622
|
-
{ ALT: () => this.CONSUME(e).image },
|
|
621
|
+
const e = this.OR([
|
|
623
622
|
{ ALT: () => this.CONSUME(t).image },
|
|
624
|
-
{ ALT: () => this.CONSUME(s).image }
|
|
623
|
+
{ ALT: () => this.CONSUME(s).image },
|
|
624
|
+
{ ALT: () => this.CONSUME(r).image }
|
|
625
625
|
]);
|
|
626
626
|
this.ACTION(() => {
|
|
627
|
-
|
|
627
|
+
i.push([e, this.getLexerPosition()]);
|
|
628
628
|
});
|
|
629
629
|
});
|
|
630
|
-
let
|
|
630
|
+
let n = this.SUBRULE(this._ruleRangeOp);
|
|
631
631
|
return this.ACTION(() => {
|
|
632
|
-
const
|
|
633
|
-
if (0 !==
|
|
634
|
-
const
|
|
635
|
-
|
|
632
|
+
const t = i.length;
|
|
633
|
+
if (0 !== t) for (let s = t - 1; s >= 0; s--) {
|
|
634
|
+
const t = i[s], r = t[0], o = t[1], a = S.includes(r);
|
|
635
|
+
n = e(r, n, a), n = this._tag(n, o);
|
|
636
636
|
}
|
|
637
|
-
}),
|
|
637
|
+
}), n;
|
|
638
638
|
}), this._ruleRangeOp = this.RULE("ruleRangeOp", () => {
|
|
639
639
|
const { RangeOp: e, RangeTrimFullOp: t, RangeTrimLeadingOp: s, RangeTrimTrailingOp: r, ArrayAnchorOp: i } = this._vocab, n = [];
|
|
640
640
|
return n.push({ node: this.SUBRULE(this._ruleCallOp) }), this.MANY2(() => {
|
|
@@ -659,17 +659,17 @@ var te = {
|
|
|
659
659
|
for (let e = 1; e < n.length; e++) {
|
|
660
660
|
const t = n[e];
|
|
661
661
|
if (void 0 !== t.anchor) {
|
|
662
|
-
n[0].node = this._tag(
|
|
662
|
+
n[0].node = this._tag(h("#", n[0].node, !0), t.anchor);
|
|
663
663
|
continue;
|
|
664
664
|
}
|
|
665
665
|
const s = t.op;
|
|
666
|
-
let r =
|
|
666
|
+
let r = o(s.value, n[0].node, t.node, !0);
|
|
667
667
|
r = this._tag(r, s.index), n[0].node = r;
|
|
668
668
|
}
|
|
669
669
|
}), n[0].node;
|
|
670
670
|
}), this._ruleCallOp = this.RULE("ruleCallOp", () => {
|
|
671
|
-
const { OpenParen: e, CloseParen:
|
|
672
|
-
let
|
|
671
|
+
const { OpenParen: e, CloseParen: s } = this._vocab;
|
|
672
|
+
let r = this.SUBRULE(this._ruleFormula);
|
|
673
673
|
return this.MANY({
|
|
674
674
|
GATE: () => {
|
|
675
675
|
const t = this.LA(0), s = this.LA(1);
|
|
@@ -677,12 +677,12 @@ var te = {
|
|
|
677
677
|
},
|
|
678
678
|
DEF: () => {
|
|
679
679
|
this.CONSUME(e);
|
|
680
|
-
const
|
|
680
|
+
const i = this.getLexerPosition(), n = this.SUBRULE(this._ruleFunctionArguments), o = r, a = this.ACTION(() => this._tag(t(o, n), i)), h = this.OPTION(() => this.CONSUME(s));
|
|
681
681
|
this.ACTION(() => {
|
|
682
|
-
|
|
682
|
+
h || this._reportError(a, "Missing closing parenthesis ')'", i), this._tagClose(a, this.getLexerPosition()), r = a;
|
|
683
683
|
});
|
|
684
684
|
}
|
|
685
|
-
}),
|
|
685
|
+
}), r;
|
|
686
686
|
}), this._ruleIntersectOp = this.RULE("ruleIntersectOp", () => {
|
|
687
687
|
const e = [this.SUBRULE(this._ruleInfixOp)];
|
|
688
688
|
return this.MANY(() => {
|
|
@@ -699,14 +699,14 @@ var te = {
|
|
|
699
699
|
for (; e.length > 1;) {
|
|
700
700
|
let t = e.length - 1;
|
|
701
701
|
for (let s = 0; s < t; s++) {
|
|
702
|
-
const r = e[s], i = e[s + 1], n =
|
|
703
|
-
|
|
704
|
-
const
|
|
705
|
-
if (void 0 !==
|
|
706
|
-
const e = this.input[
|
|
702
|
+
const r = e[s], i = e[s + 1], n = o(" ", r, i, !0), a = this._tokenMap.get(r);
|
|
703
|
+
a && delete a.tokenIndexClose;
|
|
704
|
+
const h = this._tokenMap.get(i), l = h?.tokenIndex;
|
|
705
|
+
if (void 0 !== l) {
|
|
706
|
+
const e = this.input[l], t = this.input[l - 1]?.endOffset ?? -1, s = this._inputText.slice(t + 1, e.startOffset).slice(0, -1);
|
|
707
707
|
s.length > 0 && (n.wsBefore = s);
|
|
708
708
|
}
|
|
709
|
-
|
|
709
|
+
h && delete h.tokenIndex, s + 1 < t && h && delete h.tokenIndexClose, e.splice(s, 2, n), s--, t--;
|
|
710
710
|
}
|
|
711
711
|
}
|
|
712
712
|
}), e[0];
|
|
@@ -729,83 +729,83 @@ var te = {
|
|
|
729
729
|
}), t;
|
|
730
730
|
}), this._ruleParen = this.RULE("ruleParen", () => {
|
|
731
731
|
const { OpenParen: e, CloseParen: t } = this._vocab;
|
|
732
|
-
return this._processParen(
|
|
732
|
+
return this._processParen(_.Paren, e, t);
|
|
733
733
|
}), this._ruleLiteralArray = this.RULE("ruleLiteralArray", () => {
|
|
734
|
-
const { OpenCurlyParen: e, CloseCurlyParen:
|
|
735
|
-
let
|
|
734
|
+
const { OpenCurlyParen: e, CloseCurlyParen: t, ColSeparator: s, RowSeparator: r } = this._vocab;
|
|
735
|
+
let i = g();
|
|
736
736
|
this.CONSUME(e);
|
|
737
|
-
const
|
|
738
|
-
let
|
|
739
|
-
const
|
|
737
|
+
const n = this.getLexerPosition();
|
|
738
|
+
let o = this.ACTION(() => this._tag(d(i), n));
|
|
739
|
+
const a = this.SUBRULE(this._ruleLiteralForArray);
|
|
740
740
|
this.ACTION(() => {
|
|
741
|
-
|
|
741
|
+
i.value.push(a);
|
|
742
742
|
}), this.MANY(() => {
|
|
743
743
|
let e = !1;
|
|
744
744
|
this.OR([{ ALT: () => {
|
|
745
|
-
this.CONSUME(
|
|
746
|
-
} }, { ALT: () => this.CONSUME(
|
|
747
|
-
const
|
|
745
|
+
this.CONSUME(s), e = !0;
|
|
746
|
+
} }, { ALT: () => this.CONSUME(r) }]);
|
|
747
|
+
const t = this.SUBRULE2(this._ruleLiteralForArray);
|
|
748
748
|
this.ACTION(() => {
|
|
749
|
-
e || (
|
|
749
|
+
e || (i = g(), o.value.push(i)), i.value.push(t);
|
|
750
750
|
});
|
|
751
751
|
});
|
|
752
|
-
const
|
|
753
|
-
return
|
|
752
|
+
const h = this.OPTION(() => this.CONSUME(t));
|
|
753
|
+
return o = this.ACTION(() => (h || this._reportError(o, "Missing closing parenthesis '}'", n), this._tagClose(o, this.getLexerPosition()))), o;
|
|
754
754
|
}), this._ruleLiteralForArray = this.RULE("ruleLiteralForArray", () => {
|
|
755
|
-
const { StringToken:
|
|
755
|
+
const { StringToken: e, BooleanToken: t, LiteralError: s, RefError: r } = this._vocab;
|
|
756
756
|
return this.OR([
|
|
757
757
|
{ ALT: () => {
|
|
758
|
-
const e = this.OPTION(() => this.SUBRULE(this._rulePlusMinusOp)), t = this.SUBRULE(this._ruleNumber), s = this.ACTION(() => this._tag(
|
|
759
|
-
return this.ACTION(() => e ?
|
|
758
|
+
const e = this.OPTION(() => this.SUBRULE(this._rulePlusMinusOp)), t = this.SUBRULE(this._ruleNumber), s = this.ACTION(() => this._tag(m(t.image, this._locale), this.getLexerPosition()));
|
|
759
|
+
return this.ACTION(() => e ? L(e.image, s) : s);
|
|
760
760
|
} },
|
|
761
761
|
{ ALT: () => {
|
|
762
|
-
const
|
|
763
|
-
return this.ACTION(() => this._tag(
|
|
762
|
+
const t = this.CONSUME(e);
|
|
763
|
+
return this.ACTION(() => this._tag(x(t.image), this.getLexerPosition()));
|
|
764
764
|
} },
|
|
765
765
|
{ ALT: () => {
|
|
766
|
-
const
|
|
767
|
-
return this.ACTION(() => this._tag(e
|
|
766
|
+
const e = this.CONSUME(t);
|
|
767
|
+
return this.ACTION(() => this._tag(I(e.image, this._locale), this.getLexerPosition()));
|
|
768
768
|
} },
|
|
769
769
|
{ ALT: () => {
|
|
770
|
-
const e = this.CONSUME(
|
|
771
|
-
return this.ACTION(() => this._tag(
|
|
770
|
+
const e = this.CONSUME(s);
|
|
771
|
+
return this.ACTION(() => this._tag(n(e.image, this._locale), this.getLexerPosition()));
|
|
772
772
|
} },
|
|
773
773
|
{ ALT: () => {
|
|
774
|
-
const e = this.CONSUME(
|
|
775
|
-
return this.ACTION(() => this._tag(
|
|
774
|
+
const e = this.CONSUME(r);
|
|
775
|
+
return this.ACTION(() => this._tag(R(e.image, this._locale), this.getLexerPosition()));
|
|
776
776
|
} }
|
|
777
777
|
]);
|
|
778
778
|
}), this._ruleLiteral = this.RULE("ruleLiteral", () => {
|
|
779
|
-
const { StringToken:
|
|
779
|
+
const { StringToken: e, BooleanToken: t, LiteralError: s, RefError: r } = this._vocab;
|
|
780
780
|
return this.OR([
|
|
781
781
|
{ ALT: () => {
|
|
782
782
|
const e = this.SUBRULE(this._ruleNumber);
|
|
783
|
-
return this.ACTION(() => this._tag(
|
|
783
|
+
return this.ACTION(() => this._tag(m(e.image, this._locale), this.getLexerPosition()));
|
|
784
784
|
} },
|
|
785
785
|
{ ALT: () => {
|
|
786
|
-
const
|
|
787
|
-
return this.ACTION(() => this._tag(
|
|
786
|
+
const t = this.CONSUME(e);
|
|
787
|
+
return this.ACTION(() => this._tag(x(t.image), this.getLexerPosition()));
|
|
788
788
|
} },
|
|
789
789
|
{ ALT: () => {
|
|
790
|
-
const
|
|
791
|
-
return this.ACTION(() => this._tag(e
|
|
790
|
+
const e = this.CONSUME(t);
|
|
791
|
+
return this.ACTION(() => this._tag(I(e.image, this._locale), this.getLexerPosition()));
|
|
792
792
|
} },
|
|
793
793
|
{ ALT: () => {
|
|
794
|
-
const e = this.CONSUME(
|
|
795
|
-
return this.ACTION(() => this._tag(
|
|
794
|
+
const e = this.CONSUME(s);
|
|
795
|
+
return this.ACTION(() => this._tag(n(e.image, this._locale), this.getLexerPosition()));
|
|
796
796
|
} },
|
|
797
797
|
{ ALT: () => {
|
|
798
|
-
const e = this.CONSUME(
|
|
799
|
-
return this.ACTION(() => this._tag(
|
|
798
|
+
const e = this.CONSUME(r);
|
|
799
|
+
return this.ACTION(() => this._tag(R(e.image, this._locale), this.getLexerPosition()));
|
|
800
800
|
} }
|
|
801
801
|
]);
|
|
802
802
|
}), this._ruleFunction = this.RULE("ruleFunction", () => {
|
|
803
|
-
const { FunctionToken: e, OpenParen: t, CloseParen:
|
|
803
|
+
const { FunctionToken: e, OpenParen: t, CloseParen: r } = this._vocab, i = this.CONSUME(e).image, n = this.getLexerPosition();
|
|
804
804
|
this.CONSUME(t);
|
|
805
|
-
const
|
|
806
|
-
let a = this.ACTION(() => this._tag(
|
|
807
|
-
const h = this.OPTION(() => this.CONSUME(
|
|
808
|
-
return a = this.ACTION(() => (h || this._reportError(a, "Missing closing parenthesis ')'",
|
|
805
|
+
const o = this.SUBRULE(this._ruleFunctionArguments);
|
|
806
|
+
let a = this.ACTION(() => this._tag(s(i, o), n));
|
|
807
|
+
const h = this.OPTION(() => this.CONSUME(r));
|
|
808
|
+
return a = this.ACTION(() => (h || this._reportError(a, "Missing closing parenthesis ')'", n), this._tagClose(a, this.getLexerPosition()))), a;
|
|
809
809
|
}), this._ruleFunctionArguments = this.RULE("ruleFunctionArguments", () => {
|
|
810
810
|
const { ArgSeparator: e, CloseParen: t } = this._vocab, s = [];
|
|
811
811
|
return this.OPTION({
|
|
@@ -814,11 +814,11 @@ var te = {
|
|
|
814
814
|
let t;
|
|
815
815
|
this.OPTION2(() => {
|
|
816
816
|
t = this.SUBRULE(this._ruleIntersectOp);
|
|
817
|
-
}), t = this.ACTION(() => t ?? this._tagClose(
|
|
817
|
+
}), t = this.ACTION(() => t ?? this._tagClose(c(), this.getLexerPosition())), s.push(t), this.MANY(() => {
|
|
818
818
|
let t;
|
|
819
819
|
this.CONSUME(e), this.OPTION3(() => {
|
|
820
820
|
t = this.SUBRULE2(this._ruleIntersectOp);
|
|
821
|
-
}), t = this.ACTION(() => t ?? this._tagClose(
|
|
821
|
+
}), t = this.ACTION(() => t ?? this._tagClose(c(), this.getLexerPosition())), s.push(t);
|
|
822
822
|
});
|
|
823
823
|
}
|
|
824
824
|
}), s;
|
|
@@ -837,14 +837,14 @@ var te = {
|
|
|
837
837
|
return this._tag(e.root, s);
|
|
838
838
|
});
|
|
839
839
|
}), this._ruleReference = this.RULE("ruleReference", () => {
|
|
840
|
-
const { Sheet: e, SheetQuoted: t, DivOp: s, MulOp:
|
|
840
|
+
const { Sheet: e, SheetQuoted: t, DivOp: s, MulOp: i, PlusOp: n, MinOp: o, ArgSeparator: a, Cell: h, NamedToken: l, SingleQuotedString: c, Column: g, AbsRow: m, DigitToken: O, RefError: E } = this._vocab;
|
|
841
841
|
let L, f;
|
|
842
842
|
this.OPTION2({
|
|
843
843
|
GATE: () => {
|
|
844
|
-
for (let
|
|
845
|
-
const h = this.LA(
|
|
844
|
+
for (let r = 1; r < 6; r++) {
|
|
845
|
+
const h = this.LA(r);
|
|
846
846
|
if (h.tokenType === e || h.tokenType === t) return !0;
|
|
847
|
-
if ("" === h.image || ")" === h.image || h.tokenType === s || h.tokenType ===
|
|
847
|
+
if ("" === h.image || ")" === h.image || h.tokenType === s || h.tokenType === i || h.tokenType === n || h.tokenType === o || h.tokenType === a) break;
|
|
848
848
|
}
|
|
849
849
|
return !1;
|
|
850
850
|
},
|
|
@@ -852,45 +852,45 @@ var te = {
|
|
|
852
852
|
f = this.getLexerPosition() + 1, L = this.SUBRULE(this._rulePrefixSheetName);
|
|
853
853
|
}
|
|
854
854
|
});
|
|
855
|
-
let
|
|
855
|
+
let A = this.OR([
|
|
856
856
|
{ ALT: () => {
|
|
857
|
-
const e = this.CONSUME(
|
|
858
|
-
return this.ACTION(() => this._tag(
|
|
857
|
+
const e = this.CONSUME(h), t = this.getLexerPosition();
|
|
858
|
+
return this.ACTION(() => this._tag(r(e.image, this.rowIndex, this.colIndex), t));
|
|
859
859
|
} },
|
|
860
860
|
{ ALT: () => {
|
|
861
|
-
const e = this.OR2([{ ALT: () => this.CONSUME(l) }, { ALT: () => this.CONSUME(
|
|
862
|
-
return this.ACTION(() => this._tag(
|
|
861
|
+
const e = this.OR2([{ ALT: () => this.CONSUME(l) }, { ALT: () => this.CONSUME(c) }]);
|
|
862
|
+
return this.ACTION(() => this._tag(p(e.image), this.getLexerPosition()));
|
|
863
863
|
} },
|
|
864
864
|
{ ALT: () => this.SUBRULE(this._ruleBracketedString) },
|
|
865
865
|
{ ALT: () => this.SUBRULE(this._ruleFunction) },
|
|
866
866
|
{ ALT: () => {
|
|
867
867
|
const e = this.CONSUME(g);
|
|
868
|
-
return this.ACTION(() => this._tag(
|
|
868
|
+
return this.ACTION(() => this._tag(u(e.image, this.colIndex), this.getLexerPosition()));
|
|
869
869
|
} },
|
|
870
870
|
{ ALT: () => {
|
|
871
871
|
const e = this.CONSUME(m);
|
|
872
|
-
return this.ACTION(() => this._tag(
|
|
872
|
+
return this.ACTION(() => this._tag(N(e.image, this.rowIndex), this.getLexerPosition()));
|
|
873
873
|
} },
|
|
874
874
|
{ ALT: () => {
|
|
875
|
-
const e = this.CONSUME(
|
|
876
|
-
return this.ACTION(() => this._tag(
|
|
875
|
+
const e = this.CONSUME(O);
|
|
876
|
+
return this.ACTION(() => this._tag(N(e.image, this.rowIndex), this.getLexerPosition()));
|
|
877
877
|
} },
|
|
878
878
|
{ ALT: () => {
|
|
879
879
|
const e = this.CONSUME(E);
|
|
880
|
-
return this.ACTION(() => this._tag(
|
|
880
|
+
return this.ACTION(() => this._tag(R(e.image, this._locale), this.getLexerPosition()));
|
|
881
881
|
} }
|
|
882
882
|
]);
|
|
883
883
|
return this.ACTION(() => {
|
|
884
|
-
if (L &&
|
|
885
|
-
if ("" === L.name) return void this._reportError(
|
|
886
|
-
let e =
|
|
887
|
-
if (
|
|
884
|
+
if (L && A) {
|
|
885
|
+
if ("" === L.name) return void this._reportError(A, `'${L.image}' is not a valid sheet reference — a '!' needs a sheet name before it`);
|
|
886
|
+
let e = A;
|
|
887
|
+
if (A.type === _.Postfix && A.inputs?.[0] && (e = A.inputs[0]), e.type === _.Cell || e.type === _.Named || e.type === _.Row || e.type === _.TableColumn || e.type === _.Error) {
|
|
888
888
|
e.value.scope = L.name, e.value.scopeImage = L.image;
|
|
889
889
|
const t = this._tokenMap.get(e);
|
|
890
890
|
t && void 0 !== f && (t.tokenIndex = f);
|
|
891
891
|
}
|
|
892
892
|
}
|
|
893
|
-
}),
|
|
893
|
+
}), A;
|
|
894
894
|
}), this._rulePrefixSheetName = this.RULE("rulePrefixSheetName", () => {
|
|
895
895
|
const { SheetQuoted: e, BracketedString: t, NamedToken: s, RangeOp: r, Sheet: i } = this._vocab;
|
|
896
896
|
return this.OR([{ ALT: () => {
|
|
@@ -927,12 +927,12 @@ var te = {
|
|
|
927
927
|
return this.MANY(() => {
|
|
928
928
|
this.CONSUME(e), s.push(this.SUBRULE2(this._ruleIntersectOp));
|
|
929
929
|
}), this.ACTION(() => 0 === s.length ? t : {
|
|
930
|
-
type:
|
|
930
|
+
type: _.List,
|
|
931
931
|
value: ",",
|
|
932
932
|
inputs: [t, ...s],
|
|
933
933
|
isReference: !0
|
|
934
934
|
});
|
|
935
|
-
}), this._lexer =
|
|
935
|
+
}), this._lexer = l, this._locale = l.getLocale(), this._vocab = O, this._srParser = a?.srParser ?? new Q(this._locale), this.performSelfAnalysis();
|
|
936
936
|
}
|
|
937
937
|
getLexer() {
|
|
938
938
|
return this._lexer;
|
|
@@ -942,26 +942,26 @@ var te = {
|
|
|
942
942
|
let i;
|
|
943
943
|
if (!r) return {
|
|
944
944
|
root: {
|
|
945
|
-
type:
|
|
945
|
+
type: _.Unparsed,
|
|
946
946
|
value: s
|
|
947
947
|
},
|
|
948
948
|
errors: []
|
|
949
949
|
};
|
|
950
950
|
const n = r.tokens;
|
|
951
951
|
if (0 === n.length) throw new M.Parse(J);
|
|
952
|
-
return this.input = n, this._inputText = s, this._inputTextLength = s.length, this.rowIndex = e, this.colIndex = t, this._astErrors = [], this._tokenMap = /* @__PURE__ */ new Map(), this.reset(), i = this._ruleRoot(), i && this._bindAllWhitespace(i), i =
|
|
953
|
-
const r = t.type, i = s?.isReference ? s.value : void 0, n = "string" == typeof i &&
|
|
954
|
-
if (n && r !==
|
|
955
|
-
const s =
|
|
956
|
-
return
|
|
952
|
+
return this.input = n, this._inputText = s, this._inputTextLength = s.length, this.rowIndex = e, this.colIndex = t, this._astErrors = [], this._tokenMap = /* @__PURE__ */ new Map(), this.reset(), i = this._ruleRoot(), i && this._bindAllWhitespace(i), i = C(i, (t, s) => {
|
|
953
|
+
const r = t.type, i = s?.isReference ? s.value : void 0, n = "string" == typeof i && Z.has(i), o = "string" == typeof i && q.has(i), a = n ? s.inputs : void 0, h = a ? a[0] === t ? a[1] : a[0] : void 0, u = this._lexer.getMaxRow();
|
|
954
|
+
if (n && r !== _.Cell && Number.isInteger(t.value)) {
|
|
955
|
+
const s = N(t.image, e);
|
|
956
|
+
return l(s, t), "row" !== K(h) ? this._reportError(s, `'${t.image}' is not a valid reference — a whole row can only pair with another row (as in ${t.image}:${t.image})`) : H(t.image, u) || this._reportError(s, `'${t.image}' is not a valid row — rows run from 1 to ${u}`), s;
|
|
957
957
|
}
|
|
958
|
-
if (o && r ===
|
|
959
|
-
if (r ===
|
|
958
|
+
if (o && r === _.Named) return this._reportError(t, `'${t.image ?? t.value?.nameId}' is a name — '${i}' needs a cell or range on both sides`), t;
|
|
959
|
+
if (r === _.Cell) {
|
|
960
960
|
const e = t.value, s = e.colIndex === Number.MIN_SAFE_INTEGER, r = e.rowIndex === Number.MIN_SAFE_INTEGER;
|
|
961
|
-
if ((s || r) && K(h) === (s ? "row" : "col")) return s && !H(t.image,
|
|
961
|
+
if ((s || r) && K(h) === (s ? "row" : "col")) return s && !H(t.image, u) && this._reportError(t, `'${t.image}' is not a valid row — rows run from 1 to ${u}`), t;
|
|
962
962
|
if (s || r || e.colIndex >= 16384) {
|
|
963
|
-
const n =
|
|
964
|
-
|
|
963
|
+
const n = p(t.image);
|
|
964
|
+
l(n, t);
|
|
965
965
|
const a = e.scope;
|
|
966
966
|
return a && (n.value.scope = a, n.value.scopeImage = e.scopeImage), s ? this._reportError(n, `'${t.image}' is not a valid reference — a row needs a column (use ${t.image}:${t.image} for the whole row)`) : r && t.image.includes("$") ? this._reportError(n, `'${t.image}' is not a valid reference — a whole column can only pair with another column (as in ${t.image}:${t.image})`) : o && this._reportError(n, `'${t.image}' is a name — '${i}' needs a cell or range on both sides`), n;
|
|
967
967
|
}
|
|
@@ -1024,7 +1024,7 @@ var te = {
|
|
|
1024
1024
|
_bindAllWhitespace(e) {
|
|
1025
1025
|
if (e) {
|
|
1026
1026
|
if (this._bindNodeWhitespace(e), e.inputs) for (const t of e.inputs) t && this._bindAllWhitespace(t);
|
|
1027
|
-
if (e.type ===
|
|
1027
|
+
if (e.type === _.Array && Array.isArray(e.value)) {
|
|
1028
1028
|
for (const t of e.value) if (t && Array.isArray(t.value)) for (const e of t.value) e && this._bindAllWhitespace(e);
|
|
1029
1029
|
}
|
|
1030
1030
|
}
|