@malloydata/malloy-filter 0.0.350 → 0.0.352

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 (46) hide show
  1. package/README.md +3 -3
  2. package/dist/clause_utils.d.ts +7 -62
  3. package/dist/clause_utils.js +0 -14
  4. package/dist/clause_utils.js.map +1 -1
  5. package/dist/filter_interface.d.ts +5 -5
  6. package/dist/filter_interface.js +13 -5
  7. package/dist/filter_interface.js.map +1 -1
  8. package/dist/lib/fexpr_number_parser.d.ts +9 -26
  9. package/dist/lib/fexpr_number_parser.js +1476 -83
  10. package/dist/lib/fexpr_number_parser.js.map +1 -1
  11. package/dist/lib/fexpr_string_parser.d.ts +9 -26
  12. package/dist/lib/fexpr_string_parser.js +709 -50
  13. package/dist/lib/fexpr_string_parser.js.map +1 -1
  14. package/dist/lib/ftemporal_parser.d.ts +9 -26
  15. package/dist/lib/ftemporal_parser.js +4095 -163
  16. package/dist/lib/ftemporal_parser.js.map +1 -1
  17. package/dist/number_filter_expression.js +3 -41
  18. package/dist/number_filter_expression.js.map +1 -1
  19. package/dist/{nearley_parse.d.ts → peggy_parse.d.ts} +1 -2
  20. package/dist/peggy_parse.js +40 -0
  21. package/dist/peggy_parse.js.map +1 -0
  22. package/dist/string_filter_expression.js +3 -46
  23. package/dist/string_filter_expression.js.map +1 -1
  24. package/dist/temporal_filter_expression.js +3 -41
  25. package/dist/temporal_filter_expression.js.map +1 -1
  26. package/femto-config.motly +19 -0
  27. package/package.json +9 -11
  28. package/src/clause_utils.ts +9 -23
  29. package/src/filter_interface.ts +14 -8
  30. package/src/grammars/fexpr_number.peggy +46 -0
  31. package/src/grammars/fexpr_string.peggy +32 -0
  32. package/src/grammars/ftemporal.peggy +112 -0
  33. package/src/lib/fexpr_number_parser.js +1411 -0
  34. package/src/lib/fexpr_string_parser.js +740 -0
  35. package/src/lib/ftemporal_parser.js +3641 -0
  36. package/src/number_filter_expression.ts +3 -7
  37. package/src/peggy_parse.ts +50 -0
  38. package/src/string_filter_expression.ts +3 -12
  39. package/src/temporal_filter_expression.ts +3 -7
  40. package/tsconfig.json +3 -2
  41. package/dist/nearley_parse.js +0 -51
  42. package/dist/nearley_parse.js.map +0 -1
  43. package/src/lib/fexpr_number_parser.ts +0 -126
  44. package/src/lib/fexpr_string_parser.ts +0 -84
  45. package/src/lib/ftemporal_parser.ts +0 -246
  46. package/src/nearley_parse.ts +0 -53
@@ -1,54 +1,713 @@
1
+ // @generated by Peggy 4.2.0.
2
+ //
3
+ // https://peggyjs.org/
1
4
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ const { conjoin, maybeNot, matchOp } = require('../clause_utils');
6
+ function peg$subclass(child, parent) {
7
+ function C() { this.constructor = child; }
8
+ C.prototype = parent.prototype;
9
+ child.prototype = new C();
10
+ }
11
+ function peg$SyntaxError(message, expected, found, location) {
12
+ var self = Error.call(this, message);
13
+ // istanbul ignore next Check is a necessary evil to support older environments
14
+ if (Object.setPrototypeOf) {
15
+ Object.setPrototypeOf(self, peg$SyntaxError.prototype);
16
+ }
17
+ self.expected = expected;
18
+ self.found = found;
19
+ self.location = location;
20
+ self.name = "SyntaxError";
21
+ return self;
22
+ }
23
+ peg$subclass(peg$SyntaxError, Error);
24
+ function peg$padEnd(str, targetLength, padString) {
25
+ padString = padString || " ";
26
+ if (str.length > targetLength) {
27
+ return str;
28
+ }
29
+ targetLength -= str.length;
30
+ padString += padString.repeat(targetLength);
31
+ return str + padString.slice(0, targetLength);
32
+ }
33
+ peg$SyntaxError.prototype.format = function (sources) {
34
+ var str = "Error: " + this.message;
35
+ if (this.location) {
36
+ var src = null;
37
+ var k;
38
+ for (k = 0; k < sources.length; k++) {
39
+ if (sources[k].source === this.location.source) {
40
+ src = sources[k].text.split(/\r\n|\n|\r/g);
41
+ break;
42
+ }
43
+ }
44
+ var s = this.location.start;
45
+ var offset_s = (this.location.source && (typeof this.location.source.offset === "function"))
46
+ ? this.location.source.offset(s)
47
+ : s;
48
+ var loc = this.location.source + ":" + offset_s.line + ":" + offset_s.column;
49
+ if (src) {
50
+ var e = this.location.end;
51
+ var filler = peg$padEnd("", offset_s.line.toString().length, ' ');
52
+ var line = src[s.line - 1];
53
+ var last = s.line === e.line ? e.column : line.length + 1;
54
+ var hatLen = (last - s.column) || 1;
55
+ str += "\n --> " + loc + "\n"
56
+ + filler + " |\n"
57
+ + offset_s.line + " | " + line + "\n"
58
+ + filler + " | " + peg$padEnd("", s.column - 1, ' ')
59
+ + peg$padEnd("", hatLen, "^");
60
+ }
61
+ else {
62
+ str += "\n at " + loc;
63
+ }
64
+ }
65
+ return str;
66
+ };
67
+ peg$SyntaxError.buildMessage = function (expected, found) {
68
+ var DESCRIBE_EXPECTATION_FNS = {
69
+ literal: function (expectation) {
70
+ return "\"" + literalEscape(expectation.text) + "\"";
71
+ },
72
+ class: function (expectation) {
73
+ var escapedParts = expectation.parts.map(function (part) {
74
+ return Array.isArray(part)
75
+ ? classEscape(part[0]) + "-" + classEscape(part[1])
76
+ : classEscape(part);
77
+ });
78
+ return "[" + (expectation.inverted ? "^" : "") + escapedParts.join("") + "]";
79
+ },
80
+ any: function () {
81
+ return "any character";
82
+ },
83
+ end: function () {
84
+ return "end of input";
85
+ },
86
+ other: function (expectation) {
87
+ return expectation.description;
88
+ }
89
+ };
90
+ function hex(ch) {
91
+ return ch.charCodeAt(0).toString(16).toUpperCase();
92
+ }
93
+ function literalEscape(s) {
94
+ return s
95
+ .replace(/\\/g, "\\\\")
96
+ .replace(/"/g, "\\\"")
97
+ .replace(/\0/g, "\\0")
98
+ .replace(/\t/g, "\\t")
99
+ .replace(/\n/g, "\\n")
100
+ .replace(/\r/g, "\\r")
101
+ .replace(/[\x00-\x0F]/g, function (ch) { return "\\x0" + hex(ch); })
102
+ .replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) { return "\\x" + hex(ch); });
103
+ }
104
+ function classEscape(s) {
105
+ return s
106
+ .replace(/\\/g, "\\\\")
107
+ .replace(/\]/g, "\\]")
108
+ .replace(/\^/g, "\\^")
109
+ .replace(/-/g, "\\-")
110
+ .replace(/\0/g, "\\0")
111
+ .replace(/\t/g, "\\t")
112
+ .replace(/\n/g, "\\n")
113
+ .replace(/\r/g, "\\r")
114
+ .replace(/[\x00-\x0F]/g, function (ch) { return "\\x0" + hex(ch); })
115
+ .replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) { return "\\x" + hex(ch); });
116
+ }
117
+ function describeExpectation(expectation) {
118
+ return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
119
+ }
120
+ function describeExpected(expected) {
121
+ var descriptions = expected.map(describeExpectation);
122
+ var i, j;
123
+ descriptions.sort();
124
+ if (descriptions.length > 0) {
125
+ for (i = 1, j = 1; i < descriptions.length; i++) {
126
+ if (descriptions[i - 1] !== descriptions[i]) {
127
+ descriptions[j] = descriptions[i];
128
+ j++;
129
+ }
130
+ }
131
+ descriptions.length = j;
132
+ }
133
+ switch (descriptions.length) {
134
+ case 1:
135
+ return descriptions[0];
136
+ case 2:
137
+ return descriptions[0] + " or " + descriptions[1];
138
+ default:
139
+ return descriptions.slice(0, -1).join(", ")
140
+ + ", or "
141
+ + descriptions[descriptions.length - 1];
142
+ }
143
+ }
144
+ function describeFound(found) {
145
+ return found ? "\"" + literalEscape(found) + "\"" : "end of input";
146
+ }
147
+ return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";
4
148
  };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- // Generated automatically by nearley, version 2.20.1
7
- // http://github.com/Hardmath123/nearley
8
- // Bypasses TS6133. Allow declared but unused functions.
9
- // @ts-ignore
10
- function id(d) { return d[0]; }
11
- const moo_1 = __importDefault(require("moo"));
12
- const clause_utils_1 = require("../clause_utils");
13
- const fstring_lexer = moo_1.default.compile({
14
- WS: /[ \t]+/,
15
- comma: ',',
16
- semi: ';',
17
- or: '|',
18
- open: '(',
19
- close: ')',
20
- minus: '-',
21
- matchStr: /(?:\\[^\n]|[^\n,;()|])+/,
22
- });
23
- const actual_next = fstring_lexer.next;
24
- fstring_lexer.next = (next => () => {
25
- for (;;) {
26
- const token = next.call(fstring_lexer);
27
- if (token == undefined || token.type !== 'WS') {
28
- return token;
29
- }
30
- }
31
- })(actual_next);
32
- ;
33
- ;
34
- ;
35
- ;
36
- const grammar = {
37
- Lexer: fstring_lexer,
38
- ParserRules: [
39
- { "name": "stringFilter", "symbols": ["stringFilter", "conjunction", "sfUnary"], "postprocess": ([left, cop, right]) => (0, clause_utils_1.conjoin)(left, cop[0].text, right) },
40
- { "name": "stringFilter", "symbols": ["sfUnary"], "postprocess": (data) => data[0] },
41
- { "name": "sfUnary$ebnf$1", "symbols": [(fstring_lexer.has("minus") ? { type: "minus" } : minus)], "postprocess": id },
42
- { "name": "sfUnary$ebnf$1", "symbols": [], "postprocess": () => null },
43
- { "name": "sfUnary", "symbols": ["sfUnary$ebnf$1", "clause"], "postprocess": (data) => (0, clause_utils_1.maybeNot)(data) },
44
- { "name": "parens", "symbols": [(fstring_lexer.has("open") ? { type: "open" } : open), "stringFilter", (fstring_lexer.has("close") ? { type: "close" } : close)], "postprocess": ([_1, subFilter, _3]) => ({ operator: "()", expr: subFilter }) },
45
- { "name": "clause", "symbols": [(fstring_lexer.has("matchStr") ? { type: "matchStr" } : matchStr)], "postprocess": ([withStr]) => (0, clause_utils_1.matchOp)(withStr.text) },
46
- { "name": "clause", "symbols": ["parens"], "postprocess": (data) => data[0] },
47
- { "name": "conjunction", "symbols": [(fstring_lexer.has("comma") ? { type: "comma" } : comma)] },
48
- { "name": "conjunction", "symbols": [(fstring_lexer.has("semi") ? { type: "semi" } : semi)] },
49
- { "name": "conjunction", "symbols": [(fstring_lexer.has("or") ? { type: "or" } : or)] }
50
- ],
51
- ParserStart: "stringFilter",
149
+ function peg$parse(input, options) {
150
+ options = options !== undefined ? options : {};
151
+ var peg$FAILED = {};
152
+ var peg$source = options.grammarSource;
153
+ var peg$startRuleFunctions = { stringFilter: peg$parsestringFilter };
154
+ var peg$startRuleFunction = peg$parsestringFilter;
155
+ var peg$c0 = "-";
156
+ var peg$c1 = "(";
157
+ var peg$c2 = ")";
158
+ var peg$c3 = "\\";
159
+ var peg$c4 = ",";
160
+ var peg$c5 = ";";
161
+ var peg$c6 = "|";
162
+ var peg$r0 = /^[^\n,;()|]/;
163
+ var peg$r1 = /^[ \t]/;
164
+ var peg$e0 = peg$literalExpectation("-", false);
165
+ var peg$e1 = peg$literalExpectation("(", false);
166
+ var peg$e2 = peg$literalExpectation(")", false);
167
+ var peg$e3 = peg$otherExpectation("match string");
168
+ var peg$e4 = peg$literalExpectation("\\", false);
169
+ var peg$e5 = peg$anyExpectation();
170
+ var peg$e6 = peg$classExpectation(["\n", ",", ";", "(", ")", "|"], true, false);
171
+ var peg$e7 = peg$literalExpectation(",", false);
172
+ var peg$e8 = peg$literalExpectation(";", false);
173
+ var peg$e9 = peg$literalExpectation("|", false);
174
+ var peg$e10 = peg$otherExpectation("whitespace");
175
+ var peg$e11 = peg$classExpectation([" ", "\t"], false, false);
176
+ var peg$f0 = function (head, tail) {
177
+ return tail.reduce((left, [, cop, , right]) => conjoin(left, cop, right), head);
178
+ };
179
+ var peg$f1 = function (clause) { return maybeNot([true, clause]); };
180
+ var peg$f2 = function (clause) { return clause; };
181
+ var peg$f3 = function (expr) { return { operator: "()", expr }; };
182
+ var peg$f4 = function (str) { return matchOp(str); };
183
+ var peg$f5 = function (s) { return s; };
184
+ var peg$f6 = function () { return ","; };
185
+ var peg$f7 = function () { return ";"; };
186
+ var peg$f8 = function () { return "|"; };
187
+ var peg$currPos = options.peg$currPos | 0;
188
+ var peg$savedPos = peg$currPos;
189
+ var peg$posDetailsCache = [{ line: 1, column: 1 }];
190
+ var peg$maxFailPos = peg$currPos;
191
+ var peg$maxFailExpected = options.peg$maxFailExpected || [];
192
+ var peg$silentFails = options.peg$silentFails | 0;
193
+ var peg$result;
194
+ if (options.startRule) {
195
+ if (!(options.startRule in peg$startRuleFunctions)) {
196
+ throw new Error("Can't start parsing from rule \"" + options.startRule + "\".");
197
+ }
198
+ peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
199
+ }
200
+ function text() {
201
+ return input.substring(peg$savedPos, peg$currPos);
202
+ }
203
+ function offset() {
204
+ return peg$savedPos;
205
+ }
206
+ function range() {
207
+ return {
208
+ source: peg$source,
209
+ start: peg$savedPos,
210
+ end: peg$currPos
211
+ };
212
+ }
213
+ function location() {
214
+ return peg$computeLocation(peg$savedPos, peg$currPos);
215
+ }
216
+ function expected(description, location) {
217
+ location = location !== undefined
218
+ ? location
219
+ : peg$computeLocation(peg$savedPos, peg$currPos);
220
+ throw peg$buildStructuredError([peg$otherExpectation(description)], input.substring(peg$savedPos, peg$currPos), location);
221
+ }
222
+ function error(message, location) {
223
+ location = location !== undefined
224
+ ? location
225
+ : peg$computeLocation(peg$savedPos, peg$currPos);
226
+ throw peg$buildSimpleError(message, location);
227
+ }
228
+ function peg$literalExpectation(text, ignoreCase) {
229
+ return { type: "literal", text: text, ignoreCase: ignoreCase };
230
+ }
231
+ function peg$classExpectation(parts, inverted, ignoreCase) {
232
+ return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase };
233
+ }
234
+ function peg$anyExpectation() {
235
+ return { type: "any" };
236
+ }
237
+ function peg$endExpectation() {
238
+ return { type: "end" };
239
+ }
240
+ function peg$otherExpectation(description) {
241
+ return { type: "other", description: description };
242
+ }
243
+ function peg$computePosDetails(pos) {
244
+ var details = peg$posDetailsCache[pos];
245
+ var p;
246
+ if (details) {
247
+ return details;
248
+ }
249
+ else {
250
+ if (pos >= peg$posDetailsCache.length) {
251
+ p = peg$posDetailsCache.length - 1;
252
+ }
253
+ else {
254
+ p = pos;
255
+ while (!peg$posDetailsCache[--p]) { }
256
+ }
257
+ details = peg$posDetailsCache[p];
258
+ details = {
259
+ line: details.line,
260
+ column: details.column
261
+ };
262
+ while (p < pos) {
263
+ if (input.charCodeAt(p) === 10) {
264
+ details.line++;
265
+ details.column = 1;
266
+ }
267
+ else {
268
+ details.column++;
269
+ }
270
+ p++;
271
+ }
272
+ peg$posDetailsCache[pos] = details;
273
+ return details;
274
+ }
275
+ }
276
+ function peg$computeLocation(startPos, endPos, offset) {
277
+ var startPosDetails = peg$computePosDetails(startPos);
278
+ var endPosDetails = peg$computePosDetails(endPos);
279
+ var res = {
280
+ source: peg$source,
281
+ start: {
282
+ offset: startPos,
283
+ line: startPosDetails.line,
284
+ column: startPosDetails.column
285
+ },
286
+ end: {
287
+ offset: endPos,
288
+ line: endPosDetails.line,
289
+ column: endPosDetails.column
290
+ }
291
+ };
292
+ if (offset && peg$source && (typeof peg$source.offset === "function")) {
293
+ res.start = peg$source.offset(res.start);
294
+ res.end = peg$source.offset(res.end);
295
+ }
296
+ return res;
297
+ }
298
+ function peg$fail(expected) {
299
+ if (peg$currPos < peg$maxFailPos) {
300
+ return;
301
+ }
302
+ if (peg$currPos > peg$maxFailPos) {
303
+ peg$maxFailPos = peg$currPos;
304
+ peg$maxFailExpected = [];
305
+ }
306
+ peg$maxFailExpected.push(expected);
307
+ }
308
+ function peg$buildSimpleError(message, location) {
309
+ return new peg$SyntaxError(message, null, null, location);
310
+ }
311
+ function peg$buildStructuredError(expected, found, location) {
312
+ return new peg$SyntaxError(peg$SyntaxError.buildMessage(expected, found), expected, found, location);
313
+ }
314
+ function peg$parsestringFilter() {
315
+ var s0, s1, s2, s3, s4, s5, s6, s7, s8;
316
+ s0 = peg$currPos;
317
+ s1 = peg$parse_();
318
+ s2 = peg$parsesfUnary();
319
+ if (s2 !== peg$FAILED) {
320
+ s3 = [];
321
+ s4 = peg$currPos;
322
+ s5 = peg$parse_();
323
+ s6 = peg$parseconjunction();
324
+ if (s6 !== peg$FAILED) {
325
+ s7 = peg$parse_();
326
+ s8 = peg$parsesfUnary();
327
+ if (s8 !== peg$FAILED) {
328
+ s5 = [s5, s6, s7, s8];
329
+ s4 = s5;
330
+ }
331
+ else {
332
+ peg$currPos = s4;
333
+ s4 = peg$FAILED;
334
+ }
335
+ }
336
+ else {
337
+ peg$currPos = s4;
338
+ s4 = peg$FAILED;
339
+ }
340
+ while (s4 !== peg$FAILED) {
341
+ s3.push(s4);
342
+ s4 = peg$currPos;
343
+ s5 = peg$parse_();
344
+ s6 = peg$parseconjunction();
345
+ if (s6 !== peg$FAILED) {
346
+ s7 = peg$parse_();
347
+ s8 = peg$parsesfUnary();
348
+ if (s8 !== peg$FAILED) {
349
+ s5 = [s5, s6, s7, s8];
350
+ s4 = s5;
351
+ }
352
+ else {
353
+ peg$currPos = s4;
354
+ s4 = peg$FAILED;
355
+ }
356
+ }
357
+ else {
358
+ peg$currPos = s4;
359
+ s4 = peg$FAILED;
360
+ }
361
+ }
362
+ peg$savedPos = s0;
363
+ s0 = peg$f0(s2, s3);
364
+ }
365
+ else {
366
+ peg$currPos = s0;
367
+ s0 = peg$FAILED;
368
+ }
369
+ return s0;
370
+ }
371
+ function peg$parsesfUnary() {
372
+ var s0, s1, s2, s3;
373
+ s0 = peg$currPos;
374
+ if (input.charCodeAt(peg$currPos) === 45) {
375
+ s1 = peg$c0;
376
+ peg$currPos++;
377
+ }
378
+ else {
379
+ s1 = peg$FAILED;
380
+ if (peg$silentFails === 0) {
381
+ peg$fail(peg$e0);
382
+ }
383
+ }
384
+ if (s1 !== peg$FAILED) {
385
+ s2 = peg$parse_();
386
+ s3 = peg$parseclause();
387
+ if (s3 !== peg$FAILED) {
388
+ peg$savedPos = s0;
389
+ s0 = peg$f1(s3);
390
+ }
391
+ else {
392
+ peg$currPos = s0;
393
+ s0 = peg$FAILED;
394
+ }
395
+ }
396
+ else {
397
+ peg$currPos = s0;
398
+ s0 = peg$FAILED;
399
+ }
400
+ if (s0 === peg$FAILED) {
401
+ s0 = peg$currPos;
402
+ s1 = peg$parseclause();
403
+ if (s1 !== peg$FAILED) {
404
+ peg$savedPos = s0;
405
+ s1 = peg$f2(s1);
406
+ }
407
+ s0 = s1;
408
+ }
409
+ return s0;
410
+ }
411
+ function peg$parseclause() {
412
+ var s0, s1, s2, s3, s4, s5;
413
+ s0 = peg$currPos;
414
+ if (input.charCodeAt(peg$currPos) === 40) {
415
+ s1 = peg$c1;
416
+ peg$currPos++;
417
+ }
418
+ else {
419
+ s1 = peg$FAILED;
420
+ if (peg$silentFails === 0) {
421
+ peg$fail(peg$e1);
422
+ }
423
+ }
424
+ if (s1 !== peg$FAILED) {
425
+ s2 = peg$parse_();
426
+ s3 = peg$parsestringFilter();
427
+ if (s3 !== peg$FAILED) {
428
+ s4 = peg$parse_();
429
+ if (input.charCodeAt(peg$currPos) === 41) {
430
+ s5 = peg$c2;
431
+ peg$currPos++;
432
+ }
433
+ else {
434
+ s5 = peg$FAILED;
435
+ if (peg$silentFails === 0) {
436
+ peg$fail(peg$e2);
437
+ }
438
+ }
439
+ if (s5 !== peg$FAILED) {
440
+ peg$savedPos = s0;
441
+ s0 = peg$f3(s3);
442
+ }
443
+ else {
444
+ peg$currPos = s0;
445
+ s0 = peg$FAILED;
446
+ }
447
+ }
448
+ else {
449
+ peg$currPos = s0;
450
+ s0 = peg$FAILED;
451
+ }
452
+ }
453
+ else {
454
+ peg$currPos = s0;
455
+ s0 = peg$FAILED;
456
+ }
457
+ if (s0 === peg$FAILED) {
458
+ s0 = peg$currPos;
459
+ s1 = peg$parsematchStr();
460
+ if (s1 !== peg$FAILED) {
461
+ peg$savedPos = s0;
462
+ s1 = peg$f4(s1);
463
+ }
464
+ s0 = s1;
465
+ }
466
+ return s0;
467
+ }
468
+ function peg$parsematchStr() {
469
+ var s0, s1, s2, s3, s4, s5;
470
+ peg$silentFails++;
471
+ s0 = peg$currPos;
472
+ s1 = peg$currPos;
473
+ s2 = [];
474
+ s3 = peg$currPos;
475
+ if (input.charCodeAt(peg$currPos) === 92) {
476
+ s4 = peg$c3;
477
+ peg$currPos++;
478
+ }
479
+ else {
480
+ s4 = peg$FAILED;
481
+ if (peg$silentFails === 0) {
482
+ peg$fail(peg$e4);
483
+ }
484
+ }
485
+ if (s4 !== peg$FAILED) {
486
+ if (input.length > peg$currPos) {
487
+ s5 = input.charAt(peg$currPos);
488
+ peg$currPos++;
489
+ }
490
+ else {
491
+ s5 = peg$FAILED;
492
+ if (peg$silentFails === 0) {
493
+ peg$fail(peg$e5);
494
+ }
495
+ }
496
+ if (s5 !== peg$FAILED) {
497
+ s4 = [s4, s5];
498
+ s3 = s4;
499
+ }
500
+ else {
501
+ peg$currPos = s3;
502
+ s3 = peg$FAILED;
503
+ }
504
+ }
505
+ else {
506
+ peg$currPos = s3;
507
+ s3 = peg$FAILED;
508
+ }
509
+ if (s3 === peg$FAILED) {
510
+ s3 = input.charAt(peg$currPos);
511
+ if (peg$r0.test(s3)) {
512
+ peg$currPos++;
513
+ }
514
+ else {
515
+ s3 = peg$FAILED;
516
+ if (peg$silentFails === 0) {
517
+ peg$fail(peg$e6);
518
+ }
519
+ }
520
+ }
521
+ if (s3 !== peg$FAILED) {
522
+ while (s3 !== peg$FAILED) {
523
+ s2.push(s3);
524
+ s3 = peg$currPos;
525
+ if (input.charCodeAt(peg$currPos) === 92) {
526
+ s4 = peg$c3;
527
+ peg$currPos++;
528
+ }
529
+ else {
530
+ s4 = peg$FAILED;
531
+ if (peg$silentFails === 0) {
532
+ peg$fail(peg$e4);
533
+ }
534
+ }
535
+ if (s4 !== peg$FAILED) {
536
+ if (input.length > peg$currPos) {
537
+ s5 = input.charAt(peg$currPos);
538
+ peg$currPos++;
539
+ }
540
+ else {
541
+ s5 = peg$FAILED;
542
+ if (peg$silentFails === 0) {
543
+ peg$fail(peg$e5);
544
+ }
545
+ }
546
+ if (s5 !== peg$FAILED) {
547
+ s4 = [s4, s5];
548
+ s3 = s4;
549
+ }
550
+ else {
551
+ peg$currPos = s3;
552
+ s3 = peg$FAILED;
553
+ }
554
+ }
555
+ else {
556
+ peg$currPos = s3;
557
+ s3 = peg$FAILED;
558
+ }
559
+ if (s3 === peg$FAILED) {
560
+ s3 = input.charAt(peg$currPos);
561
+ if (peg$r0.test(s3)) {
562
+ peg$currPos++;
563
+ }
564
+ else {
565
+ s3 = peg$FAILED;
566
+ if (peg$silentFails === 0) {
567
+ peg$fail(peg$e6);
568
+ }
569
+ }
570
+ }
571
+ }
572
+ }
573
+ else {
574
+ s2 = peg$FAILED;
575
+ }
576
+ if (s2 !== peg$FAILED) {
577
+ s1 = input.substring(s1, peg$currPos);
578
+ }
579
+ else {
580
+ s1 = s2;
581
+ }
582
+ if (s1 !== peg$FAILED) {
583
+ peg$savedPos = s0;
584
+ s1 = peg$f5(s1);
585
+ }
586
+ s0 = s1;
587
+ peg$silentFails--;
588
+ if (s0 === peg$FAILED) {
589
+ s1 = peg$FAILED;
590
+ if (peg$silentFails === 0) {
591
+ peg$fail(peg$e3);
592
+ }
593
+ }
594
+ return s0;
595
+ }
596
+ function peg$parseconjunction() {
597
+ var s0, s1;
598
+ s0 = peg$currPos;
599
+ if (input.charCodeAt(peg$currPos) === 44) {
600
+ s1 = peg$c4;
601
+ peg$currPos++;
602
+ }
603
+ else {
604
+ s1 = peg$FAILED;
605
+ if (peg$silentFails === 0) {
606
+ peg$fail(peg$e7);
607
+ }
608
+ }
609
+ if (s1 !== peg$FAILED) {
610
+ peg$savedPos = s0;
611
+ s1 = peg$f6();
612
+ }
613
+ s0 = s1;
614
+ if (s0 === peg$FAILED) {
615
+ s0 = peg$currPos;
616
+ if (input.charCodeAt(peg$currPos) === 59) {
617
+ s1 = peg$c5;
618
+ peg$currPos++;
619
+ }
620
+ else {
621
+ s1 = peg$FAILED;
622
+ if (peg$silentFails === 0) {
623
+ peg$fail(peg$e8);
624
+ }
625
+ }
626
+ if (s1 !== peg$FAILED) {
627
+ peg$savedPos = s0;
628
+ s1 = peg$f7();
629
+ }
630
+ s0 = s1;
631
+ if (s0 === peg$FAILED) {
632
+ s0 = peg$currPos;
633
+ if (input.charCodeAt(peg$currPos) === 124) {
634
+ s1 = peg$c6;
635
+ peg$currPos++;
636
+ }
637
+ else {
638
+ s1 = peg$FAILED;
639
+ if (peg$silentFails === 0) {
640
+ peg$fail(peg$e9);
641
+ }
642
+ }
643
+ if (s1 !== peg$FAILED) {
644
+ peg$savedPos = s0;
645
+ s1 = peg$f8();
646
+ }
647
+ s0 = s1;
648
+ }
649
+ }
650
+ return s0;
651
+ }
652
+ function peg$parse_() {
653
+ var s0, s1;
654
+ peg$silentFails++;
655
+ s0 = [];
656
+ s1 = input.charAt(peg$currPos);
657
+ if (peg$r1.test(s1)) {
658
+ peg$currPos++;
659
+ }
660
+ else {
661
+ s1 = peg$FAILED;
662
+ if (peg$silentFails === 0) {
663
+ peg$fail(peg$e11);
664
+ }
665
+ }
666
+ while (s1 !== peg$FAILED) {
667
+ s0.push(s1);
668
+ s1 = input.charAt(peg$currPos);
669
+ if (peg$r1.test(s1)) {
670
+ peg$currPos++;
671
+ }
672
+ else {
673
+ s1 = peg$FAILED;
674
+ if (peg$silentFails === 0) {
675
+ peg$fail(peg$e11);
676
+ }
677
+ }
678
+ }
679
+ peg$silentFails--;
680
+ s1 = peg$FAILED;
681
+ if (peg$silentFails === 0) {
682
+ peg$fail(peg$e10);
683
+ }
684
+ return s0;
685
+ }
686
+ peg$result = peg$startRuleFunction();
687
+ if (options.peg$library) {
688
+ return /** @type {any} */ ({
689
+ peg$result,
690
+ peg$currPos,
691
+ peg$FAILED,
692
+ peg$maxFailExpected,
693
+ peg$maxFailPos
694
+ });
695
+ }
696
+ if (peg$result !== peg$FAILED && peg$currPos === input.length) {
697
+ return peg$result;
698
+ }
699
+ else {
700
+ if (peg$result !== peg$FAILED && peg$currPos < input.length) {
701
+ peg$fail(peg$endExpectation());
702
+ }
703
+ throw peg$buildStructuredError(peg$maxFailExpected, peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, peg$maxFailPos < input.length
704
+ ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)
705
+ : peg$computeLocation(peg$maxFailPos, peg$maxFailPos));
706
+ }
707
+ }
708
+ module.exports = {
709
+ StartRules: ["stringFilter"],
710
+ SyntaxError: peg$SyntaxError,
711
+ parse: peg$parse
52
712
  };
53
- exports.default = grammar;
54
713
  //# sourceMappingURL=fexpr_string_parser.js.map