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