@dotenvx/dotenvx 2.32.4 → 2.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/CHANGELOG.md +22 -1
  2. package/README.md +24 -26
  3. package/package.json +5 -13
  4. package/src/cli/actions/check.js +6 -11
  5. package/src/cli/actions/encrypt.js +2 -2
  6. package/src/cli/actions/get.js +4 -5
  7. package/src/cli/actions/init.js +4 -4
  8. package/src/cli/actions/keypair.js +1 -0
  9. package/src/cli/actions/policy.js +14 -0
  10. package/src/cli/actions/primitivesCheck.js +32 -0
  11. package/src/cli/actions/primitivesProfile.js +15 -0
  12. package/src/cli/actions/primitivesRedact.js +19 -0
  13. package/src/cli/actions/protectStdin.js +2 -2
  14. package/src/cli/actions/run.js +8 -46
  15. package/src/cli/actions/set.js +1 -1
  16. package/src/cli/commands/primitives.js +28 -1
  17. package/src/cli/dotenvx.js +6 -6
  18. package/src/db/session.js +1 -1
  19. package/src/lib/custodians/index.js +12 -10
  20. package/src/lib/custodians/local/bitwarden.js +5 -15
  21. package/src/lib/custodians/local/native/backend.js +4 -10
  22. package/src/lib/custodians/local/native/index.js +1 -1
  23. package/src/lib/custodians/local/onepassword.js +7 -29
  24. package/src/lib/custodians/managed/armor/index.js +0 -10
  25. package/src/lib/custodians/resolveLocalKey.js +3 -4
  26. package/src/lib/decryptors/armor/index.js +6 -7
  27. package/src/lib/{envspec → envfile}/discovery/discoverEnvFiles.js +1 -1
  28. package/src/lib/{envspec → envfile}/discovery/scanSource.js +1 -1
  29. package/src/lib/{envspec/parsing/formatEnvspecSyntaxError.js → envfile/parsing/formatEnvfileSyntaxError.js} +1 -1
  30. package/src/lib/envfile/parsing/readEnvfile.js +43 -0
  31. package/src/lib/envfile/parsing/resolveEnvfilePath.js +5 -0
  32. package/src/lib/{envspec/rendering/normalizeEnvspec.js → envfile/rendering/normalizeEnvfile.js} +1 -1
  33. package/src/lib/{envspec/rendering/previewEnvspec.js → envfile/rendering/previewEnvfile.js} +7 -15
  34. package/src/lib/{envspec/rendering/renderEnvspec.js → envfile/rendering/renderEnvfile.js} +3 -3
  35. package/src/lib/{envspec/validation/protectEnvspec.js → envfile/validation/protectEnvfile.js} +7 -7
  36. package/src/lib/envfile/validation/validateEnvfile.js +14 -0
  37. package/src/lib/helpers/errors.js +3 -25
  38. package/src/lib/helpers/executeCommand.js +1 -2
  39. package/src/lib/helpers/matchesStoredKey.js +1 -12
  40. package/src/lib/helpers/parseWithDecryptor.js +27 -12
  41. package/src/lib/helpers/redactOutput.js +30 -32
  42. package/src/lib/helpers/redactProcessOutput.js +58 -0
  43. package/src/lib/helpers/redactedValues.js +2 -2
  44. package/src/lib/helpers/selectEnvfileEnvs.js +29 -0
  45. package/src/lib/helpers/selectKeyStorage.js +1 -1
  46. package/src/lib/helpers/storeKeyStorage.js +0 -1
  47. package/src/lib/main.d.ts +12 -6
  48. package/src/lib/main.js +16 -29
  49. package/src/lib/providers/index.js +53 -53
  50. package/src/lib/resolvers/envs.js +7 -26
  51. package/src/lib/resolvers/get.js +2 -3
  52. package/src/lib/resolvers/keypair.js +39 -4
  53. package/src/lib/services/init.js +4 -4
  54. package/src/lib/services/validate.js +20 -32
  55. package/src/lib/transforms/encrypt.js +5 -5
  56. package/src/lib/transforms/set.js +5 -3
  57. package/src/cli/actions/lock/down.js +0 -54
  58. package/src/cli/actions/lock/up.js +0 -62
  59. package/src/cli/commands/lock.js +0 -36
  60. package/src/lib/api/postArmorDecrypt.js +0 -49
  61. package/src/lib/api/postArmorKeyring.js +0 -50
  62. package/src/lib/custodians/lock.js +0 -80
  63. package/src/lib/custodians/managed/armor/get.js +0 -44
  64. package/src/lib/envspec/parsing/envspec.peggy +0 -105
  65. package/src/lib/envspec/parsing/envspecParser.js +0 -2851
  66. package/src/lib/envspec/parsing/readEnvspec.js +0 -144
  67. package/src/lib/envspec/parsing/resolveEnvspecPath.js +0 -11
  68. package/src/lib/envspec/validation/encryptedSources.js +0 -15
  69. package/src/lib/envspec/validation/validate.js +0 -109
  70. package/src/lib/envspec/validation/validateEnvspec.js +0 -57
  71. package/src/lib/helpers/isValidEmail.js +0 -11
  72. package/src/lib/helpers/isValidUrl.js +0 -9
  73. package/src/lib/helpers/lockedValue.js +0 -24
  74. package/src/lib/helpers/resolveLockPassword.js +0 -5
  75. package/src/lib/helpers/unlockedValue.js +0 -26
  76. package/src/lib/helpers/withLockedKeys.js +0 -41
  77. package/src/lib/providers/provider-worker.js +0 -6
  78. package/src/lib/proxy/configureProxy.js +0 -55
  79. package/src/lib/proxy/eligibleHeaders.js +0 -16
  80. package/src/lib/proxy/prepareProxy.js +0 -24
  81. package/src/lib/proxy/proxyCertificates.js +0 -44
  82. package/src/lib/proxy/proxyForward.js +0 -65
  83. package/src/lib/proxy/proxyPreload.js +0 -21
  84. package/src/lib/proxy/proxyPreloadSource.js +0 -3
  85. package/src/lib/proxy/proxyServer.js +0 -175
  86. package/src/lib/services/armorKeyring.js +0 -119
  87. package/src/lib/services/lockDown.js +0 -157
  88. package/src/lib/services/lockUp.js +0 -150
  89. /package/src/lib/{envspec → envfile}/discovery/extractEnvKeys.js +0 -0
  90. /package/src/lib/{envspec → envfile}/validation/diagnosticLocation.js +0 -0
@@ -1,2851 +0,0 @@
1
- // @generated by Peggy 5.1.0.
2
- //
3
- // https://peggyjs.org/
4
-
5
- "use strict";
6
-
7
- class peg$SyntaxError extends SyntaxError {
8
- constructor(message, expected, found, location) {
9
- super(message);
10
- this.expected = expected;
11
- this.found = found;
12
- this.location = location;
13
- this.name = "SyntaxError";
14
- }
15
-
16
- format(sources) {
17
- let str = "Error: " + this.message;
18
- if (this.location) {
19
- let src = null;
20
- const st = sources.find(s => s.source === this.location.source);
21
- if (st) {
22
- src = st.text.split(/\r\n|\n|\r/g);
23
- }
24
- const s = this.location.start;
25
- const offset_s = (this.location.source && (typeof this.location.source.offset === "function"))
26
- ? this.location.source.offset(s)
27
- : s;
28
- const loc = this.location.source + ":" + offset_s.line + ":" + offset_s.column;
29
- if (src) {
30
- const e = this.location.end;
31
- const filler = "".padEnd(offset_s.line.toString().length, " ");
32
- const line = src[s.line - 1];
33
- const last = s.line === e.line ? e.column : line.length + 1;
34
- const hatLen = (last - s.column) || 1;
35
- str += "\n --> " + loc + "\n"
36
- + filler + " |\n"
37
- + offset_s.line + " | " + line + "\n"
38
- + filler + " | " + "".padEnd(s.column - 1, " ")
39
- + "".padEnd(hatLen, "^");
40
- } else {
41
- str += "\n at " + loc;
42
- }
43
- }
44
- return str;
45
- }
46
-
47
- static buildMessage(expected, found) {
48
- function hex(ch) {
49
- return ch.codePointAt(0).toString(16).toUpperCase();
50
- }
51
-
52
- const nonPrintable = Object.prototype.hasOwnProperty.call(RegExp.prototype, "unicode")
53
- ? new RegExp("[\\p{C}\\p{Mn}\\p{Mc}]", "gu")
54
- : null;
55
- function unicodeEscape(s) {
56
- if (nonPrintable) {
57
- return s.replace(nonPrintable, ch => "\\u{" + hex(ch) + "}");
58
- }
59
- return s;
60
- }
61
-
62
- function literalEscape(s) {
63
- return unicodeEscape(s
64
- .replace(/\\/g, "\\\\")
65
- .replace(/"/g, "\\\"")
66
- .replace(/\0/g, "\\0")
67
- .replace(/\t/g, "\\t")
68
- .replace(/\n/g, "\\n")
69
- .replace(/\r/g, "\\r")
70
- .replace(/[\x00-\x0F]/g, ch => "\\x0" + hex(ch))
71
- .replace(/[\x10-\x1F\x7F-\x9F]/g, ch => "\\x" + hex(ch)));
72
- }
73
-
74
- function classEscape(s) {
75
- return unicodeEscape(s
76
- .replace(/\\/g, "\\\\")
77
- .replace(/\]/g, "\\]")
78
- .replace(/\^/g, "\\^")
79
- .replace(/-/g, "\\-")
80
- .replace(/\0/g, "\\0")
81
- .replace(/\t/g, "\\t")
82
- .replace(/\n/g, "\\n")
83
- .replace(/\r/g, "\\r")
84
- .replace(/[\x00-\x0F]/g, ch => "\\x0" + hex(ch))
85
- .replace(/[\x10-\x1F\x7F-\x9F]/g, ch => "\\x" + hex(ch)));
86
- }
87
-
88
- const DESCRIBE_EXPECTATION_FNS = {
89
- literal(expectation) {
90
- return "\"" + literalEscape(expectation.text) + "\"";
91
- },
92
-
93
- class(expectation) {
94
- const escapedParts = expectation.parts.map(
95
- part => (Array.isArray(part)
96
- ? classEscape(part[0]) + "-" + classEscape(part[1])
97
- : classEscape(part))
98
- );
99
-
100
- return "[" + (expectation.inverted ? "^" : "") + escapedParts.join("") + "]" + (expectation.unicode ? "u" : "");
101
- },
102
-
103
- any() {
104
- return "any character";
105
- },
106
-
107
- end() {
108
- return "end of input";
109
- },
110
-
111
- other(expectation) {
112
- return expectation.description;
113
- },
114
- };
115
-
116
- function describeExpectation(expectation) {
117
- return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
118
- }
119
-
120
- function describeExpected(expected) {
121
- const descriptions = expected.map(describeExpectation);
122
- descriptions.sort();
123
-
124
- if (descriptions.length > 0) {
125
- let j = 1;
126
- for (let i = 1; i < descriptions.length; i++) {
127
- if (descriptions[i - 1] !== descriptions[i]) {
128
- descriptions[j] = descriptions[i];
129
- j++;
130
- }
131
- }
132
- descriptions.length = j;
133
- }
134
-
135
- switch (descriptions.length) {
136
- case 1:
137
- return descriptions[0];
138
-
139
- case 2:
140
- return descriptions[0] + " or " + descriptions[1];
141
-
142
- default:
143
- return descriptions.slice(0, -1).join(", ")
144
- + ", or "
145
- + descriptions[descriptions.length - 1];
146
- }
147
- }
148
-
149
- function describeFound(found) {
150
- return found ? "\"" + literalEscape(found) + "\"" : "end of input";
151
- }
152
-
153
- return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";
154
- }
155
- }
156
-
157
- function peg$parse(input, options) {
158
- options = options !== undefined ? options : {};
159
-
160
- const peg$FAILED = {};
161
- const peg$source = options.grammarSource;
162
-
163
- const peg$startRuleFunctions = {
164
- Document: peg$parseDocument,
165
- };
166
- let peg$startRuleFunction = peg$parseDocument;
167
-
168
- const peg$c0 = "file";
169
- const peg$c1 = "do";
170
- const peg$c2 = "end";
171
- const peg$c3 = "strict";
172
- const peg$c4 = "\"";
173
- const peg$c5 = "'";
174
- const peg$c6 = "env";
175
- const peg$c7 = ",";
176
- const peg$c8 = "proxy";
177
- const peg$c9 = ":";
178
- const peg$c10 = "required";
179
- const peg$c11 = "optional";
180
- const peg$c12 = "redacted";
181
- const peg$c13 = "redact";
182
- const peg$c14 = "encrypted";
183
- const peg$c15 = "encrypt";
184
- const peg$c16 = "type";
185
- const peg$c17 = "enum";
186
- const peg$c18 = "min";
187
- const peg$c19 = "max";
188
- const peg$c20 = "[";
189
- const peg$c21 = "]";
190
- const peg$c22 = "\\";
191
- const peg$c23 = "\"integer\"";
192
- const peg$c24 = "'integer'";
193
- const peg$c25 = "\"boolean\"";
194
- const peg$c26 = "'boolean'";
195
- const peg$c27 = "\"port\"";
196
- const peg$c28 = "'port'";
197
- const peg$c29 = "\"url\"";
198
- const peg$c30 = "'url'";
199
- const peg$c31 = "\"email\"";
200
- const peg$c32 = "'email'";
201
- const peg$c33 = "\"ip\"";
202
- const peg$c34 = "'ip'";
203
- const peg$c35 = "true";
204
- const peg$c36 = "{";
205
- const peg$c37 = "domain";
206
- const peg$c38 = "}";
207
- const peg$c39 = "false";
208
- const peg$c40 = "#";
209
- const peg$c41 = "\r\n";
210
-
211
- const peg$r0 = /^[ \t]/;
212
- const peg$r1 = /^[^"\r\n\0]/;
213
- const peg$r2 = /^[^'\r\n\0]/;
214
- const peg$r3 = /^[+\-]/;
215
- const peg$r4 = /^[0-9]/;
216
- const peg$r5 = /^[^"\\\r\n]/;
217
- const peg$r6 = /^[^'\\\r\n]/;
218
- const peg$r7 = /^["'\\nrt]/;
219
- const peg$r8 = /^[A-Za-z0-9.\-]/;
220
- const peg$r9 = /^[A-Za-z_]/;
221
- const peg$r10 = /^[A-Za-z0-9_]/;
222
- const peg$r11 = /^[^\r\n]/;
223
- const peg$r12 = /^[\n\r]/;
224
-
225
- const peg$e0 = peg$literalExpectation("file", false);
226
- const peg$e1 = peg$classExpectation([" ", "\t"], false, false, false);
227
- const peg$e2 = peg$literalExpectation("do", false);
228
- const peg$e3 = peg$literalExpectation("end", false);
229
- const peg$e4 = peg$anyExpectation();
230
- const peg$e5 = peg$literalExpectation("strict", false);
231
- const peg$e6 = peg$otherExpectation("a quoted filename");
232
- const peg$e7 = peg$literalExpectation("\"", false);
233
- const peg$e8 = peg$classExpectation(["\"", "\r", "\n", "\0"], true, false, false);
234
- const peg$e9 = peg$literalExpectation("'", false);
235
- const peg$e10 = peg$classExpectation(["'", "\r", "\n", "\0"], true, false, false);
236
- const peg$e11 = peg$literalExpectation("env", false);
237
- const peg$e12 = peg$literalExpectation(",", false);
238
- const peg$e13 = peg$literalExpectation("proxy", false);
239
- const peg$e14 = peg$literalExpectation(":", false);
240
- const peg$e15 = peg$literalExpectation("required", false);
241
- const peg$e16 = peg$literalExpectation("optional", false);
242
- const peg$e17 = peg$literalExpectation("redacted", false);
243
- const peg$e18 = peg$literalExpectation("redact", false);
244
- const peg$e19 = peg$literalExpectation("encrypted", false);
245
- const peg$e20 = peg$literalExpectation("encrypt", false);
246
- const peg$e21 = peg$literalExpectation("type", false);
247
- const peg$e22 = peg$literalExpectation("enum", false);
248
- const peg$e23 = peg$literalExpectation("min", false);
249
- const peg$e24 = peg$literalExpectation("max", false);
250
- const peg$e25 = peg$otherExpectation("an integer");
251
- const peg$e26 = peg$classExpectation(["+", "-"], false, false, false);
252
- const peg$e27 = peg$classExpectation([["0", "9"]], false, false, false);
253
- const peg$e28 = peg$literalExpectation("[", false);
254
- const peg$e29 = peg$literalExpectation("]", false);
255
- const peg$e30 = peg$classExpectation(["\"", "\\", "\r", "\n"], true, false, false);
256
- const peg$e31 = peg$classExpectation(["'", "\\", "\r", "\n"], true, false, false);
257
- const peg$e32 = peg$literalExpectation("\\", false);
258
- const peg$e33 = peg$classExpectation(["\"", "'", "\\", "n", "r", "t"], false, false, false);
259
- const peg$e34 = peg$otherExpectation("a supported type (integer, boolean, port, url, email, or ip)");
260
- const peg$e35 = peg$literalExpectation("\"integer\"", false);
261
- const peg$e36 = peg$literalExpectation("'integer'", false);
262
- const peg$e37 = peg$literalExpectation("\"boolean\"", false);
263
- const peg$e38 = peg$literalExpectation("'boolean'", false);
264
- const peg$e39 = peg$literalExpectation("\"port\"", false);
265
- const peg$e40 = peg$literalExpectation("'port'", false);
266
- const peg$e41 = peg$literalExpectation("\"url\"", false);
267
- const peg$e42 = peg$literalExpectation("'url'", false);
268
- const peg$e43 = peg$literalExpectation("\"email\"", false);
269
- const peg$e44 = peg$literalExpectation("'email'", false);
270
- const peg$e45 = peg$literalExpectation("\"ip\"", false);
271
- const peg$e46 = peg$literalExpectation("'ip'", false);
272
- const peg$e47 = peg$otherExpectation("true or false");
273
- const peg$e48 = peg$literalExpectation("true", false);
274
- const peg$e49 = peg$literalExpectation("{", false);
275
- const peg$e50 = peg$literalExpectation("domain", false);
276
- const peg$e51 = peg$literalExpectation("}", false);
277
- const peg$e52 = peg$literalExpectation("false", false);
278
- const peg$e53 = peg$otherExpectation("a quoted domain");
279
- const peg$e54 = peg$classExpectation([["A", "Z"], ["a", "z"], ["0", "9"], ".", "-"], false, false, false);
280
- const peg$e55 = peg$otherExpectation("a quoted variable name");
281
- const peg$e56 = peg$classExpectation([["A", "Z"], ["a", "z"], "_"], false, false, false);
282
- const peg$e57 = peg$classExpectation([["A", "Z"], ["a", "z"], ["0", "9"], "_"], false, false, false);
283
- const peg$e58 = peg$literalExpectation("#", false);
284
- const peg$e59 = peg$classExpectation(["\r", "\n"], true, false, false);
285
- const peg$e60 = peg$literalExpectation("\r\n", false);
286
- const peg$e61 = peg$classExpectation(["\n", "\r"], false, false, false);
287
-
288
- function peg$f0(entries) {
289
- const items = entries.map(item => item[0]);
290
- const settings = items.filter(item => item.strict !== undefined && !item.file);
291
- if (settings.length > 1) error("Duplicate Envfile setting: strict");
292
- return { ...settings[0], declarations: items.filter(item => item.name), files: items.filter(item => item.file) };
293
- }
294
- function peg$f1(file, entries) {
295
- const items = entries.map(item => item[0]);
296
- const settings = items.filter(item => item.strict !== undefined);
297
- if (settings.length > 1) error("Duplicate Envfile setting: strict");
298
- return { file, ...settings[0], declarations: items.filter(item => item.name) };
299
- }
300
- function peg$f2(value) { return { strict: value }; }
301
- function peg$f3(value) { return value; }
302
- function peg$f4(value) { return value; }
303
- function peg$f5(name, options) {
304
- const declaration = { name };
305
- const seen = new Set();
306
- for (const option of options) {
307
- if (seen.has(option.key)) error(`Duplicate Envfile option: ${option.key}`);
308
- if ((option.key === "optional" && seen.has("required")) ||
309
- (option.key === "required" && seen.has("optional"))) {
310
- error("Cannot combine required and optional in an Envfile declaration");
311
- }
312
- seen.add(option.key);
313
- if (option.key === "optional") declaration.required = !option.value;
314
- else declaration[option.key] = option.value;
315
- }
316
- return declaration;
317
- }
318
- function peg$f6(value) { return { key: "proxy", value }; }
319
- function peg$f7(value) { return { key: "required", value }; }
320
- function peg$f8(value) { return { key: "optional", value }; }
321
- function peg$f9(value) { return { key: "redacted", value }; }
322
- function peg$f10(value) { return { key: "encrypted", value }; }
323
- function peg$f11(value) { return { key: "type", value }; }
324
- function peg$f12(value) { return { key: "enum", value }; }
325
- function peg$f13(key, value) { return { key, value }; }
326
- function peg$f14(value) { return value; }
327
- function peg$f15(first, value) { return value; }
328
- function peg$f16(first, rest) {
329
- return [first, ...rest];
330
- }
331
- function peg$f17(chars) { return chars.join(""); }
332
- function peg$f18(chars) { return chars.join(""); }
333
- function peg$f19(char) {
334
- return ({ n: "\n", r: "\r", t: "\t" })[char] || char;
335
- }
336
- function peg$f20() { return "integer"; }
337
- function peg$f21() { return "boolean"; }
338
- function peg$f22() { return "port"; }
339
- function peg$f23() { return "url"; }
340
- function peg$f24() { return "email"; }
341
- function peg$f25() { return "ip"; }
342
- function peg$f26() { return true; }
343
- function peg$f27(domain) { return { domain }; }
344
- function peg$f28() { return false; }
345
- function peg$f29(host) { return host; }
346
- function peg$f30(host) { return host; }
347
- function peg$f31(name) { return name; }
348
- function peg$f32(name) { return name; }
349
- let peg$currPos = options.peg$currPos | 0;
350
- let peg$savedPos = peg$currPos;
351
- const peg$posDetailsCache = [{ line: 1, column: 1 }];
352
- let peg$maxFailPos = peg$currPos;
353
- let peg$maxFailExpected = options.peg$maxFailExpected || [];
354
- let peg$silentFails = options.peg$silentFails | 0;
355
-
356
- let peg$result;
357
-
358
- if (options.startRule) {
359
- if (!(options.startRule in peg$startRuleFunctions)) {
360
- throw new Error("Can't start parsing from rule \"" + options.startRule + "\".");
361
- }
362
-
363
- peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
364
- }
365
-
366
- function text() {
367
- return input.substring(peg$savedPos, peg$currPos);
368
- }
369
-
370
- function offset() {
371
- return peg$savedPos;
372
- }
373
-
374
- function range() {
375
- return {
376
- source: peg$source,
377
- start: peg$savedPos,
378
- end: peg$currPos,
379
- };
380
- }
381
-
382
- function location() {
383
- return peg$computeLocation(peg$savedPos, peg$currPos);
384
- }
385
-
386
- function expected(description, location) {
387
- location = location !== undefined
388
- ? location
389
- : peg$computeLocation(peg$savedPos, peg$currPos);
390
-
391
- throw peg$buildStructuredError(
392
- [peg$otherExpectation(description)],
393
- input.substring(peg$savedPos, peg$currPos),
394
- location
395
- );
396
- }
397
-
398
- function error(message, location) {
399
- location = location !== undefined
400
- ? location
401
- : peg$computeLocation(peg$savedPos, peg$currPos);
402
-
403
- throw peg$buildSimpleError(message, location);
404
- }
405
-
406
- function peg$getUnicode(pos = peg$currPos) {
407
- const cp = input.codePointAt(pos);
408
- if (cp === undefined) {
409
- return "";
410
- }
411
- return String.fromCodePoint(cp);
412
- }
413
-
414
- function peg$literalExpectation(text, ignoreCase) {
415
- return { type: "literal", text, ignoreCase };
416
- }
417
-
418
- function peg$classExpectation(parts, inverted, ignoreCase, unicode) {
419
- return { type: "class", parts, inverted, ignoreCase, unicode };
420
- }
421
-
422
- function peg$anyExpectation() {
423
- return { type: "any" };
424
- }
425
-
426
- function peg$endExpectation() {
427
- return { type: "end" };
428
- }
429
-
430
- function peg$otherExpectation(description) {
431
- return { type: "other", description };
432
- }
433
-
434
- function peg$computePosDetails(pos) {
435
- let details = peg$posDetailsCache[pos];
436
- let p;
437
-
438
- if (details) {
439
- return details;
440
- } else {
441
- if (pos >= peg$posDetailsCache.length) {
442
- p = peg$posDetailsCache.length - 1;
443
- } else {
444
- p = pos;
445
- while (!peg$posDetailsCache[--p]) {}
446
- }
447
-
448
- details = peg$posDetailsCache[p];
449
- details = {
450
- line: details.line,
451
- column: details.column,
452
- };
453
-
454
- while (p < pos) {
455
- if (input.charCodeAt(p) === 10) {
456
- details.line++;
457
- details.column = 1;
458
- } else {
459
- details.column++;
460
- }
461
-
462
- p++;
463
- }
464
-
465
- peg$posDetailsCache[pos] = details;
466
-
467
- return details;
468
- }
469
- }
470
-
471
- function peg$computeLocation(startPos, endPos, offset) {
472
- const startPosDetails = peg$computePosDetails(startPos);
473
- const endPosDetails = peg$computePosDetails(endPos);
474
-
475
- const res = {
476
- source: peg$source,
477
- start: {
478
- offset: startPos,
479
- line: startPosDetails.line,
480
- column: startPosDetails.column,
481
- },
482
- end: {
483
- offset: endPos,
484
- line: endPosDetails.line,
485
- column: endPosDetails.column,
486
- },
487
- };
488
- if (offset && peg$source && (typeof peg$source.offset === "function")) {
489
- res.start = peg$source.offset(res.start);
490
- res.end = peg$source.offset(res.end);
491
- }
492
- return res;
493
- }
494
-
495
- function peg$fail(expected) {
496
- if (peg$currPos < peg$maxFailPos) { return; }
497
-
498
- if (peg$currPos > peg$maxFailPos) {
499
- peg$maxFailPos = peg$currPos;
500
- peg$maxFailExpected = [];
501
- }
502
-
503
- peg$maxFailExpected.push(expected);
504
- }
505
-
506
- function peg$buildSimpleError(message, location) {
507
- return new peg$SyntaxError(message, null, null, location);
508
- }
509
-
510
- function peg$buildStructuredError(expected, found, location) {
511
- return new peg$SyntaxError(
512
- peg$SyntaxError.buildMessage(expected, found),
513
- expected,
514
- found,
515
- location
516
- );
517
- }
518
-
519
- function peg$parseDocument() {
520
- let s0, s1, s2, s3, s4, s5;
521
-
522
- s0 = peg$currPos;
523
- s1 = peg$parse_();
524
- s2 = [];
525
- s3 = peg$currPos;
526
- s4 = peg$parseFileBlock();
527
- if (s4 === peg$FAILED) {
528
- s4 = peg$parseDeclaration();
529
- if (s4 === peg$FAILED) {
530
- s4 = peg$parseStrict();
531
- }
532
- }
533
- if (s4 !== peg$FAILED) {
534
- s5 = peg$parse_();
535
- s4 = [s4, s5];
536
- s3 = s4;
537
- } else {
538
- peg$currPos = s3;
539
- s3 = peg$FAILED;
540
- }
541
- while (s3 !== peg$FAILED) {
542
- s2.push(s3);
543
- s3 = peg$currPos;
544
- s4 = peg$parseFileBlock();
545
- if (s4 === peg$FAILED) {
546
- s4 = peg$parseDeclaration();
547
- if (s4 === peg$FAILED) {
548
- s4 = peg$parseStrict();
549
- }
550
- }
551
- if (s4 !== peg$FAILED) {
552
- s5 = peg$parse_();
553
- s4 = [s4, s5];
554
- s3 = s4;
555
- } else {
556
- peg$currPos = s3;
557
- s3 = peg$FAILED;
558
- }
559
- }
560
- peg$savedPos = s0;
561
- s0 = peg$f0(s2);
562
-
563
- return s0;
564
- }
565
-
566
- function peg$parseFileBlock() {
567
- let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15;
568
-
569
- s0 = peg$currPos;
570
- if (input.substr(peg$currPos, 4) === peg$c0) {
571
- s1 = peg$c0;
572
- peg$currPos += 4;
573
- } else {
574
- s1 = peg$FAILED;
575
- if (peg$silentFails === 0) { peg$fail(peg$e0); }
576
- }
577
- if (s1 !== peg$FAILED) {
578
- s2 = [];
579
- s3 = input.charAt(peg$currPos);
580
- if (peg$r0.test(s3)) {
581
- peg$currPos++;
582
- } else {
583
- s3 = peg$FAILED;
584
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
585
- }
586
- if (s3 !== peg$FAILED) {
587
- while (s3 !== peg$FAILED) {
588
- s2.push(s3);
589
- s3 = input.charAt(peg$currPos);
590
- if (peg$r0.test(s3)) {
591
- peg$currPos++;
592
- } else {
593
- s3 = peg$FAILED;
594
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
595
- }
596
- }
597
- } else {
598
- s2 = peg$FAILED;
599
- }
600
- if (s2 !== peg$FAILED) {
601
- s3 = peg$parseFilename();
602
- if (s3 !== peg$FAILED) {
603
- s4 = [];
604
- s5 = input.charAt(peg$currPos);
605
- if (peg$r0.test(s5)) {
606
- peg$currPos++;
607
- } else {
608
- s5 = peg$FAILED;
609
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
610
- }
611
- if (s5 !== peg$FAILED) {
612
- while (s5 !== peg$FAILED) {
613
- s4.push(s5);
614
- s5 = input.charAt(peg$currPos);
615
- if (peg$r0.test(s5)) {
616
- peg$currPos++;
617
- } else {
618
- s5 = peg$FAILED;
619
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
620
- }
621
- }
622
- } else {
623
- s4 = peg$FAILED;
624
- }
625
- if (s4 !== peg$FAILED) {
626
- if (input.substr(peg$currPos, 2) === peg$c1) {
627
- s5 = peg$c1;
628
- peg$currPos += 2;
629
- } else {
630
- s5 = peg$FAILED;
631
- if (peg$silentFails === 0) { peg$fail(peg$e2); }
632
- }
633
- if (s5 !== peg$FAILED) {
634
- s6 = [];
635
- s7 = input.charAt(peg$currPos);
636
- if (peg$r0.test(s7)) {
637
- peg$currPos++;
638
- } else {
639
- s7 = peg$FAILED;
640
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
641
- }
642
- while (s7 !== peg$FAILED) {
643
- s6.push(s7);
644
- s7 = input.charAt(peg$currPos);
645
- if (peg$r0.test(s7)) {
646
- peg$currPos++;
647
- } else {
648
- s7 = peg$FAILED;
649
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
650
- }
651
- }
652
- s7 = peg$parseComment();
653
- if (s7 === peg$FAILED) {
654
- s7 = null;
655
- }
656
- s8 = peg$parseNewline();
657
- if (s8 !== peg$FAILED) {
658
- s9 = peg$parse_();
659
- s10 = [];
660
- s11 = peg$currPos;
661
- s12 = peg$parseDeclaration();
662
- if (s12 === peg$FAILED) {
663
- s12 = peg$parseStrict();
664
- }
665
- if (s12 !== peg$FAILED) {
666
- s13 = peg$parse_();
667
- s12 = [s12, s13];
668
- s11 = s12;
669
- } else {
670
- peg$currPos = s11;
671
- s11 = peg$FAILED;
672
- }
673
- while (s11 !== peg$FAILED) {
674
- s10.push(s11);
675
- s11 = peg$currPos;
676
- s12 = peg$parseDeclaration();
677
- if (s12 === peg$FAILED) {
678
- s12 = peg$parseStrict();
679
- }
680
- if (s12 !== peg$FAILED) {
681
- s13 = peg$parse_();
682
- s12 = [s12, s13];
683
- s11 = s12;
684
- } else {
685
- peg$currPos = s11;
686
- s11 = peg$FAILED;
687
- }
688
- }
689
- if (input.substr(peg$currPos, 3) === peg$c2) {
690
- s11 = peg$c2;
691
- peg$currPos += 3;
692
- } else {
693
- s11 = peg$FAILED;
694
- if (peg$silentFails === 0) { peg$fail(peg$e3); }
695
- }
696
- if (s11 !== peg$FAILED) {
697
- s12 = [];
698
- s13 = input.charAt(peg$currPos);
699
- if (peg$r0.test(s13)) {
700
- peg$currPos++;
701
- } else {
702
- s13 = peg$FAILED;
703
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
704
- }
705
- while (s13 !== peg$FAILED) {
706
- s12.push(s13);
707
- s13 = input.charAt(peg$currPos);
708
- if (peg$r0.test(s13)) {
709
- peg$currPos++;
710
- } else {
711
- s13 = peg$FAILED;
712
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
713
- }
714
- }
715
- s13 = peg$parseComment();
716
- if (s13 === peg$FAILED) {
717
- s13 = null;
718
- }
719
- s14 = peg$parseNewline();
720
- if (s14 === peg$FAILED) {
721
- s14 = peg$currPos;
722
- peg$silentFails++;
723
- if (input.length > peg$currPos) {
724
- s15 = input.charAt(peg$currPos);
725
- peg$currPos++;
726
- } else {
727
- s15 = peg$FAILED;
728
- if (peg$silentFails === 0) { peg$fail(peg$e4); }
729
- }
730
- peg$silentFails--;
731
- if (s15 === peg$FAILED) {
732
- s14 = undefined;
733
- } else {
734
- peg$currPos = s14;
735
- s14 = peg$FAILED;
736
- }
737
- }
738
- if (s14 !== peg$FAILED) {
739
- peg$savedPos = s0;
740
- s0 = peg$f1(s3, s10);
741
- } else {
742
- peg$currPos = s0;
743
- s0 = peg$FAILED;
744
- }
745
- } else {
746
- peg$currPos = s0;
747
- s0 = peg$FAILED;
748
- }
749
- } else {
750
- peg$currPos = s0;
751
- s0 = peg$FAILED;
752
- }
753
- } else {
754
- peg$currPos = s0;
755
- s0 = peg$FAILED;
756
- }
757
- } else {
758
- peg$currPos = s0;
759
- s0 = peg$FAILED;
760
- }
761
- } else {
762
- peg$currPos = s0;
763
- s0 = peg$FAILED;
764
- }
765
- } else {
766
- peg$currPos = s0;
767
- s0 = peg$FAILED;
768
- }
769
- } else {
770
- peg$currPos = s0;
771
- s0 = peg$FAILED;
772
- }
773
-
774
- return s0;
775
- }
776
-
777
- function peg$parseStrict() {
778
- let s0, s1, s2, s3, s4, s5, s6, s7;
779
-
780
- s0 = peg$currPos;
781
- if (input.substr(peg$currPos, 6) === peg$c3) {
782
- s1 = peg$c3;
783
- peg$currPos += 6;
784
- } else {
785
- s1 = peg$FAILED;
786
- if (peg$silentFails === 0) { peg$fail(peg$e5); }
787
- }
788
- if (s1 !== peg$FAILED) {
789
- s2 = [];
790
- s3 = input.charAt(peg$currPos);
791
- if (peg$r0.test(s3)) {
792
- peg$currPos++;
793
- } else {
794
- s3 = peg$FAILED;
795
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
796
- }
797
- if (s3 !== peg$FAILED) {
798
- while (s3 !== peg$FAILED) {
799
- s2.push(s3);
800
- s3 = input.charAt(peg$currPos);
801
- if (peg$r0.test(s3)) {
802
- peg$currPos++;
803
- } else {
804
- s3 = peg$FAILED;
805
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
806
- }
807
- }
808
- } else {
809
- s2 = peg$FAILED;
810
- }
811
- if (s2 !== peg$FAILED) {
812
- s3 = peg$parseBoolean();
813
- if (s3 !== peg$FAILED) {
814
- s4 = [];
815
- s5 = input.charAt(peg$currPos);
816
- if (peg$r0.test(s5)) {
817
- peg$currPos++;
818
- } else {
819
- s5 = peg$FAILED;
820
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
821
- }
822
- while (s5 !== peg$FAILED) {
823
- s4.push(s5);
824
- s5 = input.charAt(peg$currPos);
825
- if (peg$r0.test(s5)) {
826
- peg$currPos++;
827
- } else {
828
- s5 = peg$FAILED;
829
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
830
- }
831
- }
832
- s5 = peg$parseComment();
833
- if (s5 === peg$FAILED) {
834
- s5 = null;
835
- }
836
- s6 = peg$parseNewline();
837
- if (s6 === peg$FAILED) {
838
- s6 = peg$currPos;
839
- peg$silentFails++;
840
- if (input.length > peg$currPos) {
841
- s7 = input.charAt(peg$currPos);
842
- peg$currPos++;
843
- } else {
844
- s7 = peg$FAILED;
845
- if (peg$silentFails === 0) { peg$fail(peg$e4); }
846
- }
847
- peg$silentFails--;
848
- if (s7 === peg$FAILED) {
849
- s6 = undefined;
850
- } else {
851
- peg$currPos = s6;
852
- s6 = peg$FAILED;
853
- }
854
- }
855
- if (s6 !== peg$FAILED) {
856
- peg$savedPos = s0;
857
- s0 = peg$f2(s3);
858
- } else {
859
- peg$currPos = s0;
860
- s0 = peg$FAILED;
861
- }
862
- } else {
863
- peg$currPos = s0;
864
- s0 = peg$FAILED;
865
- }
866
- } else {
867
- peg$currPos = s0;
868
- s0 = peg$FAILED;
869
- }
870
- } else {
871
- peg$currPos = s0;
872
- s0 = peg$FAILED;
873
- }
874
-
875
- return s0;
876
- }
877
-
878
- function peg$parseFilename() {
879
- let s0, s1, s2, s3, s4;
880
-
881
- peg$silentFails++;
882
- s0 = peg$currPos;
883
- if (input.charCodeAt(peg$currPos) === 34) {
884
- s1 = peg$c4;
885
- peg$currPos++;
886
- } else {
887
- s1 = peg$FAILED;
888
- if (peg$silentFails === 0) { peg$fail(peg$e7); }
889
- }
890
- if (s1 !== peg$FAILED) {
891
- s2 = peg$currPos;
892
- s3 = [];
893
- s4 = input.charAt(peg$currPos);
894
- if (peg$r1.test(s4)) {
895
- peg$currPos++;
896
- } else {
897
- s4 = peg$FAILED;
898
- if (peg$silentFails === 0) { peg$fail(peg$e8); }
899
- }
900
- if (s4 !== peg$FAILED) {
901
- while (s4 !== peg$FAILED) {
902
- s3.push(s4);
903
- s4 = input.charAt(peg$currPos);
904
- if (peg$r1.test(s4)) {
905
- peg$currPos++;
906
- } else {
907
- s4 = peg$FAILED;
908
- if (peg$silentFails === 0) { peg$fail(peg$e8); }
909
- }
910
- }
911
- } else {
912
- s3 = peg$FAILED;
913
- }
914
- if (s3 !== peg$FAILED) {
915
- s2 = input.substring(s2, peg$currPos);
916
- } else {
917
- s2 = s3;
918
- }
919
- if (s2 !== peg$FAILED) {
920
- if (input.charCodeAt(peg$currPos) === 34) {
921
- s3 = peg$c4;
922
- peg$currPos++;
923
- } else {
924
- s3 = peg$FAILED;
925
- if (peg$silentFails === 0) { peg$fail(peg$e7); }
926
- }
927
- if (s3 !== peg$FAILED) {
928
- peg$savedPos = s0;
929
- s0 = peg$f3(s2);
930
- } else {
931
- peg$currPos = s0;
932
- s0 = peg$FAILED;
933
- }
934
- } else {
935
- peg$currPos = s0;
936
- s0 = peg$FAILED;
937
- }
938
- } else {
939
- peg$currPos = s0;
940
- s0 = peg$FAILED;
941
- }
942
- if (s0 === peg$FAILED) {
943
- s0 = peg$currPos;
944
- if (input.charCodeAt(peg$currPos) === 39) {
945
- s1 = peg$c5;
946
- peg$currPos++;
947
- } else {
948
- s1 = peg$FAILED;
949
- if (peg$silentFails === 0) { peg$fail(peg$e9); }
950
- }
951
- if (s1 !== peg$FAILED) {
952
- s2 = peg$currPos;
953
- s3 = [];
954
- s4 = input.charAt(peg$currPos);
955
- if (peg$r2.test(s4)) {
956
- peg$currPos++;
957
- } else {
958
- s4 = peg$FAILED;
959
- if (peg$silentFails === 0) { peg$fail(peg$e10); }
960
- }
961
- if (s4 !== peg$FAILED) {
962
- while (s4 !== peg$FAILED) {
963
- s3.push(s4);
964
- s4 = input.charAt(peg$currPos);
965
- if (peg$r2.test(s4)) {
966
- peg$currPos++;
967
- } else {
968
- s4 = peg$FAILED;
969
- if (peg$silentFails === 0) { peg$fail(peg$e10); }
970
- }
971
- }
972
- } else {
973
- s3 = peg$FAILED;
974
- }
975
- if (s3 !== peg$FAILED) {
976
- s2 = input.substring(s2, peg$currPos);
977
- } else {
978
- s2 = s3;
979
- }
980
- if (s2 !== peg$FAILED) {
981
- if (input.charCodeAt(peg$currPos) === 39) {
982
- s3 = peg$c5;
983
- peg$currPos++;
984
- } else {
985
- s3 = peg$FAILED;
986
- if (peg$silentFails === 0) { peg$fail(peg$e9); }
987
- }
988
- if (s3 !== peg$FAILED) {
989
- peg$savedPos = s0;
990
- s0 = peg$f4(s2);
991
- } else {
992
- peg$currPos = s0;
993
- s0 = peg$FAILED;
994
- }
995
- } else {
996
- peg$currPos = s0;
997
- s0 = peg$FAILED;
998
- }
999
- } else {
1000
- peg$currPos = s0;
1001
- s0 = peg$FAILED;
1002
- }
1003
- }
1004
- peg$silentFails--;
1005
- if (s0 === peg$FAILED) {
1006
- s1 = peg$FAILED;
1007
- if (peg$silentFails === 0) { peg$fail(peg$e6); }
1008
- }
1009
-
1010
- return s0;
1011
- }
1012
-
1013
- function peg$parseDeclaration() {
1014
- let s0, s1, s2, s3, s4, s5, s6, s7, s8;
1015
-
1016
- s0 = peg$currPos;
1017
- if (input.substr(peg$currPos, 3) === peg$c6) {
1018
- s1 = peg$c6;
1019
- peg$currPos += 3;
1020
- } else {
1021
- s1 = peg$FAILED;
1022
- if (peg$silentFails === 0) { peg$fail(peg$e11); }
1023
- }
1024
- if (s1 !== peg$FAILED) {
1025
- s2 = [];
1026
- s3 = input.charAt(peg$currPos);
1027
- if (peg$r0.test(s3)) {
1028
- peg$currPos++;
1029
- } else {
1030
- s3 = peg$FAILED;
1031
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
1032
- }
1033
- if (s3 !== peg$FAILED) {
1034
- while (s3 !== peg$FAILED) {
1035
- s2.push(s3);
1036
- s3 = input.charAt(peg$currPos);
1037
- if (peg$r0.test(s3)) {
1038
- peg$currPos++;
1039
- } else {
1040
- s3 = peg$FAILED;
1041
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
1042
- }
1043
- }
1044
- } else {
1045
- s2 = peg$FAILED;
1046
- }
1047
- if (s2 !== peg$FAILED) {
1048
- s3 = peg$parseName();
1049
- if (s3 !== peg$FAILED) {
1050
- s4 = [];
1051
- s5 = peg$parseOption();
1052
- while (s5 !== peg$FAILED) {
1053
- s4.push(s5);
1054
- s5 = peg$parseOption();
1055
- }
1056
- s5 = [];
1057
- s6 = input.charAt(peg$currPos);
1058
- if (peg$r0.test(s6)) {
1059
- peg$currPos++;
1060
- } else {
1061
- s6 = peg$FAILED;
1062
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
1063
- }
1064
- while (s6 !== peg$FAILED) {
1065
- s5.push(s6);
1066
- s6 = input.charAt(peg$currPos);
1067
- if (peg$r0.test(s6)) {
1068
- peg$currPos++;
1069
- } else {
1070
- s6 = peg$FAILED;
1071
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
1072
- }
1073
- }
1074
- s6 = peg$parseComment();
1075
- if (s6 === peg$FAILED) {
1076
- s6 = null;
1077
- }
1078
- s7 = peg$parseNewline();
1079
- if (s7 === peg$FAILED) {
1080
- s7 = peg$currPos;
1081
- peg$silentFails++;
1082
- if (input.length > peg$currPos) {
1083
- s8 = input.charAt(peg$currPos);
1084
- peg$currPos++;
1085
- } else {
1086
- s8 = peg$FAILED;
1087
- if (peg$silentFails === 0) { peg$fail(peg$e4); }
1088
- }
1089
- peg$silentFails--;
1090
- if (s8 === peg$FAILED) {
1091
- s7 = undefined;
1092
- } else {
1093
- peg$currPos = s7;
1094
- s7 = peg$FAILED;
1095
- }
1096
- }
1097
- if (s7 !== peg$FAILED) {
1098
- peg$savedPos = s0;
1099
- s0 = peg$f5(s3, s4);
1100
- } else {
1101
- peg$currPos = s0;
1102
- s0 = peg$FAILED;
1103
- }
1104
- } else {
1105
- peg$currPos = s0;
1106
- s0 = peg$FAILED;
1107
- }
1108
- } else {
1109
- peg$currPos = s0;
1110
- s0 = peg$FAILED;
1111
- }
1112
- } else {
1113
- peg$currPos = s0;
1114
- s0 = peg$FAILED;
1115
- }
1116
-
1117
- return s0;
1118
- }
1119
-
1120
- function peg$parseOption() {
1121
- let s0, s1, s2, s3, s4, s5, s6, s7, s8;
1122
-
1123
- s0 = peg$currPos;
1124
- s1 = [];
1125
- s2 = input.charAt(peg$currPos);
1126
- if (peg$r0.test(s2)) {
1127
- peg$currPos++;
1128
- } else {
1129
- s2 = peg$FAILED;
1130
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
1131
- }
1132
- while (s2 !== peg$FAILED) {
1133
- s1.push(s2);
1134
- s2 = input.charAt(peg$currPos);
1135
- if (peg$r0.test(s2)) {
1136
- peg$currPos++;
1137
- } else {
1138
- s2 = peg$FAILED;
1139
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
1140
- }
1141
- }
1142
- if (input.charCodeAt(peg$currPos) === 44) {
1143
- s2 = peg$c7;
1144
- peg$currPos++;
1145
- } else {
1146
- s2 = peg$FAILED;
1147
- if (peg$silentFails === 0) { peg$fail(peg$e12); }
1148
- }
1149
- if (s2 !== peg$FAILED) {
1150
- s3 = peg$parse_();
1151
- if (input.substr(peg$currPos, 5) === peg$c8) {
1152
- s4 = peg$c8;
1153
- peg$currPos += 5;
1154
- } else {
1155
- s4 = peg$FAILED;
1156
- if (peg$silentFails === 0) { peg$fail(peg$e13); }
1157
- }
1158
- if (s4 !== peg$FAILED) {
1159
- s5 = [];
1160
- s6 = input.charAt(peg$currPos);
1161
- if (peg$r0.test(s6)) {
1162
- peg$currPos++;
1163
- } else {
1164
- s6 = peg$FAILED;
1165
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
1166
- }
1167
- while (s6 !== peg$FAILED) {
1168
- s5.push(s6);
1169
- s6 = input.charAt(peg$currPos);
1170
- if (peg$r0.test(s6)) {
1171
- peg$currPos++;
1172
- } else {
1173
- s6 = peg$FAILED;
1174
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
1175
- }
1176
- }
1177
- if (input.charCodeAt(peg$currPos) === 58) {
1178
- s6 = peg$c9;
1179
- peg$currPos++;
1180
- } else {
1181
- s6 = peg$FAILED;
1182
- if (peg$silentFails === 0) { peg$fail(peg$e14); }
1183
- }
1184
- if (s6 !== peg$FAILED) {
1185
- s7 = peg$parse_();
1186
- s8 = peg$parseProxyOptions();
1187
- if (s8 === peg$FAILED) {
1188
- s8 = peg$parseDisabled();
1189
- }
1190
- if (s8 !== peg$FAILED) {
1191
- peg$savedPos = s0;
1192
- s0 = peg$f6(s8);
1193
- } else {
1194
- peg$currPos = s0;
1195
- s0 = peg$FAILED;
1196
- }
1197
- } else {
1198
- peg$currPos = s0;
1199
- s0 = peg$FAILED;
1200
- }
1201
- } else {
1202
- peg$currPos = s0;
1203
- s0 = peg$FAILED;
1204
- }
1205
- } else {
1206
- peg$currPos = s0;
1207
- s0 = peg$FAILED;
1208
- }
1209
- if (s0 === peg$FAILED) {
1210
- s0 = peg$currPos;
1211
- s1 = [];
1212
- s2 = input.charAt(peg$currPos);
1213
- if (peg$r0.test(s2)) {
1214
- peg$currPos++;
1215
- } else {
1216
- s2 = peg$FAILED;
1217
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
1218
- }
1219
- while (s2 !== peg$FAILED) {
1220
- s1.push(s2);
1221
- s2 = input.charAt(peg$currPos);
1222
- if (peg$r0.test(s2)) {
1223
- peg$currPos++;
1224
- } else {
1225
- s2 = peg$FAILED;
1226
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
1227
- }
1228
- }
1229
- if (input.charCodeAt(peg$currPos) === 44) {
1230
- s2 = peg$c7;
1231
- peg$currPos++;
1232
- } else {
1233
- s2 = peg$FAILED;
1234
- if (peg$silentFails === 0) { peg$fail(peg$e12); }
1235
- }
1236
- if (s2 !== peg$FAILED) {
1237
- s3 = peg$parse_();
1238
- if (input.substr(peg$currPos, 8) === peg$c10) {
1239
- s4 = peg$c10;
1240
- peg$currPos += 8;
1241
- } else {
1242
- s4 = peg$FAILED;
1243
- if (peg$silentFails === 0) { peg$fail(peg$e15); }
1244
- }
1245
- if (s4 !== peg$FAILED) {
1246
- s5 = [];
1247
- s6 = input.charAt(peg$currPos);
1248
- if (peg$r0.test(s6)) {
1249
- peg$currPos++;
1250
- } else {
1251
- s6 = peg$FAILED;
1252
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
1253
- }
1254
- while (s6 !== peg$FAILED) {
1255
- s5.push(s6);
1256
- s6 = input.charAt(peg$currPos);
1257
- if (peg$r0.test(s6)) {
1258
- peg$currPos++;
1259
- } else {
1260
- s6 = peg$FAILED;
1261
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
1262
- }
1263
- }
1264
- if (input.charCodeAt(peg$currPos) === 58) {
1265
- s6 = peg$c9;
1266
- peg$currPos++;
1267
- } else {
1268
- s6 = peg$FAILED;
1269
- if (peg$silentFails === 0) { peg$fail(peg$e14); }
1270
- }
1271
- if (s6 !== peg$FAILED) {
1272
- s7 = peg$parse_();
1273
- s8 = peg$parseBoolean();
1274
- if (s8 !== peg$FAILED) {
1275
- peg$savedPos = s0;
1276
- s0 = peg$f7(s8);
1277
- } else {
1278
- peg$currPos = s0;
1279
- s0 = peg$FAILED;
1280
- }
1281
- } else {
1282
- peg$currPos = s0;
1283
- s0 = peg$FAILED;
1284
- }
1285
- } else {
1286
- peg$currPos = s0;
1287
- s0 = peg$FAILED;
1288
- }
1289
- } else {
1290
- peg$currPos = s0;
1291
- s0 = peg$FAILED;
1292
- }
1293
- if (s0 === peg$FAILED) {
1294
- s0 = peg$currPos;
1295
- s1 = [];
1296
- s2 = input.charAt(peg$currPos);
1297
- if (peg$r0.test(s2)) {
1298
- peg$currPos++;
1299
- } else {
1300
- s2 = peg$FAILED;
1301
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
1302
- }
1303
- while (s2 !== peg$FAILED) {
1304
- s1.push(s2);
1305
- s2 = input.charAt(peg$currPos);
1306
- if (peg$r0.test(s2)) {
1307
- peg$currPos++;
1308
- } else {
1309
- s2 = peg$FAILED;
1310
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
1311
- }
1312
- }
1313
- if (input.charCodeAt(peg$currPos) === 44) {
1314
- s2 = peg$c7;
1315
- peg$currPos++;
1316
- } else {
1317
- s2 = peg$FAILED;
1318
- if (peg$silentFails === 0) { peg$fail(peg$e12); }
1319
- }
1320
- if (s2 !== peg$FAILED) {
1321
- s3 = peg$parse_();
1322
- if (input.substr(peg$currPos, 8) === peg$c11) {
1323
- s4 = peg$c11;
1324
- peg$currPos += 8;
1325
- } else {
1326
- s4 = peg$FAILED;
1327
- if (peg$silentFails === 0) { peg$fail(peg$e16); }
1328
- }
1329
- if (s4 !== peg$FAILED) {
1330
- s5 = [];
1331
- s6 = input.charAt(peg$currPos);
1332
- if (peg$r0.test(s6)) {
1333
- peg$currPos++;
1334
- } else {
1335
- s6 = peg$FAILED;
1336
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
1337
- }
1338
- while (s6 !== peg$FAILED) {
1339
- s5.push(s6);
1340
- s6 = input.charAt(peg$currPos);
1341
- if (peg$r0.test(s6)) {
1342
- peg$currPos++;
1343
- } else {
1344
- s6 = peg$FAILED;
1345
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
1346
- }
1347
- }
1348
- if (input.charCodeAt(peg$currPos) === 58) {
1349
- s6 = peg$c9;
1350
- peg$currPos++;
1351
- } else {
1352
- s6 = peg$FAILED;
1353
- if (peg$silentFails === 0) { peg$fail(peg$e14); }
1354
- }
1355
- if (s6 !== peg$FAILED) {
1356
- s7 = peg$parse_();
1357
- s8 = peg$parseBoolean();
1358
- if (s8 !== peg$FAILED) {
1359
- peg$savedPos = s0;
1360
- s0 = peg$f8(s8);
1361
- } else {
1362
- peg$currPos = s0;
1363
- s0 = peg$FAILED;
1364
- }
1365
- } else {
1366
- peg$currPos = s0;
1367
- s0 = peg$FAILED;
1368
- }
1369
- } else {
1370
- peg$currPos = s0;
1371
- s0 = peg$FAILED;
1372
- }
1373
- } else {
1374
- peg$currPos = s0;
1375
- s0 = peg$FAILED;
1376
- }
1377
- if (s0 === peg$FAILED) {
1378
- s0 = peg$currPos;
1379
- s1 = [];
1380
- s2 = input.charAt(peg$currPos);
1381
- if (peg$r0.test(s2)) {
1382
- peg$currPos++;
1383
- } else {
1384
- s2 = peg$FAILED;
1385
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
1386
- }
1387
- while (s2 !== peg$FAILED) {
1388
- s1.push(s2);
1389
- s2 = input.charAt(peg$currPos);
1390
- if (peg$r0.test(s2)) {
1391
- peg$currPos++;
1392
- } else {
1393
- s2 = peg$FAILED;
1394
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
1395
- }
1396
- }
1397
- if (input.charCodeAt(peg$currPos) === 44) {
1398
- s2 = peg$c7;
1399
- peg$currPos++;
1400
- } else {
1401
- s2 = peg$FAILED;
1402
- if (peg$silentFails === 0) { peg$fail(peg$e12); }
1403
- }
1404
- if (s2 !== peg$FAILED) {
1405
- s3 = peg$parse_();
1406
- if (input.substr(peg$currPos, 8) === peg$c12) {
1407
- s4 = peg$c12;
1408
- peg$currPos += 8;
1409
- } else {
1410
- s4 = peg$FAILED;
1411
- if (peg$silentFails === 0) { peg$fail(peg$e17); }
1412
- }
1413
- if (s4 === peg$FAILED) {
1414
- if (input.substr(peg$currPos, 6) === peg$c13) {
1415
- s4 = peg$c13;
1416
- peg$currPos += 6;
1417
- } else {
1418
- s4 = peg$FAILED;
1419
- if (peg$silentFails === 0) { peg$fail(peg$e18); }
1420
- }
1421
- }
1422
- if (s4 !== peg$FAILED) {
1423
- s5 = [];
1424
- s6 = input.charAt(peg$currPos);
1425
- if (peg$r0.test(s6)) {
1426
- peg$currPos++;
1427
- } else {
1428
- s6 = peg$FAILED;
1429
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
1430
- }
1431
- while (s6 !== peg$FAILED) {
1432
- s5.push(s6);
1433
- s6 = input.charAt(peg$currPos);
1434
- if (peg$r0.test(s6)) {
1435
- peg$currPos++;
1436
- } else {
1437
- s6 = peg$FAILED;
1438
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
1439
- }
1440
- }
1441
- if (input.charCodeAt(peg$currPos) === 58) {
1442
- s6 = peg$c9;
1443
- peg$currPos++;
1444
- } else {
1445
- s6 = peg$FAILED;
1446
- if (peg$silentFails === 0) { peg$fail(peg$e14); }
1447
- }
1448
- if (s6 !== peg$FAILED) {
1449
- s7 = peg$parse_();
1450
- s8 = peg$parseBoolean();
1451
- if (s8 !== peg$FAILED) {
1452
- peg$savedPos = s0;
1453
- s0 = peg$f9(s8);
1454
- } else {
1455
- peg$currPos = s0;
1456
- s0 = peg$FAILED;
1457
- }
1458
- } else {
1459
- peg$currPos = s0;
1460
- s0 = peg$FAILED;
1461
- }
1462
- } else {
1463
- peg$currPos = s0;
1464
- s0 = peg$FAILED;
1465
- }
1466
- } else {
1467
- peg$currPos = s0;
1468
- s0 = peg$FAILED;
1469
- }
1470
- if (s0 === peg$FAILED) {
1471
- s0 = peg$currPos;
1472
- s1 = [];
1473
- s2 = input.charAt(peg$currPos);
1474
- if (peg$r0.test(s2)) {
1475
- peg$currPos++;
1476
- } else {
1477
- s2 = peg$FAILED;
1478
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
1479
- }
1480
- while (s2 !== peg$FAILED) {
1481
- s1.push(s2);
1482
- s2 = input.charAt(peg$currPos);
1483
- if (peg$r0.test(s2)) {
1484
- peg$currPos++;
1485
- } else {
1486
- s2 = peg$FAILED;
1487
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
1488
- }
1489
- }
1490
- if (input.charCodeAt(peg$currPos) === 44) {
1491
- s2 = peg$c7;
1492
- peg$currPos++;
1493
- } else {
1494
- s2 = peg$FAILED;
1495
- if (peg$silentFails === 0) { peg$fail(peg$e12); }
1496
- }
1497
- if (s2 !== peg$FAILED) {
1498
- s3 = peg$parse_();
1499
- if (input.substr(peg$currPos, 9) === peg$c14) {
1500
- s4 = peg$c14;
1501
- peg$currPos += 9;
1502
- } else {
1503
- s4 = peg$FAILED;
1504
- if (peg$silentFails === 0) { peg$fail(peg$e19); }
1505
- }
1506
- if (s4 === peg$FAILED) {
1507
- if (input.substr(peg$currPos, 7) === peg$c15) {
1508
- s4 = peg$c15;
1509
- peg$currPos += 7;
1510
- } else {
1511
- s4 = peg$FAILED;
1512
- if (peg$silentFails === 0) { peg$fail(peg$e20); }
1513
- }
1514
- }
1515
- if (s4 !== peg$FAILED) {
1516
- s5 = [];
1517
- s6 = input.charAt(peg$currPos);
1518
- if (peg$r0.test(s6)) {
1519
- peg$currPos++;
1520
- } else {
1521
- s6 = peg$FAILED;
1522
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
1523
- }
1524
- while (s6 !== peg$FAILED) {
1525
- s5.push(s6);
1526
- s6 = input.charAt(peg$currPos);
1527
- if (peg$r0.test(s6)) {
1528
- peg$currPos++;
1529
- } else {
1530
- s6 = peg$FAILED;
1531
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
1532
- }
1533
- }
1534
- if (input.charCodeAt(peg$currPos) === 58) {
1535
- s6 = peg$c9;
1536
- peg$currPos++;
1537
- } else {
1538
- s6 = peg$FAILED;
1539
- if (peg$silentFails === 0) { peg$fail(peg$e14); }
1540
- }
1541
- if (s6 !== peg$FAILED) {
1542
- s7 = peg$parse_();
1543
- s8 = peg$parseBoolean();
1544
- if (s8 !== peg$FAILED) {
1545
- peg$savedPos = s0;
1546
- s0 = peg$f10(s8);
1547
- } else {
1548
- peg$currPos = s0;
1549
- s0 = peg$FAILED;
1550
- }
1551
- } else {
1552
- peg$currPos = s0;
1553
- s0 = peg$FAILED;
1554
- }
1555
- } else {
1556
- peg$currPos = s0;
1557
- s0 = peg$FAILED;
1558
- }
1559
- } else {
1560
- peg$currPos = s0;
1561
- s0 = peg$FAILED;
1562
- }
1563
- if (s0 === peg$FAILED) {
1564
- s0 = peg$currPos;
1565
- s1 = [];
1566
- s2 = input.charAt(peg$currPos);
1567
- if (peg$r0.test(s2)) {
1568
- peg$currPos++;
1569
- } else {
1570
- s2 = peg$FAILED;
1571
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
1572
- }
1573
- while (s2 !== peg$FAILED) {
1574
- s1.push(s2);
1575
- s2 = input.charAt(peg$currPos);
1576
- if (peg$r0.test(s2)) {
1577
- peg$currPos++;
1578
- } else {
1579
- s2 = peg$FAILED;
1580
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
1581
- }
1582
- }
1583
- if (input.charCodeAt(peg$currPos) === 44) {
1584
- s2 = peg$c7;
1585
- peg$currPos++;
1586
- } else {
1587
- s2 = peg$FAILED;
1588
- if (peg$silentFails === 0) { peg$fail(peg$e12); }
1589
- }
1590
- if (s2 !== peg$FAILED) {
1591
- s3 = peg$parse_();
1592
- if (input.substr(peg$currPos, 4) === peg$c16) {
1593
- s4 = peg$c16;
1594
- peg$currPos += 4;
1595
- } else {
1596
- s4 = peg$FAILED;
1597
- if (peg$silentFails === 0) { peg$fail(peg$e21); }
1598
- }
1599
- if (s4 !== peg$FAILED) {
1600
- s5 = [];
1601
- s6 = input.charAt(peg$currPos);
1602
- if (peg$r0.test(s6)) {
1603
- peg$currPos++;
1604
- } else {
1605
- s6 = peg$FAILED;
1606
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
1607
- }
1608
- while (s6 !== peg$FAILED) {
1609
- s5.push(s6);
1610
- s6 = input.charAt(peg$currPos);
1611
- if (peg$r0.test(s6)) {
1612
- peg$currPos++;
1613
- } else {
1614
- s6 = peg$FAILED;
1615
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
1616
- }
1617
- }
1618
- if (input.charCodeAt(peg$currPos) === 58) {
1619
- s6 = peg$c9;
1620
- peg$currPos++;
1621
- } else {
1622
- s6 = peg$FAILED;
1623
- if (peg$silentFails === 0) { peg$fail(peg$e14); }
1624
- }
1625
- if (s6 !== peg$FAILED) {
1626
- s7 = peg$parse_();
1627
- s8 = peg$parseType();
1628
- if (s8 !== peg$FAILED) {
1629
- peg$savedPos = s0;
1630
- s0 = peg$f11(s8);
1631
- } else {
1632
- peg$currPos = s0;
1633
- s0 = peg$FAILED;
1634
- }
1635
- } else {
1636
- peg$currPos = s0;
1637
- s0 = peg$FAILED;
1638
- }
1639
- } else {
1640
- peg$currPos = s0;
1641
- s0 = peg$FAILED;
1642
- }
1643
- } else {
1644
- peg$currPos = s0;
1645
- s0 = peg$FAILED;
1646
- }
1647
- if (s0 === peg$FAILED) {
1648
- s0 = peg$currPos;
1649
- s1 = [];
1650
- s2 = input.charAt(peg$currPos);
1651
- if (peg$r0.test(s2)) {
1652
- peg$currPos++;
1653
- } else {
1654
- s2 = peg$FAILED;
1655
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
1656
- }
1657
- while (s2 !== peg$FAILED) {
1658
- s1.push(s2);
1659
- s2 = input.charAt(peg$currPos);
1660
- if (peg$r0.test(s2)) {
1661
- peg$currPos++;
1662
- } else {
1663
- s2 = peg$FAILED;
1664
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
1665
- }
1666
- }
1667
- if (input.charCodeAt(peg$currPos) === 44) {
1668
- s2 = peg$c7;
1669
- peg$currPos++;
1670
- } else {
1671
- s2 = peg$FAILED;
1672
- if (peg$silentFails === 0) { peg$fail(peg$e12); }
1673
- }
1674
- if (s2 !== peg$FAILED) {
1675
- s3 = peg$parse_();
1676
- if (input.substr(peg$currPos, 4) === peg$c17) {
1677
- s4 = peg$c17;
1678
- peg$currPos += 4;
1679
- } else {
1680
- s4 = peg$FAILED;
1681
- if (peg$silentFails === 0) { peg$fail(peg$e22); }
1682
- }
1683
- if (s4 !== peg$FAILED) {
1684
- s5 = [];
1685
- s6 = input.charAt(peg$currPos);
1686
- if (peg$r0.test(s6)) {
1687
- peg$currPos++;
1688
- } else {
1689
- s6 = peg$FAILED;
1690
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
1691
- }
1692
- while (s6 !== peg$FAILED) {
1693
- s5.push(s6);
1694
- s6 = input.charAt(peg$currPos);
1695
- if (peg$r0.test(s6)) {
1696
- peg$currPos++;
1697
- } else {
1698
- s6 = peg$FAILED;
1699
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
1700
- }
1701
- }
1702
- if (input.charCodeAt(peg$currPos) === 58) {
1703
- s6 = peg$c9;
1704
- peg$currPos++;
1705
- } else {
1706
- s6 = peg$FAILED;
1707
- if (peg$silentFails === 0) { peg$fail(peg$e14); }
1708
- }
1709
- if (s6 !== peg$FAILED) {
1710
- s7 = peg$parse_();
1711
- s8 = peg$parseEnum();
1712
- if (s8 !== peg$FAILED) {
1713
- peg$savedPos = s0;
1714
- s0 = peg$f12(s8);
1715
- } else {
1716
- peg$currPos = s0;
1717
- s0 = peg$FAILED;
1718
- }
1719
- } else {
1720
- peg$currPos = s0;
1721
- s0 = peg$FAILED;
1722
- }
1723
- } else {
1724
- peg$currPos = s0;
1725
- s0 = peg$FAILED;
1726
- }
1727
- } else {
1728
- peg$currPos = s0;
1729
- s0 = peg$FAILED;
1730
- }
1731
- if (s0 === peg$FAILED) {
1732
- s0 = peg$currPos;
1733
- s1 = [];
1734
- s2 = input.charAt(peg$currPos);
1735
- if (peg$r0.test(s2)) {
1736
- peg$currPos++;
1737
- } else {
1738
- s2 = peg$FAILED;
1739
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
1740
- }
1741
- while (s2 !== peg$FAILED) {
1742
- s1.push(s2);
1743
- s2 = input.charAt(peg$currPos);
1744
- if (peg$r0.test(s2)) {
1745
- peg$currPos++;
1746
- } else {
1747
- s2 = peg$FAILED;
1748
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
1749
- }
1750
- }
1751
- if (input.charCodeAt(peg$currPos) === 44) {
1752
- s2 = peg$c7;
1753
- peg$currPos++;
1754
- } else {
1755
- s2 = peg$FAILED;
1756
- if (peg$silentFails === 0) { peg$fail(peg$e12); }
1757
- }
1758
- if (s2 !== peg$FAILED) {
1759
- s3 = peg$parse_();
1760
- if (input.substr(peg$currPos, 3) === peg$c18) {
1761
- s4 = peg$c18;
1762
- peg$currPos += 3;
1763
- } else {
1764
- s4 = peg$FAILED;
1765
- if (peg$silentFails === 0) { peg$fail(peg$e23); }
1766
- }
1767
- if (s4 === peg$FAILED) {
1768
- if (input.substr(peg$currPos, 3) === peg$c19) {
1769
- s4 = peg$c19;
1770
- peg$currPos += 3;
1771
- } else {
1772
- s4 = peg$FAILED;
1773
- if (peg$silentFails === 0) { peg$fail(peg$e24); }
1774
- }
1775
- }
1776
- if (s4 !== peg$FAILED) {
1777
- s5 = [];
1778
- s6 = input.charAt(peg$currPos);
1779
- if (peg$r0.test(s6)) {
1780
- peg$currPos++;
1781
- } else {
1782
- s6 = peg$FAILED;
1783
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
1784
- }
1785
- while (s6 !== peg$FAILED) {
1786
- s5.push(s6);
1787
- s6 = input.charAt(peg$currPos);
1788
- if (peg$r0.test(s6)) {
1789
- peg$currPos++;
1790
- } else {
1791
- s6 = peg$FAILED;
1792
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
1793
- }
1794
- }
1795
- if (input.charCodeAt(peg$currPos) === 58) {
1796
- s6 = peg$c9;
1797
- peg$currPos++;
1798
- } else {
1799
- s6 = peg$FAILED;
1800
- if (peg$silentFails === 0) { peg$fail(peg$e14); }
1801
- }
1802
- if (s6 !== peg$FAILED) {
1803
- s7 = peg$parse_();
1804
- s8 = peg$parseInteger();
1805
- if (s8 !== peg$FAILED) {
1806
- peg$savedPos = s0;
1807
- s0 = peg$f13(s4, s8);
1808
- } else {
1809
- peg$currPos = s0;
1810
- s0 = peg$FAILED;
1811
- }
1812
- } else {
1813
- peg$currPos = s0;
1814
- s0 = peg$FAILED;
1815
- }
1816
- } else {
1817
- peg$currPos = s0;
1818
- s0 = peg$FAILED;
1819
- }
1820
- } else {
1821
- peg$currPos = s0;
1822
- s0 = peg$FAILED;
1823
- }
1824
- }
1825
- }
1826
- }
1827
- }
1828
- }
1829
- }
1830
- }
1831
-
1832
- return s0;
1833
- }
1834
-
1835
- function peg$parseInteger() {
1836
- let s0, s1, s2, s3, s4, s5;
1837
-
1838
- peg$silentFails++;
1839
- s0 = peg$currPos;
1840
- s1 = peg$currPos;
1841
- s2 = peg$currPos;
1842
- s3 = input.charAt(peg$currPos);
1843
- if (peg$r3.test(s3)) {
1844
- peg$currPos++;
1845
- } else {
1846
- s3 = peg$FAILED;
1847
- if (peg$silentFails === 0) { peg$fail(peg$e26); }
1848
- }
1849
- if (s3 === peg$FAILED) {
1850
- s3 = null;
1851
- }
1852
- s4 = [];
1853
- s5 = input.charAt(peg$currPos);
1854
- if (peg$r4.test(s5)) {
1855
- peg$currPos++;
1856
- } else {
1857
- s5 = peg$FAILED;
1858
- if (peg$silentFails === 0) { peg$fail(peg$e27); }
1859
- }
1860
- if (s5 !== peg$FAILED) {
1861
- while (s5 !== peg$FAILED) {
1862
- s4.push(s5);
1863
- s5 = input.charAt(peg$currPos);
1864
- if (peg$r4.test(s5)) {
1865
- peg$currPos++;
1866
- } else {
1867
- s5 = peg$FAILED;
1868
- if (peg$silentFails === 0) { peg$fail(peg$e27); }
1869
- }
1870
- }
1871
- } else {
1872
- s4 = peg$FAILED;
1873
- }
1874
- if (s4 !== peg$FAILED) {
1875
- s3 = [s3, s4];
1876
- s2 = s3;
1877
- } else {
1878
- peg$currPos = s2;
1879
- s2 = peg$FAILED;
1880
- }
1881
- if (s2 !== peg$FAILED) {
1882
- s1 = input.substring(s1, peg$currPos);
1883
- } else {
1884
- s1 = s2;
1885
- }
1886
- if (s1 !== peg$FAILED) {
1887
- peg$savedPos = s0;
1888
- s1 = peg$f14(s1);
1889
- }
1890
- s0 = s1;
1891
- peg$silentFails--;
1892
- if (s0 === peg$FAILED) {
1893
- s1 = peg$FAILED;
1894
- if (peg$silentFails === 0) { peg$fail(peg$e25); }
1895
- }
1896
-
1897
- return s0;
1898
- }
1899
-
1900
- function peg$parseEnum() {
1901
- let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9;
1902
-
1903
- s0 = peg$currPos;
1904
- if (input.charCodeAt(peg$currPos) === 91) {
1905
- s1 = peg$c20;
1906
- peg$currPos++;
1907
- } else {
1908
- s1 = peg$FAILED;
1909
- if (peg$silentFails === 0) { peg$fail(peg$e28); }
1910
- }
1911
- if (s1 !== peg$FAILED) {
1912
- s2 = peg$parse_();
1913
- s3 = peg$parseEnumValue();
1914
- if (s3 !== peg$FAILED) {
1915
- s4 = [];
1916
- s5 = peg$currPos;
1917
- s6 = peg$parse_();
1918
- if (input.charCodeAt(peg$currPos) === 44) {
1919
- s7 = peg$c7;
1920
- peg$currPos++;
1921
- } else {
1922
- s7 = peg$FAILED;
1923
- if (peg$silentFails === 0) { peg$fail(peg$e12); }
1924
- }
1925
- if (s7 !== peg$FAILED) {
1926
- s8 = peg$parse_();
1927
- s9 = peg$parseEnumValue();
1928
- if (s9 !== peg$FAILED) {
1929
- peg$savedPos = s5;
1930
- s5 = peg$f15(s3, s9);
1931
- } else {
1932
- peg$currPos = s5;
1933
- s5 = peg$FAILED;
1934
- }
1935
- } else {
1936
- peg$currPos = s5;
1937
- s5 = peg$FAILED;
1938
- }
1939
- while (s5 !== peg$FAILED) {
1940
- s4.push(s5);
1941
- s5 = peg$currPos;
1942
- s6 = peg$parse_();
1943
- if (input.charCodeAt(peg$currPos) === 44) {
1944
- s7 = peg$c7;
1945
- peg$currPos++;
1946
- } else {
1947
- s7 = peg$FAILED;
1948
- if (peg$silentFails === 0) { peg$fail(peg$e12); }
1949
- }
1950
- if (s7 !== peg$FAILED) {
1951
- s8 = peg$parse_();
1952
- s9 = peg$parseEnumValue();
1953
- if (s9 !== peg$FAILED) {
1954
- peg$savedPos = s5;
1955
- s5 = peg$f15(s3, s9);
1956
- } else {
1957
- peg$currPos = s5;
1958
- s5 = peg$FAILED;
1959
- }
1960
- } else {
1961
- peg$currPos = s5;
1962
- s5 = peg$FAILED;
1963
- }
1964
- }
1965
- s5 = peg$parse_();
1966
- if (input.charCodeAt(peg$currPos) === 44) {
1967
- s6 = peg$c7;
1968
- peg$currPos++;
1969
- } else {
1970
- s6 = peg$FAILED;
1971
- if (peg$silentFails === 0) { peg$fail(peg$e12); }
1972
- }
1973
- if (s6 === peg$FAILED) {
1974
- s6 = null;
1975
- }
1976
- s7 = peg$parse_();
1977
- if (input.charCodeAt(peg$currPos) === 93) {
1978
- s8 = peg$c21;
1979
- peg$currPos++;
1980
- } else {
1981
- s8 = peg$FAILED;
1982
- if (peg$silentFails === 0) { peg$fail(peg$e29); }
1983
- }
1984
- if (s8 !== peg$FAILED) {
1985
- peg$savedPos = s0;
1986
- s0 = peg$f16(s3, s4);
1987
- } else {
1988
- peg$currPos = s0;
1989
- s0 = peg$FAILED;
1990
- }
1991
- } else {
1992
- peg$currPos = s0;
1993
- s0 = peg$FAILED;
1994
- }
1995
- } else {
1996
- peg$currPos = s0;
1997
- s0 = peg$FAILED;
1998
- }
1999
-
2000
- return s0;
2001
- }
2002
-
2003
- function peg$parseEnumValue() {
2004
- let s0, s1, s2, s3;
2005
-
2006
- s0 = peg$currPos;
2007
- if (input.charCodeAt(peg$currPos) === 34) {
2008
- s1 = peg$c4;
2009
- peg$currPos++;
2010
- } else {
2011
- s1 = peg$FAILED;
2012
- if (peg$silentFails === 0) { peg$fail(peg$e7); }
2013
- }
2014
- if (s1 !== peg$FAILED) {
2015
- s2 = [];
2016
- s3 = peg$parseEscape();
2017
- if (s3 === peg$FAILED) {
2018
- s3 = input.charAt(peg$currPos);
2019
- if (peg$r5.test(s3)) {
2020
- peg$currPos++;
2021
- } else {
2022
- s3 = peg$FAILED;
2023
- if (peg$silentFails === 0) { peg$fail(peg$e30); }
2024
- }
2025
- }
2026
- while (s3 !== peg$FAILED) {
2027
- s2.push(s3);
2028
- s3 = peg$parseEscape();
2029
- if (s3 === peg$FAILED) {
2030
- s3 = input.charAt(peg$currPos);
2031
- if (peg$r5.test(s3)) {
2032
- peg$currPos++;
2033
- } else {
2034
- s3 = peg$FAILED;
2035
- if (peg$silentFails === 0) { peg$fail(peg$e30); }
2036
- }
2037
- }
2038
- }
2039
- if (input.charCodeAt(peg$currPos) === 34) {
2040
- s3 = peg$c4;
2041
- peg$currPos++;
2042
- } else {
2043
- s3 = peg$FAILED;
2044
- if (peg$silentFails === 0) { peg$fail(peg$e7); }
2045
- }
2046
- if (s3 !== peg$FAILED) {
2047
- peg$savedPos = s0;
2048
- s0 = peg$f17(s2);
2049
- } else {
2050
- peg$currPos = s0;
2051
- s0 = peg$FAILED;
2052
- }
2053
- } else {
2054
- peg$currPos = s0;
2055
- s0 = peg$FAILED;
2056
- }
2057
- if (s0 === peg$FAILED) {
2058
- s0 = peg$currPos;
2059
- if (input.charCodeAt(peg$currPos) === 39) {
2060
- s1 = peg$c5;
2061
- peg$currPos++;
2062
- } else {
2063
- s1 = peg$FAILED;
2064
- if (peg$silentFails === 0) { peg$fail(peg$e9); }
2065
- }
2066
- if (s1 !== peg$FAILED) {
2067
- s2 = [];
2068
- s3 = peg$parseEscape();
2069
- if (s3 === peg$FAILED) {
2070
- s3 = input.charAt(peg$currPos);
2071
- if (peg$r6.test(s3)) {
2072
- peg$currPos++;
2073
- } else {
2074
- s3 = peg$FAILED;
2075
- if (peg$silentFails === 0) { peg$fail(peg$e31); }
2076
- }
2077
- }
2078
- while (s3 !== peg$FAILED) {
2079
- s2.push(s3);
2080
- s3 = peg$parseEscape();
2081
- if (s3 === peg$FAILED) {
2082
- s3 = input.charAt(peg$currPos);
2083
- if (peg$r6.test(s3)) {
2084
- peg$currPos++;
2085
- } else {
2086
- s3 = peg$FAILED;
2087
- if (peg$silentFails === 0) { peg$fail(peg$e31); }
2088
- }
2089
- }
2090
- }
2091
- if (input.charCodeAt(peg$currPos) === 39) {
2092
- s3 = peg$c5;
2093
- peg$currPos++;
2094
- } else {
2095
- s3 = peg$FAILED;
2096
- if (peg$silentFails === 0) { peg$fail(peg$e9); }
2097
- }
2098
- if (s3 !== peg$FAILED) {
2099
- peg$savedPos = s0;
2100
- s0 = peg$f18(s2);
2101
- } else {
2102
- peg$currPos = s0;
2103
- s0 = peg$FAILED;
2104
- }
2105
- } else {
2106
- peg$currPos = s0;
2107
- s0 = peg$FAILED;
2108
- }
2109
- if (s0 === peg$FAILED) {
2110
- s0 = peg$parseInteger();
2111
- }
2112
- }
2113
-
2114
- return s0;
2115
- }
2116
-
2117
- function peg$parseEscape() {
2118
- let s0, s1, s2;
2119
-
2120
- s0 = peg$currPos;
2121
- if (input.charCodeAt(peg$currPos) === 92) {
2122
- s1 = peg$c22;
2123
- peg$currPos++;
2124
- } else {
2125
- s1 = peg$FAILED;
2126
- if (peg$silentFails === 0) { peg$fail(peg$e32); }
2127
- }
2128
- if (s1 !== peg$FAILED) {
2129
- s2 = input.charAt(peg$currPos);
2130
- if (peg$r7.test(s2)) {
2131
- peg$currPos++;
2132
- } else {
2133
- s2 = peg$FAILED;
2134
- if (peg$silentFails === 0) { peg$fail(peg$e33); }
2135
- }
2136
- if (s2 !== peg$FAILED) {
2137
- peg$savedPos = s0;
2138
- s0 = peg$f19(s2);
2139
- } else {
2140
- peg$currPos = s0;
2141
- s0 = peg$FAILED;
2142
- }
2143
- } else {
2144
- peg$currPos = s0;
2145
- s0 = peg$FAILED;
2146
- }
2147
-
2148
- return s0;
2149
- }
2150
-
2151
- function peg$parseType() {
2152
- let s0, s1;
2153
-
2154
- peg$silentFails++;
2155
- s0 = peg$currPos;
2156
- if (input.substr(peg$currPos, 9) === peg$c23) {
2157
- s1 = peg$c23;
2158
- peg$currPos += 9;
2159
- } else {
2160
- s1 = peg$FAILED;
2161
- if (peg$silentFails === 0) { peg$fail(peg$e35); }
2162
- }
2163
- if (s1 === peg$FAILED) {
2164
- if (input.substr(peg$currPos, 9) === peg$c24) {
2165
- s1 = peg$c24;
2166
- peg$currPos += 9;
2167
- } else {
2168
- s1 = peg$FAILED;
2169
- if (peg$silentFails === 0) { peg$fail(peg$e36); }
2170
- }
2171
- }
2172
- if (s1 !== peg$FAILED) {
2173
- peg$savedPos = s0;
2174
- s1 = peg$f20();
2175
- }
2176
- s0 = s1;
2177
- if (s0 === peg$FAILED) {
2178
- s0 = peg$currPos;
2179
- if (input.substr(peg$currPos, 9) === peg$c25) {
2180
- s1 = peg$c25;
2181
- peg$currPos += 9;
2182
- } else {
2183
- s1 = peg$FAILED;
2184
- if (peg$silentFails === 0) { peg$fail(peg$e37); }
2185
- }
2186
- if (s1 === peg$FAILED) {
2187
- if (input.substr(peg$currPos, 9) === peg$c26) {
2188
- s1 = peg$c26;
2189
- peg$currPos += 9;
2190
- } else {
2191
- s1 = peg$FAILED;
2192
- if (peg$silentFails === 0) { peg$fail(peg$e38); }
2193
- }
2194
- }
2195
- if (s1 !== peg$FAILED) {
2196
- peg$savedPos = s0;
2197
- s1 = peg$f21();
2198
- }
2199
- s0 = s1;
2200
- if (s0 === peg$FAILED) {
2201
- s0 = peg$currPos;
2202
- if (input.substr(peg$currPos, 6) === peg$c27) {
2203
- s1 = peg$c27;
2204
- peg$currPos += 6;
2205
- } else {
2206
- s1 = peg$FAILED;
2207
- if (peg$silentFails === 0) { peg$fail(peg$e39); }
2208
- }
2209
- if (s1 === peg$FAILED) {
2210
- if (input.substr(peg$currPos, 6) === peg$c28) {
2211
- s1 = peg$c28;
2212
- peg$currPos += 6;
2213
- } else {
2214
- s1 = peg$FAILED;
2215
- if (peg$silentFails === 0) { peg$fail(peg$e40); }
2216
- }
2217
- }
2218
- if (s1 !== peg$FAILED) {
2219
- peg$savedPos = s0;
2220
- s1 = peg$f22();
2221
- }
2222
- s0 = s1;
2223
- if (s0 === peg$FAILED) {
2224
- s0 = peg$currPos;
2225
- if (input.substr(peg$currPos, 5) === peg$c29) {
2226
- s1 = peg$c29;
2227
- peg$currPos += 5;
2228
- } else {
2229
- s1 = peg$FAILED;
2230
- if (peg$silentFails === 0) { peg$fail(peg$e41); }
2231
- }
2232
- if (s1 === peg$FAILED) {
2233
- if (input.substr(peg$currPos, 5) === peg$c30) {
2234
- s1 = peg$c30;
2235
- peg$currPos += 5;
2236
- } else {
2237
- s1 = peg$FAILED;
2238
- if (peg$silentFails === 0) { peg$fail(peg$e42); }
2239
- }
2240
- }
2241
- if (s1 !== peg$FAILED) {
2242
- peg$savedPos = s0;
2243
- s1 = peg$f23();
2244
- }
2245
- s0 = s1;
2246
- if (s0 === peg$FAILED) {
2247
- s0 = peg$currPos;
2248
- if (input.substr(peg$currPos, 7) === peg$c31) {
2249
- s1 = peg$c31;
2250
- peg$currPos += 7;
2251
- } else {
2252
- s1 = peg$FAILED;
2253
- if (peg$silentFails === 0) { peg$fail(peg$e43); }
2254
- }
2255
- if (s1 === peg$FAILED) {
2256
- if (input.substr(peg$currPos, 7) === peg$c32) {
2257
- s1 = peg$c32;
2258
- peg$currPos += 7;
2259
- } else {
2260
- s1 = peg$FAILED;
2261
- if (peg$silentFails === 0) { peg$fail(peg$e44); }
2262
- }
2263
- }
2264
- if (s1 !== peg$FAILED) {
2265
- peg$savedPos = s0;
2266
- s1 = peg$f24();
2267
- }
2268
- s0 = s1;
2269
- if (s0 === peg$FAILED) {
2270
- s0 = peg$currPos;
2271
- if (input.substr(peg$currPos, 4) === peg$c33) {
2272
- s1 = peg$c33;
2273
- peg$currPos += 4;
2274
- } else {
2275
- s1 = peg$FAILED;
2276
- if (peg$silentFails === 0) { peg$fail(peg$e45); }
2277
- }
2278
- if (s1 === peg$FAILED) {
2279
- if (input.substr(peg$currPos, 4) === peg$c34) {
2280
- s1 = peg$c34;
2281
- peg$currPos += 4;
2282
- } else {
2283
- s1 = peg$FAILED;
2284
- if (peg$silentFails === 0) { peg$fail(peg$e46); }
2285
- }
2286
- }
2287
- if (s1 !== peg$FAILED) {
2288
- peg$savedPos = s0;
2289
- s1 = peg$f25();
2290
- }
2291
- s0 = s1;
2292
- }
2293
- }
2294
- }
2295
- }
2296
- }
2297
- peg$silentFails--;
2298
- if (s0 === peg$FAILED) {
2299
- s1 = peg$FAILED;
2300
- if (peg$silentFails === 0) { peg$fail(peg$e34); }
2301
- }
2302
-
2303
- return s0;
2304
- }
2305
-
2306
- function peg$parseBoolean() {
2307
- let s0, s1;
2308
-
2309
- peg$silentFails++;
2310
- s0 = peg$currPos;
2311
- if (input.substr(peg$currPos, 4) === peg$c35) {
2312
- s1 = peg$c35;
2313
- peg$currPos += 4;
2314
- } else {
2315
- s1 = peg$FAILED;
2316
- if (peg$silentFails === 0) { peg$fail(peg$e48); }
2317
- }
2318
- if (s1 !== peg$FAILED) {
2319
- peg$savedPos = s0;
2320
- s1 = peg$f26();
2321
- }
2322
- s0 = s1;
2323
- if (s0 === peg$FAILED) {
2324
- s0 = peg$parseDisabled();
2325
- }
2326
- peg$silentFails--;
2327
- if (s0 === peg$FAILED) {
2328
- s1 = peg$FAILED;
2329
- if (peg$silentFails === 0) { peg$fail(peg$e47); }
2330
- }
2331
-
2332
- return s0;
2333
- }
2334
-
2335
- function peg$parseProxyOptions() {
2336
- let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11;
2337
-
2338
- s0 = peg$currPos;
2339
- if (input.charCodeAt(peg$currPos) === 123) {
2340
- s1 = peg$c36;
2341
- peg$currPos++;
2342
- } else {
2343
- s1 = peg$FAILED;
2344
- if (peg$silentFails === 0) { peg$fail(peg$e49); }
2345
- }
2346
- if (s1 !== peg$FAILED) {
2347
- s2 = peg$parse_();
2348
- if (input.substr(peg$currPos, 6) === peg$c37) {
2349
- s3 = peg$c37;
2350
- peg$currPos += 6;
2351
- } else {
2352
- s3 = peg$FAILED;
2353
- if (peg$silentFails === 0) { peg$fail(peg$e50); }
2354
- }
2355
- if (s3 !== peg$FAILED) {
2356
- s4 = [];
2357
- s5 = input.charAt(peg$currPos);
2358
- if (peg$r0.test(s5)) {
2359
- peg$currPos++;
2360
- } else {
2361
- s5 = peg$FAILED;
2362
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
2363
- }
2364
- while (s5 !== peg$FAILED) {
2365
- s4.push(s5);
2366
- s5 = input.charAt(peg$currPos);
2367
- if (peg$r0.test(s5)) {
2368
- peg$currPos++;
2369
- } else {
2370
- s5 = peg$FAILED;
2371
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
2372
- }
2373
- }
2374
- if (input.charCodeAt(peg$currPos) === 58) {
2375
- s5 = peg$c9;
2376
- peg$currPos++;
2377
- } else {
2378
- s5 = peg$FAILED;
2379
- if (peg$silentFails === 0) { peg$fail(peg$e14); }
2380
- }
2381
- if (s5 !== peg$FAILED) {
2382
- s6 = peg$parse_();
2383
- s7 = peg$parseDestination();
2384
- if (s7 !== peg$FAILED) {
2385
- s8 = peg$parse_();
2386
- if (input.charCodeAt(peg$currPos) === 44) {
2387
- s9 = peg$c7;
2388
- peg$currPos++;
2389
- } else {
2390
- s9 = peg$FAILED;
2391
- if (peg$silentFails === 0) { peg$fail(peg$e12); }
2392
- }
2393
- if (s9 === peg$FAILED) {
2394
- s9 = null;
2395
- }
2396
- s10 = peg$parse_();
2397
- if (input.charCodeAt(peg$currPos) === 125) {
2398
- s11 = peg$c38;
2399
- peg$currPos++;
2400
- } else {
2401
- s11 = peg$FAILED;
2402
- if (peg$silentFails === 0) { peg$fail(peg$e51); }
2403
- }
2404
- if (s11 !== peg$FAILED) {
2405
- peg$savedPos = s0;
2406
- s0 = peg$f27(s7);
2407
- } else {
2408
- peg$currPos = s0;
2409
- s0 = peg$FAILED;
2410
- }
2411
- } else {
2412
- peg$currPos = s0;
2413
- s0 = peg$FAILED;
2414
- }
2415
- } else {
2416
- peg$currPos = s0;
2417
- s0 = peg$FAILED;
2418
- }
2419
- } else {
2420
- peg$currPos = s0;
2421
- s0 = peg$FAILED;
2422
- }
2423
- } else {
2424
- peg$currPos = s0;
2425
- s0 = peg$FAILED;
2426
- }
2427
-
2428
- return s0;
2429
- }
2430
-
2431
- function peg$parseDisabled() {
2432
- let s0, s1;
2433
-
2434
- s0 = peg$currPos;
2435
- if (input.substr(peg$currPos, 5) === peg$c39) {
2436
- s1 = peg$c39;
2437
- peg$currPos += 5;
2438
- } else {
2439
- s1 = peg$FAILED;
2440
- if (peg$silentFails === 0) { peg$fail(peg$e52); }
2441
- }
2442
- if (s1 !== peg$FAILED) {
2443
- peg$savedPos = s0;
2444
- s1 = peg$f28();
2445
- }
2446
- s0 = s1;
2447
-
2448
- return s0;
2449
- }
2450
-
2451
- function peg$parseDestination() {
2452
- let s0, s1, s2, s3, s4;
2453
-
2454
- peg$silentFails++;
2455
- s0 = peg$currPos;
2456
- if (input.charCodeAt(peg$currPos) === 34) {
2457
- s1 = peg$c4;
2458
- peg$currPos++;
2459
- } else {
2460
- s1 = peg$FAILED;
2461
- if (peg$silentFails === 0) { peg$fail(peg$e7); }
2462
- }
2463
- if (s1 !== peg$FAILED) {
2464
- s2 = peg$currPos;
2465
- s3 = [];
2466
- s4 = input.charAt(peg$currPos);
2467
- if (peg$r8.test(s4)) {
2468
- peg$currPos++;
2469
- } else {
2470
- s4 = peg$FAILED;
2471
- if (peg$silentFails === 0) { peg$fail(peg$e54); }
2472
- }
2473
- if (s4 !== peg$FAILED) {
2474
- while (s4 !== peg$FAILED) {
2475
- s3.push(s4);
2476
- s4 = input.charAt(peg$currPos);
2477
- if (peg$r8.test(s4)) {
2478
- peg$currPos++;
2479
- } else {
2480
- s4 = peg$FAILED;
2481
- if (peg$silentFails === 0) { peg$fail(peg$e54); }
2482
- }
2483
- }
2484
- } else {
2485
- s3 = peg$FAILED;
2486
- }
2487
- if (s3 !== peg$FAILED) {
2488
- s2 = input.substring(s2, peg$currPos);
2489
- } else {
2490
- s2 = s3;
2491
- }
2492
- if (s2 !== peg$FAILED) {
2493
- if (input.charCodeAt(peg$currPos) === 34) {
2494
- s3 = peg$c4;
2495
- peg$currPos++;
2496
- } else {
2497
- s3 = peg$FAILED;
2498
- if (peg$silentFails === 0) { peg$fail(peg$e7); }
2499
- }
2500
- if (s3 !== peg$FAILED) {
2501
- peg$savedPos = s0;
2502
- s0 = peg$f29(s2);
2503
- } else {
2504
- peg$currPos = s0;
2505
- s0 = peg$FAILED;
2506
- }
2507
- } else {
2508
- peg$currPos = s0;
2509
- s0 = peg$FAILED;
2510
- }
2511
- } else {
2512
- peg$currPos = s0;
2513
- s0 = peg$FAILED;
2514
- }
2515
- if (s0 === peg$FAILED) {
2516
- s0 = peg$currPos;
2517
- if (input.charCodeAt(peg$currPos) === 39) {
2518
- s1 = peg$c5;
2519
- peg$currPos++;
2520
- } else {
2521
- s1 = peg$FAILED;
2522
- if (peg$silentFails === 0) { peg$fail(peg$e9); }
2523
- }
2524
- if (s1 !== peg$FAILED) {
2525
- s2 = peg$currPos;
2526
- s3 = [];
2527
- s4 = input.charAt(peg$currPos);
2528
- if (peg$r8.test(s4)) {
2529
- peg$currPos++;
2530
- } else {
2531
- s4 = peg$FAILED;
2532
- if (peg$silentFails === 0) { peg$fail(peg$e54); }
2533
- }
2534
- if (s4 !== peg$FAILED) {
2535
- while (s4 !== peg$FAILED) {
2536
- s3.push(s4);
2537
- s4 = input.charAt(peg$currPos);
2538
- if (peg$r8.test(s4)) {
2539
- peg$currPos++;
2540
- } else {
2541
- s4 = peg$FAILED;
2542
- if (peg$silentFails === 0) { peg$fail(peg$e54); }
2543
- }
2544
- }
2545
- } else {
2546
- s3 = peg$FAILED;
2547
- }
2548
- if (s3 !== peg$FAILED) {
2549
- s2 = input.substring(s2, peg$currPos);
2550
- } else {
2551
- s2 = s3;
2552
- }
2553
- if (s2 !== peg$FAILED) {
2554
- if (input.charCodeAt(peg$currPos) === 39) {
2555
- s3 = peg$c5;
2556
- peg$currPos++;
2557
- } else {
2558
- s3 = peg$FAILED;
2559
- if (peg$silentFails === 0) { peg$fail(peg$e9); }
2560
- }
2561
- if (s3 !== peg$FAILED) {
2562
- peg$savedPos = s0;
2563
- s0 = peg$f30(s2);
2564
- } else {
2565
- peg$currPos = s0;
2566
- s0 = peg$FAILED;
2567
- }
2568
- } else {
2569
- peg$currPos = s0;
2570
- s0 = peg$FAILED;
2571
- }
2572
- } else {
2573
- peg$currPos = s0;
2574
- s0 = peg$FAILED;
2575
- }
2576
- }
2577
- peg$silentFails--;
2578
- if (s0 === peg$FAILED) {
2579
- s1 = peg$FAILED;
2580
- if (peg$silentFails === 0) { peg$fail(peg$e53); }
2581
- }
2582
-
2583
- return s0;
2584
- }
2585
-
2586
- function peg$parseName() {
2587
- let s0, s1, s2, s3;
2588
-
2589
- peg$silentFails++;
2590
- s0 = peg$currPos;
2591
- if (input.charCodeAt(peg$currPos) === 34) {
2592
- s1 = peg$c4;
2593
- peg$currPos++;
2594
- } else {
2595
- s1 = peg$FAILED;
2596
- if (peg$silentFails === 0) { peg$fail(peg$e7); }
2597
- }
2598
- if (s1 !== peg$FAILED) {
2599
- s2 = peg$parseIdentifier();
2600
- if (s2 !== peg$FAILED) {
2601
- if (input.charCodeAt(peg$currPos) === 34) {
2602
- s3 = peg$c4;
2603
- peg$currPos++;
2604
- } else {
2605
- s3 = peg$FAILED;
2606
- if (peg$silentFails === 0) { peg$fail(peg$e7); }
2607
- }
2608
- if (s3 !== peg$FAILED) {
2609
- peg$savedPos = s0;
2610
- s0 = peg$f31(s2);
2611
- } else {
2612
- peg$currPos = s0;
2613
- s0 = peg$FAILED;
2614
- }
2615
- } else {
2616
- peg$currPos = s0;
2617
- s0 = peg$FAILED;
2618
- }
2619
- } else {
2620
- peg$currPos = s0;
2621
- s0 = peg$FAILED;
2622
- }
2623
- if (s0 === peg$FAILED) {
2624
- s0 = peg$currPos;
2625
- if (input.charCodeAt(peg$currPos) === 39) {
2626
- s1 = peg$c5;
2627
- peg$currPos++;
2628
- } else {
2629
- s1 = peg$FAILED;
2630
- if (peg$silentFails === 0) { peg$fail(peg$e9); }
2631
- }
2632
- if (s1 !== peg$FAILED) {
2633
- s2 = peg$parseIdentifier();
2634
- if (s2 !== peg$FAILED) {
2635
- if (input.charCodeAt(peg$currPos) === 39) {
2636
- s3 = peg$c5;
2637
- peg$currPos++;
2638
- } else {
2639
- s3 = peg$FAILED;
2640
- if (peg$silentFails === 0) { peg$fail(peg$e9); }
2641
- }
2642
- if (s3 !== peg$FAILED) {
2643
- peg$savedPos = s0;
2644
- s0 = peg$f32(s2);
2645
- } else {
2646
- peg$currPos = s0;
2647
- s0 = peg$FAILED;
2648
- }
2649
- } else {
2650
- peg$currPos = s0;
2651
- s0 = peg$FAILED;
2652
- }
2653
- } else {
2654
- peg$currPos = s0;
2655
- s0 = peg$FAILED;
2656
- }
2657
- }
2658
- peg$silentFails--;
2659
- if (s0 === peg$FAILED) {
2660
- s1 = peg$FAILED;
2661
- if (peg$silentFails === 0) { peg$fail(peg$e55); }
2662
- }
2663
-
2664
- return s0;
2665
- }
2666
-
2667
- function peg$parseIdentifier() {
2668
- let s0, s1, s2, s3, s4;
2669
-
2670
- s0 = peg$currPos;
2671
- s1 = peg$currPos;
2672
- s2 = input.charAt(peg$currPos);
2673
- if (peg$r9.test(s2)) {
2674
- peg$currPos++;
2675
- } else {
2676
- s2 = peg$FAILED;
2677
- if (peg$silentFails === 0) { peg$fail(peg$e56); }
2678
- }
2679
- if (s2 !== peg$FAILED) {
2680
- s3 = [];
2681
- s4 = input.charAt(peg$currPos);
2682
- if (peg$r10.test(s4)) {
2683
- peg$currPos++;
2684
- } else {
2685
- s4 = peg$FAILED;
2686
- if (peg$silentFails === 0) { peg$fail(peg$e57); }
2687
- }
2688
- while (s4 !== peg$FAILED) {
2689
- s3.push(s4);
2690
- s4 = input.charAt(peg$currPos);
2691
- if (peg$r10.test(s4)) {
2692
- peg$currPos++;
2693
- } else {
2694
- s4 = peg$FAILED;
2695
- if (peg$silentFails === 0) { peg$fail(peg$e57); }
2696
- }
2697
- }
2698
- s2 = [s2, s3];
2699
- s1 = s2;
2700
- } else {
2701
- peg$currPos = s1;
2702
- s1 = peg$FAILED;
2703
- }
2704
- if (s1 !== peg$FAILED) {
2705
- s0 = input.substring(s0, peg$currPos);
2706
- } else {
2707
- s0 = s1;
2708
- }
2709
-
2710
- return s0;
2711
- }
2712
-
2713
- function peg$parseComment() {
2714
- let s0, s1, s2, s3;
2715
-
2716
- s0 = peg$currPos;
2717
- if (input.charCodeAt(peg$currPos) === 35) {
2718
- s1 = peg$c40;
2719
- peg$currPos++;
2720
- } else {
2721
- s1 = peg$FAILED;
2722
- if (peg$silentFails === 0) { peg$fail(peg$e58); }
2723
- }
2724
- if (s1 !== peg$FAILED) {
2725
- s2 = [];
2726
- s3 = input.charAt(peg$currPos);
2727
- if (peg$r11.test(s3)) {
2728
- peg$currPos++;
2729
- } else {
2730
- s3 = peg$FAILED;
2731
- if (peg$silentFails === 0) { peg$fail(peg$e59); }
2732
- }
2733
- while (s3 !== peg$FAILED) {
2734
- s2.push(s3);
2735
- s3 = input.charAt(peg$currPos);
2736
- if (peg$r11.test(s3)) {
2737
- peg$currPos++;
2738
- } else {
2739
- s3 = peg$FAILED;
2740
- if (peg$silentFails === 0) { peg$fail(peg$e59); }
2741
- }
2742
- }
2743
- s1 = [s1, s2];
2744
- s0 = s1;
2745
- } else {
2746
- peg$currPos = s0;
2747
- s0 = peg$FAILED;
2748
- }
2749
-
2750
- return s0;
2751
- }
2752
-
2753
- function peg$parseNewline() {
2754
- let s0;
2755
-
2756
- if (input.substr(peg$currPos, 2) === peg$c41) {
2757
- s0 = peg$c41;
2758
- peg$currPos += 2;
2759
- } else {
2760
- s0 = peg$FAILED;
2761
- if (peg$silentFails === 0) { peg$fail(peg$e60); }
2762
- }
2763
- if (s0 === peg$FAILED) {
2764
- s0 = input.charAt(peg$currPos);
2765
- if (peg$r12.test(s0)) {
2766
- peg$currPos++;
2767
- } else {
2768
- s0 = peg$FAILED;
2769
- if (peg$silentFails === 0) { peg$fail(peg$e61); }
2770
- }
2771
- }
2772
-
2773
- return s0;
2774
- }
2775
-
2776
- function peg$parse_() {
2777
- let s0, s1;
2778
-
2779
- s0 = [];
2780
- s1 = input.charAt(peg$currPos);
2781
- if (peg$r0.test(s1)) {
2782
- peg$currPos++;
2783
- } else {
2784
- s1 = peg$FAILED;
2785
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
2786
- }
2787
- if (s1 === peg$FAILED) {
2788
- s1 = peg$parseNewline();
2789
- if (s1 === peg$FAILED) {
2790
- s1 = peg$parseComment();
2791
- }
2792
- }
2793
- while (s1 !== peg$FAILED) {
2794
- s0.push(s1);
2795
- s1 = input.charAt(peg$currPos);
2796
- if (peg$r0.test(s1)) {
2797
- peg$currPos++;
2798
- } else {
2799
- s1 = peg$FAILED;
2800
- if (peg$silentFails === 0) { peg$fail(peg$e1); }
2801
- }
2802
- if (s1 === peg$FAILED) {
2803
- s1 = peg$parseNewline();
2804
- if (s1 === peg$FAILED) {
2805
- s1 = peg$parseComment();
2806
- }
2807
- }
2808
- }
2809
-
2810
- return s0;
2811
- }
2812
-
2813
- peg$result = peg$startRuleFunction();
2814
-
2815
- const peg$success = (peg$result !== peg$FAILED && peg$currPos === input.length);
2816
- function peg$throw() {
2817
- if (peg$result !== peg$FAILED && peg$currPos < input.length) {
2818
- peg$fail(peg$endExpectation());
2819
- }
2820
-
2821
- throw peg$buildStructuredError(
2822
- peg$maxFailExpected,
2823
- peg$maxFailPos < input.length ? peg$getUnicode(peg$maxFailPos) : null,
2824
- peg$maxFailPos < input.length
2825
- ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)
2826
- : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)
2827
- );
2828
- }
2829
- if (options.peg$library) {
2830
- return /** @type {any} */ ({
2831
- peg$result,
2832
- peg$currPos,
2833
- peg$FAILED,
2834
- peg$maxFailExpected,
2835
- peg$maxFailPos,
2836
- peg$success,
2837
- peg$throw: peg$success ? undefined : peg$throw,
2838
- });
2839
- }
2840
- if (peg$success) {
2841
- return peg$result;
2842
- } else {
2843
- peg$throw();
2844
- }
2845
- }
2846
-
2847
- module.exports = {
2848
- StartRules: ["Document"],
2849
- SyntaxError: peg$SyntaxError,
2850
- parse: peg$parse,
2851
- };