@sheetxl/sdk 0.8.0-beta.15 → 0.8.0-beta.16
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/LICENSE.md +8 -7
- package/browser/esm/4MbBwfmW2hDXk9_w.mjs +165 -0
- package/browser/esm/{zjEXdQiQruTkUyf5.mjs → 9YWdxmSjzLN4j_ts.mjs} +22 -22
- package/browser/esm/B6BdiHigbUdbZp3J.mjs +686 -0
- package/browser/esm/{D8PxKK6OrmancpLT.mjs → BF_QwkZ_hs2rFoTT.mjs} +3 -3
- package/browser/esm/{Do8TQqQvnFXRlFu-.mjs → BMo2_9Ul36IwRm3S.mjs} +3 -3
- package/browser/esm/{DDQtExVGSoCzAf6-.mjs → BWY1qiidTUBVPJoD.mjs} +506 -502
- package/browser/esm/{DA4S5eqog20pG7b2.mjs → Bf80epSsm_RyAOb9.mjs} +29 -29
- package/browser/esm/{FHp0QfwZMIfP0Sry.mjs → BfoE6Dn_GQCIkQD3.mjs} +2 -2
- package/browser/esm/{D4ZCoKyNCJvDQAkx.mjs → BlMYYQZP-QM-iBHz.mjs} +23 -22
- package/browser/esm/{CWyzk_3eDCR9bKq6.mjs → BqT-ASHP0NVSUUnY.mjs} +1528 -1433
- package/browser/esm/{DwH4H_p6gTAcpQ17.mjs → BtNuoQIrrHw_jnbJ.mjs} +4 -4
- package/browser/esm/BxFzcCYhvo9NXFjC.mjs +527 -0
- package/browser/esm/{BsGN0Tk0jVc2n0hy.mjs → BxYuRTSF9ykc-Tpz.mjs} +3 -3
- package/browser/esm/{KgTozk3nvOZzEG27.mjs → C2PvZwqK-uvsugVS.mjs} +2 -2
- package/browser/esm/C3JOjQwdG9kAig7i.mjs +2017 -0
- package/browser/esm/{Blo0Hwg2ojXt99Dl.mjs → C5x0EzqElYGTiTQc.mjs} +2 -2
- package/browser/esm/{Bbrhl946_QbCz5WS.mjs → CMChv-fCFh68VQQt.mjs} +588 -587
- package/browser/esm/{Cl3jq6y4Idilod82.mjs → CRbQATfI0yZxe1kX.mjs} +3 -3
- package/browser/esm/{CxhXbk-5XhaK8UNs.mjs → CUu3zeHqcwMRYiov.mjs} +2 -2
- package/browser/esm/{CNM5d4p0Y7In0rTf.mjs → C_jLGkFemj55_BP3.mjs} +3 -3
- package/browser/esm/{BGPT-k25jo0UhtT5.mjs → CkZoDPUCK5jMUaeJ.mjs} +26901 -22016
- package/browser/esm/{DMbcmIZ-G2fbWn8v.mjs → D-iHJ3q4nwOLcn1D.mjs} +2 -2
- package/browser/esm/{KsfZhE6ocmYobGjY.mjs → D807piM0VSokWz-L.mjs} +2 -2
- package/browser/esm/{BVsG6Vpvb1ZzpURJ.mjs → DW3oQ39IF0bsc_lm.mjs} +2 -2
- package/browser/esm/{BzG0p8RdGDWHttVr.mjs → DcB52JPBPmkc3l1m.mjs} +4 -4
- package/browser/esm/{CZ_ZPliIkoh8BViV.mjs → DlVnybrgwZWxWN3_.mjs} +10 -10
- package/browser/esm/{CqzKBrmmV-fWRoK7.mjs → DvVhatd0J1ch3OCO.mjs} +22 -22
- package/browser/esm/{tm7XJ-Zd_04xWKG6.mjs → Dx9Fya60meMpuHqm.mjs} +2 -2
- package/browser/esm/{Blo0jHze0bQxnKh4.mjs → HV0FkJ6k3Ils318J.mjs} +78 -78
- package/browser/esm/{DJNLo8Rd_5UQP0U5.mjs → JV9Szh5qTssjxJoE.mjs} +2 -2
- package/browser/esm/{D0KMmRjGOQUs7Ls-.mjs → KpuD1kEcWB7cT0VM.mjs} +3 -3
- package/browser/esm/{Bw66vzKThXKvXvPI.mjs → U4FL-QeC0bRUhTEo.mjs} +2 -2
- package/browser/esm/{Dp4OIVjjAVhpD815.mjs → WLlpmgLN5OVLoLrC.mjs} +3 -3
- package/browser/esm/{D6OqcO9IWPaY211T.mjs → WR146UAqrsUsL39e.mjs} +2 -2
- package/browser/esm/{CPUobTehcKZllBDS.mjs → WcHfawW2lkTHtWUd.mjs} +51 -49
- package/browser/esm/{XrasOsWQ-64jwMn1.mjs → Zp5-cTJ0Llb6EfGi.mjs} +4 -4
- package/browser/esm/{CMSeF5rGzeuMUydM.mjs → ad9PX897hYE4Srkc.mjs} +3 -3
- package/browser/esm/{CIab4UYcHQQKTHeD.mjs → d_t-7d5BD1AdHg3u.mjs} +404 -404
- package/browser/esm/{L7SKr6r1tmMwFx6Q.mjs → dwGdnbV-CykjNrlm.mjs} +2 -2
- package/browser/esm/{DpaqR081c-Q7WemN.mjs → e69NcYnKMLnAmqyA.mjs} +2 -2
- package/browser/esm/index.mjs +886 -578
- package/browser/esm/{BN1MW1nuBndrzryn.mjs → r-o0UCm7KtluNmyK.mjs} +3 -3
- package/licenses/dependencies.txt +69 -69
- package/node/esm/{DjsOfZn5vYpB7L6U.mjs → 446KYBjJQa8g-8Gg.mjs} +52 -50
- package/node/esm/{BlHlBRvKGt-4CS0A.mjs → 5OfKfTRX2_y2NwpU.mjs} +2 -2
- package/node/esm/{BRnNpoS8VpkAhdVk.mjs → A3PEHO1HJvkHfb5n.mjs} +2 -2
- package/node/esm/{ZtF9EuipL7Z9Iwfs.mjs → B4WUGzJBkQu7BXRm.mjs} +2 -2
- package/node/esm/{DKdFasYVvjAitASZ.mjs → BH8J6vKSO5zI_TWo.mjs} +2 -2
- package/node/esm/BLmdKnkLwkb3wWe6.mjs +2040 -0
- package/node/esm/{D9RwzPR5s2mWrbCQ.mjs → BZSxu_ZqX8-Uczzn.mjs} +2 -2
- package/node/esm/{-afI0SRg_vgXtea7.mjs → BfPBiAgVmWhuFgFP.mjs} +3 -3
- package/node/esm/{OnkJkCGFDjamqIUQ.mjs → Bknw7zWZhl2-w1pi.mjs} +3 -3
- package/node/esm/{BNiG1ISiMjs-G2mE.mjs → BvIPsPiHhMclZ1kH.mjs} +22 -22
- package/node/esm/{B07QPde9GloqsW8e.mjs → By2TFKOjA1HekZap.mjs} +4 -4
- package/node/esm/{D9zb5xVRehABdbXL.mjs → BywIhvYkWk2o7MSW.mjs} +2 -2
- package/node/esm/{BZ0IRjh2hYuI86xW.mjs → C3zyhnMwQ2hRQBz7.mjs} +31 -30
- package/node/esm/{DVejVdSBXzAFQbqo.mjs → C884edhUf9yMqpPp.mjs} +2 -2
- package/node/esm/{DDIiQZTdeY4vdK8_.mjs → CDHY-0OyQ9348Brb.mjs} +189 -189
- package/node/esm/{BlzPuXtKvF3Qfr0p.mjs → CERNLhFrAwtu_p-q.mjs} +2 -2
- package/node/esm/{BfXLtDqsXXYeZ6LX.mjs → CFkX_Cn6avQqQiVC.mjs} +78 -78
- package/node/esm/CJDV8P3hI8lu--3Z.mjs +530 -0
- package/node/esm/{C6b4rM62pIWIywlM.mjs → CKwiipdPJGzAiPjg.mjs} +2 -2
- package/node/esm/{DUft-qpAS4MMANwG.mjs → CLtUMJfKsy4SevWE.mjs} +3 -3
- package/node/esm/{Cx9nQSsuyqhayyBS.mjs → CVPieTgKCwkL21nD.mjs} +32752 -27295
- package/node/esm/{DW3u4bBJIUaHZ6m-.mjs → C_fYuynP2a_70WdL.mjs} +2 -2
- package/node/esm/{C-JEySqMuKdpcKe0.mjs → CgdNA3B_GFG_yJiN.mjs} +3 -3
- package/node/esm/Cs3ibv6YHCDwLRlk.mjs +115 -0
- package/node/esm/{CjwmkzMtjj6OMJbO.mjs → Cxak8i2NidZ4Uv6v.mjs} +487 -483
- package/node/esm/{MtRwC1PMkOEb1Nty.mjs → D88A3UpCyGRjcX3U.mjs} +3 -3
- package/node/esm/{B8KEX44VZTFTTKb3.mjs → DBIUe2BC9xU7qMHR.mjs} +3 -3
- package/node/esm/{C7h7SvhWNwQ9TfGh.mjs → DELfV5HQZo1mInBd.mjs} +4 -4
- package/node/esm/{WBHD7ECKG6HZ5UpY.mjs → DOt3t-13tsnM7Fj6.mjs} +2 -2
- package/node/esm/{BqvqbFsPQB0gEvwF.mjs → DfWc3nW_Z_qqc_Wf.mjs} +1762 -1674
- package/node/esm/DgnwKbUEyQN5_gWT.mjs +169 -0
- package/node/esm/{D7ia4o3y5Wvl__9Y.mjs → Dhv9JymnXqcF54oo.mjs} +2 -2
- package/node/esm/{CHBlLTJaoPUVxA2J.mjs → DvtyKKzOnoOM80NB.mjs} +22 -22
- package/node/esm/{Dh8o-woVpmUL50BD.mjs → KDGrIa9R5XzWfjM2.mjs} +2 -2
- package/node/esm/{DyIASfKKPuNl5Xx-.mjs → RTwm9ge1KoPdlBNt.mjs} +2 -2
- package/node/esm/{DQqXPS05dvF0F-gh.mjs → _RIAmJI98l6bIFfZ.mjs} +2 -2
- package/node/esm/{j8DqCwPgfIPICFtf.mjs → bIGdvfpnijWeCac6.mjs} +1005 -1004
- package/node/esm/index.mjs +913 -598
- package/node/esm/kaiXmn0AA5WDsLPo.mjs +199 -0
- package/node/esm/{Ddd1y3TP0kqnnSs7.mjs → mTIhoz1gEcaEm7s1.mjs} +3 -3
- package/package.json +7 -7
- package/resources/locales/de/model.msg.json +82 -1
- package/resources/locales/en/model.msg.json +80 -1
- package/types/scripting-api.json +9967 -9497
- package/types/scripting-enums.json +27 -0
- package/types/scripting.d.ts +2282 -166
- package/types/src/.generated/wasm/sdk.d.ts +332 -0
- package/types/src/calculation/Calculation.d.ts +8 -0
- package/types/src/calculation/ICalculation.d.ts +51 -0
- package/types/src/calculation/compiler/Types.d.ts +5 -0
- package/types/src/calculation/executor/CalcExecutorUtils.d.ts +1 -1
- package/types/src/calculation/formula/FormulaBlock.d.ts +2 -0
- package/types/src/calculation/formula/IFormulaBlock.d.ts +18 -0
- package/types/src/calculation/grid/CalcGrid.d.ts +5 -1
- package/types/src/calculation/grid/CalcGridBackend.d.ts +36 -1
- package/types/src/calculation/grid/CalcGridProxy.d.ts +2 -0
- package/types/src/calculation/grid/CalcGridUtils.d.ts +4 -2
- package/types/src/calculation/grid/FormulaHost.d.ts +3 -1
- package/types/src/calculation/grid/ICalcGrid.d.ts +88 -0
- package/types/src/calculation/grid/_CalcRequest.d.ts +9 -0
- package/types/src/calculation/spatial/FormulaSpatialValue.d.ts +2 -0
- package/types/src/calculation/spatial/SpillEntry.d.ts +55 -4
- package/types/src/calculation/state/CalcNode.d.ts +6 -3
- package/types/src/calculation/state/CalculationContext.d.ts +4 -2
- package/types/src/calculation/state/_PivotView.d.ts +22 -0
- package/types/src/cell/ICell.d.ts +1 -21
- package/types/src/cellRange/ICellRange.d.ts +18 -2
- package/types/src/collections/MixedTypedArrayList.d.ts +16 -2
- package/types/src/condition/BuiltInOperators/AbstractOperator.d.ts +10 -0
- package/types/src/condition/BuiltInOperators/GreaterThanEqualToOperator.d.ts +3 -0
- package/types/src/condition/BuiltInOperators/GreaterThanOperator.d.ts +3 -0
- package/types/src/condition/BuiltInOperators/LessThanEqualToOperator.d.ts +3 -0
- package/types/src/condition/BuiltInOperators/LessThanOperator.d.ts +3 -0
- package/types/src/condition/BuiltInOperators/MatchesOperator.d.ts +10 -0
- package/types/src/condition/BuiltInOperators/TimePeriodOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/index.d.ts +2 -0
- package/types/src/condition/Condition.d.ts +1 -0
- package/types/src/condition/ICondition.d.ts +15 -0
- package/types/src/condition/_ConditionUtils.d.ts +14 -0
- package/types/src/conditionalFormat/ConditionalFormat.d.ts +2 -1
- package/types/src/conditionalFormat/IConditionalFormat.d.ts +4 -3
- package/types/src/license/LicenseDetails.d.ts +27 -0
- package/types/src/license/LicenseManager.d.ts +24 -7
- package/types/src/license/_Utils.d.ts +34 -3
- package/types/src/license/index.d.ts +1 -0
- package/types/src/license/runtime.browser.d.ts +32 -4
- package/types/src/license/runtime.node.d.ts +8 -5
- package/types/src/license/summary.d.ts +18 -0
- package/types/src/pivot/IPivotTable.d.ts +1549 -13
- package/types/src/pivot/IPivotTableCollection.d.ts +70 -4
- package/types/src/pivot/PivotCache.d.ts +95 -11
- package/types/src/pivot/PivotDataField.d.ts +73 -0
- package/types/src/pivot/PivotField.d.ts +142 -0
- package/types/src/pivot/PivotTable.d.ts +548 -14
- package/types/src/pivot/PivotTableCollection.d.ts +18 -3
- package/types/src/pivot/_PivotAreas.d.ts +48 -0
- package/types/src/pivot/_PivotControls.d.ts +140 -0
- package/types/src/pivot/_PivotEngine.d.ts +9 -0
- package/types/src/pivot/_PivotGroups.d.ts +25 -0
- package/types/src/pivot/_PivotItems.d.ts +167 -0
- package/types/src/pivot/_PivotStructure.d.ts +237 -0
- package/types/src/pivot/_PivotStylePreview.d.ts +21 -0
- package/types/src/pivot/_PivotUtils.d.ts +37 -0
- package/types/src/pivot/engine/PivotAdd.d.ts +37 -0
- package/types/src/pivot/engine/PivotData.d.ts +65 -0
- package/types/src/pivot/engine/PivotEdit.d.ts +45 -0
- package/types/src/pivot/engine/PivotFilters.d.ts +50 -0
- package/types/src/pivot/engine/PivotFormulas.d.ts +72 -0
- package/types/src/pivot/engine/PivotLayout.d.ts +133 -0
- package/types/src/pivot/engine/PivotMove.d.ts +24 -0
- package/types/src/pivot/engine/PivotRefresh.d.ts +87 -0
- package/types/src/pivot/engine/PivotSort.d.ts +26 -0
- package/types/src/pivot/engine/PivotViewBuilder.d.ts +22 -0
- package/types/src/pivot/engine/index.d.ts +15 -0
- package/types/src/pivot/index.d.ts +4 -0
- package/types/src/pivot/kernel/KernelPivot.d.ts +63 -0
- package/types/src/pivot/kernel/_KernelLeaves.d.ts +100 -0
- package/types/src/pivot/kernel/_PivotAxisTree.d.ts +71 -0
- package/types/src/primitives/Range.d.ts +12 -1
- package/types/src/sheet/IWorksheet.d.ts +35 -0
- package/types/src/sheet/SheetCell.d.ts +21 -14
- package/types/src/sheet/SheetRange.d.ts +3 -0
- package/types/src/sheet/Worksheet.d.ts +175 -7
- package/types/src/sheet/_PivotFootprint.d.ts +42 -0
- package/types/src/sheet/_SheetAutoFitUtils.d.ts +12 -1
- package/types/src/sheet/_SheetMutations.d.ts +47 -0
- package/types/src/sheet/_SheetStateTypes.d.ts +11 -0
- package/types/src/sheet/style/SheetCellStyle.d.ts +6 -0
- package/types/src/sheet/style/SheetPivotStyle.d.ts +83 -0
- package/types/src/sheet/style/_IndentUnit.d.ts +14 -0
- package/types/src/sheetHeader/SheetCellHeader.d.ts +1 -1
- package/types/src/slicer/ISlicer.d.ts +114 -34
- package/types/src/slicer/ITimeline.d.ts +61 -0
- package/types/src/slicer/Slicer.d.ts +76 -3
- package/types/src/slicer/_PivotSlicer.d.ts +51 -0
- package/types/src/slicer/index.d.ts +1 -0
- package/types/src/table/AnchoredTable.d.ts +11 -1
- package/types/src/table/ITable.d.ts +5 -6
- package/types/src/table/ITableStyle.d.ts +50 -34
- package/types/src/table/_BuiltInPivotStyles.d.ts +8 -0
- package/types/src/table/_BuiltInTableStyles.d.ts +0 -1
- package/types/src/type/ITypes.d.ts +5 -1
- package/types/src/workbook/IWorkbook.d.ts +8 -2
- package/types/src/workbook/Workbook.d.ts +72 -6
- package/browser/esm/BrHplg4RuI5jOmmr.mjs +0 -357
- package/browser/esm/eImPONkfn5DstmS8.mjs +0 -184
- package/node/esm/03AYPvCda2x9EOlY.mjs +0 -360
- package/node/esm/BmVQRGAijOHzgHmz.mjs +0 -199
- package/node/esm/Dk4KLs5GoRRuD8J4.mjs +0 -115
- package/types/src/pivot/_PivotXml.d.ts +0 -24
- package/types/src/primitives/Grouping.d.ts +0 -65
|
@@ -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.16
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
|
-
* License:
|
|
5
|
+
* License: SheetXL EULA — https://www.sheetxl.com/eula
|
|
6
6
|
*/
|
|
7
|
-
import { $
|
|
7
|
+
import { $r as e, Br as t, Dr as s, Fr as r, Gr as i, Hr as n, Ir as o, Jr as a, Kr as h, Lr as l, Mr as u, Nr as c, Qr as p, Rr as g, Ur as m, Vr as O, Wr as _, Xr as E, Yr as L, Zr as A, ai as f, ci as C, ii as T, jr as N, kr as U, li as S, oi as d, pi as x, qr as R, zr as I } from "./CVPieTgKCwkL21nD.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 ?? S, 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 ?? S;
|
|
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,16 +37,16 @@ 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: T },
|
|
46
46
|
line_breaks: !1,
|
|
47
47
|
start_chars_hint: [91],
|
|
48
48
|
longer_alt: [c, l]
|
|
49
|
-
}), g = (e) => (e ?? []).map((e) => e?.trim()).filter(Boolean).map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).map((e) => e + "|").join(""),
|
|
49
|
+
}), g = (e) => (e ?? []).map((e) => e?.trim()).filter(Boolean).map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).map((e) => e + "|").join(""), m = (e) => e.replace(/[A-Za-z]/g, (e) => `[${e.toUpperCase()}${e.toLowerCase()}]`), O = k({
|
|
50
50
|
name: "LiteralError",
|
|
51
51
|
pattern: new RegExp(g(r.errorLiterals) + [
|
|
52
52
|
"#PARSE!",
|
|
@@ -65,24 +65,24 @@ var y = class e {
|
|
|
65
65
|
"#BUSY!",
|
|
66
66
|
"#PYTHON!",
|
|
67
67
|
"#TIMEOUT!"
|
|
68
|
-
].map(
|
|
69
|
-
}),
|
|
68
|
+
].map(m).join("|"))
|
|
69
|
+
}), _ = k({
|
|
70
70
|
name: "RefError",
|
|
71
|
-
pattern: new RegExp(g(r.errorRefs) + ["#REF!", "#NAME\\?"].map(
|
|
72
|
-
}),
|
|
71
|
+
pattern: new RegExp(g(r.errorRefs) + ["#REF!", "#NAME\\?"].map(m).join("|"))
|
|
72
|
+
}), E = k({
|
|
73
73
|
name: "SingleQuotedString",
|
|
74
74
|
pattern: /'(''|[^'])*'/
|
|
75
|
-
}),
|
|
75
|
+
}), L = k({
|
|
76
76
|
name: "SheetQuoted",
|
|
77
77
|
pattern: /'(?:''|[^'])*?'!/
|
|
78
|
-
}),
|
|
78
|
+
}), A = k({
|
|
79
79
|
name: "Sheet",
|
|
80
80
|
pattern: /[A-Za-z_.\d\u007F-\uFFFF]*!/
|
|
81
|
-
}),
|
|
81
|
+
}), C = /[a-zA-Z_\\\u007F-\uFFFF][a-zA-Z0-9_.?\\\u007F-\uFFFF]*:?/y, N = k({
|
|
82
82
|
name: "NamedToken",
|
|
83
83
|
pattern: { exec: (e, t) => {
|
|
84
|
-
|
|
85
|
-
const s =
|
|
84
|
+
C.lastIndex = t;
|
|
85
|
+
const s = C.exec(e);
|
|
86
86
|
if (!s) return null;
|
|
87
87
|
let r = s[0];
|
|
88
88
|
const i = r.indexOf(".:");
|
|
@@ -90,18 +90,18 @@ var y = class e {
|
|
|
90
90
|
} },
|
|
91
91
|
line_breaks: !1,
|
|
92
92
|
start_chars_hint: B
|
|
93
|
-
}),
|
|
93
|
+
}), U = 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:
|
|
98
|
+
longer_alt: N
|
|
99
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:
|
|
104
|
+
longer_alt: N
|
|
105
105
|
}), x = k({
|
|
106
106
|
name: "AbsRow",
|
|
107
107
|
pattern: /[$][0-9]+/
|
|
@@ -185,7 +185,7 @@ var y = class e {
|
|
|
185
185
|
}), le = k({
|
|
186
186
|
name: "ArrayAnchorOp",
|
|
187
187
|
pattern: /#/,
|
|
188
|
-
longer_alt: [
|
|
188
|
+
longer_alt: [O, _]
|
|
189
189
|
}), ue = k({
|
|
190
190
|
name: "GtOp",
|
|
191
191
|
pattern: />/
|
|
@@ -198,14 +198,14 @@ var y = class e {
|
|
|
198
198
|
}), ge = [
|
|
199
199
|
h,
|
|
200
200
|
l,
|
|
201
|
-
|
|
201
|
+
L,
|
|
202
|
+
E,
|
|
202
203
|
A,
|
|
203
|
-
C,
|
|
204
204
|
u,
|
|
205
205
|
c,
|
|
206
206
|
p,
|
|
207
|
+
O,
|
|
207
208
|
_,
|
|
208
|
-
L,
|
|
209
209
|
y,
|
|
210
210
|
...n !== i ? [$] : [],
|
|
211
211
|
Y,
|
|
@@ -213,7 +213,7 @@ var y = class e {
|
|
|
213
213
|
Z,
|
|
214
214
|
q,
|
|
215
215
|
j,
|
|
216
|
-
|
|
216
|
+
U,
|
|
217
217
|
w,
|
|
218
218
|
d,
|
|
219
219
|
x,
|
|
@@ -222,7 +222,7 @@ var y = class e {
|
|
|
222
222
|
P,
|
|
223
223
|
le,
|
|
224
224
|
ne,
|
|
225
|
-
|
|
225
|
+
N,
|
|
226
226
|
K,
|
|
227
227
|
H,
|
|
228
228
|
J,
|
|
@@ -355,7 +355,7 @@ function V(e) {
|
|
|
355
355
|
return new RegExp(e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
|
|
356
356
|
}
|
|
357
357
|
var j = class {
|
|
358
|
-
constructor(e =
|
|
358
|
+
constructor(e = S) {
|
|
359
359
|
const t = function(e) {
|
|
360
360
|
const t = [...s];
|
|
361
361
|
if (e) for (const s of Object.values(e)) {
|
|
@@ -404,53 +404,53 @@ var j = class {
|
|
|
404
404
|
return this._lexer.tokenize(e);
|
|
405
405
|
}
|
|
406
406
|
}, Q = class extends b {
|
|
407
|
-
constructor(
|
|
408
|
-
const
|
|
409
|
-
super(
|
|
407
|
+
constructor(t = S) {
|
|
408
|
+
const s = new j(t), r = s.getVocabulary();
|
|
409
|
+
super(r, {
|
|
410
410
|
nodeLocationTracking: "none",
|
|
411
411
|
maxLookahead: 2,
|
|
412
412
|
skipValidations: !0,
|
|
413
413
|
recoveryEnabled: !1
|
|
414
|
-
}), this._lexer =
|
|
415
|
-
const { TableSpecifier:
|
|
416
|
-
|
|
417
|
-
const e = [], t =
|
|
418
|
-
return
|
|
414
|
+
}), this._lexer = s;
|
|
415
|
+
const { TableSpecifier: i, BracketedColumn: n, BareSpecifier: o, ColumnSep: a, ListSep: h } = r, 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
|
|
430
|
-
return
|
|
431
|
-
const
|
|
432
|
-
return
|
|
428
|
+
}), l.RULE("ruleItem", () => l.OR([{ ALT: () => l.SUBRULE(l.ruleSpecifier) }, { ALT: () => l.SUBRULE(l.ruleColumnOrRange) }])), l.RULE("ruleSpecifier", () => l.OR([{ ALT: () => {
|
|
429
|
+
const s = l.CONSUME(i);
|
|
430
|
+
return l.ACTION(() => {
|
|
431
|
+
const r = e(s.image, t);
|
|
432
|
+
return r.image = s.image, r;
|
|
433
433
|
});
|
|
434
434
|
} }, { ALT: () => {
|
|
435
|
-
const
|
|
436
|
-
return
|
|
437
|
-
const
|
|
438
|
-
return
|
|
435
|
+
const s = l.CONSUME(o);
|
|
436
|
+
return l.ACTION(() => {
|
|
437
|
+
const r = e(s.image, t);
|
|
438
|
+
return r.image = s.image, r;
|
|
439
439
|
});
|
|
440
|
-
} }])),
|
|
441
|
-
const e =
|
|
440
|
+
} }])), l.RULE("ruleColumnOrRange", () => {
|
|
441
|
+
const e = l.CONSUME(n);
|
|
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(n);
|
|
445
|
+
}), l.ACTION(() => {
|
|
446
|
+
const r = A(e.image);
|
|
447
447
|
if (r.image = e.image, !s) return r;
|
|
448
|
-
const i =
|
|
448
|
+
const i = A(s.image);
|
|
449
449
|
i.image = s.image;
|
|
450
|
-
const n =
|
|
450
|
+
const n = I(":", 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);
|
|
@@ -464,23 +464,23 @@ var j = class {
|
|
|
464
464
|
if ("@" === s) {
|
|
465
465
|
const e = t.slice(1).trim();
|
|
466
466
|
if (!e) {
|
|
467
|
-
const e =
|
|
467
|
+
const e = h("@", null, !0);
|
|
468
468
|
return e.image = "@", [e];
|
|
469
469
|
}
|
|
470
470
|
if ("[" === e.charAt(0)) {
|
|
471
471
|
const t = this._parseInner(e);
|
|
472
472
|
if (1 === t.length && "infix" === t[0].type) {
|
|
473
|
-
const e =
|
|
473
|
+
const e = h("@", t[0], !0);
|
|
474
474
|
return e.image = "@", [e];
|
|
475
475
|
}
|
|
476
476
|
}
|
|
477
|
-
const s =
|
|
477
|
+
const s = A(e);
|
|
478
478
|
s.image = e;
|
|
479
|
-
const r =
|
|
479
|
+
const r = h("@", s, !0);
|
|
480
480
|
return r.image = "@", [r];
|
|
481
481
|
}
|
|
482
482
|
if ("[" !== s && "#" !== s) {
|
|
483
|
-
const t =
|
|
483
|
+
const t = A(e);
|
|
484
484
|
return t.image = e, [t];
|
|
485
485
|
}
|
|
486
486
|
return this._parseInner(t);
|
|
@@ -488,7 +488,7 @@ var j = class {
|
|
|
488
488
|
parse(e, t, s) {
|
|
489
489
|
this.reset();
|
|
490
490
|
const r = () => ({
|
|
491
|
-
root:
|
|
491
|
+
root: p("", []),
|
|
492
492
|
errors: []
|
|
493
493
|
});
|
|
494
494
|
if (!s) return r();
|
|
@@ -501,7 +501,7 @@ 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: p(o, h),
|
|
505
505
|
errors: this.errors.length > 0 ? [...this.errors] : []
|
|
506
506
|
};
|
|
507
507
|
}
|
|
@@ -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 === x.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,75 +546,75 @@ 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(e) {
|
|
550
|
+
const s = e?.lexer ?? y.shared(e?.lexerOptions), p = s.getVocabulary();
|
|
551
|
+
super(p, {
|
|
552
552
|
skipValidations: !0,
|
|
553
553
|
recoveryEnabled: !0,
|
|
554
|
-
...
|
|
554
|
+
...e,
|
|
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: s, DivOp: r, ExOp: i, ConcatOp: n, GtOp:
|
|
560
|
-
return
|
|
561
|
-
const
|
|
559
|
+
const { PlusOp: e, MinOp: t, MulOp: s, DivOp: r, ExOp: i, ConcatOp: n, GtOp: o, EqOp: a, LtOp: h, NeqOp: l, GteOp: u, LteOp: c } = this._vocab, p = [];
|
|
560
|
+
return p.push({ node: this.SUBRULE(this._rulePostfixOp) }), this.MANY(() => {
|
|
561
|
+
const g = this.OR(this._c1 || (this._c1 = [
|
|
562
562
|
{ ALT: () => this.CONSUME(e).image },
|
|
563
563
|
{ ALT: () => this.CONSUME(t).image },
|
|
564
564
|
{ ALT: () => this.CONSUME(s).image },
|
|
565
565
|
{ ALT: () => this.CONSUME(r).image },
|
|
566
566
|
{ ALT: () => this.CONSUME(i).image },
|
|
567
567
|
{ ALT: () => this.CONSUME(n).image },
|
|
568
|
+
{ ALT: () => this.CONSUME(o).image },
|
|
568
569
|
{ ALT: () => this.CONSUME(a).image },
|
|
569
570
|
{ ALT: () => this.CONSUME(h).image },
|
|
570
571
|
{ ALT: () => this.CONSUME(l).image },
|
|
571
572
|
{ ALT: () => this.CONSUME(u).image },
|
|
572
|
-
{ ALT: () => this.CONSUME(c).image }
|
|
573
|
-
{ ALT: () => this.CONSUME(p).image }
|
|
573
|
+
{ ALT: () => this.CONSUME(c).image }
|
|
574
574
|
])), m = {
|
|
575
|
-
value:
|
|
575
|
+
value: g,
|
|
576
576
|
index: this.getLexerPosition(),
|
|
577
|
-
isRange:
|
|
577
|
+
isRange: d.includes(g)
|
|
578
578
|
}, O = this.SUBRULE2(this._rulePostfixOp);
|
|
579
|
-
|
|
579
|
+
p.push({
|
|
580
580
|
op: m,
|
|
581
581
|
node: O
|
|
582
582
|
});
|
|
583
583
|
}), this.ACTION(() => {
|
|
584
|
-
let e =
|
|
585
|
-
const t =
|
|
584
|
+
let e = p.length - 1;
|
|
585
|
+
const t = U.length;
|
|
586
586
|
for (let s = 0; e > 0 && s < t; s++) {
|
|
587
|
-
const t =
|
|
587
|
+
const t = U[s];
|
|
588
588
|
let r = 1;
|
|
589
|
-
for (; r <
|
|
590
|
-
const s =
|
|
589
|
+
for (; r < p.length;) {
|
|
590
|
+
const s = p[r].op;
|
|
591
591
|
if (t.includes(s.value)) {
|
|
592
|
-
const t =
|
|
593
|
-
let n =
|
|
594
|
-
n = this._tag(n, s.index),
|
|
592
|
+
const t = p[r - 1].node, i = p[r].node;
|
|
593
|
+
let n = I(s.value, t, i, s.isRange);
|
|
594
|
+
n = this._tag(n, s.index), p[r - 1].node = n, p.splice(r, 1), e--;
|
|
595
595
|
} else r++;
|
|
596
596
|
}
|
|
597
597
|
}
|
|
598
|
-
}),
|
|
598
|
+
}), p[0].node;
|
|
599
599
|
}), this._rulePlusMinusOp = this.RULE("rulePlusMinusOp", () => {
|
|
600
600
|
const { PlusOp: e, MinOp: t } = this._vocab;
|
|
601
601
|
return this.OR([{ ALT: () => this.CONSUME(e) }, { ALT: () => this.CONSUME(t) }]);
|
|
602
602
|
}), this._rulePostfixOp = this.RULE("rulePostfixOp", () => {
|
|
603
|
-
const { PercentOp:
|
|
604
|
-
let
|
|
605
|
-
const
|
|
603
|
+
const { PercentOp: e } = this._vocab;
|
|
604
|
+
let t = this.SUBRULE(this._rulePrefixOp);
|
|
605
|
+
const s = [];
|
|
606
606
|
return this.MANY(() => {
|
|
607
|
-
const
|
|
607
|
+
const t = this.CONSUME(e).image;
|
|
608
608
|
this.ACTION(() => {
|
|
609
|
-
|
|
609
|
+
s.push([t, this.getLexerPosition()]);
|
|
610
610
|
});
|
|
611
611
|
}), this.ACTION(() => {
|
|
612
|
-
const
|
|
613
|
-
if (0 !==
|
|
614
|
-
const
|
|
615
|
-
|
|
612
|
+
const e = s.length;
|
|
613
|
+
if (0 !== e) for (let r = 0; r < e; r++) {
|
|
614
|
+
const e = s[r], n = e[0], o = e[1], a = d.includes(n);
|
|
615
|
+
t = i(n, t, a), t = this._tag(t, o);
|
|
616
616
|
}
|
|
617
|
-
}),
|
|
617
|
+
}), t;
|
|
618
618
|
}), this._rulePrefixOp = this.RULE("rulePrefixOp", () => {
|
|
619
619
|
const { PlusOp: e, MinOp: t, ImplicitIntersectOp: s } = this._vocab, r = [];
|
|
620
620
|
this.MANY(() => {
|
|
@@ -631,26 +631,26 @@ var te = {
|
|
|
631
631
|
return this.ACTION(() => {
|
|
632
632
|
const e = r.length;
|
|
633
633
|
if (0 !== e) for (let t = e - 1; t >= 0; t--) {
|
|
634
|
-
const e = r[t], s = e[0], n = e[1], o =
|
|
635
|
-
i =
|
|
634
|
+
const e = r[t], s = e[0], n = e[1], o = d.includes(s);
|
|
635
|
+
i = h(s, i, o), i = this._tag(i, n);
|
|
636
636
|
}
|
|
637
637
|
}), i;
|
|
638
638
|
}), this._ruleRangeOp = this.RULE("ruleRangeOp", () => {
|
|
639
|
-
const { RangeOp:
|
|
639
|
+
const { RangeOp: e, RangeTrimFullOp: t, RangeTrimLeadingOp: s, RangeTrimTrailingOp: r, ArrayAnchorOp: n } = this._vocab, o = [];
|
|
640
640
|
return o.push({ node: this.SUBRULE(this._ruleCallOp) }), this.MANY2(() => {
|
|
641
641
|
this.CONSUME(n), o.push({ anchor: this.getLexerPosition() });
|
|
642
642
|
}), this.MANY(() => {
|
|
643
|
-
const
|
|
643
|
+
const i = {
|
|
644
644
|
value: this.OR(this._c2 || (this._c2 = [
|
|
645
|
+
{ ALT: () => this.CONSUME(e).image },
|
|
645
646
|
{ ALT: () => this.CONSUME(t).image },
|
|
646
647
|
{ ALT: () => this.CONSUME(s).image },
|
|
647
|
-
{ ALT: () => this.CONSUME(r).image }
|
|
648
|
-
{ ALT: () => this.CONSUME(i).image }
|
|
648
|
+
{ ALT: () => this.CONSUME(r).image }
|
|
649
649
|
])),
|
|
650
650
|
index: this.getLexerPosition()
|
|
651
651
|
}, a = this.SUBRULE2(this._ruleCallOp);
|
|
652
652
|
o.push({
|
|
653
|
-
op:
|
|
653
|
+
op: i,
|
|
654
654
|
node: a
|
|
655
655
|
}), this.MANY3(() => {
|
|
656
656
|
this.CONSUME2(n), o.push({ anchor: this.getLexerPosition() });
|
|
@@ -660,17 +660,17 @@ var te = {
|
|
|
660
660
|
const t = o[e], s = o[e + 1];
|
|
661
661
|
if (":" !== t.op?.value || ":" !== s.op?.value) continue;
|
|
662
662
|
const r = K(t.node);
|
|
663
|
-
r && K(s.node) === r && K(o[e - 1].node) !== r && (t.node = this._tag(
|
|
663
|
+
r && K(s.node) === r && K(o[e - 1].node) !== r && (t.node = this._tag(I(":", t.node, s.node, !0), s.op.index), o.splice(e + 1, 1));
|
|
664
664
|
}
|
|
665
|
-
for (let
|
|
666
|
-
const
|
|
667
|
-
if (void 0 !==
|
|
668
|
-
o[0].node = this._tag(
|
|
665
|
+
for (let e = 1; e < o.length; e++) {
|
|
666
|
+
const t = o[e];
|
|
667
|
+
if (void 0 !== t.anchor) {
|
|
668
|
+
o[0].node = this._tag(i("#", o[0].node, !0), t.anchor);
|
|
669
669
|
continue;
|
|
670
670
|
}
|
|
671
|
-
const
|
|
672
|
-
let
|
|
673
|
-
|
|
671
|
+
const s = t.op;
|
|
672
|
+
let r = I(s.value, o[0].node, t.node, !0);
|
|
673
|
+
r = this._tag(r, s.index), o[0].node = r;
|
|
674
674
|
}
|
|
675
675
|
}), o[0].node;
|
|
676
676
|
}), this._ruleCallOp = this.RULE("ruleCallOp", () => {
|
|
@@ -683,7 +683,7 @@ var te = {
|
|
|
683
683
|
},
|
|
684
684
|
DEF: () => {
|
|
685
685
|
this.CONSUME(e);
|
|
686
|
-
const r = this.getLexerPosition(), i = this.SUBRULE(this._ruleFunctionArguments), n = s, o = this.ACTION(() => this._tag(
|
|
686
|
+
const r = this.getLexerPosition(), i = this.SUBRULE(this._ruleFunctionArguments), n = s, o = this.ACTION(() => this._tag(c(n, i), r)), a = this.OPTION(() => this.CONSUME(t));
|
|
687
687
|
this.ACTION(() => {
|
|
688
688
|
a || this._reportError(o, "Missing closing parenthesis ')'", r), this._tagClose(o, this.getLexerPosition()), s = o;
|
|
689
689
|
});
|
|
@@ -705,7 +705,7 @@ var te = {
|
|
|
705
705
|
for (; e.length > 1;) {
|
|
706
706
|
let t = e.length - 1;
|
|
707
707
|
for (let s = 0; s < t; s++) {
|
|
708
|
-
const r = e[s], i = e[s + 1], n =
|
|
708
|
+
const r = e[s], i = e[s + 1], n = I(" ", r, i, !0), o = this._tokenMap.get(r);
|
|
709
709
|
o && delete o.tokenIndexClose;
|
|
710
710
|
const a = this._tokenMap.get(i), h = a?.tokenIndex;
|
|
711
711
|
if (void 0 !== h) {
|
|
@@ -735,83 +735,83 @@ var te = {
|
|
|
735
735
|
}), t;
|
|
736
736
|
}), this._ruleParen = this.RULE("ruleParen", () => {
|
|
737
737
|
const { OpenParen: e, CloseParen: t } = this._vocab;
|
|
738
|
-
return this._processParen(
|
|
738
|
+
return this._processParen(x.Paren, e, t);
|
|
739
739
|
}), this._ruleLiteralArray = this.RULE("ruleLiteralArray", () => {
|
|
740
|
-
const { OpenCurlyParen: e, CloseCurlyParen:
|
|
741
|
-
let
|
|
740
|
+
const { OpenCurlyParen: e, CloseCurlyParen: s, ColSeparator: r, RowSeparator: i } = this._vocab;
|
|
741
|
+
let o = n();
|
|
742
742
|
this.CONSUME(e);
|
|
743
|
-
const
|
|
744
|
-
let
|
|
745
|
-
const
|
|
743
|
+
const a = this.getLexerPosition();
|
|
744
|
+
let h = this.ACTION(() => this._tag(t(o), a));
|
|
745
|
+
const l = this.SUBRULE(this._ruleLiteralForArray);
|
|
746
746
|
this.ACTION(() => {
|
|
747
|
-
|
|
747
|
+
o.value.push(l);
|
|
748
748
|
}), this.MANY(() => {
|
|
749
749
|
let e = !1;
|
|
750
750
|
this.OR([{ ALT: () => {
|
|
751
|
-
this.CONSUME(
|
|
752
|
-
} }, { ALT: () => this.CONSUME(
|
|
751
|
+
this.CONSUME(r), e = !0;
|
|
752
|
+
} }, { ALT: () => this.CONSUME(i) }]);
|
|
753
753
|
const t = this.SUBRULE2(this._ruleLiteralForArray);
|
|
754
754
|
this.ACTION(() => {
|
|
755
|
-
e || (
|
|
755
|
+
e || (o = n(), h.value.push(o)), o.value.push(t);
|
|
756
756
|
});
|
|
757
757
|
});
|
|
758
|
-
const
|
|
759
|
-
return
|
|
758
|
+
const u = this.OPTION(() => this.CONSUME(s));
|
|
759
|
+
return h = this.ACTION(() => (u || this._reportError(h, "Missing closing parenthesis '}'", a), this._tagClose(h, this.getLexerPosition()))), h;
|
|
760
760
|
}), this._ruleLiteralForArray = this.RULE("ruleLiteralForArray", () => {
|
|
761
|
-
const { StringToken: e, BooleanToken:
|
|
761
|
+
const { StringToken: e, BooleanToken: t, LiteralError: s, RefError: r } = this._vocab;
|
|
762
762
|
return this.OR([
|
|
763
763
|
{ ALT: () => {
|
|
764
|
-
const e = this.OPTION(() => this.SUBRULE(this._rulePlusMinusOp)), t = this.SUBRULE(this._ruleNumber), s = this.ACTION(() => this._tag(
|
|
765
|
-
return this.ACTION(() => e ?
|
|
764
|
+
const e = this.OPTION(() => this.SUBRULE(this._rulePlusMinusOp)), t = this.SUBRULE(this._ruleNumber), s = this.ACTION(() => this._tag(_(t.image, this._locale), this.getLexerPosition()));
|
|
765
|
+
return this.ACTION(() => e ? R(e.image, s) : s);
|
|
766
766
|
} },
|
|
767
767
|
{ ALT: () => {
|
|
768
768
|
const t = this.CONSUME(e);
|
|
769
|
-
return this.ACTION(() => this._tag(
|
|
769
|
+
return this.ACTION(() => this._tag(E(t.image), this.getLexerPosition()));
|
|
770
770
|
} },
|
|
771
771
|
{ ALT: () => {
|
|
772
|
-
const e = this.CONSUME(
|
|
773
|
-
return this.ACTION(() => this._tag(
|
|
772
|
+
const e = this.CONSUME(t);
|
|
773
|
+
return this.ACTION(() => this._tag(u(e.image, this._locale), this.getLexerPosition()));
|
|
774
774
|
} },
|
|
775
775
|
{ ALT: () => {
|
|
776
|
-
const e = this.CONSUME(
|
|
777
|
-
return this.ACTION(() => this._tag(
|
|
776
|
+
const e = this.CONSUME(s);
|
|
777
|
+
return this.ACTION(() => this._tag(O(e.image, this._locale), this.getLexerPosition()));
|
|
778
778
|
} },
|
|
779
779
|
{ ALT: () => {
|
|
780
|
-
const e = this.CONSUME(
|
|
781
|
-
return this.ACTION(() => this._tag(
|
|
780
|
+
const e = this.CONSUME(r);
|
|
781
|
+
return this.ACTION(() => this._tag(a(e.image, this._locale), this.getLexerPosition()));
|
|
782
782
|
} }
|
|
783
783
|
]);
|
|
784
784
|
}), this._ruleLiteral = this.RULE("ruleLiteral", () => {
|
|
785
|
-
const { StringToken: e, BooleanToken:
|
|
785
|
+
const { StringToken: e, BooleanToken: t, LiteralError: s, RefError: r } = this._vocab;
|
|
786
786
|
return this.OR([
|
|
787
787
|
{ ALT: () => {
|
|
788
788
|
const e = this.SUBRULE(this._ruleNumber);
|
|
789
|
-
return this.ACTION(() => this._tag(
|
|
789
|
+
return this.ACTION(() => this._tag(_(e.image, this._locale), this.getLexerPosition()));
|
|
790
790
|
} },
|
|
791
791
|
{ ALT: () => {
|
|
792
792
|
const t = this.CONSUME(e);
|
|
793
|
-
return this.ACTION(() => this._tag(
|
|
793
|
+
return this.ACTION(() => this._tag(E(t.image), this.getLexerPosition()));
|
|
794
794
|
} },
|
|
795
795
|
{ ALT: () => {
|
|
796
|
-
const e = this.CONSUME(
|
|
797
|
-
return this.ACTION(() => this._tag(
|
|
796
|
+
const e = this.CONSUME(t);
|
|
797
|
+
return this.ACTION(() => this._tag(u(e.image, this._locale), this.getLexerPosition()));
|
|
798
798
|
} },
|
|
799
799
|
{ ALT: () => {
|
|
800
|
-
const e = this.CONSUME(
|
|
801
|
-
return this.ACTION(() => this._tag(
|
|
800
|
+
const e = this.CONSUME(s);
|
|
801
|
+
return this.ACTION(() => this._tag(O(e.image, this._locale), this.getLexerPosition()));
|
|
802
802
|
} },
|
|
803
803
|
{ ALT: () => {
|
|
804
|
-
const e = this.CONSUME(
|
|
805
|
-
return this.ACTION(() => this._tag(
|
|
804
|
+
const e = this.CONSUME(r);
|
|
805
|
+
return this.ACTION(() => this._tag(a(e.image, this._locale), this.getLexerPosition()));
|
|
806
806
|
} }
|
|
807
807
|
]);
|
|
808
808
|
}), this._ruleFunction = this.RULE("ruleFunction", () => {
|
|
809
809
|
const { FunctionToken: e, OpenParen: t, CloseParen: s } = this._vocab, r = this.CONSUME(e).image, i = this.getLexerPosition();
|
|
810
810
|
this.CONSUME(t);
|
|
811
|
-
const
|
|
812
|
-
let
|
|
813
|
-
const
|
|
814
|
-
return
|
|
811
|
+
const n = this.SUBRULE(this._ruleFunctionArguments);
|
|
812
|
+
let o = this.ACTION(() => this._tag(g(r, n), i));
|
|
813
|
+
const a = this.OPTION(() => this.CONSUME(s));
|
|
814
|
+
return o = this.ACTION(() => (a || this._reportError(o, "Missing closing parenthesis ')'", i), this._tagClose(o, this.getLexerPosition()))), o;
|
|
815
815
|
}), this._ruleFunctionArguments = this.RULE("ruleFunctionArguments", () => {
|
|
816
816
|
const { ArgSeparator: e, CloseParen: t } = this._vocab, s = [];
|
|
817
817
|
return this.OPTION({
|
|
@@ -820,11 +820,11 @@ var te = {
|
|
|
820
820
|
let t;
|
|
821
821
|
this.OPTION2(() => {
|
|
822
822
|
t = this.SUBRULE(this._ruleIntersectOp);
|
|
823
|
-
}), t = this.ACTION(() => t ?? this._tagClose(
|
|
823
|
+
}), t = this.ACTION(() => t ?? this._tagClose(l(), this.getLexerPosition())), s.push(t), this.MANY(() => {
|
|
824
824
|
let t;
|
|
825
825
|
this.CONSUME(e), this.OPTION3(() => {
|
|
826
826
|
t = this.SUBRULE2(this._ruleIntersectOp);
|
|
827
|
-
}), t = this.ACTION(() => t ?? this._tagClose(
|
|
827
|
+
}), t = this.ACTION(() => t ?? this._tagClose(l(), this.getLexerPosition())), s.push(t);
|
|
828
828
|
});
|
|
829
829
|
}
|
|
830
830
|
}), s;
|
|
@@ -843,60 +843,60 @@ var te = {
|
|
|
843
843
|
return this._tag(e.root, s);
|
|
844
844
|
});
|
|
845
845
|
}), this._ruleReference = this.RULE("ruleReference", () => {
|
|
846
|
-
const { Sheet: e, SheetQuoted: t, DivOp: s, MulOp:
|
|
847
|
-
let
|
|
846
|
+
const { Sheet: e, SheetQuoted: t, DivOp: s, MulOp: i, PlusOp: n, MinOp: h, ArgSeparator: l, Cell: u, NamedToken: c, SingleQuotedString: p, Column: g, AbsRow: O, DigitToken: _, RefError: E } = this._vocab;
|
|
847
|
+
let A, f;
|
|
848
848
|
this.OPTION2({
|
|
849
849
|
GATE: () => {
|
|
850
|
-
for (let
|
|
851
|
-
const
|
|
852
|
-
if (
|
|
853
|
-
if ("" ===
|
|
850
|
+
for (let r = 1; r < 6; r++) {
|
|
851
|
+
const o = this.LA(r);
|
|
852
|
+
if (o.tokenType === e || o.tokenType === t) return !0;
|
|
853
|
+
if ("" === o.image || ")" === o.image || o.tokenType === s || o.tokenType === i || o.tokenType === n || o.tokenType === h || o.tokenType === l) break;
|
|
854
854
|
}
|
|
855
855
|
return !1;
|
|
856
856
|
},
|
|
857
857
|
DEF: () => {
|
|
858
|
-
|
|
858
|
+
f = this.getLexerPosition() + 1, A = this.SUBRULE(this._rulePrefixSheetName);
|
|
859
859
|
}
|
|
860
860
|
});
|
|
861
|
-
let
|
|
861
|
+
let C = this.OR([
|
|
862
862
|
{ ALT: () => {
|
|
863
|
-
const e = this.CONSUME(
|
|
864
|
-
return this.ACTION(() => this._tag(
|
|
863
|
+
const e = this.CONSUME(u), t = this.getLexerPosition();
|
|
864
|
+
return this.ACTION(() => this._tag(r(e.image, this.rowIndex, this.colIndex), t));
|
|
865
865
|
} },
|
|
866
866
|
{ ALT: () => {
|
|
867
|
-
const e = this.OR2([{ ALT: () => this.CONSUME(
|
|
868
|
-
return this.ACTION(() => this._tag(
|
|
867
|
+
const e = this.OR2([{ ALT: () => this.CONSUME(c) }, { ALT: () => this.CONSUME(p) }]);
|
|
868
|
+
return this.ACTION(() => this._tag(m(e.image), this.getLexerPosition()));
|
|
869
869
|
} },
|
|
870
870
|
{ ALT: () => this.SUBRULE(this._ruleBracketedString) },
|
|
871
871
|
{ ALT: () => this.SUBRULE(this._ruleFunction) },
|
|
872
872
|
{ ALT: () => {
|
|
873
|
-
const e = this.CONSUME(
|
|
874
|
-
return this.ACTION(() => this._tag(
|
|
875
|
-
} },
|
|
876
|
-
{ ALT: () => {
|
|
877
|
-
const e = this.CONSUME(m);
|
|
878
|
-
return this.ACTION(() => this._tag(S(e.image, this.rowIndex), this.getLexerPosition()));
|
|
873
|
+
const e = this.CONSUME(g);
|
|
874
|
+
return this.ACTION(() => this._tag(o(e.image, this.colIndex), this.getLexerPosition()));
|
|
879
875
|
} },
|
|
880
876
|
{ ALT: () => {
|
|
881
877
|
const e = this.CONSUME(O);
|
|
882
|
-
return this.ACTION(() => this._tag(
|
|
878
|
+
return this.ACTION(() => this._tag(L(e.image, this.rowIndex), this.getLexerPosition()));
|
|
883
879
|
} },
|
|
884
880
|
{ ALT: () => {
|
|
885
881
|
const e = this.CONSUME(_);
|
|
886
|
-
return this.ACTION(() => this._tag(
|
|
882
|
+
return this.ACTION(() => this._tag(L(e.image, this.rowIndex), this.getLexerPosition()));
|
|
883
|
+
} },
|
|
884
|
+
{ ALT: () => {
|
|
885
|
+
const e = this.CONSUME(E);
|
|
886
|
+
return this.ACTION(() => this._tag(a(e.image, this._locale), this.getLexerPosition()));
|
|
887
887
|
} }
|
|
888
888
|
]);
|
|
889
889
|
return this.ACTION(() => {
|
|
890
|
-
if (
|
|
891
|
-
if ("" ===
|
|
892
|
-
let e =
|
|
893
|
-
if (
|
|
894
|
-
e.value.scope =
|
|
890
|
+
if (A && C) {
|
|
891
|
+
if ("" === A.name) return void this._reportError(C, `'${A.image}' is not a valid sheet reference — a '!' needs a sheet name before it`);
|
|
892
|
+
let e = C;
|
|
893
|
+
if (C.type === x.Postfix && C.inputs?.[0] && (e = C.inputs[0]), e.type === x.Cell || e.type === x.Named || e.type === x.Row || e.type === x.TableColumn || e.type === x.Error) {
|
|
894
|
+
e.value.scope = A.name, e.value.scopeImage = A.image;
|
|
895
895
|
const t = this._tokenMap.get(e);
|
|
896
|
-
t && void 0 !==
|
|
896
|
+
t && void 0 !== f && (t.tokenIndex = f);
|
|
897
897
|
}
|
|
898
898
|
}
|
|
899
|
-
}),
|
|
899
|
+
}), C;
|
|
900
900
|
}), this._rulePrefixSheetName = this.RULE("rulePrefixSheetName", () => {
|
|
901
901
|
const { SheetQuoted: e, BracketedString: t, NamedToken: s, Column: r, RangeOp: i, Sheet: n } = this._vocab;
|
|
902
902
|
return this.OR([{ ALT: () => {
|
|
@@ -936,12 +936,12 @@ var te = {
|
|
|
936
936
|
return this.MANY(() => {
|
|
937
937
|
this.CONSUME(e), s.push(this.SUBRULE2(this._ruleIntersectOp));
|
|
938
938
|
}), this.ACTION(() => 0 === s.length ? t : {
|
|
939
|
-
type:
|
|
939
|
+
type: x.List,
|
|
940
940
|
value: ",",
|
|
941
941
|
inputs: [t, ...s],
|
|
942
942
|
isReference: !0
|
|
943
943
|
});
|
|
944
|
-
}), this._lexer =
|
|
944
|
+
}), this._lexer = s, this._locale = s.getLocale(), this._vocab = p, this._srParser = e?.srParser ?? new Q(this._locale), this.performSelfAnalysis();
|
|
945
945
|
}
|
|
946
946
|
getLexer() {
|
|
947
947
|
return this._lexer;
|
|
@@ -951,26 +951,26 @@ var te = {
|
|
|
951
951
|
let i;
|
|
952
952
|
if (!r) return {
|
|
953
953
|
root: {
|
|
954
|
-
type:
|
|
954
|
+
type: x.Unparsed,
|
|
955
955
|
value: s
|
|
956
956
|
},
|
|
957
957
|
errors: []
|
|
958
958
|
};
|
|
959
959
|
const n = r.tokens;
|
|
960
960
|
if (0 === n.length) throw new M.Parse(J);
|
|
961
|
-
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 =
|
|
961
|
+
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) => {
|
|
962
962
|
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, l = this._lexer.getMaxRow();
|
|
963
|
-
if (n && r !==
|
|
964
|
-
const s =
|
|
965
|
-
return
|
|
963
|
+
if (n && r !== x.Cell && Number.isInteger(t.value)) {
|
|
964
|
+
const s = L(t.image, e);
|
|
965
|
+
return N(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, l) || this._reportError(s, `'${t.image}' is not a valid row — rows run from 1 to ${l}`), s;
|
|
966
966
|
}
|
|
967
|
-
if (o && r ===
|
|
968
|
-
if (r ===
|
|
967
|
+
if (o && r === x.Named) return this._reportError(t, `'${t.image ?? t.value?.nameId}' is a name — '${i}' needs a cell or range on both sides`), t;
|
|
968
|
+
if (r === x.Cell) {
|
|
969
969
|
const e = t.value, s = e.colIndex === Number.MIN_SAFE_INTEGER, r = e.rowIndex === Number.MIN_SAFE_INTEGER;
|
|
970
970
|
if ((s || r) && K(h) === (s ? "row" : "col")) return s && !H(t.image, l) && this._reportError(t, `'${t.image}' is not a valid row — rows run from 1 to ${l}`), t;
|
|
971
971
|
if (s || r || e.colIndex >= 16384) {
|
|
972
|
-
const n =
|
|
973
|
-
|
|
972
|
+
const n = m(t.image);
|
|
973
|
+
N(n, t);
|
|
974
974
|
const a = e.scope;
|
|
975
975
|
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;
|
|
976
976
|
}
|
|
@@ -1033,7 +1033,7 @@ var te = {
|
|
|
1033
1033
|
_bindAllWhitespace(e) {
|
|
1034
1034
|
if (e) {
|
|
1035
1035
|
if (this._bindNodeWhitespace(e), e.inputs) for (const t of e.inputs) t && this._bindAllWhitespace(t);
|
|
1036
|
-
if (e.type ===
|
|
1036
|
+
if (e.type === x.Array && Array.isArray(e.value)) {
|
|
1037
1037
|
for (const t of e.value) if (t && Array.isArray(t.value)) for (const e of t.value) e && this._bindAllWhitespace(e);
|
|
1038
1038
|
}
|
|
1039
1039
|
}
|