@env-spec/parser 0.0.2 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { __name, ParsedEnvSpecCommentBlock, ParsedEnvSpecDivider, ParsedEnvSpecComment, ParsedEnvSpecBlankLine, ParsedEnvSpecDecoratorComment, ParsedEnvSpecConfigItem, ParsedEnvSpecFile, ParsedEnvSpecFunctionArgs, ParsedEnvSpecDecorator, ParsedEnvSpecFunctionCall, ParsedEnvSpecKeyValuePair, ParsedEnvSpecStaticValue } from './chunk-FWOHTEQS.mjs';
2
- export { ParsedEnvSpecBlankLine, ParsedEnvSpecComment, ParsedEnvSpecCommentBlock, ParsedEnvSpecConfigItem, ParsedEnvSpecDecorator, ParsedEnvSpecDecoratorComment, ParsedEnvSpecDivider, ParsedEnvSpecFile, ParsedEnvSpecFunctionArgs, ParsedEnvSpecFunctionCall, ParsedEnvSpecKeyValuePair, ParsedEnvSpecStaticValue, expand } from './chunk-FWOHTEQS.mjs';
1
+ import { __name, ParsedEnvSpecCommentBlock, ParsedEnvSpecDivider, ParsedEnvSpecComment, ParsedEnvSpecBlankLine, ParsedEnvSpecDecoratorComment, ParsedEnvSpecConfigItem, ParsedEnvSpecFile, ParsedEnvSpecFunctionArgs, ParsedEnvSpecDecorator, ParsedEnvSpecFunctionCall, ParsedEnvSpecKeyValuePair, ParsedEnvSpecStaticValue } from './chunk-RQYYQO3M.mjs';
2
+ export { ParsedEnvSpecBlankLine, ParsedEnvSpecComment, ParsedEnvSpecCommentBlock, ParsedEnvSpecConfigItem, ParsedEnvSpecDecorator, ParsedEnvSpecDecoratorComment, ParsedEnvSpecDivider, ParsedEnvSpecFile, ParsedEnvSpecFunctionArgs, ParsedEnvSpecFunctionCall, ParsedEnvSpecKeyValuePair, ParsedEnvSpecStaticValue, expand } from './chunk-RQYYQO3M.mjs';
3
3
 
4
4
  // src/updater.ts
5
5
  function ensureHeader(file, newHeaderContents) {
@@ -123,223 +123,204 @@ var envSpecUpdater = {
123
123
  };
124
124
 
125
125
  // src/grammar.js
126
- function peg$subclass(child, parent) {
127
- function C() {
128
- this.constructor = child;
129
- }
130
- __name(C, "C");
131
- C.prototype = parent.prototype;
132
- child.prototype = new C();
133
- }
134
- __name(peg$subclass, "peg$subclass");
135
- function peg$SyntaxError(message, expected, found, location) {
136
- var self = Error.call(this, message);
137
- if (Object.setPrototypeOf) {
138
- Object.setPrototypeOf(self, peg$SyntaxError.prototype);
139
- }
140
- self.expected = expected;
141
- self.found = found;
142
- self.location = location;
143
- self.name = "SyntaxError";
144
- return self;
145
- }
146
- __name(peg$SyntaxError, "peg$SyntaxError");
147
- peg$subclass(peg$SyntaxError, Error);
148
- function peg$padEnd(str, targetLength, padString) {
149
- padString = padString || " ";
150
- if (str.length > targetLength) {
126
+ var peg$SyntaxError = class extends SyntaxError {
127
+ static {
128
+ __name(this, "peg$SyntaxError");
129
+ }
130
+ constructor(message, expected, found, location) {
131
+ super(message);
132
+ this.expected = expected;
133
+ this.found = found;
134
+ this.location = location;
135
+ this.name = "SyntaxError";
136
+ }
137
+ format(sources) {
138
+ let str = "Error: " + this.message;
139
+ if (this.location) {
140
+ let src = null;
141
+ const st = sources.find((s2) => s2.source === this.location.source);
142
+ if (st) {
143
+ src = st.text.split(/\r\n|\n|\r/g);
144
+ }
145
+ const s = this.location.start;
146
+ const offset_s = this.location.source && typeof this.location.source.offset === "function" ? this.location.source.offset(s) : s;
147
+ const loc = this.location.source + ":" + offset_s.line + ":" + offset_s.column;
148
+ if (src) {
149
+ const e = this.location.end;
150
+ const filler = "".padEnd(offset_s.line.toString().length, " ");
151
+ const line = src[s.line - 1];
152
+ const last = s.line === e.line ? e.column : line.length + 1;
153
+ const hatLen = last - s.column || 1;
154
+ str += "\n --> " + loc + "\n" + filler + " |\n" + offset_s.line + " | " + line + "\n" + filler + " | " + "".padEnd(s.column - 1, " ") + "".padEnd(hatLen, "^");
155
+ } else {
156
+ str += "\n at " + loc;
157
+ }
158
+ }
151
159
  return str;
152
160
  }
153
- targetLength -= str.length;
154
- padString += padString.repeat(targetLength);
155
- return str + padString.slice(0, targetLength);
156
- }
157
- __name(peg$padEnd, "peg$padEnd");
158
- peg$SyntaxError.prototype.format = function(sources) {
159
- var str = "Error: " + this.message;
160
- if (this.location) {
161
- var src = null;
162
- var k;
163
- for (k = 0; k < sources.length; k++) {
164
- if (sources[k].source === this.location.source) {
165
- src = sources[k].text.split(/\r\n|\n|\r/g);
166
- break;
167
- }
168
- }
169
- var s = this.location.start;
170
- var offset_s = this.location.source && typeof this.location.source.offset === "function" ? this.location.source.offset(s) : s;
171
- var loc = this.location.source + ":" + offset_s.line + ":" + offset_s.column;
172
- if (src) {
173
- var e = this.location.end;
174
- var filler = peg$padEnd("", offset_s.line.toString().length, " ");
175
- var line = src[s.line - 1];
176
- var last = s.line === e.line ? e.column : line.length + 1;
177
- var hatLen = last - s.column || 1;
178
- str += "\n --> " + loc + "\n" + filler + " |\n" + offset_s.line + " | " + line + "\n" + filler + " | " + peg$padEnd("", s.column - 1, " ") + peg$padEnd("", hatLen, "^");
179
- } else {
180
- str += "\n at " + loc;
161
+ static buildMessage(expected, found) {
162
+ function hex(ch) {
163
+ return ch.codePointAt(0).toString(16).toUpperCase();
181
164
  }
182
- }
183
- return str;
184
- };
185
- peg$SyntaxError.buildMessage = function(expected, found) {
186
- var DESCRIBE_EXPECTATION_FNS = {
187
- literal: /* @__PURE__ */ __name(function(expectation) {
188
- return '"' + literalEscape(expectation.text) + '"';
189
- }, "literal"),
190
- class: /* @__PURE__ */ __name(function(expectation) {
191
- var escapedParts = expectation.parts.map(function(part) {
192
- return Array.isArray(part) ? classEscape(part[0]) + "-" + classEscape(part[1]) : classEscape(part);
193
- });
194
- return "[" + (expectation.inverted ? "^" : "") + escapedParts.join("") + "]";
195
- }, "class"),
196
- any: /* @__PURE__ */ __name(function() {
197
- return "any character";
198
- }, "any"),
199
- end: /* @__PURE__ */ __name(function() {
200
- return "end of input";
201
- }, "end"),
202
- other: /* @__PURE__ */ __name(function(expectation) {
203
- return expectation.description;
204
- }, "other")
205
- };
206
- function hex(ch) {
207
- return ch.charCodeAt(0).toString(16).toUpperCase();
208
- }
209
- __name(hex, "hex");
210
- function literalEscape(s) {
211
- return s.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, function(ch) {
212
- return "\\x0" + hex(ch);
213
- }).replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) {
214
- return "\\x" + hex(ch);
215
- });
216
- }
217
- __name(literalEscape, "literalEscape");
218
- function classEscape(s) {
219
- return s.replace(/\\/g, "\\\\").replace(/\]/g, "\\]").replace(/\^/g, "\\^").replace(/-/g, "\\-").replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, function(ch) {
220
- return "\\x0" + hex(ch);
221
- }).replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) {
222
- return "\\x" + hex(ch);
223
- });
224
- }
225
- __name(classEscape, "classEscape");
226
- function describeExpectation(expectation) {
227
- return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
228
- }
229
- __name(describeExpectation, "describeExpectation");
230
- function describeExpected(expected2) {
231
- var descriptions = expected2.map(describeExpectation);
232
- var i, j;
233
- descriptions.sort();
234
- if (descriptions.length > 0) {
235
- for (i = 1, j = 1; i < descriptions.length; i++) {
236
- if (descriptions[i - 1] !== descriptions[i]) {
237
- descriptions[j] = descriptions[i];
238
- j++;
165
+ __name(hex, "hex");
166
+ const nonPrintable = Object.prototype.hasOwnProperty.call(RegExp.prototype, "unicode") ? new RegExp("[\\p{C}\\p{Mn}\\p{Mc}]", "gu") : null;
167
+ function unicodeEscape(s) {
168
+ if (nonPrintable) {
169
+ return s.replace(nonPrintable, (ch) => "\\u{" + hex(ch) + "}");
170
+ }
171
+ return s;
172
+ }
173
+ __name(unicodeEscape, "unicodeEscape");
174
+ function literalEscape(s) {
175
+ return unicodeEscape(s.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, (ch) => "\\x0" + hex(ch)).replace(/[\x10-\x1F\x7F-\x9F]/g, (ch) => "\\x" + hex(ch)));
176
+ }
177
+ __name(literalEscape, "literalEscape");
178
+ function classEscape(s) {
179
+ return unicodeEscape(s.replace(/\\/g, "\\\\").replace(/\]/g, "\\]").replace(/\^/g, "\\^").replace(/-/g, "\\-").replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, (ch) => "\\x0" + hex(ch)).replace(/[\x10-\x1F\x7F-\x9F]/g, (ch) => "\\x" + hex(ch)));
180
+ }
181
+ __name(classEscape, "classEscape");
182
+ const DESCRIBE_EXPECTATION_FNS = {
183
+ literal(expectation) {
184
+ return '"' + literalEscape(expectation.text) + '"';
185
+ },
186
+ class(expectation) {
187
+ const escapedParts = expectation.parts.map(
188
+ (part) => Array.isArray(part) ? classEscape(part[0]) + "-" + classEscape(part[1]) : classEscape(part)
189
+ );
190
+ return "[" + (expectation.inverted ? "^" : "") + escapedParts.join("") + "]" + (expectation.unicode ? "u" : "");
191
+ },
192
+ any() {
193
+ return "any character";
194
+ },
195
+ end() {
196
+ return "end of input";
197
+ },
198
+ other(expectation) {
199
+ return expectation.description;
200
+ }
201
+ };
202
+ function describeExpectation(expectation) {
203
+ return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
204
+ }
205
+ __name(describeExpectation, "describeExpectation");
206
+ function describeExpected(expected2) {
207
+ const descriptions = expected2.map(describeExpectation);
208
+ descriptions.sort();
209
+ if (descriptions.length > 0) {
210
+ let j = 1;
211
+ for (let i = 1; i < descriptions.length; i++) {
212
+ if (descriptions[i - 1] !== descriptions[i]) {
213
+ descriptions[j] = descriptions[i];
214
+ j++;
215
+ }
239
216
  }
217
+ descriptions.length = j;
218
+ }
219
+ switch (descriptions.length) {
220
+ case 1:
221
+ return descriptions[0];
222
+ case 2:
223
+ return descriptions[0] + " or " + descriptions[1];
224
+ default:
225
+ return descriptions.slice(0, -1).join(", ") + ", or " + descriptions[descriptions.length - 1];
240
226
  }
241
- descriptions.length = j;
242
227
  }
243
- switch (descriptions.length) {
244
- case 1:
245
- return descriptions[0];
246
- case 2:
247
- return descriptions[0] + " or " + descriptions[1];
248
- default:
249
- return descriptions.slice(0, -1).join(", ") + ", or " + descriptions[descriptions.length - 1];
228
+ __name(describeExpected, "describeExpected");
229
+ function describeFound(found2) {
230
+ return found2 ? '"' + literalEscape(found2) + '"' : "end of input";
250
231
  }
232
+ __name(describeFound, "describeFound");
233
+ return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";
251
234
  }
252
- __name(describeExpected, "describeExpected");
253
- function describeFound(found2) {
254
- return found2 ? '"' + literalEscape(found2) + '"' : "end of input";
255
- }
256
- __name(describeFound, "describeFound");
257
- return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";
258
235
  };
259
236
  function peg$parse(input, options) {
260
237
  options = options !== void 0 ? options : {};
261
- var peg$FAILED = {};
262
- var peg$source = options.grammarSource;
263
- var peg$startRuleFunctions = { EnvSpecFile: peg$parseEnvSpecFile };
264
- var peg$startRuleFunction = peg$parseEnvSpecFile;
265
- var peg$c0 = "\n";
266
- var peg$c1 = "export ";
267
- var peg$c2 = "=";
268
- var peg$c3 = "#";
269
- var peg$c4 = "@";
270
- var peg$c5 = ":";
271
- var peg$c6 = "()";
272
- var peg$c7 = "(";
273
- var peg$c8 = ")";
274
- var peg$c9 = ",";
275
- var peg$c10 = '\\"';
276
- var peg$c11 = "\\'";
277
- var peg$c12 = "\\`";
278
- var peg$c13 = '"""';
279
- var peg$c14 = '\\"""';
280
- var peg$c15 = "```";
281
- var peg$c16 = "\\```";
282
- var peg$r0 = /^[a-zA-Z_]/;
283
- var peg$r1 = /^[a-zA-Z0-9_.\-]/;
284
- var peg$r2 = /^[^\n]/;
285
- var peg$r3 = /^[a-zA-Z]/;
286
- var peg$r4 = /^[@#]/;
287
- var peg$r5 = /^[a-zA-Z0-9_]/;
288
- var peg$r6 = /^[^ \n,)]/;
289
- var peg$r7 = /^[\-=*#]/;
290
- var peg$r8 = /^['"`]/;
291
- var peg$r9 = /^[^#\n]/;
292
- var peg$r10 = /^[^# \n]/;
293
- var peg$r11 = /^["]/;
294
- var peg$r12 = /^[^"\n]/;
295
- var peg$r13 = /^[']/;
296
- var peg$r14 = /^[^'\n]/;
297
- var peg$r15 = /^[`]/;
298
- var peg$r16 = /^[^`\n]/;
299
- var peg$r17 = /^[ \t]/;
300
- var peg$e0 = peg$literalExpectation("\n", false);
301
- var peg$e1 = peg$literalExpectation("export ", false);
302
- var peg$e2 = peg$literalExpectation("=", false);
303
- var peg$e3 = peg$classExpectation([["a", "z"], ["A", "Z"], "_"], false, false);
304
- var peg$e4 = peg$classExpectation([["a", "z"], ["A", "Z"], ["0", "9"], "_", ".", "-"], false, false);
305
- var peg$e5 = peg$literalExpectation("#", false);
306
- var peg$e6 = peg$literalExpectation("@", false);
307
- var peg$e7 = peg$classExpectation(["\n"], true, false);
308
- var peg$e8 = peg$classExpectation([["a", "z"], ["A", "Z"]], false, false);
309
- var peg$e9 = peg$literalExpectation(":", false);
310
- var peg$e10 = peg$classExpectation(["@", "#"], false, false);
311
- var peg$e11 = peg$literalExpectation("()", false);
312
- var peg$e12 = peg$literalExpectation("(", false);
313
- var peg$e13 = peg$literalExpectation(")", false);
314
- var peg$e14 = peg$classExpectation([["a", "z"], ["A", "Z"], ["0", "9"], "_"], false, false);
315
- var peg$e15 = peg$literalExpectation(",", false);
316
- var peg$e16 = peg$classExpectation([" ", "\n", ",", ")"], true, false);
317
- var peg$e17 = peg$classExpectation(["-", "=", "*", "#"], false, false);
318
- var peg$e18 = peg$classExpectation(["'", '"', "`"], false, false);
319
- var peg$e19 = peg$classExpectation(["#", "\n"], true, false);
320
- var peg$e20 = peg$classExpectation(["#", " ", "\n"], true, false);
321
- var peg$e21 = peg$classExpectation(['"'], false, false);
322
- var peg$e22 = peg$literalExpectation('\\"', false);
323
- var peg$e23 = peg$classExpectation(['"', "\n"], true, false);
324
- var peg$e24 = peg$classExpectation(["'"], false, false);
325
- var peg$e25 = peg$literalExpectation("\\'", false);
326
- var peg$e26 = peg$classExpectation(["'", "\n"], true, false);
327
- var peg$e27 = peg$classExpectation(["`"], false, false);
328
- var peg$e28 = peg$literalExpectation("\\`", false);
329
- var peg$e29 = peg$classExpectation(["`", "\n"], true, false);
330
- var peg$e30 = peg$literalExpectation('"""', false);
331
- var peg$e31 = peg$literalExpectation('\\"""', false);
332
- var peg$e32 = peg$literalExpectation("```", false);
333
- var peg$e33 = peg$literalExpectation("\\```", false);
334
- var peg$e34 = peg$anyExpectation();
335
- var peg$e35 = peg$classExpectation([" ", " "], false, false);
336
- var peg$f0 = /* @__PURE__ */ __name(function() {
238
+ const peg$FAILED = {};
239
+ const peg$source = options.grammarSource;
240
+ const peg$startRuleFunctions = {
241
+ EnvSpecFile: peg$parseEnvSpecFile
242
+ };
243
+ let peg$startRuleFunction = peg$parseEnvSpecFile;
244
+ const peg$c0 = "\n";
245
+ const peg$c1 = "export ";
246
+ const peg$c2 = "=";
247
+ const peg$c3 = "#";
248
+ const peg$c4 = "@";
249
+ const peg$c5 = ":";
250
+ const peg$c6 = "()";
251
+ const peg$c7 = "(";
252
+ const peg$c8 = ")";
253
+ const peg$c9 = ",";
254
+ const peg$c10 = '\\"';
255
+ const peg$c11 = "\\'";
256
+ const peg$c12 = "\\`";
257
+ const peg$c13 = '"""';
258
+ const peg$c14 = '\\"""';
259
+ const peg$c15 = "```";
260
+ const peg$c16 = "\\```";
261
+ const peg$r0 = /^[a-zA-Z_]/;
262
+ const peg$r1 = /^[a-zA-Z0-9_.\-]/;
263
+ const peg$r2 = /^[^\n]/;
264
+ const peg$r3 = /^[a-zA-Z]/;
265
+ const peg$r4 = /^[@#]/;
266
+ const peg$r5 = /^[a-zA-Z0-9_]/;
267
+ const peg$r6 = /^[^ \n,)]/;
268
+ const peg$r7 = /^[\-=*#]/;
269
+ const peg$r8 = /^['"`]/;
270
+ const peg$r9 = /^[^#\n]/;
271
+ const peg$r10 = /^[^# \n]/;
272
+ const peg$r11 = /^["]/;
273
+ const peg$r12 = /^[^"\n]/;
274
+ const peg$r13 = /^[']/;
275
+ const peg$r14 = /^[^'\n]/;
276
+ const peg$r15 = /^[`]/;
277
+ const peg$r16 = /^[^`\n]/;
278
+ const peg$r17 = /^[ \t]/;
279
+ const peg$e0 = peg$literalExpectation("\n", false);
280
+ const peg$e1 = peg$literalExpectation("export ", false);
281
+ const peg$e2 = peg$literalExpectation("=", false);
282
+ const peg$e3 = peg$classExpectation([["a", "z"], ["A", "Z"], "_"], false, false, false);
283
+ const peg$e4 = peg$classExpectation([["a", "z"], ["A", "Z"], ["0", "9"], "_", ".", "-"], false, false, false);
284
+ const peg$e5 = peg$literalExpectation("#", false);
285
+ const peg$e6 = peg$literalExpectation("@", false);
286
+ const peg$e7 = peg$classExpectation(["\n"], true, false, false);
287
+ const peg$e8 = peg$classExpectation([["a", "z"], ["A", "Z"]], false, false, false);
288
+ const peg$e9 = peg$literalExpectation(":", false);
289
+ const peg$e10 = peg$classExpectation(["@", "#"], false, false, false);
290
+ const peg$e11 = peg$literalExpectation("()", false);
291
+ const peg$e12 = peg$literalExpectation("(", false);
292
+ const peg$e13 = peg$literalExpectation(")", false);
293
+ const peg$e14 = peg$classExpectation([["a", "z"], ["A", "Z"], ["0", "9"], "_"], false, false, false);
294
+ const peg$e15 = peg$literalExpectation(",", false);
295
+ const peg$e16 = peg$classExpectation([" ", "\n", ",", ")"], true, false, false);
296
+ const peg$e17 = peg$classExpectation(["-", "=", "*", "#"], false, false, false);
297
+ const peg$e18 = peg$classExpectation(["'", '"', "`"], false, false, false);
298
+ const peg$e19 = peg$classExpectation(["#", "\n"], true, false, false);
299
+ const peg$e20 = peg$classExpectation(["#", " ", "\n"], true, false, false);
300
+ const peg$e21 = peg$classExpectation(['"'], false, false, false);
301
+ const peg$e22 = peg$literalExpectation('\\"', false);
302
+ const peg$e23 = peg$classExpectation(['"', "\n"], true, false, false);
303
+ const peg$e24 = peg$classExpectation(["'"], false, false, false);
304
+ const peg$e25 = peg$literalExpectation("\\'", false);
305
+ const peg$e26 = peg$classExpectation(["'", "\n"], true, false, false);
306
+ const peg$e27 = peg$classExpectation(["`"], false, false, false);
307
+ const peg$e28 = peg$literalExpectation("\\`", false);
308
+ const peg$e29 = peg$classExpectation(["`", "\n"], true, false, false);
309
+ const peg$e30 = peg$literalExpectation('"""', false);
310
+ const peg$e31 = peg$literalExpectation('\\"""', false);
311
+ const peg$e32 = peg$literalExpectation("```", false);
312
+ const peg$e33 = peg$literalExpectation("\\```", false);
313
+ const peg$e34 = peg$anyExpectation();
314
+ const peg$e35 = peg$classExpectation([" ", " "], false, false, false);
315
+ function peg$f0() {
337
316
  return new ParsedEnvSpecBlankLine({ _location: location() });
338
- }, "peg$f0");
339
- var peg$f1 = /* @__PURE__ */ __name(function(contents) {
317
+ }
318
+ __name(peg$f0, "peg$f0");
319
+ function peg$f1(contents) {
340
320
  return new ParsedEnvSpecFile(contents);
341
- }, "peg$f1");
342
- var peg$f2 = /* @__PURE__ */ __name(function(preComments, key, value, postComment) {
321
+ }
322
+ __name(peg$f1, "peg$f1");
323
+ function peg$f2(preComments, key, value, postComment) {
343
324
  return new ParsedEnvSpecConfigItem({
344
325
  key,
345
326
  preComments,
@@ -347,102 +328,123 @@ function peg$parse(input, options) {
347
328
  value,
348
329
  _location: location()
349
330
  });
350
- }, "peg$f2");
351
- var peg$f3 = /* @__PURE__ */ __name(function(comments, end) {
331
+ }
332
+ __name(peg$f2, "peg$f2");
333
+ function peg$f3(comments, end) {
352
334
  return new ParsedEnvSpecCommentBlock({
353
335
  comments,
354
336
  divider: end instanceof ParsedEnvSpecDivider ? end : void 0,
355
337
  _location: location()
356
338
  });
357
- }, "peg$f3");
358
- var peg$f4 = /* @__PURE__ */ __name(function(leadingSpace, contents) {
339
+ }
340
+ __name(peg$f3, "peg$f3");
341
+ function peg$f4(leadingSpace, contents) {
359
342
  return new ParsedEnvSpecComment({
360
343
  contents,
361
344
  leadingSpace,
362
345
  _location: location()
363
346
  });
364
- }, "peg$f4");
365
- var peg$f5 = /* @__PURE__ */ __name(function(leadingSpace, contents) {
347
+ }
348
+ __name(peg$f4, "peg$f4");
349
+ function peg$f5(leadingSpace, contents) {
366
350
  return new ParsedEnvSpecComment({ contents, leadingSpace, _location: location() });
367
- }, "peg$f5");
368
- var peg$f6 = /* @__PURE__ */ __name(function(leadingSpace, first, rest, postComment) {
351
+ }
352
+ __name(peg$f5, "peg$f5");
353
+ function peg$f6(leadingSpace, first, rest, postComment) {
369
354
  return new ParsedEnvSpecDecoratorComment({
370
355
  decorators: [first, ...rest],
371
356
  leadingSpace,
372
357
  postComment,
373
358
  _location: location()
374
359
  });
375
- }, "peg$f6");
376
- var peg$f7 = /* @__PURE__ */ __name(function(name) {
360
+ }
361
+ __name(peg$f6, "peg$f6");
362
+ function peg$f7(name) {
377
363
  return new ParsedEnvSpecFunctionArgs({ values: [] });
378
- }, "peg$f7");
379
- var peg$f8 = /* @__PURE__ */ __name(function(name, valueOrFnArgs) {
364
+ }
365
+ __name(peg$f7, "peg$f7");
366
+ function peg$f8(name, valueOrFnArgs) {
380
367
  return new ParsedEnvSpecDecorator({
381
368
  name,
382
369
  valueOrFnArgs,
383
370
  _location: location()
384
371
  });
385
- }, "peg$f8");
386
- var peg$f9 = /* @__PURE__ */ __name(function(name, args) {
372
+ }
373
+ __name(peg$f8, "peg$f8");
374
+ function peg$f9(name, args) {
387
375
  return new ParsedEnvSpecFunctionCall({
388
376
  name,
389
377
  args: args || new ParsedEnvSpecFunctionArgs({ values: [] }),
390
378
  _location: location()
391
379
  });
392
- }, "peg$f9");
393
- var peg$f10 = /* @__PURE__ */ __name(function(key, val) {
380
+ }
381
+ __name(peg$f9, "peg$f9");
382
+ function peg$f10(key, val) {
394
383
  return new ParsedEnvSpecKeyValuePair({ key, val });
395
- }, "peg$f10");
396
- var peg$f11 = /* @__PURE__ */ __name(function(values) {
384
+ }
385
+ __name(peg$f10, "peg$f10");
386
+ function peg$f11(values) {
397
387
  return new ParsedEnvSpecFunctionArgs({
398
388
  values,
399
389
  _location: location()
400
390
  });
401
- }, "peg$f11");
402
- var peg$f12 = /* @__PURE__ */ __name(function() {
391
+ }
392
+ __name(peg$f11, "peg$f11");
393
+ function peg$f12() {
403
394
  return new ParsedEnvSpecStaticValue({ rawValue: text(), _location: location() });
404
- }, "peg$f12");
405
- var peg$f13 = /* @__PURE__ */ __name(function(leadingSpace, contents) {
395
+ }
396
+ __name(peg$f12, "peg$f12");
397
+ function peg$f13(leadingSpace, contents) {
406
398
  return new ParsedEnvSpecDivider({
407
399
  contents,
408
400
  leadingSpace,
409
401
  _location: location()
410
402
  });
411
- }, "peg$f13");
412
- var peg$f14 = /* @__PURE__ */ __name(function() {
403
+ }
404
+ __name(peg$f13, "peg$f13");
405
+ function peg$f14() {
413
406
  return new ParsedEnvSpecStaticValue({ rawValue: text(), _location: location() });
414
- }, "peg$f14");
415
- var peg$f15 = /* @__PURE__ */ __name(function() {
407
+ }
408
+ __name(peg$f14, "peg$f14");
409
+ function peg$f15() {
416
410
  return new ParsedEnvSpecStaticValue({ rawValue: text(), _location: location() });
417
- }, "peg$f15");
418
- var peg$f16 = /* @__PURE__ */ __name(function(quote) {
411
+ }
412
+ __name(peg$f15, "peg$f15");
413
+ function peg$f16(quote) {
419
414
  return new ParsedEnvSpecStaticValue({ quote, rawValue: text(), _location: location() });
420
- }, "peg$f16");
421
- var peg$f17 = /* @__PURE__ */ __name(function(quote) {
415
+ }
416
+ __name(peg$f16, "peg$f16");
417
+ function peg$f17(quote) {
422
418
  return new ParsedEnvSpecStaticValue({ quote, rawValue: text(), _location: location() });
423
- }, "peg$f17");
424
- var peg$f18 = /* @__PURE__ */ __name(function(quote) {
419
+ }
420
+ __name(peg$f17, "peg$f17");
421
+ function peg$f18(quote) {
425
422
  return new ParsedEnvSpecStaticValue({ quote, rawValue: text(), _location: location() });
426
- }, "peg$f18");
427
- var peg$f19 = /* @__PURE__ */ __name(function(quote) {
423
+ }
424
+ __name(peg$f18, "peg$f18");
425
+ function peg$f19(quote) {
428
426
  return new ParsedEnvSpecStaticValue({ quote, isMultiLine: true, rawValue: text(), _location: location() });
429
- }, "peg$f19");
430
- var peg$f20 = /* @__PURE__ */ __name(function(quote) {
427
+ }
428
+ __name(peg$f19, "peg$f19");
429
+ function peg$f20(quote) {
431
430
  return new ParsedEnvSpecStaticValue({ quote, isMultiLine: true, rawValue: text(), _location: location() });
432
- }, "peg$f20");
433
- var peg$f21 = /* @__PURE__ */ __name(function(quote) {
431
+ }
432
+ __name(peg$f20, "peg$f20");
433
+ function peg$f21(quote) {
434
434
  return new ParsedEnvSpecStaticValue({ quote, isMultiLine: true, rawValue: text(), _location: location() });
435
- }, "peg$f21");
436
- var peg$f22 = /* @__PURE__ */ __name(function(quote) {
435
+ }
436
+ __name(peg$f21, "peg$f21");
437
+ function peg$f22(quote) {
437
438
  return new ParsedEnvSpecStaticValue({ quote, isMultiLine: true, rawValue: text(), _location: location() });
438
- }, "peg$f22");
439
- var peg$currPos = options.peg$currPos | 0;
440
- var peg$savedPos = peg$currPos;
441
- var peg$posDetailsCache = [{ line: 1, column: 1 }];
442
- var peg$maxFailPos = peg$currPos;
443
- var peg$maxFailExpected = options.peg$maxFailExpected || [];
444
- var peg$silentFails = options.peg$silentFails | 0;
445
- var peg$result;
439
+ }
440
+ __name(peg$f22, "peg$f22");
441
+ let peg$currPos = options.peg$currPos | 0;
442
+ let peg$savedPos = peg$currPos;
443
+ const peg$posDetailsCache = [{ line: 1, column: 1 }];
444
+ let peg$maxFailPos = peg$currPos;
445
+ let peg$maxFailExpected = options.peg$maxFailExpected || [];
446
+ let peg$silentFails = options.peg$silentFails | 0;
447
+ let peg$result;
446
448
  if (options.startRule) {
447
449
  if (!(options.startRule in peg$startRuleFunctions)) {
448
450
  throw new Error(`Can't start parsing from rule "` + options.startRule + '".');
@@ -483,12 +485,20 @@ function peg$parse(input, options) {
483
485
  throw peg$buildSimpleError(message, location2);
484
486
  }
485
487
  __name(error, "error");
488
+ function peg$getUnicode(pos = peg$currPos) {
489
+ const cp = input.codePointAt(pos);
490
+ if (cp === void 0) {
491
+ return "";
492
+ }
493
+ return String.fromCodePoint(cp);
494
+ }
495
+ __name(peg$getUnicode, "peg$getUnicode");
486
496
  function peg$literalExpectation(text2, ignoreCase) {
487
497
  return { type: "literal", text: text2, ignoreCase };
488
498
  }
489
499
  __name(peg$literalExpectation, "peg$literalExpectation");
490
- function peg$classExpectation(parts, inverted, ignoreCase) {
491
- return { type: "class", parts, inverted, ignoreCase };
500
+ function peg$classExpectation(parts, inverted, ignoreCase, unicode) {
501
+ return { type: "class", parts, inverted, ignoreCase, unicode };
492
502
  }
493
503
  __name(peg$classExpectation, "peg$classExpectation");
494
504
  function peg$anyExpectation() {
@@ -504,8 +514,8 @@ function peg$parse(input, options) {
504
514
  }
505
515
  __name(peg$otherExpectation, "peg$otherExpectation");
506
516
  function peg$computePosDetails(pos) {
507
- var details = peg$posDetailsCache[pos];
508
- var p;
517
+ let details = peg$posDetailsCache[pos];
518
+ let p;
509
519
  if (details) {
510
520
  return details;
511
521
  } else {
@@ -536,9 +546,9 @@ function peg$parse(input, options) {
536
546
  }
537
547
  __name(peg$computePosDetails, "peg$computePosDetails");
538
548
  function peg$computeLocation(startPos, endPos, offset2) {
539
- var startPosDetails = peg$computePosDetails(startPos);
540
- var endPosDetails = peg$computePosDetails(endPos);
541
- var res = {
549
+ const startPosDetails = peg$computePosDetails(startPos);
550
+ const endPosDetails = peg$computePosDetails(endPos);
551
+ const res = {
542
552
  source: peg$source,
543
553
  start: {
544
554
  offset: startPos,
@@ -583,7 +593,7 @@ function peg$parse(input, options) {
583
593
  }
584
594
  __name(peg$buildStructuredError, "peg$buildStructuredError");
585
595
  function peg$parseEnvSpecFile() {
586
- var s0, s1, s2, s3;
596
+ let s0, s1, s2, s3;
587
597
  s0 = peg$currPos;
588
598
  s1 = [];
589
599
  s2 = peg$parseConfigItem();
@@ -644,7 +654,7 @@ function peg$parse(input, options) {
644
654
  }
645
655
  __name(peg$parseEnvSpecFile, "peg$parseEnvSpecFile");
646
656
  function peg$parseConfigItem() {
647
- var s0, s1, s2, s3, s4, s5, s6, s7, s9, s10;
657
+ let s0, s1, s2, s3, s4, s5, s6, s7, s9, s10;
648
658
  s0 = peg$currPos;
649
659
  s1 = [];
650
660
  s2 = peg$currPos;
@@ -784,7 +794,7 @@ function peg$parse(input, options) {
784
794
  }
785
795
  __name(peg$parseConfigItem, "peg$parseConfigItem");
786
796
  function peg$parseConfigItemKey() {
787
- var s0, s1, s2, s3, s4;
797
+ let s0, s1, s2, s3, s4;
788
798
  s0 = peg$currPos;
789
799
  s1 = peg$currPos;
790
800
  s2 = input.charAt(peg$currPos);
@@ -834,7 +844,7 @@ function peg$parse(input, options) {
834
844
  }
835
845
  __name(peg$parseConfigItemKey, "peg$parseConfigItemKey");
836
846
  function peg$parseConfigItemValue() {
837
- var s0;
847
+ let s0;
838
848
  s0 = peg$parseFunctionCall();
839
849
  if (s0 === peg$FAILED) {
840
850
  s0 = peg$parsemultiLineString();
@@ -849,7 +859,7 @@ function peg$parse(input, options) {
849
859
  }
850
860
  __name(peg$parseConfigItemValue, "peg$parseConfigItemValue");
851
861
  function peg$parseCommentBlock() {
852
- var s0, s1, s2, s3, s4;
862
+ let s0, s1, s2, s3, s4;
853
863
  s0 = peg$currPos;
854
864
  s1 = [];
855
865
  s2 = peg$currPos;
@@ -919,7 +929,7 @@ function peg$parse(input, options) {
919
929
  }
920
930
  __name(peg$parseCommentBlock, "peg$parseCommentBlock");
921
931
  function peg$parseComment() {
922
- var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9;
932
+ let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9;
923
933
  s0 = peg$currPos;
924
934
  s1 = peg$currPos;
925
935
  peg$silentFails++;
@@ -1014,7 +1024,7 @@ function peg$parse(input, options) {
1014
1024
  }
1015
1025
  __name(peg$parseComment, "peg$parseComment");
1016
1026
  function peg$parseIgnoredDecoratorComment() {
1017
- var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10;
1027
+ let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10;
1018
1028
  s0 = peg$currPos;
1019
1029
  if (input.charCodeAt(peg$currPos) === 35) {
1020
1030
  s1 = peg$c3;
@@ -1235,7 +1245,7 @@ function peg$parse(input, options) {
1235
1245
  }
1236
1246
  __name(peg$parseIgnoredDecoratorComment, "peg$parseIgnoredDecoratorComment");
1237
1247
  function peg$parseDecoratorComment() {
1238
- var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10;
1248
+ let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10;
1239
1249
  s0 = peg$currPos;
1240
1250
  if (input.charCodeAt(peg$currPos) === 35) {
1241
1251
  s1 = peg$c3;
@@ -1343,7 +1353,7 @@ function peg$parse(input, options) {
1343
1353
  }
1344
1354
  __name(peg$parseDecoratorComment, "peg$parseDecoratorComment");
1345
1355
  function peg$parseDecorator() {
1346
- var s0, s1, s2, s3, s4, s5, s6;
1356
+ let s0, s1, s2, s3, s4, s5, s6;
1347
1357
  s0 = peg$currPos;
1348
1358
  if (input.charCodeAt(peg$currPos) === 64) {
1349
1359
  s1 = peg$c4;
@@ -1369,7 +1379,7 @@ function peg$parse(input, options) {
1369
1379
  }
1370
1380
  if (s4 !== peg$FAILED) {
1371
1381
  peg$savedPos = s3;
1372
- s4 = peg$f7(s2);
1382
+ s4 = peg$f7();
1373
1383
  }
1374
1384
  s3 = s4;
1375
1385
  if (s3 === peg$FAILED) {
@@ -1449,7 +1459,7 @@ function peg$parse(input, options) {
1449
1459
  }
1450
1460
  __name(peg$parseDecorator, "peg$parseDecorator");
1451
1461
  function peg$parseDecoratorName() {
1452
- var s0, s1, s2, s3, s4;
1462
+ let s0, s1, s2, s3, s4;
1453
1463
  s0 = peg$currPos;
1454
1464
  s1 = peg$currPos;
1455
1465
  s2 = input.charAt(peg$currPos);
@@ -1499,7 +1509,7 @@ function peg$parse(input, options) {
1499
1509
  }
1500
1510
  __name(peg$parseDecoratorName, "peg$parseDecoratorName");
1501
1511
  function peg$parseDecoratorValue() {
1502
- var s0;
1512
+ let s0;
1503
1513
  s0 = peg$parseFunctionCall();
1504
1514
  if (s0 === peg$FAILED) {
1505
1515
  s0 = peg$parsequotedString();
@@ -1511,7 +1521,7 @@ function peg$parse(input, options) {
1511
1521
  }
1512
1522
  __name(peg$parseDecoratorValue, "peg$parseDecoratorValue");
1513
1523
  function peg$parseFunctionCall() {
1514
- var s0, s1, s2, s4, s6;
1524
+ let s0, s1, s2, s4, s6;
1515
1525
  s0 = peg$currPos;
1516
1526
  s1 = peg$parseFunctionName();
1517
1527
  if (s1 !== peg$FAILED) {
@@ -1559,7 +1569,7 @@ function peg$parse(input, options) {
1559
1569
  }
1560
1570
  __name(peg$parseFunctionCall, "peg$parseFunctionCall");
1561
1571
  function peg$parseFunctionName() {
1562
- var s0, s1, s2, s3, s4;
1572
+ let s0, s1, s2, s3, s4;
1563
1573
  s0 = peg$currPos;
1564
1574
  s1 = peg$currPos;
1565
1575
  s2 = input.charAt(peg$currPos);
@@ -1609,7 +1619,7 @@ function peg$parse(input, options) {
1609
1619
  }
1610
1620
  __name(peg$parseFunctionName, "peg$parseFunctionName");
1611
1621
  function peg$parseFunctionArgs() {
1612
- var s0, s1, s2, s3, s4, s5, s6, s7;
1622
+ let s0, s1, s2, s3, s4, s5, s6, s7;
1613
1623
  s0 = peg$currPos;
1614
1624
  s1 = peg$currPos;
1615
1625
  s2 = [];
@@ -1725,7 +1735,7 @@ function peg$parse(input, options) {
1725
1735
  }
1726
1736
  __name(peg$parseFunctionArgs, "peg$parseFunctionArgs");
1727
1737
  function peg$parseFunctionArgKeyName() {
1728
- var s0, s1, s2, s3, s4;
1738
+ let s0, s1, s2, s3, s4;
1729
1739
  s0 = peg$currPos;
1730
1740
  s1 = peg$currPos;
1731
1741
  s2 = input.charAt(peg$currPos);
@@ -1775,7 +1785,7 @@ function peg$parse(input, options) {
1775
1785
  }
1776
1786
  __name(peg$parseFunctionArgKeyName, "peg$parseFunctionArgKeyName");
1777
1787
  function peg$parseFunctionArgValue() {
1778
- var s0, s1, s2, s3;
1788
+ let s0, s1, s2, s3;
1779
1789
  s0 = peg$parseFunctionCall();
1780
1790
  if (s0 === peg$FAILED) {
1781
1791
  s0 = peg$parsequotedString();
@@ -1824,7 +1834,7 @@ function peg$parse(input, options) {
1824
1834
  }
1825
1835
  __name(peg$parseFunctionArgValue, "peg$parseFunctionArgValue");
1826
1836
  function peg$parseDivider() {
1827
- var s0, s1, s2, s3, s4, s5, s6, s7;
1837
+ let s0, s1, s2, s3, s4, s5, s6, s7;
1828
1838
  s0 = peg$currPos;
1829
1839
  if (input.charCodeAt(peg$currPos) === 35) {
1830
1840
  s1 = peg$c3;
@@ -1925,7 +1935,7 @@ function peg$parse(input, options) {
1925
1935
  }
1926
1936
  __name(peg$parseDivider, "peg$parseDivider");
1927
1937
  function peg$parseunquotedString() {
1928
- var s0, s1, s2, s3, s4, s5, s6;
1938
+ let s0, s1, s2, s3, s4, s5, s6;
1929
1939
  s0 = peg$currPos;
1930
1940
  s1 = peg$currPos;
1931
1941
  s2 = peg$currPos;
@@ -2000,7 +2010,7 @@ function peg$parse(input, options) {
2000
2010
  }
2001
2011
  __name(peg$parseunquotedString, "peg$parseunquotedString");
2002
2012
  function peg$parseunquotedStringWithoutSpaces() {
2003
- var s0, s1, s2, s3, s4, s5;
2013
+ let s0, s1, s2, s3, s4, s5;
2004
2014
  s0 = peg$currPos;
2005
2015
  s1 = peg$currPos;
2006
2016
  s2 = peg$currPos;
@@ -2074,7 +2084,7 @@ function peg$parse(input, options) {
2074
2084
  }
2075
2085
  __name(peg$parseunquotedStringWithoutSpaces, "peg$parseunquotedStringWithoutSpaces");
2076
2086
  function peg$parsequotedString() {
2077
- var s0;
2087
+ let s0;
2078
2088
  s0 = peg$parseDQuotedString();
2079
2089
  if (s0 === peg$FAILED) {
2080
2090
  s0 = peg$parseSQuotedString();
@@ -2086,7 +2096,7 @@ function peg$parse(input, options) {
2086
2096
  }
2087
2097
  __name(peg$parsequotedString, "peg$parsequotedString");
2088
2098
  function peg$parseDQuotedString() {
2089
- var s0, s1, s2, s3;
2099
+ let s0, s1, s2, s3;
2090
2100
  s0 = peg$currPos;
2091
2101
  s1 = input.charAt(peg$currPos);
2092
2102
  if (peg$r11.test(s1)) {
@@ -2166,7 +2176,7 @@ function peg$parse(input, options) {
2166
2176
  }
2167
2177
  __name(peg$parseDQuotedString, "peg$parseDQuotedString");
2168
2178
  function peg$parseSQuotedString() {
2169
- var s0, s1, s2, s3;
2179
+ let s0, s1, s2, s3;
2170
2180
  s0 = peg$currPos;
2171
2181
  s1 = input.charAt(peg$currPos);
2172
2182
  if (peg$r13.test(s1)) {
@@ -2246,7 +2256,7 @@ function peg$parse(input, options) {
2246
2256
  }
2247
2257
  __name(peg$parseSQuotedString, "peg$parseSQuotedString");
2248
2258
  function peg$parseBQuotedString() {
2249
- var s0, s1, s2, s3;
2259
+ let s0, s1, s2, s3;
2250
2260
  s0 = peg$currPos;
2251
2261
  s1 = input.charAt(peg$currPos);
2252
2262
  if (peg$r15.test(s1)) {
@@ -2326,7 +2336,7 @@ function peg$parse(input, options) {
2326
2336
  }
2327
2337
  __name(peg$parseBQuotedString, "peg$parseBQuotedString");
2328
2338
  function peg$parsemultiLineString() {
2329
- var s0;
2339
+ let s0;
2330
2340
  s0 = peg$parsesingleSQuotedMultiLineString();
2331
2341
  if (s0 === peg$FAILED) {
2332
2342
  s0 = peg$parsesingleDQuotedMultiLineString();
@@ -2341,7 +2351,7 @@ function peg$parse(input, options) {
2341
2351
  }
2342
2352
  __name(peg$parsemultiLineString, "peg$parsemultiLineString");
2343
2353
  function peg$parsesingleSQuotedMultiLineString() {
2344
- var s0, s1, s2, s3, s4, s5;
2354
+ let s0, s1, s2, s3, s4, s5;
2345
2355
  s0 = peg$currPos;
2346
2356
  s1 = input.charAt(peg$currPos);
2347
2357
  if (peg$r13.test(s1)) {
@@ -2556,7 +2566,7 @@ function peg$parse(input, options) {
2556
2566
  }
2557
2567
  __name(peg$parsesingleSQuotedMultiLineString, "peg$parsesingleSQuotedMultiLineString");
2558
2568
  function peg$parsesingleDQuotedMultiLineString() {
2559
- var s0, s1, s2, s3, s4, s5;
2569
+ let s0, s1, s2, s3, s4, s5;
2560
2570
  s0 = peg$currPos;
2561
2571
  s1 = input.charAt(peg$currPos);
2562
2572
  if (peg$r11.test(s1)) {
@@ -2771,7 +2781,7 @@ function peg$parse(input, options) {
2771
2781
  }
2772
2782
  __name(peg$parsesingleDQuotedMultiLineString, "peg$parsesingleDQuotedMultiLineString");
2773
2783
  function peg$parsetripleDQuotedMultiLineString() {
2774
- var s0, s1, s2, s3, s4, s5, s6, s7;
2784
+ let s0, s1, s2, s3, s4, s5, s6, s7;
2775
2785
  s0 = peg$currPos;
2776
2786
  if (input.substr(peg$currPos, 3) === peg$c13) {
2777
2787
  s1 = peg$c13;
@@ -3172,7 +3182,7 @@ function peg$parse(input, options) {
3172
3182
  }
3173
3183
  __name(peg$parsetripleDQuotedMultiLineString, "peg$parsetripleDQuotedMultiLineString");
3174
3184
  function peg$parsetripleBQuotedMultiLineString() {
3175
- var s0, s1, s2, s3, s4, s5, s6, s7;
3185
+ let s0, s1, s2, s3, s4, s5, s6, s7;
3176
3186
  s0 = peg$currPos;
3177
3187
  if (input.substr(peg$currPos, 3) === peg$c15) {
3178
3188
  s1 = peg$c15;
@@ -3573,7 +3583,7 @@ function peg$parse(input, options) {
3573
3583
  }
3574
3584
  __name(peg$parsetripleBQuotedMultiLineString, "peg$parsetripleBQuotedMultiLineString");
3575
3585
  function peg$parse_n() {
3576
- var s0, s1;
3586
+ let s0, s1;
3577
3587
  if (input.charCodeAt(peg$currPos) === 10) {
3578
3588
  s0 = peg$c0;
3579
3589
  peg$currPos++;
@@ -3607,7 +3617,7 @@ function peg$parse(input, options) {
3607
3617
  }
3608
3618
  __name(peg$parse_n, "peg$parse_n");
3609
3619
  function peg$parse_() {
3610
- var s0, s1;
3620
+ let s0, s1;
3611
3621
  s0 = [];
3612
3622
  s1 = input.charAt(peg$currPos);
3613
3623
  if (peg$r17.test(s1)) {
@@ -3634,7 +3644,7 @@ function peg$parse(input, options) {
3634
3644
  }
3635
3645
  __name(peg$parse_, "peg$parse_");
3636
3646
  function peg$parse__() {
3637
- var s0, s1;
3647
+ let s0, s1;
3638
3648
  s0 = [];
3639
3649
  s1 = input.charAt(peg$currPos);
3640
3650
  if (peg$r17.test(s1)) {
@@ -3665,6 +3675,18 @@ function peg$parse(input, options) {
3665
3675
  }
3666
3676
  __name(peg$parse__, "peg$parse__");
3667
3677
  peg$result = peg$startRuleFunction();
3678
+ const peg$success = peg$result !== peg$FAILED && peg$currPos === input.length;
3679
+ function peg$throw() {
3680
+ if (peg$result !== peg$FAILED && peg$currPos < input.length) {
3681
+ peg$fail(peg$endExpectation());
3682
+ }
3683
+ throw peg$buildStructuredError(
3684
+ peg$maxFailExpected,
3685
+ peg$maxFailPos < input.length ? peg$getUnicode(peg$maxFailPos) : null,
3686
+ peg$maxFailPos < input.length ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)
3687
+ );
3688
+ }
3689
+ __name(peg$throw, "peg$throw");
3668
3690
  if (options.peg$library) {
3669
3691
  return (
3670
3692
  /** @type {any} */
@@ -3673,21 +3695,16 @@ function peg$parse(input, options) {
3673
3695
  peg$currPos,
3674
3696
  peg$FAILED,
3675
3697
  peg$maxFailExpected,
3676
- peg$maxFailPos
3698
+ peg$maxFailPos,
3699
+ peg$success,
3700
+ peg$throw: peg$success ? void 0 : peg$throw
3677
3701
  }
3678
3702
  );
3679
3703
  }
3680
- if (peg$result !== peg$FAILED && peg$currPos === input.length) {
3704
+ if (peg$success) {
3681
3705
  return peg$result;
3682
3706
  } else {
3683
- if (peg$result !== peg$FAILED && peg$currPos < input.length) {
3684
- peg$fail(peg$endExpectation());
3685
- }
3686
- throw peg$buildStructuredError(
3687
- peg$maxFailExpected,
3688
- peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,
3689
- peg$maxFailPos < input.length ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)
3690
- );
3707
+ peg$throw();
3691
3708
  }
3692
3709
  }
3693
3710
  __name(peg$parse, "peg$parse");