@zwave-js/config 15.15.3 → 15.17.0

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.
Files changed (67) hide show
  1. package/build/cjs/JsonTemplate.js +2 -2
  2. package/build/cjs/JsonTemplate.js.map +2 -2
  3. package/build/cjs/Logic.d.ts +1 -1
  4. package/build/cjs/Logic.js +6 -7
  5. package/build/cjs/Logic.js.map +2 -2
  6. package/build/cjs/LogicParser.d.ts +66 -84
  7. package/build/cjs/LogicParser.js +410 -1337
  8. package/build/cjs/LogicParser.js.map +3 -3
  9. package/build/cjs/Manufacturers.js +1 -1
  10. package/build/cjs/Manufacturers.js.map +2 -2
  11. package/build/cjs/_version.d.ts +1 -1
  12. package/build/cjs/_version.js +1 -1
  13. package/build/cjs/_version.js.map +1 -1
  14. package/build/cjs/devices/DeviceConfig.d.ts +3 -3
  15. package/build/cjs/devices/DeviceConfig.js +3 -3
  16. package/build/cjs/devices/DeviceConfig.js.map +2 -2
  17. package/build/cjs/devices/DeviceConfig.unit._test.js.map +1 -1
  18. package/build/cjs/devices/ParamInformation.d.ts +2 -0
  19. package/build/cjs/devices/ParamInformation.js +16 -2
  20. package/build/cjs/devices/ParamInformation.js.map +2 -2
  21. package/build/cjs/index.js.map +2 -2
  22. package/build/esm/JsonTemplate.js +2 -2
  23. package/build/esm/JsonTemplate.js.map +1 -1
  24. package/build/esm/Logic.d.ts +1 -1
  25. package/build/esm/Logic.d.ts.map +1 -1
  26. package/build/esm/Logic.js +6 -8
  27. package/build/esm/Logic.js.map +1 -1
  28. package/build/esm/LogicParser.d.ts +66 -84
  29. package/build/esm/LogicParser.d.ts.map +1 -1
  30. package/build/esm/LogicParser.js +432 -2335
  31. package/build/esm/LogicParser.js.map +1 -1
  32. package/build/esm/Manufacturers.js +1 -1
  33. package/build/esm/Manufacturers.js.map +1 -1
  34. package/build/esm/_version.d.ts +1 -1
  35. package/build/esm/_version.js +1 -1
  36. package/build/esm/devices/DeviceConfig.d.ts +3 -3
  37. package/build/esm/devices/DeviceConfig.d.ts.map +1 -1
  38. package/build/esm/devices/DeviceConfig.js +4 -3
  39. package/build/esm/devices/DeviceConfig.js.map +1 -1
  40. package/build/esm/devices/DeviceConfig.unit._test.js +1 -0
  41. package/build/esm/devices/DeviceConfig.unit._test.js.map +1 -1
  42. package/build/esm/devices/ParamInformation.d.ts +2 -0
  43. package/build/esm/devices/ParamInformation.d.ts.map +1 -1
  44. package/build/esm/devices/ParamInformation.js +17 -2
  45. package/build/esm/devices/ParamInformation.js.map +1 -1
  46. package/build/esm/index.d.ts.map +1 -1
  47. package/build/esm/index.js +0 -1
  48. package/build/esm/index.js.map +1 -1
  49. package/config/devices/0x003b/be468zp.json +1 -1
  50. package/config/devices/0x003b/be469.json +2 -3
  51. package/config/devices/0x003b/be469zp.json +2 -3
  52. package/config/devices/0x0063/55258_zw4002.json +34 -1
  53. package/config/devices/0x0090/918.json +101 -0
  54. package/config/devices/0x0090/hc620.json +4 -0
  55. package/config/devices/0x0148/cometz_700.json +1 -1
  56. package/config/devices/0x021d/{ddl240x.json → ddl240x_15hzw.json} +1 -2
  57. package/config/devices/0x021d/ddl240x_1hzw.json +115 -0
  58. package/config/devices/0x027a/zse11.json +134 -0
  59. package/config/devices/0x0460/qlsh-001P10.json +119 -0
  60. package/config/devices/0x0460/qnpl-0A112.json +4 -0
  61. package/config/devices/0x0460/qnsw-001P16.json +15 -0
  62. package/config/devices/0x0460/qnsw-001X16.json +10 -0
  63. package/config/devices/0x0460/templates/wave_template.json +70 -0
  64. package/config/devices/0x0460/{qnsw-002P16.json → wave_2pm.json} +22 -1
  65. package/config/devices/templates/master_template.json +1 -1
  66. package/config/eslint.config.mjs +24 -19
  67. package/package.json +10 -12
@@ -1,2358 +1,455 @@
1
- // THIS FILE WAS AUTO GENERATED
2
- /* eslint-disable */
3
- // @ts-nocheck
4
- /* eslint-disable */
5
- const peggyParser = // Generated by Peggy 3.0.2.
6
-
7
- //
8
- // https://peggyjs.org/
9
- // @ts-ignore
10
- (function () {
11
- // @ts-ignore
12
- "use strict";
13
- // @ts-ignore
14
- function peg$subclass(child, parent) {
15
- // @ts-ignore
16
- function C() {
17
- this.constructor = child;
18
- }
19
- // @ts-ignore
20
- C.prototype = parent.prototype;
21
- // @ts-ignore
22
- child.prototype = new C();
23
- }
24
- // @ts-ignore
25
- function peg$SyntaxError(message, expected, found, location) {
26
- // @ts-ignore
27
- var self = Error.call(this, message);
28
- // istanbul ignore next Check is a necessary evil to support older environments
29
- // @ts-ignore
30
- if (Object.setPrototypeOf) {
31
- // @ts-ignore
32
- Object.setPrototypeOf(self, peg$SyntaxError.prototype);
33
- }
34
- // @ts-ignore
35
- self.expected = expected;
36
- // @ts-ignore
37
- self.found = found;
38
- // @ts-ignore
39
- self.location = location;
40
- // @ts-ignore
41
- self.name = "SyntaxError";
42
- // @ts-ignore
43
- return self;
44
- }
45
- // @ts-ignore
46
- peg$subclass(peg$SyntaxError, Error);
47
- // @ts-ignore
48
- function peg$padEnd(str, targetLength, padString) {
49
- // @ts-ignore
50
- padString = padString || " ";
51
- // @ts-ignore
52
- if (str.length > targetLength)
53
- return str;
54
- // @ts-ignore
55
- targetLength -= str.length;
56
- // @ts-ignore
57
- padString += padString.repeat(targetLength);
58
- // @ts-ignore
59
- return str + padString.slice(0, targetLength);
60
- }
61
- // @ts-ignore
62
- peg$SyntaxError.prototype.format = function (sources) {
63
- // @ts-ignore
64
- var str = "Error: " + this.message;
65
- // @ts-ignore
66
- if (this.location) {
67
- // @ts-ignore
68
- var src = null;
69
- // @ts-ignore
70
- var k;
71
- // @ts-ignore
72
- for (k = 0; k < sources.length; k++) {
73
- // @ts-ignore
74
- if (sources[k].source === this.location.source) {
75
- // @ts-ignore
76
- src = sources[k].text.split(/\r\n|\n|\r/g);
77
- // @ts-ignore
78
- break;
79
- }
80
- }
81
- // @ts-ignore
82
- var s = this.location.start;
83
- // @ts-ignore
84
- var offset_s = (this.location.source
85
- && (typeof this.location.source.offset
86
- === "function"))
87
- // @ts-ignore
88
- ? this.location.source.offset(s)
89
- // @ts-ignore
90
- : s;
91
- // @ts-ignore
92
- var loc = this.location.source
93
- + ":"
94
- + offset_s.line
95
- + ":"
96
- + offset_s.column;
97
- // @ts-ignore
98
- if (src) {
99
- // @ts-ignore
100
- var e = this.location.end;
101
- // @ts-ignore
102
- var filler = peg$padEnd("", offset_s.line.toString().length, " ");
103
- // @ts-ignore
104
- var line = src[s.line - 1];
105
- // @ts-ignore
106
- var last = s.line === e.line ? e.column : line.length + 1;
107
- // @ts-ignore
108
- var hatLen = (last - s.column) || 1;
109
- // @ts-ignore
110
- str += "\n --> " + loc + "\n" // @ts-ignore
111
- + filler + " |\n" // @ts-ignore
112
- + offset_s.line + " | " + line + "\n" // @ts-ignore
113
- + filler + " | " + peg$padEnd("", s.column - 1, " ") // @ts-ignore
114
- + peg$padEnd("", hatLen, "^");
115
- // @ts-ignore
116
- }
117
- else {
118
- // @ts-ignore
119
- str += "\n at " + loc;
120
- }
121
- }
122
- // @ts-ignore
123
- return str;
124
- };
125
- // @ts-ignore
126
- peg$SyntaxError.buildMessage = function (expected, found) {
127
- // @ts-ignore
128
- var DESCRIBE_EXPECTATION_FNS = {
129
- // @ts-ignore
130
- literal: function (expectation) {
131
- // @ts-ignore
132
- return "\"" + literalEscape(expectation.text) + "\"";
133
- },
134
- // @ts-ignore
135
- class: function (expectation) {
136
- // @ts-ignore
137
- var escapedParts = expectation.parts.map(function (part) {
138
- // @ts-ignore
139
- return Array.isArray(part)
140
- // @ts-ignore
141
- ? classEscape(part[0]) + "-" + classEscape(part[1])
142
- // @ts-ignore
143
- : classEscape(part);
144
- });
145
- // @ts-ignore
146
- return "["
147
- + (expectation.inverted ? "^" : "")
148
- + escapedParts.join("")
149
- + "]";
150
- },
151
- // @ts-ignore
152
- any: function () {
153
- // @ts-ignore
154
- return "any character";
155
- },
156
- // @ts-ignore
157
- end: function () {
158
- // @ts-ignore
159
- return "end of input";
160
- },
161
- // @ts-ignore
162
- other: function (expectation) {
163
- // @ts-ignore
164
- return expectation.description;
165
- },
166
- };
167
- // @ts-ignore
168
- function hex(ch) {
169
- // @ts-ignore
170
- return ch.charCodeAt(0).toString(16).toUpperCase();
171
- }
172
- // @ts-ignore
173
- function literalEscape(s) {
174
- // @ts-ignore
175
- return s
176
- // @ts-ignore
177
- .replace(/\\/g, "\\\\")
178
- // @ts-ignore
179
- .replace(/"/g, "\\\"")
180
- // @ts-ignore
181
- .replace(/\0/g, "\\0")
182
- // @ts-ignore
183
- .replace(/\t/g, "\\t")
184
- // @ts-ignore
185
- .replace(/\n/g, "\\n")
186
- // @ts-ignore
187
- .replace(/\r/g, "\\r")
188
- // @ts-ignore
189
- .replace(/[\x00-\x0F]/g, function (ch) {
190
- return "\\x0" + hex(ch);
191
- })
192
- // @ts-ignore
193
- .replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) {
194
- return "\\x" + hex(ch);
195
- });
196
- }
197
- // @ts-ignore
198
- function classEscape(s) {
199
- // @ts-ignore
200
- return s
201
- // @ts-ignore
202
- .replace(/\\/g, "\\\\")
203
- // @ts-ignore
204
- .replace(/\]/g, "\\]")
205
- // @ts-ignore
206
- .replace(/\^/g, "\\^")
207
- // @ts-ignore
208
- .replace(/-/g, "\\-")
209
- // @ts-ignore
210
- .replace(/\0/g, "\\0")
211
- // @ts-ignore
212
- .replace(/\t/g, "\\t")
213
- // @ts-ignore
214
- .replace(/\n/g, "\\n")
215
- // @ts-ignore
216
- .replace(/\r/g, "\\r")
217
- // @ts-ignore
218
- .replace(/[\x00-\x0F]/g, function (ch) {
219
- return "\\x0" + hex(ch);
220
- })
221
- // @ts-ignore
222
- .replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) {
223
- return "\\x" + hex(ch);
224
- });
225
- }
226
- // @ts-ignore
227
- function describeExpectation(expectation) {
228
- // @ts-ignore
229
- return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
230
- }
231
- // @ts-ignore
232
- function describeExpected(expected) {
233
- // @ts-ignore
234
- var descriptions = expected.map(describeExpectation);
235
- // @ts-ignore
236
- var i, j;
237
- // @ts-ignore
238
- descriptions.sort();
239
- // @ts-ignore
240
- if (descriptions.length > 0) {
241
- // @ts-ignore
242
- for (i = 1, j = 1; i < descriptions.length; i++) {
243
- // @ts-ignore
244
- if (descriptions[i - 1] !== descriptions[i]) {
245
- // @ts-ignore
246
- descriptions[j] = descriptions[i];
247
- // @ts-ignore
248
- j++;
249
- }
250
- }
251
- // @ts-ignore
252
- descriptions.length = j;
253
- }
254
- // @ts-ignore
255
- switch (descriptions.length) {
256
- // @ts-ignore
257
- case 1:
258
- // @ts-ignore
259
- return descriptions[0];
260
- // @ts-ignore
261
- case 2:
262
- // @ts-ignore
263
- return descriptions[0] + " or " + descriptions[1];
264
- // @ts-ignore
265
- default:
266
- // @ts-ignore
267
- return descriptions.slice(0, -1).join(", ")
268
- // @ts-ignore
269
- + ", or "
270
- // @ts-ignore
271
- + descriptions[descriptions.length - 1];
272
- }
273
- }
274
- // @ts-ignore
275
- function describeFound(found) {
276
- // @ts-ignore
277
- return found
278
- ? "\"" + literalEscape(found) + "\""
279
- : "end of input";
280
- }
281
- // @ts-ignore
282
- return "Expected "
283
- + describeExpected(expected)
284
- + " but "
285
- + describeFound(found)
286
- + " found.";
287
- };
288
- // @ts-ignore
289
- function peg$parse(input, options) {
290
- // @ts-ignore
291
- options = options !== undefined ? options : {};
292
- // @ts-ignore
293
- var peg$FAILED = {};
294
- // @ts-ignore
295
- var peg$source = options.grammarSource;
296
- // @ts-ignore
297
- var peg$startRuleFunctions = { start: peg$parsestart };
298
- // @ts-ignore
299
- var peg$startRuleFunction = peg$parsestart;
300
- // @ts-ignore
301
- var peg$c0 = "(";
302
- var peg$c1 = ")";
303
- var peg$c2 = "||";
304
- var peg$c3 = "&&";
305
- var peg$c4 = ">=";
306
- var peg$c5 = ">";
307
- var peg$c6 = "<=";
308
- var peg$c7 = "<";
309
- var peg$c8 = "===";
310
- var peg$c9 = "-";
311
- var peg$c10 = "0x";
312
- var peg$c11 = ".";
313
- var peg$c12 = "\"";
314
- var peg$c13 = "'";
315
- var peg$r0 = /^[a-zA-Z]/;
316
- var peg$r1 = /^[a-zA-Z0-9]/;
317
- var peg$r2 = /^[0-9]/;
318
- var peg$r3 = /^[0-9a-f]/i;
319
- var peg$r4 = /^[^"]/;
320
- var peg$r5 = /^[^']/;
321
- var peg$r6 = /^[ \t\n\r]/;
322
- var peg$e0 = peg$otherExpectation("grouped expression");
323
- var peg$e1 = peg$literalExpectation("(", false);
324
- var peg$e2 = peg$literalExpectation(")", false);
325
- var peg$e3 = peg$otherExpectation("logical OR");
326
- var peg$e4 = peg$literalExpectation("||", false);
327
- var peg$e5 = peg$otherExpectation("logical AND");
328
- var peg$e6 = peg$literalExpectation("&&", false);
329
- var peg$e7 = peg$otherExpectation("numeric comparison");
330
- var peg$e8 = peg$literalExpectation(">=", false);
331
- var peg$e9 = peg$literalExpectation(">", false);
332
- var peg$e10 = peg$literalExpectation("<=", false);
333
- var peg$e11 = peg$literalExpectation("<", false);
334
- var peg$e12 = peg$literalExpectation("===", false);
335
- var peg$e13 = peg$otherExpectation("version comparison");
336
- var peg$e14 = peg$otherExpectation("variable");
337
- var peg$e15 = peg$classExpectation([["a", "z"], ["A", "Z"]], false, false);
338
- var peg$e16 = peg$classExpectation([["a", "z"], ["A", "Z"], ["0", "9"]], false, false);
339
- var peg$e17 = peg$otherExpectation("number");
340
- var peg$e18 = peg$literalExpectation("-", false);
341
- var peg$e19 = peg$classExpectation([["0", "9"]], false, false);
342
- var peg$e20 = peg$otherExpectation("hex number");
343
- var peg$e21 = peg$literalExpectation("0x", false);
344
- var peg$e22 = peg$classExpectation([["0", "9"], ["a", "f"]], false, true);
345
- var peg$e23 = peg$otherExpectation("version string");
346
- var peg$e24 = peg$literalExpectation(".", false);
347
- var peg$e25 = peg$otherExpectation("string");
348
- var peg$e26 = peg$literalExpectation("\"", false);
349
- var peg$e27 = peg$classExpectation(["\""], true, false);
350
- var peg$e28 = peg$literalExpectation("'", false);
351
- var peg$e29 = peg$classExpectation(["'"], true, false);
352
- var peg$e30 = peg$otherExpectation("whitespace");
353
- var peg$e31 = peg$classExpectation([" ", "\t", "\n", "\r"], false, false);
354
- // @ts-ignore
355
- var peg$f0 = function (group) {
356
- return group;
357
- }; // @ts-ignore
358
- var peg$f1 = function (head, tails) {
359
- // @ts-ignore
360
- return { or: [head, ...tails] };
361
- }; // @ts-ignore
362
- var peg$f2 = function (tail) {
363
- return tail;
364
- }; // @ts-ignore
365
- var peg$f3 = function (head, tails) {
366
- // @ts-ignore
367
- return { and: [head, ...tails] };
368
- }; // @ts-ignore
369
- var peg$f4 = function (tail) {
370
- return tail;
371
- }; // @ts-ignore
372
- var peg$f5 = function (head, expr, tail) {
373
- // @ts-ignore
374
- return { [expr]: [head, tail] };
375
- }; // @ts-ignore
376
- var peg$f6 = function (head, expr, tail) {
377
- // @ts-ignore
378
- return { ["ver " + expr]: [head, tail] };
379
- }; // @ts-ignore
380
- var peg$f7 = function (variable) {
381
- return { var: variable[1].join("") };
382
- }; // @ts-ignore
383
- var peg$f8 = function () {
384
- return parseInt(text(), 10);
385
- }; // @ts-ignore
386
- var peg$f9 = function () {
387
- return parseInt(text(), 16);
388
- }; // @ts-ignore
389
- var peg$f10 = function (version) {
390
- return text();
391
- }; // @ts-ignore
392
- var peg$f11 = function () {
393
- return text();
394
- }; // @ts-ignore
395
- var peg$f12 = function () {
396
- return text();
397
- };
398
- // @ts-ignore
399
- var peg$currPos = 0;
400
- // @ts-ignore
401
- var peg$savedPos = 0;
402
- // @ts-ignore
403
- var peg$posDetailsCache = [{ line: 1, column: 1 }];
404
- // @ts-ignore
405
- var peg$maxFailPos = 0;
406
- // @ts-ignore
407
- var peg$maxFailExpected = [];
408
- // @ts-ignore
409
- var peg$silentFails = 0;
410
- // @ts-ignore
411
- var peg$result;
412
- // @ts-ignore
413
- if ("startRule" in options) {
414
- // @ts-ignore
415
- if (!(options.startRule in peg$startRuleFunctions)) {
416
- // @ts-ignore
417
- throw new Error("Can't start parsing from rule \""
418
- + options.startRule
419
- + "\".");
420
- }
421
- // @ts-ignore
422
- peg$startRuleFunction =
423
- peg$startRuleFunctions[options.startRule];
424
- }
425
- // @ts-ignore
426
- function text() {
427
- // @ts-ignore
428
- return input.substring(peg$savedPos, peg$currPos);
429
- }
430
- // @ts-ignore
431
- function offset() {
432
- // @ts-ignore
433
- return peg$savedPos;
434
- }
435
- // @ts-ignore
436
- function range() {
437
- // @ts-ignore
438
- return {
439
- // @ts-ignore
440
- source: peg$source,
441
- // @ts-ignore
442
- start: peg$savedPos,
443
- // @ts-ignore
444
- end: peg$currPos,
445
- };
446
- }
447
- // @ts-ignore
448
- function location() {
449
- // @ts-ignore
450
- return peg$computeLocation(peg$savedPos, peg$currPos);
451
- }
452
- // @ts-ignore
453
- function expected(description, location) {
454
- // @ts-ignore
455
- location = location !== undefined
456
- // @ts-ignore
457
- ? location
458
- // @ts-ignore
459
- : peg$computeLocation(peg$savedPos, peg$currPos);
460
- // @ts-ignore
461
- throw peg$buildStructuredError(
462
- // @ts-ignore
463
- [peg$otherExpectation(description)],
464
- // @ts-ignore
465
- input.substring(peg$savedPos, peg$currPos),
466
- // @ts-ignore
467
- location);
468
- }
469
- // @ts-ignore
470
- function error(message, location) {
471
- // @ts-ignore
472
- location = location !== undefined
473
- // @ts-ignore
474
- ? location
475
- // @ts-ignore
476
- : peg$computeLocation(peg$savedPos, peg$currPos);
477
- // @ts-ignore
478
- throw peg$buildSimpleError(message, location);
479
- }
480
- // @ts-ignore
481
- function peg$literalExpectation(text, ignoreCase) {
482
- // @ts-ignore
483
- return { type: "literal", text: text, ignoreCase: ignoreCase };
484
- }
485
- // @ts-ignore
486
- function peg$classExpectation(parts, inverted, ignoreCase) {
487
- // @ts-ignore
488
- return {
489
- type: "class",
490
- parts: parts,
491
- inverted: inverted,
492
- ignoreCase: ignoreCase,
493
- };
494
- }
495
- // @ts-ignore
496
- function peg$anyExpectation() {
497
- // @ts-ignore
498
- return { type: "any" };
499
- }
500
- // @ts-ignore
501
- function peg$endExpectation() {
502
- // @ts-ignore
503
- return { type: "end" };
504
- }
505
- // @ts-ignore
506
- function peg$otherExpectation(description) {
507
- // @ts-ignore
508
- return { type: "other", description: description };
509
- }
510
- // @ts-ignore
511
- function peg$computePosDetails(pos) {
512
- // @ts-ignore
513
- var details = peg$posDetailsCache[pos];
514
- // @ts-ignore
515
- var p;
516
- // @ts-ignore
517
- if (details) {
518
- // @ts-ignore
519
- return details;
520
- // @ts-ignore
521
- }
522
- else {
523
- // @ts-ignore
524
- p = pos - 1;
525
- // @ts-ignore
526
- while (!peg$posDetailsCache[p]) {
527
- // @ts-ignore
528
- p--;
529
- }
530
- // @ts-ignore
531
- details = peg$posDetailsCache[p];
532
- // @ts-ignore
533
- details = {
534
- // @ts-ignore
535
- line: details.line,
536
- // @ts-ignore
537
- column: details.column,
538
- };
539
- // @ts-ignore
540
- while (p < pos) {
541
- // @ts-ignore
542
- if (input.charCodeAt(p) === 10) {
543
- // @ts-ignore
544
- details.line++;
545
- // @ts-ignore
546
- details.column = 1;
547
- // @ts-ignore
548
- }
549
- else {
550
- // @ts-ignore
551
- details.column++;
552
- }
553
- // @ts-ignore
554
- p++;
555
- }
556
- // @ts-ignore
557
- peg$posDetailsCache[pos] = details;
558
- // @ts-ignore
559
- return details;
560
- }
561
- }
562
- // @ts-ignore
563
- function peg$computeLocation(startPos, endPos, offset) {
564
- // @ts-ignore
565
- var startPosDetails = peg$computePosDetails(startPos);
566
- // @ts-ignore
567
- var endPosDetails = peg$computePosDetails(endPos);
568
- // @ts-ignore
569
- var res = {
570
- // @ts-ignore
571
- source: peg$source,
572
- // @ts-ignore
573
- start: {
574
- // @ts-ignore
575
- offset: startPos,
576
- // @ts-ignore
577
- line: startPosDetails.line,
578
- // @ts-ignore
579
- column: startPosDetails.column,
580
- },
581
- // @ts-ignore
582
- end: {
583
- // @ts-ignore
584
- offset: endPos,
585
- // @ts-ignore
586
- line: endPosDetails.line,
587
- // @ts-ignore
588
- column: endPosDetails.column,
589
- },
590
- };
591
- // @ts-ignore
592
- if (offset
593
- && peg$source
594
- && (typeof peg$source.offset === "function")) {
595
- // @ts-ignore
596
- res.start = peg$source.offset(res.start);
597
- // @ts-ignore
598
- res.end = peg$source.offset(res.end);
599
- }
600
- // @ts-ignore
601
- return res;
602
- }
603
- // @ts-ignore
604
- function peg$fail(expected) {
605
- // @ts-ignore
606
- if (peg$currPos < peg$maxFailPos)
607
- return;
608
- // @ts-ignore
609
- if (peg$currPos > peg$maxFailPos) {
610
- // @ts-ignore
611
- peg$maxFailPos = peg$currPos;
612
- // @ts-ignore
613
- peg$maxFailExpected = [];
614
- }
615
- // @ts-ignore
616
- peg$maxFailExpected.push(expected);
617
- }
618
- // @ts-ignore
619
- function peg$buildSimpleError(message, location) {
620
- // @ts-ignore
621
- return new peg$SyntaxError(message, null, null, location);
622
- }
623
- // @ts-ignore
624
- function peg$buildStructuredError(expected, found, location) {
625
- // @ts-ignore
626
- return new peg$SyntaxError(
627
- // @ts-ignore
628
- peg$SyntaxError.buildMessage(expected, found),
629
- // @ts-ignore
630
- expected,
631
- // @ts-ignore
632
- found,
633
- // @ts-ignore
634
- location);
635
- }
636
- // @ts-ignore
637
- function peg$parsestart() {
638
- // @ts-ignore
639
- var s0;
640
- // @ts-ignore
641
- s0 = peg$parsegroup();
642
- // @ts-ignore
643
- if (s0 === peg$FAILED) {
644
- // @ts-ignore
645
- s0 = peg$parseor();
646
- // @ts-ignore
647
- if (s0 === peg$FAILED) {
648
- // @ts-ignore
649
- s0 = peg$parseand();
650
- // @ts-ignore
651
- if (s0 === peg$FAILED) {
652
- // @ts-ignore
653
- s0 = peg$parsecomparison();
654
- }
655
- }
656
- }
657
- // @ts-ignore
658
- return s0;
659
- }
660
- // @ts-ignore
661
- function peg$parsegroup() {
662
- // @ts-ignore
663
- var s0, s1, s2, s3, s4, s5, s6;
664
- // @ts-ignore
665
- peg$silentFails++;
666
- // @ts-ignore
667
- s0 = peg$currPos;
668
- // @ts-ignore
669
- s1 = peg$parse_();
670
- // @ts-ignore
671
- if (input.charCodeAt(peg$currPos) === 40) {
672
- // @ts-ignore
673
- s2 = peg$c0;
674
- // @ts-ignore
675
- peg$currPos++;
676
- // @ts-ignore
677
- }
678
- else {
679
- // @ts-ignore
680
- s2 = peg$FAILED;
681
- // @ts-ignore
682
- if (peg$silentFails === 0)
683
- peg$fail(peg$e1);
684
- }
685
- // @ts-ignore
686
- if (s2 !== peg$FAILED) {
687
- // @ts-ignore
688
- s3 = peg$parse_();
689
- // @ts-ignore
690
- s4 = peg$parseor();
691
- // @ts-ignore
692
- if (s4 !== peg$FAILED) {
693
- // @ts-ignore
694
- s5 = peg$parse_();
695
- // @ts-ignore
696
- if (input.charCodeAt(peg$currPos) === 41) {
697
- // @ts-ignore
698
- s6 = peg$c1;
699
- // @ts-ignore
700
- peg$currPos++;
701
- // @ts-ignore
702
- }
703
- else {
704
- // @ts-ignore
705
- s6 = peg$FAILED;
706
- // @ts-ignore
707
- if (peg$silentFails === 0)
708
- peg$fail(peg$e2);
709
- }
710
- // @ts-ignore
711
- if (s6 !== peg$FAILED) {
712
- // @ts-ignore
713
- peg$savedPos = s0;
714
- // @ts-ignore
715
- s0 = peg$f0(s4);
716
- // @ts-ignore
717
- }
718
- else {
719
- // @ts-ignore
720
- peg$currPos = s0;
721
- // @ts-ignore
722
- s0 = peg$FAILED;
723
- }
724
- // @ts-ignore
725
- }
726
- else {
727
- // @ts-ignore
728
- peg$currPos = s0;
729
- // @ts-ignore
730
- s0 = peg$FAILED;
731
- }
732
- // @ts-ignore
733
- }
734
- else {
735
- // @ts-ignore
736
- peg$currPos = s0;
737
- // @ts-ignore
738
- s0 = peg$FAILED;
739
- }
740
- // @ts-ignore
741
- peg$silentFails--;
742
- // @ts-ignore
743
- if (s0 === peg$FAILED) {
744
- // @ts-ignore
745
- s1 = peg$FAILED;
746
- // @ts-ignore
747
- if (peg$silentFails === 0)
748
- peg$fail(peg$e0);
749
- }
750
- // @ts-ignore
751
- return s0;
752
- }
753
- // @ts-ignore
754
- function peg$parseor() {
755
- // @ts-ignore
756
- var s0, s1, s2, s3, s4;
757
- // @ts-ignore
758
- peg$silentFails++;
759
- // @ts-ignore
760
- s0 = peg$currPos;
761
- // @ts-ignore
762
- s1 = peg$parse_();
763
- // @ts-ignore
764
- s2 = peg$parseand();
765
- // @ts-ignore
766
- if (s2 === peg$FAILED) {
767
- // @ts-ignore
768
- s2 = peg$parsecomparison();
769
- }
770
- // @ts-ignore
771
- if (s2 !== peg$FAILED) {
772
- // @ts-ignore
773
- s3 = [];
774
- // @ts-ignore
775
- s4 = peg$parseor_tails();
776
- // @ts-ignore
777
- if (s4 !== peg$FAILED) {
778
- // @ts-ignore
779
- while (s4 !== peg$FAILED) {
780
- // @ts-ignore
781
- s3.push(s4);
782
- // @ts-ignore
783
- s4 = peg$parseor_tails();
784
- }
785
- // @ts-ignore
786
- }
787
- else {
788
- // @ts-ignore
789
- s3 = peg$FAILED;
790
- }
791
- // @ts-ignore
792
- if (s3 !== peg$FAILED) {
793
- // @ts-ignore
794
- peg$savedPos = s0;
795
- // @ts-ignore
796
- s0 = peg$f1(s2, s3);
797
- // @ts-ignore
798
- }
799
- else {
800
- // @ts-ignore
801
- peg$currPos = s0;
802
- // @ts-ignore
803
- s0 = peg$FAILED;
804
- }
805
- // @ts-ignore
806
- }
807
- else {
808
- // @ts-ignore
809
- peg$currPos = s0;
810
- // @ts-ignore
811
- s0 = peg$FAILED;
812
- }
813
- // @ts-ignore
814
- peg$silentFails--;
815
- // @ts-ignore
816
- if (s0 === peg$FAILED) {
817
- // @ts-ignore
818
- s1 = peg$FAILED;
819
- // @ts-ignore
820
- if (peg$silentFails === 0)
821
- peg$fail(peg$e3);
822
- }
823
- // @ts-ignore
824
- return s0;
825
- }
826
- // @ts-ignore
827
- function peg$parseor_tails() {
828
- // @ts-ignore
829
- var s0, s1, s2, s3, s4;
830
- // @ts-ignore
831
- s0 = peg$currPos;
832
- // @ts-ignore
833
- s1 = peg$parse_();
834
- // @ts-ignore
835
- if (input.substr(peg$currPos, 2) === peg$c2) {
836
- // @ts-ignore
837
- s2 = peg$c2;
838
- // @ts-ignore
839
- peg$currPos += 2;
840
- // @ts-ignore
841
- }
842
- else {
843
- // @ts-ignore
844
- s2 = peg$FAILED;
845
- // @ts-ignore
846
- if (peg$silentFails === 0)
847
- peg$fail(peg$e4);
848
- }
849
- // @ts-ignore
850
- if (s2 !== peg$FAILED) {
851
- // @ts-ignore
852
- s3 = peg$parse_();
853
- // @ts-ignore
854
- s4 = peg$parseand();
855
- // @ts-ignore
856
- if (s4 === peg$FAILED) {
857
- // @ts-ignore
858
- s4 = peg$parsecomparison();
859
- }
860
- // @ts-ignore
861
- if (s4 !== peg$FAILED) {
862
- // @ts-ignore
863
- peg$savedPos = s0;
864
- // @ts-ignore
865
- s0 = peg$f2(s4);
866
- // @ts-ignore
867
- }
868
- else {
869
- // @ts-ignore
870
- peg$currPos = s0;
871
- // @ts-ignore
872
- s0 = peg$FAILED;
873
- }
874
- // @ts-ignore
875
- }
876
- else {
877
- // @ts-ignore
878
- peg$currPos = s0;
879
- // @ts-ignore
880
- s0 = peg$FAILED;
881
- }
882
- // @ts-ignore
883
- return s0;
884
- }
885
- // @ts-ignore
886
- function peg$parseand() {
887
- // @ts-ignore
888
- var s0, s1, s2, s3, s4;
889
- // @ts-ignore
890
- peg$silentFails++;
891
- // @ts-ignore
892
- s0 = peg$currPos;
893
- // @ts-ignore
894
- s1 = peg$parse_();
895
- // @ts-ignore
896
- s2 = peg$parsegroup();
897
- // @ts-ignore
898
- if (s2 === peg$FAILED) {
899
- // @ts-ignore
900
- s2 = peg$parsecomparison();
901
- }
902
- // @ts-ignore
903
- if (s2 !== peg$FAILED) {
904
- // @ts-ignore
905
- s3 = [];
906
- // @ts-ignore
907
- s4 = peg$parseand_tails();
908
- // @ts-ignore
909
- if (s4 !== peg$FAILED) {
910
- // @ts-ignore
911
- while (s4 !== peg$FAILED) {
912
- // @ts-ignore
913
- s3.push(s4);
914
- // @ts-ignore
915
- s4 = peg$parseand_tails();
916
- }
917
- // @ts-ignore
918
- }
919
- else {
920
- // @ts-ignore
921
- s3 = peg$FAILED;
922
- }
923
- // @ts-ignore
924
- if (s3 !== peg$FAILED) {
925
- // @ts-ignore
926
- peg$savedPos = s0;
927
- // @ts-ignore
928
- s0 = peg$f3(s2, s3);
929
- // @ts-ignore
930
- }
931
- else {
932
- // @ts-ignore
933
- peg$currPos = s0;
934
- // @ts-ignore
935
- s0 = peg$FAILED;
936
- }
937
- // @ts-ignore
938
- }
939
- else {
940
- // @ts-ignore
941
- peg$currPos = s0;
942
- // @ts-ignore
943
- s0 = peg$FAILED;
944
- }
945
- // @ts-ignore
946
- peg$silentFails--;
947
- // @ts-ignore
948
- if (s0 === peg$FAILED) {
949
- // @ts-ignore
950
- s1 = peg$FAILED;
951
- // @ts-ignore
952
- if (peg$silentFails === 0)
953
- peg$fail(peg$e5);
954
- }
955
- // @ts-ignore
956
- return s0;
957
- }
958
- // @ts-ignore
959
- function peg$parseand_tails() {
960
- // @ts-ignore
961
- var s0, s1, s2, s3, s4;
962
- // @ts-ignore
963
- s0 = peg$currPos;
964
- // @ts-ignore
965
- s1 = peg$parse_();
966
- // @ts-ignore
967
- if (input.substr(peg$currPos, 2) === peg$c3) {
968
- // @ts-ignore
969
- s2 = peg$c3;
970
- // @ts-ignore
971
- peg$currPos += 2;
972
- // @ts-ignore
973
- }
974
- else {
975
- // @ts-ignore
976
- s2 = peg$FAILED;
977
- // @ts-ignore
978
- if (peg$silentFails === 0)
979
- peg$fail(peg$e6);
980
- }
981
- // @ts-ignore
982
- if (s2 !== peg$FAILED) {
983
- // @ts-ignore
984
- s3 = peg$parse_();
985
- // @ts-ignore
986
- s4 = peg$parsegroup();
987
- // @ts-ignore
988
- if (s4 === peg$FAILED) {
989
- // @ts-ignore
990
- s4 = peg$parsecomparison();
991
- }
992
- // @ts-ignore
993
- if (s4 !== peg$FAILED) {
994
- // @ts-ignore
995
- peg$savedPos = s0;
996
- // @ts-ignore
997
- s0 = peg$f4(s4);
998
- // @ts-ignore
999
- }
1000
- else {
1001
- // @ts-ignore
1002
- peg$currPos = s0;
1003
- // @ts-ignore
1004
- s0 = peg$FAILED;
1005
- }
1006
- // @ts-ignore
1007
- }
1008
- else {
1009
- // @ts-ignore
1010
- peg$currPos = s0;
1011
- // @ts-ignore
1012
- s0 = peg$FAILED;
1013
- }
1014
- // @ts-ignore
1015
- return s0;
1016
- }
1017
- // @ts-ignore
1018
- function peg$parsecomparison() {
1019
- // @ts-ignore
1020
- var s0;
1021
- // @ts-ignore
1022
- s0 = peg$parsever_comparison();
1023
- // @ts-ignore
1024
- if (s0 === peg$FAILED) {
1025
- // @ts-ignore
1026
- s0 = peg$parseint_comparison();
1027
- }
1028
- // @ts-ignore
1029
- return s0;
1030
- }
1031
- // @ts-ignore
1032
- function peg$parseint_comparison() {
1033
- // @ts-ignore
1034
- var s0, s1, s2, s3, s4, s5, s6, s7;
1035
- // @ts-ignore
1036
- peg$silentFails++;
1037
- // @ts-ignore
1038
- s0 = peg$currPos;
1039
- // @ts-ignore
1040
- s1 = peg$parse_();
1041
- // @ts-ignore
1042
- s2 = peg$parseterm();
1043
- // @ts-ignore
1044
- if (s2 !== peg$FAILED) {
1045
- // @ts-ignore
1046
- s3 = peg$parse_();
1047
- // @ts-ignore
1048
- if (input.substr(peg$currPos, 2) === peg$c4) {
1049
- // @ts-ignore
1050
- s4 = peg$c4;
1051
- // @ts-ignore
1052
- peg$currPos += 2;
1053
- // @ts-ignore
1054
- }
1055
- else {
1056
- // @ts-ignore
1057
- s4 = peg$FAILED;
1058
- // @ts-ignore
1059
- if (peg$silentFails === 0)
1060
- peg$fail(peg$e8);
1061
- }
1062
- // @ts-ignore
1063
- if (s4 === peg$FAILED) {
1064
- // @ts-ignore
1065
- if (input.charCodeAt(peg$currPos) === 62) {
1066
- // @ts-ignore
1067
- s4 = peg$c5;
1068
- // @ts-ignore
1069
- peg$currPos++;
1070
- // @ts-ignore
1071
- }
1072
- else {
1073
- // @ts-ignore
1074
- s4 = peg$FAILED;
1075
- // @ts-ignore
1076
- if (peg$silentFails === 0)
1077
- peg$fail(peg$e9);
1078
- }
1079
- // @ts-ignore
1080
- if (s4 === peg$FAILED) {
1081
- // @ts-ignore
1082
- if (input.substr(peg$currPos, 2) === peg$c6) {
1083
- // @ts-ignore
1084
- s4 = peg$c6;
1085
- // @ts-ignore
1086
- peg$currPos += 2;
1087
- // @ts-ignore
1088
- }
1089
- else {
1090
- // @ts-ignore
1091
- s4 = peg$FAILED;
1092
- // @ts-ignore
1093
- if (peg$silentFails === 0)
1094
- peg$fail(peg$e10);
1095
- }
1096
- // @ts-ignore
1097
- if (s4 === peg$FAILED) {
1098
- // @ts-ignore
1099
- if (input.charCodeAt(peg$currPos) === 60) {
1100
- // @ts-ignore
1101
- s4 = peg$c7;
1102
- // @ts-ignore
1103
- peg$currPos++;
1104
- // @ts-ignore
1105
- }
1106
- else {
1107
- // @ts-ignore
1108
- s4 = peg$FAILED;
1109
- // @ts-ignore
1110
- if (peg$silentFails === 0) {
1111
- peg$fail(peg$e11);
1112
- }
1113
- }
1114
- // @ts-ignore
1115
- if (s4 === peg$FAILED) {
1116
- // @ts-ignore
1117
- if (input.substr(peg$currPos, 3) === peg$c8) {
1118
- // @ts-ignore
1119
- s4 = peg$c8;
1120
- // @ts-ignore
1121
- peg$currPos += 3;
1122
- // @ts-ignore
1123
- }
1124
- else {
1125
- // @ts-ignore
1126
- s4 = peg$FAILED;
1127
- // @ts-ignore
1128
- if (peg$silentFails === 0) {
1129
- peg$fail(peg$e12);
1130
- }
1131
- }
1132
- }
1133
- }
1134
- }
1135
- }
1136
- // @ts-ignore
1137
- if (s4 !== peg$FAILED) {
1138
- // @ts-ignore
1139
- s5 = peg$parse_();
1140
- // @ts-ignore
1141
- s6 = peg$parseterm();
1142
- // @ts-ignore
1143
- if (s6 !== peg$FAILED) {
1144
- // @ts-ignore
1145
- s7 = peg$parse_();
1146
- // @ts-ignore
1147
- peg$savedPos = s0;
1148
- // @ts-ignore
1149
- s0 = peg$f5(s2, s4, s6);
1150
- // @ts-ignore
1151
- }
1152
- else {
1153
- // @ts-ignore
1154
- peg$currPos = s0;
1155
- // @ts-ignore
1156
- s0 = peg$FAILED;
1157
- }
1158
- // @ts-ignore
1159
- }
1160
- else {
1161
- // @ts-ignore
1162
- peg$currPos = s0;
1163
- // @ts-ignore
1164
- s0 = peg$FAILED;
1165
- }
1166
- // @ts-ignore
1167
- }
1168
- else {
1169
- // @ts-ignore
1170
- peg$currPos = s0;
1171
- // @ts-ignore
1172
- s0 = peg$FAILED;
1173
- }
1174
- // @ts-ignore
1175
- peg$silentFails--;
1176
- // @ts-ignore
1177
- if (s0 === peg$FAILED) {
1178
- // @ts-ignore
1179
- s1 = peg$FAILED;
1180
- // @ts-ignore
1181
- if (peg$silentFails === 0)
1182
- peg$fail(peg$e7);
1183
- }
1184
- // @ts-ignore
1185
- return s0;
1186
- }
1187
- // @ts-ignore
1188
- function peg$parsever_comparison() {
1189
- // @ts-ignore
1190
- var s0, s1, s2, s3, s4, s5, s6, s7;
1191
- // @ts-ignore
1192
- peg$silentFails++;
1193
- // @ts-ignore
1194
- s0 = peg$currPos;
1195
- // @ts-ignore
1196
- s1 = peg$parse_();
1197
- // @ts-ignore
1198
- s2 = peg$parseterm();
1199
- // @ts-ignore
1200
- if (s2 !== peg$FAILED) {
1201
- // @ts-ignore
1202
- s3 = peg$parse_();
1203
- // @ts-ignore
1204
- if (input.substr(peg$currPos, 2) === peg$c4) {
1205
- // @ts-ignore
1206
- s4 = peg$c4;
1207
- // @ts-ignore
1208
- peg$currPos += 2;
1209
- // @ts-ignore
1210
- }
1211
- else {
1212
- // @ts-ignore
1213
- s4 = peg$FAILED;
1214
- // @ts-ignore
1215
- if (peg$silentFails === 0)
1216
- peg$fail(peg$e8);
1217
- }
1218
- // @ts-ignore
1219
- if (s4 === peg$FAILED) {
1220
- // @ts-ignore
1221
- if (input.charCodeAt(peg$currPos) === 62) {
1222
- // @ts-ignore
1223
- s4 = peg$c5;
1224
- // @ts-ignore
1225
- peg$currPos++;
1226
- // @ts-ignore
1227
- }
1228
- else {
1229
- // @ts-ignore
1230
- s4 = peg$FAILED;
1231
- // @ts-ignore
1232
- if (peg$silentFails === 0)
1233
- peg$fail(peg$e9);
1234
- }
1235
- // @ts-ignore
1236
- if (s4 === peg$FAILED) {
1237
- // @ts-ignore
1238
- if (input.substr(peg$currPos, 2) === peg$c6) {
1239
- // @ts-ignore
1240
- s4 = peg$c6;
1241
- // @ts-ignore
1242
- peg$currPos += 2;
1243
- // @ts-ignore
1244
- }
1245
- else {
1246
- // @ts-ignore
1247
- s4 = peg$FAILED;
1248
- // @ts-ignore
1249
- if (peg$silentFails === 0)
1250
- peg$fail(peg$e10);
1251
- }
1252
- // @ts-ignore
1253
- if (s4 === peg$FAILED) {
1254
- // @ts-ignore
1255
- if (input.charCodeAt(peg$currPos) === 60) {
1256
- // @ts-ignore
1257
- s4 = peg$c7;
1258
- // @ts-ignore
1259
- peg$currPos++;
1260
- // @ts-ignore
1261
- }
1262
- else {
1263
- // @ts-ignore
1264
- s4 = peg$FAILED;
1265
- // @ts-ignore
1266
- if (peg$silentFails === 0) {
1267
- peg$fail(peg$e11);
1268
- }
1269
- }
1270
- // @ts-ignore
1271
- if (s4 === peg$FAILED) {
1272
- // @ts-ignore
1273
- if (input.substr(peg$currPos, 3) === peg$c8) {
1274
- // @ts-ignore
1275
- s4 = peg$c8;
1276
- // @ts-ignore
1277
- peg$currPos += 3;
1278
- // @ts-ignore
1279
- }
1280
- else {
1281
- // @ts-ignore
1282
- s4 = peg$FAILED;
1283
- // @ts-ignore
1284
- if (peg$silentFails === 0) {
1285
- peg$fail(peg$e12);
1286
- }
1287
- }
1288
- }
1289
- }
1290
- }
1291
- }
1292
- // @ts-ignore
1293
- if (s4 !== peg$FAILED) {
1294
- // @ts-ignore
1295
- s5 = peg$parse_();
1296
- // @ts-ignore
1297
- s6 = peg$parseversion();
1298
- // @ts-ignore
1299
- if (s6 !== peg$FAILED) {
1300
- // @ts-ignore
1301
- s7 = peg$parse_();
1302
- // @ts-ignore
1303
- peg$savedPos = s0;
1304
- // @ts-ignore
1305
- s0 = peg$f6(s2, s4, s6);
1306
- // @ts-ignore
1307
- }
1308
- else {
1309
- // @ts-ignore
1310
- peg$currPos = s0;
1311
- // @ts-ignore
1312
- s0 = peg$FAILED;
1313
- }
1314
- // @ts-ignore
1315
- }
1316
- else {
1317
- // @ts-ignore
1318
- peg$currPos = s0;
1319
- // @ts-ignore
1320
- s0 = peg$FAILED;
1321
- }
1322
- // @ts-ignore
1323
- }
1324
- else {
1325
- // @ts-ignore
1326
- peg$currPos = s0;
1327
- // @ts-ignore
1328
- s0 = peg$FAILED;
1329
- }
1330
- // @ts-ignore
1331
- peg$silentFails--;
1332
- // @ts-ignore
1333
- if (s0 === peg$FAILED) {
1334
- // @ts-ignore
1335
- s1 = peg$FAILED;
1336
- // @ts-ignore
1337
- if (peg$silentFails === 0)
1338
- peg$fail(peg$e13);
1339
- }
1340
- // @ts-ignore
1341
- return s0;
1342
- }
1343
- // @ts-ignore
1344
- function peg$parseterm() {
1345
- // @ts-ignore
1346
- var s0;
1347
- // @ts-ignore
1348
- s0 = peg$parseconst();
1349
- // @ts-ignore
1350
- if (s0 === peg$FAILED) {
1351
- // @ts-ignore
1352
- s0 = peg$parsestring();
1353
- // @ts-ignore
1354
- if (s0 === peg$FAILED) {
1355
- // @ts-ignore
1356
- s0 = peg$parsehex();
1357
- // @ts-ignore
1358
- if (s0 === peg$FAILED) {
1359
- // @ts-ignore
1360
- s0 = peg$parseinteger();
1361
- }
1362
- }
1363
- }
1364
- // @ts-ignore
1365
- return s0;
1366
- }
1367
- // @ts-ignore
1368
- function peg$parseconst() {
1369
- // @ts-ignore
1370
- var s0, s1, s2, s3, s4, s5;
1371
- // @ts-ignore
1372
- peg$silentFails++;
1373
- // @ts-ignore
1374
- s0 = peg$currPos;
1375
- // @ts-ignore
1376
- s1 = peg$parse_();
1377
- // @ts-ignore
1378
- s2 = peg$currPos;
1379
- // @ts-ignore
1380
- s3 = peg$currPos;
1381
- // @ts-ignore
1382
- peg$silentFails++;
1383
- // @ts-ignore
1384
- if (peg$r0.test(input.charAt(peg$currPos))) {
1385
- // @ts-ignore
1386
- s4 = input.charAt(peg$currPos);
1387
- // @ts-ignore
1388
- peg$currPos++;
1389
- // @ts-ignore
1390
- }
1391
- else {
1392
- // @ts-ignore
1393
- s4 = peg$FAILED;
1394
- // @ts-ignore
1395
- if (peg$silentFails === 0)
1396
- peg$fail(peg$e15);
1397
- }
1398
- // @ts-ignore
1399
- peg$silentFails--;
1400
- // @ts-ignore
1401
- if (s4 !== peg$FAILED) {
1402
- // @ts-ignore
1403
- peg$currPos = s3;
1404
- // @ts-ignore
1405
- s3 = undefined;
1406
- // @ts-ignore
1407
- }
1408
- else {
1409
- // @ts-ignore
1410
- s3 = peg$FAILED;
1411
- }
1412
- // @ts-ignore
1413
- if (s3 !== peg$FAILED) {
1414
- // @ts-ignore
1415
- s4 = [];
1416
- // @ts-ignore
1417
- if (peg$r1.test(input.charAt(peg$currPos))) {
1418
- // @ts-ignore
1419
- s5 = input.charAt(peg$currPos);
1420
- // @ts-ignore
1421
- peg$currPos++;
1422
- // @ts-ignore
1423
- }
1424
- else {
1425
- // @ts-ignore
1426
- s5 = peg$FAILED;
1427
- // @ts-ignore
1428
- if (peg$silentFails === 0)
1429
- peg$fail(peg$e16);
1430
- }
1431
- // @ts-ignore
1432
- if (s5 !== peg$FAILED) {
1433
- // @ts-ignore
1434
- while (s5 !== peg$FAILED) {
1435
- // @ts-ignore
1436
- s4.push(s5);
1437
- // @ts-ignore
1438
- if (peg$r1.test(input.charAt(peg$currPos))) {
1439
- // @ts-ignore
1440
- s5 = input.charAt(peg$currPos);
1441
- // @ts-ignore
1442
- peg$currPos++;
1443
- // @ts-ignore
1444
- }
1445
- else {
1446
- // @ts-ignore
1447
- s5 = peg$FAILED;
1448
- // @ts-ignore
1449
- if (peg$silentFails === 0)
1450
- peg$fail(peg$e16);
1451
- }
1452
- }
1453
- // @ts-ignore
1454
- }
1455
- else {
1456
- // @ts-ignore
1457
- s4 = peg$FAILED;
1458
- }
1459
- // @ts-ignore
1460
- if (s4 !== peg$FAILED) {
1461
- // @ts-ignore
1462
- s3 = [s3, s4];
1463
- // @ts-ignore
1464
- s2 = s3;
1465
- // @ts-ignore
1466
- }
1467
- else {
1468
- // @ts-ignore
1469
- peg$currPos = s2;
1470
- // @ts-ignore
1471
- s2 = peg$FAILED;
1472
- }
1473
- // @ts-ignore
1474
- }
1475
- else {
1476
- // @ts-ignore
1477
- peg$currPos = s2;
1478
- // @ts-ignore
1479
- s2 = peg$FAILED;
1480
- }
1481
- // @ts-ignore
1482
- if (s2 !== peg$FAILED) {
1483
- // @ts-ignore
1484
- peg$savedPos = s0;
1485
- // @ts-ignore
1486
- s0 = peg$f7(s2);
1487
- // @ts-ignore
1488
- }
1489
- else {
1490
- // @ts-ignore
1491
- peg$currPos = s0;
1492
- // @ts-ignore
1493
- s0 = peg$FAILED;
1494
- }
1495
- // @ts-ignore
1496
- peg$silentFails--;
1497
- // @ts-ignore
1498
- if (s0 === peg$FAILED) {
1499
- // @ts-ignore
1500
- s1 = peg$FAILED;
1501
- // @ts-ignore
1502
- if (peg$silentFails === 0)
1503
- peg$fail(peg$e14);
1504
- }
1505
- // @ts-ignore
1506
- return s0;
1507
- }
1508
- // @ts-ignore
1509
- function peg$parseinteger() {
1510
- // @ts-ignore
1511
- var s0, s1, s2, s3, s4, s5;
1512
- // @ts-ignore
1513
- peg$silentFails++;
1514
- // @ts-ignore
1515
- s0 = peg$currPos;
1516
- // @ts-ignore
1517
- s1 = peg$parse_();
1518
- // @ts-ignore
1519
- s2 = peg$currPos;
1520
- // @ts-ignore
1521
- if (input.charCodeAt(peg$currPos) === 45) {
1522
- // @ts-ignore
1523
- s3 = peg$c9;
1524
- // @ts-ignore
1525
- peg$currPos++;
1526
- // @ts-ignore
1527
- }
1528
- else {
1529
- // @ts-ignore
1530
- s3 = peg$FAILED;
1531
- // @ts-ignore
1532
- if (peg$silentFails === 0)
1533
- peg$fail(peg$e18);
1534
- }
1535
- // @ts-ignore
1536
- if (s3 === peg$FAILED) {
1537
- // @ts-ignore
1538
- s3 = null;
1539
- }
1540
- // @ts-ignore
1541
- s4 = [];
1542
- // @ts-ignore
1543
- if (peg$r2.test(input.charAt(peg$currPos))) {
1544
- // @ts-ignore
1545
- s5 = input.charAt(peg$currPos);
1546
- // @ts-ignore
1547
- peg$currPos++;
1548
- // @ts-ignore
1549
- }
1550
- else {
1551
- // @ts-ignore
1552
- s5 = peg$FAILED;
1553
- // @ts-ignore
1554
- if (peg$silentFails === 0)
1555
- peg$fail(peg$e19);
1556
- }
1557
- // @ts-ignore
1558
- if (s5 !== peg$FAILED) {
1559
- // @ts-ignore
1560
- while (s5 !== peg$FAILED) {
1561
- // @ts-ignore
1562
- s4.push(s5);
1563
- // @ts-ignore
1564
- if (peg$r2.test(input.charAt(peg$currPos))) {
1565
- // @ts-ignore
1566
- s5 = input.charAt(peg$currPos);
1567
- // @ts-ignore
1568
- peg$currPos++;
1569
- // @ts-ignore
1
+ // A parser to convert logical JavaScript-like expressions into JSON Logic
2
+ import { getEnumMemberName } from "@zwave-js/shared";
3
+ import { assertNever } from "alcalzone-shared/helpers";
4
+ export var SyntaxKind;
5
+ (function (SyntaxKind) {
6
+ SyntaxKind[SyntaxKind["Group"] = 0] = "Group";
7
+ SyntaxKind[SyntaxKind["Or"] = 1] = "Or";
8
+ SyntaxKind[SyntaxKind["And"] = 2] = "And";
9
+ SyntaxKind[SyntaxKind["Comparison"] = 3] = "Comparison";
10
+ SyntaxKind[SyntaxKind["Identifier"] = 4] = "Identifier";
11
+ SyntaxKind[SyntaxKind["NumberLiteral"] = 5] = "NumberLiteral";
12
+ SyntaxKind[SyntaxKind["Version"] = 6] = "Version";
13
+ })(SyntaxKind || (SyntaxKind = {}));
14
+ export var Operator;
15
+ (function (Operator) {
16
+ Operator[Operator["Equal"] = 0] = "Equal";
17
+ Operator[Operator["NotEqual"] = 1] = "NotEqual";
18
+ Operator[Operator["LessThan"] = 2] = "LessThan";
19
+ Operator[Operator["LessThanOrEqual"] = 3] = "LessThanOrEqual";
20
+ Operator[Operator["GreaterThan"] = 4] = "GreaterThan";
21
+ Operator[Operator["GreaterThanOrEqual"] = 5] = "GreaterThanOrEqual";
22
+ })(Operator || (Operator = {}));
23
+ export var TokenKind;
24
+ (function (TokenKind) {
25
+ TokenKind[TokenKind["Identifier"] = 0] = "Identifier";
26
+ TokenKind[TokenKind["NumberLiteral"] = 1] = "NumberLiteral";
27
+ TokenKind[TokenKind["Dot"] = 2] = "Dot";
28
+ TokenKind[TokenKind["LeftParen"] = 3] = "LeftParen";
29
+ TokenKind[TokenKind["RightParen"] = 4] = "RightParen";
30
+ TokenKind[TokenKind["BarBar"] = 5] = "BarBar";
31
+ TokenKind[TokenKind["AmpAmp"] = 6] = "AmpAmp";
32
+ TokenKind[TokenKind["EqualsEquals"] = 7] = "EqualsEquals";
33
+ TokenKind[TokenKind["EqualsEqualsEquals"] = 8] = "EqualsEqualsEquals";
34
+ TokenKind[TokenKind["ExclamationEquals"] = 9] = "ExclamationEquals";
35
+ TokenKind[TokenKind["ExclamationEqualsEquals"] = 10] = "ExclamationEqualsEquals";
36
+ TokenKind[TokenKind["LessThan"] = 11] = "LessThan";
37
+ TokenKind[TokenKind["LessThanEquals"] = 12] = "LessThanEquals";
38
+ TokenKind[TokenKind["GreaterThan"] = 13] = "GreaterThan";
39
+ TokenKind[TokenKind["GreaterThanEquals"] = 14] = "GreaterThanEquals";
40
+ })(TokenKind || (TokenKind = {}));
41
+ /**
42
+ * Splits a string into tokens to be consumed by the Parser.
43
+ */
44
+ export function* tokenize(input) {
45
+ for (let i = 0; i < input.length; i++) {
46
+ switch (input[i]) {
47
+ case ".": {
48
+ yield { kind: TokenKind.Dot, start: i };
49
+ break;
50
+ }
51
+ case "(": {
52
+ yield { kind: TokenKind.LeftParen, start: i };
53
+ break;
54
+ }
55
+ case ")": {
56
+ yield { kind: TokenKind.RightParen, start: i };
57
+ break;
58
+ }
59
+ case "|": {
60
+ if (input[i + 1] === "|") {
61
+ yield { kind: TokenKind.BarBar, start: i };
62
+ i++;
63
+ }
64
+ break;
65
+ }
66
+ case "&": {
67
+ if (input[i + 1] === "&") {
68
+ yield { kind: TokenKind.AmpAmp, start: i };
69
+ i++;
70
+ }
71
+ break;
72
+ }
73
+ case "=": {
74
+ if (input[i + 1] === "=") {
75
+ if (input[i + 2] === "=") {
76
+ yield { kind: TokenKind.EqualsEqualsEquals, start: i };
77
+ i += 2;
1570
78
  }
1571
79
  else {
1572
- // @ts-ignore
1573
- s5 = peg$FAILED;
1574
- // @ts-ignore
1575
- if (peg$silentFails === 0)
1576
- peg$fail(peg$e19);
1577
- }
1578
- }
1579
- // @ts-ignore
1580
- }
1581
- else {
1582
- // @ts-ignore
1583
- s4 = peg$FAILED;
1584
- }
1585
- // @ts-ignore
1586
- if (s4 !== peg$FAILED) {
1587
- // @ts-ignore
1588
- s3 = [s3, s4];
1589
- // @ts-ignore
1590
- s2 = s3;
1591
- // @ts-ignore
1592
- }
1593
- else {
1594
- // @ts-ignore
1595
- peg$currPos = s2;
1596
- // @ts-ignore
1597
- s2 = peg$FAILED;
1598
- }
1599
- // @ts-ignore
1600
- if (s2 !== peg$FAILED) {
1601
- // @ts-ignore
1602
- peg$savedPos = s0;
1603
- // @ts-ignore
1604
- s0 = peg$f8();
1605
- // @ts-ignore
1606
- }
1607
- else {
1608
- // @ts-ignore
1609
- peg$currPos = s0;
1610
- // @ts-ignore
1611
- s0 = peg$FAILED;
1612
- }
1613
- // @ts-ignore
1614
- peg$silentFails--;
1615
- // @ts-ignore
1616
- if (s0 === peg$FAILED) {
1617
- // @ts-ignore
1618
- s1 = peg$FAILED;
1619
- // @ts-ignore
1620
- if (peg$silentFails === 0)
1621
- peg$fail(peg$e17);
1622
- }
1623
- // @ts-ignore
1624
- return s0;
1625
- }
1626
- // @ts-ignore
1627
- function peg$parsehex() {
1628
- // @ts-ignore
1629
- var s0, s1, s2, s3, s4, s5;
1630
- // @ts-ignore
1631
- peg$silentFails++;
1632
- // @ts-ignore
1633
- s0 = peg$currPos;
1634
- // @ts-ignore
1635
- s1 = peg$parse_();
1636
- // @ts-ignore
1637
- s2 = peg$currPos;
1638
- // @ts-ignore
1639
- if (input.substr(peg$currPos, 2) === peg$c10) {
1640
- // @ts-ignore
1641
- s3 = peg$c10;
1642
- // @ts-ignore
1643
- peg$currPos += 2;
1644
- // @ts-ignore
1645
- }
1646
- else {
1647
- // @ts-ignore
1648
- s3 = peg$FAILED;
1649
- // @ts-ignore
1650
- if (peg$silentFails === 0)
1651
- peg$fail(peg$e21);
1652
- }
1653
- // @ts-ignore
1654
- if (s3 !== peg$FAILED) {
1655
- // @ts-ignore
1656
- s4 = [];
1657
- // @ts-ignore
1658
- if (peg$r3.test(input.charAt(peg$currPos))) {
1659
- // @ts-ignore
1660
- s5 = input.charAt(peg$currPos);
1661
- // @ts-ignore
1662
- peg$currPos++;
1663
- // @ts-ignore
1664
- }
1665
- else {
1666
- // @ts-ignore
1667
- s5 = peg$FAILED;
1668
- // @ts-ignore
1669
- if (peg$silentFails === 0)
1670
- peg$fail(peg$e22);
1671
- }
1672
- // @ts-ignore
1673
- if (s5 !== peg$FAILED) {
1674
- // @ts-ignore
1675
- while (s5 !== peg$FAILED) {
1676
- // @ts-ignore
1677
- s4.push(s5);
1678
- // @ts-ignore
1679
- if (peg$r3.test(input.charAt(peg$currPos))) {
1680
- // @ts-ignore
1681
- s5 = input.charAt(peg$currPos);
1682
- // @ts-ignore
1683
- peg$currPos++;
1684
- // @ts-ignore
1685
- }
1686
- else {
1687
- // @ts-ignore
1688
- s5 = peg$FAILED;
1689
- // @ts-ignore
1690
- if (peg$silentFails === 0)
1691
- peg$fail(peg$e22);
1692
- }
80
+ yield { kind: TokenKind.EqualsEquals, start: i };
81
+ i++;
1693
82
  }
1694
- // @ts-ignore
1695
83
  }
1696
- else {
1697
- // @ts-ignore
1698
- s4 = peg$FAILED;
1699
- }
1700
- // @ts-ignore
1701
- if (s4 !== peg$FAILED) {
1702
- // @ts-ignore
1703
- s3 = [s3, s4];
1704
- // @ts-ignore
1705
- s2 = s3;
1706
- // @ts-ignore
1707
- }
1708
- else {
1709
- // @ts-ignore
1710
- peg$currPos = s2;
1711
- // @ts-ignore
1712
- s2 = peg$FAILED;
1713
- }
1714
- // @ts-ignore
1715
- }
1716
- else {
1717
- // @ts-ignore
1718
- peg$currPos = s2;
1719
- // @ts-ignore
1720
- s2 = peg$FAILED;
1721
- }
1722
- // @ts-ignore
1723
- if (s2 !== peg$FAILED) {
1724
- // @ts-ignore
1725
- peg$savedPos = s0;
1726
- // @ts-ignore
1727
- s0 = peg$f9();
1728
- // @ts-ignore
1729
- }
1730
- else {
1731
- // @ts-ignore
1732
- peg$currPos = s0;
1733
- // @ts-ignore
1734
- s0 = peg$FAILED;
1735
- }
1736
- // @ts-ignore
1737
- peg$silentFails--;
1738
- // @ts-ignore
1739
- if (s0 === peg$FAILED) {
1740
- // @ts-ignore
1741
- s1 = peg$FAILED;
1742
- // @ts-ignore
1743
- if (peg$silentFails === 0)
1744
- peg$fail(peg$e20);
1745
- }
1746
- // @ts-ignore
1747
- return s0;
1748
- }
1749
- // @ts-ignore
1750
- function peg$parseversion() {
1751
- // @ts-ignore
1752
- var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9;
1753
- // @ts-ignore
1754
- peg$silentFails++;
1755
- // @ts-ignore
1756
- s0 = peg$currPos;
1757
- // @ts-ignore
1758
- s1 = peg$parse_();
1759
- // @ts-ignore
1760
- s2 = peg$currPos;
1761
- // @ts-ignore
1762
- s3 = [];
1763
- // @ts-ignore
1764
- if (peg$r2.test(input.charAt(peg$currPos))) {
1765
- // @ts-ignore
1766
- s4 = input.charAt(peg$currPos);
1767
- // @ts-ignore
1768
- peg$currPos++;
1769
- // @ts-ignore
1770
- }
1771
- else {
1772
- // @ts-ignore
1773
- s4 = peg$FAILED;
1774
- // @ts-ignore
1775
- if (peg$silentFails === 0)
1776
- peg$fail(peg$e19);
84
+ break;
1777
85
  }
1778
- // @ts-ignore
1779
- if (s4 !== peg$FAILED) {
1780
- // @ts-ignore
1781
- while (s4 !== peg$FAILED) {
1782
- // @ts-ignore
1783
- s3.push(s4);
1784
- // @ts-ignore
1785
- if (peg$r2.test(input.charAt(peg$currPos))) {
1786
- // @ts-ignore
1787
- s4 = input.charAt(peg$currPos);
1788
- // @ts-ignore
1789
- peg$currPos++;
1790
- // @ts-ignore
86
+ case "!": {
87
+ if (input[i + 1] === "=") {
88
+ if (input[i + 2] === "=") {
89
+ yield {
90
+ kind: TokenKind.ExclamationEqualsEquals,
91
+ start: i,
92
+ };
93
+ i += 2;
1791
94
  }
1792
95
  else {
1793
- // @ts-ignore
1794
- s4 = peg$FAILED;
1795
- // @ts-ignore
1796
- if (peg$silentFails === 0)
1797
- peg$fail(peg$e19);
96
+ yield { kind: TokenKind.ExclamationEquals, start: i };
97
+ i++;
1798
98
  }
1799
99
  }
1800
- // @ts-ignore
1801
- }
1802
- else {
1803
- // @ts-ignore
1804
- s3 = peg$FAILED;
100
+ break;
1805
101
  }
1806
- // @ts-ignore
1807
- if (s3 !== peg$FAILED) {
1808
- // @ts-ignore
1809
- if (input.charCodeAt(peg$currPos) === 46) {
1810
- // @ts-ignore
1811
- s4 = peg$c11;
1812
- // @ts-ignore
1813
- peg$currPos++;
1814
- // @ts-ignore
1815
- }
1816
- else {
1817
- // @ts-ignore
1818
- s4 = peg$FAILED;
1819
- // @ts-ignore
1820
- if (peg$silentFails === 0)
1821
- peg$fail(peg$e24);
1822
- }
1823
- // @ts-ignore
1824
- if (s4 !== peg$FAILED) {
1825
- // @ts-ignore
1826
- s5 = [];
1827
- // @ts-ignore
1828
- if (peg$r2.test(input.charAt(peg$currPos))) {
1829
- // @ts-ignore
1830
- s6 = input.charAt(peg$currPos);
1831
- // @ts-ignore
1832
- peg$currPos++;
1833
- // @ts-ignore
1834
- }
1835
- else {
1836
- // @ts-ignore
1837
- s6 = peg$FAILED;
1838
- // @ts-ignore
1839
- if (peg$silentFails === 0)
1840
- peg$fail(peg$e19);
1841
- }
1842
- // @ts-ignore
1843
- if (s6 !== peg$FAILED) {
1844
- // @ts-ignore
1845
- while (s6 !== peg$FAILED) {
1846
- // @ts-ignore
1847
- s5.push(s6);
1848
- // @ts-ignore
1849
- if (peg$r2.test(input.charAt(peg$currPos))) {
1850
- // @ts-ignore
1851
- s6 = input.charAt(peg$currPos);
1852
- // @ts-ignore
1853
- peg$currPos++;
1854
- // @ts-ignore
1855
- }
1856
- else {
1857
- // @ts-ignore
1858
- s6 = peg$FAILED;
1859
- // @ts-ignore
1860
- if (peg$silentFails === 0) {
1861
- peg$fail(peg$e19);
1862
- }
1863
- }
1864
- }
1865
- // @ts-ignore
1866
- }
1867
- else {
1868
- // @ts-ignore
1869
- s5 = peg$FAILED;
1870
- }
1871
- // @ts-ignore
1872
- if (s5 !== peg$FAILED) {
1873
- // @ts-ignore
1874
- s6 = peg$currPos;
1875
- // @ts-ignore
1876
- if (input.charCodeAt(peg$currPos) === 46) {
1877
- // @ts-ignore
1878
- s7 = peg$c11;
1879
- // @ts-ignore
1880
- peg$currPos++;
1881
- // @ts-ignore
1882
- }
1883
- else {
1884
- // @ts-ignore
1885
- s7 = peg$FAILED;
1886
- // @ts-ignore
1887
- if (peg$silentFails === 0)
1888
- peg$fail(peg$e24);
1889
- }
1890
- // @ts-ignore
1891
- if (s7 !== peg$FAILED) {
1892
- // @ts-ignore
1893
- s8 = [];
1894
- // @ts-ignore
1895
- if (peg$r2.test(input.charAt(peg$currPos))) {
1896
- // @ts-ignore
1897
- s9 = input.charAt(peg$currPos);
1898
- // @ts-ignore
1899
- peg$currPos++;
1900
- // @ts-ignore
1901
- }
1902
- else {
1903
- // @ts-ignore
1904
- s9 = peg$FAILED;
1905
- // @ts-ignore
1906
- if (peg$silentFails === 0) {
1907
- peg$fail(peg$e19);
1908
- }
1909
- }
1910
- // @ts-ignore
1911
- if (s9 !== peg$FAILED) {
1912
- // @ts-ignore
1913
- while (s9 !== peg$FAILED) {
1914
- // @ts-ignore
1915
- s8.push(s9);
1916
- // @ts-ignore
1917
- if (peg$r2.test(input.charAt(peg$currPos))) {
1918
- // @ts-ignore
1919
- s9 = input.charAt(peg$currPos);
1920
- // @ts-ignore
1921
- peg$currPos++;
1922
- // @ts-ignore
1923
- }
1924
- else {
1925
- // @ts-ignore
1926
- s9 = peg$FAILED;
1927
- // @ts-ignore
1928
- if (peg$silentFails === 0) {
1929
- peg$fail(peg$e19);
1930
- }
1931
- }
1932
- }
1933
- // @ts-ignore
1934
- }
1935
- else {
1936
- // @ts-ignore
1937
- s8 = peg$FAILED;
1938
- }
1939
- // @ts-ignore
1940
- if (s8 !== peg$FAILED) {
1941
- // @ts-ignore
1942
- s7 = [s7, s8];
1943
- // @ts-ignore
1944
- s6 = s7;
1945
- // @ts-ignore
1946
- }
1947
- else {
1948
- // @ts-ignore
1949
- peg$currPos = s6;
1950
- // @ts-ignore
1951
- s6 = peg$FAILED;
1952
- }
1953
- // @ts-ignore
1954
- }
1955
- else {
1956
- // @ts-ignore
1957
- peg$currPos = s6;
1958
- // @ts-ignore
1959
- s6 = peg$FAILED;
1960
- }
1961
- // @ts-ignore
1962
- if (s6 === peg$FAILED) {
1963
- // @ts-ignore
1964
- s6 = null;
1965
- }
1966
- // @ts-ignore
1967
- s3 = [s3, s4, s5, s6];
1968
- // @ts-ignore
1969
- s2 = s3;
1970
- // @ts-ignore
1971
- }
1972
- else {
1973
- // @ts-ignore
1974
- peg$currPos = s2;
1975
- // @ts-ignore
1976
- s2 = peg$FAILED;
1977
- }
1978
- // @ts-ignore
102
+ case "<": {
103
+ if (input[i + 1] === "=") {
104
+ yield { kind: TokenKind.LessThanEquals, start: i };
105
+ i++;
1979
106
  }
1980
107
  else {
1981
- // @ts-ignore
1982
- peg$currPos = s2;
1983
- // @ts-ignore
1984
- s2 = peg$FAILED;
108
+ yield { kind: TokenKind.LessThan, start: i };
1985
109
  }
1986
- // @ts-ignore
1987
- }
1988
- else {
1989
- // @ts-ignore
1990
- peg$currPos = s2;
1991
- // @ts-ignore
1992
- s2 = peg$FAILED;
1993
- }
1994
- // @ts-ignore
1995
- if (s2 !== peg$FAILED) {
1996
- // @ts-ignore
1997
- peg$savedPos = s0;
1998
- // @ts-ignore
1999
- s0 = peg$f10(s2);
2000
- // @ts-ignore
2001
- }
2002
- else {
2003
- // @ts-ignore
2004
- peg$currPos = s0;
2005
- // @ts-ignore
2006
- s0 = peg$FAILED;
2007
- }
2008
- // @ts-ignore
2009
- peg$silentFails--;
2010
- // @ts-ignore
2011
- if (s0 === peg$FAILED) {
2012
- // @ts-ignore
2013
- s1 = peg$FAILED;
2014
- // @ts-ignore
2015
- if (peg$silentFails === 0)
2016
- peg$fail(peg$e23);
2017
- }
2018
- // @ts-ignore
2019
- return s0;
2020
- }
2021
- // @ts-ignore
2022
- function peg$parsestring() {
2023
- // @ts-ignore
2024
- var s0, s1, s2, s3, s4, s5;
2025
- // @ts-ignore
2026
- peg$silentFails++;
2027
- // @ts-ignore
2028
- s0 = peg$currPos;
2029
- // @ts-ignore
2030
- s1 = peg$parse_();
2031
- // @ts-ignore
2032
- s2 = peg$currPos;
2033
- // @ts-ignore
2034
- if (input.charCodeAt(peg$currPos) === 34) {
2035
- // @ts-ignore
2036
- s3 = peg$c12;
2037
- // @ts-ignore
2038
- peg$currPos++;
2039
- // @ts-ignore
2040
- }
2041
- else {
2042
- // @ts-ignore
2043
- s3 = peg$FAILED;
2044
- // @ts-ignore
2045
- if (peg$silentFails === 0)
2046
- peg$fail(peg$e26);
110
+ break;
2047
111
  }
2048
- // @ts-ignore
2049
- if (s3 !== peg$FAILED) {
2050
- // @ts-ignore
2051
- s4 = [];
2052
- // @ts-ignore
2053
- if (peg$r4.test(input.charAt(peg$currPos))) {
2054
- // @ts-ignore
2055
- s5 = input.charAt(peg$currPos);
2056
- // @ts-ignore
2057
- peg$currPos++;
2058
- // @ts-ignore
2059
- }
2060
- else {
2061
- // @ts-ignore
2062
- s5 = peg$FAILED;
2063
- // @ts-ignore
2064
- if (peg$silentFails === 0)
2065
- peg$fail(peg$e27);
2066
- }
2067
- // @ts-ignore
2068
- while (s5 !== peg$FAILED) {
2069
- // @ts-ignore
2070
- s4.push(s5);
2071
- // @ts-ignore
2072
- if (peg$r4.test(input.charAt(peg$currPos))) {
2073
- // @ts-ignore
2074
- s5 = input.charAt(peg$currPos);
2075
- // @ts-ignore
2076
- peg$currPos++;
2077
- // @ts-ignore
2078
- }
2079
- else {
2080
- // @ts-ignore
2081
- s5 = peg$FAILED;
2082
- // @ts-ignore
2083
- if (peg$silentFails === 0)
2084
- peg$fail(peg$e27);
2085
- }
2086
- }
2087
- // @ts-ignore
2088
- if (input.charCodeAt(peg$currPos) === 34) {
2089
- // @ts-ignore
2090
- s5 = peg$c12;
2091
- // @ts-ignore
2092
- peg$currPos++;
2093
- // @ts-ignore
112
+ case ">": {
113
+ if (input[i + 1] === "=") {
114
+ yield { kind: TokenKind.GreaterThanEquals, start: i };
115
+ i++;
2094
116
  }
2095
117
  else {
2096
- // @ts-ignore
2097
- s5 = peg$FAILED;
2098
- // @ts-ignore
2099
- if (peg$silentFails === 0)
2100
- peg$fail(peg$e26);
2101
- }
2102
- // @ts-ignore
2103
- if (s5 !== peg$FAILED) {
2104
- // @ts-ignore
2105
- s3 = [s3, s4, s5];
2106
- // @ts-ignore
2107
- s2 = s3;
2108
- // @ts-ignore
2109
- }
2110
- else {
2111
- // @ts-ignore
2112
- peg$currPos = s2;
2113
- // @ts-ignore
2114
- s2 = peg$FAILED;
2115
- }
2116
- // @ts-ignore
2117
- }
2118
- else {
2119
- // @ts-ignore
2120
- peg$currPos = s2;
2121
- // @ts-ignore
2122
- s2 = peg$FAILED;
2123
- }
2124
- // @ts-ignore
2125
- if (s2 !== peg$FAILED) {
2126
- // @ts-ignore
2127
- peg$savedPos = s0;
2128
- // @ts-ignore
2129
- s0 = peg$f11();
2130
- // @ts-ignore
2131
- }
2132
- else {
2133
- // @ts-ignore
2134
- peg$currPos = s0;
2135
- // @ts-ignore
2136
- s0 = peg$FAILED;
2137
- }
2138
- // @ts-ignore
2139
- if (s0 === peg$FAILED) {
2140
- // @ts-ignore
2141
- s0 = peg$currPos;
2142
- // @ts-ignore
2143
- s1 = peg$parse_();
2144
- // @ts-ignore
2145
- s2 = peg$currPos;
2146
- // @ts-ignore
2147
- if (input.charCodeAt(peg$currPos) === 39) {
2148
- // @ts-ignore
2149
- s3 = peg$c13;
2150
- // @ts-ignore
2151
- peg$currPos++;
2152
- // @ts-ignore
2153
- }
2154
- else {
2155
- // @ts-ignore
2156
- s3 = peg$FAILED;
2157
- // @ts-ignore
2158
- if (peg$silentFails === 0)
2159
- peg$fail(peg$e28);
2160
- }
2161
- // @ts-ignore
2162
- if (s3 !== peg$FAILED) {
2163
- // @ts-ignore
2164
- s4 = [];
2165
- // @ts-ignore
2166
- if (peg$r5.test(input.charAt(peg$currPos))) {
2167
- // @ts-ignore
2168
- s5 = input.charAt(peg$currPos);
2169
- // @ts-ignore
2170
- peg$currPos++;
2171
- // @ts-ignore
2172
- }
2173
- else {
2174
- // @ts-ignore
2175
- s5 = peg$FAILED;
2176
- // @ts-ignore
2177
- if (peg$silentFails === 0)
2178
- peg$fail(peg$e29);
2179
- }
2180
- // @ts-ignore
2181
- while (s5 !== peg$FAILED) {
2182
- // @ts-ignore
2183
- s4.push(s5);
2184
- // @ts-ignore
2185
- if (peg$r5.test(input.charAt(peg$currPos))) {
2186
- // @ts-ignore
2187
- s5 = input.charAt(peg$currPos);
2188
- // @ts-ignore
2189
- peg$currPos++;
2190
- // @ts-ignore
2191
- }
2192
- else {
2193
- // @ts-ignore
2194
- s5 = peg$FAILED;
2195
- // @ts-ignore
2196
- if (peg$silentFails === 0)
2197
- peg$fail(peg$e29);
2198
- }
2199
- }
2200
- // @ts-ignore
2201
- if (input.charCodeAt(peg$currPos) === 39) {
2202
- // @ts-ignore
2203
- s5 = peg$c13;
2204
- // @ts-ignore
2205
- peg$currPos++;
2206
- // @ts-ignore
2207
- }
2208
- else {
2209
- // @ts-ignore
2210
- s5 = peg$FAILED;
2211
- // @ts-ignore
2212
- if (peg$silentFails === 0)
2213
- peg$fail(peg$e28);
2214
- }
2215
- // @ts-ignore
2216
- if (s5 !== peg$FAILED) {
2217
- // @ts-ignore
2218
- s3 = [s3, s4, s5];
2219
- // @ts-ignore
2220
- s2 = s3;
2221
- // @ts-ignore
2222
- }
2223
- else {
2224
- // @ts-ignore
2225
- peg$currPos = s2;
2226
- // @ts-ignore
2227
- s2 = peg$FAILED;
2228
- }
2229
- // @ts-ignore
2230
- }
2231
- else {
2232
- // @ts-ignore
2233
- peg$currPos = s2;
2234
- // @ts-ignore
2235
- s2 = peg$FAILED;
2236
- }
2237
- // @ts-ignore
2238
- if (s2 !== peg$FAILED) {
2239
- // @ts-ignore
2240
- peg$savedPos = s0;
2241
- // @ts-ignore
2242
- s0 = peg$f12();
2243
- // @ts-ignore
2244
- }
2245
- else {
2246
- // @ts-ignore
2247
- peg$currPos = s0;
2248
- // @ts-ignore
2249
- s0 = peg$FAILED;
2250
- }
2251
- }
2252
- // @ts-ignore
2253
- peg$silentFails--;
2254
- // @ts-ignore
2255
- if (s0 === peg$FAILED) {
2256
- // @ts-ignore
2257
- s1 = peg$FAILED;
2258
- // @ts-ignore
2259
- if (peg$silentFails === 0)
2260
- peg$fail(peg$e25);
2261
- }
2262
- // @ts-ignore
2263
- return s0;
2264
- }
2265
- // @ts-ignore
2266
- function peg$parse_() {
2267
- // @ts-ignore
2268
- var s0, s1;
2269
- // @ts-ignore
2270
- peg$silentFails++;
2271
- // @ts-ignore
2272
- s0 = [];
2273
- // @ts-ignore
2274
- if (peg$r6.test(input.charAt(peg$currPos))) {
2275
- // @ts-ignore
2276
- s1 = input.charAt(peg$currPos);
2277
- // @ts-ignore
2278
- peg$currPos++;
2279
- // @ts-ignore
2280
- }
2281
- else {
2282
- // @ts-ignore
2283
- s1 = peg$FAILED;
2284
- // @ts-ignore
2285
- if (peg$silentFails === 0)
2286
- peg$fail(peg$e31);
118
+ yield { kind: TokenKind.GreaterThan, start: i };
119
+ }
120
+ break;
121
+ }
122
+ default: {
123
+ if (/\s/.test(input[i])) {
124
+ // Skip whitespace
125
+ continue;
126
+ }
127
+ // Parse hexadecimal numbers
128
+ if (input[i] === "0" && input[i + 1] === "x") {
129
+ const start = i;
130
+ let hex = "0x";
131
+ i += 2;
132
+ while (i < input.length && /[0-9a-fA-F]/.test(input[i])) {
133
+ hex += input[i];
134
+ i++;
135
+ }
136
+ yield {
137
+ kind: TokenKind.NumberLiteral,
138
+ value: hex,
139
+ start,
140
+ };
141
+ i--; // Account for the outer loop increment
142
+ continue;
143
+ }
144
+ // Parse decimal numbers
145
+ if (/\d/.test(input[i])) {
146
+ const start = i;
147
+ let num = "";
148
+ while (i < input.length && /\d/.test(input[i])) {
149
+ num += input[i];
150
+ i++;
151
+ }
152
+ yield {
153
+ kind: TokenKind.NumberLiteral,
154
+ value: num,
155
+ start,
156
+ };
157
+ i--; // Account for the outer loop increment
158
+ continue;
159
+ }
160
+ // Parse identifiers
161
+ if (/[a-zA-Z_$]/.test(input[i])) {
162
+ const start = i;
163
+ let id = "";
164
+ while (i < input.length && /[a-zA-Z0-9_$]/.test(input[i])) {
165
+ id += input[i];
166
+ i++;
167
+ }
168
+ yield { kind: TokenKind.Identifier, value: id, start };
169
+ i--; // Account for the outer loop increment
170
+ continue;
171
+ }
172
+ throw new Error(`Unexpected character '${input[i]}' at index ${i}`);
2287
173
  }
2288
- // @ts-ignore
2289
- while (s1 !== peg$FAILED) {
2290
- // @ts-ignore
2291
- s0.push(s1);
2292
- // @ts-ignore
2293
- if (peg$r6.test(input.charAt(peg$currPos))) {
2294
- // @ts-ignore
2295
- s1 = input.charAt(peg$currPos);
2296
- // @ts-ignore
2297
- peg$currPos++;
2298
- // @ts-ignore
2299
- }
2300
- else {
2301
- // @ts-ignore
2302
- s1 = peg$FAILED;
2303
- // @ts-ignore
2304
- if (peg$silentFails === 0)
2305
- peg$fail(peg$e31);
2306
- }
2307
- }
2308
- // @ts-ignore
2309
- peg$silentFails--;
2310
- // @ts-ignore
2311
- s1 = peg$FAILED;
2312
- // @ts-ignore
2313
- if (peg$silentFails === 0)
2314
- peg$fail(peg$e30);
2315
- // @ts-ignore
2316
- return s0;
2317
174
  }
2318
- // @ts-ignore
2319
- peg$result = peg$startRuleFunction();
2320
- // @ts-ignore
2321
- if (peg$result !== peg$FAILED && peg$currPos === input.length) {
2322
- // @ts-ignore
2323
- return peg$result;
2324
- // @ts-ignore
175
+ }
176
+ }
177
+ export function parse(input) {
178
+ const tokens = Array.from(tokenize(input));
179
+ const state = { input, tokens, pos: 0 };
180
+ const ret = parseExpression(state);
181
+ // If there are remaining tokens, the parse failed
182
+ if (state.pos < tokens.length) {
183
+ const token = tokens[state.pos];
184
+ throw new Error(`Unexpected token ${getEnumMemberName(TokenKind, token.kind)} at position ` + token.start);
185
+ }
186
+ return ret;
187
+ }
188
+ function parseExpression(s) {
189
+ return parseOr(s) || parseAnd(s) || parseComparison(s) || parseGroup(s);
190
+ }
191
+ function parseAnd(s) {
192
+ // <comparison|group> && <comparison|group> && ...
193
+ let startPos = s.pos;
194
+ const first = parseComparison(s) || parseGroup(s);
195
+ if (!first) {
196
+ s.pos = startPos;
197
+ return;
198
+ }
199
+ // Expect a "&&" operator
200
+ if (s.tokens[s.pos]?.kind !== TokenKind.AmpAmp) {
201
+ s.pos = startPos;
202
+ return;
203
+ }
204
+ s.pos++; // consume "&&"
205
+ const second = parseComparison(s) || parseGroup(s);
206
+ if (!second) {
207
+ s.pos = startPos;
208
+ return;
209
+ }
210
+ // Parsing succeeded so far, update the parser start position,
211
+ // so we don't rewind too much on failure
212
+ startPos = s.pos;
213
+ // Now optionally parse further sequences of "&&" <comparison|group>
214
+ const operands = [first, second];
215
+ while (s.tokens[s.pos]?.kind === TokenKind.AmpAmp) {
216
+ s.pos++; // consume "&&"
217
+ const next = parseComparison(s) || parseGroup(s);
218
+ if (!next) {
219
+ s.pos = startPos;
220
+ break;
221
+ }
222
+ operands.push(next);
223
+ // update the parser start position,
224
+ // so we don't rewind too much on failure
225
+ startPos = s.pos;
226
+ }
227
+ return {
228
+ kind: SyntaxKind.And,
229
+ operands,
230
+ };
231
+ }
232
+ function parseOr(s) {
233
+ // <and|comparison|group> || <and|comparison|group> || ...
234
+ let startPos = s.pos;
235
+ const first = parseAnd(s) || parseComparison(s) || parseGroup(s);
236
+ if (!first) {
237
+ s.pos = startPos;
238
+ return;
239
+ }
240
+ // Expect a "||" operator
241
+ if (s.tokens[s.pos]?.kind !== TokenKind.BarBar) {
242
+ s.pos = startPos;
243
+ return;
244
+ }
245
+ s.pos++; // consume "||"
246
+ const second = parseAnd(s) || parseComparison(s) || parseGroup(s);
247
+ if (!second) {
248
+ s.pos = startPos;
249
+ return;
250
+ }
251
+ // Parsing succeeded so far, update the parser start position,
252
+ // so we don't rewind too much on failure
253
+ startPos = s.pos;
254
+ // Now optionally parse further sequences of "||" <and|comparison|group>
255
+ const operands = [first, second];
256
+ while (s.tokens[s.pos]?.kind === TokenKind.BarBar) {
257
+ s.pos++; // consume "||"
258
+ const next = parseAnd(s) || parseComparison(s) || parseGroup(s);
259
+ if (!next) {
260
+ s.pos = startPos;
261
+ break;
262
+ }
263
+ operands.push(next);
264
+ // update the parser start position,
265
+ // so we don't rewind too much on failure
266
+ startPos = s.pos;
267
+ }
268
+ return {
269
+ kind: SyntaxKind.Or,
270
+ operands,
271
+ };
272
+ }
273
+ function parseGroup(s) {
274
+ // A group is technically only needed for operator precedence of OR expressions,
275
+ // but we parse any expression within parentheses for simplicity
276
+ // "(" <expression> ")"
277
+ const startPos = s.pos;
278
+ if (s.tokens[s.pos]?.kind !== TokenKind.LeftParen) {
279
+ return;
280
+ }
281
+ s.pos++; // consume "("
282
+ const expression = parseExpression(s);
283
+ if (!expression) {
284
+ s.pos = startPos;
285
+ return;
286
+ }
287
+ if (s.tokens[s.pos]?.kind !== TokenKind.RightParen) {
288
+ s.pos = startPos;
289
+ return;
290
+ }
291
+ s.pos++; // consume ")"
292
+ return expression;
293
+ }
294
+ function parseComparison(s) {
295
+ // <identifier> <operator> <identifier|version|number>
296
+ const startPos = s.pos;
297
+ const left = parseIdentifier(s);
298
+ if (!left) {
299
+ s.pos = startPos;
300
+ return;
301
+ }
302
+ const operator = parseOperator(s);
303
+ if (operator == undefined) {
304
+ s.pos = startPos;
305
+ return;
306
+ }
307
+ const right = parseVersion(s)
308
+ || parseNumberLiteral(s)
309
+ || parseIdentifier(s);
310
+ if (!right) {
311
+ s.pos = startPos;
312
+ return;
313
+ }
314
+ else if (right.kind === SyntaxKind.Identifier) {
315
+ // For comparisons, the right side must not be an identifier
316
+ throw new Error(`Right-hand side of comparisons must be a version or number literal`);
317
+ }
318
+ return {
319
+ kind: SyntaxKind.Comparison,
320
+ left,
321
+ operator,
322
+ right,
323
+ };
324
+ }
325
+ function parseIdentifier(s) {
326
+ const token = s.tokens[s.pos];
327
+ if (token?.kind === TokenKind.Identifier) {
328
+ s.pos++;
329
+ return { kind: SyntaxKind.Identifier, name: token.value };
330
+ }
331
+ }
332
+ function parseOperator(s) {
333
+ const token = s.tokens[s.pos];
334
+ if (!token)
335
+ return null;
336
+ switch (token.kind) {
337
+ case TokenKind.EqualsEquals:
338
+ case TokenKind.EqualsEqualsEquals:
339
+ s.pos++;
340
+ return Operator.Equal;
341
+ case TokenKind.ExclamationEquals:
342
+ case TokenKind.ExclamationEqualsEquals:
343
+ s.pos++;
344
+ return Operator.NotEqual;
345
+ case TokenKind.LessThan:
346
+ s.pos++;
347
+ return Operator.LessThan;
348
+ case TokenKind.LessThanEquals:
349
+ s.pos++;
350
+ return Operator.LessThanOrEqual;
351
+ case TokenKind.GreaterThan:
352
+ s.pos++;
353
+ return Operator.GreaterThan;
354
+ case TokenKind.GreaterThanEquals:
355
+ s.pos++;
356
+ return Operator.GreaterThanOrEqual;
357
+ default:
358
+ return null;
359
+ }
360
+ }
361
+ function parseVersion(s) {
362
+ // <number> "." <number> ["." <number>]
363
+ let pos = s.pos;
364
+ // Parse a sequence of 2-3 number literals separated by dots
365
+ if (s.tokens[pos]?.kind !== TokenKind.NumberLiteral) {
366
+ return;
367
+ }
368
+ let version = s.tokens[pos].value;
369
+ pos++;
370
+ if (s.tokens[pos]?.kind !== TokenKind.Dot) {
371
+ return;
372
+ }
373
+ version += ".";
374
+ pos++;
375
+ if (s.tokens[pos]?.kind !== TokenKind.NumberLiteral) {
376
+ return;
377
+ }
378
+ version += s.tokens[pos].value;
379
+ pos++;
380
+ // Optionally parse a third number
381
+ if (s.tokens[pos]?.kind === TokenKind.Dot) {
382
+ version += ".";
383
+ pos++;
384
+ if (s.tokens[pos]?.kind !== TokenKind.NumberLiteral) {
385
+ return;
386
+ }
387
+ version += s.tokens[pos].value;
388
+ pos++;
389
+ }
390
+ // Update the parser state position
391
+ s.pos = pos;
392
+ return { kind: SyntaxKind.Version, value: version };
393
+ }
394
+ function parseNumberLiteral(s) {
395
+ if (s.tokens[s.pos]?.kind === TokenKind.NumberLiteral) {
396
+ const token = s.tokens[s.pos];
397
+ s.pos++;
398
+ return {
399
+ kind: SyntaxKind.NumberLiteral,
400
+ value: parseInt(token.value),
401
+ };
402
+ }
403
+ }
404
+ export function toRulesLogic(expr) {
405
+ if (expr.kind === SyntaxKind.Or) {
406
+ return {
407
+ or: expr.operands.map(toRulesLogic),
408
+ };
409
+ }
410
+ else if (expr.kind === SyntaxKind.And) {
411
+ return {
412
+ and: expr.operands.map(toRulesLogic),
413
+ };
414
+ }
415
+ else if (expr.kind === SyntaxKind.Comparison) {
416
+ if (expr.right.kind === SyntaxKind.Version) {
417
+ const opMap = {
418
+ [Operator.Equal]: "ver ===",
419
+ [Operator.NotEqual]: "ver !==",
420
+ [Operator.LessThan]: "ver <",
421
+ [Operator.LessThanOrEqual]: "ver <=",
422
+ [Operator.GreaterThan]: "ver >",
423
+ [Operator.GreaterThanOrEqual]: "ver >=",
424
+ };
425
+ // @ts-expect-error The generated types for the version comparisons are not compatible with the RulesLogic type
426
+ return {
427
+ [opMap[expr.operator]]: [
428
+ { var: expr.left.name },
429
+ expr.right.value,
430
+ ],
431
+ };
2325
432
  }
2326
433
  else {
2327
- // @ts-ignore
2328
- if (peg$result !== peg$FAILED && peg$currPos < input.length) {
2329
- // @ts-ignore
2330
- peg$fail(peg$endExpectation());
2331
- }
2332
- // @ts-ignore
2333
- throw peg$buildStructuredError(
2334
- // @ts-ignore
2335
- peg$maxFailExpected,
2336
- // @ts-ignore
2337
- peg$maxFailPos < input.length
2338
- ? input.charAt(peg$maxFailPos)
2339
- : null,
2340
- // @ts-ignore
2341
- peg$maxFailPos < input.length
2342
- // @ts-ignore
2343
- ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)
2344
- // @ts-ignore
2345
- : peg$computeLocation(peg$maxFailPos, peg$maxFailPos));
434
+ const opMap = {
435
+ [Operator.Equal]: "===",
436
+ [Operator.NotEqual]: "!==",
437
+ [Operator.LessThan]: "<",
438
+ [Operator.LessThanOrEqual]: "<=",
439
+ [Operator.GreaterThan]: ">",
440
+ [Operator.GreaterThanOrEqual]: ">=",
441
+ };
442
+ // @ts-expect-error The generated types for the version comparisons are not compatible with the RulesLogic type
443
+ return {
444
+ [opMap[expr.operator]]: [
445
+ { var: expr.left.name },
446
+ expr.right.value,
447
+ ],
448
+ };
2346
449
  }
2347
450
  }
2348
- // @ts-ignore
2349
- return {
2350
- SyntaxError: peg$SyntaxError,
2351
- parse: peg$parse,
2352
- };
2353
- })();
2354
- peggyParser.SyntaxError.prototype.name = "PeggySyntaxError";
2355
- export const parse = peggyParser.parse;
2356
- export const PeggySyntaxError = peggyParser
2357
- .SyntaxError;
451
+ else {
452
+ assertNever(expr);
453
+ }
454
+ }
2358
455
  //# sourceMappingURL=LogicParser.js.map