@ts-graphviz/ast 0.0.0-next-20240301111950

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/lib/ast.js ADDED
@@ -0,0 +1,3917 @@
1
+ import { pipe, map, isNodeModel, isForwardRefNode, createModelsContext } from "@ts-graphviz/common";
2
+ class Builder {
3
+ /**
4
+ * Constructor of Builder
5
+ * @param options - Options to initialize Builder
6
+ */
7
+ constructor(options) {
8
+ this.options = options;
9
+ }
10
+ /**
11
+ * Get the current file range or null
12
+ * @internal
13
+ */
14
+ getLocation() {
15
+ return this.options?.locationFunction?.() ?? null;
16
+ }
17
+ /**
18
+ * Create an {@link ASTNode} of the specified type
19
+ *
20
+ * @param type - Type of the {@link ASTNode}
21
+ * @param props - Properties of the {@link ASTNode}
22
+ * @param children - Children of the {@link ASTNode}
23
+ * @returns An {@link ASTNode}
24
+ */
25
+ createElement(type, props, children = []) {
26
+ return {
27
+ location: this.getLocation(),
28
+ ...props,
29
+ type,
30
+ children
31
+ };
32
+ }
33
+ }
34
+ const createElement = Builder.prototype.createElement.bind(new Builder());
35
+ const EOL = /\r?\n/;
36
+ function joinBy(sep) {
37
+ return (value) => value.join(sep);
38
+ }
39
+ function wrapWith(wrapper) {
40
+ return (value) => wrapper + value + wrapper;
41
+ }
42
+ function wrapByPair(l, r) {
43
+ return (value) => l + value + r;
44
+ }
45
+ function leftPadWith(left) {
46
+ return (value) => left + value;
47
+ }
48
+ const escape = (value) => value.replace(/\\/g, "\\\\").replace(/\r/g, "\\r").replace(/\n/g, "\\n").replace(/"/g, '\\"');
49
+ const splitByLine = (value) => value.split(EOL);
50
+ const indent = (style, size, eol) => pipe(
51
+ splitByLine,
52
+ map(leftPadWith(style === "space" ? " ".repeat(size) : "\n")),
53
+ joinBy(eol)
54
+ );
55
+ const endOfLine = (eol) => {
56
+ switch (eol) {
57
+ case "crlf":
58
+ return "\r\n";
59
+ case "lf":
60
+ return "\n";
61
+ }
62
+ };
63
+ const AttributeListPrintPlugin = {
64
+ match(ast) {
65
+ return ast.type === "AttributeList";
66
+ },
67
+ print(context, ast) {
68
+ if (ast.children.length === 0) {
69
+ return `${ast.kind.toLocaleLowerCase()} [];`;
70
+ }
71
+ const eol = endOfLine(context.endOfLine);
72
+ return pipe(
73
+ map(context.print),
74
+ joinBy(eol),
75
+ indent(context.indentStyle, context.indentSize, eol),
76
+ wrapByPair(`${ast.kind.toLocaleLowerCase()} [${eol}`, `${eol}];`)
77
+ )(ast.children);
78
+ }
79
+ };
80
+ const AttributePrintPlugin = {
81
+ match(ast) {
82
+ return ast.type === "Attribute";
83
+ },
84
+ print(context, ast) {
85
+ return `${context.print(ast.key)} = ${context.print(ast.value)};`;
86
+ }
87
+ };
88
+ const CommentPrintPlugin = {
89
+ match(ast) {
90
+ return ast.type === "Comment";
91
+ },
92
+ print(context, ast) {
93
+ const eol = endOfLine(context.endOfLine);
94
+ switch (ast.kind) {
95
+ case "Block":
96
+ return pipe(
97
+ splitByLine,
98
+ map(leftPadWith(" * ")),
99
+ joinBy(eol),
100
+ wrapByPair(`/**${eol}`, `${eol} */`)
101
+ )(ast.value);
102
+ case "Macro":
103
+ return pipe(
104
+ splitByLine,
105
+ map(leftPadWith("# ")),
106
+ joinBy(eol)
107
+ )(ast.value);
108
+ default:
109
+ return pipe(
110
+ splitByLine,
111
+ map(leftPadWith("// ")),
112
+ joinBy(eol)
113
+ )(ast.value);
114
+ }
115
+ }
116
+ };
117
+ const DotPrintPlugin = {
118
+ match(ast) {
119
+ return ast.type === "Dot";
120
+ },
121
+ print(context, ast) {
122
+ return ast.children.map(context.print).join(endOfLine(context.endOfLine));
123
+ }
124
+ };
125
+ const EdgePrintPlugin = {
126
+ match(ast) {
127
+ return ast.type === "Edge";
128
+ },
129
+ print(context, ast) {
130
+ const targets = pipe(
131
+ map(context.print),
132
+ joinBy(context.directed ? " -> " : " -- ")
133
+ )(ast.targets);
134
+ if (ast.children.length === 0) {
135
+ return `${targets};`;
136
+ }
137
+ const eol = endOfLine(context.endOfLine);
138
+ const contents = pipe(
139
+ map(context.print),
140
+ joinBy(eol),
141
+ indent(context.indentStyle, context.indentSize, eol),
142
+ wrapByPair(`[${eol}`, `${eol}];`)
143
+ )(ast.children);
144
+ return `${targets} ${contents}`;
145
+ }
146
+ };
147
+ const GraphPrintPlugin = {
148
+ match(ast) {
149
+ return ast.type === "Graph";
150
+ },
151
+ print(context, ast) {
152
+ context.directed = ast.directed;
153
+ const parts = [];
154
+ if (ast.strict) {
155
+ parts.push("strict");
156
+ }
157
+ parts.push(ast.directed ? "digraph" : "graph");
158
+ if (ast.id) {
159
+ parts.push(context.print(ast.id));
160
+ }
161
+ if (ast.children.length === 0) {
162
+ return `${parts.join(" ")} {}`;
163
+ }
164
+ const eol = endOfLine(context.endOfLine);
165
+ const contents = pipe(
166
+ map(context.print),
167
+ joinBy(eol),
168
+ indent(context.indentStyle, context.indentSize, eol),
169
+ wrapByPair(`{${eol}`, `${eol}}`)
170
+ )(ast.children);
171
+ return `${parts.join(" ")} ${contents}`;
172
+ }
173
+ };
174
+ const quoteLiteralValue = pipe(escape, wrapWith('"'));
175
+ const quoteHTMLLikeLiteralValue = wrapByPair("<", ">");
176
+ const LiteralPrintPlugin = {
177
+ match(ast) {
178
+ return ast.type === "Literal";
179
+ },
180
+ print(context, ast) {
181
+ switch (ast.quoted) {
182
+ case "html":
183
+ return quoteHTMLLikeLiteralValue(ast.value);
184
+ case true:
185
+ return quoteLiteralValue(ast.value);
186
+ default:
187
+ return escape(ast.value);
188
+ }
189
+ }
190
+ };
191
+ const NodePrintPlugin = {
192
+ match(ast) {
193
+ return ast.type === "Node";
194
+ },
195
+ print(context, ast) {
196
+ const id = context.print(ast.id);
197
+ if (ast.children.length === 0) {
198
+ return `${id};`;
199
+ }
200
+ const eol = endOfLine(context.endOfLine);
201
+ const contents = pipe(
202
+ map(context.print),
203
+ joinBy(eol),
204
+ indent(context.indentStyle, context.indentSize, eol),
205
+ wrapByPair(`[${eol}`, `${eol}];`)
206
+ )(ast.children);
207
+ return `${id} ${contents}`;
208
+ }
209
+ };
210
+ const NodeRefGroupPrintPlugin = {
211
+ match(ast) {
212
+ return ast.type === "NodeRefGroup";
213
+ },
214
+ print(context, ast) {
215
+ return pipe(
216
+ map(context.print),
217
+ joinBy(" "),
218
+ wrapByPair("{", "}")
219
+ )(ast.children);
220
+ }
221
+ };
222
+ const NodeRefPrintPlugin = {
223
+ match(ast) {
224
+ return ast.type === "NodeRef";
225
+ },
226
+ print(context, ast) {
227
+ const parts = [context.print(ast.id)];
228
+ if (ast.port) {
229
+ parts.push(context.print(ast.port));
230
+ }
231
+ if (ast.compass) {
232
+ parts.push(context.print(ast.compass));
233
+ }
234
+ return parts.join(":");
235
+ }
236
+ };
237
+ const SubgraphPrintPlugin = {
238
+ match(ast) {
239
+ return ast.type === "Subgraph";
240
+ },
241
+ print(context, ast) {
242
+ const parts = ["subgraph"];
243
+ if (ast.id) {
244
+ parts.push(context.print(ast.id));
245
+ }
246
+ if (ast.children.length === 0) {
247
+ return `${parts.join(" ")} {}`;
248
+ }
249
+ const eol = endOfLine(context.endOfLine);
250
+ const contents = pipe(
251
+ map(context.print),
252
+ joinBy(eol),
253
+ indent(context.indentStyle, context.indentSize, eol),
254
+ wrapByPair(`{${eol}`, `${eol}}`)
255
+ )(ast.children);
256
+ return `${parts.join(" ")} ${contents}`;
257
+ }
258
+ };
259
+ const defaultPlugins$2 = [
260
+ AttributeListPrintPlugin,
261
+ AttributePrintPlugin,
262
+ CommentPrintPlugin,
263
+ DotPrintPlugin,
264
+ EdgePrintPlugin,
265
+ GraphPrintPlugin,
266
+ LiteralPrintPlugin,
267
+ NodePrintPlugin,
268
+ NodeRefGroupPrintPlugin,
269
+ NodeRefPrintPlugin,
270
+ SubgraphPrintPlugin
271
+ ];
272
+ class Printer {
273
+ /**
274
+ * @param options Options to be used when generating the DOT string.
275
+ */
276
+ constructor(options = {}) {
277
+ this.options = options;
278
+ }
279
+ /** @internal */
280
+ #plugins = [...defaultPlugins$2];
281
+ /**
282
+ * Generates a DOT string from an ASTNode.
283
+ * @param ast The ASTNode to be converted into a DOT string.
284
+ * @returns The DOT string generated from the ASTNode.
285
+ */
286
+ print(ast) {
287
+ const plugins = [...this.#plugins];
288
+ const {
289
+ indentSize = 2,
290
+ indentStyle = "space",
291
+ endOfLine: endOfLine2 = "lf"
292
+ } = this.options;
293
+ const context = {
294
+ directed: true,
295
+ indentSize,
296
+ indentStyle,
297
+ endOfLine: endOfLine2,
298
+ print(a) {
299
+ for (const plugin of plugins) {
300
+ if (plugin.match(a)) {
301
+ return plugin.print(context, a);
302
+ }
303
+ }
304
+ throw Error();
305
+ }
306
+ };
307
+ return context.print(ast);
308
+ }
309
+ }
310
+ function stringify(ast, options) {
311
+ const result = new Printer(options).print(ast);
312
+ if (!result) {
313
+ throw new Error();
314
+ }
315
+ return result;
316
+ }
317
+ const peggyParser = (
318
+ // Generated by Peggy 3.0.2.
319
+ //
320
+ // https://peggyjs.org/
321
+ // @ts-ignore
322
+ function() {
323
+ function peg$subclass(child, parent) {
324
+ function C() {
325
+ this.constructor = child;
326
+ }
327
+ C.prototype = parent.prototype;
328
+ child.prototype = new C();
329
+ }
330
+ function peg$SyntaxError(message, expected, found, location) {
331
+ var self = Error.call(this, message);
332
+ if (Object.setPrototypeOf) {
333
+ Object.setPrototypeOf(self, peg$SyntaxError.prototype);
334
+ }
335
+ self.expected = expected;
336
+ self.found = found;
337
+ self.location = location;
338
+ self.name = "SyntaxError";
339
+ return self;
340
+ }
341
+ peg$subclass(peg$SyntaxError, Error);
342
+ function peg$padEnd(str, targetLength, padString) {
343
+ padString = padString || " ";
344
+ if (str.length > targetLength) {
345
+ return str;
346
+ }
347
+ targetLength -= str.length;
348
+ padString += padString.repeat(targetLength);
349
+ return str + padString.slice(0, targetLength);
350
+ }
351
+ peg$SyntaxError.prototype.format = function(sources) {
352
+ var str = "Error: " + this.message;
353
+ if (this.location) {
354
+ var src = null;
355
+ var k;
356
+ for (k = 0; k < sources.length; k++) {
357
+ if (sources[k].source === this.location.source) {
358
+ src = sources[k].text.split(/\r\n|\n|\r/g);
359
+ break;
360
+ }
361
+ }
362
+ var s = this.location.start;
363
+ var offset_s = this.location.source && typeof this.location.source.offset === "function" ? this.location.source.offset(s) : s;
364
+ var loc = this.location.source + ":" + offset_s.line + ":" + offset_s.column;
365
+ if (src) {
366
+ var e = this.location.end;
367
+ var filler = peg$padEnd("", offset_s.line.toString().length, " ");
368
+ var line = src[s.line - 1];
369
+ var last = s.line === e.line ? e.column : line.length + 1;
370
+ var hatLen = last - s.column || 1;
371
+ str += "\n --> " + loc + "\n" + filler + " |\n" + offset_s.line + " | " + line + "\n" + filler + " | " + peg$padEnd("", s.column - 1, " ") + peg$padEnd("", hatLen, "^");
372
+ } else {
373
+ str += "\n at " + loc;
374
+ }
375
+ }
376
+ return str;
377
+ };
378
+ peg$SyntaxError.buildMessage = function(expected, found) {
379
+ var DESCRIBE_EXPECTATION_FNS = {
380
+ // @ts-ignore
381
+ literal: function(expectation) {
382
+ return '"' + literalEscape(expectation.text) + '"';
383
+ },
384
+ // @ts-ignore
385
+ class: function(expectation) {
386
+ var escapedParts = expectation.parts.map(function(part) {
387
+ return Array.isArray(part) ? classEscape(part[0]) + "-" + classEscape(part[1]) : classEscape(part);
388
+ });
389
+ return "[" + (expectation.inverted ? "^" : "") + escapedParts.join("") + "]";
390
+ },
391
+ // @ts-ignore
392
+ any: function() {
393
+ return "any character";
394
+ },
395
+ // @ts-ignore
396
+ end: function() {
397
+ return "end of input";
398
+ },
399
+ // @ts-ignore
400
+ other: function(expectation) {
401
+ return expectation.description;
402
+ }
403
+ };
404
+ function hex(ch) {
405
+ return ch.charCodeAt(0).toString(16).toUpperCase();
406
+ }
407
+ function literalEscape(s) {
408
+ return s.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, function(ch) {
409
+ return "\\x0" + hex(ch);
410
+ }).replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) {
411
+ return "\\x" + hex(ch);
412
+ });
413
+ }
414
+ function classEscape(s) {
415
+ return s.replace(/\\/g, "\\\\").replace(/\]/g, "\\]").replace(/\^/g, "\\^").replace(/-/g, "\\-").replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, function(ch) {
416
+ return "\\x0" + hex(ch);
417
+ }).replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) {
418
+ return "\\x" + hex(ch);
419
+ });
420
+ }
421
+ function describeExpectation(expectation) {
422
+ return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
423
+ }
424
+ function describeExpected(expected2) {
425
+ var descriptions = expected2.map(describeExpectation);
426
+ var i, j;
427
+ descriptions.sort();
428
+ if (descriptions.length > 0) {
429
+ for (i = 1, j = 1; i < descriptions.length; i++) {
430
+ if (descriptions[i - 1] !== descriptions[i]) {
431
+ descriptions[j] = descriptions[i];
432
+ j++;
433
+ }
434
+ }
435
+ descriptions.length = j;
436
+ }
437
+ switch (descriptions.length) {
438
+ case 1:
439
+ return descriptions[0];
440
+ case 2:
441
+ return descriptions[0] + " or " + descriptions[1];
442
+ default:
443
+ return descriptions.slice(0, -1).join(", ") + ", or " + descriptions[descriptions.length - 1];
444
+ }
445
+ }
446
+ function describeFound(found2) {
447
+ return found2 ? '"' + literalEscape(found2) + '"' : "end of input";
448
+ }
449
+ return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";
450
+ };
451
+ function peg$parse(input, options) {
452
+ options = options !== void 0 ? options : {};
453
+ var peg$FAILED = {};
454
+ var peg$source = options.grammarSource;
455
+ var peg$startRuleFunctions = { Dot: peg$parseDot, Graph: peg$parseGraph, Subgraph: peg$parseSubgraph, Node: peg$parseNode, Edge: peg$parseEdge, AttributeList: peg$parseAttributeList, Attribute: peg$parseAttribute, ClusterStatements: peg$parseClusterStatements };
456
+ var peg$startRuleFunction = peg$parseDot;
457
+ var peg$c0 = "strict";
458
+ var peg$c1 = "graph";
459
+ var peg$c2 = "digraph";
460
+ var peg$c3 = "{";
461
+ var peg$c4 = "}";
462
+ var peg$c5 = ";";
463
+ var peg$c6 = "node";
464
+ var peg$c7 = "edge";
465
+ var peg$c8 = "=";
466
+ var peg$c9 = ",";
467
+ var peg$c10 = "[";
468
+ var peg$c11 = "]";
469
+ var peg$c12 = "->";
470
+ var peg$c13 = "--";
471
+ var peg$c14 = ":";
472
+ var peg$c15 = "subgraph";
473
+ var peg$c16 = "n";
474
+ var peg$c17 = "ne";
475
+ var peg$c18 = "e";
476
+ var peg$c19 = "se";
477
+ var peg$c20 = "s";
478
+ var peg$c21 = "sw";
479
+ var peg$c22 = "w";
480
+ var peg$c23 = "nw";
481
+ var peg$c24 = '"';
482
+ var peg$c25 = "/*";
483
+ var peg$c26 = "*/";
484
+ var peg$c27 = "//";
485
+ var peg$c28 = "#";
486
+ var peg$c29 = "$";
487
+ var peg$c30 = "_";
488
+ var peg$c31 = "-";
489
+ var peg$c32 = ".";
490
+ var peg$c33 = "<";
491
+ var peg$c34 = ">";
492
+ var peg$c35 = "\\";
493
+ var peg$c36 = "\n";
494
+ var peg$c37 = "\r\n";
495
+ var peg$c38 = "\r";
496
+ var peg$c39 = "\u2028";
497
+ var peg$c40 = "\u2029";
498
+ var peg$r0 = /^[0-9]/;
499
+ var peg$r1 = /^[\n\r\u2028\u2029]/;
500
+ var peg$r3 = /^[\n\r]/;
501
+ var peg$r4 = /^[ \t]/;
502
+ var peg$r5 = /^[a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137-\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148-\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C-\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA-\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9-\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC-\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF-\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F-\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0-\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB-\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE-\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0561-\u0587\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6-\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FC7\u1FD0-\u1FD3\u1FD6-\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6-\u1FF7\u210A\u210E-\u210F\u2113\u212F\u2134\u2139\u213C-\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65-\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73-\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3-\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7FA\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A]/;
503
+ var peg$r6 = /^[\u02B0-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0374\u037A\u0559\u0640\u06E5-\u06E6\u07F4-\u07F5\u07FA\u081A\u0824\u0828\u0971\u0E46\u0EC6\u10FC\u17D7\u1843\u1AA7\u1C78-\u1C7D\u1D2C-\u1D6A\u1D78\u1D9B-\u1DBF\u2071\u207F\u2090-\u209C\u2C7C-\u2C7D\u2D6F\u2E2F\u3005\u3031-\u3035\u303B\u309D-\u309E\u30FC-\u30FE\uA015\uA4F8-\uA4FD\uA60C\uA67F\uA717-\uA71F\uA770\uA788\uA7F8-\uA7F9\uA9CF\uAA70\uAADD\uAAF3-\uAAF4\uFF70\uFF9E-\uFF9F]/;
504
+ var peg$r7 = /^[\xAA\xBA\u01BB\u01C0-\u01C3\u0294\u05D0-\u05EA\u05F0-\u05F2\u0620-\u063F\u0641-\u064A\u066E-\u066F\u0671-\u06D3\u06D5\u06EE-\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u0800-\u0815\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0972-\u0977\u0979-\u097F\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC-\u09DD\u09DF-\u09E1\u09F0-\u09F1\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33\u0A35-\u0A36\u0A38-\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0-\u0AE1\u0B05-\u0B0C\u0B0F-\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B35-\u0B39\u0B3D\u0B5C-\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58-\u0C59\u0C60-\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0-\u0CE1\u0CF1-\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32-\u0E33\u0E40-\u0E45\u0E81-\u0E82\u0E84\u0E87-\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA-\u0EAB\u0EAD-\u0EB0\u0EB2-\u0EB3\u0EBD\u0EC0-\u0EC4\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065-\u1066\u106E-\u1070\u1075-\u1081\u108E\u10D0-\u10FA\u10FD-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17DC\u1820-\u1842\u1844-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE-\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C77\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5-\u1CF6\u2135-\u2138\u2D30-\u2D67\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3006\u303C\u3041-\u3096\u309F\u30A1-\u30FA\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA014\uA016-\uA48C\uA4D0-\uA4F7\uA500-\uA60B\uA610-\uA61F\uA62A-\uA62B\uA66E\uA6A0-\uA6E5\uA7FB-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA6F\uAA71-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5-\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADC\uAAE0-\uAAEA\uAAF2\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40-\uFB41\uFB43-\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF66-\uFF6F\uFF71-\uFF9D\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/;
505
+ var peg$r8 = /^[\u01C5\u01C8\u01CB\u01F2\u1F88-\u1F8F\u1F98-\u1F9F\u1FA8-\u1FAF\u1FBC\u1FCC\u1FFC]/;
506
+ var peg$r9 = /^[A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178-\u0179\u017B\u017D\u0181-\u0182\u0184\u0186-\u0187\u0189-\u018B\u018E-\u0191\u0193-\u0194\u0196-\u0198\u019C-\u019D\u019F-\u01A0\u01A2\u01A4\u01A6-\u01A7\u01A9\u01AC\u01AE-\u01AF\u01B1-\u01B3\u01B5\u01B7-\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A-\u023B\u023D-\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u0386\u0388-\u038A\u038C\u038E-\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9-\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0-\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E-\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D-\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA\uFF21-\uFF3A]/;
507
+ var peg$r10 = /^[\u16EE-\u16F0\u2160-\u2182\u2185-\u2188\u3007\u3021-\u3029\u3038-\u303A\uA6E6-\uA6EF]/;
508
+ var peg$r11 = /^[0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]/;
509
+ var peg$e0 = peg$literalExpectation("strict", true);
510
+ var peg$e1 = peg$literalExpectation("graph", true);
511
+ var peg$e2 = peg$literalExpectation("digraph", true);
512
+ var peg$e3 = peg$literalExpectation("{", false);
513
+ var peg$e4 = peg$literalExpectation("}", false);
514
+ var peg$e5 = peg$literalExpectation(";", false);
515
+ var peg$e6 = peg$literalExpectation("node", true);
516
+ var peg$e7 = peg$literalExpectation("edge", true);
517
+ var peg$e8 = peg$literalExpectation("=", false);
518
+ var peg$e9 = peg$literalExpectation(",", false);
519
+ var peg$e10 = peg$literalExpectation("[", false);
520
+ var peg$e11 = peg$literalExpectation("]", false);
521
+ var peg$e12 = peg$literalExpectation("->", false);
522
+ var peg$e13 = peg$literalExpectation("--", false);
523
+ var peg$e14 = peg$otherExpectation("port");
524
+ var peg$e15 = peg$literalExpectation(":", false);
525
+ var peg$e16 = peg$literalExpectation("subgraph", true);
526
+ var peg$e17 = peg$literalExpectation("n", false);
527
+ var peg$e18 = peg$literalExpectation("ne", false);
528
+ var peg$e19 = peg$literalExpectation("e", false);
529
+ var peg$e20 = peg$literalExpectation("se", false);
530
+ var peg$e21 = peg$literalExpectation("s", false);
531
+ var peg$e22 = peg$literalExpectation("sw", false);
532
+ var peg$e23 = peg$literalExpectation("w", false);
533
+ var peg$e24 = peg$literalExpectation("nw", false);
534
+ var peg$e25 = peg$literalExpectation('"', false);
535
+ var peg$e26 = peg$literalExpectation("/*", false);
536
+ var peg$e27 = peg$literalExpectation("*/", false);
537
+ var peg$e28 = peg$anyExpectation();
538
+ var peg$e29 = peg$literalExpectation("//", false);
539
+ var peg$e30 = peg$literalExpectation("#", false);
540
+ var peg$e31 = peg$otherExpectation("UNICODE_STRING");
541
+ var peg$e32 = peg$literalExpectation("$", false);
542
+ var peg$e33 = peg$literalExpectation("_", false);
543
+ var peg$e34 = peg$otherExpectation("NUMBER");
544
+ var peg$e35 = peg$literalExpectation("-", false);
545
+ var peg$e36 = peg$literalExpectation(".", false);
546
+ var peg$e37 = peg$classExpectation([["0", "9"]], false, false);
547
+ var peg$e38 = peg$literalExpectation("<", false);
548
+ var peg$e39 = peg$literalExpectation(">", false);
549
+ var peg$e40 = peg$literalExpectation("\\", false);
550
+ var peg$e41 = peg$classExpectation(["\n", "\r", "\u2028", "\u2029"], false, false);
551
+ var peg$e42 = peg$otherExpectation("end of line");
552
+ var peg$e43 = peg$literalExpectation("\n", false);
553
+ var peg$e44 = peg$literalExpectation("\r\n", false);
554
+ var peg$e45 = peg$literalExpectation("\r", false);
555
+ var peg$e46 = peg$literalExpectation("\u2028", false);
556
+ var peg$e47 = peg$literalExpectation("\u2029", false);
557
+ var peg$e50 = peg$otherExpectation("whitespace");
558
+ var peg$e51 = peg$otherExpectation("WHITESPACE");
559
+ var peg$e52 = peg$classExpectation(["\n", "\r"], false, false);
560
+ var peg$e53 = peg$classExpectation([" ", " "], false, false);
561
+ var peg$e54 = peg$classExpectation([["a", "z"], "µ", ["ß", "ö"], ["ø", "ÿ"], "ā", "ă", "ą", "ć", "ĉ", "ċ", "č", "ď", "đ", "ē", "ĕ", "ė", "ę", "ě", "ĝ", "ğ", "ġ", "ģ", "ĥ", "ħ", "ĩ", "ī", "ĭ", "į", "ı", "ij", "ĵ", ["ķ", "ĸ"], "ĺ", "ļ", "ľ", "ŀ", "ł", "ń", "ņ", ["ň", "ʼn"], "ŋ", "ō", "ŏ", "ő", "œ", "ŕ", "ŗ", "ř", "ś", "ŝ", "ş", "š", "ţ", "ť", "ŧ", "ũ", "ū", "ŭ", "ů", "ű", "ų", "ŵ", "ŷ", "ź", "ż", ["ž", "ƀ"], "ƃ", "ƅ", "ƈ", ["ƌ", "ƍ"], "ƒ", "ƕ", ["ƙ", "ƛ"], "ƞ", "ơ", "ƣ", "ƥ", "ƨ", ["ƪ", "ƫ"], "ƭ", "ư", "ƴ", "ƶ", ["ƹ", "ƺ"], ["ƽ", "ƿ"], "dž", "lj", "nj", "ǎ", "ǐ", "ǒ", "ǔ", "ǖ", "ǘ", "ǚ", ["ǜ", "ǝ"], "ǟ", "ǡ", "ǣ", "ǥ", "ǧ", "ǩ", "ǫ", "ǭ", ["ǯ", "ǰ"], "dz", "ǵ", "ǹ", "ǻ", "ǽ", "ǿ", "ȁ", "ȃ", "ȅ", "ȇ", "ȉ", "ȋ", "ȍ", "ȏ", "ȑ", "ȓ", "ȕ", "ȗ", "ș", "ț", "ȝ", "ȟ", "ȡ", "ȣ", "ȥ", "ȧ", "ȩ", "ȫ", "ȭ", "ȯ", "ȱ", ["ȳ", "ȹ"], "ȼ", ["ȿ", "ɀ"], "ɂ", "ɇ", "ɉ", "ɋ", "ɍ", ["ɏ", "ʓ"], ["ʕ", "ʯ"], "ͱ", "ͳ", "ͷ", ["ͻ", "ͽ"], "ΐ", ["ά", "ώ"], ["ϐ", "ϑ"], ["ϕ", "ϗ"], "ϙ", "ϛ", "ϝ", "ϟ", "ϡ", "ϣ", "ϥ", "ϧ", "ϩ", "ϫ", "ϭ", ["ϯ", "ϳ"], "ϵ", "ϸ", ["ϻ", "ϼ"], ["а", "џ"], "ѡ", "ѣ", "ѥ", "ѧ", "ѩ", "ѫ", "ѭ", "ѯ", "ѱ", "ѳ", "ѵ", "ѷ", "ѹ", "ѻ", "ѽ", "ѿ", "ҁ", "ҋ", "ҍ", "ҏ", "ґ", "ғ", "ҕ", "җ", "ҙ", "қ", "ҝ", "ҟ", "ҡ", "ң", "ҥ", "ҧ", "ҩ", "ҫ", "ҭ", "ү", "ұ", "ҳ", "ҵ", "ҷ", "ҹ", "һ", "ҽ", "ҿ", "ӂ", "ӄ", "ӆ", "ӈ", "ӊ", "ӌ", ["ӎ", "ӏ"], "ӑ", "ӓ", "ӕ", "ӗ", "ә", "ӛ", "ӝ", "ӟ", "ӡ", "ӣ", "ӥ", "ӧ", "ө", "ӫ", "ӭ", "ӯ", "ӱ", "ӳ", "ӵ", "ӷ", "ӹ", "ӻ", "ӽ", "ӿ", "ԁ", "ԃ", "ԅ", "ԇ", "ԉ", "ԋ", "ԍ", "ԏ", "ԑ", "ԓ", "ԕ", "ԗ", "ԙ", "ԛ", "ԝ", "ԟ", "ԡ", "ԣ", "ԥ", "ԧ", ["ա", "և"], ["ᴀ", "ᴫ"], ["ᵫ", "ᵷ"], ["ᵹ", "ᶚ"], "ḁ", "ḃ", "ḅ", "ḇ", "ḉ", "ḋ", "ḍ", "ḏ", "ḑ", "ḓ", "ḕ", "ḗ", "ḙ", "ḛ", "ḝ", "ḟ", "ḡ", "ḣ", "ḥ", "ḧ", "ḩ", "ḫ", "ḭ", "ḯ", "ḱ", "ḳ", "ḵ", "ḷ", "ḹ", "ḻ", "ḽ", "ḿ", "ṁ", "ṃ", "ṅ", "ṇ", "ṉ", "ṋ", "ṍ", "ṏ", "ṑ", "ṓ", "ṕ", "ṗ", "ṙ", "ṛ", "ṝ", "ṟ", "ṡ", "ṣ", "ṥ", "ṧ", "ṩ", "ṫ", "ṭ", "ṯ", "ṱ", "ṳ", "ṵ", "ṷ", "ṹ", "ṻ", "ṽ", "ṿ", "ẁ", "ẃ", "ẅ", "ẇ", "ẉ", "ẋ", "ẍ", "ẏ", "ẑ", "ẓ", ["ẕ", "ẝ"], "ẟ", "ạ", "ả", "ấ", "ầ", "ẩ", "ẫ", "ậ", "ắ", "ằ", "ẳ", "ẵ", "ặ", "ẹ", "ẻ", "ẽ", "ế", "ề", "ể", "ễ", "ệ", "ỉ", "ị", "ọ", "ỏ", "ố", "ồ", "ổ", "ỗ", "ộ", "ớ", "ờ", "ở", "ỡ", "ợ", "ụ", "ủ", "ứ", "ừ", "ử", "ữ", "ự", "ỳ", "ỵ", "ỷ", "ỹ", "ỻ", "ỽ", ["ỿ", "ἇ"], ["ἐ", "ἕ"], ["ἠ", "ἧ"], ["ἰ", "ἷ"], ["ὀ", "ὅ"], ["ὐ", "ὗ"], ["ὠ", "ὧ"], ["ὰ", "ώ"], ["ᾀ", "ᾇ"], ["ᾐ", "ᾗ"], ["ᾠ", "ᾧ"], ["ᾰ", "ᾴ"], ["ᾶ", "ᾷ"], "ι", ["ῂ", "ῄ"], ["ῆ", "ῇ"], ["ῐ", "ΐ"], ["ῖ", "ῗ"], ["ῠ", "ῧ"], ["ῲ", "ῴ"], ["ῶ", "ῷ"], "ℊ", ["ℎ", "ℏ"], "ℓ", "ℯ", "ℴ", "ℹ", ["ℼ", "ℽ"], ["ⅆ", "ⅉ"], "ⅎ", "ↄ", ["ⰰ", "ⱞ"], "ⱡ", ["ⱥ", "ⱦ"], "ⱨ", "ⱪ", "ⱬ", "ⱱ", ["ⱳ", "ⱴ"], ["ⱶ", "ⱻ"], "ⲁ", "ⲃ", "ⲅ", "ⲇ", "ⲉ", "ⲋ", "ⲍ", "ⲏ", "ⲑ", "ⲓ", "ⲕ", "ⲗ", "ⲙ", "ⲛ", "ⲝ", "ⲟ", "ⲡ", "ⲣ", "ⲥ", "ⲧ", "ⲩ", "ⲫ", "ⲭ", "ⲯ", "ⲱ", "ⲳ", "ⲵ", "ⲷ", "ⲹ", "ⲻ", "ⲽ", "ⲿ", "ⳁ", "ⳃ", "ⳅ", "ⳇ", "ⳉ", "ⳋ", "ⳍ", "ⳏ", "ⳑ", "ⳓ", "ⳕ", "ⳗ", "ⳙ", "ⳛ", "ⳝ", "ⳟ", "ⳡ", ["ⳣ", "ⳤ"], "ⳬ", "ⳮ", "ⳳ", ["ⴀ", "ⴥ"], "ⴧ", "ⴭ", "ꙁ", "ꙃ", "ꙅ", "ꙇ", "ꙉ", "ꙋ", "ꙍ", "ꙏ", "ꙑ", "ꙓ", "ꙕ", "ꙗ", "ꙙ", "ꙛ", "ꙝ", "ꙟ", "ꙡ", "ꙣ", "ꙥ", "ꙧ", "ꙩ", "ꙫ", "ꙭ", "ꚁ", "ꚃ", "ꚅ", "ꚇ", "ꚉ", "ꚋ", "ꚍ", "ꚏ", "ꚑ", "ꚓ", "ꚕ", "ꚗ", "ꜣ", "ꜥ", "ꜧ", "ꜩ", "ꜫ", "ꜭ", ["ꜯ", "ꜱ"], "ꜳ", "ꜵ", "ꜷ", "ꜹ", "ꜻ", "ꜽ", "ꜿ", "ꝁ", "ꝃ", "ꝅ", "ꝇ", "ꝉ", "ꝋ", "ꝍ", "ꝏ", "ꝑ", "ꝓ", "ꝕ", "ꝗ", "ꝙ", "ꝛ", "ꝝ", "ꝟ", "ꝡ", "ꝣ", "ꝥ", "ꝧ", "ꝩ", "ꝫ", "ꝭ", "ꝯ", ["ꝱ", "ꝸ"], "ꝺ", "ꝼ", "ꝿ", "ꞁ", "ꞃ", "ꞅ", "ꞇ", "ꞌ", "ꞎ", "ꞑ", "ꞓ", "ꞡ", "ꞣ", "ꞥ", "ꞧ", "ꞩ", "ꟺ", ["ff", "st"], ["ﬓ", "ﬗ"], ["a", "z"]], false, false);
562
+ var peg$e55 = peg$classExpectation([["ʰ", "ˁ"], ["ˆ", "ˑ"], ["ˠ", "ˤ"], "ˬ", "ˮ", "ʹ", "ͺ", "ՙ", "ـ", ["ۥ", "ۦ"], ["ߴ", "ߵ"], "ߺ", "ࠚ", "ࠤ", "ࠨ", "ॱ", "ๆ", "ໆ", "ჼ", "ៗ", "ᡃ", "ᪧ", ["ᱸ", "ᱽ"], ["ᴬ", "ᵪ"], "ᵸ", ["ᶛ", "ᶿ"], "ⁱ", "ⁿ", ["ₐ", "ₜ"], ["ⱼ", "ⱽ"], "ⵯ", "ⸯ", "々", ["〱", "〵"], "〻", ["ゝ", "ゞ"], ["ー", "ヾ"], "ꀕ", ["ꓸ", "ꓽ"], "ꘌ", "ꙿ", ["ꜗ", "ꜟ"], "ꝰ", "ꞈ", ["ꟸ", "ꟹ"], "ꧏ", "ꩰ", "ꫝ", ["ꫳ", "ꫴ"], "ー", ["゙", "゚"]], false, false);
563
+ var peg$e56 = peg$classExpectation(["ª", "º", "ƻ", ["ǀ", "ǃ"], "ʔ", ["א", "ת"], ["װ", "ײ"], ["ؠ", "ؿ"], ["ف", "ي"], ["ٮ", "ٯ"], ["ٱ", "ۓ"], "ە", ["ۮ", "ۯ"], ["ۺ", "ۼ"], "ۿ", "ܐ", ["ܒ", "ܯ"], ["ݍ", "ޥ"], "ޱ", ["ߊ", "ߪ"], ["ࠀ", "ࠕ"], ["ࡀ", "ࡘ"], "ࢠ", ["ࢢ", "ࢬ"], ["ऄ", "ह"], "ऽ", "ॐ", ["क़", "ॡ"], ["ॲ", "ॷ"], ["ॹ", "ॿ"], ["অ", "ঌ"], ["এ", "ঐ"], ["ও", "ন"], ["প", "র"], "ল", ["শ", "হ"], "ঽ", "ৎ", ["ড়", "ঢ়"], ["য়", "ৡ"], ["ৰ", "ৱ"], ["ਅ", "ਊ"], ["ਏ", "ਐ"], ["ਓ", "ਨ"], ["ਪ", "ਰ"], ["ਲ", "ਲ਼"], ["ਵ", "ਸ਼"], ["ਸ", "ਹ"], ["ਖ਼", "ੜ"], "ਫ਼", ["ੲ", "ੴ"], ["અ", "ઍ"], ["એ", "ઑ"], ["ઓ", "ન"], ["પ", "ર"], ["લ", "ળ"], ["વ", "હ"], "ઽ", "ૐ", ["ૠ", "ૡ"], ["ଅ", "ଌ"], ["ଏ", "ଐ"], ["ଓ", "ନ"], ["ପ", "ର"], ["ଲ", "ଳ"], ["ଵ", "ହ"], "ଽ", ["ଡ଼", "ଢ଼"], ["ୟ", "ୡ"], "ୱ", "ஃ", ["அ", "ஊ"], ["எ", "ஐ"], ["ஒ", "க"], ["ங", "ச"], "ஜ", ["ஞ", "ட"], ["ண", "த"], ["ந", "ப"], ["ம", "ஹ"], "ௐ", ["అ", "ఌ"], ["ఎ", "ఐ"], ["ఒ", "న"], ["ప", "ళ"], ["వ", "హ"], "ఽ", ["ౘ", "ౙ"], ["ౠ", "ౡ"], ["ಅ", "ಌ"], ["ಎ", "ಐ"], ["ಒ", "ನ"], ["ಪ", "ಳ"], ["ವ", "ಹ"], "ಽ", "ೞ", ["ೠ", "ೡ"], ["ೱ", "ೲ"], ["അ", "ഌ"], ["എ", "ഐ"], ["ഒ", "ഺ"], "ഽ", "ൎ", ["ൠ", "ൡ"], ["ൺ", "ൿ"], ["අ", "ඖ"], ["ක", "න"], ["ඳ", "ර"], "ල", ["ව", "ෆ"], ["ก", "ะ"], ["า", "ำ"], ["เ", "ๅ"], ["ກ", "ຂ"], "ຄ", ["ງ", "ຈ"], "ຊ", "ຍ", ["ດ", "ທ"], ["ນ", "ຟ"], ["ມ", "ຣ"], "ລ", "ວ", ["ສ", "ຫ"], ["ອ", "ະ"], ["າ", "ຳ"], "ຽ", ["ເ", "ໄ"], ["ໜ", "ໟ"], "ༀ", ["ཀ", "ཇ"], ["ཉ", "ཬ"], ["ྈ", "ྌ"], ["က", "ဪ"], "ဿ", ["ၐ", "ၕ"], ["ၚ", "ၝ"], "ၡ", ["ၥ", "ၦ"], ["ၮ", "ၰ"], ["ၵ", "ႁ"], "ႎ", ["ა", "ჺ"], ["ჽ", "ቈ"], ["ቊ", "ቍ"], ["ቐ", "ቖ"], "ቘ", ["ቚ", "ቝ"], ["በ", "ኈ"], ["ኊ", "ኍ"], ["ነ", "ኰ"], ["ኲ", "ኵ"], ["ኸ", "ኾ"], "ዀ", ["ዂ", "ዅ"], ["ወ", "ዖ"], ["ዘ", "ጐ"], ["ጒ", "ጕ"], ["ጘ", "ፚ"], ["ᎀ", "ᎏ"], ["Ꭰ", "Ᏼ"], ["ᐁ", "ᙬ"], ["ᙯ", "ᙿ"], ["ᚁ", "ᚚ"], ["ᚠ", "ᛪ"], ["ᜀ", "ᜌ"], ["ᜎ", "ᜑ"], ["ᜠ", "ᜱ"], ["ᝀ", "ᝑ"], ["ᝠ", "ᝬ"], ["ᝮ", "ᝰ"], ["ក", "ឳ"], "ៜ", ["ᠠ", "ᡂ"], ["ᡄ", "ᡷ"], ["ᢀ", "ᢨ"], "ᢪ", ["ᢰ", "ᣵ"], ["ᤀ", "ᤜ"], ["ᥐ", "ᥭ"], ["ᥰ", "ᥴ"], ["ᦀ", "ᦫ"], ["ᧁ", "ᧇ"], ["ᨀ", "ᨖ"], ["ᨠ", "ᩔ"], ["ᬅ", "ᬳ"], ["ᭅ", "ᭋ"], ["ᮃ", "ᮠ"], ["ᮮ", "ᮯ"], ["ᮺ", "ᯥ"], ["ᰀ", "ᰣ"], ["ᱍ", "ᱏ"], ["ᱚ", "ᱷ"], ["ᳩ", "ᳬ"], ["ᳮ", "ᳱ"], ["ᳵ", "ᳶ"], ["ℵ", "ℸ"], ["ⴰ", "ⵧ"], ["ⶀ", "ⶖ"], ["ⶠ", "ⶦ"], ["ⶨ", "ⶮ"], ["ⶰ", "ⶶ"], ["ⶸ", "ⶾ"], ["ⷀ", "ⷆ"], ["ⷈ", "ⷎ"], ["ⷐ", "ⷖ"], ["ⷘ", "ⷞ"], "〆", "〼", ["ぁ", "ゖ"], "ゟ", ["ァ", "ヺ"], "ヿ", ["ㄅ", "ㄭ"], ["ㄱ", "ㆎ"], ["ㆠ", "ㆺ"], ["ㇰ", "ㇿ"], ["㐀", "䶵"], ["一", "鿌"], ["ꀀ", "ꀔ"], ["ꀖ", "ꒌ"], ["ꓐ", "ꓷ"], ["ꔀ", "ꘋ"], ["ꘐ", "ꘟ"], ["ꘪ", "ꘫ"], "ꙮ", ["ꚠ", "ꛥ"], ["ꟻ", "ꠁ"], ["ꠃ", "ꠅ"], ["ꠇ", "ꠊ"], ["ꠌ", "ꠢ"], ["ꡀ", "ꡳ"], ["ꢂ", "ꢳ"], ["ꣲ", "ꣷ"], "ꣻ", ["ꤊ", "ꤥ"], ["ꤰ", "ꥆ"], ["ꥠ", "ꥼ"], ["ꦄ", "ꦲ"], ["ꨀ", "ꨨ"], ["ꩀ", "ꩂ"], ["ꩄ", "ꩋ"], ["ꩠ", "ꩯ"], ["ꩱ", "ꩶ"], "ꩺ", ["ꪀ", "ꪯ"], "ꪱ", ["ꪵ", "ꪶ"], ["ꪹ", "ꪽ"], "ꫀ", "ꫂ", ["ꫛ", "ꫜ"], ["ꫠ", "ꫪ"], "ꫲ", ["ꬁ", "ꬆ"], ["ꬉ", "ꬎ"], ["ꬑ", "ꬖ"], ["ꬠ", "ꬦ"], ["ꬨ", "ꬮ"], ["ꯀ", "ꯢ"], ["가", "힣"], ["ힰ", "ퟆ"], ["ퟋ", "ퟻ"], ["豈", "舘"], ["並", "龎"], "יִ", ["ײַ", "ﬨ"], ["שׁ", "זּ"], ["טּ", "לּ"], "מּ", ["נּ", "סּ"], ["ףּ", "פּ"], ["צּ", "ﮱ"], ["ﯓ", "ﴽ"], ["ﵐ", "ﶏ"], ["ﶒ", "ﷇ"], ["ﷰ", "ﷻ"], ["ﹰ", "ﹴ"], ["ﹶ", "ﻼ"], ["ヲ", "ッ"], ["ア", "ン"], ["ᅠ", "ᄒ"], ["ᅡ", "ᅦ"], ["ᅧ", "ᅬ"], ["ᅭ", "ᅲ"], ["ᅳ", "ᅵ"]], false, false);
564
+ var peg$e57 = peg$classExpectation(["Dž", "Lj", "Nj", "Dz", ["ᾈ", "ᾏ"], ["ᾘ", "ᾟ"], ["ᾨ", "ᾯ"], "ᾼ", "ῌ", "ῼ"], false, false);
565
+ var peg$e58 = peg$classExpectation([["A", "Z"], ["À", "Ö"], ["Ø", "Þ"], "Ā", "Ă", "Ą", "Ć", "Ĉ", "Ċ", "Č", "Ď", "Đ", "Ē", "Ĕ", "Ė", "Ę", "Ě", "Ĝ", "Ğ", "Ġ", "Ģ", "Ĥ", "Ħ", "Ĩ", "Ī", "Ĭ", "Į", "İ", "IJ", "Ĵ", "Ķ", "Ĺ", "Ļ", "Ľ", "Ŀ", "Ł", "Ń", "Ņ", "Ň", "Ŋ", "Ō", "Ŏ", "Ő", "Œ", "Ŕ", "Ŗ", "Ř", "Ś", "Ŝ", "Ş", "Š", "Ţ", "Ť", "Ŧ", "Ũ", "Ū", "Ŭ", "Ů", "Ű", "Ų", "Ŵ", "Ŷ", ["Ÿ", "Ź"], "Ż", "Ž", ["Ɓ", "Ƃ"], "Ƅ", ["Ɔ", "Ƈ"], ["Ɖ", "Ƌ"], ["Ǝ", "Ƒ"], ["Ɠ", "Ɣ"], ["Ɩ", "Ƙ"], ["Ɯ", "Ɲ"], ["Ɵ", "Ơ"], "Ƣ", "Ƥ", ["Ʀ", "Ƨ"], "Ʃ", "Ƭ", ["Ʈ", "Ư"], ["Ʊ", "Ƴ"], "Ƶ", ["Ʒ", "Ƹ"], "Ƽ", "DŽ", "LJ", "NJ", "Ǎ", "Ǐ", "Ǒ", "Ǔ", "Ǖ", "Ǘ", "Ǚ", "Ǜ", "Ǟ", "Ǡ", "Ǣ", "Ǥ", "Ǧ", "Ǩ", "Ǫ", "Ǭ", "Ǯ", "DZ", "Ǵ", ["Ƕ", "Ǹ"], "Ǻ", "Ǽ", "Ǿ", "Ȁ", "Ȃ", "Ȅ", "Ȇ", "Ȉ", "Ȋ", "Ȍ", "Ȏ", "Ȑ", "Ȓ", "Ȕ", "Ȗ", "Ș", "Ț", "Ȝ", "Ȟ", "Ƞ", "Ȣ", "Ȥ", "Ȧ", "Ȩ", "Ȫ", "Ȭ", "Ȯ", "Ȱ", "Ȳ", ["Ⱥ", "Ȼ"], ["Ƚ", "Ⱦ"], "Ɂ", ["Ƀ", "Ɇ"], "Ɉ", "Ɋ", "Ɍ", "Ɏ", "Ͱ", "Ͳ", "Ͷ", "Ά", ["Έ", "Ί"], "Ό", ["Ύ", "Ώ"], ["Α", "Ρ"], ["Σ", "Ϋ"], "Ϗ", ["ϒ", "ϔ"], "Ϙ", "Ϛ", "Ϝ", "Ϟ", "Ϡ", "Ϣ", "Ϥ", "Ϧ", "Ϩ", "Ϫ", "Ϭ", "Ϯ", "ϴ", "Ϸ", ["Ϲ", "Ϻ"], ["Ͻ", "Я"], "Ѡ", "Ѣ", "Ѥ", "Ѧ", "Ѩ", "Ѫ", "Ѭ", "Ѯ", "Ѱ", "Ѳ", "Ѵ", "Ѷ", "Ѹ", "Ѻ", "Ѽ", "Ѿ", "Ҁ", "Ҋ", "Ҍ", "Ҏ", "Ґ", "Ғ", "Ҕ", "Җ", "Ҙ", "Қ", "Ҝ", "Ҟ", "Ҡ", "Ң", "Ҥ", "Ҧ", "Ҩ", "Ҫ", "Ҭ", "Ү", "Ұ", "Ҳ", "Ҵ", "Ҷ", "Ҹ", "Һ", "Ҽ", "Ҿ", ["Ӏ", "Ӂ"], "Ӄ", "Ӆ", "Ӈ", "Ӊ", "Ӌ", "Ӎ", "Ӑ", "Ӓ", "Ӕ", "Ӗ", "Ә", "Ӛ", "Ӝ", "Ӟ", "Ӡ", "Ӣ", "Ӥ", "Ӧ", "Ө", "Ӫ", "Ӭ", "Ӯ", "Ӱ", "Ӳ", "Ӵ", "Ӷ", "Ӹ", "Ӻ", "Ӽ", "Ӿ", "Ԁ", "Ԃ", "Ԅ", "Ԇ", "Ԉ", "Ԋ", "Ԍ", "Ԏ", "Ԑ", "Ԓ", "Ԕ", "Ԗ", "Ԙ", "Ԛ", "Ԝ", "Ԟ", "Ԡ", "Ԣ", "Ԥ", "Ԧ", ["Ա", "Ֆ"], ["Ⴀ", "Ⴥ"], "Ⴧ", "Ⴭ", "Ḁ", "Ḃ", "Ḅ", "Ḇ", "Ḉ", "Ḋ", "Ḍ", "Ḏ", "Ḑ", "Ḓ", "Ḕ", "Ḗ", "Ḙ", "Ḛ", "Ḝ", "Ḟ", "Ḡ", "Ḣ", "Ḥ", "Ḧ", "Ḩ", "Ḫ", "Ḭ", "Ḯ", "Ḱ", "Ḳ", "Ḵ", "Ḷ", "Ḹ", "Ḻ", "Ḽ", "Ḿ", "Ṁ", "Ṃ", "Ṅ", "Ṇ", "Ṉ", "Ṋ", "Ṍ", "Ṏ", "Ṑ", "Ṓ", "Ṕ", "Ṗ", "Ṙ", "Ṛ", "Ṝ", "Ṟ", "Ṡ", "Ṣ", "Ṥ", "Ṧ", "Ṩ", "Ṫ", "Ṭ", "Ṯ", "Ṱ", "Ṳ", "Ṵ", "Ṷ", "Ṹ", "Ṻ", "Ṽ", "Ṿ", "Ẁ", "Ẃ", "Ẅ", "Ẇ", "Ẉ", "Ẋ", "Ẍ", "Ẏ", "Ẑ", "Ẓ", "Ẕ", "ẞ", "Ạ", "Ả", "Ấ", "Ầ", "Ẩ", "Ẫ", "Ậ", "Ắ", "Ằ", "Ẳ", "Ẵ", "Ặ", "Ẹ", "Ẻ", "Ẽ", "Ế", "Ề", "Ể", "Ễ", "Ệ", "Ỉ", "Ị", "Ọ", "Ỏ", "Ố", "Ồ", "Ổ", "Ỗ", "Ộ", "Ớ", "Ờ", "Ở", "Ỡ", "Ợ", "Ụ", "Ủ", "Ứ", "Ừ", "Ử", "Ữ", "Ự", "Ỳ", "Ỵ", "Ỷ", "Ỹ", "Ỻ", "Ỽ", "Ỿ", ["Ἀ", "Ἇ"], ["Ἐ", "Ἕ"], ["Ἠ", "Ἧ"], ["Ἰ", "Ἷ"], ["Ὀ", "Ὅ"], "Ὑ", "Ὓ", "Ὕ", "Ὗ", ["Ὠ", "Ὧ"], ["Ᾰ", "Ά"], ["Ὲ", "Ή"], ["Ῐ", "Ί"], ["Ῠ", "Ῥ"], ["Ὸ", "Ώ"], "ℂ", "ℇ", ["ℋ", "ℍ"], ["ℐ", "ℒ"], "ℕ", ["ℙ", "ℝ"], "ℤ", "Ω", "ℨ", ["K", "ℭ"], ["ℰ", "ℳ"], ["ℾ", "ℿ"], "ⅅ", "Ↄ", ["Ⰰ", "Ⱞ"], "Ⱡ", ["Ɫ", "Ɽ"], "Ⱨ", "Ⱪ", "Ⱬ", ["Ɑ", "Ɒ"], "Ⱳ", "Ⱶ", ["Ȿ", "Ⲁ"], "Ⲃ", "Ⲅ", "Ⲇ", "Ⲉ", "Ⲋ", "Ⲍ", "Ⲏ", "Ⲑ", "Ⲓ", "Ⲕ", "Ⲗ", "Ⲙ", "Ⲛ", "Ⲝ", "Ⲟ", "Ⲡ", "Ⲣ", "Ⲥ", "Ⲧ", "Ⲩ", "Ⲫ", "Ⲭ", "Ⲯ", "Ⲱ", "Ⲳ", "Ⲵ", "Ⲷ", "Ⲹ", "Ⲻ", "Ⲽ", "Ⲿ", "Ⳁ", "Ⳃ", "Ⳅ", "Ⳇ", "Ⳉ", "Ⳋ", "Ⳍ", "Ⳏ", "Ⳑ", "Ⳓ", "Ⳕ", "Ⳗ", "Ⳙ", "Ⳛ", "Ⳝ", "Ⳟ", "Ⳡ", "Ⳣ", "Ⳬ", "Ⳮ", "Ⳳ", "Ꙁ", "Ꙃ", "Ꙅ", "Ꙇ", "Ꙉ", "Ꙋ", "Ꙍ", "Ꙏ", "Ꙑ", "Ꙓ", "Ꙕ", "Ꙗ", "Ꙙ", "Ꙛ", "Ꙝ", "Ꙟ", "Ꙡ", "Ꙣ", "Ꙥ", "Ꙧ", "Ꙩ", "Ꙫ", "Ꙭ", "Ꚁ", "Ꚃ", "Ꚅ", "Ꚇ", "Ꚉ", "Ꚋ", "Ꚍ", "Ꚏ", "Ꚑ", "Ꚓ", "Ꚕ", "Ꚗ", "Ꜣ", "Ꜥ", "Ꜧ", "Ꜩ", "Ꜫ", "Ꜭ", "Ꜯ", "Ꜳ", "Ꜵ", "Ꜷ", "Ꜹ", "Ꜻ", "Ꜽ", "Ꜿ", "Ꝁ", "Ꝃ", "Ꝅ", "Ꝇ", "Ꝉ", "Ꝋ", "Ꝍ", "Ꝏ", "Ꝑ", "Ꝓ", "Ꝕ", "Ꝗ", "Ꝙ", "Ꝛ", "Ꝝ", "Ꝟ", "Ꝡ", "Ꝣ", "Ꝥ", "Ꝧ", "Ꝩ", "Ꝫ", "Ꝭ", "Ꝯ", "Ꝺ", "Ꝼ", ["Ᵹ", "Ꝿ"], "Ꞁ", "Ꞃ", "Ꞅ", "Ꞇ", "Ꞌ", "Ɥ", "Ꞑ", "Ꞓ", "Ꞡ", "Ꞣ", "Ꞥ", "Ꞧ", "Ꞩ", "Ɦ", ["A", "Z"]], false, false);
566
+ var peg$e59 = peg$classExpectation([["ᛮ", "ᛰ"], ["Ⅰ", "ↂ"], ["ↅ", "ↈ"], "〇", ["〡", "〩"], ["〸", "〺"], ["ꛦ", "ꛯ"]], false, false);
567
+ var peg$e60 = peg$classExpectation([["0", "9"], ["٠", "٩"], ["۰", "۹"], ["߀", "߉"], ["०", "९"], ["০", "৯"], ["੦", "੯"], ["૦", "૯"], ["୦", "୯"], ["௦", "௯"], ["౦", "౯"], ["೦", "೯"], ["൦", "൯"], ["๐", "๙"], ["໐", "໙"], ["༠", "༩"], ["၀", "၉"], ["႐", "႙"], ["០", "៩"], ["᠐", "᠙"], ["᥆", "᥏"], ["᧐", "᧙"], ["᪀", "᪉"], ["᪐", "᪙"], ["᭐", "᭙"], ["᮰", "᮹"], ["᱀", "᱉"], ["᱐", "᱙"], ["꘠", "꘩"], ["꣐", "꣙"], ["꤀", "꤉"], ["꧐", "꧙"], ["꩐", "꩙"], ["꯰", "꯹"], ["0", "9"]], false, false);
568
+ var peg$f0 = function(v) {
569
+ return v;
570
+ };
571
+ var peg$f1 = function(v) {
572
+ return v;
573
+ };
574
+ var peg$f2 = function(v) {
575
+ return v;
576
+ };
577
+ var peg$f3 = function(v) {
578
+ return v;
579
+ };
580
+ var peg$f4 = function(v) {
581
+ return v;
582
+ };
583
+ var peg$f5 = function(v) {
584
+ return v;
585
+ };
586
+ var peg$f6 = function(v) {
587
+ return v;
588
+ };
589
+ var peg$f7 = function(v) {
590
+ return v;
591
+ };
592
+ var peg$f8 = function(v) {
593
+ return v;
594
+ };
595
+ var peg$f9 = function(v) {
596
+ return v;
597
+ };
598
+ var peg$f10 = function(c1, graph, c2) {
599
+ return b.createElement("Dot", {}, [...c1, graph, ...c2]);
600
+ };
601
+ var peg$f11 = function(_strict, _kind, id, children) {
602
+ const strict = !!_strict;
603
+ const kind = _kind.toLowerCase();
604
+ const directed = kind === "digraph";
605
+ for (const edgeop of edgeops) {
606
+ if (directed) {
607
+ if (edgeop.operator !== "->") {
608
+ error(`In digraph, it's necessary to describe with "->" operator to create edge.`, edgeop.location);
609
+ }
610
+ } else {
611
+ if (edgeop.operator !== "--") {
612
+ error(`In graph, it's necessary to describe with "--" operator to create edge.`, edgeop.location);
613
+ }
614
+ }
615
+ }
616
+ return b.createElement(
617
+ // @ts-ignore
618
+ "Graph",
619
+ // @ts-ignore
620
+ id !== null ? {
621
+ // @ts-ignore
622
+ id,
623
+ // @ts-ignore
624
+ directed,
625
+ // @ts-ignore
626
+ strict
627
+ } : {
628
+ // @ts-ignore
629
+ directed,
630
+ // @ts-ignore
631
+ strict
632
+ },
633
+ // @ts-ignore
634
+ children
635
+ );
636
+ };
637
+ var peg$f12 = function(keyValue) {
638
+ return b.createElement(
639
+ // @ts-ignore
640
+ "Attribute",
641
+ {
642
+ // @ts-ignore
643
+ ...keyValue
644
+ },
645
+ []
646
+ );
647
+ };
648
+ var peg$f13 = function(_kind, children) {
649
+ return b.createElement(
650
+ // @ts-ignore
651
+ "AttributeList",
652
+ {
653
+ // @ts-ignore
654
+ kind: `${_kind.slice(0, 1).toUpperCase()}${_kind.slice(1).toLowerCase()}`
655
+ },
656
+ // @ts-ignore
657
+ children
658
+ );
659
+ };
660
+ var peg$f14 = function(id, rhs, _children) {
661
+ return b.createElement(
662
+ // @ts-ignore
663
+ // @ts-ignore
664
+ "Edge",
665
+ {
666
+ // @ts-ignore
667
+ targets: [id, ...rhs]
668
+ },
669
+ // @ts-ignore
670
+ _children ?? []
671
+ );
672
+ };
673
+ var peg$f15 = function(id, _children) {
674
+ return b.createElement(
675
+ // @ts-ignore
676
+ "Node",
677
+ {
678
+ // @ts-ignore
679
+ id
680
+ },
681
+ // @ts-ignore
682
+ _children ?? []
683
+ );
684
+ };
685
+ var peg$f16 = function(key, value) {
686
+ return { key, value };
687
+ };
688
+ var peg$f17 = function(kv) {
689
+ return b.createElement(
690
+ // @ts-ignore
691
+ "Attribute",
692
+ {
693
+ // @ts-ignore
694
+ ...kv,
695
+ // @ts-ignore
696
+ location: location()
697
+ },
698
+ []
699
+ );
700
+ };
701
+ var peg$f18 = function(list) {
702
+ return list;
703
+ };
704
+ var peg$f19 = function(id, v) {
705
+ return v;
706
+ };
707
+ var peg$f20 = function(id, rest) {
708
+ return b.createElement("NodeRefGroup", {}, [id, ...rest]);
709
+ };
710
+ var peg$f21 = function(operator) {
711
+ return { operator, location: location() };
712
+ };
713
+ var peg$f22 = function(edgeop, id, rest) {
714
+ edgeops.push(edgeop);
715
+ return [id].concat(rest || []);
716
+ };
717
+ var peg$f23 = function(id, port) {
718
+ return b.createElement(
719
+ // @ts-ignore
720
+ "NodeRef",
721
+ {
722
+ // @ts-ignore
723
+ id,
724
+ // @ts-ignore
725
+ ...port
726
+ },
727
+ []
728
+ );
729
+ };
730
+ var peg$f24 = function(port, compass) {
731
+ return compass;
732
+ };
733
+ var peg$f25 = function(port, compass) {
734
+ if (["n", "ne", "e", "se", "s", "sw", "w", "nw"].includes(port)) {
735
+ return { compass: port };
736
+ } else if (compass) {
737
+ return { port, compass };
738
+ }
739
+ return { port };
740
+ };
741
+ var peg$f26 = function(id) {
742
+ return id;
743
+ };
744
+ var peg$f27 = function(id, _children) {
745
+ const children = _children ?? [];
746
+ return b.createElement("Subgraph", id ? { id } : {}, children);
747
+ };
748
+ var peg$f28 = function(value) {
749
+ return { value, quoted: false };
750
+ };
751
+ var peg$f29 = function(value) {
752
+ return { value, quoted: true };
753
+ };
754
+ var peg$f30 = function(v) {
755
+ return b.createElement(
756
+ // @ts-ignore
757
+ "Literal",
758
+ {
759
+ // @ts-ignore
760
+ ...v
761
+ },
762
+ []
763
+ );
764
+ };
765
+ var peg$f31 = function(value) {
766
+ return b.createElement(
767
+ // @ts-ignore
768
+ "Literal",
769
+ {
770
+ // @ts-ignore
771
+ value,
772
+ // @ts-ignore
773
+ quoted: false
774
+ },
775
+ []
776
+ );
777
+ };
778
+ var peg$f32 = function(v) {
779
+ return v;
780
+ };
781
+ var peg$f33 = function(v) {
782
+ return b.createElement(
783
+ // @ts-ignore
784
+ "Comment",
785
+ {
786
+ // @ts-ignore
787
+ kind: "Block",
788
+ // @ts-ignore
789
+ value: dedent(v.join("").replace(/[ \t]*\*/g, ""))
790
+ },
791
+ []
792
+ );
793
+ };
794
+ var peg$f34 = function(lines) {
795
+ return b.createElement(
796
+ // @ts-ignore
797
+ "Comment",
798
+ {
799
+ // @ts-ignore
800
+ kind: "Slash",
801
+ // @ts-ignore
802
+ value: dedent(lines.join("\n"))
803
+ },
804
+ []
805
+ );
806
+ };
807
+ var peg$f35 = function(v) {
808
+ return v;
809
+ };
810
+ var peg$f36 = function(v) {
811
+ return v.join("");
812
+ };
813
+ var peg$f37 = function(lines) {
814
+ return b.createElement(
815
+ // @ts-ignore
816
+ "Comment",
817
+ {
818
+ // @ts-ignore
819
+ kind: "Macro",
820
+ // @ts-ignore
821
+ value: dedent(lines.join("\n"))
822
+ },
823
+ []
824
+ );
825
+ };
826
+ var peg$f38 = function(v) {
827
+ return v;
828
+ };
829
+ var peg$f39 = function(v) {
830
+ return v.join("");
831
+ };
832
+ var peg$f40 = function(first, rest) {
833
+ return first + rest.join("");
834
+ };
835
+ var peg$f41 = function(first, rest) {
836
+ return first + rest;
837
+ };
838
+ var peg$f42 = function(n) {
839
+ return text();
840
+ };
841
+ var peg$f43 = function(v) {
842
+ return b.createElement(
843
+ // @ts-ignore
844
+ "Literal",
845
+ {
846
+ // @ts-ignore
847
+ value: v.slice(1, v.length - 1),
848
+ // @ts-ignore
849
+ quoted: "html"
850
+ },
851
+ []
852
+ );
853
+ };
854
+ var peg$f44 = function(v) {
855
+ return "<" + v.join("") + ">";
856
+ };
857
+ var peg$f45 = function(v) {
858
+ return v;
859
+ };
860
+ var peg$f46 = function(v) {
861
+ return v.join("");
862
+ };
863
+ var peg$f47 = function(chars) {
864
+ return b.createElement(
865
+ // @ts-ignore
866
+ "Literal",
867
+ {
868
+ // @ts-ignore
869
+ value: chars.join(""),
870
+ // @ts-ignore
871
+ quoted: true
872
+ },
873
+ []
874
+ );
875
+ };
876
+ var peg$f48 = function() {
877
+ return text();
878
+ };
879
+ var peg$f49 = function(v) {
880
+ return v[1] === '"' ? '"' : v[0] + v[1];
881
+ };
882
+ var peg$f50 = function() {
883
+ return "";
884
+ };
885
+ var peg$currPos = 0;
886
+ var peg$savedPos = 0;
887
+ var peg$posDetailsCache = [{ line: 1, column: 1 }];
888
+ var peg$maxFailPos = 0;
889
+ var peg$maxFailExpected = [];
890
+ var peg$silentFails = 0;
891
+ var peg$result;
892
+ if ("startRule" in options) {
893
+ if (!(options.startRule in peg$startRuleFunctions)) {
894
+ throw new Error(`Can't start parsing from rule "` + options.startRule + '".');
895
+ }
896
+ peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
897
+ }
898
+ function text() {
899
+ return input.substring(peg$savedPos, peg$currPos);
900
+ }
901
+ function location() {
902
+ return peg$computeLocation(peg$savedPos, peg$currPos);
903
+ }
904
+ function error(message, location2) {
905
+ location2 = location2 !== void 0 ? location2 : peg$computeLocation(peg$savedPos, peg$currPos);
906
+ throw peg$buildSimpleError(message, location2);
907
+ }
908
+ function peg$literalExpectation(text2, ignoreCase) {
909
+ return { type: "literal", text: text2, ignoreCase };
910
+ }
911
+ function peg$classExpectation(parts, inverted, ignoreCase) {
912
+ return { type: "class", parts, inverted, ignoreCase };
913
+ }
914
+ function peg$anyExpectation() {
915
+ return { type: "any" };
916
+ }
917
+ function peg$endExpectation() {
918
+ return { type: "end" };
919
+ }
920
+ function peg$otherExpectation(description) {
921
+ return { type: "other", description };
922
+ }
923
+ function peg$computePosDetails(pos) {
924
+ var details = peg$posDetailsCache[pos];
925
+ var p;
926
+ if (details) {
927
+ return details;
928
+ } else {
929
+ p = pos - 1;
930
+ while (!peg$posDetailsCache[p]) {
931
+ p--;
932
+ }
933
+ details = peg$posDetailsCache[p];
934
+ details = {
935
+ // @ts-ignore
936
+ line: details.line,
937
+ // @ts-ignore
938
+ column: details.column
939
+ };
940
+ while (p < pos) {
941
+ if (input.charCodeAt(p) === 10) {
942
+ details.line++;
943
+ details.column = 1;
944
+ } else {
945
+ details.column++;
946
+ }
947
+ p++;
948
+ }
949
+ peg$posDetailsCache[pos] = details;
950
+ return details;
951
+ }
952
+ }
953
+ function peg$computeLocation(startPos, endPos, offset2) {
954
+ var startPosDetails = peg$computePosDetails(startPos);
955
+ var endPosDetails = peg$computePosDetails(endPos);
956
+ var res = {
957
+ // @ts-ignore
958
+ source: peg$source,
959
+ // @ts-ignore
960
+ start: {
961
+ // @ts-ignore
962
+ offset: startPos,
963
+ // @ts-ignore
964
+ line: startPosDetails.line,
965
+ // @ts-ignore
966
+ column: startPosDetails.column
967
+ },
968
+ // @ts-ignore
969
+ end: {
970
+ // @ts-ignore
971
+ offset: endPos,
972
+ // @ts-ignore
973
+ line: endPosDetails.line,
974
+ // @ts-ignore
975
+ column: endPosDetails.column
976
+ }
977
+ };
978
+ if (offset2 && peg$source && typeof peg$source.offset === "function") {
979
+ res.start = peg$source.offset(res.start);
980
+ res.end = peg$source.offset(res.end);
981
+ }
982
+ return res;
983
+ }
984
+ function peg$fail(expected2) {
985
+ if (peg$currPos < peg$maxFailPos) {
986
+ return;
987
+ }
988
+ if (peg$currPos > peg$maxFailPos) {
989
+ peg$maxFailPos = peg$currPos;
990
+ peg$maxFailExpected = [];
991
+ }
992
+ peg$maxFailExpected.push(expected2);
993
+ }
994
+ function peg$buildSimpleError(message, location2) {
995
+ return new peg$SyntaxError(message, null, null, location2);
996
+ }
997
+ function peg$buildStructuredError(expected2, found, location2) {
998
+ return new peg$SyntaxError(
999
+ // @ts-ignore
1000
+ peg$SyntaxError.buildMessage(expected2, found),
1001
+ // @ts-ignore
1002
+ expected2,
1003
+ // @ts-ignore
1004
+ found,
1005
+ // @ts-ignore
1006
+ location2
1007
+ );
1008
+ }
1009
+ function peg$parseDot() {
1010
+ var s0, s2;
1011
+ s0 = peg$currPos;
1012
+ peg$parse__();
1013
+ s2 = peg$parse_dot();
1014
+ if (s2 !== peg$FAILED) {
1015
+ peg$parse__();
1016
+ peg$savedPos = s0;
1017
+ s0 = peg$f0(s2);
1018
+ } else {
1019
+ peg$currPos = s0;
1020
+ s0 = peg$FAILED;
1021
+ }
1022
+ return s0;
1023
+ }
1024
+ function peg$parseGraph() {
1025
+ var s0, s2;
1026
+ s0 = peg$currPos;
1027
+ peg$parse__();
1028
+ s2 = peg$parse_graph();
1029
+ if (s2 !== peg$FAILED) {
1030
+ peg$parse__();
1031
+ peg$savedPos = s0;
1032
+ s0 = peg$f1(s2);
1033
+ } else {
1034
+ peg$currPos = s0;
1035
+ s0 = peg$FAILED;
1036
+ }
1037
+ return s0;
1038
+ }
1039
+ function peg$parseNode() {
1040
+ var s0, s2;
1041
+ s0 = peg$currPos;
1042
+ peg$parse__();
1043
+ s2 = peg$parse_node();
1044
+ if (s2 !== peg$FAILED) {
1045
+ peg$parse__();
1046
+ peg$savedPos = s0;
1047
+ s0 = peg$f2(s2);
1048
+ } else {
1049
+ peg$currPos = s0;
1050
+ s0 = peg$FAILED;
1051
+ }
1052
+ return s0;
1053
+ }
1054
+ function peg$parseAttributeList() {
1055
+ var s0, s2;
1056
+ s0 = peg$currPos;
1057
+ peg$parse__();
1058
+ s2 = peg$parse_attributes();
1059
+ if (s2 !== peg$FAILED) {
1060
+ peg$parse__();
1061
+ peg$savedPos = s0;
1062
+ s0 = peg$f3(s2);
1063
+ } else {
1064
+ peg$currPos = s0;
1065
+ s0 = peg$FAILED;
1066
+ }
1067
+ return s0;
1068
+ }
1069
+ function peg$parseAttribute() {
1070
+ var s0, s2;
1071
+ s0 = peg$currPos;
1072
+ peg$parse__();
1073
+ s2 = peg$parse_attribute();
1074
+ if (s2 !== peg$FAILED) {
1075
+ peg$parse__();
1076
+ peg$savedPos = s0;
1077
+ s0 = peg$f4(s2);
1078
+ } else {
1079
+ peg$currPos = s0;
1080
+ s0 = peg$FAILED;
1081
+ }
1082
+ return s0;
1083
+ }
1084
+ function peg$parseEdge() {
1085
+ var s0, s2;
1086
+ s0 = peg$currPos;
1087
+ peg$parse__();
1088
+ s2 = peg$parse_edge();
1089
+ if (s2 !== peg$FAILED) {
1090
+ peg$parse__();
1091
+ peg$savedPos = s0;
1092
+ s0 = peg$f5(s2);
1093
+ } else {
1094
+ peg$currPos = s0;
1095
+ s0 = peg$FAILED;
1096
+ }
1097
+ return s0;
1098
+ }
1099
+ function peg$parseSubgraph() {
1100
+ var s0, s2;
1101
+ s0 = peg$currPos;
1102
+ peg$parse__();
1103
+ s2 = peg$parse_subgraph();
1104
+ if (s2 !== peg$FAILED) {
1105
+ peg$parse__();
1106
+ peg$savedPos = s0;
1107
+ s0 = peg$f6(s2);
1108
+ } else {
1109
+ peg$currPos = s0;
1110
+ s0 = peg$FAILED;
1111
+ }
1112
+ return s0;
1113
+ }
1114
+ function peg$parseNodeRef() {
1115
+ var s0, s2;
1116
+ s0 = peg$currPos;
1117
+ peg$parse__();
1118
+ s2 = peg$parse_node_ref();
1119
+ if (s2 !== peg$FAILED) {
1120
+ peg$parse__();
1121
+ peg$savedPos = s0;
1122
+ s0 = peg$f7(s2);
1123
+ } else {
1124
+ peg$currPos = s0;
1125
+ s0 = peg$FAILED;
1126
+ }
1127
+ return s0;
1128
+ }
1129
+ function peg$parseAttibutesItem() {
1130
+ var s0, s2;
1131
+ s0 = peg$currPos;
1132
+ peg$parse__();
1133
+ s2 = peg$parse_attibutes_item();
1134
+ if (s2 !== peg$FAILED) {
1135
+ peg$parse__();
1136
+ peg$savedPos = s0;
1137
+ s0 = peg$f8(s2);
1138
+ } else {
1139
+ peg$currPos = s0;
1140
+ s0 = peg$FAILED;
1141
+ }
1142
+ return s0;
1143
+ }
1144
+ function peg$parseComment() {
1145
+ var s0, s2;
1146
+ s0 = peg$currPos;
1147
+ peg$parse__();
1148
+ s2 = peg$parse_comment();
1149
+ if (s2 !== peg$FAILED) {
1150
+ peg$parse__();
1151
+ peg$savedPos = s0;
1152
+ s0 = peg$f9(s2);
1153
+ } else {
1154
+ peg$currPos = s0;
1155
+ s0 = peg$FAILED;
1156
+ }
1157
+ return s0;
1158
+ }
1159
+ function peg$parseClusterStatements() {
1160
+ var s0, s1;
1161
+ s0 = [];
1162
+ s1 = peg$parseAttribute();
1163
+ if (s1 === peg$FAILED) {
1164
+ s1 = peg$parseAttributeList();
1165
+ if (s1 === peg$FAILED) {
1166
+ s1 = peg$parseEdge();
1167
+ if (s1 === peg$FAILED) {
1168
+ s1 = peg$parseSubgraph();
1169
+ if (s1 === peg$FAILED) {
1170
+ s1 = peg$parseNode();
1171
+ if (s1 === peg$FAILED) {
1172
+ s1 = peg$parseComment();
1173
+ }
1174
+ }
1175
+ }
1176
+ }
1177
+ }
1178
+ while (s1 !== peg$FAILED) {
1179
+ s0.push(s1);
1180
+ s1 = peg$parseAttribute();
1181
+ if (s1 === peg$FAILED) {
1182
+ s1 = peg$parseAttributeList();
1183
+ if (s1 === peg$FAILED) {
1184
+ s1 = peg$parseEdge();
1185
+ if (s1 === peg$FAILED) {
1186
+ s1 = peg$parseSubgraph();
1187
+ if (s1 === peg$FAILED) {
1188
+ s1 = peg$parseNode();
1189
+ if (s1 === peg$FAILED) {
1190
+ s1 = peg$parseComment();
1191
+ }
1192
+ }
1193
+ }
1194
+ }
1195
+ }
1196
+ }
1197
+ return s0;
1198
+ }
1199
+ function peg$parse_dot() {
1200
+ var s0, s1, s2, s3, s4;
1201
+ s0 = peg$currPos;
1202
+ s1 = [];
1203
+ s2 = peg$parseComment();
1204
+ while (s2 !== peg$FAILED) {
1205
+ s1.push(s2);
1206
+ s2 = peg$parseComment();
1207
+ }
1208
+ s2 = peg$parseGraph();
1209
+ if (s2 !== peg$FAILED) {
1210
+ s3 = [];
1211
+ s4 = peg$parseComment();
1212
+ while (s4 !== peg$FAILED) {
1213
+ s3.push(s4);
1214
+ s4 = peg$parseComment();
1215
+ }
1216
+ peg$savedPos = s0;
1217
+ s0 = peg$f10(s1, s2, s3);
1218
+ } else {
1219
+ peg$currPos = s0;
1220
+ s0 = peg$FAILED;
1221
+ }
1222
+ return s0;
1223
+ }
1224
+ function peg$parse_graph() {
1225
+ var s0, s1, s3, s5, s7, s8, s10;
1226
+ s0 = peg$currPos;
1227
+ if (input.substr(peg$currPos, 6).toLowerCase() === peg$c0) {
1228
+ s1 = input.substr(peg$currPos, 6);
1229
+ peg$currPos += 6;
1230
+ } else {
1231
+ s1 = peg$FAILED;
1232
+ if (peg$silentFails === 0) {
1233
+ peg$fail(peg$e0);
1234
+ }
1235
+ }
1236
+ if (s1 === peg$FAILED) {
1237
+ s1 = null;
1238
+ }
1239
+ peg$parse_();
1240
+ if (input.substr(peg$currPos, 5).toLowerCase() === peg$c1) {
1241
+ s3 = input.substr(peg$currPos, 5);
1242
+ peg$currPos += 5;
1243
+ } else {
1244
+ s3 = peg$FAILED;
1245
+ if (peg$silentFails === 0) {
1246
+ peg$fail(peg$e1);
1247
+ }
1248
+ }
1249
+ if (s3 === peg$FAILED) {
1250
+ if (input.substr(peg$currPos, 7).toLowerCase() === peg$c2) {
1251
+ s3 = input.substr(peg$currPos, 7);
1252
+ peg$currPos += 7;
1253
+ } else {
1254
+ s3 = peg$FAILED;
1255
+ if (peg$silentFails === 0) {
1256
+ peg$fail(peg$e2);
1257
+ }
1258
+ }
1259
+ }
1260
+ if (s3 !== peg$FAILED) {
1261
+ peg$parse_();
1262
+ s5 = peg$parse_literal();
1263
+ if (s5 === peg$FAILED) {
1264
+ s5 = null;
1265
+ }
1266
+ peg$parse__();
1267
+ if (input.charCodeAt(peg$currPos) === 123) {
1268
+ s7 = peg$c3;
1269
+ peg$currPos++;
1270
+ } else {
1271
+ s7 = peg$FAILED;
1272
+ if (peg$silentFails === 0) {
1273
+ peg$fail(peg$e3);
1274
+ }
1275
+ }
1276
+ if (s7 !== peg$FAILED) {
1277
+ s8 = peg$parseClusterStatements();
1278
+ peg$parse__();
1279
+ if (input.charCodeAt(peg$currPos) === 125) {
1280
+ s10 = peg$c4;
1281
+ peg$currPos++;
1282
+ } else {
1283
+ s10 = peg$FAILED;
1284
+ if (peg$silentFails === 0) {
1285
+ peg$fail(peg$e4);
1286
+ }
1287
+ }
1288
+ if (s10 !== peg$FAILED) {
1289
+ peg$savedPos = s0;
1290
+ s0 = peg$f11(s1, s3, s5, s8);
1291
+ } else {
1292
+ peg$currPos = s0;
1293
+ s0 = peg$FAILED;
1294
+ }
1295
+ } else {
1296
+ peg$currPos = s0;
1297
+ s0 = peg$FAILED;
1298
+ }
1299
+ } else {
1300
+ peg$currPos = s0;
1301
+ s0 = peg$FAILED;
1302
+ }
1303
+ return s0;
1304
+ }
1305
+ function peg$parse_attribute() {
1306
+ var s0, s1;
1307
+ s0 = peg$currPos;
1308
+ s1 = peg$parse_key_value();
1309
+ if (s1 !== peg$FAILED) {
1310
+ peg$parse_();
1311
+ if (input.charCodeAt(peg$currPos) === 59) {
1312
+ peg$currPos++;
1313
+ } else {
1314
+ if (peg$silentFails === 0) {
1315
+ peg$fail(peg$e5);
1316
+ }
1317
+ }
1318
+ peg$savedPos = s0;
1319
+ s0 = peg$f12(s1);
1320
+ } else {
1321
+ peg$currPos = s0;
1322
+ s0 = peg$FAILED;
1323
+ }
1324
+ return s0;
1325
+ }
1326
+ function peg$parse_attributes() {
1327
+ var s0, s1, s2;
1328
+ s0 = peg$currPos;
1329
+ if (input.substr(peg$currPos, 5).toLowerCase() === peg$c1) {
1330
+ s1 = input.substr(peg$currPos, 5);
1331
+ peg$currPos += 5;
1332
+ } else {
1333
+ s1 = peg$FAILED;
1334
+ if (peg$silentFails === 0) {
1335
+ peg$fail(peg$e1);
1336
+ }
1337
+ }
1338
+ if (s1 === peg$FAILED) {
1339
+ if (input.substr(peg$currPos, 4).toLowerCase() === peg$c6) {
1340
+ s1 = input.substr(peg$currPos, 4);
1341
+ peg$currPos += 4;
1342
+ } else {
1343
+ s1 = peg$FAILED;
1344
+ if (peg$silentFails === 0) {
1345
+ peg$fail(peg$e6);
1346
+ }
1347
+ }
1348
+ if (s1 === peg$FAILED) {
1349
+ if (input.substr(peg$currPos, 4).toLowerCase() === peg$c7) {
1350
+ s1 = input.substr(peg$currPos, 4);
1351
+ peg$currPos += 4;
1352
+ } else {
1353
+ s1 = peg$FAILED;
1354
+ if (peg$silentFails === 0) {
1355
+ peg$fail(peg$e7);
1356
+ }
1357
+ }
1358
+ }
1359
+ }
1360
+ if (s1 !== peg$FAILED) {
1361
+ s2 = peg$parse_attribute_list();
1362
+ if (s2 !== peg$FAILED) {
1363
+ peg$parse_();
1364
+ if (input.charCodeAt(peg$currPos) === 59) {
1365
+ peg$currPos++;
1366
+ } else {
1367
+ if (peg$silentFails === 0) {
1368
+ peg$fail(peg$e5);
1369
+ }
1370
+ }
1371
+ peg$savedPos = s0;
1372
+ s0 = peg$f13(s1, s2);
1373
+ } else {
1374
+ peg$currPos = s0;
1375
+ s0 = peg$FAILED;
1376
+ }
1377
+ } else {
1378
+ peg$currPos = s0;
1379
+ s0 = peg$FAILED;
1380
+ }
1381
+ return s0;
1382
+ }
1383
+ function peg$parse_edge() {
1384
+ var s0, s1, s2, s3;
1385
+ s0 = peg$currPos;
1386
+ s1 = peg$parse_edge_target();
1387
+ if (s1 !== peg$FAILED) {
1388
+ s2 = peg$parse_edge_rhs();
1389
+ if (s2 !== peg$FAILED) {
1390
+ s3 = peg$parse_attribute_list();
1391
+ if (s3 === peg$FAILED) {
1392
+ s3 = null;
1393
+ }
1394
+ peg$parse_();
1395
+ if (input.charCodeAt(peg$currPos) === 59) {
1396
+ peg$currPos++;
1397
+ } else {
1398
+ if (peg$silentFails === 0) {
1399
+ peg$fail(peg$e5);
1400
+ }
1401
+ }
1402
+ peg$savedPos = s0;
1403
+ s0 = peg$f14(s1, s2, s3);
1404
+ } else {
1405
+ peg$currPos = s0;
1406
+ s0 = peg$FAILED;
1407
+ }
1408
+ } else {
1409
+ peg$currPos = s0;
1410
+ s0 = peg$FAILED;
1411
+ }
1412
+ return s0;
1413
+ }
1414
+ function peg$parse_node() {
1415
+ var s0, s1, s3;
1416
+ s0 = peg$currPos;
1417
+ s1 = peg$parse_literal();
1418
+ if (s1 !== peg$FAILED) {
1419
+ peg$parse_();
1420
+ s3 = peg$parse_attribute_list();
1421
+ if (s3 === peg$FAILED) {
1422
+ s3 = null;
1423
+ }
1424
+ peg$parse_();
1425
+ if (input.charCodeAt(peg$currPos) === 59) {
1426
+ peg$currPos++;
1427
+ } else {
1428
+ if (peg$silentFails === 0) {
1429
+ peg$fail(peg$e5);
1430
+ }
1431
+ }
1432
+ peg$savedPos = s0;
1433
+ s0 = peg$f15(s1, s3);
1434
+ } else {
1435
+ peg$currPos = s0;
1436
+ s0 = peg$FAILED;
1437
+ }
1438
+ return s0;
1439
+ }
1440
+ function peg$parse_key_value() {
1441
+ var s0, s1, s3, s5;
1442
+ s0 = peg$currPos;
1443
+ s1 = peg$parse_literal();
1444
+ if (s1 !== peg$FAILED) {
1445
+ peg$parse_();
1446
+ if (input.charCodeAt(peg$currPos) === 61) {
1447
+ s3 = peg$c8;
1448
+ peg$currPos++;
1449
+ } else {
1450
+ s3 = peg$FAILED;
1451
+ if (peg$silentFails === 0) {
1452
+ peg$fail(peg$e8);
1453
+ }
1454
+ }
1455
+ if (s3 !== peg$FAILED) {
1456
+ peg$parse_();
1457
+ s5 = peg$parse_literal();
1458
+ if (s5 !== peg$FAILED) {
1459
+ peg$savedPos = s0;
1460
+ s0 = peg$f16(s1, s5);
1461
+ } else {
1462
+ peg$currPos = s0;
1463
+ s0 = peg$FAILED;
1464
+ }
1465
+ } else {
1466
+ peg$currPos = s0;
1467
+ s0 = peg$FAILED;
1468
+ }
1469
+ } else {
1470
+ peg$currPos = s0;
1471
+ s0 = peg$FAILED;
1472
+ }
1473
+ return s0;
1474
+ }
1475
+ function peg$parse_attibutes_item() {
1476
+ var s0, s1, s3;
1477
+ s0 = peg$currPos;
1478
+ s1 = peg$parse_key_value();
1479
+ if (s1 !== peg$FAILED) {
1480
+ peg$parse_();
1481
+ if (input.charCodeAt(peg$currPos) === 44) {
1482
+ s3 = peg$c9;
1483
+ peg$currPos++;
1484
+ } else {
1485
+ s3 = peg$FAILED;
1486
+ if (peg$silentFails === 0) {
1487
+ peg$fail(peg$e9);
1488
+ }
1489
+ }
1490
+ if (s3 === peg$FAILED) {
1491
+ if (input.charCodeAt(peg$currPos) === 59) {
1492
+ s3 = peg$c5;
1493
+ peg$currPos++;
1494
+ } else {
1495
+ s3 = peg$FAILED;
1496
+ if (peg$silentFails === 0) {
1497
+ peg$fail(peg$e5);
1498
+ }
1499
+ }
1500
+ }
1501
+ if (s3 === peg$FAILED) {
1502
+ s3 = null;
1503
+ }
1504
+ peg$savedPos = s0;
1505
+ s0 = peg$f17(s1);
1506
+ } else {
1507
+ peg$currPos = s0;
1508
+ s0 = peg$FAILED;
1509
+ }
1510
+ return s0;
1511
+ }
1512
+ function peg$parse_attribute_list() {
1513
+ var s0, s2, s3, s4, s5;
1514
+ s0 = peg$currPos;
1515
+ peg$parse_();
1516
+ if (input.charCodeAt(peg$currPos) === 91) {
1517
+ s2 = peg$c10;
1518
+ peg$currPos++;
1519
+ } else {
1520
+ s2 = peg$FAILED;
1521
+ if (peg$silentFails === 0) {
1522
+ peg$fail(peg$e10);
1523
+ }
1524
+ }
1525
+ if (s2 !== peg$FAILED) {
1526
+ s3 = [];
1527
+ s4 = peg$parseAttibutesItem();
1528
+ if (s4 === peg$FAILED) {
1529
+ s4 = peg$parseComment();
1530
+ }
1531
+ while (s4 !== peg$FAILED) {
1532
+ s3.push(s4);
1533
+ s4 = peg$parseAttibutesItem();
1534
+ if (s4 === peg$FAILED) {
1535
+ s4 = peg$parseComment();
1536
+ }
1537
+ }
1538
+ s4 = peg$parse__();
1539
+ if (input.charCodeAt(peg$currPos) === 93) {
1540
+ s5 = peg$c11;
1541
+ peg$currPos++;
1542
+ } else {
1543
+ s5 = peg$FAILED;
1544
+ if (peg$silentFails === 0) {
1545
+ peg$fail(peg$e11);
1546
+ }
1547
+ }
1548
+ if (s5 !== peg$FAILED) {
1549
+ peg$savedPos = s0;
1550
+ s0 = peg$f18(s3);
1551
+ } else {
1552
+ peg$currPos = s0;
1553
+ s0 = peg$FAILED;
1554
+ }
1555
+ } else {
1556
+ peg$currPos = s0;
1557
+ s0 = peg$FAILED;
1558
+ }
1559
+ return s0;
1560
+ }
1561
+ function peg$parse_edge_target_group() {
1562
+ var s0, s1, s2, s3, s4, s5, s6;
1563
+ s0 = peg$currPos;
1564
+ if (input.charCodeAt(peg$currPos) === 123) {
1565
+ s1 = peg$c3;
1566
+ peg$currPos++;
1567
+ } else {
1568
+ s1 = peg$FAILED;
1569
+ if (peg$silentFails === 0) {
1570
+ peg$fail(peg$e3);
1571
+ }
1572
+ }
1573
+ if (s1 !== peg$FAILED) {
1574
+ s2 = peg$parseNodeRef();
1575
+ if (s2 !== peg$FAILED) {
1576
+ s3 = [];
1577
+ s4 = peg$currPos;
1578
+ if (input.charCodeAt(peg$currPos) === 44) {
1579
+ s5 = peg$c9;
1580
+ peg$currPos++;
1581
+ } else {
1582
+ s5 = peg$FAILED;
1583
+ if (peg$silentFails === 0) {
1584
+ peg$fail(peg$e9);
1585
+ }
1586
+ }
1587
+ if (s5 === peg$FAILED) {
1588
+ if (input.charCodeAt(peg$currPos) === 59) {
1589
+ s5 = peg$c5;
1590
+ peg$currPos++;
1591
+ } else {
1592
+ s5 = peg$FAILED;
1593
+ if (peg$silentFails === 0) {
1594
+ peg$fail(peg$e5);
1595
+ }
1596
+ }
1597
+ }
1598
+ if (s5 === peg$FAILED) {
1599
+ s5 = null;
1600
+ }
1601
+ s6 = peg$parseNodeRef();
1602
+ if (s6 !== peg$FAILED) {
1603
+ peg$savedPos = s4;
1604
+ s4 = peg$f19(s2, s6);
1605
+ } else {
1606
+ peg$currPos = s4;
1607
+ s4 = peg$FAILED;
1608
+ }
1609
+ while (s4 !== peg$FAILED) {
1610
+ s3.push(s4);
1611
+ s4 = peg$currPos;
1612
+ if (input.charCodeAt(peg$currPos) === 44) {
1613
+ s5 = peg$c9;
1614
+ peg$currPos++;
1615
+ } else {
1616
+ s5 = peg$FAILED;
1617
+ if (peg$silentFails === 0) {
1618
+ peg$fail(peg$e9);
1619
+ }
1620
+ }
1621
+ if (s5 === peg$FAILED) {
1622
+ if (input.charCodeAt(peg$currPos) === 59) {
1623
+ s5 = peg$c5;
1624
+ peg$currPos++;
1625
+ } else {
1626
+ s5 = peg$FAILED;
1627
+ if (peg$silentFails === 0) {
1628
+ peg$fail(peg$e5);
1629
+ }
1630
+ }
1631
+ }
1632
+ if (s5 === peg$FAILED) {
1633
+ s5 = null;
1634
+ }
1635
+ s6 = peg$parseNodeRef();
1636
+ if (s6 !== peg$FAILED) {
1637
+ peg$savedPos = s4;
1638
+ s4 = peg$f19(s2, s6);
1639
+ } else {
1640
+ peg$currPos = s4;
1641
+ s4 = peg$FAILED;
1642
+ }
1643
+ }
1644
+ if (input.charCodeAt(peg$currPos) === 44) {
1645
+ s4 = peg$c9;
1646
+ peg$currPos++;
1647
+ } else {
1648
+ s4 = peg$FAILED;
1649
+ if (peg$silentFails === 0) {
1650
+ peg$fail(peg$e9);
1651
+ }
1652
+ }
1653
+ if (s4 === peg$FAILED) {
1654
+ if (input.charCodeAt(peg$currPos) === 59) {
1655
+ s4 = peg$c5;
1656
+ peg$currPos++;
1657
+ } else {
1658
+ s4 = peg$FAILED;
1659
+ if (peg$silentFails === 0) {
1660
+ peg$fail(peg$e5);
1661
+ }
1662
+ }
1663
+ }
1664
+ if (s4 === peg$FAILED) {
1665
+ s4 = null;
1666
+ }
1667
+ s5 = peg$parse__();
1668
+ if (input.charCodeAt(peg$currPos) === 125) {
1669
+ s6 = peg$c4;
1670
+ peg$currPos++;
1671
+ } else {
1672
+ s6 = peg$FAILED;
1673
+ if (peg$silentFails === 0) {
1674
+ peg$fail(peg$e4);
1675
+ }
1676
+ }
1677
+ if (s6 !== peg$FAILED) {
1678
+ peg$savedPos = s0;
1679
+ s0 = peg$f20(s2, s3);
1680
+ } else {
1681
+ peg$currPos = s0;
1682
+ s0 = peg$FAILED;
1683
+ }
1684
+ } else {
1685
+ peg$currPos = s0;
1686
+ s0 = peg$FAILED;
1687
+ }
1688
+ } else {
1689
+ peg$currPos = s0;
1690
+ s0 = peg$FAILED;
1691
+ }
1692
+ return s0;
1693
+ }
1694
+ function peg$parse_edge_target() {
1695
+ var s0;
1696
+ s0 = peg$parse_edge_target_group();
1697
+ if (s0 === peg$FAILED) {
1698
+ s0 = peg$parseNodeRef();
1699
+ }
1700
+ return s0;
1701
+ }
1702
+ function peg$parse_edge_operator() {
1703
+ var s0, s1;
1704
+ s0 = peg$currPos;
1705
+ if (input.substr(peg$currPos, 2) === peg$c12) {
1706
+ s1 = peg$c12;
1707
+ peg$currPos += 2;
1708
+ } else {
1709
+ s1 = peg$FAILED;
1710
+ if (peg$silentFails === 0) {
1711
+ peg$fail(peg$e12);
1712
+ }
1713
+ }
1714
+ if (s1 === peg$FAILED) {
1715
+ if (input.substr(peg$currPos, 2) === peg$c13) {
1716
+ s1 = peg$c13;
1717
+ peg$currPos += 2;
1718
+ } else {
1719
+ s1 = peg$FAILED;
1720
+ if (peg$silentFails === 0) {
1721
+ peg$fail(peg$e13);
1722
+ }
1723
+ }
1724
+ }
1725
+ if (s1 !== peg$FAILED) {
1726
+ peg$savedPos = s0;
1727
+ s1 = peg$f21(s1);
1728
+ }
1729
+ s0 = s1;
1730
+ return s0;
1731
+ }
1732
+ function peg$parse_edge_rhs() {
1733
+ var s0, s2, s4, s6;
1734
+ s0 = peg$currPos;
1735
+ peg$parse_();
1736
+ s2 = peg$parse_edge_operator();
1737
+ if (s2 !== peg$FAILED) {
1738
+ peg$parse_();
1739
+ s4 = peg$parse_edge_target();
1740
+ if (s4 !== peg$FAILED) {
1741
+ peg$parse_();
1742
+ s6 = peg$parse_edge_rhs();
1743
+ if (s6 === peg$FAILED) {
1744
+ s6 = null;
1745
+ }
1746
+ peg$savedPos = s0;
1747
+ s0 = peg$f22(s2, s4, s6);
1748
+ } else {
1749
+ peg$currPos = s0;
1750
+ s0 = peg$FAILED;
1751
+ }
1752
+ } else {
1753
+ peg$currPos = s0;
1754
+ s0 = peg$FAILED;
1755
+ }
1756
+ return s0;
1757
+ }
1758
+ function peg$parse_node_ref() {
1759
+ var s0, s1, s2;
1760
+ s0 = peg$currPos;
1761
+ s1 = peg$parse_literal();
1762
+ if (s1 !== peg$FAILED) {
1763
+ s2 = peg$parse_port();
1764
+ if (s2 === peg$FAILED) {
1765
+ s2 = null;
1766
+ }
1767
+ peg$savedPos = s0;
1768
+ s0 = peg$f23(s1, s2);
1769
+ } else {
1770
+ peg$currPos = s0;
1771
+ s0 = peg$FAILED;
1772
+ }
1773
+ return s0;
1774
+ }
1775
+ function peg$parse_port() {
1776
+ var s0, s1, s2, s3, s4, s5;
1777
+ peg$silentFails++;
1778
+ s0 = peg$currPos;
1779
+ if (input.charCodeAt(peg$currPos) === 58) {
1780
+ s1 = peg$c14;
1781
+ peg$currPos++;
1782
+ } else {
1783
+ s1 = peg$FAILED;
1784
+ if (peg$silentFails === 0) {
1785
+ peg$fail(peg$e15);
1786
+ }
1787
+ }
1788
+ if (s1 !== peg$FAILED) {
1789
+ s2 = peg$parse_literal();
1790
+ if (s2 !== peg$FAILED) {
1791
+ s3 = peg$currPos;
1792
+ if (input.charCodeAt(peg$currPos) === 58) {
1793
+ s4 = peg$c14;
1794
+ peg$currPos++;
1795
+ } else {
1796
+ s4 = peg$FAILED;
1797
+ if (peg$silentFails === 0) {
1798
+ peg$fail(peg$e15);
1799
+ }
1800
+ }
1801
+ if (s4 !== peg$FAILED) {
1802
+ s5 = peg$parse_compass();
1803
+ if (s5 !== peg$FAILED) {
1804
+ peg$savedPos = s3;
1805
+ s3 = peg$f24(s2, s5);
1806
+ } else {
1807
+ peg$currPos = s3;
1808
+ s3 = peg$FAILED;
1809
+ }
1810
+ } else {
1811
+ peg$currPos = s3;
1812
+ s3 = peg$FAILED;
1813
+ }
1814
+ if (s3 === peg$FAILED) {
1815
+ s3 = null;
1816
+ }
1817
+ peg$savedPos = s0;
1818
+ s0 = peg$f25(s2, s3);
1819
+ } else {
1820
+ peg$currPos = s0;
1821
+ s0 = peg$FAILED;
1822
+ }
1823
+ } else {
1824
+ peg$currPos = s0;
1825
+ s0 = peg$FAILED;
1826
+ }
1827
+ peg$silentFails--;
1828
+ if (s0 === peg$FAILED) {
1829
+ s1 = peg$FAILED;
1830
+ if (peg$silentFails === 0) {
1831
+ peg$fail(peg$e14);
1832
+ }
1833
+ }
1834
+ return s0;
1835
+ }
1836
+ function peg$parse_subgraph_id() {
1837
+ var s0, s1, s3;
1838
+ s0 = peg$currPos;
1839
+ if (input.substr(peg$currPos, 8).toLowerCase() === peg$c15) {
1840
+ s1 = input.substr(peg$currPos, 8);
1841
+ peg$currPos += 8;
1842
+ } else {
1843
+ s1 = peg$FAILED;
1844
+ if (peg$silentFails === 0) {
1845
+ peg$fail(peg$e16);
1846
+ }
1847
+ }
1848
+ if (s1 !== peg$FAILED) {
1849
+ peg$parse_();
1850
+ s3 = peg$parse_literal();
1851
+ if (s3 === peg$FAILED) {
1852
+ s3 = null;
1853
+ }
1854
+ peg$parse_();
1855
+ peg$savedPos = s0;
1856
+ s0 = peg$f26(s3);
1857
+ } else {
1858
+ peg$currPos = s0;
1859
+ s0 = peg$FAILED;
1860
+ }
1861
+ return s0;
1862
+ }
1863
+ function peg$parse_subgraph() {
1864
+ var s0, s1, s2, s3, s5;
1865
+ s0 = peg$currPos;
1866
+ s1 = peg$parse_subgraph_id();
1867
+ if (s1 === peg$FAILED) {
1868
+ s1 = null;
1869
+ }
1870
+ if (input.charCodeAt(peg$currPos) === 123) {
1871
+ s2 = peg$c3;
1872
+ peg$currPos++;
1873
+ } else {
1874
+ s2 = peg$FAILED;
1875
+ if (peg$silentFails === 0) {
1876
+ peg$fail(peg$e3);
1877
+ }
1878
+ }
1879
+ if (s2 !== peg$FAILED) {
1880
+ s3 = peg$parseClusterStatements();
1881
+ if (s3 === peg$FAILED) {
1882
+ s3 = null;
1883
+ }
1884
+ peg$parse__();
1885
+ if (input.charCodeAt(peg$currPos) === 125) {
1886
+ s5 = peg$c4;
1887
+ peg$currPos++;
1888
+ } else {
1889
+ s5 = peg$FAILED;
1890
+ if (peg$silentFails === 0) {
1891
+ peg$fail(peg$e4);
1892
+ }
1893
+ }
1894
+ if (s5 !== peg$FAILED) {
1895
+ peg$savedPos = s0;
1896
+ s0 = peg$f27(s1, s3);
1897
+ } else {
1898
+ peg$currPos = s0;
1899
+ s0 = peg$FAILED;
1900
+ }
1901
+ } else {
1902
+ peg$currPos = s0;
1903
+ s0 = peg$FAILED;
1904
+ }
1905
+ return s0;
1906
+ }
1907
+ function peg$parse_compass_keyword() {
1908
+ var s0;
1909
+ if (input.charCodeAt(peg$currPos) === 110) {
1910
+ s0 = peg$c16;
1911
+ peg$currPos++;
1912
+ } else {
1913
+ s0 = peg$FAILED;
1914
+ if (peg$silentFails === 0) {
1915
+ peg$fail(peg$e17);
1916
+ }
1917
+ }
1918
+ if (s0 === peg$FAILED) {
1919
+ if (input.substr(peg$currPos, 2) === peg$c17) {
1920
+ s0 = peg$c17;
1921
+ peg$currPos += 2;
1922
+ } else {
1923
+ s0 = peg$FAILED;
1924
+ if (peg$silentFails === 0) {
1925
+ peg$fail(peg$e18);
1926
+ }
1927
+ }
1928
+ if (s0 === peg$FAILED) {
1929
+ if (input.charCodeAt(peg$currPos) === 101) {
1930
+ s0 = peg$c18;
1931
+ peg$currPos++;
1932
+ } else {
1933
+ s0 = peg$FAILED;
1934
+ if (peg$silentFails === 0) {
1935
+ peg$fail(peg$e19);
1936
+ }
1937
+ }
1938
+ if (s0 === peg$FAILED) {
1939
+ if (input.substr(peg$currPos, 2) === peg$c19) {
1940
+ s0 = peg$c19;
1941
+ peg$currPos += 2;
1942
+ } else {
1943
+ s0 = peg$FAILED;
1944
+ if (peg$silentFails === 0) {
1945
+ peg$fail(peg$e20);
1946
+ }
1947
+ }
1948
+ if (s0 === peg$FAILED) {
1949
+ if (input.charCodeAt(peg$currPos) === 115) {
1950
+ s0 = peg$c20;
1951
+ peg$currPos++;
1952
+ } else {
1953
+ s0 = peg$FAILED;
1954
+ if (peg$silentFails === 0) {
1955
+ peg$fail(peg$e21);
1956
+ }
1957
+ }
1958
+ if (s0 === peg$FAILED) {
1959
+ if (input.substr(peg$currPos, 2) === peg$c21) {
1960
+ s0 = peg$c21;
1961
+ peg$currPos += 2;
1962
+ } else {
1963
+ s0 = peg$FAILED;
1964
+ if (peg$silentFails === 0) {
1965
+ peg$fail(peg$e22);
1966
+ }
1967
+ }
1968
+ if (s0 === peg$FAILED) {
1969
+ if (input.charCodeAt(peg$currPos) === 119) {
1970
+ s0 = peg$c22;
1971
+ peg$currPos++;
1972
+ } else {
1973
+ s0 = peg$FAILED;
1974
+ if (peg$silentFails === 0) {
1975
+ peg$fail(peg$e23);
1976
+ }
1977
+ }
1978
+ if (s0 === peg$FAILED) {
1979
+ if (input.substr(peg$currPos, 2) === peg$c23) {
1980
+ s0 = peg$c23;
1981
+ peg$currPos += 2;
1982
+ } else {
1983
+ s0 = peg$FAILED;
1984
+ if (peg$silentFails === 0) {
1985
+ peg$fail(peg$e24);
1986
+ }
1987
+ }
1988
+ }
1989
+ }
1990
+ }
1991
+ }
1992
+ }
1993
+ }
1994
+ }
1995
+ return s0;
1996
+ }
1997
+ function peg$parse_compass() {
1998
+ var s0, s1, s2, s3, s4;
1999
+ s0 = peg$currPos;
2000
+ s1 = peg$currPos;
2001
+ s2 = peg$parse_compass_keyword();
2002
+ if (s2 !== peg$FAILED) {
2003
+ peg$savedPos = s1;
2004
+ s2 = peg$f28(s2);
2005
+ }
2006
+ s1 = s2;
2007
+ if (s1 === peg$FAILED) {
2008
+ s1 = peg$currPos;
2009
+ if (input.charCodeAt(peg$currPos) === 34) {
2010
+ s2 = peg$c24;
2011
+ peg$currPos++;
2012
+ } else {
2013
+ s2 = peg$FAILED;
2014
+ if (peg$silentFails === 0) {
2015
+ peg$fail(peg$e25);
2016
+ }
2017
+ }
2018
+ if (s2 !== peg$FAILED) {
2019
+ s3 = peg$parse_compass_keyword();
2020
+ if (s3 !== peg$FAILED) {
2021
+ if (input.charCodeAt(peg$currPos) === 34) {
2022
+ s4 = peg$c24;
2023
+ peg$currPos++;
2024
+ } else {
2025
+ s4 = peg$FAILED;
2026
+ if (peg$silentFails === 0) {
2027
+ peg$fail(peg$e25);
2028
+ }
2029
+ }
2030
+ if (s4 !== peg$FAILED) {
2031
+ peg$savedPos = s1;
2032
+ s1 = peg$f29(s3);
2033
+ } else {
2034
+ peg$currPos = s1;
2035
+ s1 = peg$FAILED;
2036
+ }
2037
+ } else {
2038
+ peg$currPos = s1;
2039
+ s1 = peg$FAILED;
2040
+ }
2041
+ } else {
2042
+ peg$currPos = s1;
2043
+ s1 = peg$FAILED;
2044
+ }
2045
+ }
2046
+ if (s1 !== peg$FAILED) {
2047
+ peg$savedPos = s0;
2048
+ s1 = peg$f30(s1);
2049
+ }
2050
+ s0 = s1;
2051
+ return s0;
2052
+ }
2053
+ function peg$parse_literal() {
2054
+ var s0, s1;
2055
+ s0 = peg$parseQUOTED_STRING();
2056
+ if (s0 === peg$FAILED) {
2057
+ s0 = peg$parseHTML_STRING();
2058
+ if (s0 === peg$FAILED) {
2059
+ s0 = peg$currPos;
2060
+ s1 = peg$parseSTRING();
2061
+ if (s1 === peg$FAILED) {
2062
+ s1 = peg$parseNUMBER_STRING();
2063
+ if (s1 === peg$FAILED) {
2064
+ s1 = peg$parseNUMBER();
2065
+ }
2066
+ }
2067
+ if (s1 !== peg$FAILED) {
2068
+ peg$savedPos = s0;
2069
+ s1 = peg$f31(s1);
2070
+ }
2071
+ s0 = s1;
2072
+ }
2073
+ }
2074
+ return s0;
2075
+ }
2076
+ function peg$parse_comment() {
2077
+ var s0;
2078
+ s0 = peg$parse_block_comment();
2079
+ if (s0 === peg$FAILED) {
2080
+ s0 = peg$parse_slash_comment();
2081
+ if (s0 === peg$FAILED) {
2082
+ s0 = peg$parse_macro_comment();
2083
+ }
2084
+ }
2085
+ return s0;
2086
+ }
2087
+ function peg$parse_block_comment() {
2088
+ var s0, s1, s2, s3, s4, s5;
2089
+ s0 = peg$currPos;
2090
+ if (input.substr(peg$currPos, 2) === peg$c25) {
2091
+ s1 = peg$c25;
2092
+ peg$currPos += 2;
2093
+ } else {
2094
+ s1 = peg$FAILED;
2095
+ if (peg$silentFails === 0) {
2096
+ peg$fail(peg$e26);
2097
+ }
2098
+ }
2099
+ if (s1 !== peg$FAILED) {
2100
+ s2 = [];
2101
+ s3 = peg$currPos;
2102
+ s4 = peg$currPos;
2103
+ peg$silentFails++;
2104
+ if (input.substr(peg$currPos, 2) === peg$c26) {
2105
+ s5 = peg$c26;
2106
+ peg$currPos += 2;
2107
+ } else {
2108
+ s5 = peg$FAILED;
2109
+ if (peg$silentFails === 0) {
2110
+ peg$fail(peg$e27);
2111
+ }
2112
+ }
2113
+ peg$silentFails--;
2114
+ if (s5 === peg$FAILED) {
2115
+ s4 = void 0;
2116
+ } else {
2117
+ peg$currPos = s4;
2118
+ s4 = peg$FAILED;
2119
+ }
2120
+ if (s4 !== peg$FAILED) {
2121
+ if (input.length > peg$currPos) {
2122
+ s5 = input.charAt(peg$currPos);
2123
+ peg$currPos++;
2124
+ } else {
2125
+ s5 = peg$FAILED;
2126
+ if (peg$silentFails === 0) {
2127
+ peg$fail(peg$e28);
2128
+ }
2129
+ }
2130
+ if (s5 !== peg$FAILED) {
2131
+ peg$savedPos = s3;
2132
+ s3 = peg$f32(s5);
2133
+ } else {
2134
+ peg$currPos = s3;
2135
+ s3 = peg$FAILED;
2136
+ }
2137
+ } else {
2138
+ peg$currPos = s3;
2139
+ s3 = peg$FAILED;
2140
+ }
2141
+ while (s3 !== peg$FAILED) {
2142
+ s2.push(s3);
2143
+ s3 = peg$currPos;
2144
+ s4 = peg$currPos;
2145
+ peg$silentFails++;
2146
+ if (input.substr(peg$currPos, 2) === peg$c26) {
2147
+ s5 = peg$c26;
2148
+ peg$currPos += 2;
2149
+ } else {
2150
+ s5 = peg$FAILED;
2151
+ if (peg$silentFails === 0) {
2152
+ peg$fail(peg$e27);
2153
+ }
2154
+ }
2155
+ peg$silentFails--;
2156
+ if (s5 === peg$FAILED) {
2157
+ s4 = void 0;
2158
+ } else {
2159
+ peg$currPos = s4;
2160
+ s4 = peg$FAILED;
2161
+ }
2162
+ if (s4 !== peg$FAILED) {
2163
+ if (input.length > peg$currPos) {
2164
+ s5 = input.charAt(peg$currPos);
2165
+ peg$currPos++;
2166
+ } else {
2167
+ s5 = peg$FAILED;
2168
+ if (peg$silentFails === 0) {
2169
+ peg$fail(peg$e28);
2170
+ }
2171
+ }
2172
+ if (s5 !== peg$FAILED) {
2173
+ peg$savedPos = s3;
2174
+ s3 = peg$f32(s5);
2175
+ } else {
2176
+ peg$currPos = s3;
2177
+ s3 = peg$FAILED;
2178
+ }
2179
+ } else {
2180
+ peg$currPos = s3;
2181
+ s3 = peg$FAILED;
2182
+ }
2183
+ }
2184
+ if (input.substr(peg$currPos, 2) === peg$c26) {
2185
+ s3 = peg$c26;
2186
+ peg$currPos += 2;
2187
+ } else {
2188
+ s3 = peg$FAILED;
2189
+ if (peg$silentFails === 0) {
2190
+ peg$fail(peg$e27);
2191
+ }
2192
+ }
2193
+ if (s3 !== peg$FAILED) {
2194
+ peg$savedPos = s0;
2195
+ s0 = peg$f33(s2);
2196
+ } else {
2197
+ peg$currPos = s0;
2198
+ s0 = peg$FAILED;
2199
+ }
2200
+ } else {
2201
+ peg$currPos = s0;
2202
+ s0 = peg$FAILED;
2203
+ }
2204
+ return s0;
2205
+ }
2206
+ function peg$parse_slash_comment() {
2207
+ var s0, s1, s2;
2208
+ s0 = peg$currPos;
2209
+ s1 = [];
2210
+ s2 = peg$parse_slash_comment_line();
2211
+ if (s2 !== peg$FAILED) {
2212
+ while (s2 !== peg$FAILED) {
2213
+ s1.push(s2);
2214
+ s2 = peg$parse_slash_comment_line();
2215
+ }
2216
+ } else {
2217
+ s1 = peg$FAILED;
2218
+ }
2219
+ if (s1 !== peg$FAILED) {
2220
+ peg$savedPos = s0;
2221
+ s1 = peg$f34(s1);
2222
+ }
2223
+ s0 = s1;
2224
+ return s0;
2225
+ }
2226
+ function peg$parse_slash_comment_line() {
2227
+ var s0, s2, s3, s4, s5, s6;
2228
+ s0 = peg$currPos;
2229
+ peg$parse_();
2230
+ if (input.substr(peg$currPos, 2) === peg$c27) {
2231
+ s2 = peg$c27;
2232
+ peg$currPos += 2;
2233
+ } else {
2234
+ s2 = peg$FAILED;
2235
+ if (peg$silentFails === 0) {
2236
+ peg$fail(peg$e29);
2237
+ }
2238
+ }
2239
+ if (s2 !== peg$FAILED) {
2240
+ s3 = [];
2241
+ s4 = peg$currPos;
2242
+ s5 = peg$currPos;
2243
+ peg$silentFails++;
2244
+ s6 = peg$parse_newline();
2245
+ peg$silentFails--;
2246
+ if (s6 === peg$FAILED) {
2247
+ s5 = void 0;
2248
+ } else {
2249
+ peg$currPos = s5;
2250
+ s5 = peg$FAILED;
2251
+ }
2252
+ if (s5 !== peg$FAILED) {
2253
+ if (input.length > peg$currPos) {
2254
+ s6 = input.charAt(peg$currPos);
2255
+ peg$currPos++;
2256
+ } else {
2257
+ s6 = peg$FAILED;
2258
+ if (peg$silentFails === 0) {
2259
+ peg$fail(peg$e28);
2260
+ }
2261
+ }
2262
+ if (s6 !== peg$FAILED) {
2263
+ peg$savedPos = s4;
2264
+ s4 = peg$f35(s6);
2265
+ } else {
2266
+ peg$currPos = s4;
2267
+ s4 = peg$FAILED;
2268
+ }
2269
+ } else {
2270
+ peg$currPos = s4;
2271
+ s4 = peg$FAILED;
2272
+ }
2273
+ while (s4 !== peg$FAILED) {
2274
+ s3.push(s4);
2275
+ s4 = peg$currPos;
2276
+ s5 = peg$currPos;
2277
+ peg$silentFails++;
2278
+ s6 = peg$parse_newline();
2279
+ peg$silentFails--;
2280
+ if (s6 === peg$FAILED) {
2281
+ s5 = void 0;
2282
+ } else {
2283
+ peg$currPos = s5;
2284
+ s5 = peg$FAILED;
2285
+ }
2286
+ if (s5 !== peg$FAILED) {
2287
+ if (input.length > peg$currPos) {
2288
+ s6 = input.charAt(peg$currPos);
2289
+ peg$currPos++;
2290
+ } else {
2291
+ s6 = peg$FAILED;
2292
+ if (peg$silentFails === 0) {
2293
+ peg$fail(peg$e28);
2294
+ }
2295
+ }
2296
+ if (s6 !== peg$FAILED) {
2297
+ peg$savedPos = s4;
2298
+ s4 = peg$f35(s6);
2299
+ } else {
2300
+ peg$currPos = s4;
2301
+ s4 = peg$FAILED;
2302
+ }
2303
+ } else {
2304
+ peg$currPos = s4;
2305
+ s4 = peg$FAILED;
2306
+ }
2307
+ }
2308
+ s4 = peg$parse_newline();
2309
+ if (s4 === peg$FAILED) {
2310
+ s4 = null;
2311
+ }
2312
+ peg$savedPos = s0;
2313
+ s0 = peg$f36(s3);
2314
+ } else {
2315
+ peg$currPos = s0;
2316
+ s0 = peg$FAILED;
2317
+ }
2318
+ return s0;
2319
+ }
2320
+ function peg$parse_macro_comment() {
2321
+ var s0, s1, s2;
2322
+ s0 = peg$currPos;
2323
+ s1 = [];
2324
+ s2 = peg$parse_macro_comment_line();
2325
+ if (s2 !== peg$FAILED) {
2326
+ while (s2 !== peg$FAILED) {
2327
+ s1.push(s2);
2328
+ s2 = peg$parse_macro_comment_line();
2329
+ }
2330
+ } else {
2331
+ s1 = peg$FAILED;
2332
+ }
2333
+ if (s1 !== peg$FAILED) {
2334
+ peg$savedPos = s0;
2335
+ s1 = peg$f37(s1);
2336
+ }
2337
+ s0 = s1;
2338
+ return s0;
2339
+ }
2340
+ function peg$parse_macro_comment_line() {
2341
+ var s0, s2, s3, s4, s5, s6;
2342
+ s0 = peg$currPos;
2343
+ peg$parse_();
2344
+ if (input.charCodeAt(peg$currPos) === 35) {
2345
+ s2 = peg$c28;
2346
+ peg$currPos++;
2347
+ } else {
2348
+ s2 = peg$FAILED;
2349
+ if (peg$silentFails === 0) {
2350
+ peg$fail(peg$e30);
2351
+ }
2352
+ }
2353
+ if (s2 !== peg$FAILED) {
2354
+ s3 = [];
2355
+ s4 = peg$currPos;
2356
+ s5 = peg$currPos;
2357
+ peg$silentFails++;
2358
+ s6 = peg$parse_newline();
2359
+ peg$silentFails--;
2360
+ if (s6 === peg$FAILED) {
2361
+ s5 = void 0;
2362
+ } else {
2363
+ peg$currPos = s5;
2364
+ s5 = peg$FAILED;
2365
+ }
2366
+ if (s5 !== peg$FAILED) {
2367
+ if (input.length > peg$currPos) {
2368
+ s6 = input.charAt(peg$currPos);
2369
+ peg$currPos++;
2370
+ } else {
2371
+ s6 = peg$FAILED;
2372
+ if (peg$silentFails === 0) {
2373
+ peg$fail(peg$e28);
2374
+ }
2375
+ }
2376
+ if (s6 !== peg$FAILED) {
2377
+ peg$savedPos = s4;
2378
+ s4 = peg$f38(s6);
2379
+ } else {
2380
+ peg$currPos = s4;
2381
+ s4 = peg$FAILED;
2382
+ }
2383
+ } else {
2384
+ peg$currPos = s4;
2385
+ s4 = peg$FAILED;
2386
+ }
2387
+ while (s4 !== peg$FAILED) {
2388
+ s3.push(s4);
2389
+ s4 = peg$currPos;
2390
+ s5 = peg$currPos;
2391
+ peg$silentFails++;
2392
+ s6 = peg$parse_newline();
2393
+ peg$silentFails--;
2394
+ if (s6 === peg$FAILED) {
2395
+ s5 = void 0;
2396
+ } else {
2397
+ peg$currPos = s5;
2398
+ s5 = peg$FAILED;
2399
+ }
2400
+ if (s5 !== peg$FAILED) {
2401
+ if (input.length > peg$currPos) {
2402
+ s6 = input.charAt(peg$currPos);
2403
+ peg$currPos++;
2404
+ } else {
2405
+ s6 = peg$FAILED;
2406
+ if (peg$silentFails === 0) {
2407
+ peg$fail(peg$e28);
2408
+ }
2409
+ }
2410
+ if (s6 !== peg$FAILED) {
2411
+ peg$savedPos = s4;
2412
+ s4 = peg$f38(s6);
2413
+ } else {
2414
+ peg$currPos = s4;
2415
+ s4 = peg$FAILED;
2416
+ }
2417
+ } else {
2418
+ peg$currPos = s4;
2419
+ s4 = peg$FAILED;
2420
+ }
2421
+ }
2422
+ s4 = peg$parse_newline();
2423
+ if (s4 === peg$FAILED) {
2424
+ s4 = null;
2425
+ }
2426
+ peg$savedPos = s0;
2427
+ s0 = peg$f39(s3);
2428
+ } else {
2429
+ peg$currPos = s0;
2430
+ s0 = peg$FAILED;
2431
+ }
2432
+ return s0;
2433
+ }
2434
+ function peg$parseSTRING() {
2435
+ var s0, s1, s2, s3;
2436
+ peg$silentFails++;
2437
+ s0 = peg$currPos;
2438
+ s1 = peg$parseStringStart();
2439
+ if (s1 !== peg$FAILED) {
2440
+ s2 = [];
2441
+ s3 = peg$parseStringPart();
2442
+ while (s3 !== peg$FAILED) {
2443
+ s2.push(s3);
2444
+ s3 = peg$parseStringPart();
2445
+ }
2446
+ peg$savedPos = s0;
2447
+ s0 = peg$f40(s1, s2);
2448
+ } else {
2449
+ peg$currPos = s0;
2450
+ s0 = peg$FAILED;
2451
+ }
2452
+ peg$silentFails--;
2453
+ if (s0 === peg$FAILED) {
2454
+ s1 = peg$FAILED;
2455
+ if (peg$silentFails === 0) {
2456
+ peg$fail(peg$e31);
2457
+ }
2458
+ }
2459
+ return s0;
2460
+ }
2461
+ function peg$parseNUMBER_STRING() {
2462
+ var s0, s1, s2;
2463
+ s0 = peg$currPos;
2464
+ s1 = peg$parseNUMBER();
2465
+ if (s1 !== peg$FAILED) {
2466
+ s2 = peg$parseSTRING();
2467
+ if (s2 !== peg$FAILED) {
2468
+ peg$savedPos = s0;
2469
+ s0 = peg$f41(s1, s2);
2470
+ } else {
2471
+ peg$currPos = s0;
2472
+ s0 = peg$FAILED;
2473
+ }
2474
+ } else {
2475
+ peg$currPos = s0;
2476
+ s0 = peg$FAILED;
2477
+ }
2478
+ return s0;
2479
+ }
2480
+ function peg$parseStringStart() {
2481
+ var s0;
2482
+ s0 = peg$parseUnicodeLetter();
2483
+ if (s0 === peg$FAILED) {
2484
+ if (input.charCodeAt(peg$currPos) === 36) {
2485
+ s0 = peg$c29;
2486
+ peg$currPos++;
2487
+ } else {
2488
+ s0 = peg$FAILED;
2489
+ if (peg$silentFails === 0) {
2490
+ peg$fail(peg$e32);
2491
+ }
2492
+ }
2493
+ if (s0 === peg$FAILED) {
2494
+ if (input.charCodeAt(peg$currPos) === 95) {
2495
+ s0 = peg$c30;
2496
+ peg$currPos++;
2497
+ } else {
2498
+ s0 = peg$FAILED;
2499
+ if (peg$silentFails === 0) {
2500
+ peg$fail(peg$e33);
2501
+ }
2502
+ }
2503
+ }
2504
+ }
2505
+ return s0;
2506
+ }
2507
+ function peg$parseStringPart() {
2508
+ var s0;
2509
+ s0 = peg$parseStringStart();
2510
+ if (s0 === peg$FAILED) {
2511
+ s0 = peg$parseNd();
2512
+ }
2513
+ return s0;
2514
+ }
2515
+ function peg$parseNUMBER() {
2516
+ var s0, s1, s2, s3, s4, s5, s6, s7, s8;
2517
+ peg$silentFails++;
2518
+ s0 = peg$currPos;
2519
+ s1 = peg$currPos;
2520
+ if (input.charCodeAt(peg$currPos) === 45) {
2521
+ s2 = peg$c31;
2522
+ peg$currPos++;
2523
+ } else {
2524
+ s2 = peg$FAILED;
2525
+ if (peg$silentFails === 0) {
2526
+ peg$fail(peg$e35);
2527
+ }
2528
+ }
2529
+ if (s2 === peg$FAILED) {
2530
+ s2 = null;
2531
+ }
2532
+ s3 = peg$currPos;
2533
+ if (input.charCodeAt(peg$currPos) === 46) {
2534
+ s4 = peg$c32;
2535
+ peg$currPos++;
2536
+ } else {
2537
+ s4 = peg$FAILED;
2538
+ if (peg$silentFails === 0) {
2539
+ peg$fail(peg$e36);
2540
+ }
2541
+ }
2542
+ if (s4 !== peg$FAILED) {
2543
+ s5 = [];
2544
+ if (peg$r0.test(input.charAt(peg$currPos))) {
2545
+ s6 = input.charAt(peg$currPos);
2546
+ peg$currPos++;
2547
+ } else {
2548
+ s6 = peg$FAILED;
2549
+ if (peg$silentFails === 0) {
2550
+ peg$fail(peg$e37);
2551
+ }
2552
+ }
2553
+ if (s6 !== peg$FAILED) {
2554
+ while (s6 !== peg$FAILED) {
2555
+ s5.push(s6);
2556
+ if (peg$r0.test(input.charAt(peg$currPos))) {
2557
+ s6 = input.charAt(peg$currPos);
2558
+ peg$currPos++;
2559
+ } else {
2560
+ s6 = peg$FAILED;
2561
+ if (peg$silentFails === 0) {
2562
+ peg$fail(peg$e37);
2563
+ }
2564
+ }
2565
+ }
2566
+ } else {
2567
+ s5 = peg$FAILED;
2568
+ }
2569
+ if (s5 !== peg$FAILED) {
2570
+ s4 = [s4, s5];
2571
+ s3 = s4;
2572
+ } else {
2573
+ peg$currPos = s3;
2574
+ s3 = peg$FAILED;
2575
+ }
2576
+ } else {
2577
+ peg$currPos = s3;
2578
+ s3 = peg$FAILED;
2579
+ }
2580
+ if (s3 === peg$FAILED) {
2581
+ s3 = peg$currPos;
2582
+ s4 = [];
2583
+ if (peg$r0.test(input.charAt(peg$currPos))) {
2584
+ s5 = input.charAt(peg$currPos);
2585
+ peg$currPos++;
2586
+ } else {
2587
+ s5 = peg$FAILED;
2588
+ if (peg$silentFails === 0) {
2589
+ peg$fail(peg$e37);
2590
+ }
2591
+ }
2592
+ if (s5 !== peg$FAILED) {
2593
+ while (s5 !== peg$FAILED) {
2594
+ s4.push(s5);
2595
+ if (peg$r0.test(input.charAt(peg$currPos))) {
2596
+ s5 = input.charAt(peg$currPos);
2597
+ peg$currPos++;
2598
+ } else {
2599
+ s5 = peg$FAILED;
2600
+ if (peg$silentFails === 0) {
2601
+ peg$fail(peg$e37);
2602
+ }
2603
+ }
2604
+ }
2605
+ } else {
2606
+ s4 = peg$FAILED;
2607
+ }
2608
+ if (s4 !== peg$FAILED) {
2609
+ s5 = peg$currPos;
2610
+ if (input.charCodeAt(peg$currPos) === 46) {
2611
+ s6 = peg$c32;
2612
+ peg$currPos++;
2613
+ } else {
2614
+ s6 = peg$FAILED;
2615
+ if (peg$silentFails === 0) {
2616
+ peg$fail(peg$e36);
2617
+ }
2618
+ }
2619
+ if (s6 !== peg$FAILED) {
2620
+ s7 = [];
2621
+ if (peg$r0.test(input.charAt(peg$currPos))) {
2622
+ s8 = input.charAt(peg$currPos);
2623
+ peg$currPos++;
2624
+ } else {
2625
+ s8 = peg$FAILED;
2626
+ if (peg$silentFails === 0) {
2627
+ peg$fail(peg$e37);
2628
+ }
2629
+ }
2630
+ while (s8 !== peg$FAILED) {
2631
+ s7.push(s8);
2632
+ if (peg$r0.test(input.charAt(peg$currPos))) {
2633
+ s8 = input.charAt(peg$currPos);
2634
+ peg$currPos++;
2635
+ } else {
2636
+ s8 = peg$FAILED;
2637
+ if (peg$silentFails === 0) {
2638
+ peg$fail(peg$e37);
2639
+ }
2640
+ }
2641
+ }
2642
+ s6 = [s6, s7];
2643
+ s5 = s6;
2644
+ } else {
2645
+ peg$currPos = s5;
2646
+ s5 = peg$FAILED;
2647
+ }
2648
+ if (s5 === peg$FAILED) {
2649
+ s5 = null;
2650
+ }
2651
+ s4 = [s4, s5];
2652
+ s3 = s4;
2653
+ } else {
2654
+ peg$currPos = s3;
2655
+ s3 = peg$FAILED;
2656
+ }
2657
+ }
2658
+ if (s3 !== peg$FAILED) {
2659
+ s2 = [s2, s3];
2660
+ s1 = s2;
2661
+ } else {
2662
+ peg$currPos = s1;
2663
+ s1 = peg$FAILED;
2664
+ }
2665
+ if (s1 !== peg$FAILED) {
2666
+ peg$savedPos = s0;
2667
+ s1 = peg$f42();
2668
+ }
2669
+ s0 = s1;
2670
+ peg$silentFails--;
2671
+ if (s0 === peg$FAILED) {
2672
+ s1 = peg$FAILED;
2673
+ if (peg$silentFails === 0) {
2674
+ peg$fail(peg$e34);
2675
+ }
2676
+ }
2677
+ return s0;
2678
+ }
2679
+ function peg$parseHTML_STRING() {
2680
+ var s0, s1;
2681
+ s0 = peg$currPos;
2682
+ s1 = peg$parsehtml_raw_string();
2683
+ if (s1 !== peg$FAILED) {
2684
+ peg$savedPos = s0;
2685
+ s1 = peg$f43(s1);
2686
+ }
2687
+ s0 = s1;
2688
+ return s0;
2689
+ }
2690
+ function peg$parsehtml_raw_string() {
2691
+ var s0, s1, s2, s3;
2692
+ s0 = peg$currPos;
2693
+ if (input.charCodeAt(peg$currPos) === 60) {
2694
+ s1 = peg$c33;
2695
+ peg$currPos++;
2696
+ } else {
2697
+ s1 = peg$FAILED;
2698
+ if (peg$silentFails === 0) {
2699
+ peg$fail(peg$e38);
2700
+ }
2701
+ }
2702
+ if (s1 !== peg$FAILED) {
2703
+ s2 = [];
2704
+ s3 = peg$parsehtml_char();
2705
+ if (s3 === peg$FAILED) {
2706
+ s3 = peg$parsehtml_raw_string();
2707
+ }
2708
+ while (s3 !== peg$FAILED) {
2709
+ s2.push(s3);
2710
+ s3 = peg$parsehtml_char();
2711
+ if (s3 === peg$FAILED) {
2712
+ s3 = peg$parsehtml_raw_string();
2713
+ }
2714
+ }
2715
+ if (input.charCodeAt(peg$currPos) === 62) {
2716
+ s3 = peg$c34;
2717
+ peg$currPos++;
2718
+ } else {
2719
+ s3 = peg$FAILED;
2720
+ if (peg$silentFails === 0) {
2721
+ peg$fail(peg$e39);
2722
+ }
2723
+ }
2724
+ if (s3 !== peg$FAILED) {
2725
+ peg$savedPos = s0;
2726
+ s0 = peg$f44(s2);
2727
+ } else {
2728
+ peg$currPos = s0;
2729
+ s0 = peg$FAILED;
2730
+ }
2731
+ } else {
2732
+ peg$currPos = s0;
2733
+ s0 = peg$FAILED;
2734
+ }
2735
+ return s0;
2736
+ }
2737
+ function peg$parsehtml_char() {
2738
+ var s0, s1, s2, s3, s4;
2739
+ s0 = peg$currPos;
2740
+ s1 = [];
2741
+ s2 = peg$currPos;
2742
+ s3 = peg$currPos;
2743
+ peg$silentFails++;
2744
+ if (input.charCodeAt(peg$currPos) === 62) {
2745
+ s4 = peg$c34;
2746
+ peg$currPos++;
2747
+ } else {
2748
+ s4 = peg$FAILED;
2749
+ if (peg$silentFails === 0) {
2750
+ peg$fail(peg$e39);
2751
+ }
2752
+ }
2753
+ if (s4 === peg$FAILED) {
2754
+ if (input.charCodeAt(peg$currPos) === 60) {
2755
+ s4 = peg$c33;
2756
+ peg$currPos++;
2757
+ } else {
2758
+ s4 = peg$FAILED;
2759
+ if (peg$silentFails === 0) {
2760
+ peg$fail(peg$e38);
2761
+ }
2762
+ }
2763
+ }
2764
+ peg$silentFails--;
2765
+ if (s4 === peg$FAILED) {
2766
+ s3 = void 0;
2767
+ } else {
2768
+ peg$currPos = s3;
2769
+ s3 = peg$FAILED;
2770
+ }
2771
+ if (s3 !== peg$FAILED) {
2772
+ if (input.length > peg$currPos) {
2773
+ s4 = input.charAt(peg$currPos);
2774
+ peg$currPos++;
2775
+ } else {
2776
+ s4 = peg$FAILED;
2777
+ if (peg$silentFails === 0) {
2778
+ peg$fail(peg$e28);
2779
+ }
2780
+ }
2781
+ if (s4 !== peg$FAILED) {
2782
+ peg$savedPos = s2;
2783
+ s2 = peg$f45(s4);
2784
+ } else {
2785
+ peg$currPos = s2;
2786
+ s2 = peg$FAILED;
2787
+ }
2788
+ } else {
2789
+ peg$currPos = s2;
2790
+ s2 = peg$FAILED;
2791
+ }
2792
+ if (s2 !== peg$FAILED) {
2793
+ while (s2 !== peg$FAILED) {
2794
+ s1.push(s2);
2795
+ s2 = peg$currPos;
2796
+ s3 = peg$currPos;
2797
+ peg$silentFails++;
2798
+ if (input.charCodeAt(peg$currPos) === 62) {
2799
+ s4 = peg$c34;
2800
+ peg$currPos++;
2801
+ } else {
2802
+ s4 = peg$FAILED;
2803
+ if (peg$silentFails === 0) {
2804
+ peg$fail(peg$e39);
2805
+ }
2806
+ }
2807
+ if (s4 === peg$FAILED) {
2808
+ if (input.charCodeAt(peg$currPos) === 60) {
2809
+ s4 = peg$c33;
2810
+ peg$currPos++;
2811
+ } else {
2812
+ s4 = peg$FAILED;
2813
+ if (peg$silentFails === 0) {
2814
+ peg$fail(peg$e38);
2815
+ }
2816
+ }
2817
+ }
2818
+ peg$silentFails--;
2819
+ if (s4 === peg$FAILED) {
2820
+ s3 = void 0;
2821
+ } else {
2822
+ peg$currPos = s3;
2823
+ s3 = peg$FAILED;
2824
+ }
2825
+ if (s3 !== peg$FAILED) {
2826
+ if (input.length > peg$currPos) {
2827
+ s4 = input.charAt(peg$currPos);
2828
+ peg$currPos++;
2829
+ } else {
2830
+ s4 = peg$FAILED;
2831
+ if (peg$silentFails === 0) {
2832
+ peg$fail(peg$e28);
2833
+ }
2834
+ }
2835
+ if (s4 !== peg$FAILED) {
2836
+ peg$savedPos = s2;
2837
+ s2 = peg$f45(s4);
2838
+ } else {
2839
+ peg$currPos = s2;
2840
+ s2 = peg$FAILED;
2841
+ }
2842
+ } else {
2843
+ peg$currPos = s2;
2844
+ s2 = peg$FAILED;
2845
+ }
2846
+ }
2847
+ } else {
2848
+ s1 = peg$FAILED;
2849
+ }
2850
+ if (s1 !== peg$FAILED) {
2851
+ peg$savedPos = s0;
2852
+ s1 = peg$f46(s1);
2853
+ }
2854
+ s0 = s1;
2855
+ return s0;
2856
+ }
2857
+ function peg$parseQUOTED_STRING() {
2858
+ var s0, s1, s2, s3;
2859
+ s0 = peg$currPos;
2860
+ if (input.charCodeAt(peg$currPos) === 34) {
2861
+ s1 = peg$c24;
2862
+ peg$currPos++;
2863
+ } else {
2864
+ s1 = peg$FAILED;
2865
+ if (peg$silentFails === 0) {
2866
+ peg$fail(peg$e25);
2867
+ }
2868
+ }
2869
+ if (s1 !== peg$FAILED) {
2870
+ s2 = [];
2871
+ s3 = peg$parseDoubleStringCharacter();
2872
+ while (s3 !== peg$FAILED) {
2873
+ s2.push(s3);
2874
+ s3 = peg$parseDoubleStringCharacter();
2875
+ }
2876
+ if (input.charCodeAt(peg$currPos) === 34) {
2877
+ s3 = peg$c24;
2878
+ peg$currPos++;
2879
+ } else {
2880
+ s3 = peg$FAILED;
2881
+ if (peg$silentFails === 0) {
2882
+ peg$fail(peg$e25);
2883
+ }
2884
+ }
2885
+ if (s3 !== peg$FAILED) {
2886
+ peg$savedPos = s0;
2887
+ s0 = peg$f47(s2);
2888
+ } else {
2889
+ peg$currPos = s0;
2890
+ s0 = peg$FAILED;
2891
+ }
2892
+ } else {
2893
+ peg$currPos = s0;
2894
+ s0 = peg$FAILED;
2895
+ }
2896
+ return s0;
2897
+ }
2898
+ function peg$parseDoubleStringCharacter() {
2899
+ var s0, s1, s2;
2900
+ s0 = peg$parseQuoteEscape();
2901
+ if (s0 === peg$FAILED) {
2902
+ s0 = peg$currPos;
2903
+ s1 = peg$currPos;
2904
+ peg$silentFails++;
2905
+ if (input.charCodeAt(peg$currPos) === 34) {
2906
+ s2 = peg$c24;
2907
+ peg$currPos++;
2908
+ } else {
2909
+ s2 = peg$FAILED;
2910
+ if (peg$silentFails === 0) {
2911
+ peg$fail(peg$e25);
2912
+ }
2913
+ }
2914
+ if (s2 === peg$FAILED) {
2915
+ s2 = peg$parseLineTerminator();
2916
+ }
2917
+ peg$silentFails--;
2918
+ if (s2 === peg$FAILED) {
2919
+ s1 = void 0;
2920
+ } else {
2921
+ peg$currPos = s1;
2922
+ s1 = peg$FAILED;
2923
+ }
2924
+ if (s1 !== peg$FAILED) {
2925
+ s2 = peg$parseSourceCharacter();
2926
+ if (s2 !== peg$FAILED) {
2927
+ peg$savedPos = s0;
2928
+ s0 = peg$f48();
2929
+ } else {
2930
+ peg$currPos = s0;
2931
+ s0 = peg$FAILED;
2932
+ }
2933
+ } else {
2934
+ peg$currPos = s0;
2935
+ s0 = peg$FAILED;
2936
+ }
2937
+ if (s0 === peg$FAILED) {
2938
+ s0 = peg$parseLineContinuation();
2939
+ }
2940
+ }
2941
+ return s0;
2942
+ }
2943
+ function peg$parseQuoteEscape() {
2944
+ var s0, s1, s2, s3;
2945
+ s0 = peg$currPos;
2946
+ s1 = peg$currPos;
2947
+ if (input.charCodeAt(peg$currPos) === 92) {
2948
+ s2 = peg$c35;
2949
+ peg$currPos++;
2950
+ } else {
2951
+ s2 = peg$FAILED;
2952
+ if (peg$silentFails === 0) {
2953
+ peg$fail(peg$e40);
2954
+ }
2955
+ }
2956
+ if (s2 !== peg$FAILED) {
2957
+ if (input.length > peg$currPos) {
2958
+ s3 = input.charAt(peg$currPos);
2959
+ peg$currPos++;
2960
+ } else {
2961
+ s3 = peg$FAILED;
2962
+ if (peg$silentFails === 0) {
2963
+ peg$fail(peg$e28);
2964
+ }
2965
+ }
2966
+ if (s3 !== peg$FAILED) {
2967
+ s2 = [s2, s3];
2968
+ s1 = s2;
2969
+ } else {
2970
+ peg$currPos = s1;
2971
+ s1 = peg$FAILED;
2972
+ }
2973
+ } else {
2974
+ peg$currPos = s1;
2975
+ s1 = peg$FAILED;
2976
+ }
2977
+ if (s1 !== peg$FAILED) {
2978
+ peg$savedPos = s0;
2979
+ s1 = peg$f49(s1);
2980
+ }
2981
+ s0 = s1;
2982
+ return s0;
2983
+ }
2984
+ function peg$parseLineContinuation() {
2985
+ var s0, s1, s2;
2986
+ s0 = peg$currPos;
2987
+ if (input.charCodeAt(peg$currPos) === 92) {
2988
+ s1 = peg$c35;
2989
+ peg$currPos++;
2990
+ } else {
2991
+ s1 = peg$FAILED;
2992
+ if (peg$silentFails === 0) {
2993
+ peg$fail(peg$e40);
2994
+ }
2995
+ }
2996
+ if (s1 !== peg$FAILED) {
2997
+ s2 = peg$parseLineTerminatorSequence();
2998
+ if (s2 !== peg$FAILED) {
2999
+ peg$savedPos = s0;
3000
+ s0 = peg$f50();
3001
+ } else {
3002
+ peg$currPos = s0;
3003
+ s0 = peg$FAILED;
3004
+ }
3005
+ } else {
3006
+ peg$currPos = s0;
3007
+ s0 = peg$FAILED;
3008
+ }
3009
+ return s0;
3010
+ }
3011
+ function peg$parseLineTerminator() {
3012
+ var s0;
3013
+ if (peg$r1.test(input.charAt(peg$currPos))) {
3014
+ s0 = input.charAt(peg$currPos);
3015
+ peg$currPos++;
3016
+ } else {
3017
+ s0 = peg$FAILED;
3018
+ if (peg$silentFails === 0) {
3019
+ peg$fail(peg$e41);
3020
+ }
3021
+ }
3022
+ return s0;
3023
+ }
3024
+ function peg$parseLineTerminatorSequence() {
3025
+ var s0;
3026
+ peg$silentFails++;
3027
+ if (input.charCodeAt(peg$currPos) === 10) {
3028
+ s0 = peg$c36;
3029
+ peg$currPos++;
3030
+ } else {
3031
+ s0 = peg$FAILED;
3032
+ if (peg$silentFails === 0) {
3033
+ peg$fail(peg$e43);
3034
+ }
3035
+ }
3036
+ if (s0 === peg$FAILED) {
3037
+ if (input.substr(peg$currPos, 2) === peg$c37) {
3038
+ s0 = peg$c37;
3039
+ peg$currPos += 2;
3040
+ } else {
3041
+ s0 = peg$FAILED;
3042
+ if (peg$silentFails === 0) {
3043
+ peg$fail(peg$e44);
3044
+ }
3045
+ }
3046
+ if (s0 === peg$FAILED) {
3047
+ if (input.charCodeAt(peg$currPos) === 13) {
3048
+ s0 = peg$c38;
3049
+ peg$currPos++;
3050
+ } else {
3051
+ s0 = peg$FAILED;
3052
+ if (peg$silentFails === 0) {
3053
+ peg$fail(peg$e45);
3054
+ }
3055
+ }
3056
+ if (s0 === peg$FAILED) {
3057
+ if (input.charCodeAt(peg$currPos) === 8232) {
3058
+ s0 = peg$c39;
3059
+ peg$currPos++;
3060
+ } else {
3061
+ s0 = peg$FAILED;
3062
+ if (peg$silentFails === 0) {
3063
+ peg$fail(peg$e46);
3064
+ }
3065
+ }
3066
+ if (s0 === peg$FAILED) {
3067
+ if (input.charCodeAt(peg$currPos) === 8233) {
3068
+ s0 = peg$c40;
3069
+ peg$currPos++;
3070
+ } else {
3071
+ s0 = peg$FAILED;
3072
+ if (peg$silentFails === 0) {
3073
+ peg$fail(peg$e47);
3074
+ }
3075
+ }
3076
+ }
3077
+ }
3078
+ }
3079
+ }
3080
+ peg$silentFails--;
3081
+ if (s0 === peg$FAILED) {
3082
+ if (peg$silentFails === 0) {
3083
+ peg$fail(peg$e42);
3084
+ }
3085
+ }
3086
+ return s0;
3087
+ }
3088
+ function peg$parseSourceCharacter() {
3089
+ var s0;
3090
+ if (input.length > peg$currPos) {
3091
+ s0 = input.charAt(peg$currPos);
3092
+ peg$currPos++;
3093
+ } else {
3094
+ s0 = peg$FAILED;
3095
+ if (peg$silentFails === 0) {
3096
+ peg$fail(peg$e28);
3097
+ }
3098
+ }
3099
+ return s0;
3100
+ }
3101
+ function peg$parse_() {
3102
+ var s0, s1;
3103
+ peg$silentFails++;
3104
+ s0 = [];
3105
+ s1 = peg$parse_whitespace();
3106
+ while (s1 !== peg$FAILED) {
3107
+ s0.push(s1);
3108
+ s1 = peg$parse_whitespace();
3109
+ }
3110
+ peg$silentFails--;
3111
+ s1 = peg$FAILED;
3112
+ if (peg$silentFails === 0) {
3113
+ peg$fail(peg$e50);
3114
+ }
3115
+ return s0;
3116
+ }
3117
+ function peg$parse__() {
3118
+ var s0, s1;
3119
+ peg$silentFails++;
3120
+ s0 = [];
3121
+ s1 = peg$parse_whitespace();
3122
+ if (s1 === peg$FAILED) {
3123
+ s1 = peg$parse_newline();
3124
+ }
3125
+ while (s1 !== peg$FAILED) {
3126
+ s0.push(s1);
3127
+ s1 = peg$parse_whitespace();
3128
+ if (s1 === peg$FAILED) {
3129
+ s1 = peg$parse_newline();
3130
+ }
3131
+ }
3132
+ peg$silentFails--;
3133
+ s1 = peg$FAILED;
3134
+ if (peg$silentFails === 0) {
3135
+ peg$fail(peg$e51);
3136
+ }
3137
+ return s0;
3138
+ }
3139
+ function peg$parse_newline() {
3140
+ var s0;
3141
+ if (peg$r3.test(input.charAt(peg$currPos))) {
3142
+ s0 = input.charAt(peg$currPos);
3143
+ peg$currPos++;
3144
+ } else {
3145
+ s0 = peg$FAILED;
3146
+ if (peg$silentFails === 0) {
3147
+ peg$fail(peg$e52);
3148
+ }
3149
+ }
3150
+ return s0;
3151
+ }
3152
+ function peg$parse_whitespace() {
3153
+ var s0;
3154
+ if (peg$r4.test(input.charAt(peg$currPos))) {
3155
+ s0 = input.charAt(peg$currPos);
3156
+ peg$currPos++;
3157
+ } else {
3158
+ s0 = peg$FAILED;
3159
+ if (peg$silentFails === 0) {
3160
+ peg$fail(peg$e53);
3161
+ }
3162
+ }
3163
+ return s0;
3164
+ }
3165
+ function peg$parseUnicodeLetter() {
3166
+ var s0;
3167
+ s0 = peg$parseLu();
3168
+ if (s0 === peg$FAILED) {
3169
+ s0 = peg$parseLl();
3170
+ if (s0 === peg$FAILED) {
3171
+ s0 = peg$parseLt();
3172
+ if (s0 === peg$FAILED) {
3173
+ s0 = peg$parseLm();
3174
+ if (s0 === peg$FAILED) {
3175
+ s0 = peg$parseLo();
3176
+ if (s0 === peg$FAILED) {
3177
+ s0 = peg$parseNl();
3178
+ }
3179
+ }
3180
+ }
3181
+ }
3182
+ }
3183
+ return s0;
3184
+ }
3185
+ function peg$parseLl() {
3186
+ var s0;
3187
+ if (peg$r5.test(input.charAt(peg$currPos))) {
3188
+ s0 = input.charAt(peg$currPos);
3189
+ peg$currPos++;
3190
+ } else {
3191
+ s0 = peg$FAILED;
3192
+ if (peg$silentFails === 0) {
3193
+ peg$fail(peg$e54);
3194
+ }
3195
+ }
3196
+ return s0;
3197
+ }
3198
+ function peg$parseLm() {
3199
+ var s0;
3200
+ if (peg$r6.test(input.charAt(peg$currPos))) {
3201
+ s0 = input.charAt(peg$currPos);
3202
+ peg$currPos++;
3203
+ } else {
3204
+ s0 = peg$FAILED;
3205
+ if (peg$silentFails === 0) {
3206
+ peg$fail(peg$e55);
3207
+ }
3208
+ }
3209
+ return s0;
3210
+ }
3211
+ function peg$parseLo() {
3212
+ var s0;
3213
+ if (peg$r7.test(input.charAt(peg$currPos))) {
3214
+ s0 = input.charAt(peg$currPos);
3215
+ peg$currPos++;
3216
+ } else {
3217
+ s0 = peg$FAILED;
3218
+ if (peg$silentFails === 0) {
3219
+ peg$fail(peg$e56);
3220
+ }
3221
+ }
3222
+ return s0;
3223
+ }
3224
+ function peg$parseLt() {
3225
+ var s0;
3226
+ if (peg$r8.test(input.charAt(peg$currPos))) {
3227
+ s0 = input.charAt(peg$currPos);
3228
+ peg$currPos++;
3229
+ } else {
3230
+ s0 = peg$FAILED;
3231
+ if (peg$silentFails === 0) {
3232
+ peg$fail(peg$e57);
3233
+ }
3234
+ }
3235
+ return s0;
3236
+ }
3237
+ function peg$parseLu() {
3238
+ var s0;
3239
+ if (peg$r9.test(input.charAt(peg$currPos))) {
3240
+ s0 = input.charAt(peg$currPos);
3241
+ peg$currPos++;
3242
+ } else {
3243
+ s0 = peg$FAILED;
3244
+ if (peg$silentFails === 0) {
3245
+ peg$fail(peg$e58);
3246
+ }
3247
+ }
3248
+ return s0;
3249
+ }
3250
+ function peg$parseNl() {
3251
+ var s0;
3252
+ if (peg$r10.test(input.charAt(peg$currPos))) {
3253
+ s0 = input.charAt(peg$currPos);
3254
+ peg$currPos++;
3255
+ } else {
3256
+ s0 = peg$FAILED;
3257
+ if (peg$silentFails === 0) {
3258
+ peg$fail(peg$e59);
3259
+ }
3260
+ }
3261
+ return s0;
3262
+ }
3263
+ function peg$parseNd() {
3264
+ var s0;
3265
+ if (peg$r11.test(input.charAt(peg$currPos))) {
3266
+ s0 = input.charAt(peg$currPos);
3267
+ peg$currPos++;
3268
+ } else {
3269
+ s0 = peg$FAILED;
3270
+ if (peg$silentFails === 0) {
3271
+ peg$fail(peg$e60);
3272
+ }
3273
+ }
3274
+ return s0;
3275
+ }
3276
+ function dedent(value) {
3277
+ const str = value.trim();
3278
+ const matches = str.match(/\n([\t ]+|(?!\s).)/g);
3279
+ if (matches) {
3280
+ const indentLengths = matches.map((match) => match.match(/[\t ]/g)?.length ?? 0);
3281
+ const pattern = new RegExp(`
3282
+ [ ]{${Math.min(...indentLengths)}}`, "g");
3283
+ return str.replace(pattern, "\n");
3284
+ }
3285
+ return str;
3286
+ }
3287
+ const edgeops = [];
3288
+ const b = new Builder({
3289
+ // @ts-ignore
3290
+ locationFunction: location
3291
+ });
3292
+ peg$result = peg$startRuleFunction();
3293
+ if (peg$result !== peg$FAILED && peg$currPos === input.length) {
3294
+ return peg$result;
3295
+ } else {
3296
+ if (peg$result !== peg$FAILED && peg$currPos < input.length) {
3297
+ peg$fail(peg$endExpectation());
3298
+ }
3299
+ throw peg$buildStructuredError(
3300
+ // @ts-ignore
3301
+ peg$maxFailExpected,
3302
+ // @ts-ignore
3303
+ peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,
3304
+ // @ts-ignore
3305
+ peg$maxFailPos < input.length ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)
3306
+ );
3307
+ }
3308
+ }
3309
+ return {
3310
+ SyntaxError: peg$SyntaxError,
3311
+ parse: peg$parse
3312
+ };
3313
+ }()
3314
+ );
3315
+ peggyParser.SyntaxError.prototype.name = "PeggySyntaxError";
3316
+ const parse$1 = peggyParser.parse;
3317
+ const PeggySyntaxError = peggyParser.SyntaxError;
3318
+ function parse(input, options) {
3319
+ try {
3320
+ return parse$1(input, options);
3321
+ } catch (e) {
3322
+ if (e instanceof PeggySyntaxError) {
3323
+ throw new DotSyntaxError(e.message, e.expected, e.found, e.location);
3324
+ }
3325
+ throw e;
3326
+ }
3327
+ }
3328
+ class DotSyntaxError extends PeggySyntaxError {
3329
+ constructor(...args) {
3330
+ super(...args);
3331
+ this.name = "DotSyntaxError";
3332
+ }
3333
+ }
3334
+ function convertAttribute(key, value) {
3335
+ if (typeof value === "string") {
3336
+ const trimmed = value.trim();
3337
+ const isHTMLLike = /^<.+>$/ms.test(trimmed);
3338
+ if (isHTMLLike) {
3339
+ return createElement(
3340
+ "Attribute",
3341
+ {
3342
+ key: createElement("Literal", { value: key, quoted: false }, []),
3343
+ value: createElement(
3344
+ "Literal",
3345
+ { value: trimmed.slice(1, trimmed.length - 1), quoted: "html" },
3346
+ []
3347
+ )
3348
+ },
3349
+ []
3350
+ );
3351
+ }
3352
+ return createElement(
3353
+ "Attribute",
3354
+ {
3355
+ key: createElement("Literal", { value: key, quoted: false }, []),
3356
+ value: createElement("Literal", { value, quoted: true }, [])
3357
+ },
3358
+ []
3359
+ );
3360
+ }
3361
+ return createElement(
3362
+ "Attribute",
3363
+ {
3364
+ key: createElement("Literal", { value: key, quoted: false }, []),
3365
+ value: createElement(
3366
+ "Literal",
3367
+ { value: String(value), quoted: false },
3368
+ []
3369
+ )
3370
+ },
3371
+ []
3372
+ );
3373
+ }
3374
+ function convertComment(value, kind) {
3375
+ return createElement(
3376
+ "Comment",
3377
+ {
3378
+ kind,
3379
+ value
3380
+ },
3381
+ []
3382
+ );
3383
+ }
3384
+ function convertClusterChildren(context, model) {
3385
+ return Array.from(
3386
+ function* () {
3387
+ for (const [key, value] of model.values) {
3388
+ yield convertAttribute(key, value);
3389
+ }
3390
+ for (const attrs of Object.values(model.attributes)) {
3391
+ if (attrs.size > 0) {
3392
+ if (attrs.comment) {
3393
+ yield convertComment(attrs.comment, context.commentKind);
3394
+ }
3395
+ yield context.convert(attrs);
3396
+ }
3397
+ }
3398
+ for (const node of model.nodes) {
3399
+ if (node.comment) {
3400
+ yield convertComment(node.comment, context.commentKind);
3401
+ }
3402
+ yield context.convert(node);
3403
+ }
3404
+ for (const subgraph of model.subgraphs) {
3405
+ if (subgraph.comment) {
3406
+ yield convertComment(subgraph.comment, context.commentKind);
3407
+ }
3408
+ yield context.convert(subgraph);
3409
+ }
3410
+ for (const edge of model.edges) {
3411
+ if (edge.comment) {
3412
+ yield convertComment(edge.comment, context.commentKind);
3413
+ }
3414
+ yield context.convert(edge);
3415
+ }
3416
+ }()
3417
+ );
3418
+ }
3419
+ const AttributeListPlugin = {
3420
+ match(model) {
3421
+ return model.$$type === "AttributeList";
3422
+ },
3423
+ convert(context, model) {
3424
+ return createElement(
3425
+ "AttributeList",
3426
+ {
3427
+ kind: model.$$kind
3428
+ },
3429
+ model.values.map(([key, value]) => convertAttribute(key, value))
3430
+ );
3431
+ }
3432
+ };
3433
+ const EdgePlugin$1 = {
3434
+ match(model) {
3435
+ return model.$$type === "Edge";
3436
+ },
3437
+ convert(context, model) {
3438
+ return createElement(
3439
+ "Edge",
3440
+ {
3441
+ targets: model.targets.map((target) => {
3442
+ if (isNodeModel(target)) {
3443
+ return createElement(
3444
+ "NodeRef",
3445
+ {
3446
+ id: createElement(
3447
+ "Literal",
3448
+ {
3449
+ value: target.id,
3450
+ quoted: true
3451
+ },
3452
+ []
3453
+ )
3454
+ },
3455
+ []
3456
+ );
3457
+ }
3458
+ if (isForwardRefNode(target)) {
3459
+ return createElement(
3460
+ "NodeRef",
3461
+ {
3462
+ id: createElement(
3463
+ "Literal",
3464
+ {
3465
+ value: target.id,
3466
+ quoted: true
3467
+ },
3468
+ []
3469
+ ),
3470
+ port: target.port ? createElement(
3471
+ "Literal",
3472
+ {
3473
+ value: target.port,
3474
+ quoted: true
3475
+ },
3476
+ []
3477
+ ) : void 0,
3478
+ compass: target.compass ? createElement(
3479
+ "Literal",
3480
+ {
3481
+ value: target.compass,
3482
+ quoted: true
3483
+ },
3484
+ []
3485
+ ) : void 0
3486
+ },
3487
+ []
3488
+ );
3489
+ }
3490
+ return createElement(
3491
+ "NodeRefGroup",
3492
+ {},
3493
+ target.map((n) => {
3494
+ if (isNodeModel(n)) {
3495
+ return createElement(
3496
+ "NodeRef",
3497
+ {
3498
+ id: createElement(
3499
+ "Literal",
3500
+ {
3501
+ value: n.id,
3502
+ quoted: true
3503
+ },
3504
+ []
3505
+ )
3506
+ },
3507
+ []
3508
+ );
3509
+ }
3510
+ return createElement(
3511
+ "NodeRef",
3512
+ {
3513
+ id: createElement(
3514
+ "Literal",
3515
+ {
3516
+ value: n.id,
3517
+ quoted: true
3518
+ },
3519
+ []
3520
+ ),
3521
+ port: n.port ? createElement(
3522
+ "Literal",
3523
+ {
3524
+ value: n.port,
3525
+ quoted: true
3526
+ },
3527
+ []
3528
+ ) : void 0,
3529
+ compass: n.compass ? createElement(
3530
+ "Literal",
3531
+ {
3532
+ value: n.compass,
3533
+ quoted: true
3534
+ },
3535
+ []
3536
+ ) : void 0
3537
+ },
3538
+ []
3539
+ );
3540
+ })
3541
+ );
3542
+ })
3543
+ },
3544
+ [
3545
+ ...model.attributes.comment ? [convertComment(model.attributes.comment, context.commentKind)] : [],
3546
+ ...model.attributes.values.map(
3547
+ ([key, value]) => convertAttribute(key, value)
3548
+ )
3549
+ ]
3550
+ );
3551
+ }
3552
+ };
3553
+ const GraphPlugin$1 = {
3554
+ match(model) {
3555
+ return model.$$type === "Graph";
3556
+ },
3557
+ convert(context, model) {
3558
+ return createElement("Dot", {}, [
3559
+ ...model.comment ? [convertComment(model.comment, context.commentKind)] : [],
3560
+ createElement(
3561
+ "Graph",
3562
+ {
3563
+ directed: model.directed,
3564
+ strict: model.strict,
3565
+ id: model.id ? createElement(
3566
+ "Literal",
3567
+ {
3568
+ value: model.id,
3569
+ quoted: true
3570
+ },
3571
+ []
3572
+ ) : void 0
3573
+ },
3574
+ convertClusterChildren(context, model)
3575
+ )
3576
+ ]);
3577
+ }
3578
+ };
3579
+ const NodePlugin$1 = {
3580
+ match(model) {
3581
+ return model.$$type === "Node";
3582
+ },
3583
+ convert(context, model) {
3584
+ return createElement(
3585
+ "Node",
3586
+ {
3587
+ id: createElement(
3588
+ "Literal",
3589
+ {
3590
+ value: model.id,
3591
+ quoted: true
3592
+ },
3593
+ []
3594
+ )
3595
+ },
3596
+ [
3597
+ ...model.attributes.comment ? [convertComment(model.attributes.comment, context.commentKind)] : [],
3598
+ ...model.attributes.values.map(
3599
+ ([key, value]) => convertAttribute(key, value)
3600
+ )
3601
+ ]
3602
+ );
3603
+ }
3604
+ };
3605
+ const SubgraphPlugin$1 = {
3606
+ match(model) {
3607
+ return model.$$type === "Subgraph";
3608
+ },
3609
+ convert(context, model) {
3610
+ return createElement(
3611
+ "Subgraph",
3612
+ {
3613
+ id: model.id ? createElement(
3614
+ "Literal",
3615
+ {
3616
+ value: model.id,
3617
+ quoted: true
3618
+ },
3619
+ []
3620
+ ) : void 0
3621
+ },
3622
+ convertClusterChildren(context, model)
3623
+ );
3624
+ }
3625
+ };
3626
+ const defaultPlugins$1 = [
3627
+ AttributeListPlugin,
3628
+ EdgePlugin$1,
3629
+ NodePlugin$1,
3630
+ GraphPlugin$1,
3631
+ SubgraphPlugin$1
3632
+ ];
3633
+ class FromModelConverter {
3634
+ constructor(options = {}) {
3635
+ this.options = options;
3636
+ }
3637
+ /** @hidden */
3638
+ #plugins = [...defaultPlugins$1];
3639
+ /**
3640
+ * Converts a DotObjectModel into an AST.
3641
+ *
3642
+ * @param model The {@link DotObjectModel} to be converted.
3643
+ * @returns The AST generated from the model.
3644
+ */
3645
+ convert(model) {
3646
+ const plugins = [...this.#plugins];
3647
+ const { commentKind = "Slash" } = this.options;
3648
+ const context = {
3649
+ commentKind,
3650
+ convert(m) {
3651
+ for (const plugin of plugins) {
3652
+ if (plugin.match(m)) {
3653
+ return plugin.convert(context, m);
3654
+ }
3655
+ }
3656
+ throw Error();
3657
+ }
3658
+ };
3659
+ return context.convert(model);
3660
+ }
3661
+ }
3662
+ function fromModel(model, options) {
3663
+ return new FromModelConverter(options).convert(model);
3664
+ }
3665
+ class CommentHolder {
3666
+ comment = null;
3667
+ set(comment) {
3668
+ this.comment = comment;
3669
+ }
3670
+ reset() {
3671
+ this.comment = null;
3672
+ }
3673
+ apply(model, location) {
3674
+ if (location && this.comment?.location) {
3675
+ if (this.comment?.kind === "Block") {
3676
+ if (this.comment.location.end.line === location.start.line - 1) {
3677
+ model.comment = this.comment.value;
3678
+ }
3679
+ } else {
3680
+ if (this.comment.location.end.line === location.start.line) {
3681
+ model.comment = this.comment.value;
3682
+ }
3683
+ }
3684
+ } else {
3685
+ model.comment = this.comment?.value;
3686
+ }
3687
+ this.reset();
3688
+ }
3689
+ }
3690
+ const DotPlugin = {
3691
+ match(ast) {
3692
+ return ast.type === "Dot";
3693
+ },
3694
+ convert(context, ast) {
3695
+ const commentHolder = new CommentHolder();
3696
+ for (const stmt of ast.children) {
3697
+ switch (stmt.type) {
3698
+ case "Comment":
3699
+ commentHolder.set(stmt);
3700
+ break;
3701
+ case "Graph": {
3702
+ const graph = context.convert(stmt);
3703
+ commentHolder.apply(graph, stmt.location);
3704
+ return graph;
3705
+ }
3706
+ }
3707
+ }
3708
+ throw Error();
3709
+ }
3710
+ };
3711
+ function convertToEdgeTargetTuple(edge) {
3712
+ return edge.targets.map((t) => {
3713
+ switch (t.type) {
3714
+ case "NodeRef":
3715
+ return {
3716
+ id: t.id.value,
3717
+ port: t.port?.value,
3718
+ compass: t.compass?.value
3719
+ };
3720
+ case "NodeRefGroup":
3721
+ return t.children.map((t2) => ({
3722
+ id: t2.id.value,
3723
+ port: t2.port?.value,
3724
+ compass: t2.compass?.value
3725
+ }));
3726
+ }
3727
+ });
3728
+ }
3729
+ const EdgePlugin = {
3730
+ match(ast) {
3731
+ return ast.type === "Edge";
3732
+ },
3733
+ convert(context, ast) {
3734
+ const edge = new context.models.Edge(
3735
+ convertToEdgeTargetTuple(ast),
3736
+ ast.children.filter(
3737
+ (v) => v.type === "Attribute"
3738
+ ).reduce(
3739
+ (acc, curr) => {
3740
+ acc[curr.key.value] = curr.value.value;
3741
+ return acc;
3742
+ },
3743
+ {}
3744
+ )
3745
+ );
3746
+ return edge;
3747
+ }
3748
+ };
3749
+ function applyStatements(graph, statements) {
3750
+ const commentHolder = new CommentHolder();
3751
+ for (const stmt of statements) {
3752
+ switch (stmt.type) {
3753
+ case "Subgraph": {
3754
+ const subgraph = stmt.id ? graph.subgraph(stmt.id.value) : graph.subgraph();
3755
+ applyStatements(subgraph, stmt.children);
3756
+ commentHolder.apply(subgraph, stmt.location);
3757
+ break;
3758
+ }
3759
+ case "Attribute":
3760
+ graph.set(stmt.key.value, stmt.value.value);
3761
+ commentHolder.reset();
3762
+ break;
3763
+ case "Node":
3764
+ commentHolder.apply(
3765
+ graph.node(
3766
+ stmt.id.value,
3767
+ stmt.children.filter(
3768
+ (v) => v.type === "Attribute"
3769
+ ).reduce(
3770
+ (acc, curr) => {
3771
+ acc[curr.key.value] = curr.value.value;
3772
+ return acc;
3773
+ },
3774
+ {}
3775
+ )
3776
+ ),
3777
+ stmt.location
3778
+ );
3779
+ break;
3780
+ case "Edge":
3781
+ commentHolder.apply(
3782
+ graph.edge(
3783
+ convertToEdgeTargetTuple(stmt),
3784
+ stmt.children.filter(
3785
+ (v) => v.type === "Attribute"
3786
+ ).reduce(
3787
+ (acc, curr) => {
3788
+ acc[curr.key.value] = curr.value.value;
3789
+ return acc;
3790
+ },
3791
+ {}
3792
+ )
3793
+ ),
3794
+ stmt.location
3795
+ );
3796
+ break;
3797
+ case "AttributeList": {
3798
+ const attrs = stmt.children.filter(
3799
+ (v) => v.type === "Attribute"
3800
+ ).reduce(
3801
+ (acc, curr) => {
3802
+ acc[curr.key.value] = curr.value.value;
3803
+ return acc;
3804
+ },
3805
+ {}
3806
+ );
3807
+ switch (stmt.kind) {
3808
+ case "Edge":
3809
+ graph.edge(attrs);
3810
+ break;
3811
+ case "Node":
3812
+ graph.node(attrs);
3813
+ break;
3814
+ case "Graph":
3815
+ graph.graph(attrs);
3816
+ break;
3817
+ }
3818
+ commentHolder.reset();
3819
+ break;
3820
+ }
3821
+ case "Comment":
3822
+ commentHolder.set(stmt);
3823
+ }
3824
+ }
3825
+ }
3826
+ const GraphPlugin = {
3827
+ match(ast) {
3828
+ return ast.type === "Graph";
3829
+ },
3830
+ convert(context, ast) {
3831
+ const G = ast.directed ? context.models.Digraph : context.models.Graph;
3832
+ const graph = new G(ast.id?.value, ast.strict);
3833
+ applyStatements(graph, ast.children);
3834
+ return graph;
3835
+ }
3836
+ };
3837
+ const NodePlugin = {
3838
+ match(ast) {
3839
+ return ast.type === "Node";
3840
+ },
3841
+ convert(context, ast) {
3842
+ const node = new context.models.Node(
3843
+ ast.id.value,
3844
+ ast.children.filter(
3845
+ (v) => v.type === "Attribute"
3846
+ ).reduce(
3847
+ (acc, curr) => {
3848
+ acc[curr.key.value] = curr.value.value;
3849
+ return acc;
3850
+ },
3851
+ {}
3852
+ )
3853
+ );
3854
+ return node;
3855
+ }
3856
+ };
3857
+ const SubgraphPlugin = {
3858
+ match(ast) {
3859
+ return ast.type === "Subgraph";
3860
+ },
3861
+ convert(context, ast) {
3862
+ const subgraph = new context.models.Subgraph(ast.id?.value);
3863
+ applyStatements(subgraph, ast.children);
3864
+ return subgraph;
3865
+ }
3866
+ };
3867
+ const defaultPlugins = [
3868
+ NodePlugin,
3869
+ EdgePlugin,
3870
+ SubgraphPlugin,
3871
+ GraphPlugin,
3872
+ DotPlugin
3873
+ ];
3874
+ class ToModelConverter {
3875
+ constructor(options = {}) {
3876
+ this.options = options;
3877
+ }
3878
+ /** @hidden */
3879
+ plugins = [
3880
+ ...defaultPlugins
3881
+ ];
3882
+ /**
3883
+ * Convert AST to Model.
3884
+ *
3885
+ * @param ast AST node.
3886
+ */
3887
+ convert(ast) {
3888
+ const plugins = [...this.plugins];
3889
+ const context = {
3890
+ models: createModelsContext(this.options.models ?? {}),
3891
+ convert(m) {
3892
+ for (const plugin of plugins) {
3893
+ if (plugin.match(m)) {
3894
+ return plugin.convert(context, m);
3895
+ }
3896
+ }
3897
+ throw Error();
3898
+ }
3899
+ };
3900
+ return context.convert(ast);
3901
+ }
3902
+ }
3903
+ function toModel(ast, options) {
3904
+ return new ToModelConverter(options).convert(ast);
3905
+ }
3906
+ export {
3907
+ Builder,
3908
+ DotSyntaxError,
3909
+ FromModelConverter,
3910
+ Printer,
3911
+ ToModelConverter,
3912
+ createElement,
3913
+ fromModel,
3914
+ parse,
3915
+ stringify,
3916
+ toModel
3917
+ };