@weborigami/language 0.5.0 → 0.5.2-test.1

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.
@@ -1,4 +1,4 @@
1
- // @generated by Peggy 4.0.3.
1
+ // @generated by Peggy 5.0.6.
2
2
  //
3
3
  // https://peggyjs.org/
4
4
 
@@ -36,769 +36,896 @@ import {
36
36
  import isOrigamiFrontMatter from "./isOrigamiFrontMatter.js";
37
37
 
38
38
 
39
- function peg$subclass(child, parent) {
40
- function C() { this.constructor = child; }
41
- C.prototype = parent.prototype;
42
- child.prototype = new C();
43
- }
44
-
45
- function peg$SyntaxError(message, expected, found, location) {
46
- var self = Error.call(this, message);
47
- // istanbul ignore next Check is a necessary evil to support older environments
48
- if (Object.setPrototypeOf) {
49
- Object.setPrototypeOf(self, peg$SyntaxError.prototype);
50
- }
51
- self.expected = expected;
52
- self.found = found;
53
- self.location = location;
54
- self.name = "SyntaxError";
55
- return self;
56
- }
57
-
58
- peg$subclass(peg$SyntaxError, Error);
59
-
60
- function peg$padEnd(str, targetLength, padString) {
61
- padString = padString || " ";
62
- if (str.length > targetLength) { return str; }
63
- targetLength -= str.length;
64
- padString += padString.repeat(targetLength);
65
- return str + padString.slice(0, targetLength);
66
- }
67
-
68
- peg$SyntaxError.prototype.format = function(sources) {
69
- var str = "Error: " + this.message;
70
- if (this.location) {
71
- var src = null;
72
- var k;
73
- for (k = 0; k < sources.length; k++) {
74
- if (sources[k].source === this.location.source) {
75
- src = sources[k].text.split(/\r\n|\n|\r/g);
76
- break;
77
- }
78
- }
79
- var s = this.location.start;
80
- var offset_s = (this.location.source && (typeof this.location.source.offset === "function"))
81
- ? this.location.source.offset(s)
82
- : s;
83
- var loc = this.location.source + ":" + offset_s.line + ":" + offset_s.column;
84
- if (src) {
85
- var e = this.location.end;
86
- var filler = peg$padEnd("", offset_s.line.toString().length, ' ');
87
- var line = src[s.line - 1];
88
- var last = s.line === e.line ? e.column : line.length + 1;
89
- var hatLen = (last - s.column) || 1;
90
- str += "\n --> " + loc + "\n"
91
- + filler + " |\n"
92
- + offset_s.line + " | " + line + "\n"
93
- + filler + " | " + peg$padEnd("", s.column - 1, ' ')
94
- + peg$padEnd("", hatLen, "^");
95
- } else {
96
- str += "\n at " + loc;
97
- }
98
- }
99
- return str;
100
- };
39
+ class peg$SyntaxError extends SyntaxError {
40
+ constructor(message, expected, found, location) {
41
+ super(message);
42
+ this.expected = expected;
43
+ this.found = found;
44
+ this.location = location;
45
+ this.name = "SyntaxError";
46
+ }
47
+
48
+ format(sources) {
49
+ let str = "Error: " + this.message;
50
+ if (this.location) {
51
+ let src = null;
52
+ const st = sources.find(s => s.source === this.location.source);
53
+ if (st) {
54
+ src = st.text.split(/\r\n|\n|\r/g);
55
+ }
56
+ const s = this.location.start;
57
+ const offset_s = (this.location.source && (typeof this.location.source.offset === "function"))
58
+ ? this.location.source.offset(s)
59
+ : s;
60
+ const loc = this.location.source + ":" + offset_s.line + ":" + offset_s.column;
61
+ if (src) {
62
+ const e = this.location.end;
63
+ const filler = "".padEnd(offset_s.line.toString().length, " ");
64
+ const line = src[s.line - 1];
65
+ const last = s.line === e.line ? e.column : line.length + 1;
66
+ const hatLen = (last - s.column) || 1;
67
+ str += "\n --> " + loc + "\n"
68
+ + filler + " |\n"
69
+ + offset_s.line + " | " + line + "\n"
70
+ + filler + " | " + "".padEnd(s.column - 1, " ")
71
+ + "".padEnd(hatLen, "^");
72
+ } else {
73
+ str += "\n at " + loc;
74
+ }
75
+ }
76
+ return str;
77
+ }
78
+
79
+ static buildMessage(expected, found) {
80
+ function hex(ch) {
81
+ return ch.codePointAt(0).toString(16).toUpperCase();
82
+ }
83
+
84
+ const nonPrintable = Object.prototype.hasOwnProperty.call(RegExp.prototype, "unicode")
85
+ ? new RegExp("[\\p{C}\\p{Mn}\\p{Mc}]", "gu")
86
+ : null;
87
+ function unicodeEscape(s) {
88
+ if (nonPrintable) {
89
+ return s.replace(nonPrintable, ch => "\\u{" + hex(ch) + "}");
90
+ }
91
+ return s;
92
+ }
93
+
94
+ function literalEscape(s) {
95
+ return unicodeEscape(s
96
+ .replace(/\\/g, "\\\\")
97
+ .replace(/"/g, "\\\"")
98
+ .replace(/\0/g, "\\0")
99
+ .replace(/\t/g, "\\t")
100
+ .replace(/\n/g, "\\n")
101
+ .replace(/\r/g, "\\r")
102
+ .replace(/[\x00-\x0F]/g, ch => "\\x0" + hex(ch))
103
+ .replace(/[\x10-\x1F\x7F-\x9F]/g, ch => "\\x" + hex(ch)));
104
+ }
105
+
106
+ function classEscape(s) {
107
+ return unicodeEscape(s
108
+ .replace(/\\/g, "\\\\")
109
+ .replace(/\]/g, "\\]")
110
+ .replace(/\^/g, "\\^")
111
+ .replace(/-/g, "\\-")
112
+ .replace(/\0/g, "\\0")
113
+ .replace(/\t/g, "\\t")
114
+ .replace(/\n/g, "\\n")
115
+ .replace(/\r/g, "\\r")
116
+ .replace(/[\x00-\x0F]/g, ch => "\\x0" + hex(ch))
117
+ .replace(/[\x10-\x1F\x7F-\x9F]/g, ch => "\\x" + hex(ch)));
118
+ }
119
+
120
+ const DESCRIBE_EXPECTATION_FNS = {
121
+ literal(expectation) {
122
+ return "\"" + literalEscape(expectation.text) + "\"";
123
+ },
101
124
 
102
- peg$SyntaxError.buildMessage = function(expected, found) {
103
- var DESCRIBE_EXPECTATION_FNS = {
104
- literal: function(expectation) {
105
- return "\"" + literalEscape(expectation.text) + "\"";
106
- },
125
+ class(expectation) {
126
+ const escapedParts = expectation.parts.map(
127
+ part => (Array.isArray(part)
128
+ ? classEscape(part[0]) + "-" + classEscape(part[1])
129
+ : classEscape(part))
130
+ );
107
131
 
108
- class: function(expectation) {
109
- var escapedParts = expectation.parts.map(function(part) {
110
- return Array.isArray(part)
111
- ? classEscape(part[0]) + "-" + classEscape(part[1])
112
- : classEscape(part);
113
- });
132
+ return "[" + (expectation.inverted ? "^" : "") + escapedParts.join("") + "]" + (expectation.unicode ? "u" : "");
133
+ },
114
134
 
115
- return "[" + (expectation.inverted ? "^" : "") + escapedParts.join("") + "]";
116
- },
135
+ any() {
136
+ return "any character";
137
+ },
117
138
 
118
- any: function() {
119
- return "any character";
120
- },
139
+ end() {
140
+ return "end of input";
141
+ },
121
142
 
122
- end: function() {
123
- return "end of input";
124
- },
143
+ other(expectation) {
144
+ return expectation.description;
145
+ },
146
+ };
125
147
 
126
- other: function(expectation) {
127
- return expectation.description;
148
+ function describeExpectation(expectation) {
149
+ return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
128
150
  }
129
- };
130
-
131
- function hex(ch) {
132
- return ch.charCodeAt(0).toString(16).toUpperCase();
133
- }
134
-
135
- function literalEscape(s) {
136
- return s
137
- .replace(/\\/g, "\\\\")
138
- .replace(/"/g, "\\\"")
139
- .replace(/\0/g, "\\0")
140
- .replace(/\t/g, "\\t")
141
- .replace(/\n/g, "\\n")
142
- .replace(/\r/g, "\\r")
143
- .replace(/[\x00-\x0F]/g, function(ch) { return "\\x0" + hex(ch); })
144
- .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return "\\x" + hex(ch); });
145
- }
146
151
 
147
- function classEscape(s) {
148
- return s
149
- .replace(/\\/g, "\\\\")
150
- .replace(/\]/g, "\\]")
151
- .replace(/\^/g, "\\^")
152
- .replace(/-/g, "\\-")
153
- .replace(/\0/g, "\\0")
154
- .replace(/\t/g, "\\t")
155
- .replace(/\n/g, "\\n")
156
- .replace(/\r/g, "\\r")
157
- .replace(/[\x00-\x0F]/g, function(ch) { return "\\x0" + hex(ch); })
158
- .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return "\\x" + hex(ch); });
159
- }
152
+ function describeExpected(expected) {
153
+ const descriptions = expected.map(describeExpectation);
154
+ descriptions.sort();
160
155
 
161
- function describeExpectation(expectation) {
162
- return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
163
- }
156
+ if (descriptions.length > 0) {
157
+ let j = 1;
158
+ for (let i = 1; i < descriptions.length; i++) {
159
+ if (descriptions[i - 1] !== descriptions[i]) {
160
+ descriptions[j] = descriptions[i];
161
+ j++;
162
+ }
163
+ }
164
+ descriptions.length = j;
165
+ }
164
166
 
165
- function describeExpected(expected) {
166
- var descriptions = expected.map(describeExpectation);
167
- var i, j;
167
+ switch (descriptions.length) {
168
+ case 1:
169
+ return descriptions[0];
168
170
 
169
- descriptions.sort();
171
+ case 2:
172
+ return descriptions[0] + " or " + descriptions[1];
170
173
 
171
- if (descriptions.length > 0) {
172
- for (i = 1, j = 1; i < descriptions.length; i++) {
173
- if (descriptions[i - 1] !== descriptions[i]) {
174
- descriptions[j] = descriptions[i];
175
- j++;
176
- }
174
+ default:
175
+ return descriptions.slice(0, -1).join(", ")
176
+ + ", or "
177
+ + descriptions[descriptions.length - 1];
177
178
  }
178
- descriptions.length = j;
179
179
  }
180
180
 
181
- switch (descriptions.length) {
182
- case 1:
183
- return descriptions[0];
184
-
185
- case 2:
186
- return descriptions[0] + " or " + descriptions[1];
187
-
188
- default:
189
- return descriptions.slice(0, -1).join(", ")
190
- + ", or "
191
- + descriptions[descriptions.length - 1];
181
+ function describeFound(found) {
182
+ return found ? "\"" + literalEscape(found) + "\"" : "end of input";
192
183
  }
193
- }
194
184
 
195
- function describeFound(found) {
196
- return found ? "\"" + literalEscape(found) + "\"" : "end of input";
185
+ return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";
197
186
  }
198
-
199
- return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";
200
- };
187
+ }
201
188
 
202
189
  function peg$parse(input, options) {
203
190
  options = options !== undefined ? options : {};
204
191
 
205
- var peg$FAILED = {};
206
- var peg$source = options.grammarSource;
207
-
208
- var peg$startRuleFunctions = { __: peg$parse__, additiveExpression: peg$parseadditiveExpression, additiveOperator: peg$parseadditiveOperator, angleBracketLiteral: peg$parseangleBracketLiteral, angleBracketPath: peg$parseangleBracketPath, angleBracketKey: peg$parseangleBracketKey, angleBracketPathChar: peg$parseangleBracketPathChar, arguments: peg$parsearguments, arrayLiteral: peg$parsearrayLiteral, arrayEntries: peg$parsearrayEntries, arrayEntry: peg$parsearrayEntry, arrowFunction: peg$parsearrowFunction, bitwiseAndExpression: peg$parsebitwiseAndExpression, bitwiseAndOperator: peg$parsebitwiseAndOperator, bitwiseOrExpression: peg$parsebitwiseOrExpression, bitwiseOrOperator: peg$parsebitwiseOrOperator, bitwiseXorExpression: peg$parsebitwiseXorExpression, bitwiseXorOperator: peg$parsebitwiseXorOperator, callExpression: peg$parsecallExpression, commaExpression: peg$parsecommaExpression, comment: peg$parsecomment, computedPropertyAccess: peg$parsecomputedPropertyAccess, computedPropertySpace: peg$parsecomputedPropertySpace, conditionalExpression: peg$parseconditionalExpression, digits: peg$parsedigits, doubleArrow: peg$parsedoubleArrow, doubleQuoteString: peg$parsedoubleQuoteString, doubleQuoteStringChar: peg$parsedoubleQuoteStringChar, ellipsis: peg$parseellipsis, equalityExpression: peg$parseequalityExpression, equalityOperator: peg$parseequalityOperator, escapedChar: peg$parseescapedChar, expectBacktick: peg$parseexpectBacktick, expectClosingBrace: peg$parseexpectClosingBrace, expectClosingBracket: peg$parseexpectClosingBracket, expectClosingParenthesis: peg$parseexpectClosingParenthesis, expectDoubleQuote: peg$parseexpectDoubleQuote, expectExpression: peg$parseexpectExpression, expectFrontDelimiter: peg$parseexpectFrontDelimiter, expectGuillemet: peg$parseexpectGuillemet, expectSingleQuote: peg$parseexpectSingleQuote, expectPipelineExpression: peg$parseexpectPipelineExpression, expectUnaryExpression: peg$parseexpectUnaryExpression, exponentiationExpression: peg$parseexponentiationExpression, expression: peg$parseexpression, floatLiteral: peg$parsefloatLiteral, frontDelimiter: peg$parsefrontDelimiter, frontMatterExpression: peg$parsefrontMatterExpression, frontMatterText: peg$parsefrontMatterText, frontMatterYaml: peg$parsefrontMatterYaml, group: peg$parsegroup, guillemetString: peg$parseguillemetString, guillemetStringChar: peg$parseguillemetStringChar, host: peg$parsehost, hostname: peg$parsehostname, identifier: peg$parseidentifier, identifierLiteral: peg$parseidentifierLiteral, identifierPart: peg$parseidentifierPart, identifierStart: peg$parseidentifierStart, implicitParenthesesCallExpression: peg$parseimplicitParenthesesCallExpression, implicitParensthesesArguments: peg$parseimplicitParensthesesArguments, inlineSpace: peg$parseinlineSpace, integerLiteral: peg$parseintegerLiteral, key: peg$parsekey, keyChar: peg$parsekeyChar, keyCharStart: peg$parsekeyCharStart, list: peg$parselist, logicalAndExpression: peg$parselogicalAndExpression, logicalOrExpression: peg$parselogicalOrExpression, minus: peg$parseminus, multiLineComment: peg$parsemultiLineComment, multiplicativeExpression: peg$parsemultiplicativeExpression, multiplicativeOperator: peg$parsemultiplicativeOperator, newExpression: peg$parsenewExpression, newLine: peg$parsenewLine, numericLiteral: peg$parsenumericLiteral, nullishCoalescingExpression: peg$parsenullishCoalescingExpression, objectLiteral: peg$parseobjectLiteral, objectEntries: peg$parseobjectEntries, objectEntry: peg$parseobjectEntry, objectGetter: peg$parseobjectGetter, objectHiddenKey: peg$parseobjectHiddenKey, objectKey: peg$parseobjectKey, objectProperty: peg$parseobjectProperty, objectShorthandProperty: peg$parseobjectShorthandProperty, objectPublicKey: peg$parseobjectPublicKey, optionalChaining: peg$parseoptionalChaining, parameter: peg$parseparameter, parameterList: peg$parseparameterList, parameterSingleton: peg$parseparameterSingleton, parenthesesArguments: peg$parseparenthesesArguments, pathArguments: peg$parsepathArguments, pathKeys: peg$parsepathKeys, pathLiteral: peg$parsepathLiteral, pathSegment: peg$parsepathSegment, pipelineExpression: peg$parsepipelineExpression, primary: peg$parseprimary, program: peg$parseprogram, programMode: peg$parseprogramMode, propertyAccess: peg$parsepropertyAccess, regexFlags: peg$parseregexFlags, regexLiteral: peg$parseregexLiteral, regexLiteralChar: peg$parseregexLiteralChar, relationalExpression: peg$parserelationalExpression, relationalOperator: peg$parserelationalOperator, separator: peg$parseseparator, shebang: peg$parseshebang, shellMode: peg$parseshellMode, shiftExpression: peg$parseshiftExpression, shiftOperator: peg$parseshiftOperator, shorthandFunction: peg$parseshorthandFunction, singleArrow: peg$parsesingleArrow, singleLineComment: peg$parsesingleLineComment, singleQuoteString: peg$parsesingleQuoteString, singleQuoteStringChar: peg$parsesingleQuoteStringChar, slash: peg$parseslash, slashes: peg$parseslashes, slashFollows: peg$parseslashFollows, spreadElement: peg$parsespreadElement, stringLiteral: peg$parsestringLiteral, templateBody: peg$parsetemplateBody, templateBodyChar: peg$parsetemplateBodyChar, templateBodyText: peg$parsetemplateBodyText, templateDocument: peg$parsetemplateDocument, templateLiteral: peg$parsetemplateLiteral, templateLiteralChar: peg$parsetemplateLiteralChar, templateLiteralText: peg$parsetemplateLiteralText, templateSubstitution: peg$parsetemplateSubstitution, textChar: peg$parsetextChar, unaryExpression: peg$parseunaryExpression, uri: peg$parseuri, uriExpression: peg$parseuriExpression, uriKey: peg$parseuriKey, uriKeyChar: peg$parseuriKeyChar, uriPath: peg$parseuriPath, uriScheme: peg$parseuriScheme, unaryOperator: peg$parseunaryOperator, whitespace: peg$parsewhitespace, whitespaceChar: peg$parsewhitespaceChar, whitespaceOptionalForProgram: peg$parsewhitespaceOptionalForProgram, whitespaceWithNewLine: peg$parsewhitespaceWithNewLine };
209
- var peg$startRuleFunction = peg$parse__;
210
-
211
- var peg$c0 = "+";
212
- var peg$c1 = "<";
213
- var peg$c2 = "//";
214
- var peg$c3 = ">";
215
- var peg$c4 = "</";
216
- var peg$c5 = "/";
217
- var peg$c6 = "[";
218
- var peg$c7 = "]";
219
- var peg$c8 = "(";
220
- var peg$c9 = ")";
221
- var peg$c10 = "&";
222
- var peg$c11 = "|";
223
- var peg$c12 = "^";
224
- var peg$c13 = ",";
225
- var peg$c14 = "?";
226
- var peg$c15 = ":";
227
- var peg$c16 = "\u21D2";
228
- var peg$c17 = "=>";
229
- var peg$c18 = "\"";
230
- var peg$c19 = "...";
231
- var peg$c20 = "\u2026";
232
- var peg$c21 = "===";
233
- var peg$c22 = "!==";
234
- var peg$c23 = "==";
235
- var peg$c24 = "!=";
236
- var peg$c25 = "\\0";
237
- var peg$c26 = "\\b";
238
- var peg$c27 = "\\f";
239
- var peg$c28 = "\\n";
240
- var peg$c29 = "\\r";
241
- var peg$c30 = "\\t";
242
- var peg$c31 = "\\v";
243
- var peg$c32 = "\\";
244
- var peg$c33 = "`";
245
- var peg$c34 = "}";
246
- var peg$c35 = "\xBB";
247
- var peg$c36 = "'";
248
- var peg$c37 = "**";
249
- var peg$c38 = ".";
250
- var peg$c39 = "---\n";
251
- var peg$c40 = "\xAB";
252
- var peg$c41 = "&&";
253
- var peg$c42 = "||";
254
- var peg$c43 = "-";
255
- var peg$c44 = "-\n";
256
- var peg$c45 = "/*";
257
- var peg$c46 = "*/";
258
- var peg$c47 = "new";
259
- var peg$c48 = "new:";
260
- var peg$c49 = "\n";
261
- var peg$c50 = "\r\n";
262
- var peg$c51 = "\r";
263
- var peg$c52 = "??";
264
- var peg$c53 = "{";
265
- var peg$c54 = "=";
266
- var peg$c55 = "?.";
267
- var peg$c56 = "<=";
268
- var peg$c57 = ">=";
269
- var peg$c58 = "#!";
270
- var peg$c59 = "<<";
271
- var peg$c60 = ">>>";
272
- var peg$c61 = ">>";
273
- var peg$c62 = "\u2192";
274
- var peg$c63 = "->";
275
- var peg$c64 = "${";
276
- var peg$c65 = "~";
277
-
278
- var peg$r0 = /^[^\/>\t\n\r]/;
279
- var peg$r1 = /^[0-9]/;
280
- var peg$r2 = /^[ \t]/;
281
- var peg$r3 = /^[!+]/;
282
- var peg$r4 = /^[%-&*\^|]/;
283
- var peg$r5 = /^[.@~]/;
284
- var peg$r6 = /^[%*\/]/;
285
- var peg$r7 = /^[gimuy]/;
286
- var peg$r8 = /^[^\/\n\r]/;
287
- var peg$r9 = /^[^\n\r]/;
288
- var peg$r10 = /^[^\/,)\]}]/;
289
- var peg$r11 = /^[a-z]/;
290
- var peg$r12 = /^[a-z0-9+-.]/;
291
- var peg$r13 = /^[:]/;
292
- var peg$r14 = /^[\/)\]}]/;
293
-
294
- var peg$e0 = peg$literalExpectation("+", false);
295
- var peg$e1 = peg$literalExpectation("<", false);
296
- var peg$e2 = peg$literalExpectation("//", false);
297
- var peg$e3 = peg$literalExpectation(">", false);
298
- var peg$e4 = peg$literalExpectation("</", false);
299
- var peg$e5 = peg$literalExpectation("/", false);
300
- var peg$e6 = peg$classExpectation(["/", ">", "\t", "\n", "\r"], true, false);
301
- var peg$e7 = peg$otherExpectation("function arguments");
302
- var peg$e8 = peg$otherExpectation("array");
303
- var peg$e9 = peg$literalExpectation("[", false);
304
- var peg$e10 = peg$literalExpectation("]", false);
305
- var peg$e11 = peg$literalExpectation("(", false);
306
- var peg$e12 = peg$literalExpectation(")", false);
307
- var peg$e13 = peg$literalExpectation("&", false);
308
- var peg$e14 = peg$literalExpectation("|", false);
309
- var peg$e15 = peg$literalExpectation("^", false);
310
- var peg$e16 = peg$otherExpectation("function call");
311
- var peg$e17 = peg$literalExpectation(",", false);
312
- var peg$e18 = peg$otherExpectation("comment");
313
- var peg$e19 = peg$literalExpectation("?", false);
314
- var peg$e20 = peg$literalExpectation(":", false);
315
- var peg$e21 = peg$classExpectation([["0", "9"]], false, false);
316
- var peg$e22 = peg$literalExpectation("\u21D2", false);
317
- var peg$e23 = peg$literalExpectation("=>", false);
318
- var peg$e24 = peg$otherExpectation("double quote string");
319
- var peg$e25 = peg$literalExpectation("\"", false);
320
- var peg$e26 = peg$literalExpectation("...", false);
321
- var peg$e27 = peg$literalExpectation("\u2026", false);
322
- var peg$e28 = peg$literalExpectation("===", false);
323
- var peg$e29 = peg$literalExpectation("!==", false);
324
- var peg$e30 = peg$literalExpectation("==", false);
325
- var peg$e31 = peg$literalExpectation("!=", false);
326
- var peg$e32 = peg$otherExpectation("backslash-escaped character");
327
- var peg$e33 = peg$literalExpectation("\\0", false);
328
- var peg$e34 = peg$literalExpectation("\\b", false);
329
- var peg$e35 = peg$literalExpectation("\\f", false);
330
- var peg$e36 = peg$literalExpectation("\\n", false);
331
- var peg$e37 = peg$literalExpectation("\\r", false);
332
- var peg$e38 = peg$literalExpectation("\\t", false);
333
- var peg$e39 = peg$literalExpectation("\\v", false);
334
- var peg$e40 = peg$literalExpectation("\\", false);
335
- var peg$e41 = peg$anyExpectation();
336
- var peg$e42 = peg$literalExpectation("`", false);
337
- var peg$e43 = peg$literalExpectation("}", false);
338
- var peg$e44 = peg$literalExpectation("\xBB", false);
339
- var peg$e45 = peg$literalExpectation("'", false);
340
- var peg$e46 = peg$literalExpectation("**", false);
341
- var peg$e47 = peg$otherExpectation("floating-point number");
342
- var peg$e48 = peg$literalExpectation(".", false);
343
- var peg$e49 = peg$literalExpectation("---\n", false);
344
- var peg$e50 = peg$otherExpectation("YAML front matter");
345
- var peg$e51 = peg$otherExpectation("parenthetical group");
346
- var peg$e52 = peg$otherExpectation("guillemet string");
347
- var peg$e53 = peg$literalExpectation("\xAB", false);
348
- var peg$e54 = peg$otherExpectation("HTTP/HTTPS host");
349
- var peg$e55 = peg$otherExpectation("JavaScript identifier continuation");
350
- var peg$e56 = peg$otherExpectation("JavaScript identifier start");
351
- var peg$e57 = peg$otherExpectation("function call with implicit parentheses");
352
- var peg$e58 = peg$classExpectation([" ", "\t"], false, false);
353
- var peg$e59 = peg$otherExpectation("integer");
354
- var peg$e60 = peg$classExpectation(["!", "+"], false, false);
355
- var peg$e61 = peg$classExpectation([["%", "&"], "*", "^", "|"], false, false);
356
- var peg$e62 = peg$classExpectation([".", "@", "~"], false, false);
357
- var peg$e63 = peg$otherExpectation("list");
358
- var peg$e64 = peg$literalExpectation("&&", false);
359
- var peg$e65 = peg$literalExpectation("||", false);
360
- var peg$e66 = peg$literalExpectation("-", false);
361
- var peg$e67 = peg$literalExpectation("-\n", false);
362
- var peg$e68 = peg$literalExpectation("/*", false);
363
- var peg$e69 = peg$literalExpectation("*/", false);
364
- var peg$e70 = peg$classExpectation(["%", "*", "/"], false, false);
365
- var peg$e71 = peg$literalExpectation("new", false);
366
- var peg$e72 = peg$literalExpectation("new:", false);
367
- var peg$e73 = peg$literalExpectation("\n", false);
368
- var peg$e74 = peg$literalExpectation("\r\n", false);
369
- var peg$e75 = peg$literalExpectation("\r", false);
370
- var peg$e76 = peg$otherExpectation("number");
371
- var peg$e77 = peg$literalExpectation("??", false);
372
- var peg$e78 = peg$otherExpectation("object literal");
373
- var peg$e79 = peg$literalExpectation("{", false);
374
- var peg$e80 = peg$otherExpectation("object getter");
375
- var peg$e81 = peg$literalExpectation("=", false);
376
- var peg$e82 = peg$otherExpectation("object key");
377
- var peg$e83 = peg$otherExpectation("object property");
378
- var peg$e84 = peg$otherExpectation("object identifier");
379
- var peg$e85 = peg$literalExpectation("?.", false);
380
- var peg$e86 = peg$otherExpectation("function arguments in parentheses");
381
- var peg$e87 = peg$otherExpectation("Origami program");
382
- var peg$e88 = peg$classExpectation(["g", "i", "m", "u", "y"], false, false);
383
- var peg$e89 = peg$classExpectation(["/", "\n", "\r"], true, false);
384
- var peg$e90 = peg$literalExpectation("<=", false);
385
- var peg$e91 = peg$literalExpectation(">=", false);
386
- var peg$e92 = peg$literalExpectation("#!", false);
387
- var peg$e93 = peg$classExpectation(["\n", "\r"], true, false);
388
- var peg$e94 = peg$literalExpectation("<<", false);
389
- var peg$e95 = peg$literalExpectation(">>>", false);
390
- var peg$e96 = peg$literalExpectation(">>", false);
391
- var peg$e97 = peg$otherExpectation("lambda function");
392
- var peg$e98 = peg$literalExpectation("\u2192", false);
393
- var peg$e99 = peg$literalExpectation("->", false);
394
- var peg$e100 = peg$otherExpectation("single quote string");
395
- var peg$e101 = peg$otherExpectation("string");
396
- var peg$e102 = peg$otherExpectation("template");
397
- var peg$e103 = peg$literalExpectation("${", false);
398
- var peg$e104 = peg$otherExpectation("template text");
399
- var peg$e105 = peg$otherExpectation("template document");
400
- var peg$e106 = peg$otherExpectation("template literal");
401
- var peg$e107 = peg$otherExpectation("template substitution");
402
- var peg$e108 = peg$classExpectation(["/", ",", ")", "]", "}"], true, false);
403
- var peg$e109 = peg$otherExpectation("slash-separated path");
404
- var peg$e110 = peg$classExpectation([["a", "z"]], false, false);
405
- var peg$e111 = peg$classExpectation([["a", "z"], ["0", "9"], ["+", "."]], false, false);
406
- var peg$e112 = peg$classExpectation([":"], false, false);
407
- var peg$e113 = peg$literalExpectation("~", false);
408
- var peg$e114 = peg$classExpectation(["/", ")", "]", "}"], false, false);
409
-
410
- var peg$f0 = function() {
411
- return null;
192
+ const peg$FAILED = {};
193
+ const peg$source = options.grammarSource;
194
+
195
+ const peg$startRuleFunctions = {
196
+ __: peg$parse__,
197
+ additiveExpression: peg$parseadditiveExpression,
198
+ additiveOperator: peg$parseadditiveOperator,
199
+ angleBracketLiteral: peg$parseangleBracketLiteral,
200
+ angleBracketPath: peg$parseangleBracketPath,
201
+ angleBracketKey: peg$parseangleBracketKey,
202
+ angleBracketPathChar: peg$parseangleBracketPathChar,
203
+ arguments: peg$parsearguments,
204
+ arrayLiteral: peg$parsearrayLiteral,
205
+ arrayEntries: peg$parsearrayEntries,
206
+ arrayEntry: peg$parsearrayEntry,
207
+ arrowFunction: peg$parsearrowFunction,
208
+ bitwiseAndExpression: peg$parsebitwiseAndExpression,
209
+ bitwiseAndOperator: peg$parsebitwiseAndOperator,
210
+ bitwiseOrExpression: peg$parsebitwiseOrExpression,
211
+ bitwiseOrOperator: peg$parsebitwiseOrOperator,
212
+ bitwiseXorExpression: peg$parsebitwiseXorExpression,
213
+ bitwiseXorOperator: peg$parsebitwiseXorOperator,
214
+ callExpression: peg$parsecallExpression,
215
+ commaExpression: peg$parsecommaExpression,
216
+ comment: peg$parsecomment,
217
+ computedPropertyAccess: peg$parsecomputedPropertyAccess,
218
+ computedPropertySpace: peg$parsecomputedPropertySpace,
219
+ conditionalExpression: peg$parseconditionalExpression,
220
+ digits: peg$parsedigits,
221
+ doubleArrow: peg$parsedoubleArrow,
222
+ doubleQuoteString: peg$parsedoubleQuoteString,
223
+ doubleQuoteStringChar: peg$parsedoubleQuoteStringChar,
224
+ ellipsis: peg$parseellipsis,
225
+ equalityExpression: peg$parseequalityExpression,
226
+ equalityOperator: peg$parseequalityOperator,
227
+ escapedChar: peg$parseescapedChar,
228
+ expectBacktick: peg$parseexpectBacktick,
229
+ expectClosingBrace: peg$parseexpectClosingBrace,
230
+ expectClosingBracket: peg$parseexpectClosingBracket,
231
+ expectClosingParenthesis: peg$parseexpectClosingParenthesis,
232
+ expectDoubleQuote: peg$parseexpectDoubleQuote,
233
+ expectExpression: peg$parseexpectExpression,
234
+ expectFrontDelimiter: peg$parseexpectFrontDelimiter,
235
+ expectGuillemet: peg$parseexpectGuillemet,
236
+ expectSingleQuote: peg$parseexpectSingleQuote,
237
+ expectPipelineExpression: peg$parseexpectPipelineExpression,
238
+ expectUnaryExpression: peg$parseexpectUnaryExpression,
239
+ exponentiationExpression: peg$parseexponentiationExpression,
240
+ expression: peg$parseexpression,
241
+ floatLiteral: peg$parsefloatLiteral,
242
+ frontDelimiter: peg$parsefrontDelimiter,
243
+ frontMatterExpression: peg$parsefrontMatterExpression,
244
+ frontMatterText: peg$parsefrontMatterText,
245
+ frontMatterYaml: peg$parsefrontMatterYaml,
246
+ group: peg$parsegroup,
247
+ guillemetString: peg$parseguillemetString,
248
+ guillemetStringChar: peg$parseguillemetStringChar,
249
+ host: peg$parsehost,
250
+ hostname: peg$parsehostname,
251
+ identifier: peg$parseidentifier,
252
+ identifierLiteral: peg$parseidentifierLiteral,
253
+ identifierPart: peg$parseidentifierPart,
254
+ identifierStart: peg$parseidentifierStart,
255
+ implicitParenthesesCallExpression: peg$parseimplicitParenthesesCallExpression,
256
+ implicitParensthesesArguments: peg$parseimplicitParensthesesArguments,
257
+ inlineSpace: peg$parseinlineSpace,
258
+ integerLiteral: peg$parseintegerLiteral,
259
+ key: peg$parsekey,
260
+ keyChar: peg$parsekeyChar,
261
+ keyCharStart: peg$parsekeyCharStart,
262
+ list: peg$parselist,
263
+ logicalAndExpression: peg$parselogicalAndExpression,
264
+ logicalOrExpression: peg$parselogicalOrExpression,
265
+ minus: peg$parseminus,
266
+ multiLineComment: peg$parsemultiLineComment,
267
+ multiplicativeExpression: peg$parsemultiplicativeExpression,
268
+ multiplicativeOperator: peg$parsemultiplicativeOperator,
269
+ newExpression: peg$parsenewExpression,
270
+ newLine: peg$parsenewLine,
271
+ numericLiteral: peg$parsenumericLiteral,
272
+ nullishCoalescingExpression: peg$parsenullishCoalescingExpression,
273
+ objectLiteral: peg$parseobjectLiteral,
274
+ objectEntries: peg$parseobjectEntries,
275
+ objectEntry: peg$parseobjectEntry,
276
+ objectGetter: peg$parseobjectGetter,
277
+ objectHiddenKey: peg$parseobjectHiddenKey,
278
+ objectKey: peg$parseobjectKey,
279
+ objectProperty: peg$parseobjectProperty,
280
+ objectShorthandProperty: peg$parseobjectShorthandProperty,
281
+ objectPublicKey: peg$parseobjectPublicKey,
282
+ optionalChaining: peg$parseoptionalChaining,
283
+ parameter: peg$parseparameter,
284
+ parameterList: peg$parseparameterList,
285
+ parameterSingleton: peg$parseparameterSingleton,
286
+ parenthesesArguments: peg$parseparenthesesArguments,
287
+ pathArguments: peg$parsepathArguments,
288
+ pathKeys: peg$parsepathKeys,
289
+ pathLiteral: peg$parsepathLiteral,
290
+ pathSegment: peg$parsepathSegment,
291
+ pipelineExpression: peg$parsepipelineExpression,
292
+ primary: peg$parseprimary,
293
+ program: peg$parseprogram,
294
+ programMode: peg$parseprogramMode,
295
+ propertyAccess: peg$parsepropertyAccess,
296
+ regexFlags: peg$parseregexFlags,
297
+ regexLiteral: peg$parseregexLiteral,
298
+ regexLiteralChar: peg$parseregexLiteralChar,
299
+ relationalExpression: peg$parserelationalExpression,
300
+ relationalOperator: peg$parserelationalOperator,
301
+ separator: peg$parseseparator,
302
+ shebang: peg$parseshebang,
303
+ shellMode: peg$parseshellMode,
304
+ shiftExpression: peg$parseshiftExpression,
305
+ shiftOperator: peg$parseshiftOperator,
306
+ shorthandFunction: peg$parseshorthandFunction,
307
+ singleArrow: peg$parsesingleArrow,
308
+ singleLineComment: peg$parsesingleLineComment,
309
+ singleQuoteString: peg$parsesingleQuoteString,
310
+ singleQuoteStringChar: peg$parsesingleQuoteStringChar,
311
+ slash: peg$parseslash,
312
+ slashes: peg$parseslashes,
313
+ slashFollows: peg$parseslashFollows,
314
+ spreadElement: peg$parsespreadElement,
315
+ stringLiteral: peg$parsestringLiteral,
316
+ templateBody: peg$parsetemplateBody,
317
+ templateBodyChar: peg$parsetemplateBodyChar,
318
+ templateBodyText: peg$parsetemplateBodyText,
319
+ templateDocument: peg$parsetemplateDocument,
320
+ templateLiteral: peg$parsetemplateLiteral,
321
+ templateLiteralChar: peg$parsetemplateLiteralChar,
322
+ templateLiteralText: peg$parsetemplateLiteralText,
323
+ templateSubstitution: peg$parsetemplateSubstitution,
324
+ textChar: peg$parsetextChar,
325
+ unaryExpression: peg$parseunaryExpression,
326
+ uri: peg$parseuri,
327
+ uriExpression: peg$parseuriExpression,
328
+ uriKey: peg$parseuriKey,
329
+ uriKeyChar: peg$parseuriKeyChar,
330
+ uriPath: peg$parseuriPath,
331
+ uriScheme: peg$parseuriScheme,
332
+ unaryOperator: peg$parseunaryOperator,
333
+ whitespace: peg$parsewhitespace,
334
+ whitespaceChar: peg$parsewhitespaceChar,
335
+ whitespaceOptionalForProgram: peg$parsewhitespaceOptionalForProgram,
336
+ whitespaceWithNewLine: peg$parsewhitespaceWithNewLine,
412
337
  };
413
- var peg$f1 = function(head, tail) {
414
- return tail.reduce(makeBinaryOperation, head);
415
- };
416
- var peg$f2 = function(scheme, path) {
338
+ let peg$startRuleFunction = peg$parse__;
339
+
340
+ const peg$c0 = "+";
341
+ const peg$c1 = "<";
342
+ const peg$c2 = "//";
343
+ const peg$c3 = ">";
344
+ const peg$c4 = "</";
345
+ const peg$c5 = "/";
346
+ const peg$c6 = "[";
347
+ const peg$c7 = "]";
348
+ const peg$c8 = "(";
349
+ const peg$c9 = ")";
350
+ const peg$c10 = "&";
351
+ const peg$c11 = "|";
352
+ const peg$c12 = "^";
353
+ const peg$c13 = ",";
354
+ const peg$c14 = "?";
355
+ const peg$c15 = ":";
356
+ const peg$c16 = "\u21D2";
357
+ const peg$c17 = "=>";
358
+ const peg$c18 = "\"";
359
+ const peg$c19 = "...";
360
+ const peg$c20 = "\u2026";
361
+ const peg$c21 = "===";
362
+ const peg$c22 = "!==";
363
+ const peg$c23 = "==";
364
+ const peg$c24 = "!=";
365
+ const peg$c25 = "\\0";
366
+ const peg$c26 = "\\b";
367
+ const peg$c27 = "\\f";
368
+ const peg$c28 = "\\n";
369
+ const peg$c29 = "\\r";
370
+ const peg$c30 = "\\t";
371
+ const peg$c31 = "\\v";
372
+ const peg$c32 = "\\";
373
+ const peg$c33 = "`";
374
+ const peg$c34 = "}";
375
+ const peg$c35 = "\xBB";
376
+ const peg$c36 = "'";
377
+ const peg$c37 = "**";
378
+ const peg$c38 = ".";
379
+ const peg$c39 = "---\n";
380
+ const peg$c40 = "\xAB";
381
+ const peg$c41 = "&&";
382
+ const peg$c42 = "||";
383
+ const peg$c43 = "-";
384
+ const peg$c44 = "-\n";
385
+ const peg$c45 = "/*";
386
+ const peg$c46 = "*/";
387
+ const peg$c47 = "new";
388
+ const peg$c48 = "new:";
389
+ const peg$c49 = "\n";
390
+ const peg$c50 = "\r\n";
391
+ const peg$c51 = "\r";
392
+ const peg$c52 = "??";
393
+ const peg$c53 = "{";
394
+ const peg$c54 = "=";
395
+ const peg$c55 = "?.";
396
+ const peg$c56 = "<=";
397
+ const peg$c57 = ">=";
398
+ const peg$c58 = "#!";
399
+ const peg$c59 = "<<";
400
+ const peg$c60 = ">>>";
401
+ const peg$c61 = ">>";
402
+ const peg$c62 = "\u2192";
403
+ const peg$c63 = "->";
404
+ const peg$c64 = "${";
405
+ const peg$c65 = "~";
406
+
407
+ const peg$r0 = /^[^\/>\t\n\r]/;
408
+ const peg$r1 = /^[0-9]/;
409
+ const peg$r2 = /^[ \t]/;
410
+ const peg$r3 = /^[!+]/;
411
+ const peg$r4 = /^[%-&*\^|]/;
412
+ const peg$r5 = /^[.@~]/;
413
+ const peg$r6 = /^[%*\/]/;
414
+ const peg$r7 = /^[gimuy]/;
415
+ const peg$r8 = /^[^\/\n\r]/;
416
+ const peg$r9 = /^[^\n\r]/;
417
+ const peg$r10 = /^[^\/,)\]}]/;
418
+ const peg$r11 = /^[a-z]/;
419
+ const peg$r12 = /^[a-z0-9+-.]/;
420
+ const peg$r13 = /^[:]/;
421
+ const peg$r14 = /^[\/)\]}]/;
422
+
423
+ const peg$e0 = peg$literalExpectation("+", false);
424
+ const peg$e1 = peg$literalExpectation("<", false);
425
+ const peg$e2 = peg$literalExpectation("//", false);
426
+ const peg$e3 = peg$literalExpectation(">", false);
427
+ const peg$e4 = peg$literalExpectation("</", false);
428
+ const peg$e5 = peg$literalExpectation("/", false);
429
+ const peg$e6 = peg$classExpectation(["/", ">", "\t", "\n", "\r"], true, false, false);
430
+ const peg$e7 = peg$otherExpectation("function arguments");
431
+ const peg$e8 = peg$otherExpectation("array");
432
+ const peg$e9 = peg$literalExpectation("[", false);
433
+ const peg$e10 = peg$literalExpectation("]", false);
434
+ const peg$e11 = peg$literalExpectation("(", false);
435
+ const peg$e12 = peg$literalExpectation(")", false);
436
+ const peg$e13 = peg$literalExpectation("&", false);
437
+ const peg$e14 = peg$literalExpectation("|", false);
438
+ const peg$e15 = peg$literalExpectation("^", false);
439
+ const peg$e16 = peg$otherExpectation("function call");
440
+ const peg$e17 = peg$literalExpectation(",", false);
441
+ const peg$e18 = peg$otherExpectation("comment");
442
+ const peg$e19 = peg$literalExpectation("?", false);
443
+ const peg$e20 = peg$literalExpectation(":", false);
444
+ const peg$e21 = peg$classExpectation([["0", "9"]], false, false, false);
445
+ const peg$e22 = peg$literalExpectation("\u21D2", false);
446
+ const peg$e23 = peg$literalExpectation("=>", false);
447
+ const peg$e24 = peg$otherExpectation("double quote string");
448
+ const peg$e25 = peg$literalExpectation("\"", false);
449
+ const peg$e26 = peg$literalExpectation("...", false);
450
+ const peg$e27 = peg$literalExpectation("\u2026", false);
451
+ const peg$e28 = peg$literalExpectation("===", false);
452
+ const peg$e29 = peg$literalExpectation("!==", false);
453
+ const peg$e30 = peg$literalExpectation("==", false);
454
+ const peg$e31 = peg$literalExpectation("!=", false);
455
+ const peg$e32 = peg$otherExpectation("backslash-escaped character");
456
+ const peg$e33 = peg$literalExpectation("\\0", false);
457
+ const peg$e34 = peg$literalExpectation("\\b", false);
458
+ const peg$e35 = peg$literalExpectation("\\f", false);
459
+ const peg$e36 = peg$literalExpectation("\\n", false);
460
+ const peg$e37 = peg$literalExpectation("\\r", false);
461
+ const peg$e38 = peg$literalExpectation("\\t", false);
462
+ const peg$e39 = peg$literalExpectation("\\v", false);
463
+ const peg$e40 = peg$literalExpectation("\\", false);
464
+ const peg$e41 = peg$anyExpectation();
465
+ const peg$e42 = peg$literalExpectation("`", false);
466
+ const peg$e43 = peg$literalExpectation("}", false);
467
+ const peg$e44 = peg$literalExpectation("\xBB", false);
468
+ const peg$e45 = peg$literalExpectation("'", false);
469
+ const peg$e46 = peg$literalExpectation("**", false);
470
+ const peg$e47 = peg$otherExpectation("floating-point number");
471
+ const peg$e48 = peg$literalExpectation(".", false);
472
+ const peg$e49 = peg$literalExpectation("---\n", false);
473
+ const peg$e50 = peg$otherExpectation("YAML front matter");
474
+ const peg$e51 = peg$otherExpectation("parenthetical group");
475
+ const peg$e52 = peg$otherExpectation("guillemet string");
476
+ const peg$e53 = peg$literalExpectation("\xAB", false);
477
+ const peg$e54 = peg$otherExpectation("HTTP/HTTPS host");
478
+ const peg$e55 = peg$otherExpectation("JavaScript identifier continuation");
479
+ const peg$e56 = peg$otherExpectation("JavaScript identifier start");
480
+ const peg$e57 = peg$otherExpectation("function call with implicit parentheses");
481
+ const peg$e58 = peg$classExpectation([" ", "\t"], false, false, false);
482
+ const peg$e59 = peg$otherExpectation("integer");
483
+ const peg$e60 = peg$classExpectation(["!", "+"], false, false, false);
484
+ const peg$e61 = peg$classExpectation([["%", "&"], "*", "^", "|"], false, false, false);
485
+ const peg$e62 = peg$classExpectation([".", "@", "~"], false, false, false);
486
+ const peg$e63 = peg$otherExpectation("list");
487
+ const peg$e64 = peg$literalExpectation("&&", false);
488
+ const peg$e65 = peg$literalExpectation("||", false);
489
+ const peg$e66 = peg$literalExpectation("-", false);
490
+ const peg$e67 = peg$literalExpectation("-\n", false);
491
+ const peg$e68 = peg$literalExpectation("/*", false);
492
+ const peg$e69 = peg$literalExpectation("*/", false);
493
+ const peg$e70 = peg$classExpectation(["%", "*", "/"], false, false, false);
494
+ const peg$e71 = peg$literalExpectation("new", false);
495
+ const peg$e72 = peg$literalExpectation("new:", false);
496
+ const peg$e73 = peg$literalExpectation("\n", false);
497
+ const peg$e74 = peg$literalExpectation("\r\n", false);
498
+ const peg$e75 = peg$literalExpectation("\r", false);
499
+ const peg$e76 = peg$otherExpectation("number");
500
+ const peg$e77 = peg$literalExpectation("??", false);
501
+ const peg$e78 = peg$otherExpectation("object literal");
502
+ const peg$e79 = peg$literalExpectation("{", false);
503
+ const peg$e80 = peg$otherExpectation("object getter");
504
+ const peg$e81 = peg$literalExpectation("=", false);
505
+ const peg$e82 = peg$otherExpectation("object key");
506
+ const peg$e83 = peg$otherExpectation("object property");
507
+ const peg$e84 = peg$otherExpectation("object identifier");
508
+ const peg$e85 = peg$literalExpectation("?.", false);
509
+ const peg$e86 = peg$otherExpectation("function arguments in parentheses");
510
+ const peg$e87 = peg$otherExpectation("Origami program");
511
+ const peg$e88 = peg$classExpectation(["g", "i", "m", "u", "y"], false, false, false);
512
+ const peg$e89 = peg$classExpectation(["/", "\n", "\r"], true, false, false);
513
+ const peg$e90 = peg$literalExpectation("<=", false);
514
+ const peg$e91 = peg$literalExpectation(">=", false);
515
+ const peg$e92 = peg$literalExpectation("#!", false);
516
+ const peg$e93 = peg$classExpectation(["\n", "\r"], true, false, false);
517
+ const peg$e94 = peg$literalExpectation("<<", false);
518
+ const peg$e95 = peg$literalExpectation(">>>", false);
519
+ const peg$e96 = peg$literalExpectation(">>", false);
520
+ const peg$e97 = peg$otherExpectation("lambda function");
521
+ const peg$e98 = peg$literalExpectation("\u2192", false);
522
+ const peg$e99 = peg$literalExpectation("->", false);
523
+ const peg$e100 = peg$otherExpectation("single quote string");
524
+ const peg$e101 = peg$otherExpectation("string");
525
+ const peg$e102 = peg$literalExpectation("${", false);
526
+ const peg$e103 = peg$otherExpectation("template document");
527
+ const peg$e104 = peg$otherExpectation("template literal");
528
+ const peg$e105 = peg$otherExpectation("template substitution");
529
+ const peg$e106 = peg$classExpectation(["/", ",", ")", "]", "}"], true, false, false);
530
+ const peg$e107 = peg$otherExpectation("slash-separated path");
531
+ const peg$e108 = peg$classExpectation([["a", "z"]], false, false, false);
532
+ const peg$e109 = peg$classExpectation([["a", "z"], ["0", "9"], ["+", "."]], false, false, false);
533
+ const peg$e110 = peg$classExpectation([":"], false, false, false);
534
+ const peg$e111 = peg$literalExpectation("~", false);
535
+ const peg$e112 = peg$classExpectation(["/", ")", "]", "}"], false, false, false);
536
+
537
+ function peg$f0() {
538
+ return null;
539
+ }
540
+ function peg$f1(head, tail) {
541
+ return tail.reduce(makeBinaryOperation, head);
542
+ }
543
+ function peg$f2(scheme, path) {
417
544
  return annotate([scheme, ...path], location());
418
- };
419
- var peg$f3 = function(path) {
420
- const external = annotate([markers.external, "/"], location());
421
- return annotate([markers.traverse, external, ...path], location());
422
- };
423
- var peg$f4 = function(path) {
424
- const [head, ...tail] = path;
425
- const external = annotate([markers.external, head[1]], location());
426
- return annotate([markers.traverse, external, ...tail], location());
427
- };
428
- var peg$f5 = function(chars, slashFollows) {
429
- // Append a trailing slash if one follows (but don't consume it)
430
- const key = chars.join("") + (slashFollows ? "/" : "");
431
- return annotate([ops.literal, key], location());
432
- };
433
- var peg$f6 = function(entries) {
434
- return makeArray(entries ?? [], location());
435
- };
436
- var peg$f7 = function(entries) {
437
- return annotate(entries, location());
438
- };
439
- var peg$f8 = function() {
440
- return annotate([ops.literal, undefined], location());
441
- };
442
- var peg$f9 = function(parameters, pipeline) {
443
- const lambdaParameters = parameters ?? annotate([], location());
444
- return annotate([ops.lambda, lambdaParameters, pipeline], location());
445
- };
446
- var peg$f10 = function(parameter, pipeline) {
447
- return annotate([ops.lambda, parameter, pipeline], location());
448
- };
449
- var peg$f11 = function(head, tail) {
450
- return tail.reduce(makeBinaryOperation, head);
451
- };
452
- var peg$f12 = function(head, tail) {
453
- return tail.reduce(makeBinaryOperation, head);
454
- };
455
- var peg$f13 = function(head, tail) {
456
- return tail.reduce(makeBinaryOperation, head);
457
- };
458
- var peg$f14 = function(head, tail) {
459
- return tail.reduce(
460
- (target, args) => makeCall(target, args, location()),
461
- head
462
- );
463
- };
464
- var peg$f15 = function(list) {
465
- return list.length === 1
466
- ? list[0]
467
- : annotate([ops.comma, ...list], location());
468
- };
469
- var peg$f16 = function(expression) {
470
- return annotate([markers.property, expression], location());
471
- };
472
- var peg$f17 = function(condition, tail) {
473
- if (!tail) {
474
- return condition;
475
- }
476
- const deferred = makeDeferredArguments(tail);
477
- return annotate([
478
- ops.conditional,
479
- condition,
480
- deferred[0],
481
- deferred[1]
482
- ], location());
483
- };
484
- var peg$f18 = function(chars) {
545
+ }
546
+ function peg$f3(path) {
547
+ const external = annotate([markers.external, "/"], location());
548
+ return annotate([markers.traverse, external, ...path], location());
549
+ }
550
+ function peg$f4(path) {
551
+ const [head, ...tail] = path;
552
+ const external = annotate([markers.external, head[1]], location());
553
+ return annotate([markers.traverse, external, ...tail], location());
554
+ }
555
+ function peg$f5(chars, slashFollows) {
556
+ // Append a trailing slash if one follows (but don't consume it)
557
+ const key = chars.join("") + (slashFollows ? "/" : "");
558
+ return annotate([ops.literal, key], location());
559
+ }
560
+ function peg$f6(entries) {
561
+ return makeArray(entries ?? [], location());
562
+ }
563
+ function peg$f7(entries) {
564
+ return annotate(entries, location());
565
+ }
566
+ function peg$f8() {
567
+ return annotate([ops.literal, undefined], location());
568
+ }
569
+ function peg$f9(parameters, pipeline) {
570
+ const lambdaParameters = parameters ?? annotate([], location());
571
+ return annotate([ops.lambda, lambdaParameters, pipeline], location());
572
+ }
573
+ function peg$f10(parameter, pipeline) {
574
+ return annotate([ops.lambda, parameter, pipeline], location());
575
+ }
576
+ function peg$f11(head, tail) {
577
+ return tail.reduce(makeBinaryOperation, head);
578
+ }
579
+ function peg$f12(head, tail) {
580
+ return tail.reduce(makeBinaryOperation, head);
581
+ }
582
+ function peg$f13(head, tail) {
583
+ return tail.reduce(makeBinaryOperation, head);
584
+ }
585
+ function peg$f14(head, tail) {
586
+ return tail.reduce(
587
+ (target, args) => makeCall(target, args, location()),
588
+ head
589
+ );
590
+ }
591
+ function peg$f15(list) {
592
+ return list.length === 1
593
+ ? list[0]
594
+ : annotate([ops.comma, ...list], location());
595
+ }
596
+ function peg$f16(expression) {
597
+ return annotate([markers.property, expression], location());
598
+ }
599
+ function peg$f17(condition, tail) {
600
+ if (!tail) {
601
+ return condition;
602
+ }
603
+ const deferred = makeDeferredArguments(tail);
604
+ return annotate([
605
+ ops.conditional,
606
+ condition,
607
+ deferred[0],
608
+ deferred[1]
609
+ ], location());
610
+ }
611
+ function peg$f18(chars) {
485
612
  return annotate([ops.literal, chars.join("")], location());
486
- };
487
- var peg$f19 = function() {
613
+ }
614
+ function peg$f19() {
488
615
  console.warn("The use of the Unicode ellipsis character for an object spread is deprecated; use `...` (three periods) instead.");
489
- };
490
- var peg$f20 = function(head, tail) {
491
- return tail.reduce(makeBinaryOperation, head);
492
- };
493
- var peg$f21 = function() { return "\0"; };
494
- var peg$f22 = function() { return "\b"; };
495
- var peg$f23 = function() { return "\f"; };
496
- var peg$f24 = function() { return "\n"; };
497
- var peg$f25 = function() { return "\r"; };
498
- var peg$f26 = function() { return "\t"; };
499
- var peg$f27 = function() { return "\v"; };
500
- var peg$f28 = function() {
501
- error("Expected closing backtick");
502
- };
503
- var peg$f29 = function() {
504
- error(`An object ended without a closing brace, or contained something that wasn't expected.\nThe top level of an object can only contain definitions ("a: b" or "a = b") or spreads ("...a").`);
505
- };
506
- var peg$f30 = function() {
507
- error("Expected right bracket");
508
- };
509
- var peg$f31 = function() {
510
- error("Expected right parenthesis");
511
- };
512
- var peg$f32 = function() {
513
- error("Expected closing quote");
514
- };
515
- var peg$f33 = function() {
516
- error("Expected an expression");
517
- };
518
- var peg$f34 = function() {
519
- error("Expected \"---\"");
520
- };
521
- var peg$f35 = function() {
522
- error("Expected closing guillemet");
523
- };
524
- var peg$f36 = function() {
525
- error("Expected closing quote");
526
- };
527
- var peg$f37 = function() {
528
- error("Expected an expression");
529
- };
530
- var peg$f38 = function() {
531
- error("Expected an expression");
532
- };
533
- var peg$f39 = function(left, right) {
534
- return right ? annotate([ops.exponentiation, left, right], location()) : left;
535
- };
536
- var peg$f40 = function() {
537
- return annotate([ops.literal, parseFloat(text())], location());
538
- };
539
- var peg$f41 = function() {
616
+ }
617
+ function peg$f20(head, tail) {
618
+ return tail.reduce(makeBinaryOperation, head);
619
+ }
620
+ function peg$f21() { return "\0"; }
621
+ function peg$f22() { return "\b"; }
622
+ function peg$f23() { return "\f"; }
623
+ function peg$f24() { return "\n"; }
624
+ function peg$f25() { return "\r"; }
625
+ function peg$f26() { return "\t"; }
626
+ function peg$f27() { return "\v"; }
627
+ function peg$f28() {
628
+ error("Expected closing backtick");
629
+ }
630
+ function peg$f29() {
631
+ error(`An object ended without a closing brace, or contained something that wasn't expected.\nThe top level of an object can only contain definitions ("a: b" or "a = b") or spreads ("...a").`);
632
+ }
633
+ function peg$f30() {
634
+ error("Expected right bracket");
635
+ }
636
+ function peg$f31() {
637
+ error("Expected right parenthesis");
638
+ }
639
+ function peg$f32() {
640
+ error("Expected closing quote");
641
+ }
642
+ function peg$f33() {
643
+ error("Expected an expression");
644
+ }
645
+ function peg$f34() {
646
+ error("Expected \"---\"");
647
+ }
648
+ function peg$f35() {
649
+ error("Expected closing guillemet");
650
+ }
651
+ function peg$f36() {
652
+ error("Expected closing quote");
653
+ }
654
+ function peg$f37() {
655
+ error("Expected an expression");
656
+ }
657
+ function peg$f38() {
658
+ error("Expected an expression");
659
+ }
660
+ function peg$f39(left, right) {
661
+ return right ? annotate([ops.exponentiation, left, right], location()) : left;
662
+ }
663
+ function peg$f40() {
664
+ return annotate([ops.literal, parseFloat(text())], location());
665
+ }
666
+ function peg$f41() {
540
667
  return isOrigamiFrontMatter(input.slice(location().end.offset))
541
- };
542
- var peg$f42 = function(chars) {
668
+ }
669
+ function peg$f42(chars) {
543
670
  return chars.join("");
544
- };
545
- var peg$f43 = function(yaml) {
671
+ }
672
+ function peg$f43(yaml) {
546
673
  return makeYamlObject(yaml, location());
547
- };
548
- var peg$f44 = function(expression) {
674
+ }
675
+ function peg$f44(expression) {
549
676
  return annotate(expression, location());
550
- };
551
- var peg$f45 = function(chars) {
677
+ }
678
+ function peg$f45(chars) {
552
679
  return annotate([ops.literal, chars.join("")], location());
553
- };
554
- var peg$f46 = function(name, port, slashFollows) {
555
- const portText = port ? `:${port[1]}` : "";
556
- const slashText = slashFollows ? "/" : "";
557
- const host = name + portText + slashText;
558
- return annotate([ops.literal, host], location());
559
- };
560
- var peg$f47 = function() {
680
+ }
681
+ function peg$f46(name, port, slashFollows) {
682
+ const portText = port ? `:${port[1]}` : "";
683
+ const slashText = slashFollows ? "/" : "";
684
+ const host = name + portText + slashText;
685
+ return annotate([ops.literal, host], location());
686
+ }
687
+ function peg$f47() {
561
688
  return text();
562
- };
563
- var peg$f48 = function(id) {
689
+ }
690
+ function peg$f48(id) {
564
691
  return id;
565
- };
566
- var peg$f49 = function(id) {
567
- return annotate([ops.literal, id], location());
568
- };
569
- var peg$f50 = function(char) { return char.match(/[$_\p{ID_Continue}]/u) };
570
- var peg$f51 = function(char) { return char.match(/[$_\p{ID_Start}]/u) };
571
- var peg$f52 = function(head, args) {
572
- return args ? makeCall(head, args, location()) : head;
573
- };
574
- var peg$f53 = function(values) {
575
- return annotate(values, location());
576
- };
577
- var peg$f54 = function() {
578
- return annotate([ops.literal, parseInt(text())], location());
579
- };
580
- var peg$f55 = function() {
692
+ }
693
+ function peg$f49(id) {
694
+ return annotate([ops.literal, id], location());
695
+ }
696
+ function peg$f50(char) { return char.match(/[$_\p{ID_Continue}]/u) }
697
+ function peg$f51(char) { return char.match(/[$_\p{ID_Start}]/u) }
698
+ function peg$f52(head, args) {
699
+ return args ? makeCall(head, args, location()) : head;
700
+ }
701
+ function peg$f53(values) {
702
+ return annotate(values, location());
703
+ }
704
+ function peg$f54() {
705
+ return annotate([ops.literal, parseInt(text())], location());
706
+ }
707
+ function peg$f55() {
581
708
  return text();
582
- };
583
- var peg$f56 = function(char) { return char.match(/[$_\p{ID_Continue}]/u) };
584
- var peg$f57 = function(values) {
585
- return annotate(values, location());
586
- };
587
- var peg$f58 = function(head, tail) {
588
- return tail.length === 0
589
- ? head
590
- : annotate(
591
- [ops.logicalAnd, head, ...makeDeferredArguments(tail)],
592
- location()
593
- );
594
- };
595
- var peg$f59 = function(head, tail) {
596
- return tail.length === 0
597
- ? head
598
- : annotate(
599
- [ops.logicalOr, head, ...makeDeferredArguments(tail)],
600
- location()
601
- );
602
- };
603
- var peg$f60 = function() { return null; };
604
- var peg$f61 = function(head, tail) {
605
- return tail.reduce(makeBinaryOperation, head);
606
- };
607
- var peg$f62 = function(head, tail) {
608
- const args = tail?.[0] !== undefined ? tail : [];
609
- return annotate([ops.construct, head, ...args], location());
610
- };
611
- var peg$f63 = function(head, tail) {
612
- const args = tail?.[0] !== undefined ? tail : [];
613
- return annotate([ops.construct, head, ...args], location());
614
- };
615
- var peg$f64 = function(head, tail) {
616
- return tail.length === 0
617
- ? head
618
- : annotate(
619
- [ops.nullishCoalescing, head, ...makeDeferredArguments(tail)],
620
- location()
621
- );
622
- };
623
- var peg$f65 = function(entries) {
624
- return makeObject(entries ?? [], location());
625
- };
626
- var peg$f66 = function(entries) {
627
- return annotate(entries, location());
628
- };
629
- var peg$f67 = function(key, pipeline) {
630
- const getter = annotate([ops.getter, pipeline], location());
631
- return annotate([key, getter], location());
632
- };
633
- var peg$f68 = function(hiddenKey) { return hiddenKey.join(""); };
634
- var peg$f69 = function(key, pipeline) {
635
- return annotate([key, pipeline], location());
636
- };
637
- var peg$f70 = function(key) {
638
- const reference = annotate([markers.reference, key], location());
639
- const traverse = annotate([markers.traverse, reference], location());
640
- return annotate([key, traverse], location());
641
- };
642
- var peg$f71 = function(path) {
709
+ }
710
+ function peg$f56(char) { return char.match(/[$_\p{ID_Continue}]/u) }
711
+ function peg$f57(values) {
712
+ return annotate(values, location());
713
+ }
714
+ function peg$f58(head, tail) {
715
+ return tail.length === 0
716
+ ? head
717
+ : annotate(
718
+ [ops.logicalAnd, head, ...makeDeferredArguments(tail)],
719
+ location()
720
+ );
721
+ }
722
+ function peg$f59(head, tail) {
723
+ return tail.length === 0
724
+ ? head
725
+ : annotate(
726
+ [ops.logicalOr, head, ...makeDeferredArguments(tail)],
727
+ location()
728
+ );
729
+ }
730
+ function peg$f60() { return null; }
731
+ function peg$f61(head, tail) {
732
+ return tail.reduce(makeBinaryOperation, head);
733
+ }
734
+ function peg$f62(head, tail) {
735
+ const args = tail?.[0] !== undefined ? tail : [];
736
+ return annotate([ops.construct, head, ...args], location());
737
+ }
738
+ function peg$f63(head, tail) {
739
+ const args = tail?.[0] !== undefined ? tail : [];
740
+ return annotate([ops.construct, head, ...args], location());
741
+ }
742
+ function peg$f64(head, tail) {
743
+ return tail.length === 0
744
+ ? head
745
+ : annotate(
746
+ [ops.nullishCoalescing, head, ...makeDeferredArguments(tail)],
747
+ location()
748
+ );
749
+ }
750
+ function peg$f65(entries) {
751
+ return makeObject(entries ?? [], location());
752
+ }
753
+ function peg$f66(entries) {
754
+ return annotate(entries, location());
755
+ }
756
+ function peg$f67(key, pipeline) {
757
+ const getter = annotate([ops.getter, pipeline], location());
758
+ return annotate([key, getter], location());
759
+ }
760
+ function peg$f68(hiddenKey) { return hiddenKey.join(""); }
761
+ function peg$f69(key, pipeline) {
762
+ return annotate([key, pipeline], location());
763
+ }
764
+ function peg$f70(key) {
765
+ const reference = annotate([markers.reference, key], location());
766
+ const traverse = annotate([markers.traverse, reference], location());
767
+ return annotate([key, traverse], location());
768
+ }
769
+ function peg$f71(path) {
643
770
  let lastKey = path.at(-1);
644
771
  if (lastKey instanceof Array) {
645
772
  lastKey = lastKey[1]; // get scope identifier or literal
646
773
  }
647
774
  return annotate([lastKey, path], location());
648
- };
649
- var peg$f72 = function(key, slash) {
775
+ }
776
+ function peg$f72(key, slash) {
650
777
  return text();
651
- };
652
- var peg$f73 = function(string) {
653
- // Remove `ops.literal` from the string code
654
- return string[1];
655
- };
656
- var peg$f74 = function(property) {
778
+ }
779
+ function peg$f73(string) {
780
+ // Remove `ops.literal` from the string code
781
+ return string[1];
782
+ }
783
+ function peg$f74(property) {
657
784
  return annotate([ops.optionalTraverse, property], location());
658
- };
659
- var peg$f75 = function(key) {
660
- return annotate([ops.literal, key], location());
661
- };
662
- var peg$f76 = function(list) {
663
- return annotate(list, location());
664
- };
665
- var peg$f77 = function(param) {
666
- return annotate([param], location());
667
- };
668
- var peg$f78 = function(list) {
669
- return annotate(list ?? [undefined], location());
670
- };
671
- var peg$f79 = function(keys) {
672
- const args = keys ?? [];
673
- return annotate([markers.traverse, ...args], location());
674
- };
675
- var peg$f80 = function(keys) {
676
- return makePath(keys);
677
- };
678
- var peg$f81 = function(key) {
679
- return annotate([ops.literal, text()], location());
680
- };
681
- var peg$f82 = function() {
682
- return annotate([ops.literal, text()], location());
683
- };
684
- var peg$f83 = function(head, tail) {
685
- return annotate(
686
- tail.reduce((arg, fn) => makePipeline(arg, fn, location()), head),
687
- location()
688
- );
689
- };
690
- var peg$f84 = function() { return options.mode === "program" };
691
- var peg$f85 = function(property) {
785
+ }
786
+ function peg$f75(key) {
787
+ return annotate([ops.literal, key], location());
788
+ }
789
+ function peg$f76(list) {
790
+ return annotate(list, location());
791
+ }
792
+ function peg$f77(param) {
793
+ return annotate([param], location());
794
+ }
795
+ function peg$f78(list) {
796
+ return annotate(list ?? [undefined], location());
797
+ }
798
+ function peg$f79(keys) {
799
+ const args = keys ?? [];
800
+ return annotate([markers.traverse, ...args], location());
801
+ }
802
+ function peg$f80(keys) {
803
+ return makePath(keys);
804
+ }
805
+ function peg$f81(key) {
806
+ return annotate([ops.literal, text()], location());
807
+ }
808
+ function peg$f82() {
809
+ return annotate([ops.literal, text()], location());
810
+ }
811
+ function peg$f83(head, tail) {
812
+ return annotate(
813
+ tail.reduce((arg, fn) => makePipeline(arg, fn, location()), head),
814
+ location()
815
+ );
816
+ }
817
+ function peg$f84() { return options.mode === "program" }
818
+ function peg$f85(property) {
692
819
  return annotate([markers.property, property], location());
693
- };
694
- var peg$f86 = function(flags) {
695
- return flags.join("");
696
- };
697
- var peg$f87 = function(chars, flags) {
698
- const regex = new RegExp(chars.join(""), flags);
699
- return annotate([ops.literal, regex], location());
700
- };
701
- var peg$f88 = function(head, tail) {
702
- return tail.reduce(makeBinaryOperation, head);
703
- };
704
- var peg$f89 = function() { return null; };
705
- var peg$f90 = function() { return options.mode === "shell" };
706
- var peg$f91 = function(head, tail) {
707
- return tail.reduce(makeBinaryOperation, head);
708
- };
709
- var peg$f92 = function(definition) {
710
- if (options.mode === "program") {
711
- console.warn("Warning: the shorthand function syntax is deprecated in Origami programs. Use arrow syntax instead.");
712
- }
713
- const lambdaParameters = annotate(
714
- [annotate([ops.literal, "_"], location())],
715
- location()
716
- );
717
- return annotate([ops.lambda, lambdaParameters, definition], location());
718
- };
719
- var peg$f93 = function() { return null; };
720
- var peg$f94 = function(chars) {
820
+ }
821
+ function peg$f86(flags) {
822
+ return flags.join("");
823
+ }
824
+ function peg$f87(chars, flags) {
825
+ const regex = new RegExp(chars.join(""), flags);
826
+ return annotate([ops.literal, regex], location());
827
+ }
828
+ function peg$f88(head, tail) {
829
+ return tail.reduce(makeBinaryOperation, head);
830
+ }
831
+ function peg$f89() { return null; }
832
+ function peg$f90() { return options.mode === "shell" }
833
+ function peg$f91(head, tail) {
834
+ return tail.reduce(makeBinaryOperation, head);
835
+ }
836
+ function peg$f92(definition) {
837
+ if (options.mode === "program") {
838
+ console.warn("Warning: the shorthand function syntax is deprecated in Origami programs. Use arrow syntax instead.");
839
+ }
840
+ const lambdaParameters = annotate(
841
+ [annotate([ops.literal, "_"], location())],
842
+ location()
843
+ );
844
+ return annotate([ops.lambda, lambdaParameters, definition], location());
845
+ }
846
+ function peg$f93() { return null; }
847
+ function peg$f94(chars) {
721
848
  return annotate([ops.literal, chars.join("")], location());
722
- };
723
- var peg$f95 = function() {
849
+ }
850
+ function peg$f95() {
724
851
  return annotate([ops.literal, "/"], location());
725
- };
726
- var peg$f96 = function() {
727
- return annotate([ops.literal, "/"], location());
728
- };
729
- var peg$f97 = function() {
730
- return true;
731
- };
732
- var peg$f98 = function(value) {
733
- return annotate([ops.spread, value], location());
734
- };
735
- var peg$f99 = function(head, tail) {
736
- return makeTemplate(ops.templateIndent, head, tail, location());
737
- };
738
- var peg$f100 = function(chars) {
739
- return annotate([ops.literal, chars.join("")], location());
740
- };
741
- var peg$f101 = function(front, body) {
742
- return annotate(applyMacro(front, "_template", body), location());
743
- };
744
- var peg$f102 = function(front, body) {
745
- return makeDocument(front, body, location());
746
- };
747
- var peg$f103 = function(body) {
748
- if (options.front) {
749
- return makeDocument(options.front, body, location());
750
- }
751
- const lambdaParameters = annotate(
752
- [annotate([ops.literal, "_"], location())],
753
- location()
754
- );
755
- return annotate([ops.lambda, lambdaParameters, body], location());
756
- };
757
- var peg$f104 = function(head, tail) {
758
- return makeTemplate(ops.templateTree, head, tail, location());
759
- };
760
- var peg$f105 = function(chars) {
761
- return annotate([ops.literal, chars.join("")], location());
762
- };
763
- var peg$f106 = function(expression) {
764
- return annotate(expression, location());
765
- };
766
- var peg$f107 = function(operator, expression) {
767
- return makeUnaryOperation(operator, expression, location());
768
- };
769
- var peg$f108 = function(scheme, host, path) {
770
- const rest = path ? path[1] : [];
771
- const keys = annotate([host, ...rest], location());
772
- return makeCall(scheme, keys, location());
773
- };
774
- var peg$f109 = function(scheme, keys) {
775
- return makeCall(scheme, keys, location());
776
- };
777
- var peg$f110 = function(chars) {
778
- return annotate([ops.literal, text()], location());
779
- };
780
- var peg$f111 = function() {
852
+ }
853
+ function peg$f96() {
854
+ return annotate([ops.literal, "/"], location());
855
+ }
856
+ function peg$f97() {
857
+ return true;
858
+ }
859
+ function peg$f98(value) {
860
+ return annotate([ops.spread, value], location());
861
+ }
862
+ function peg$f99(head, tail) {
863
+ return makeTemplate(ops.templateIndent, head, tail, location());
864
+ }
865
+ function peg$f100(chars) {
866
+ return annotate([ops.literal, chars.join("")], location());
867
+ }
868
+ function peg$f101(front, body) {
869
+ return annotate(applyMacro(front, "_template", body), location());
870
+ }
871
+ function peg$f102(front, body) {
872
+ return makeDocument(front, body, location());
873
+ }
874
+ function peg$f103(body) {
875
+ if (options.front) {
876
+ return makeDocument(options.front, body, location());
877
+ }
878
+ const lambdaParameters = annotate(
879
+ [annotate([ops.literal, "_"], location())],
880
+ location()
881
+ );
882
+ return annotate([ops.lambda, lambdaParameters, body], location());
883
+ }
884
+ function peg$f104(head, tail) {
885
+ return makeTemplate(ops.templateText, head, tail, location());
886
+ }
887
+ function peg$f105(chars) {
888
+ return annotate([ops.literal, chars.join("")], location());
889
+ }
890
+ function peg$f106(expression) {
891
+ return annotate(expression, location());
892
+ }
893
+ function peg$f107(operator, expression) {
894
+ return makeUnaryOperation(operator, expression, location());
895
+ }
896
+ function peg$f108(scheme, host, path) {
897
+ const rest = path ? path[1] : [];
898
+ const keys = annotate([host, ...rest], location());
899
+ return makeCall(scheme, keys, location());
900
+ }
901
+ function peg$f109(scheme, keys) {
902
+ return makeCall(scheme, keys, location());
903
+ }
904
+ function peg$f110(chars) {
905
+ return annotate([ops.literal, text()], location());
906
+ }
907
+ function peg$f111() {
781
908
  // A single slash is a path key
782
909
  return annotate([ops.literal, ""], location());
783
- };
784
- var peg$f112 = function(char) { return /\s/.test(char); };
785
- var peg$f113 = function(char) { return char; };
786
- var peg$f114 = function(keys) {
787
- return annotate(keys, location());
788
- };
789
- var peg$f115 = function() {
790
- return annotate([markers.global, text()], location());
791
- };
792
- var peg$f116 = function(char) { return /\s/.test(char); };
793
- var peg$f117 = function(char) { return char; };
794
- var peg$currPos = options.peg$currPos | 0;
795
- var peg$savedPos = peg$currPos;
796
- var peg$posDetailsCache = [{ line: 1, column: 1 }];
797
- var peg$maxFailPos = peg$currPos;
798
- var peg$maxFailExpected = options.peg$maxFailExpected || [];
799
- var peg$silentFails = options.peg$silentFails | 0;
910
+ }
911
+ function peg$f112(char) { return /\s/.test(char); }
912
+ function peg$f113(char) { return char; }
913
+ function peg$f114(keys) {
914
+ return annotate(keys, location());
915
+ }
916
+ function peg$f115() {
917
+ return annotate([markers.global, text()], location());
918
+ }
919
+ function peg$f116(char) { return /\s/.test(char); }
920
+ function peg$f117(char) { return char; }
921
+ let peg$currPos = options.peg$currPos | 0;
922
+ let peg$savedPos = peg$currPos;
923
+ const peg$posDetailsCache = [{ line: 1, column: 1 }];
924
+ let peg$maxFailPos = peg$currPos;
925
+ let peg$maxFailExpected = options.peg$maxFailExpected || [];
926
+ let peg$silentFails = options.peg$silentFails | 0;
800
927
 
801
- var peg$result;
928
+ let peg$result;
802
929
 
803
930
  if (options.startRule) {
804
931
  if (!(options.startRule in peg$startRuleFunctions)) {
@@ -820,7 +947,7 @@ function peg$parse(input, options) {
820
947
  return {
821
948
  source: peg$source,
822
949
  start: peg$savedPos,
823
- end: peg$currPos
950
+ end: peg$currPos,
824
951
  };
825
952
  }
826
953
 
@@ -848,12 +975,20 @@ function peg$parse(input, options) {
848
975
  throw peg$buildSimpleError(message, location);
849
976
  }
850
977
 
978
+ function peg$getUnicode(pos = peg$currPos) {
979
+ const cp = input.codePointAt(pos);
980
+ if (cp === undefined) {
981
+ return "";
982
+ }
983
+ return String.fromCodePoint(cp);
984
+ }
985
+
851
986
  function peg$literalExpectation(text, ignoreCase) {
852
- return { type: "literal", text: text, ignoreCase: ignoreCase };
987
+ return { type: "literal", text, ignoreCase };
853
988
  }
854
989
 
855
- function peg$classExpectation(parts, inverted, ignoreCase) {
856
- return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase };
990
+ function peg$classExpectation(parts, inverted, ignoreCase, unicode) {
991
+ return { type: "class", parts, inverted, ignoreCase, unicode };
857
992
  }
858
993
 
859
994
  function peg$anyExpectation() {
@@ -865,12 +1000,12 @@ function peg$parse(input, options) {
865
1000
  }
866
1001
 
867
1002
  function peg$otherExpectation(description) {
868
- return { type: "other", description: description };
1003
+ return { type: "other", description };
869
1004
  }
870
1005
 
871
1006
  function peg$computePosDetails(pos) {
872
- var details = peg$posDetailsCache[pos];
873
- var p;
1007
+ let details = peg$posDetailsCache[pos];
1008
+ let p;
874
1009
 
875
1010
  if (details) {
876
1011
  return details;
@@ -885,7 +1020,7 @@ function peg$parse(input, options) {
885
1020
  details = peg$posDetailsCache[p];
886
1021
  details = {
887
1022
  line: details.line,
888
- column: details.column
1023
+ column: details.column,
889
1024
  };
890
1025
 
891
1026
  while (p < pos) {
@@ -906,21 +1041,21 @@ function peg$parse(input, options) {
906
1041
  }
907
1042
 
908
1043
  function peg$computeLocation(startPos, endPos, offset) {
909
- var startPosDetails = peg$computePosDetails(startPos);
910
- var endPosDetails = peg$computePosDetails(endPos);
1044
+ const startPosDetails = peg$computePosDetails(startPos);
1045
+ const endPosDetails = peg$computePosDetails(endPos);
911
1046
 
912
- var res = {
1047
+ const res = {
913
1048
  source: peg$source,
914
1049
  start: {
915
1050
  offset: startPos,
916
1051
  line: startPosDetails.line,
917
- column: startPosDetails.column
1052
+ column: startPosDetails.column,
918
1053
  },
919
1054
  end: {
920
1055
  offset: endPos,
921
1056
  line: endPosDetails.line,
922
- column: endPosDetails.column
923
- }
1057
+ column: endPosDetails.column,
1058
+ },
924
1059
  };
925
1060
  if (offset && peg$source && (typeof peg$source.offset === "function")) {
926
1061
  res.start = peg$source.offset(res.start);
@@ -954,7 +1089,7 @@ function peg$parse(input, options) {
954
1089
  }
955
1090
 
956
1091
  function peg$parse__() {
957
- var s0, s1, s2;
1092
+ let s0, s1, s2;
958
1093
 
959
1094
  s0 = peg$currPos;
960
1095
  s1 = [];
@@ -971,7 +1106,7 @@ function peg$parse(input, options) {
971
1106
  }
972
1107
 
973
1108
  function peg$parseadditiveExpression() {
974
- var s0, s1, s2, s3, s4, s5, s6, s7;
1109
+ let s0, s1, s2, s3, s4, s5, s6, s7;
975
1110
 
976
1111
  s0 = peg$currPos;
977
1112
  s1 = peg$parsemultiplicativeExpression();
@@ -1043,7 +1178,7 @@ function peg$parse(input, options) {
1043
1178
  }
1044
1179
 
1045
1180
  function peg$parseadditiveOperator() {
1046
- var s0;
1181
+ let s0;
1047
1182
 
1048
1183
  if (input.charCodeAt(peg$currPos) === 43) {
1049
1184
  s0 = peg$c0;
@@ -1060,7 +1195,7 @@ function peg$parse(input, options) {
1060
1195
  }
1061
1196
 
1062
1197
  function peg$parseangleBracketLiteral() {
1063
- var s0, s1, s2, s3, s4, s5;
1198
+ let s0, s1, s2, s3, s4, s5;
1064
1199
 
1065
1200
  s0 = peg$currPos;
1066
1201
  if (input.charCodeAt(peg$currPos) === 60) {
@@ -1171,7 +1306,7 @@ function peg$parse(input, options) {
1171
1306
  }
1172
1307
 
1173
1308
  function peg$parseangleBracketPath() {
1174
- var s0, s1, s2, s3;
1309
+ let s0, s1, s2, s3;
1175
1310
 
1176
1311
  s0 = peg$currPos;
1177
1312
  s1 = [];
@@ -1214,7 +1349,7 @@ function peg$parse(input, options) {
1214
1349
  }
1215
1350
 
1216
1351
  function peg$parseangleBracketKey() {
1217
- var s0, s1, s2;
1352
+ let s0, s1, s2;
1218
1353
 
1219
1354
  s0 = peg$currPos;
1220
1355
  s1 = [];
@@ -1243,7 +1378,7 @@ function peg$parse(input, options) {
1243
1378
  }
1244
1379
 
1245
1380
  function peg$parseangleBracketPathChar() {
1246
- var s0;
1381
+ let s0;
1247
1382
 
1248
1383
  s0 = input.charAt(peg$currPos);
1249
1384
  if (peg$r0.test(s0)) {
@@ -1260,7 +1395,7 @@ function peg$parse(input, options) {
1260
1395
  }
1261
1396
 
1262
1397
  function peg$parsearguments() {
1263
- var s0, s1;
1398
+ let s0, s1;
1264
1399
 
1265
1400
  peg$silentFails++;
1266
1401
  s0 = peg$parseparenthesesArguments();
@@ -1286,7 +1421,7 @@ function peg$parse(input, options) {
1286
1421
  }
1287
1422
 
1288
1423
  function peg$parsearrayLiteral() {
1289
- var s0, s1, s2, s3, s4, s5;
1424
+ let s0, s1, s2, s3, s4, s5;
1290
1425
 
1291
1426
  peg$silentFails++;
1292
1427
  s0 = peg$currPos;
@@ -1326,7 +1461,7 @@ function peg$parse(input, options) {
1326
1461
  }
1327
1462
 
1328
1463
  function peg$parsearrayEntries() {
1329
- var s0, s1, s2, s3, s4;
1464
+ let s0, s1, s2, s3, s4;
1330
1465
 
1331
1466
  s0 = peg$currPos;
1332
1467
  s1 = peg$currPos;
@@ -1370,7 +1505,7 @@ function peg$parse(input, options) {
1370
1505
  }
1371
1506
 
1372
1507
  function peg$parsearrayEntry() {
1373
- var s0, s1, s2, s3;
1508
+ let s0, s1, s2, s3;
1374
1509
 
1375
1510
  s0 = peg$parsespreadElement();
1376
1511
  if (s0 === peg$FAILED) {
@@ -1408,7 +1543,7 @@ function peg$parse(input, options) {
1408
1543
  }
1409
1544
 
1410
1545
  function peg$parsearrowFunction() {
1411
- var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9;
1546
+ let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9;
1412
1547
 
1413
1548
  s0 = peg$currPos;
1414
1549
  if (input.charCodeAt(peg$currPos) === 40) {
@@ -1490,7 +1625,7 @@ function peg$parse(input, options) {
1490
1625
  }
1491
1626
 
1492
1627
  function peg$parsebitwiseAndExpression() {
1493
- var s0, s1, s2, s3, s4, s5, s6, s7;
1628
+ let s0, s1, s2, s3, s4, s5, s6, s7;
1494
1629
 
1495
1630
  s0 = peg$currPos;
1496
1631
  s1 = peg$parseequalityExpression();
@@ -1562,7 +1697,7 @@ function peg$parse(input, options) {
1562
1697
  }
1563
1698
 
1564
1699
  function peg$parsebitwiseAndOperator() {
1565
- var s0, s1, s2, s3;
1700
+ let s0, s1, s2, s3;
1566
1701
 
1567
1702
  s0 = peg$currPos;
1568
1703
  if (input.charCodeAt(peg$currPos) === 38) {
@@ -1604,7 +1739,7 @@ function peg$parse(input, options) {
1604
1739
  }
1605
1740
 
1606
1741
  function peg$parsebitwiseOrExpression() {
1607
- var s0, s1, s2, s3, s4, s5, s6, s7;
1742
+ let s0, s1, s2, s3, s4, s5, s6, s7;
1608
1743
 
1609
1744
  s0 = peg$currPos;
1610
1745
  s1 = peg$parsebitwiseXorExpression();
@@ -1676,7 +1811,7 @@ function peg$parse(input, options) {
1676
1811
  }
1677
1812
 
1678
1813
  function peg$parsebitwiseOrOperator() {
1679
- var s0, s1, s2, s3;
1814
+ let s0, s1, s2, s3;
1680
1815
 
1681
1816
  s0 = peg$currPos;
1682
1817
  if (input.charCodeAt(peg$currPos) === 124) {
@@ -1718,7 +1853,7 @@ function peg$parse(input, options) {
1718
1853
  }
1719
1854
 
1720
1855
  function peg$parsebitwiseXorExpression() {
1721
- var s0, s1, s2, s3, s4, s5, s6, s7;
1856
+ let s0, s1, s2, s3, s4, s5, s6, s7;
1722
1857
 
1723
1858
  s0 = peg$currPos;
1724
1859
  s1 = peg$parsebitwiseAndExpression();
@@ -1790,7 +1925,7 @@ function peg$parse(input, options) {
1790
1925
  }
1791
1926
 
1792
1927
  function peg$parsebitwiseXorOperator() {
1793
- var s0;
1928
+ let s0;
1794
1929
 
1795
1930
  if (input.charCodeAt(peg$currPos) === 94) {
1796
1931
  s0 = peg$c12;
@@ -1804,7 +1939,7 @@ function peg$parse(input, options) {
1804
1939
  }
1805
1940
 
1806
1941
  function peg$parsecallExpression() {
1807
- var s0, s1, s2, s3;
1942
+ let s0, s1, s2, s3;
1808
1943
 
1809
1944
  peg$silentFails++;
1810
1945
  s0 = peg$currPos;
@@ -1832,7 +1967,7 @@ function peg$parse(input, options) {
1832
1967
  }
1833
1968
 
1834
1969
  function peg$parsecommaExpression() {
1835
- var s0, s1, s2, s3, s4, s5, s6, s7;
1970
+ let s0, s1, s2, s3, s4, s5, s6, s7;
1836
1971
 
1837
1972
  s0 = peg$currPos;
1838
1973
  s1 = peg$currPos;
@@ -1886,7 +2021,7 @@ function peg$parse(input, options) {
1886
2021
  }
1887
2022
 
1888
2023
  function peg$parsecomment() {
1889
- var s0, s1;
2024
+ let s0, s1;
1890
2025
 
1891
2026
  peg$silentFails++;
1892
2027
  s0 = peg$parsemultiLineComment();
@@ -1903,7 +2038,7 @@ function peg$parse(input, options) {
1903
2038
  }
1904
2039
 
1905
2040
  function peg$parsecomputedPropertyAccess() {
1906
- var s0, s1, s2, s3, s4;
2041
+ let s0, s1, s2, s3, s4;
1907
2042
 
1908
2043
  s0 = peg$currPos;
1909
2044
  s1 = peg$parsecomputedPropertySpace();
@@ -1943,7 +2078,7 @@ function peg$parse(input, options) {
1943
2078
  }
1944
2079
 
1945
2080
  function peg$parsecomputedPropertySpace() {
1946
- var s0, s1, s2;
2081
+ let s0, s1, s2;
1947
2082
 
1948
2083
  s0 = peg$parseshellMode();
1949
2084
  if (s0 === peg$FAILED) {
@@ -1972,7 +2107,7 @@ function peg$parse(input, options) {
1972
2107
  }
1973
2108
 
1974
2109
  function peg$parseconditionalExpression() {
1975
- var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10;
2110
+ let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10;
1976
2111
 
1977
2112
  s0 = peg$currPos;
1978
2113
  s1 = peg$parselogicalOrExpression();
@@ -2033,7 +2168,7 @@ function peg$parse(input, options) {
2033
2168
  }
2034
2169
 
2035
2170
  function peg$parsedigits() {
2036
- var s0, s1, s2;
2171
+ let s0, s1, s2;
2037
2172
 
2038
2173
  s0 = peg$currPos;
2039
2174
  s1 = [];
@@ -2069,7 +2204,7 @@ function peg$parse(input, options) {
2069
2204
  }
2070
2205
 
2071
2206
  function peg$parsedoubleArrow() {
2072
- var s0;
2207
+ let s0;
2073
2208
 
2074
2209
  if (input.charCodeAt(peg$currPos) === 8658) {
2075
2210
  s0 = peg$c16;
@@ -2092,7 +2227,7 @@ function peg$parse(input, options) {
2092
2227
  }
2093
2228
 
2094
2229
  function peg$parsedoubleQuoteString() {
2095
- var s0, s1, s2, s3;
2230
+ let s0, s1, s2, s3;
2096
2231
 
2097
2232
  peg$silentFails++;
2098
2233
  s0 = peg$currPos;
@@ -2132,7 +2267,7 @@ function peg$parse(input, options) {
2132
2267
  }
2133
2268
 
2134
2269
  function peg$parsedoubleQuoteStringChar() {
2135
- var s0, s1, s2;
2270
+ let s0, s1, s2;
2136
2271
 
2137
2272
  s0 = peg$currPos;
2138
2273
  s1 = peg$currPos;
@@ -2171,7 +2306,7 @@ function peg$parse(input, options) {
2171
2306
  }
2172
2307
 
2173
2308
  function peg$parseellipsis() {
2174
- var s0, s1;
2309
+ let s0, s1;
2175
2310
 
2176
2311
  if (input.substr(peg$currPos, 3) === peg$c19) {
2177
2312
  s0 = peg$c19;
@@ -2200,7 +2335,7 @@ function peg$parse(input, options) {
2200
2335
  }
2201
2336
 
2202
2337
  function peg$parseequalityExpression() {
2203
- var s0, s1, s2, s3, s4, s5, s6, s7;
2338
+ let s0, s1, s2, s3, s4, s5, s6, s7;
2204
2339
 
2205
2340
  s0 = peg$currPos;
2206
2341
  s1 = peg$parserelationalExpression();
@@ -2252,7 +2387,7 @@ function peg$parse(input, options) {
2252
2387
  }
2253
2388
 
2254
2389
  function peg$parseequalityOperator() {
2255
- var s0;
2390
+ let s0;
2256
2391
 
2257
2392
  if (input.substr(peg$currPos, 3) === peg$c21) {
2258
2393
  s0 = peg$c21;
@@ -2293,7 +2428,7 @@ function peg$parse(input, options) {
2293
2428
  }
2294
2429
 
2295
2430
  function peg$parseescapedChar() {
2296
- var s0, s1, s2;
2431
+ let s0, s1, s2;
2297
2432
 
2298
2433
  peg$silentFails++;
2299
2434
  s0 = peg$currPos;
@@ -2437,7 +2572,7 @@ function peg$parse(input, options) {
2437
2572
  }
2438
2573
 
2439
2574
  function peg$parseexpectBacktick() {
2440
- var s0, s1;
2575
+ let s0, s1;
2441
2576
 
2442
2577
  if (input.charCodeAt(peg$currPos) === 96) {
2443
2578
  s0 = peg$c33;
@@ -2467,7 +2602,7 @@ function peg$parse(input, options) {
2467
2602
  }
2468
2603
 
2469
2604
  function peg$parseexpectClosingBrace() {
2470
- var s0, s1;
2605
+ let s0, s1;
2471
2606
 
2472
2607
  if (input.charCodeAt(peg$currPos) === 125) {
2473
2608
  s0 = peg$c34;
@@ -2497,7 +2632,7 @@ function peg$parse(input, options) {
2497
2632
  }
2498
2633
 
2499
2634
  function peg$parseexpectClosingBracket() {
2500
- var s0, s1;
2635
+ let s0, s1;
2501
2636
 
2502
2637
  if (input.charCodeAt(peg$currPos) === 93) {
2503
2638
  s0 = peg$c7;
@@ -2527,7 +2662,7 @@ function peg$parse(input, options) {
2527
2662
  }
2528
2663
 
2529
2664
  function peg$parseexpectClosingParenthesis() {
2530
- var s0, s1;
2665
+ let s0, s1;
2531
2666
 
2532
2667
  if (input.charCodeAt(peg$currPos) === 41) {
2533
2668
  s0 = peg$c9;
@@ -2557,7 +2692,7 @@ function peg$parse(input, options) {
2557
2692
  }
2558
2693
 
2559
2694
  function peg$parseexpectDoubleQuote() {
2560
- var s0, s1;
2695
+ let s0, s1;
2561
2696
 
2562
2697
  if (input.charCodeAt(peg$currPos) === 34) {
2563
2698
  s0 = peg$c18;
@@ -2587,7 +2722,7 @@ function peg$parse(input, options) {
2587
2722
  }
2588
2723
 
2589
2724
  function peg$parseexpectExpression() {
2590
- var s0, s1;
2725
+ let s0, s1;
2591
2726
 
2592
2727
  s0 = peg$parseexpression();
2593
2728
  if (s0 === peg$FAILED) {
@@ -2611,7 +2746,7 @@ function peg$parse(input, options) {
2611
2746
  }
2612
2747
 
2613
2748
  function peg$parseexpectFrontDelimiter() {
2614
- var s0, s1;
2749
+ let s0, s1;
2615
2750
 
2616
2751
  s0 = peg$parsefrontDelimiter();
2617
2752
  if (s0 === peg$FAILED) {
@@ -2635,7 +2770,7 @@ function peg$parse(input, options) {
2635
2770
  }
2636
2771
 
2637
2772
  function peg$parseexpectGuillemet() {
2638
- var s0, s1;
2773
+ let s0, s1;
2639
2774
 
2640
2775
  if (input.charCodeAt(peg$currPos) === 187) {
2641
2776
  s0 = peg$c35;
@@ -2665,7 +2800,7 @@ function peg$parse(input, options) {
2665
2800
  }
2666
2801
 
2667
2802
  function peg$parseexpectSingleQuote() {
2668
- var s0, s1;
2803
+ let s0, s1;
2669
2804
 
2670
2805
  if (input.charCodeAt(peg$currPos) === 39) {
2671
2806
  s0 = peg$c36;
@@ -2695,7 +2830,7 @@ function peg$parse(input, options) {
2695
2830
  }
2696
2831
 
2697
2832
  function peg$parseexpectPipelineExpression() {
2698
- var s0, s1;
2833
+ let s0, s1;
2699
2834
 
2700
2835
  s0 = peg$parsepipelineExpression();
2701
2836
  if (s0 === peg$FAILED) {
@@ -2719,7 +2854,7 @@ function peg$parse(input, options) {
2719
2854
  }
2720
2855
 
2721
2856
  function peg$parseexpectUnaryExpression() {
2722
- var s0, s1;
2857
+ let s0, s1;
2723
2858
 
2724
2859
  s0 = peg$parseunaryExpression();
2725
2860
  if (s0 === peg$FAILED) {
@@ -2743,7 +2878,7 @@ function peg$parse(input, options) {
2743
2878
  }
2744
2879
 
2745
2880
  function peg$parseexponentiationExpression() {
2746
- var s0, s1, s2, s3, s4, s5, s6;
2881
+ let s0, s1, s2, s3, s4, s5, s6;
2747
2882
 
2748
2883
  s0 = peg$currPos;
2749
2884
  s1 = peg$parseunaryExpression();
@@ -2794,7 +2929,7 @@ function peg$parse(input, options) {
2794
2929
  }
2795
2930
 
2796
2931
  function peg$parseexpression() {
2797
- var s0, s1, s2, s3;
2932
+ let s0, s1, s2, s3;
2798
2933
 
2799
2934
  s0 = peg$currPos;
2800
2935
  s1 = peg$parse__();
@@ -2811,7 +2946,7 @@ function peg$parse(input, options) {
2811
2946
  }
2812
2947
 
2813
2948
  function peg$parsefloatLiteral() {
2814
- var s0, s1, s2, s3;
2949
+ let s0, s1, s2, s3;
2815
2950
 
2816
2951
  peg$silentFails++;
2817
2952
  s0 = peg$currPos;
@@ -2849,7 +2984,7 @@ function peg$parse(input, options) {
2849
2984
  }
2850
2985
 
2851
2986
  function peg$parsefrontDelimiter() {
2852
- var s0;
2987
+ let s0;
2853
2988
 
2854
2989
  if (input.substr(peg$currPos, 4) === peg$c39) {
2855
2990
  s0 = peg$c39;
@@ -2863,7 +2998,7 @@ function peg$parse(input, options) {
2863
2998
  }
2864
2999
 
2865
3000
  function peg$parsefrontMatterExpression() {
2866
- var s0, s1, s2, s3, s4;
3001
+ let s0, s1, s2, s3, s4;
2867
3002
 
2868
3003
  s0 = peg$currPos;
2869
3004
  s1 = peg$parsefrontDelimiter();
@@ -2902,7 +3037,7 @@ function peg$parse(input, options) {
2902
3037
  }
2903
3038
 
2904
3039
  function peg$parsefrontMatterText() {
2905
- var s0, s1, s2, s3, s4;
3040
+ let s0, s1, s2, s3, s4;
2906
3041
 
2907
3042
  s0 = peg$currPos;
2908
3043
  s1 = [];
@@ -2975,7 +3110,7 @@ function peg$parse(input, options) {
2975
3110
  }
2976
3111
 
2977
3112
  function peg$parsefrontMatterYaml() {
2978
- var s0, s1, s2, s3;
3113
+ let s0, s1, s2, s3;
2979
3114
 
2980
3115
  peg$silentFails++;
2981
3116
  s0 = peg$currPos;
@@ -3004,7 +3139,7 @@ function peg$parse(input, options) {
3004
3139
  }
3005
3140
 
3006
3141
  function peg$parsegroup() {
3007
- var s0, s1, s2, s3;
3142
+ let s0, s1, s2, s3;
3008
3143
 
3009
3144
  peg$silentFails++;
3010
3145
  s0 = peg$currPos;
@@ -3044,7 +3179,7 @@ function peg$parse(input, options) {
3044
3179
  }
3045
3180
 
3046
3181
  function peg$parseguillemetString() {
3047
- var s0, s1, s2, s3;
3182
+ let s0, s1, s2, s3;
3048
3183
 
3049
3184
  peg$silentFails++;
3050
3185
  s0 = peg$currPos;
@@ -3084,7 +3219,7 @@ function peg$parse(input, options) {
3084
3219
  }
3085
3220
 
3086
3221
  function peg$parseguillemetStringChar() {
3087
- var s0, s1, s2;
3222
+ let s0, s1, s2;
3088
3223
 
3089
3224
  s0 = peg$currPos;
3090
3225
  s1 = peg$currPos;
@@ -3123,7 +3258,7 @@ function peg$parse(input, options) {
3123
3258
  }
3124
3259
 
3125
3260
  function peg$parsehost() {
3126
- var s0, s1, s2, s3, s4;
3261
+ let s0, s1, s2, s3, s4;
3127
3262
 
3128
3263
  peg$silentFails++;
3129
3264
  s0 = peg$currPos;
@@ -3172,7 +3307,7 @@ function peg$parse(input, options) {
3172
3307
  }
3173
3308
 
3174
3309
  function peg$parsehostname() {
3175
- var s0, s1;
3310
+ let s0, s1;
3176
3311
 
3177
3312
  s0 = peg$currPos;
3178
3313
  s1 = peg$parsekey();
@@ -3186,7 +3321,7 @@ function peg$parse(input, options) {
3186
3321
  }
3187
3322
 
3188
3323
  function peg$parseidentifier() {
3189
- var s0, s1, s2, s3, s4, s5;
3324
+ let s0, s1, s2, s3, s4, s5;
3190
3325
 
3191
3326
  s0 = peg$currPos;
3192
3327
  s1 = peg$currPos;
@@ -3220,7 +3355,7 @@ function peg$parse(input, options) {
3220
3355
  }
3221
3356
 
3222
3357
  function peg$parseidentifierLiteral() {
3223
- var s0, s1;
3358
+ let s0, s1;
3224
3359
 
3225
3360
  s0 = peg$currPos;
3226
3361
  s1 = peg$parseidentifier();
@@ -3234,7 +3369,7 @@ function peg$parse(input, options) {
3234
3369
  }
3235
3370
 
3236
3371
  function peg$parseidentifierPart() {
3237
- var s0, s1, s2;
3372
+ let s0, s1, s2;
3238
3373
 
3239
3374
  peg$silentFails++;
3240
3375
  s0 = peg$currPos;
@@ -3274,7 +3409,7 @@ function peg$parse(input, options) {
3274
3409
  }
3275
3410
 
3276
3411
  function peg$parseidentifierStart() {
3277
- var s0, s1, s2;
3412
+ let s0, s1, s2;
3278
3413
 
3279
3414
  peg$silentFails++;
3280
3415
  s0 = peg$currPos;
@@ -3314,7 +3449,7 @@ function peg$parse(input, options) {
3314
3449
  }
3315
3450
 
3316
3451
  function peg$parseimplicitParenthesesCallExpression() {
3317
- var s0, s1, s2, s3, s4;
3452
+ let s0, s1, s2, s3, s4;
3318
3453
 
3319
3454
  peg$silentFails++;
3320
3455
  s0 = peg$currPos;
@@ -3362,7 +3497,7 @@ function peg$parse(input, options) {
3362
3497
  }
3363
3498
 
3364
3499
  function peg$parseimplicitParensthesesArguments() {
3365
- var s0, s1, s2, s3, s4, s5;
3500
+ let s0, s1, s2, s3, s4, s5;
3366
3501
 
3367
3502
  s0 = peg$currPos;
3368
3503
  s1 = peg$parseshellMode();
@@ -3412,7 +3547,7 @@ function peg$parse(input, options) {
3412
3547
  }
3413
3548
 
3414
3549
  function peg$parseinlineSpace() {
3415
- var s0;
3550
+ let s0;
3416
3551
 
3417
3552
  s0 = input.charAt(peg$currPos);
3418
3553
  if (peg$r2.test(s0)) {
@@ -3426,7 +3561,7 @@ function peg$parse(input, options) {
3426
3561
  }
3427
3562
 
3428
3563
  function peg$parseintegerLiteral() {
3429
- var s0, s1;
3564
+ let s0, s1;
3430
3565
 
3431
3566
  peg$silentFails++;
3432
3567
  s0 = peg$currPos;
@@ -3446,7 +3581,7 @@ function peg$parse(input, options) {
3446
3581
  }
3447
3582
 
3448
3583
  function peg$parsekey() {
3449
- var s0, s1, s2, s3;
3584
+ let s0, s1, s2, s3;
3450
3585
 
3451
3586
  s0 = peg$currPos;
3452
3587
  s1 = peg$parsekeyCharStart();
@@ -3468,7 +3603,7 @@ function peg$parse(input, options) {
3468
3603
  }
3469
3604
 
3470
3605
  function peg$parsekeyChar() {
3471
- var s0;
3606
+ let s0;
3472
3607
 
3473
3608
  s0 = peg$parsekeyCharStart();
3474
3609
  if (s0 === peg$FAILED) {
@@ -3497,7 +3632,7 @@ function peg$parse(input, options) {
3497
3632
  }
3498
3633
 
3499
3634
  function peg$parsekeyCharStart() {
3500
- var s0, s1, s2;
3635
+ let s0, s1, s2;
3501
3636
 
3502
3637
  s0 = peg$currPos;
3503
3638
  if (input.length > peg$currPos) {
@@ -3540,7 +3675,7 @@ function peg$parse(input, options) {
3540
3675
  }
3541
3676
 
3542
3677
  function peg$parselist() {
3543
- var s0, s1, s2, s3, s4;
3678
+ let s0, s1, s2, s3, s4;
3544
3679
 
3545
3680
  peg$silentFails++;
3546
3681
  s0 = peg$currPos;
@@ -3590,7 +3725,7 @@ function peg$parse(input, options) {
3590
3725
  }
3591
3726
 
3592
3727
  function peg$parselogicalAndExpression() {
3593
- var s0, s1, s2, s3, s4, s5, s6, s7;
3728
+ let s0, s1, s2, s3, s4, s5, s6, s7;
3594
3729
 
3595
3730
  s0 = peg$currPos;
3596
3731
  s1 = peg$parsebitwiseOrExpression();
@@ -3654,7 +3789,7 @@ function peg$parse(input, options) {
3654
3789
  }
3655
3790
 
3656
3791
  function peg$parselogicalOrExpression() {
3657
- var s0, s1, s2, s3, s4, s5, s6, s7;
3792
+ let s0, s1, s2, s3, s4, s5, s6, s7;
3658
3793
 
3659
3794
  s0 = peg$currPos;
3660
3795
  s1 = peg$parsenullishCoalescingExpression();
@@ -3718,7 +3853,7 @@ function peg$parse(input, options) {
3718
3853
  }
3719
3854
 
3720
3855
  function peg$parseminus() {
3721
- var s0, s1, s2, s3, s4;
3856
+ let s0, s1, s2, s3, s4;
3722
3857
 
3723
3858
  s0 = peg$currPos;
3724
3859
  if (input.charCodeAt(peg$currPos) === 45) {
@@ -3781,7 +3916,7 @@ function peg$parse(input, options) {
3781
3916
  }
3782
3917
 
3783
3918
  function peg$parsemultiLineComment() {
3784
- var s0, s1, s2, s3, s4, s5;
3919
+ let s0, s1, s2, s3, s4, s5;
3785
3920
 
3786
3921
  s0 = peg$currPos;
3787
3922
  if (input.substr(peg$currPos, 2) === peg$c45) {
@@ -3891,7 +4026,7 @@ function peg$parse(input, options) {
3891
4026
  }
3892
4027
 
3893
4028
  function peg$parsemultiplicativeExpression() {
3894
- var s0, s1, s2, s3, s4, s5, s6, s7;
4029
+ let s0, s1, s2, s3, s4, s5, s6, s7;
3895
4030
 
3896
4031
  s0 = peg$currPos;
3897
4032
  s1 = peg$parseexponentiationExpression();
@@ -3963,7 +4098,7 @@ function peg$parse(input, options) {
3963
4098
  }
3964
4099
 
3965
4100
  function peg$parsemultiplicativeOperator() {
3966
- var s0;
4101
+ let s0;
3967
4102
 
3968
4103
  s0 = input.charAt(peg$currPos);
3969
4104
  if (peg$r6.test(s0)) {
@@ -3977,7 +4112,7 @@ function peg$parse(input, options) {
3977
4112
  }
3978
4113
 
3979
4114
  function peg$parsenewExpression() {
3980
- var s0, s1, s2, s3, s4;
4115
+ let s0, s1, s2, s3, s4;
3981
4116
 
3982
4117
  s0 = peg$currPos;
3983
4118
  if (input.substr(peg$currPos, 3) === peg$c47) {
@@ -4039,7 +4174,7 @@ function peg$parse(input, options) {
4039
4174
  }
4040
4175
 
4041
4176
  function peg$parsenewLine() {
4042
- var s0;
4177
+ let s0;
4043
4178
 
4044
4179
  if (input.charCodeAt(peg$currPos) === 10) {
4045
4180
  s0 = peg$c49;
@@ -4071,7 +4206,7 @@ function peg$parse(input, options) {
4071
4206
  }
4072
4207
 
4073
4208
  function peg$parsenumericLiteral() {
4074
- var s0, s1;
4209
+ let s0, s1;
4075
4210
 
4076
4211
  peg$silentFails++;
4077
4212
  s0 = peg$parsefloatLiteral();
@@ -4088,7 +4223,7 @@ function peg$parse(input, options) {
4088
4223
  }
4089
4224
 
4090
4225
  function peg$parsenullishCoalescingExpression() {
4091
- var s0, s1, s2, s3, s4, s5, s6, s7;
4226
+ let s0, s1, s2, s3, s4, s5, s6, s7;
4092
4227
 
4093
4228
  s0 = peg$currPos;
4094
4229
  s1 = peg$parselogicalAndExpression();
@@ -4152,7 +4287,7 @@ function peg$parse(input, options) {
4152
4287
  }
4153
4288
 
4154
4289
  function peg$parseobjectLiteral() {
4155
- var s0, s1, s2, s3, s4, s5;
4290
+ let s0, s1, s2, s3, s4, s5;
4156
4291
 
4157
4292
  peg$silentFails++;
4158
4293
  s0 = peg$currPos;
@@ -4192,7 +4327,7 @@ function peg$parse(input, options) {
4192
4327
  }
4193
4328
 
4194
4329
  function peg$parseobjectEntries() {
4195
- var s0, s1, s2, s3, s4;
4330
+ let s0, s1, s2, s3, s4;
4196
4331
 
4197
4332
  s0 = peg$currPos;
4198
4333
  s1 = peg$currPos;
@@ -4236,7 +4371,7 @@ function peg$parse(input, options) {
4236
4371
  }
4237
4372
 
4238
4373
  function peg$parseobjectEntry() {
4239
- var s0;
4374
+ let s0;
4240
4375
 
4241
4376
  s0 = peg$parsespreadElement();
4242
4377
  if (s0 === peg$FAILED) {
@@ -4253,7 +4388,7 @@ function peg$parse(input, options) {
4253
4388
  }
4254
4389
 
4255
4390
  function peg$parseobjectGetter() {
4256
- var s0, s1, s2, s3, s4, s5;
4391
+ let s0, s1, s2, s3, s4, s5;
4257
4392
 
4258
4393
  peg$silentFails++;
4259
4394
  s0 = peg$currPos;
@@ -4295,7 +4430,7 @@ function peg$parse(input, options) {
4295
4430
  }
4296
4431
 
4297
4432
  function peg$parseobjectHiddenKey() {
4298
- var s0, s1, s2, s3, s4;
4433
+ let s0, s1, s2, s3, s4;
4299
4434
 
4300
4435
  s0 = peg$currPos;
4301
4436
  s1 = peg$currPos;
@@ -4341,7 +4476,7 @@ function peg$parse(input, options) {
4341
4476
  }
4342
4477
 
4343
4478
  function peg$parseobjectKey() {
4344
- var s0, s1;
4479
+ let s0, s1;
4345
4480
 
4346
4481
  peg$silentFails++;
4347
4482
  s0 = peg$parseobjectHiddenKey();
@@ -4358,7 +4493,7 @@ function peg$parse(input, options) {
4358
4493
  }
4359
4494
 
4360
4495
  function peg$parseobjectProperty() {
4361
- var s0, s1, s2, s3, s4, s5;
4496
+ let s0, s1, s2, s3, s4, s5;
4362
4497
 
4363
4498
  peg$silentFails++;
4364
4499
  s0 = peg$currPos;
@@ -4400,7 +4535,7 @@ function peg$parse(input, options) {
4400
4535
  }
4401
4536
 
4402
4537
  function peg$parseobjectShorthandProperty() {
4403
- var s0, s1;
4538
+ let s0, s1;
4404
4539
 
4405
4540
  peg$silentFails++;
4406
4541
  s0 = peg$currPos;
@@ -4429,7 +4564,7 @@ function peg$parse(input, options) {
4429
4564
  }
4430
4565
 
4431
4566
  function peg$parseobjectPublicKey() {
4432
- var s0, s1, s2;
4567
+ let s0, s1, s2;
4433
4568
 
4434
4569
  s0 = peg$currPos;
4435
4570
  s1 = peg$parsekey();
@@ -4464,7 +4599,7 @@ function peg$parse(input, options) {
4464
4599
  }
4465
4600
 
4466
4601
  function peg$parseoptionalChaining() {
4467
- var s0, s1, s2, s3, s4;
4602
+ let s0, s1, s2, s3, s4;
4468
4603
 
4469
4604
  s0 = peg$currPos;
4470
4605
  s1 = peg$parse__();
@@ -4494,7 +4629,7 @@ function peg$parse(input, options) {
4494
4629
  }
4495
4630
 
4496
4631
  function peg$parseparameter() {
4497
- var s0, s1;
4632
+ let s0, s1;
4498
4633
 
4499
4634
  s0 = peg$currPos;
4500
4635
  s1 = peg$parsekey();
@@ -4508,7 +4643,7 @@ function peg$parse(input, options) {
4508
4643
  }
4509
4644
 
4510
4645
  function peg$parseparameterList() {
4511
- var s0, s1, s2, s3, s4;
4646
+ let s0, s1, s2, s3, s4;
4512
4647
 
4513
4648
  s0 = peg$currPos;
4514
4649
  s1 = peg$currPos;
@@ -4552,7 +4687,7 @@ function peg$parse(input, options) {
4552
4687
  }
4553
4688
 
4554
4689
  function peg$parseparameterSingleton() {
4555
- var s0, s1;
4690
+ let s0, s1;
4556
4691
 
4557
4692
  s0 = peg$currPos;
4558
4693
  s1 = peg$parseparameter();
@@ -4566,7 +4701,7 @@ function peg$parse(input, options) {
4566
4701
  }
4567
4702
 
4568
4703
  function peg$parseparenthesesArguments() {
4569
- var s0, s1, s2, s3, s4, s5;
4704
+ let s0, s1, s2, s3, s4, s5;
4570
4705
 
4571
4706
  peg$silentFails++;
4572
4707
  s0 = peg$currPos;
@@ -4606,7 +4741,7 @@ function peg$parse(input, options) {
4606
4741
  }
4607
4742
 
4608
4743
  function peg$parsepathArguments() {
4609
- var s0, s1, s2;
4744
+ let s0, s1, s2;
4610
4745
 
4611
4746
  s0 = peg$currPos;
4612
4747
  if (input.charCodeAt(peg$currPos) === 47) {
@@ -4632,7 +4767,7 @@ function peg$parse(input, options) {
4632
4767
  }
4633
4768
 
4634
4769
  function peg$parsepathKeys() {
4635
- var s0, s1, s2;
4770
+ let s0, s1, s2;
4636
4771
 
4637
4772
  s0 = peg$currPos;
4638
4773
  s1 = [];
@@ -4652,7 +4787,7 @@ function peg$parse(input, options) {
4652
4787
  }
4653
4788
 
4654
4789
  function peg$parsepathLiteral() {
4655
- var s0, s1;
4790
+ let s0, s1;
4656
4791
 
4657
4792
  s0 = peg$currPos;
4658
4793
  s1 = peg$parsepathKeys();
@@ -4666,7 +4801,7 @@ function peg$parse(input, options) {
4666
4801
  }
4667
4802
 
4668
4803
  function peg$parsepathSegment() {
4669
- var s0, s1, s2;
4804
+ let s0, s1, s2;
4670
4805
 
4671
4806
  s0 = peg$currPos;
4672
4807
  s1 = peg$parsekey();
@@ -4707,7 +4842,7 @@ function peg$parse(input, options) {
4707
4842
  }
4708
4843
 
4709
4844
  function peg$parsepipelineExpression() {
4710
- var s0, s1, s2, s3, s4, s5, s6, s7;
4845
+ let s0, s1, s2, s3, s4, s5, s6, s7;
4711
4846
 
4712
4847
  s0 = peg$currPos;
4713
4848
  s1 = peg$parseshorthandFunction();
@@ -4759,7 +4894,7 @@ function peg$parse(input, options) {
4759
4894
  }
4760
4895
 
4761
4896
  function peg$parseprimary() {
4762
- var s0, s1, s2, s3;
4897
+ let s0, s1, s2, s3;
4763
4898
 
4764
4899
  s0 = peg$parsestringLiteral();
4765
4900
  if (s0 === peg$FAILED) {
@@ -4813,7 +4948,7 @@ function peg$parse(input, options) {
4813
4948
  }
4814
4949
 
4815
4950
  function peg$parseprogram() {
4816
- var s0, s1, s2;
4951
+ let s0, s1, s2;
4817
4952
 
4818
4953
  peg$silentFails++;
4819
4954
  s0 = peg$currPos;
@@ -4838,7 +4973,7 @@ function peg$parse(input, options) {
4838
4973
  }
4839
4974
 
4840
4975
  function peg$parseprogramMode() {
4841
- var s0;
4976
+ let s0;
4842
4977
 
4843
4978
  peg$savedPos = peg$currPos;
4844
4979
  s0 = peg$f84();
@@ -4852,7 +4987,7 @@ function peg$parse(input, options) {
4852
4987
  }
4853
4988
 
4854
4989
  function peg$parsepropertyAccess() {
4855
- var s0, s1, s2, s3, s4;
4990
+ let s0, s1, s2, s3, s4;
4856
4991
 
4857
4992
  s0 = peg$currPos;
4858
4993
  s1 = peg$parsewhitespaceOptionalForProgram();
@@ -4892,7 +5027,7 @@ function peg$parse(input, options) {
4892
5027
  }
4893
5028
 
4894
5029
  function peg$parseregexFlags() {
4895
- var s0, s1, s2;
5030
+ let s0, s1, s2;
4896
5031
 
4897
5032
  s0 = peg$currPos;
4898
5033
  s1 = [];
@@ -4921,7 +5056,7 @@ function peg$parse(input, options) {
4921
5056
  }
4922
5057
 
4923
5058
  function peg$parseregexLiteral() {
4924
- var s0, s1, s2, s3, s4;
5059
+ let s0, s1, s2, s3, s4;
4925
5060
 
4926
5061
  s0 = peg$currPos;
4927
5062
  if (input.charCodeAt(peg$currPos) === 47) {
@@ -4962,7 +5097,7 @@ function peg$parse(input, options) {
4962
5097
  }
4963
5098
 
4964
5099
  function peg$parseregexLiteralChar() {
4965
- var s0;
5100
+ let s0;
4966
5101
 
4967
5102
  s0 = input.charAt(peg$currPos);
4968
5103
  if (peg$r8.test(s0)) {
@@ -4979,7 +5114,7 @@ function peg$parse(input, options) {
4979
5114
  }
4980
5115
 
4981
5116
  function peg$parserelationalExpression() {
4982
- var s0, s1, s2, s3, s4, s5, s6, s7;
5117
+ let s0, s1, s2, s3, s4, s5, s6, s7;
4983
5118
 
4984
5119
  s0 = peg$currPos;
4985
5120
  s1 = peg$parseshiftExpression();
@@ -5041,7 +5176,7 @@ function peg$parse(input, options) {
5041
5176
  }
5042
5177
 
5043
5178
  function peg$parserelationalOperator() {
5044
- var s0;
5179
+ let s0;
5045
5180
 
5046
5181
  if (input.substr(peg$currPos, 2) === peg$c56) {
5047
5182
  s0 = peg$c56;
@@ -5082,7 +5217,7 @@ function peg$parse(input, options) {
5082
5217
  }
5083
5218
 
5084
5219
  function peg$parseseparator() {
5085
- var s0, s1, s2, s3;
5220
+ let s0, s1, s2, s3;
5086
5221
 
5087
5222
  s0 = peg$currPos;
5088
5223
  s1 = peg$parse__();
@@ -5116,7 +5251,7 @@ function peg$parse(input, options) {
5116
5251
  }
5117
5252
 
5118
5253
  function peg$parseshebang() {
5119
- var s0, s1, s2, s3;
5254
+ let s0, s1, s2, s3;
5120
5255
 
5121
5256
  s0 = peg$currPos;
5122
5257
  if (input.substr(peg$currPos, 2) === peg$c58) {
@@ -5156,7 +5291,7 @@ function peg$parse(input, options) {
5156
5291
  }
5157
5292
 
5158
5293
  function peg$parseshellMode() {
5159
- var s0;
5294
+ let s0;
5160
5295
 
5161
5296
  peg$savedPos = peg$currPos;
5162
5297
  s0 = peg$f90();
@@ -5170,7 +5305,7 @@ function peg$parse(input, options) {
5170
5305
  }
5171
5306
 
5172
5307
  function peg$parseshiftExpression() {
5173
- var s0, s1, s2, s3, s4, s5, s6, s7;
5308
+ let s0, s1, s2, s3, s4, s5, s6, s7;
5174
5309
 
5175
5310
  s0 = peg$currPos;
5176
5311
  s1 = peg$parseadditiveExpression();
@@ -5222,7 +5357,7 @@ function peg$parse(input, options) {
5222
5357
  }
5223
5358
 
5224
5359
  function peg$parseshiftOperator() {
5225
- var s0;
5360
+ let s0;
5226
5361
 
5227
5362
  if (input.substr(peg$currPos, 2) === peg$c59) {
5228
5363
  s0 = peg$c59;
@@ -5254,7 +5389,7 @@ function peg$parse(input, options) {
5254
5389
  }
5255
5390
 
5256
5391
  function peg$parseshorthandFunction() {
5257
- var s0, s1, s2, s3, s4, s5;
5392
+ let s0, s1, s2, s3, s4, s5;
5258
5393
 
5259
5394
  peg$silentFails++;
5260
5395
  s0 = peg$currPos;
@@ -5322,7 +5457,7 @@ function peg$parse(input, options) {
5322
5457
  }
5323
5458
 
5324
5459
  function peg$parsesingleArrow() {
5325
- var s0;
5460
+ let s0;
5326
5461
 
5327
5462
  if (input.charCodeAt(peg$currPos) === 8594) {
5328
5463
  s0 = peg$c62;
@@ -5345,7 +5480,7 @@ function peg$parse(input, options) {
5345
5480
  }
5346
5481
 
5347
5482
  function peg$parsesingleLineComment() {
5348
- var s0, s1, s2, s3;
5483
+ let s0, s1, s2, s3;
5349
5484
 
5350
5485
  s0 = peg$currPos;
5351
5486
  if (input.substr(peg$currPos, 2) === peg$c2) {
@@ -5385,7 +5520,7 @@ function peg$parse(input, options) {
5385
5520
  }
5386
5521
 
5387
5522
  function peg$parsesingleQuoteString() {
5388
- var s0, s1, s2, s3;
5523
+ let s0, s1, s2, s3;
5389
5524
 
5390
5525
  peg$silentFails++;
5391
5526
  s0 = peg$currPos;
@@ -5425,7 +5560,7 @@ function peg$parse(input, options) {
5425
5560
  }
5426
5561
 
5427
5562
  function peg$parsesingleQuoteStringChar() {
5428
- var s0, s1, s2;
5563
+ let s0, s1, s2;
5429
5564
 
5430
5565
  s0 = peg$currPos;
5431
5566
  s1 = peg$currPos;
@@ -5464,7 +5599,7 @@ function peg$parse(input, options) {
5464
5599
  }
5465
5600
 
5466
5601
  function peg$parseslash() {
5467
- var s0, s1;
5602
+ let s0, s1;
5468
5603
 
5469
5604
  s0 = peg$currPos;
5470
5605
  s1 = peg$parseslashFollows();
@@ -5478,7 +5613,7 @@ function peg$parse(input, options) {
5478
5613
  }
5479
5614
 
5480
5615
  function peg$parseslashes() {
5481
- var s0, s1, s2;
5616
+ let s0, s1, s2;
5482
5617
 
5483
5618
  s0 = peg$currPos;
5484
5619
  s1 = [];
@@ -5513,7 +5648,7 @@ function peg$parse(input, options) {
5513
5648
  }
5514
5649
 
5515
5650
  function peg$parseslashFollows() {
5516
- var s0, s1, s2;
5651
+ let s0, s1, s2;
5517
5652
 
5518
5653
  s0 = peg$currPos;
5519
5654
  s1 = peg$currPos;
@@ -5542,7 +5677,7 @@ function peg$parse(input, options) {
5542
5677
  }
5543
5678
 
5544
5679
  function peg$parsespreadElement() {
5545
- var s0, s1, s2, s3;
5680
+ let s0, s1, s2, s3;
5546
5681
 
5547
5682
  s0 = peg$currPos;
5548
5683
  s1 = peg$parseellipsis();
@@ -5565,7 +5700,7 @@ function peg$parse(input, options) {
5565
5700
  }
5566
5701
 
5567
5702
  function peg$parsestringLiteral() {
5568
- var s0, s1, s2;
5703
+ let s0, s1, s2;
5569
5704
 
5570
5705
  peg$silentFails++;
5571
5706
  s0 = peg$parsedoubleQuoteString();
@@ -5598,7 +5733,7 @@ function peg$parse(input, options) {
5598
5733
  }
5599
5734
 
5600
5735
  function peg$parsetemplateBody() {
5601
- var s0, s1, s2, s3, s4, s5;
5736
+ let s0, s1, s2, s3, s4, s5;
5602
5737
 
5603
5738
  peg$silentFails++;
5604
5739
  s0 = peg$currPos;
@@ -5630,14 +5765,12 @@ function peg$parse(input, options) {
5630
5765
  peg$savedPos = s0;
5631
5766
  s0 = peg$f99(s1, s2);
5632
5767
  peg$silentFails--;
5633
- s1 = peg$FAILED;
5634
- if (peg$silentFails === 0) { peg$fail(peg$e102); }
5635
5768
 
5636
5769
  return s0;
5637
5770
  }
5638
5771
 
5639
5772
  function peg$parsetemplateBodyChar() {
5640
- var s0, s1, s2;
5773
+ let s0, s1, s2;
5641
5774
 
5642
5775
  s0 = peg$currPos;
5643
5776
  s1 = peg$currPos;
@@ -5647,7 +5780,7 @@ function peg$parse(input, options) {
5647
5780
  peg$currPos += 2;
5648
5781
  } else {
5649
5782
  s2 = peg$FAILED;
5650
- if (peg$silentFails === 0) { peg$fail(peg$e103); }
5783
+ if (peg$silentFails === 0) { peg$fail(peg$e102); }
5651
5784
  }
5652
5785
  peg$silentFails--;
5653
5786
  if (s2 === peg$FAILED) {
@@ -5673,7 +5806,7 @@ function peg$parse(input, options) {
5673
5806
  }
5674
5807
 
5675
5808
  function peg$parsetemplateBodyText() {
5676
- var s0, s1, s2;
5809
+ let s0, s1, s2;
5677
5810
 
5678
5811
  peg$silentFails++;
5679
5812
  s0 = peg$currPos;
@@ -5687,14 +5820,12 @@ function peg$parse(input, options) {
5687
5820
  s1 = peg$f100(s1);
5688
5821
  s0 = s1;
5689
5822
  peg$silentFails--;
5690
- s1 = peg$FAILED;
5691
- if (peg$silentFails === 0) { peg$fail(peg$e104); }
5692
5823
 
5693
5824
  return s0;
5694
5825
  }
5695
5826
 
5696
5827
  function peg$parsetemplateDocument() {
5697
- var s0, s1, s2, s3;
5828
+ let s0, s1, s2, s3;
5698
5829
 
5699
5830
  peg$silentFails++;
5700
5831
  s0 = peg$currPos;
@@ -5730,14 +5861,14 @@ function peg$parse(input, options) {
5730
5861
  peg$silentFails--;
5731
5862
  if (s0 === peg$FAILED) {
5732
5863
  s1 = peg$FAILED;
5733
- if (peg$silentFails === 0) { peg$fail(peg$e105); }
5864
+ if (peg$silentFails === 0) { peg$fail(peg$e103); }
5734
5865
  }
5735
5866
 
5736
5867
  return s0;
5737
5868
  }
5738
5869
 
5739
5870
  function peg$parsetemplateLiteral() {
5740
- var s0, s1, s2, s3, s4, s5, s6;
5871
+ let s0, s1, s2, s3, s4, s5, s6;
5741
5872
 
5742
5873
  peg$silentFails++;
5743
5874
  s0 = peg$currPos;
@@ -5789,14 +5920,14 @@ function peg$parse(input, options) {
5789
5920
  peg$silentFails--;
5790
5921
  if (s0 === peg$FAILED) {
5791
5922
  s1 = peg$FAILED;
5792
- if (peg$silentFails === 0) { peg$fail(peg$e106); }
5923
+ if (peg$silentFails === 0) { peg$fail(peg$e104); }
5793
5924
  }
5794
5925
 
5795
5926
  return s0;
5796
5927
  }
5797
5928
 
5798
5929
  function peg$parsetemplateLiteralChar() {
5799
- var s0, s1, s2;
5930
+ let s0, s1, s2;
5800
5931
 
5801
5932
  s0 = peg$currPos;
5802
5933
  s1 = peg$currPos;
@@ -5814,7 +5945,7 @@ function peg$parse(input, options) {
5814
5945
  peg$currPos += 2;
5815
5946
  } else {
5816
5947
  s2 = peg$FAILED;
5817
- if (peg$silentFails === 0) { peg$fail(peg$e103); }
5948
+ if (peg$silentFails === 0) { peg$fail(peg$e102); }
5818
5949
  }
5819
5950
  }
5820
5951
  peg$silentFails--;
@@ -5841,7 +5972,7 @@ function peg$parse(input, options) {
5841
5972
  }
5842
5973
 
5843
5974
  function peg$parsetemplateLiteralText() {
5844
- var s0, s1, s2;
5975
+ let s0, s1, s2;
5845
5976
 
5846
5977
  s0 = peg$currPos;
5847
5978
  s1 = [];
@@ -5858,7 +5989,7 @@ function peg$parse(input, options) {
5858
5989
  }
5859
5990
 
5860
5991
  function peg$parsetemplateSubstitution() {
5861
- var s0, s1, s2, s3;
5992
+ let s0, s1, s2, s3;
5862
5993
 
5863
5994
  peg$silentFails++;
5864
5995
  s0 = peg$currPos;
@@ -5867,7 +5998,7 @@ function peg$parse(input, options) {
5867
5998
  peg$currPos += 2;
5868
5999
  } else {
5869
6000
  s1 = peg$FAILED;
5870
- if (peg$silentFails === 0) { peg$fail(peg$e103); }
6001
+ if (peg$silentFails === 0) { peg$fail(peg$e102); }
5871
6002
  }
5872
6003
  if (s1 !== peg$FAILED) {
5873
6004
  s2 = peg$parseexpectExpression();
@@ -5897,14 +6028,14 @@ function peg$parse(input, options) {
5897
6028
  peg$silentFails--;
5898
6029
  if (s0 === peg$FAILED) {
5899
6030
  s1 = peg$FAILED;
5900
- if (peg$silentFails === 0) { peg$fail(peg$e107); }
6031
+ if (peg$silentFails === 0) { peg$fail(peg$e105); }
5901
6032
  }
5902
6033
 
5903
6034
  return s0;
5904
6035
  }
5905
6036
 
5906
6037
  function peg$parsetextChar() {
5907
- var s0;
6038
+ let s0;
5908
6039
 
5909
6040
  s0 = peg$parseescapedChar();
5910
6041
  if (s0 === peg$FAILED) {
@@ -5921,7 +6052,7 @@ function peg$parse(input, options) {
5921
6052
  }
5922
6053
 
5923
6054
  function peg$parseunaryExpression() {
5924
- var s0, s1, s2, s3;
6055
+ let s0, s1, s2, s3;
5925
6056
 
5926
6057
  s0 = peg$currPos;
5927
6058
  s1 = peg$parseunaryOperator();
@@ -5947,7 +6078,7 @@ function peg$parse(input, options) {
5947
6078
  }
5948
6079
 
5949
6080
  function peg$parseuri() {
5950
- var s0, s1, s2, s3, s4, s5, s6;
6081
+ let s0, s1, s2, s3, s4, s5, s6;
5951
6082
 
5952
6083
  s0 = peg$currPos;
5953
6084
  s1 = peg$parseuriScheme();
@@ -6022,7 +6153,7 @@ function peg$parse(input, options) {
6022
6153
  }
6023
6154
 
6024
6155
  function peg$parseuriExpression() {
6025
- var s0;
6156
+ let s0;
6026
6157
 
6027
6158
  s0 = peg$parseuri();
6028
6159
  if (s0 === peg$FAILED) {
@@ -6036,7 +6167,7 @@ function peg$parse(input, options) {
6036
6167
  }
6037
6168
 
6038
6169
  function peg$parseuriKey() {
6039
- var s0, s1, s2;
6170
+ let s0, s1, s2;
6040
6171
 
6041
6172
  s0 = peg$currPos;
6042
6173
  s1 = [];
@@ -6086,7 +6217,7 @@ function peg$parse(input, options) {
6086
6217
  }
6087
6218
 
6088
6219
  function peg$parseuriKeyChar() {
6089
- var s0, s1, s2, s3;
6220
+ let s0, s1, s2, s3;
6090
6221
 
6091
6222
  s0 = peg$currPos;
6092
6223
  s1 = input.charAt(peg$currPos);
@@ -6094,7 +6225,7 @@ function peg$parse(input, options) {
6094
6225
  peg$currPos++;
6095
6226
  } else {
6096
6227
  s1 = peg$FAILED;
6097
- if (peg$silentFails === 0) { peg$fail(peg$e108); }
6228
+ if (peg$silentFails === 0) { peg$fail(peg$e106); }
6098
6229
  }
6099
6230
  if (s1 !== peg$FAILED) {
6100
6231
  s2 = peg$currPos;
@@ -6132,7 +6263,7 @@ function peg$parse(input, options) {
6132
6263
  }
6133
6264
 
6134
6265
  function peg$parseuriPath() {
6135
- var s0, s1, s2, s3;
6266
+ let s0, s1, s2, s3;
6136
6267
 
6137
6268
  peg$silentFails++;
6138
6269
  s0 = peg$currPos;
@@ -6157,14 +6288,14 @@ function peg$parse(input, options) {
6157
6288
  peg$silentFails--;
6158
6289
  if (s0 === peg$FAILED) {
6159
6290
  s1 = peg$FAILED;
6160
- if (peg$silentFails === 0) { peg$fail(peg$e109); }
6291
+ if (peg$silentFails === 0) { peg$fail(peg$e107); }
6161
6292
  }
6162
6293
 
6163
6294
  return s0;
6164
6295
  }
6165
6296
 
6166
6297
  function peg$parseuriScheme() {
6167
- var s0, s1, s2, s3;
6298
+ let s0, s1, s2, s3;
6168
6299
 
6169
6300
  s0 = peg$currPos;
6170
6301
  s1 = input.charAt(peg$currPos);
@@ -6172,7 +6303,7 @@ function peg$parse(input, options) {
6172
6303
  peg$currPos++;
6173
6304
  } else {
6174
6305
  s1 = peg$FAILED;
6175
- if (peg$silentFails === 0) { peg$fail(peg$e110); }
6306
+ if (peg$silentFails === 0) { peg$fail(peg$e108); }
6176
6307
  }
6177
6308
  if (s1 !== peg$FAILED) {
6178
6309
  s2 = [];
@@ -6181,7 +6312,7 @@ function peg$parse(input, options) {
6181
6312
  peg$currPos++;
6182
6313
  } else {
6183
6314
  s3 = peg$FAILED;
6184
- if (peg$silentFails === 0) { peg$fail(peg$e111); }
6315
+ if (peg$silentFails === 0) { peg$fail(peg$e109); }
6185
6316
  }
6186
6317
  while (s3 !== peg$FAILED) {
6187
6318
  s2.push(s3);
@@ -6190,7 +6321,7 @@ function peg$parse(input, options) {
6190
6321
  peg$currPos++;
6191
6322
  } else {
6192
6323
  s3 = peg$FAILED;
6193
- if (peg$silentFails === 0) { peg$fail(peg$e111); }
6324
+ if (peg$silentFails === 0) { peg$fail(peg$e109); }
6194
6325
  }
6195
6326
  }
6196
6327
  s3 = input.charAt(peg$currPos);
@@ -6198,7 +6329,7 @@ function peg$parse(input, options) {
6198
6329
  peg$currPos++;
6199
6330
  } else {
6200
6331
  s3 = peg$FAILED;
6201
- if (peg$silentFails === 0) { peg$fail(peg$e112); }
6332
+ if (peg$silentFails === 0) { peg$fail(peg$e110); }
6202
6333
  }
6203
6334
  if (s3 !== peg$FAILED) {
6204
6335
  peg$savedPos = s0;
@@ -6216,7 +6347,7 @@ function peg$parse(input, options) {
6216
6347
  }
6217
6348
 
6218
6349
  function peg$parseunaryOperator() {
6219
- var s0, s1, s2, s3;
6350
+ let s0, s1, s2, s3;
6220
6351
 
6221
6352
  s0 = input.charAt(peg$currPos);
6222
6353
  if (peg$r3.test(s0)) {
@@ -6232,7 +6363,7 @@ function peg$parse(input, options) {
6232
6363
  peg$currPos++;
6233
6364
  } else {
6234
6365
  s1 = peg$FAILED;
6235
- if (peg$silentFails === 0) { peg$fail(peg$e113); }
6366
+ if (peg$silentFails === 0) { peg$fail(peg$e111); }
6236
6367
  }
6237
6368
  if (s1 !== peg$FAILED) {
6238
6369
  s2 = peg$currPos;
@@ -6242,7 +6373,7 @@ function peg$parse(input, options) {
6242
6373
  peg$currPos++;
6243
6374
  } else {
6244
6375
  s3 = peg$FAILED;
6245
- if (peg$silentFails === 0) { peg$fail(peg$e114); }
6376
+ if (peg$silentFails === 0) { peg$fail(peg$e112); }
6246
6377
  }
6247
6378
  peg$silentFails--;
6248
6379
  if (s3 === peg$FAILED) {
@@ -6270,7 +6401,7 @@ function peg$parse(input, options) {
6270
6401
  }
6271
6402
 
6272
6403
  function peg$parsewhitespace() {
6273
- var s0, s1;
6404
+ let s0, s1;
6274
6405
 
6275
6406
  s0 = [];
6276
6407
  s1 = peg$parsewhitespaceChar();
@@ -6293,7 +6424,7 @@ function peg$parse(input, options) {
6293
6424
  }
6294
6425
 
6295
6426
  function peg$parsewhitespaceChar() {
6296
- var s0, s1, s2;
6427
+ let s0, s1, s2;
6297
6428
 
6298
6429
  s0 = peg$currPos;
6299
6430
  if (input.length > peg$currPos) {
@@ -6327,7 +6458,7 @@ function peg$parse(input, options) {
6327
6458
  }
6328
6459
 
6329
6460
  function peg$parsewhitespaceOptionalForProgram() {
6330
- var s0, s1, s2;
6461
+ let s0, s1, s2;
6331
6462
 
6332
6463
  s0 = peg$currPos;
6333
6464
  s1 = peg$parseprogramMode();
@@ -6347,7 +6478,7 @@ function peg$parse(input, options) {
6347
6478
  }
6348
6479
 
6349
6480
  function peg$parsewhitespaceWithNewLine() {
6350
- var s0, s1, s2, s3, s4;
6481
+ let s0, s1, s2, s3, s4;
6351
6482
 
6352
6483
  s0 = peg$currPos;
6353
6484
  s1 = [];
@@ -6375,30 +6506,36 @@ function peg$parse(input, options) {
6375
6506
 
6376
6507
  peg$result = peg$startRuleFunction();
6377
6508
 
6378
- if (options.peg$library) {
6379
- return /** @type {any} */ ({
6380
- peg$result,
6381
- peg$currPos,
6382
- peg$FAILED,
6383
- peg$maxFailExpected,
6384
- peg$maxFailPos
6385
- });
6386
- }
6387
- if (peg$result !== peg$FAILED && peg$currPos === input.length) {
6388
- return peg$result;
6389
- } else {
6509
+ const peg$success = (peg$result !== peg$FAILED && peg$currPos === input.length);
6510
+ function peg$throw() {
6390
6511
  if (peg$result !== peg$FAILED && peg$currPos < input.length) {
6391
6512
  peg$fail(peg$endExpectation());
6392
6513
  }
6393
6514
 
6394
6515
  throw peg$buildStructuredError(
6395
6516
  peg$maxFailExpected,
6396
- peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,
6517
+ peg$maxFailPos < input.length ? peg$getUnicode(peg$maxFailPos) : null,
6397
6518
  peg$maxFailPos < input.length
6398
6519
  ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)
6399
6520
  : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)
6400
6521
  );
6401
6522
  }
6523
+ if (options.peg$library) {
6524
+ return /** @type {any} */ ({
6525
+ peg$result,
6526
+ peg$currPos,
6527
+ peg$FAILED,
6528
+ peg$maxFailExpected,
6529
+ peg$maxFailPos,
6530
+ peg$success,
6531
+ peg$throw: peg$success ? undefined : peg$throw,
6532
+ });
6533
+ }
6534
+ if (peg$success) {
6535
+ return peg$result;
6536
+ } else {
6537
+ peg$throw();
6538
+ }
6402
6539
  }
6403
6540
 
6404
6541
  const peg$allowedStartRules = [