@env-spec/parser 0.0.1 → 0.0.3
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/LICENSE +21 -0
- package/dist/{chunk-FWOHTEQS.mjs → chunk-RQYYQO3M.mjs} +2 -2
- package/dist/chunk-RQYYQO3M.mjs.map +1 -0
- package/dist/{chunk-JU4IPIOA.js → chunk-YM4E5JVI.js} +2 -2
- package/dist/chunk-YM4E5JVI.js.map +1 -0
- package/dist/{classes-BGrn6GBW.d.mts → classes-DuGa2utt.d.mts} +1 -1
- package/dist/{classes-BGrn6GBW.d.ts → classes-DuGa2utt.d.ts} +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +427 -449
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +326 -348
- package/dist/index.mjs.map +1 -1
- package/dist/simple-resolver.d.mts +1 -1
- package/dist/simple-resolver.d.ts +1 -1
- package/dist/simple-resolver.js +20 -8
- package/dist/simple-resolver.js.map +1 -1
- package/dist/simple-resolver.mjs +13 -1
- package/dist/simple-resolver.mjs.map +1 -1
- package/package.json +7 -2
- package/dist/chunk-FWOHTEQS.mjs.map +0 -1
- package/dist/chunk-JU4IPIOA.js.map +0 -1
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-
|
|
2
|
-
export { ParsedEnvSpecBlankLine, ParsedEnvSpecComment, ParsedEnvSpecCommentBlock, ParsedEnvSpecConfigItem, ParsedEnvSpecDecorator, ParsedEnvSpecDecoratorComment, ParsedEnvSpecDivider, ParsedEnvSpecFile, ParsedEnvSpecFunctionArgs, ParsedEnvSpecFunctionCall, ParsedEnvSpecKeyValuePair, ParsedEnvSpecStaticValue, expand } from './chunk-
|
|
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
|
-
|
|
127
|
-
|
|
128
|
-
this
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
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
|
-
|
|
154
|
-
|
|
155
|
-
|
|
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
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
return
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
return
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
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
|
-
|
|
244
|
-
|
|
245
|
-
|
|
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
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
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
|
-
}
|
|
339
|
-
|
|
317
|
+
}
|
|
318
|
+
__name(peg$f0, "peg$f0");
|
|
319
|
+
function peg$f1(contents) {
|
|
340
320
|
return new ParsedEnvSpecFile(contents);
|
|
341
|
-
}
|
|
342
|
-
|
|
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
|
-
}
|
|
351
|
-
|
|
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
|
-
}
|
|
358
|
-
|
|
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
|
-
}
|
|
365
|
-
|
|
347
|
+
}
|
|
348
|
+
__name(peg$f4, "peg$f4");
|
|
349
|
+
function peg$f5(leadingSpace, contents) {
|
|
366
350
|
return new ParsedEnvSpecComment({ contents, leadingSpace, _location: location() });
|
|
367
|
-
}
|
|
368
|
-
|
|
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
|
-
}
|
|
376
|
-
|
|
360
|
+
}
|
|
361
|
+
__name(peg$f6, "peg$f6");
|
|
362
|
+
function peg$f7(name) {
|
|
377
363
|
return new ParsedEnvSpecFunctionArgs({ values: [] });
|
|
378
|
-
}
|
|
379
|
-
|
|
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
|
-
}
|
|
386
|
-
|
|
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
|
-
}
|
|
393
|
-
|
|
380
|
+
}
|
|
381
|
+
__name(peg$f9, "peg$f9");
|
|
382
|
+
function peg$f10(key, val) {
|
|
394
383
|
return new ParsedEnvSpecKeyValuePair({ key, val });
|
|
395
|
-
}
|
|
396
|
-
|
|
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
|
-
}
|
|
402
|
-
|
|
391
|
+
}
|
|
392
|
+
__name(peg$f11, "peg$f11");
|
|
393
|
+
function peg$f12() {
|
|
403
394
|
return new ParsedEnvSpecStaticValue({ rawValue: text(), _location: location() });
|
|
404
|
-
}
|
|
405
|
-
|
|
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
|
-
}
|
|
412
|
-
|
|
403
|
+
}
|
|
404
|
+
__name(peg$f13, "peg$f13");
|
|
405
|
+
function peg$f14() {
|
|
413
406
|
return new ParsedEnvSpecStaticValue({ rawValue: text(), _location: location() });
|
|
414
|
-
}
|
|
415
|
-
|
|
407
|
+
}
|
|
408
|
+
__name(peg$f14, "peg$f14");
|
|
409
|
+
function peg$f15() {
|
|
416
410
|
return new ParsedEnvSpecStaticValue({ rawValue: text(), _location: location() });
|
|
417
|
-
}
|
|
418
|
-
|
|
411
|
+
}
|
|
412
|
+
__name(peg$f15, "peg$f15");
|
|
413
|
+
function peg$f16(quote) {
|
|
419
414
|
return new ParsedEnvSpecStaticValue({ quote, rawValue: text(), _location: location() });
|
|
420
|
-
}
|
|
421
|
-
|
|
415
|
+
}
|
|
416
|
+
__name(peg$f16, "peg$f16");
|
|
417
|
+
function peg$f17(quote) {
|
|
422
418
|
return new ParsedEnvSpecStaticValue({ quote, rawValue: text(), _location: location() });
|
|
423
|
-
}
|
|
424
|
-
|
|
419
|
+
}
|
|
420
|
+
__name(peg$f17, "peg$f17");
|
|
421
|
+
function peg$f18(quote) {
|
|
425
422
|
return new ParsedEnvSpecStaticValue({ quote, rawValue: text(), _location: location() });
|
|
426
|
-
}
|
|
427
|
-
|
|
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
|
-
}
|
|
430
|
-
|
|
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
|
-
}
|
|
433
|
-
|
|
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
|
-
}
|
|
436
|
-
|
|
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
|
-
}
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
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
|
-
|
|
508
|
-
|
|
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
|
-
|
|
540
|
-
|
|
541
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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(
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1622
|
+
let s0, s1, s2, s3, s4, s5, s6, s7;
|
|
1613
1623
|
s0 = peg$currPos;
|
|
1614
1624
|
s1 = peg$currPos;
|
|
1615
1625
|
s2 = [];
|
|
@@ -1642,6 +1652,9 @@ function peg$parse(input, options) {
|
|
|
1642
1652
|
peg$currPos = s3;
|
|
1643
1653
|
s3 = peg$FAILED;
|
|
1644
1654
|
}
|
|
1655
|
+
if (s3 === peg$FAILED) {
|
|
1656
|
+
s3 = peg$parseFunctionArgValue();
|
|
1657
|
+
}
|
|
1645
1658
|
while (s3 !== peg$FAILED) {
|
|
1646
1659
|
s2.push(s3);
|
|
1647
1660
|
s3 = peg$currPos;
|
|
@@ -1694,6 +1707,9 @@ function peg$parse(input, options) {
|
|
|
1694
1707
|
peg$currPos = s4;
|
|
1695
1708
|
s4 = peg$FAILED;
|
|
1696
1709
|
}
|
|
1710
|
+
if (s4 === peg$FAILED) {
|
|
1711
|
+
s4 = peg$parseFunctionArgValue();
|
|
1712
|
+
}
|
|
1697
1713
|
if (s4 === peg$FAILED) {
|
|
1698
1714
|
peg$currPos = s3;
|
|
1699
1715
|
s3 = peg$FAILED;
|
|
@@ -1710,51 +1726,6 @@ function peg$parse(input, options) {
|
|
|
1710
1726
|
} else {
|
|
1711
1727
|
s1 = s2;
|
|
1712
1728
|
}
|
|
1713
|
-
if (s1 === peg$FAILED) {
|
|
1714
|
-
s1 = peg$currPos;
|
|
1715
|
-
s2 = [];
|
|
1716
|
-
s3 = peg$parseFunctionArgValue();
|
|
1717
|
-
while (s3 !== peg$FAILED) {
|
|
1718
|
-
s2.push(s3);
|
|
1719
|
-
s3 = peg$currPos;
|
|
1720
|
-
s4 = peg$currPos;
|
|
1721
|
-
s5 = peg$parse_();
|
|
1722
|
-
if (input.charCodeAt(peg$currPos) === 44) {
|
|
1723
|
-
s6 = peg$c9;
|
|
1724
|
-
peg$currPos++;
|
|
1725
|
-
} else {
|
|
1726
|
-
s6 = peg$FAILED;
|
|
1727
|
-
if (peg$silentFails === 0) {
|
|
1728
|
-
peg$fail(peg$e15);
|
|
1729
|
-
}
|
|
1730
|
-
}
|
|
1731
|
-
if (s6 !== peg$FAILED) {
|
|
1732
|
-
s7 = peg$parse_();
|
|
1733
|
-
s5 = [s5, s6, s7];
|
|
1734
|
-
s4 = s5;
|
|
1735
|
-
} else {
|
|
1736
|
-
peg$currPos = s4;
|
|
1737
|
-
s4 = peg$FAILED;
|
|
1738
|
-
}
|
|
1739
|
-
if (s4 !== peg$FAILED) {
|
|
1740
|
-
s4 = peg$parseFunctionArgValue();
|
|
1741
|
-
if (s4 === peg$FAILED) {
|
|
1742
|
-
peg$currPos = s3;
|
|
1743
|
-
s3 = peg$FAILED;
|
|
1744
|
-
} else {
|
|
1745
|
-
s3 = s4;
|
|
1746
|
-
}
|
|
1747
|
-
} else {
|
|
1748
|
-
s3 = s4;
|
|
1749
|
-
}
|
|
1750
|
-
}
|
|
1751
|
-
if (s2.length < 1) {
|
|
1752
|
-
peg$currPos = s1;
|
|
1753
|
-
s1 = peg$FAILED;
|
|
1754
|
-
} else {
|
|
1755
|
-
s1 = s2;
|
|
1756
|
-
}
|
|
1757
|
-
}
|
|
1758
1729
|
if (s1 !== peg$FAILED) {
|
|
1759
1730
|
peg$savedPos = s0;
|
|
1760
1731
|
s1 = peg$f11(s1);
|
|
@@ -1764,7 +1735,7 @@ function peg$parse(input, options) {
|
|
|
1764
1735
|
}
|
|
1765
1736
|
__name(peg$parseFunctionArgs, "peg$parseFunctionArgs");
|
|
1766
1737
|
function peg$parseFunctionArgKeyName() {
|
|
1767
|
-
|
|
1738
|
+
let s0, s1, s2, s3, s4;
|
|
1768
1739
|
s0 = peg$currPos;
|
|
1769
1740
|
s1 = peg$currPos;
|
|
1770
1741
|
s2 = input.charAt(peg$currPos);
|
|
@@ -1814,7 +1785,7 @@ function peg$parse(input, options) {
|
|
|
1814
1785
|
}
|
|
1815
1786
|
__name(peg$parseFunctionArgKeyName, "peg$parseFunctionArgKeyName");
|
|
1816
1787
|
function peg$parseFunctionArgValue() {
|
|
1817
|
-
|
|
1788
|
+
let s0, s1, s2, s3;
|
|
1818
1789
|
s0 = peg$parseFunctionCall();
|
|
1819
1790
|
if (s0 === peg$FAILED) {
|
|
1820
1791
|
s0 = peg$parsequotedString();
|
|
@@ -1863,7 +1834,7 @@ function peg$parse(input, options) {
|
|
|
1863
1834
|
}
|
|
1864
1835
|
__name(peg$parseFunctionArgValue, "peg$parseFunctionArgValue");
|
|
1865
1836
|
function peg$parseDivider() {
|
|
1866
|
-
|
|
1837
|
+
let s0, s1, s2, s3, s4, s5, s6, s7;
|
|
1867
1838
|
s0 = peg$currPos;
|
|
1868
1839
|
if (input.charCodeAt(peg$currPos) === 35) {
|
|
1869
1840
|
s1 = peg$c3;
|
|
@@ -1964,7 +1935,7 @@ function peg$parse(input, options) {
|
|
|
1964
1935
|
}
|
|
1965
1936
|
__name(peg$parseDivider, "peg$parseDivider");
|
|
1966
1937
|
function peg$parseunquotedString() {
|
|
1967
|
-
|
|
1938
|
+
let s0, s1, s2, s3, s4, s5, s6;
|
|
1968
1939
|
s0 = peg$currPos;
|
|
1969
1940
|
s1 = peg$currPos;
|
|
1970
1941
|
s2 = peg$currPos;
|
|
@@ -2039,7 +2010,7 @@ function peg$parse(input, options) {
|
|
|
2039
2010
|
}
|
|
2040
2011
|
__name(peg$parseunquotedString, "peg$parseunquotedString");
|
|
2041
2012
|
function peg$parseunquotedStringWithoutSpaces() {
|
|
2042
|
-
|
|
2013
|
+
let s0, s1, s2, s3, s4, s5;
|
|
2043
2014
|
s0 = peg$currPos;
|
|
2044
2015
|
s1 = peg$currPos;
|
|
2045
2016
|
s2 = peg$currPos;
|
|
@@ -2113,7 +2084,7 @@ function peg$parse(input, options) {
|
|
|
2113
2084
|
}
|
|
2114
2085
|
__name(peg$parseunquotedStringWithoutSpaces, "peg$parseunquotedStringWithoutSpaces");
|
|
2115
2086
|
function peg$parsequotedString() {
|
|
2116
|
-
|
|
2087
|
+
let s0;
|
|
2117
2088
|
s0 = peg$parseDQuotedString();
|
|
2118
2089
|
if (s0 === peg$FAILED) {
|
|
2119
2090
|
s0 = peg$parseSQuotedString();
|
|
@@ -2125,7 +2096,7 @@ function peg$parse(input, options) {
|
|
|
2125
2096
|
}
|
|
2126
2097
|
__name(peg$parsequotedString, "peg$parsequotedString");
|
|
2127
2098
|
function peg$parseDQuotedString() {
|
|
2128
|
-
|
|
2099
|
+
let s0, s1, s2, s3;
|
|
2129
2100
|
s0 = peg$currPos;
|
|
2130
2101
|
s1 = input.charAt(peg$currPos);
|
|
2131
2102
|
if (peg$r11.test(s1)) {
|
|
@@ -2205,7 +2176,7 @@ function peg$parse(input, options) {
|
|
|
2205
2176
|
}
|
|
2206
2177
|
__name(peg$parseDQuotedString, "peg$parseDQuotedString");
|
|
2207
2178
|
function peg$parseSQuotedString() {
|
|
2208
|
-
|
|
2179
|
+
let s0, s1, s2, s3;
|
|
2209
2180
|
s0 = peg$currPos;
|
|
2210
2181
|
s1 = input.charAt(peg$currPos);
|
|
2211
2182
|
if (peg$r13.test(s1)) {
|
|
@@ -2285,7 +2256,7 @@ function peg$parse(input, options) {
|
|
|
2285
2256
|
}
|
|
2286
2257
|
__name(peg$parseSQuotedString, "peg$parseSQuotedString");
|
|
2287
2258
|
function peg$parseBQuotedString() {
|
|
2288
|
-
|
|
2259
|
+
let s0, s1, s2, s3;
|
|
2289
2260
|
s0 = peg$currPos;
|
|
2290
2261
|
s1 = input.charAt(peg$currPos);
|
|
2291
2262
|
if (peg$r15.test(s1)) {
|
|
@@ -2365,7 +2336,7 @@ function peg$parse(input, options) {
|
|
|
2365
2336
|
}
|
|
2366
2337
|
__name(peg$parseBQuotedString, "peg$parseBQuotedString");
|
|
2367
2338
|
function peg$parsemultiLineString() {
|
|
2368
|
-
|
|
2339
|
+
let s0;
|
|
2369
2340
|
s0 = peg$parsesingleSQuotedMultiLineString();
|
|
2370
2341
|
if (s0 === peg$FAILED) {
|
|
2371
2342
|
s0 = peg$parsesingleDQuotedMultiLineString();
|
|
@@ -2380,7 +2351,7 @@ function peg$parse(input, options) {
|
|
|
2380
2351
|
}
|
|
2381
2352
|
__name(peg$parsemultiLineString, "peg$parsemultiLineString");
|
|
2382
2353
|
function peg$parsesingleSQuotedMultiLineString() {
|
|
2383
|
-
|
|
2354
|
+
let s0, s1, s2, s3, s4, s5;
|
|
2384
2355
|
s0 = peg$currPos;
|
|
2385
2356
|
s1 = input.charAt(peg$currPos);
|
|
2386
2357
|
if (peg$r13.test(s1)) {
|
|
@@ -2595,7 +2566,7 @@ function peg$parse(input, options) {
|
|
|
2595
2566
|
}
|
|
2596
2567
|
__name(peg$parsesingleSQuotedMultiLineString, "peg$parsesingleSQuotedMultiLineString");
|
|
2597
2568
|
function peg$parsesingleDQuotedMultiLineString() {
|
|
2598
|
-
|
|
2569
|
+
let s0, s1, s2, s3, s4, s5;
|
|
2599
2570
|
s0 = peg$currPos;
|
|
2600
2571
|
s1 = input.charAt(peg$currPos);
|
|
2601
2572
|
if (peg$r11.test(s1)) {
|
|
@@ -2810,7 +2781,7 @@ function peg$parse(input, options) {
|
|
|
2810
2781
|
}
|
|
2811
2782
|
__name(peg$parsesingleDQuotedMultiLineString, "peg$parsesingleDQuotedMultiLineString");
|
|
2812
2783
|
function peg$parsetripleDQuotedMultiLineString() {
|
|
2813
|
-
|
|
2784
|
+
let s0, s1, s2, s3, s4, s5, s6, s7;
|
|
2814
2785
|
s0 = peg$currPos;
|
|
2815
2786
|
if (input.substr(peg$currPos, 3) === peg$c13) {
|
|
2816
2787
|
s1 = peg$c13;
|
|
@@ -3211,7 +3182,7 @@ function peg$parse(input, options) {
|
|
|
3211
3182
|
}
|
|
3212
3183
|
__name(peg$parsetripleDQuotedMultiLineString, "peg$parsetripleDQuotedMultiLineString");
|
|
3213
3184
|
function peg$parsetripleBQuotedMultiLineString() {
|
|
3214
|
-
|
|
3185
|
+
let s0, s1, s2, s3, s4, s5, s6, s7;
|
|
3215
3186
|
s0 = peg$currPos;
|
|
3216
3187
|
if (input.substr(peg$currPos, 3) === peg$c15) {
|
|
3217
3188
|
s1 = peg$c15;
|
|
@@ -3612,7 +3583,7 @@ function peg$parse(input, options) {
|
|
|
3612
3583
|
}
|
|
3613
3584
|
__name(peg$parsetripleBQuotedMultiLineString, "peg$parsetripleBQuotedMultiLineString");
|
|
3614
3585
|
function peg$parse_n() {
|
|
3615
|
-
|
|
3586
|
+
let s0, s1;
|
|
3616
3587
|
if (input.charCodeAt(peg$currPos) === 10) {
|
|
3617
3588
|
s0 = peg$c0;
|
|
3618
3589
|
peg$currPos++;
|
|
@@ -3646,7 +3617,7 @@ function peg$parse(input, options) {
|
|
|
3646
3617
|
}
|
|
3647
3618
|
__name(peg$parse_n, "peg$parse_n");
|
|
3648
3619
|
function peg$parse_() {
|
|
3649
|
-
|
|
3620
|
+
let s0, s1;
|
|
3650
3621
|
s0 = [];
|
|
3651
3622
|
s1 = input.charAt(peg$currPos);
|
|
3652
3623
|
if (peg$r17.test(s1)) {
|
|
@@ -3673,7 +3644,7 @@ function peg$parse(input, options) {
|
|
|
3673
3644
|
}
|
|
3674
3645
|
__name(peg$parse_, "peg$parse_");
|
|
3675
3646
|
function peg$parse__() {
|
|
3676
|
-
|
|
3647
|
+
let s0, s1;
|
|
3677
3648
|
s0 = [];
|
|
3678
3649
|
s1 = input.charAt(peg$currPos);
|
|
3679
3650
|
if (peg$r17.test(s1)) {
|
|
@@ -3704,6 +3675,18 @@ function peg$parse(input, options) {
|
|
|
3704
3675
|
}
|
|
3705
3676
|
__name(peg$parse__, "peg$parse__");
|
|
3706
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");
|
|
3707
3690
|
if (options.peg$library) {
|
|
3708
3691
|
return (
|
|
3709
3692
|
/** @type {any} */
|
|
@@ -3712,21 +3695,16 @@ function peg$parse(input, options) {
|
|
|
3712
3695
|
peg$currPos,
|
|
3713
3696
|
peg$FAILED,
|
|
3714
3697
|
peg$maxFailExpected,
|
|
3715
|
-
peg$maxFailPos
|
|
3698
|
+
peg$maxFailPos,
|
|
3699
|
+
peg$success,
|
|
3700
|
+
peg$throw: peg$success ? void 0 : peg$throw
|
|
3716
3701
|
}
|
|
3717
3702
|
);
|
|
3718
3703
|
}
|
|
3719
|
-
if (peg$
|
|
3704
|
+
if (peg$success) {
|
|
3720
3705
|
return peg$result;
|
|
3721
3706
|
} else {
|
|
3722
|
-
|
|
3723
|
-
peg$fail(peg$endExpectation());
|
|
3724
|
-
}
|
|
3725
|
-
throw peg$buildStructuredError(
|
|
3726
|
-
peg$maxFailExpected,
|
|
3727
|
-
peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,
|
|
3728
|
-
peg$maxFailPos < input.length ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)
|
|
3729
|
-
);
|
|
3707
|
+
peg$throw();
|
|
3730
3708
|
}
|
|
3731
3709
|
}
|
|
3732
3710
|
__name(peg$parse, "peg$parse");
|