@sheetxl/sdk 0.7.28-beta.2 → 0.7.28-beta.3
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/cjs/1mH2uhx_Dmceu88H.cjs +33 -0
- package/browser/cjs/B4PKKgaDTG9aSO-f.cjs +1 -0
- package/browser/cjs/{CQf4zxkBmheTVbjX.cjs → BX6A6xGDOr_td9mw.cjs} +2 -2
- package/browser/cjs/{BG7YDVxiC4ErxvF1.cjs → CWCKcp58KidyndaL.cjs} +1 -1
- package/browser/cjs/{BREMLtxkQhtNSVra.cjs → D6cjnwWR_iUSe1f6.cjs} +1 -1
- package/browser/cjs/index.cjs +2 -2
- package/browser/esm/{CZO1RubmqnJV96rq.mjs → B1gpnr-7kLU7jTy-.mjs} +2 -2
- package/browser/esm/{CB_4gdPPPruwremH.mjs → C78IaCXqwCcraBPe.mjs} +5055 -4959
- package/browser/esm/{DRWu3TmcE9JFf78V.mjs → CPgz9_iM7xyAcytg.mjs} +2 -2
- package/browser/esm/{DN4d5bDBkti28wuc.mjs → CX1NO_a1QPjXDvTU.mjs} +213 -207
- package/browser/esm/{vHWuKF-ftK7LM1uw.mjs → DZfds6s3ayTZrozO.mjs} +1 -1
- package/browser/esm/{DPOelA1J3WHbMXyh.mjs → Dv8FyXyeygJPXoHo.mjs} +2 -2
- package/browser/esm/{BxIOX1TojvA-1ZZP.mjs → Rj8e7SashcMlcdZJ.mjs} +2 -2
- package/browser/esm/index.mjs +419 -414
- package/node/esm/{C8tfYGL3wHy9IDDc.mjs → 8VtzCFSmLPKxJjOa.mjs} +2 -2
- package/node/esm/{XQhP3dYwF_tEuswB.mjs → BkY99r-c3BhlT_Kv.mjs} +303 -297
- package/node/esm/{B-tgcZihStNV9CbZ.mjs → DE3eIaqkk5xzmV1c.mjs} +1 -1
- package/node/esm/index.mjs +5312 -5213
- package/package.json +6 -6
- package/resources/locales/de/model.msg.json +12 -0
- package/resources/locales/en/model.msg.json +12 -0
- package/types/scripting.d.ts +76 -7
- package/types/src/calculation/ICalculation.d.ts +5 -0
- package/types/src/calculation/compiler/CompilerUtils.d.ts +20 -0
- package/types/src/calculation/compiler/FormulaParser.d.ts +32 -6
- package/types/src/calculation/functions/Operators.d.ts +1 -1
- package/types/src/calculation/grid/CalcGrid.d.ts +2 -0
- package/types/src/calculation/grid/ICalcGrid.d.ts +11 -0
- package/types/src/cellRange/ICellRange.d.ts +60 -3
- package/types/src/sheet/SheetRange.d.ts +12 -1
- package/browser/cjs/DoemwsUQoGCk0vBK.cjs +0 -33
- package/browser/cjs/_c2uwwpr03Y7lzIj.cjs +0 -1
|
@@ -1,57 +1,57 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.7.28-beta.
|
|
2
|
+
* @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.7.28-beta.3
|
|
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 { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, G as s, H as c, I as l, J as u, K as d, L as f, M as p, N as m, O as h, P as g, Q as _, R as v, S as y, T as b, U as x, V as S, W as C, X as w, Y as T, Z as E, _ as D, b as O, et as
|
|
8
|
-
import { a as
|
|
9
|
-
import { FormulaError as
|
|
10
|
-
import { CommonUtils as
|
|
11
|
-
var
|
|
7
|
+
import { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, G as s, H as c, I as l, J as u, K as d, L as f, M as p, N as m, O as h, P as g, Q as _, R as v, S as y, T as b, U as x, V as S, W as C, X as w, Y as T, Z as E, _ as D, b as O, et as ee, g as te, j as k, k as A, nt as j, q as M, rt as N, tt as P, v as F, w as I, x as L, y as R, z as ne } from "./C78IaCXqwCcraBPe.mjs";
|
|
8
|
+
import { a as z, i as re, n as B, o as V, r as H, t as U } from "./CPgz9_iM7xyAcytg.mjs";
|
|
9
|
+
import { FormulaError as W } from "@sheetxl/primitives";
|
|
10
|
+
import { CommonUtils as G } from "@sheetxl/utils";
|
|
11
|
+
var K = [
|
|
12
12
|
"All",
|
|
13
13
|
"Data",
|
|
14
14
|
"Headers",
|
|
15
15
|
"Totals",
|
|
16
16
|
"This Row"
|
|
17
|
-
],
|
|
18
|
-
constructor(e =
|
|
17
|
+
], q = class {
|
|
18
|
+
constructor(e = j) {
|
|
19
19
|
let t = function(e) {
|
|
20
|
-
let t = [...
|
|
20
|
+
let t = [...K];
|
|
21
21
|
if (e) for (let n of Object.values(e)) {
|
|
22
22
|
let e = n?.trim();
|
|
23
23
|
e && !t.some((t) => t.toLowerCase() === e.toLowerCase()) && t.push(e);
|
|
24
24
|
}
|
|
25
25
|
return t.sort((e, t) => t.length - e.length), t.map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|");
|
|
26
|
-
}(e.specifiers), n =
|
|
26
|
+
}(e.specifiers), n = z({
|
|
27
27
|
name: "WhiteSpace",
|
|
28
28
|
pattern: /\s+/,
|
|
29
|
-
group:
|
|
30
|
-
}), r =
|
|
29
|
+
group: V.SKIPPED
|
|
30
|
+
}), r = z({
|
|
31
31
|
name: "TableSpecifier",
|
|
32
32
|
pattern: RegExp(`\\[#(?:${t})\\]`, "i")
|
|
33
33
|
}), i = [
|
|
34
34
|
n,
|
|
35
35
|
r,
|
|
36
|
-
|
|
36
|
+
z({
|
|
37
37
|
name: "BracketedColumn",
|
|
38
38
|
pattern: /\[([^[\]]*)\]/,
|
|
39
39
|
longer_alt: [r]
|
|
40
40
|
}),
|
|
41
|
-
|
|
41
|
+
z({
|
|
42
42
|
name: "BareSpecifier",
|
|
43
43
|
pattern: RegExp(`#(?:${t})`, "i")
|
|
44
44
|
}),
|
|
45
|
-
|
|
45
|
+
z({
|
|
46
46
|
name: "ColumnSep",
|
|
47
47
|
pattern: /:/
|
|
48
48
|
}),
|
|
49
|
-
|
|
49
|
+
z({
|
|
50
50
|
name: "ListSep",
|
|
51
51
|
pattern: new RegExp(e.separators.separatorFunction.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"))
|
|
52
52
|
})
|
|
53
53
|
];
|
|
54
|
-
this._lexer = new
|
|
54
|
+
this._lexer = new V(i, { ensureOptimizations: !0 });
|
|
55
55
|
let a = {};
|
|
56
56
|
i.forEach((e) => {
|
|
57
57
|
a[e.name] = e;
|
|
@@ -63,9 +63,9 @@ var G = [
|
|
|
63
63
|
tokenize(e) {
|
|
64
64
|
return this._lexer.tokenize(e);
|
|
65
65
|
}
|
|
66
|
-
},
|
|
67
|
-
constructor(e =
|
|
68
|
-
let t = new
|
|
66
|
+
}, J = class extends B {
|
|
67
|
+
constructor(e = j) {
|
|
68
|
+
let t = new q(e), n = t.getVocabulary();
|
|
69
69
|
super(n, {
|
|
70
70
|
nodeLocationTracking: "none",
|
|
71
71
|
maxLookahead: 2,
|
|
@@ -88,13 +88,13 @@ var G = [
|
|
|
88
88
|
}), c.RULE("ruleItem", () => c.OR([{ ALT: () => c.SUBRULE(c.ruleSpecifier) }, { ALT: () => c.SUBRULE(c.ruleColumnOrRange) }])), c.RULE("ruleSpecifier", () => c.OR([{ ALT: () => {
|
|
89
89
|
let t = c.CONSUME(r);
|
|
90
90
|
return c.ACTION(() => {
|
|
91
|
-
let n =
|
|
91
|
+
let n = _(t.image, e);
|
|
92
92
|
return n.image = t.image, n;
|
|
93
93
|
});
|
|
94
94
|
} }, { ALT: () => {
|
|
95
95
|
let t = c.CONSUME(a);
|
|
96
96
|
return c.ACTION(() => {
|
|
97
|
-
let n =
|
|
97
|
+
let n = _(t.image, e);
|
|
98
98
|
return n.image = t.image, n;
|
|
99
99
|
});
|
|
100
100
|
} }])), c.RULE("ruleColumnOrRange", () => {
|
|
@@ -102,11 +102,11 @@ var G = [
|
|
|
102
102
|
return c.OPTION(() => {
|
|
103
103
|
t = c.CONSUME(o), n = c.CONSUME2(i);
|
|
104
104
|
}), c.ACTION(() => {
|
|
105
|
-
let r =
|
|
105
|
+
let r = w(e.image);
|
|
106
106
|
if (r.image = e.image, !n) return r;
|
|
107
|
-
let i =
|
|
107
|
+
let i = w(n.image);
|
|
108
108
|
i.image = n.image;
|
|
109
|
-
let a =
|
|
109
|
+
let a = v(":", r, i, !0);
|
|
110
110
|
return a.image = t?.image ?? ":", a;
|
|
111
111
|
});
|
|
112
112
|
}), c.performSelfAnalysis();
|
|
@@ -123,23 +123,23 @@ var G = [
|
|
|
123
123
|
if (n === "@") {
|
|
124
124
|
let e = t.slice(1).trim();
|
|
125
125
|
if (!e) {
|
|
126
|
-
let e =
|
|
126
|
+
let e = s("@", null, !0);
|
|
127
127
|
return e.image = "@", [e];
|
|
128
128
|
}
|
|
129
|
-
let n =
|
|
129
|
+
let n = w(e);
|
|
130
130
|
n.image = e;
|
|
131
|
-
let r =
|
|
131
|
+
let r = s("@", n, !0);
|
|
132
132
|
return r.image = "@", [r];
|
|
133
133
|
}
|
|
134
134
|
if (n !== "[" && n !== "#") {
|
|
135
|
-
let t =
|
|
135
|
+
let t = w(e);
|
|
136
136
|
return t.image = e, [t];
|
|
137
137
|
}
|
|
138
138
|
return this._parseInner(t);
|
|
139
139
|
}
|
|
140
140
|
parse(e, t, n) {
|
|
141
141
|
let r = () => ({
|
|
142
|
-
root:
|
|
142
|
+
root: E("", []),
|
|
143
143
|
errors: []
|
|
144
144
|
});
|
|
145
145
|
if (!n) return r();
|
|
@@ -147,22 +147,22 @@ var G = [
|
|
|
147
147
|
if (i === -1) return r();
|
|
148
148
|
let a = n.slice(0, i), o = n.slice(i + 1, -1);
|
|
149
149
|
return {
|
|
150
|
-
root:
|
|
150
|
+
root: E(a, this._parseContent(o)),
|
|
151
151
|
errors: this.errors.length > 0 ? [...this.errors] : []
|
|
152
152
|
};
|
|
153
153
|
}
|
|
154
|
-
},
|
|
154
|
+
}, Y = /* @__PURE__ */ new Set([
|
|
155
155
|
":",
|
|
156
156
|
".:.",
|
|
157
157
|
".:",
|
|
158
158
|
":."
|
|
159
|
-
]),
|
|
159
|
+
]), ie = /* @__PURE__ */ new Set([
|
|
160
160
|
".:.",
|
|
161
161
|
".:",
|
|
162
162
|
":."
|
|
163
163
|
]), X = (e) => {
|
|
164
164
|
if (!e) return null;
|
|
165
|
-
if (e.type ===
|
|
165
|
+
if (e.type === P.Cell) {
|
|
166
166
|
let t = e.value;
|
|
167
167
|
return t.rowIndex === -(2 ** 53 - 1) ? "col" : t.colIndex === -(2 ** 53 - 1) ? "row" : null;
|
|
168
168
|
}
|
|
@@ -179,34 +179,32 @@ function $(e, t) {
|
|
|
179
179
|
}
|
|
180
180
|
return `Unexpected '${n}'`;
|
|
181
181
|
}
|
|
182
|
-
var
|
|
183
|
-
...
|
|
182
|
+
var ae = {
|
|
183
|
+
...H,
|
|
184
184
|
buildNoViableAltMessage: (e) => $(e.actual, e.previous),
|
|
185
185
|
buildEarlyExitMessage: (e) => $(e.actual, e.previous),
|
|
186
186
|
buildNotAllInputParsedMessage: (e) => {
|
|
187
187
|
let t = e.firstRedundant?.image;
|
|
188
|
-
return t ? `Unexpected '${t}'` :
|
|
188
|
+
return t ? `Unexpected '${t}'` : H.buildNotAllInputParsedMessage(e);
|
|
189
189
|
},
|
|
190
190
|
buildMismatchTokenMessage: (e) => {
|
|
191
191
|
let t = e.actual?.image;
|
|
192
|
-
return e.expected === re && t ? `Unexpected '${t}'` :
|
|
192
|
+
return e.expected === re && t ? `Unexpected '${t}'` : H.buildMismatchTokenMessage(e);
|
|
193
193
|
}
|
|
194
|
-
},
|
|
195
|
-
constructor(
|
|
196
|
-
let
|
|
197
|
-
super(
|
|
194
|
+
}, oe = class extends B {
|
|
195
|
+
constructor(r) {
|
|
196
|
+
let i = r?.lexer ?? U.shared(r?.lexerOptions), a = i.getVocabulary();
|
|
197
|
+
super(a, {
|
|
198
198
|
skipValidations: !0,
|
|
199
199
|
recoveryEnabled: !0,
|
|
200
|
-
...
|
|
200
|
+
...r,
|
|
201
201
|
nodeLocationTracking: "full",
|
|
202
|
-
errorMessageProvider:
|
|
202
|
+
errorMessageProvider: ae,
|
|
203
203
|
maxLookahead: 1
|
|
204
204
|
}), this._ruleInfixOp = this.RULE("ruleInfixOp", () => {
|
|
205
|
-
let { PlusOp:
|
|
206
|
-
return
|
|
207
|
-
let
|
|
208
|
-
{ ALT: () => this.CONSUME(e).image },
|
|
209
|
-
{ ALT: () => this.CONSUME(t).image },
|
|
205
|
+
let { PlusOp: n, MinOp: r, MulOp: i, DivOp: a, ExOp: o, ConcatOp: s, GtOp: c, EqOp: l, LtOp: u, NeqOp: d, GteOp: f, LteOp: p } = this._vocab, m = [];
|
|
206
|
+
return m.push({ node: this.SUBRULE(this._rulePostfixOp) }), this.MANY(() => {
|
|
207
|
+
let t = this.OR(this._c1 ||= [
|
|
210
208
|
{ ALT: () => this.CONSUME(n).image },
|
|
211
209
|
{ ALT: () => this.CONSUME(r).image },
|
|
212
210
|
{ ALT: () => this.CONSUME(i).image },
|
|
@@ -216,70 +214,74 @@ var ie = {
|
|
|
216
214
|
{ ALT: () => this.CONSUME(c).image },
|
|
217
215
|
{ ALT: () => this.CONSUME(l).image },
|
|
218
216
|
{ ALT: () => this.CONSUME(u).image },
|
|
219
|
-
{ ALT: () => this.CONSUME(d).image }
|
|
220
|
-
|
|
221
|
-
|
|
217
|
+
{ ALT: () => this.CONSUME(d).image },
|
|
218
|
+
{ ALT: () => this.CONSUME(f).image },
|
|
219
|
+
{ ALT: () => this.CONSUME(p).image }
|
|
220
|
+
]), h = {
|
|
221
|
+
value: t,
|
|
222
222
|
index: this.getLexerPosition(),
|
|
223
|
-
isRange:
|
|
224
|
-
},
|
|
225
|
-
|
|
226
|
-
op:
|
|
227
|
-
node:
|
|
223
|
+
isRange: e.includes(t)
|
|
224
|
+
}, g = this.SUBRULE2(this._rulePostfixOp);
|
|
225
|
+
m.push({
|
|
226
|
+
op: h,
|
|
227
|
+
node: g
|
|
228
228
|
});
|
|
229
229
|
}), this.ACTION(() => {
|
|
230
|
-
let e =
|
|
231
|
-
for (let
|
|
232
|
-
let
|
|
233
|
-
for (;
|
|
234
|
-
let
|
|
235
|
-
if (
|
|
236
|
-
let
|
|
237
|
-
a = this._tag(a,
|
|
238
|
-
} else
|
|
230
|
+
let e = m.length - 1, n = t.length;
|
|
231
|
+
for (let r = 0; e > 0 && r < n; r++) {
|
|
232
|
+
let n = t[r], i = 1;
|
|
233
|
+
for (; i < m.length;) {
|
|
234
|
+
let t = m[i].op;
|
|
235
|
+
if (n.includes(t.value)) {
|
|
236
|
+
let n = m[i - 1].node, r = m[i].node, a = v(t.value, n, r, t.isRange);
|
|
237
|
+
a = this._tag(a, t.index), m[i - 1].node = a, m.splice(i, 1), e--;
|
|
238
|
+
} else i++;
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
|
-
}),
|
|
241
|
+
}), m[0].node;
|
|
242
242
|
}), this._rulePlusMinusOp = this.RULE("rulePlusMinusOp", () => {
|
|
243
243
|
let { PlusOp: e, MinOp: t } = this._vocab;
|
|
244
244
|
return this.OR([{ ALT: () => this.CONSUME(e) }, { ALT: () => this.CONSUME(t) }]);
|
|
245
245
|
}), this._rulePostfixOp = this.RULE("rulePostfixOp", () => {
|
|
246
|
-
let { PercentOp:
|
|
246
|
+
let { PercentOp: t } = this._vocab, n = this.SUBRULE(this._rulePrefixOp), r = [];
|
|
247
247
|
return this.MANY(() => {
|
|
248
|
-
let
|
|
248
|
+
let e = this.CONSUME(t).image;
|
|
249
249
|
this.ACTION(() => {
|
|
250
|
-
r.push([
|
|
250
|
+
r.push([e, this.getLexerPosition()]);
|
|
251
251
|
});
|
|
252
252
|
}), this.ACTION(() => {
|
|
253
|
-
let
|
|
254
|
-
if (
|
|
255
|
-
let
|
|
256
|
-
n =
|
|
253
|
+
let t = r.length;
|
|
254
|
+
if (t !== 0) for (let i = 0; i < t; i++) {
|
|
255
|
+
let t = r[i], a = t[0], o = t[1], s = e.includes(a);
|
|
256
|
+
n = C(a, n, s), n = this._tag(n, o);
|
|
257
257
|
}
|
|
258
258
|
}), n;
|
|
259
259
|
}), this._rulePrefixOp = this.RULE("rulePrefixOp", () => {
|
|
260
|
-
let { PlusOp:
|
|
260
|
+
let { PlusOp: t, MinOp: n, ImplicitIntersectOp: r } = this._vocab, i = [];
|
|
261
261
|
this.MANY(() => {
|
|
262
|
-
let
|
|
263
|
-
{ ALT: () => this.CONSUME(e).image },
|
|
262
|
+
let e = this.OR([
|
|
264
263
|
{ ALT: () => this.CONSUME(t).image },
|
|
265
|
-
{ ALT: () => this.CONSUME(n).image }
|
|
264
|
+
{ ALT: () => this.CONSUME(n).image },
|
|
265
|
+
{ ALT: () => this.CONSUME(r).image }
|
|
266
266
|
]);
|
|
267
267
|
this.ACTION(() => {
|
|
268
|
-
|
|
268
|
+
i.push([e, this.getLexerPosition()]);
|
|
269
269
|
});
|
|
270
270
|
});
|
|
271
|
-
let
|
|
271
|
+
let a = this.SUBRULE(this._ruleRangeOp);
|
|
272
272
|
return this.ACTION(() => {
|
|
273
|
-
let
|
|
274
|
-
if (
|
|
275
|
-
let
|
|
276
|
-
|
|
273
|
+
let t = i.length;
|
|
274
|
+
if (t !== 0) for (let n = t - 1; n >= 0; n--) {
|
|
275
|
+
let t = i[n], r = t[0], o = t[1], c = e.includes(r);
|
|
276
|
+
a = s(r, a, c), a = this._tag(a, o);
|
|
277
277
|
}
|
|
278
|
-
}),
|
|
278
|
+
}), a;
|
|
279
279
|
}), this._ruleRangeOp = this.RULE("ruleRangeOp", () => {
|
|
280
|
-
let { RangeOp: e, RangeTrimFullOp: t, RangeTrimLeadingOp: n, RangeTrimTrailingOp: r } = this._vocab,
|
|
281
|
-
return
|
|
282
|
-
|
|
280
|
+
let { RangeOp: e, RangeTrimFullOp: t, RangeTrimLeadingOp: n, RangeTrimTrailingOp: r, ArrayAnchorOp: i } = this._vocab, a = [];
|
|
281
|
+
return a.push({ node: this.SUBRULE(this._ruleCallOp) }), this.MANY2(() => {
|
|
282
|
+
this.CONSUME(i), a.push({ anchor: this.getLexerPosition() });
|
|
283
|
+
}), this.MANY(() => {
|
|
284
|
+
let o = {
|
|
283
285
|
value: this.OR(this._c2 ||= [
|
|
284
286
|
{ ALT: () => this.CONSUME(e).image },
|
|
285
287
|
{ ALT: () => this.CONSUME(t).image },
|
|
@@ -287,17 +289,24 @@ var ie = {
|
|
|
287
289
|
{ ALT: () => this.CONSUME(r).image }
|
|
288
290
|
]),
|
|
289
291
|
index: this.getLexerPosition()
|
|
290
|
-
},
|
|
291
|
-
|
|
292
|
-
op:
|
|
293
|
-
node:
|
|
292
|
+
}, s = this.SUBRULE2(this._ruleCallOp);
|
|
293
|
+
a.push({
|
|
294
|
+
op: o,
|
|
295
|
+
node: s
|
|
296
|
+
}), this.MANY3(() => {
|
|
297
|
+
this.CONSUME2(i), a.push({ anchor: this.getLexerPosition() });
|
|
294
298
|
});
|
|
295
299
|
}), this.ACTION(() => {
|
|
296
|
-
for (let e = 1; e <
|
|
297
|
-
let t =
|
|
298
|
-
|
|
300
|
+
for (let e = 1; e < a.length; e++) {
|
|
301
|
+
let t = a[e];
|
|
302
|
+
if (t.anchor !== void 0) {
|
|
303
|
+
a[0].node = this._tag(C("#", a[0].node, !0), t.anchor);
|
|
304
|
+
continue;
|
|
305
|
+
}
|
|
306
|
+
let n = t.op, r = v(n.value, a[0].node, t.node, !0);
|
|
307
|
+
r = this._tag(r, n.index), a[0].node = r;
|
|
299
308
|
}
|
|
300
|
-
}),
|
|
309
|
+
}), a[0].node;
|
|
301
310
|
}), this._ruleCallOp = this.RULE("ruleCallOp", () => {
|
|
302
311
|
let { OpenParen: e, CloseParen: t } = this._vocab, n = this.SUBRULE(this._ruleFormula);
|
|
303
312
|
return this.MANY({
|
|
@@ -307,7 +316,7 @@ var ie = {
|
|
|
307
316
|
},
|
|
308
317
|
DEF: () => {
|
|
309
318
|
this.CONSUME(e);
|
|
310
|
-
let r = this.getLexerPosition(), i = this.SUBRULE(this._ruleFunctionArguments), a = n, o = this.ACTION(() => this._tag(
|
|
319
|
+
let r = this.getLexerPosition(), i = this.SUBRULE(this._ruleFunctionArguments), a = n, o = this.ACTION(() => this._tag(m(a, i), r)), s = this.OPTION(() => this.CONSUME(t));
|
|
311
320
|
this.ACTION(() => {
|
|
312
321
|
s || this._reportError(o, "Missing closing parenthesis ')'", r), this._tagClose(o, this.getLexerPosition()), n = o;
|
|
313
322
|
});
|
|
@@ -329,7 +338,7 @@ var ie = {
|
|
|
329
338
|
for (; e.length > 1;) {
|
|
330
339
|
let t = e.length - 1;
|
|
331
340
|
for (let n = 0; n < t; n++) {
|
|
332
|
-
let r = e[n], i = e[n + 1], a =
|
|
341
|
+
let r = e[n], i = e[n + 1], a = v(" ", r, i, !0), o = this._tokenMap.get(r);
|
|
333
342
|
o && delete o.tokenIndexClose;
|
|
334
343
|
let s = this._tokenMap.get(i), c = s?.tokenIndex;
|
|
335
344
|
if (c !== void 0) {
|
|
@@ -359,77 +368,77 @@ var ie = {
|
|
|
359
368
|
}), t;
|
|
360
369
|
}), this._ruleParen = this.RULE("ruleParen", () => {
|
|
361
370
|
let { OpenParen: e, CloseParen: t } = this._vocab;
|
|
362
|
-
return this._processParen(
|
|
371
|
+
return this._processParen(P.Paren, e, t);
|
|
363
372
|
}), this._ruleLiteralArray = this.RULE("ruleLiteralArray", () => {
|
|
364
|
-
let { OpenCurlyParen: e, CloseCurlyParen: t, ColSeparator:
|
|
373
|
+
let { OpenCurlyParen: e, CloseCurlyParen: t, ColSeparator: n, RowSeparator: r } = this._vocab, i = S();
|
|
365
374
|
this.CONSUME(e);
|
|
366
|
-
let
|
|
375
|
+
let a = this.getLexerPosition(), o = this.ACTION(() => this._tag(ne(i), a)), s = this.SUBRULE(this._ruleLiteralForArray);
|
|
367
376
|
this.ACTION(() => {
|
|
368
|
-
|
|
377
|
+
i.value.push(s);
|
|
369
378
|
}), this.MANY(() => {
|
|
370
379
|
let e = !1;
|
|
371
380
|
this.OR([{ ALT: () => {
|
|
372
|
-
this.CONSUME(
|
|
373
|
-
} }, { ALT: () => this.CONSUME(
|
|
381
|
+
this.CONSUME(n), e = !0;
|
|
382
|
+
} }, { ALT: () => this.CONSUME(r) }]);
|
|
374
383
|
let t = this.SUBRULE2(this._ruleLiteralForArray);
|
|
375
384
|
this.ACTION(() => {
|
|
376
|
-
e || (
|
|
385
|
+
e || (i = S(), o.value.push(i)), i.value.push(t);
|
|
377
386
|
});
|
|
378
387
|
});
|
|
379
|
-
let
|
|
380
|
-
return
|
|
388
|
+
let c = this.OPTION(() => this.CONSUME(t));
|
|
389
|
+
return o = this.ACTION(() => (c || this._reportError(o, "Missing closing parenthesis '}'", a), this._tagClose(o, this.getLexerPosition()))), o;
|
|
381
390
|
}), this._ruleLiteralForArray = this.RULE("ruleLiteralForArray", () => {
|
|
382
|
-
let { StringToken: e, BooleanToken: t, LiteralError:
|
|
391
|
+
let { StringToken: e, BooleanToken: t, LiteralError: r, RefError: i } = this._vocab;
|
|
383
392
|
return this.OR([
|
|
384
393
|
{ ALT: () => {
|
|
385
|
-
let e = this.OPTION(() => this.SUBRULE(this._rulePlusMinusOp)), t = this.SUBRULE(this._ruleNumber), n = this.ACTION(() => this._tag(
|
|
386
|
-
return this.ACTION(() => e ?
|
|
394
|
+
let e = this.OPTION(() => this.SUBRULE(this._rulePlusMinusOp)), t = this.SUBRULE(this._ruleNumber), n = this.ACTION(() => this._tag(x(t.image, this._locale), this.getLexerPosition()));
|
|
395
|
+
return this.ACTION(() => e ? d(e.image, n) : n);
|
|
387
396
|
} },
|
|
388
397
|
{ ALT: () => {
|
|
389
398
|
let t = this.CONSUME(e);
|
|
390
|
-
return this.ACTION(() => this._tag(
|
|
399
|
+
return this.ACTION(() => this._tag(T(t.image), this.getLexerPosition()));
|
|
391
400
|
} },
|
|
392
401
|
{ ALT: () => {
|
|
393
402
|
let e = this.CONSUME(t);
|
|
394
|
-
return this.ACTION(() => this._tag(
|
|
403
|
+
return this.ACTION(() => this._tag(p(e.image, this._locale), this.getLexerPosition()));
|
|
395
404
|
} },
|
|
396
405
|
{ ALT: () => {
|
|
397
|
-
let e = this.CONSUME(
|
|
398
|
-
return this.ACTION(() => this._tag(
|
|
406
|
+
let e = this.CONSUME(r);
|
|
407
|
+
return this.ACTION(() => this._tag(n(e.image, this._locale), this.getLexerPosition()));
|
|
399
408
|
} },
|
|
400
409
|
{ ALT: () => {
|
|
401
|
-
let e = this.CONSUME(
|
|
402
|
-
return this.ACTION(() => this._tag(
|
|
410
|
+
let e = this.CONSUME(i);
|
|
411
|
+
return this.ACTION(() => this._tag(M(e.image, this._locale), this.getLexerPosition()));
|
|
403
412
|
} }
|
|
404
413
|
]);
|
|
405
414
|
}), this._ruleLiteral = this.RULE("ruleLiteral", () => {
|
|
406
|
-
let { StringToken: e, BooleanToken: t, LiteralError:
|
|
415
|
+
let { StringToken: e, BooleanToken: t, LiteralError: r, RefError: i } = this._vocab;
|
|
407
416
|
return this.OR([
|
|
408
417
|
{ ALT: () => {
|
|
409
418
|
let e = this.SUBRULE(this._ruleNumber);
|
|
410
|
-
return this.ACTION(() => this._tag(
|
|
419
|
+
return this.ACTION(() => this._tag(x(e.image, this._locale), this.getLexerPosition()));
|
|
411
420
|
} },
|
|
412
421
|
{ ALT: () => {
|
|
413
422
|
let t = this.CONSUME(e);
|
|
414
|
-
return this.ACTION(() => this._tag(
|
|
423
|
+
return this.ACTION(() => this._tag(T(t.image), this.getLexerPosition()));
|
|
415
424
|
} },
|
|
416
425
|
{ ALT: () => {
|
|
417
426
|
let e = this.CONSUME(t);
|
|
418
|
-
return this.ACTION(() => this._tag(
|
|
427
|
+
return this.ACTION(() => this._tag(p(e.image, this._locale), this.getLexerPosition()));
|
|
419
428
|
} },
|
|
420
429
|
{ ALT: () => {
|
|
421
|
-
let e = this.CONSUME(
|
|
422
|
-
return this.ACTION(() => this._tag(
|
|
430
|
+
let e = this.CONSUME(r);
|
|
431
|
+
return this.ACTION(() => this._tag(n(e.image, this._locale), this.getLexerPosition()));
|
|
423
432
|
} },
|
|
424
433
|
{ ALT: () => {
|
|
425
|
-
let e = this.CONSUME(
|
|
426
|
-
return this.ACTION(() => this._tag(
|
|
434
|
+
let e = this.CONSUME(i);
|
|
435
|
+
return this.ACTION(() => this._tag(M(e.image, this._locale), this.getLexerPosition()));
|
|
427
436
|
} }
|
|
428
437
|
]);
|
|
429
438
|
}), this._ruleFunction = this.RULE("ruleFunction", () => {
|
|
430
439
|
let { FunctionToken: e, OpenParen: t, CloseParen: n } = this._vocab, r = this.CONSUME(e).image, i = this.getLexerPosition();
|
|
431
440
|
this.CONSUME(t);
|
|
432
|
-
let a = this.SUBRULE(this._ruleFunctionArguments), o = this.ACTION(() => this._tag(
|
|
441
|
+
let a = this.SUBRULE(this._ruleFunctionArguments), o = this.ACTION(() => this._tag(f(r, a), i)), s = this.OPTION(() => this.CONSUME(n));
|
|
433
442
|
return o = this.ACTION(() => (s || this._reportError(o, "Missing closing parenthesis ')'", i), this._tagClose(o, this.getLexerPosition()))), o;
|
|
434
443
|
}), this._ruleFunctionArguments = this.RULE("ruleFunctionArguments", () => {
|
|
435
444
|
let { ArgSeparator: e, CloseParen: t } = this._vocab, n = [];
|
|
@@ -439,11 +448,11 @@ var ie = {
|
|
|
439
448
|
let t;
|
|
440
449
|
this.OPTION2(() => {
|
|
441
450
|
t = this.SUBRULE(this._ruleIntersectOp);
|
|
442
|
-
}), t = this.ACTION(() => t ?? this._tagClose(
|
|
451
|
+
}), t = this.ACTION(() => t ?? this._tagClose(l(), this.getLexerPosition())), n.push(t), this.MANY(() => {
|
|
443
452
|
let t;
|
|
444
453
|
this.CONSUME(e), this.OPTION3(() => {
|
|
445
454
|
t = this.SUBRULE2(this._ruleIntersectOp);
|
|
446
|
-
}), t = this.ACTION(() => t ?? this._tagClose(
|
|
455
|
+
}), t = this.ACTION(() => t ?? this._tagClose(l(), this.getLexerPosition())), n.push(t);
|
|
447
456
|
});
|
|
448
457
|
}
|
|
449
458
|
}), n;
|
|
@@ -462,13 +471,13 @@ var ie = {
|
|
|
462
471
|
return this._tag(e.root, n);
|
|
463
472
|
});
|
|
464
473
|
}), this._ruleReference = this.RULE("ruleReference", () => {
|
|
465
|
-
let { Sheet: e, SheetQuoted: t, DivOp: n, MulOp: r, PlusOp: i, MinOp: a, ArgSeparator:
|
|
474
|
+
let { Sheet: e, SheetQuoted: t, DivOp: n, MulOp: r, PlusOp: i, MinOp: a, ArgSeparator: s, Cell: l, NamedToken: d, SingleQuotedString: f, Column: p, AbsRow: m, DigitToken: h, RefError: _ } = this._vocab, v;
|
|
466
475
|
this.OPTION2({
|
|
467
476
|
GATE: () => {
|
|
468
|
-
for (let
|
|
469
|
-
let c = this.LA(
|
|
477
|
+
for (let o = 1; o < 6; o++) {
|
|
478
|
+
let c = this.LA(o);
|
|
470
479
|
if (c.tokenType === e || c.tokenType === t) return !0;
|
|
471
|
-
if (c.image === "" || c.image === ")" || c.tokenType === n || c.tokenType === r || c.tokenType === i || c.tokenType === a || c.tokenType ===
|
|
480
|
+
if (c.image === "" || c.image === ")" || c.tokenType === n || c.tokenType === r || c.tokenType === i || c.tokenType === a || c.tokenType === s) break;
|
|
472
481
|
}
|
|
473
482
|
return !1;
|
|
474
483
|
},
|
|
@@ -478,40 +487,37 @@ var ie = {
|
|
|
478
487
|
});
|
|
479
488
|
let y = this.OR([
|
|
480
489
|
{ ALT: () => {
|
|
481
|
-
let e = this.CONSUME(
|
|
482
|
-
return this.ACTION(() =>
|
|
483
|
-
let r = this._tag(m(e.image, this.rowIndex, this.colIndex), t);
|
|
484
|
-
return n ? this._tag(x("#", r, !0), t) : r;
|
|
485
|
-
});
|
|
490
|
+
let e = this.CONSUME(l), t = this.getLexerPosition();
|
|
491
|
+
return this.ACTION(() => this._tag(g(e.image, this.rowIndex, this.colIndex), t));
|
|
486
492
|
} },
|
|
487
493
|
{ ALT: () => {
|
|
488
|
-
let e = this.OR2([{ ALT: () => this.CONSUME(
|
|
489
|
-
return this.ACTION(() => this._tag(
|
|
494
|
+
let e = this.OR2([{ ALT: () => this.CONSUME(d) }, { ALT: () => this.CONSUME(f) }]);
|
|
495
|
+
return this.ACTION(() => this._tag(c(e.image), this.getLexerPosition()));
|
|
490
496
|
} },
|
|
491
497
|
{ ALT: () => this.SUBRULE(this._ruleBracketedString) },
|
|
492
498
|
{ ALT: () => this.SUBRULE(this._ruleFunction) },
|
|
493
499
|
{ ALT: () => {
|
|
494
|
-
let e = this.CONSUME(
|
|
495
|
-
return this.ACTION(() => this._tag(
|
|
500
|
+
let e = this.CONSUME(p);
|
|
501
|
+
return this.ACTION(() => this._tag(o(e.image, this.colIndex), this.getLexerPosition()));
|
|
496
502
|
} },
|
|
497
503
|
{ ALT: () => {
|
|
498
|
-
let e = this.CONSUME(
|
|
499
|
-
return this.ACTION(() => this._tag(
|
|
504
|
+
let e = this.CONSUME(m);
|
|
505
|
+
return this.ACTION(() => this._tag(u(e.image, this.rowIndex), this.getLexerPosition()));
|
|
500
506
|
} },
|
|
501
507
|
{ ALT: () => {
|
|
502
508
|
let e = this.CONSUME(h);
|
|
503
|
-
return this.ACTION(() => this._tag(
|
|
509
|
+
return this.ACTION(() => this._tag(u(e.image, this.rowIndex), this.getLexerPosition()));
|
|
504
510
|
} },
|
|
505
511
|
{ ALT: () => {
|
|
506
512
|
let e = this.CONSUME(_);
|
|
507
|
-
return this.ACTION(() => this._tag(
|
|
513
|
+
return this.ACTION(() => this._tag(M(e.image, this._locale), this.getLexerPosition()));
|
|
508
514
|
} }
|
|
509
515
|
]);
|
|
510
516
|
return this.ACTION(() => {
|
|
511
517
|
if (v && y) {
|
|
512
518
|
if (v.name === "") return void this._reportError(y, `'${v.image}' is not a valid sheet reference — a '!' needs a sheet name before it`);
|
|
513
519
|
let e = y;
|
|
514
|
-
y.type ===
|
|
520
|
+
y.type === P.Postfix && y.inputs?.[0] && (e = y.inputs[0]), e.type !== P.Cell && e.type !== P.Named && e.type !== P.Row && e.type !== P.TableColumn && e.type !== P.Error || (e.value.scope = v.name, e.value.scopeImage = v.image);
|
|
515
521
|
}
|
|
516
522
|
}), y;
|
|
517
523
|
}), this._rulePrefixSheetName = this.RULE("rulePrefixSheetName", () => {
|
|
@@ -550,47 +556,47 @@ var ie = {
|
|
|
550
556
|
return this.MANY(() => {
|
|
551
557
|
this.CONSUME(e), n.push(this.SUBRULE2(this._ruleIntersectOp));
|
|
552
558
|
}), this.ACTION(() => n.length === 0 ? t : {
|
|
553
|
-
type:
|
|
559
|
+
type: P.List,
|
|
554
560
|
value: ",",
|
|
555
561
|
inputs: [t, ...n],
|
|
556
562
|
isReference: !0
|
|
557
563
|
});
|
|
558
|
-
}), this._lexer =
|
|
564
|
+
}), this._lexer = i, this._locale = i.getLocale(), this._vocab = a, this._srParser = r?.srParser ?? new J(this._locale), this.performSelfAnalysis();
|
|
559
565
|
}
|
|
560
566
|
getLexer() {
|
|
561
567
|
return this._lexer;
|
|
562
568
|
}
|
|
563
|
-
parse(
|
|
564
|
-
let
|
|
565
|
-
if (!
|
|
569
|
+
parse(e, t, n, r) {
|
|
570
|
+
let i = this._lexer.tokenize(n), a;
|
|
571
|
+
if (!i) return {
|
|
566
572
|
root: {
|
|
567
|
-
type:
|
|
568
|
-
value:
|
|
573
|
+
type: P.Unparsed,
|
|
574
|
+
value: n
|
|
569
575
|
},
|
|
570
576
|
errors: []
|
|
571
577
|
};
|
|
572
|
-
let
|
|
573
|
-
if (
|
|
574
|
-
return this.input =
|
|
575
|
-
let
|
|
576
|
-
if (
|
|
577
|
-
let
|
|
578
|
-
return
|
|
578
|
+
let o = i.tokens;
|
|
579
|
+
if (o.length === 0) throw new W.Parse(Q);
|
|
580
|
+
return this.input = o, this._inputText = n, this._inputTextLength = n.length, this.rowIndex = e, this.colIndex = t, this._astErrors = [], this._tokenMap = /* @__PURE__ */ new Map(), this.reset(), a = this._ruleRoot(), a && this._bindAllWhitespace(a), a = ee(a, (t, n) => {
|
|
581
|
+
let r = t.type, i = n?.isReference ? n.value : void 0, a = typeof i == "string" && Y.has(i), o = typeof i == "string" && ie.has(i), s = a ? n.inputs : void 0, l = s ? s[0] === t ? s[1] : s[0] : void 0, d = this._lexer.getMaxRow();
|
|
582
|
+
if (a && r !== P.Cell && Number.isInteger(t.value)) {
|
|
583
|
+
let n = u(t.image, e);
|
|
584
|
+
return k(n, t), X(l) === "row" ? Z(t.image, d) || this._reportError(n, `'${t.image}' is not a valid row — rows run from 1 to ${d}`) : this._reportError(n, `'${t.image}' is not a valid reference — a whole row can only pair with another row (as in ${t.image}:${t.image})`), n;
|
|
579
585
|
}
|
|
580
|
-
if (
|
|
581
|
-
if (
|
|
582
|
-
let
|
|
583
|
-
if ((
|
|
584
|
-
if (
|
|
585
|
-
let
|
|
586
|
-
|
|
587
|
-
let
|
|
588
|
-
return
|
|
586
|
+
if (o && r === P.Named) return this._reportError(t, `'${t.image ?? t.value?.nameId}' is a name — '${i}' needs a cell or range on both sides`), t;
|
|
587
|
+
if (r === P.Cell) {
|
|
588
|
+
let e = t.value, n = e.colIndex === -(2 ** 53 - 1), r = e.rowIndex === -(2 ** 53 - 1);
|
|
589
|
+
if ((n || r) && X(l) === (n ? "row" : "col")) return n && !Z(t.image, d) && this._reportError(t, `'${t.image}' is not a valid row — rows run from 1 to ${d}`), t;
|
|
590
|
+
if (n || r || e.colIndex >= 16384) {
|
|
591
|
+
let a = c(t.image);
|
|
592
|
+
k(a, t);
|
|
593
|
+
let s = e.scope;
|
|
594
|
+
return s && (a.value.scope = s, a.value.scopeImage = e.scopeImage), n ? this._reportError(a, `'${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(a, `'${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(a, `'${t.image}' is a name — '${i}' needs a cell or range on both sides`), a;
|
|
589
595
|
}
|
|
590
596
|
}
|
|
591
|
-
return
|
|
592
|
-
}),
|
|
593
|
-
root:
|
|
597
|
+
return t;
|
|
598
|
+
}), r && a && (a = te(a, r, null)), {
|
|
599
|
+
root: a,
|
|
594
600
|
errors: [...this.errors, ...this._astErrors]
|
|
595
601
|
};
|
|
596
602
|
}
|
|
@@ -646,26 +652,26 @@ var ie = {
|
|
|
646
652
|
_bindAllWhitespace(e) {
|
|
647
653
|
if (e) {
|
|
648
654
|
if (this._bindNodeWhitespace(e), e.inputs) for (let t of e.inputs) t && this._bindAllWhitespace(t);
|
|
649
|
-
if (e.type ===
|
|
655
|
+
if (e.type === P.Array && Array.isArray(e.value)) {
|
|
650
656
|
for (let t of e.value) if (t && Array.isArray(t.value)) for (let e of t.value) e && this._bindAllWhitespace(e);
|
|
651
657
|
}
|
|
652
658
|
}
|
|
653
659
|
}
|
|
654
|
-
},
|
|
660
|
+
}, se = class {
|
|
655
661
|
constructor(e) {
|
|
656
|
-
e = { ...e }, this._editing = e.profile === "editing", this._parser = new
|
|
662
|
+
e = { ...e }, this._editing = e.profile === "editing", this._parser = new oe(e);
|
|
657
663
|
}
|
|
658
664
|
compile(e, t, n, o, s, c, l, u) {
|
|
659
665
|
if (o.length === 0) {
|
|
660
|
-
let t = new
|
|
666
|
+
let t = new W.Parse(Q);
|
|
661
667
|
return this._compileUnparsed(e, s, o, {
|
|
662
668
|
input: o,
|
|
663
669
|
cause: t,
|
|
664
670
|
causes: [t]
|
|
665
671
|
});
|
|
666
672
|
}
|
|
667
|
-
if (o.length >
|
|
668
|
-
let t = new
|
|
673
|
+
if (o.length > N.MAX_EXPRESSION_LENGTH) {
|
|
674
|
+
let t = new W.Parse((d = o.length, `A formula must not be longer than ${N.MAX_EXPRESSION_LENGTH} characters (this one is ${d})`));
|
|
669
675
|
return this._compileUnparsed(e, s, o, {
|
|
670
676
|
input: o,
|
|
671
677
|
cause: t,
|
|
@@ -678,20 +684,20 @@ var ie = {
|
|
|
678
684
|
let e = this._parser.parse(t, n, o, u);
|
|
679
685
|
f = e.root, m = e.errors;
|
|
680
686
|
} catch (e) {
|
|
681
|
-
p =
|
|
687
|
+
p = W.isError(e, W.Code.Parse) ? e : new W.Parse(e.message, e);
|
|
682
688
|
}
|
|
683
689
|
let g = [];
|
|
684
|
-
for (let e of m) g.push(
|
|
690
|
+
for (let e of m) g.push(a(e));
|
|
685
691
|
if (f) {
|
|
686
|
-
|
|
687
|
-
let e =
|
|
688
|
-
e && g.push(new
|
|
692
|
+
I(f, c ?? null) && g.push(new W.Parse("The implicit intersection operator ' ' requires a cell or range on both sides")), r(f, c ?? null) && g.push(new W.Parse("The spill anchor operator '#' requires a cell or range")), b(f, c ?? null) && g.push(new W.Parse("Expected a reference; a value cannot be converted to one."));
|
|
693
|
+
let e = R(f, c ?? null);
|
|
694
|
+
e && g.push(new W.Parse(e));
|
|
689
695
|
let t = O(f, c ?? null);
|
|
690
|
-
t && g.push(new
|
|
691
|
-
let n =
|
|
692
|
-
n && g.push(new
|
|
696
|
+
t && g.push(new W.Parse(t));
|
|
697
|
+
let n = L(f, c ?? null);
|
|
698
|
+
n && g.push(new W.Parse(n));
|
|
693
699
|
let i = y(f);
|
|
694
|
-
i && g.push(new
|
|
700
|
+
i && g.push(new W.Parse(i));
|
|
695
701
|
}
|
|
696
702
|
g.length > 0 && !p && (p = g[0]);
|
|
697
703
|
let _ = null;
|
|
@@ -706,9 +712,9 @@ var ie = {
|
|
|
706
712
|
}
|
|
707
713
|
return this._compileUnparsed(e, s, o, _);
|
|
708
714
|
}
|
|
709
|
-
f =
|
|
715
|
+
f = h(f, c ?? null), f = D(f, c ?? null), s && (f = i(f, s, l));
|
|
710
716
|
let v = F(e, s, f, this._editing, _, c ?? null);
|
|
711
|
-
return this._editing && _ &&
|
|
717
|
+
return this._editing && _ && A(v.getTokens(), s) !== o ? this._recoverCompiled(e, t, n, o, s, _, l) || this._compileUnparsed(e, s, o, _) : v;
|
|
712
718
|
}
|
|
713
719
|
autoCorrect(e) {
|
|
714
720
|
let t;
|
|
@@ -734,21 +740,21 @@ var ie = {
|
|
|
734
740
|
symbols: t,
|
|
735
741
|
getFunction: null,
|
|
736
742
|
ast: null,
|
|
737
|
-
evaluations:
|
|
738
|
-
executions:
|
|
739
|
-
bindings:
|
|
740
|
-
referencesAbsolute:
|
|
741
|
-
referencesExecute:
|
|
742
|
-
referencesRelative:
|
|
743
|
-
referencesRoot:
|
|
744
|
-
referenceIndices:
|
|
743
|
+
evaluations: G.EmptyArray,
|
|
744
|
+
executions: G.EmptyArray,
|
|
745
|
+
bindings: G.EmptyArray,
|
|
746
|
+
referencesAbsolute: G.EmptyArray,
|
|
747
|
+
referencesExecute: G.EmptyArray,
|
|
748
|
+
referencesRelative: G.EmptyArray,
|
|
749
|
+
referencesRoot: G.EmptyArray,
|
|
750
|
+
referenceIndices: G.EmptyArray,
|
|
745
751
|
getTokens: () => [{
|
|
746
|
-
type:
|
|
752
|
+
type: P.Unparsed,
|
|
747
753
|
value: n,
|
|
748
754
|
text: n
|
|
749
755
|
}],
|
|
750
|
-
namedIds:
|
|
751
|
-
symbolIds:
|
|
756
|
+
namedIds: G.EmptyArray,
|
|
757
|
+
symbolIds: G.EmptyArray,
|
|
752
758
|
hasTotals: !1,
|
|
753
759
|
isReferenceOnly: !1,
|
|
754
760
|
error: r,
|
|
@@ -756,7 +762,7 @@ var ie = {
|
|
|
756
762
|
};
|
|
757
763
|
return i;
|
|
758
764
|
}
|
|
759
|
-
_recoverCompiled(e, t, n, r,
|
|
765
|
+
_recoverCompiled(e, t, n, r, a, o, s) {
|
|
760
766
|
let c, l = r.length;
|
|
761
767
|
try {
|
|
762
768
|
let e = this._parser.getLexer().tokenize(r, !1);
|
|
@@ -776,14 +782,14 @@ var ie = {
|
|
|
776
782
|
} catch {
|
|
777
783
|
continue;
|
|
778
784
|
}
|
|
779
|
-
if (!u || u.type ===
|
|
785
|
+
if (!u || u.type === P.Unparsed) continue;
|
|
780
786
|
try {
|
|
781
787
|
let t = D(u, null);
|
|
782
|
-
d = F(e,
|
|
788
|
+
d = F(e, a, a ? i(t, a, s) : t, !0, o);
|
|
783
789
|
} catch {
|
|
784
790
|
continue;
|
|
785
791
|
}
|
|
786
|
-
if (
|
|
792
|
+
if (A(d.getTokens(), a) !== l) continue;
|
|
787
793
|
let f = r.slice(c);
|
|
788
794
|
if (f.length === 0) return d;
|
|
789
795
|
let p, m = {
|
|
@@ -797,16 +803,16 @@ var ie = {
|
|
|
797
803
|
}
|
|
798
804
|
_appendUnparsedTail(e, t) {
|
|
799
805
|
let n = [];
|
|
800
|
-
for (let t of e) t.type ===
|
|
806
|
+
for (let t of e) t.type === P.Paren && t.text === "(" ? n.push({
|
|
801
807
|
ctx: t.context,
|
|
802
808
|
argIndex: 0
|
|
803
|
-
}) : t.type ===
|
|
809
|
+
}) : t.type === P.Paren && t.text === ")" ? n.pop() : t.type === P.Separator && n.length > 0 && n[n.length - 1].argIndex++;
|
|
804
810
|
let r = n.length > 0 ? n[n.length - 1] : void 0, i = r?.ctx ? {
|
|
805
811
|
...r.ctx,
|
|
806
812
|
argIndex: r.ctx.argIndex === -1 ? r.argIndex : r.ctx.argIndex
|
|
807
813
|
} : void 0, a = (t, n) => {
|
|
808
814
|
let r = {
|
|
809
|
-
type:
|
|
815
|
+
type: P.Unparsed,
|
|
810
816
|
value: t,
|
|
811
817
|
text: t
|
|
812
818
|
};
|
|
@@ -815,4 +821,4 @@ var ie = {
|
|
|
815
821
|
s >= 0 && (s === 0 || !/[A-Za-z0-9_.]/.test(t[s - 1])) ? (s > 0 && a(t.slice(0, s)), a(t.slice(s), !0)) : a(t);
|
|
816
822
|
}
|
|
817
823
|
};
|
|
818
|
-
export {
|
|
824
|
+
export { se as FormulaCompiler };
|