@rhost/testkit 1.5.1 → 1.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. package/dist/cli/init.d.ts.map +1 -1
  2. package/dist/cli/init.js +4 -1
  3. package/dist/cli/init.js.map +1 -1
  4. package/node_modules/@ursamu/mushcode/.github/workflows/publish.yml +36 -0
  5. package/node_modules/@ursamu/mushcode/LICENSE +21 -0
  6. package/node_modules/@ursamu/mushcode/README.md +110 -0
  7. package/node_modules/@ursamu/mushcode/_dist/mod.d.ts +36 -0
  8. package/node_modules/@ursamu/mushcode/_dist/mod.d.ts.map +1 -0
  9. package/node_modules/@ursamu/mushcode/_dist/parser/mod.d.ts +41 -0
  10. package/node_modules/@ursamu/mushcode/_dist/parser/mod.d.ts.map +1 -0
  11. package/node_modules/@ursamu/mushcode/_dist/src/analyze/commands.d.ts +15 -0
  12. package/node_modules/@ursamu/mushcode/_dist/src/analyze/commands.d.ts.map +1 -0
  13. package/node_modules/@ursamu/mushcode/_dist/src/analyze/deps.d.ts +18 -0
  14. package/node_modules/@ursamu/mushcode/_dist/src/analyze/deps.d.ts.map +1 -0
  15. package/node_modules/@ursamu/mushcode/_dist/src/analyze/mod.d.ts +20 -0
  16. package/node_modules/@ursamu/mushcode/_dist/src/analyze/mod.d.ts.map +1 -0
  17. package/node_modules/@ursamu/mushcode/_dist/src/analyze/tags.d.ts +6 -0
  18. package/node_modules/@ursamu/mushcode/_dist/src/analyze/tags.d.ts.map +1 -0
  19. package/node_modules/@ursamu/mushcode/_dist/src/eval/context.d.ts +85 -0
  20. package/node_modules/@ursamu/mushcode/_dist/src/eval/context.d.ts.map +1 -0
  21. package/node_modules/@ursamu/mushcode/_dist/src/eval/engine.d.ts +48 -0
  22. package/node_modules/@ursamu/mushcode/_dist/src/eval/engine.d.ts.map +1 -0
  23. package/node_modules/@ursamu/mushcode/_dist/src/eval/mod.d.ts +26 -0
  24. package/node_modules/@ursamu/mushcode/_dist/src/eval/mod.d.ts.map +1 -0
  25. package/node_modules/@ursamu/mushcode/_dist/src/eval/stdlib/mod.d.ts +3 -0
  26. package/node_modules/@ursamu/mushcode/_dist/src/eval/stdlib/mod.d.ts.map +1 -0
  27. package/node_modules/@ursamu/mushcode/_dist/src/lint/mod.d.ts +38 -0
  28. package/node_modules/@ursamu/mushcode/_dist/src/lint/mod.d.ts.map +1 -0
  29. package/node_modules/@ursamu/mushcode/_dist/src/print/mod.d.ts +18 -0
  30. package/node_modules/@ursamu/mushcode/_dist/src/print/mod.d.ts.map +1 -0
  31. package/node_modules/@ursamu/mushcode/_dist/src/print/printer.d.ts +15 -0
  32. package/node_modules/@ursamu/mushcode/_dist/src/print/printer.d.ts.map +1 -0
  33. package/node_modules/@ursamu/mushcode/_dist/src/traverse/mod.d.ts +19 -0
  34. package/node_modules/@ursamu/mushcode/_dist/src/traverse/mod.d.ts.map +1 -0
  35. package/node_modules/@ursamu/mushcode/_dist/src/traverse/transform.d.ts +27 -0
  36. package/node_modules/@ursamu/mushcode/_dist/src/traverse/transform.d.ts.map +1 -0
  37. package/node_modules/@ursamu/mushcode/_dist/src/traverse/walk.d.ts +27 -0
  38. package/node_modules/@ursamu/mushcode/_dist/src/traverse/walk.d.ts.map +1 -0
  39. package/node_modules/@ursamu/mushcode/deno.json +26 -0
  40. package/node_modules/@ursamu/mushcode/deno.lock +42 -0
  41. package/node_modules/@ursamu/mushcode/docs/analyze.md +145 -0
  42. package/node_modules/@ursamu/mushcode/docs/eval.md +312 -0
  43. package/node_modules/@ursamu/mushcode/docs/lint.md +152 -0
  44. package/node_modules/@ursamu/mushcode/docs/parser.md +196 -0
  45. package/node_modules/@ursamu/mushcode/docs/print.md +84 -0
  46. package/node_modules/@ursamu/mushcode/docs/stdlib.md +418 -0
  47. package/node_modules/@ursamu/mushcode/docs/traverse.md +167 -0
  48. package/node_modules/@ursamu/mushcode/grammar/mux-softcode.pegjs +781 -0
  49. package/node_modules/@ursamu/mushcode/mod.js +44 -0
  50. package/node_modules/@ursamu/mushcode/mod.js.map +1 -0
  51. package/node_modules/@ursamu/mushcode/mod.ts +63 -0
  52. package/node_modules/@ursamu/mushcode/package.json +38 -0
  53. package/node_modules/@ursamu/mushcode/parser/mod.js +47 -0
  54. package/node_modules/@ursamu/mushcode/parser/mod.js.map +1 -0
  55. package/node_modules/@ursamu/mushcode/parser/mod.ts +99 -0
  56. package/node_modules/@ursamu/mushcode/parser/mux-softcode.js +3833 -0
  57. package/node_modules/@ursamu/mushcode/parser/mux-softcode.mjs +3837 -0
  58. package/node_modules/@ursamu/mushcode/src/analyze/commands.js +29 -0
  59. package/node_modules/@ursamu/mushcode/src/analyze/commands.js.map +1 -0
  60. package/node_modules/@ursamu/mushcode/src/analyze/commands.ts +46 -0
  61. package/node_modules/@ursamu/mushcode/src/analyze/deps.js +45 -0
  62. package/node_modules/@ursamu/mushcode/src/analyze/deps.js.map +1 -0
  63. package/node_modules/@ursamu/mushcode/src/analyze/deps.ts +51 -0
  64. package/node_modules/@ursamu/mushcode/src/analyze/mod.js +18 -0
  65. package/node_modules/@ursamu/mushcode/src/analyze/mod.js.map +1 -0
  66. package/node_modules/@ursamu/mushcode/src/analyze/mod.ts +20 -0
  67. package/node_modules/@ursamu/mushcode/src/analyze/tags.js +11 -0
  68. package/node_modules/@ursamu/mushcode/src/analyze/tags.js.map +1 -0
  69. package/node_modules/@ursamu/mushcode/src/analyze/tags.ts +11 -0
  70. package/node_modules/@ursamu/mushcode/src/eval/context.js +22 -0
  71. package/node_modules/@ursamu/mushcode/src/eval/context.js.map +1 -0
  72. package/node_modules/@ursamu/mushcode/src/eval/context.ts +177 -0
  73. package/node_modules/@ursamu/mushcode/src/eval/engine.js +238 -0
  74. package/node_modules/@ursamu/mushcode/src/eval/engine.js.map +1 -0
  75. package/node_modules/@ursamu/mushcode/src/eval/engine.ts +276 -0
  76. package/node_modules/@ursamu/mushcode/src/eval/mod.js +25 -0
  77. package/node_modules/@ursamu/mushcode/src/eval/mod.js.map +1 -0
  78. package/node_modules/@ursamu/mushcode/src/eval/mod.ts +31 -0
  79. package/node_modules/@ursamu/mushcode/src/eval/stdlib/compare.js +56 -0
  80. package/node_modules/@ursamu/mushcode/src/eval/stdlib/compare.js.map +1 -0
  81. package/node_modules/@ursamu/mushcode/src/eval/stdlib/compare.ts +16 -0
  82. package/node_modules/@ursamu/mushcode/src/eval/stdlib/db.js +91 -0
  83. package/node_modules/@ursamu/mushcode/src/eval/stdlib/db.js.map +1 -0
  84. package/node_modules/@ursamu/mushcode/src/eval/stdlib/db.ts +104 -0
  85. package/node_modules/@ursamu/mushcode/src/eval/stdlib/iter.js +91 -0
  86. package/node_modules/@ursamu/mushcode/src/eval/stdlib/iter.js.map +1 -0
  87. package/node_modules/@ursamu/mushcode/src/eval/stdlib/iter.ts +98 -0
  88. package/node_modules/@ursamu/mushcode/src/eval/stdlib/logic.js +79 -0
  89. package/node_modules/@ursamu/mushcode/src/eval/stdlib/logic.js.map +1 -0
  90. package/node_modules/@ursamu/mushcode/src/eval/stdlib/logic.ts +84 -0
  91. package/node_modules/@ursamu/mushcode/src/eval/stdlib/math.js +120 -0
  92. package/node_modules/@ursamu/mushcode/src/eval/stdlib/math.js.map +1 -0
  93. package/node_modules/@ursamu/mushcode/src/eval/stdlib/math.ts +115 -0
  94. package/node_modules/@ursamu/mushcode/src/eval/stdlib/mod.js +17 -0
  95. package/node_modules/@ursamu/mushcode/src/eval/stdlib/mod.js.map +1 -0
  96. package/node_modules/@ursamu/mushcode/src/eval/stdlib/mod.ts +19 -0
  97. package/node_modules/@ursamu/mushcode/src/eval/stdlib/register.js +28 -0
  98. package/node_modules/@ursamu/mushcode/src/eval/stdlib/register.js.map +1 -0
  99. package/node_modules/@ursamu/mushcode/src/eval/stdlib/register.ts +31 -0
  100. package/node_modules/@ursamu/mushcode/src/eval/stdlib/string.js +153 -0
  101. package/node_modules/@ursamu/mushcode/src/eval/stdlib/string.js.map +1 -0
  102. package/node_modules/@ursamu/mushcode/src/eval/stdlib/string.ts +154 -0
  103. package/node_modules/@ursamu/mushcode/src/lint/builtin_arities.js +212 -0
  104. package/node_modules/@ursamu/mushcode/src/lint/builtin_arities.js.map +1 -0
  105. package/node_modules/@ursamu/mushcode/src/lint/builtin_arities.ts +68 -0
  106. package/node_modules/@ursamu/mushcode/src/lint/mod.js +60 -0
  107. package/node_modules/@ursamu/mushcode/src/lint/mod.js.map +1 -0
  108. package/node_modules/@ursamu/mushcode/src/lint/mod.ts +96 -0
  109. package/node_modules/@ursamu/mushcode/src/lint/rules/arg_count.js +37 -0
  110. package/node_modules/@ursamu/mushcode/src/lint/rules/arg_count.js.map +1 -0
  111. package/node_modules/@ursamu/mushcode/src/lint/rules/arg_count.ts +44 -0
  112. package/node_modules/@ursamu/mushcode/src/lint/rules/iter_var_outside_iter.js +55 -0
  113. package/node_modules/@ursamu/mushcode/src/lint/rules/iter_var_outside_iter.js.map +1 -0
  114. package/node_modules/@ursamu/mushcode/src/lint/rules/iter_var_outside_iter.ts +60 -0
  115. package/node_modules/@ursamu/mushcode/src/lint/rules/missing_wildcard.js +31 -0
  116. package/node_modules/@ursamu/mushcode/src/lint/rules/missing_wildcard.js.map +1 -0
  117. package/node_modules/@ursamu/mushcode/src/lint/rules/missing_wildcard.ts +40 -0
  118. package/node_modules/@ursamu/mushcode/src/lint/rules/register_before_set.js +59 -0
  119. package/node_modules/@ursamu/mushcode/src/lint/rules/register_before_set.js.map +1 -0
  120. package/node_modules/@ursamu/mushcode/src/lint/rules/register_before_set.ts +64 -0
  121. package/node_modules/@ursamu/mushcode/src/print/lock_printer.js +43 -0
  122. package/node_modules/@ursamu/mushcode/src/print/lock_printer.js.map +1 -0
  123. package/node_modules/@ursamu/mushcode/src/print/lock_printer.ts +41 -0
  124. package/node_modules/@ursamu/mushcode/src/print/mod.js +17 -0
  125. package/node_modules/@ursamu/mushcode/src/print/mod.js.map +1 -0
  126. package/node_modules/@ursamu/mushcode/src/print/mod.ts +18 -0
  127. package/node_modules/@ursamu/mushcode/src/print/printer.js +91 -0
  128. package/node_modules/@ursamu/mushcode/src/print/printer.js.map +1 -0
  129. package/node_modules/@ursamu/mushcode/src/print/printer.ts +132 -0
  130. package/node_modules/@ursamu/mushcode/src/traverse/child_slots.js +129 -0
  131. package/node_modules/@ursamu/mushcode/src/traverse/child_slots.js.map +1 -0
  132. package/node_modules/@ursamu/mushcode/src/traverse/child_slots.ts +51 -0
  133. package/node_modules/@ursamu/mushcode/src/traverse/mod.js +17 -0
  134. package/node_modules/@ursamu/mushcode/src/traverse/mod.js.map +1 -0
  135. package/node_modules/@ursamu/mushcode/src/traverse/mod.ts +19 -0
  136. package/node_modules/@ursamu/mushcode/src/traverse/transform.js +70 -0
  137. package/node_modules/@ursamu/mushcode/src/traverse/transform.js.map +1 -0
  138. package/node_modules/@ursamu/mushcode/src/traverse/transform.ts +84 -0
  139. package/node_modules/@ursamu/mushcode/src/traverse/walk.js +55 -0
  140. package/node_modules/@ursamu/mushcode/src/traverse/walk.js.map +1 -0
  141. package/node_modules/@ursamu/mushcode/src/traverse/walk.ts +82 -0
  142. package/node_modules/@ursamu/mushcode/tests/01-literals.test.ts +105 -0
  143. package/node_modules/@ursamu/mushcode/tests/02-substitutions.test.ts +145 -0
  144. package/node_modules/@ursamu/mushcode/tests/03-function-calls.test.ts +184 -0
  145. package/node_modules/@ursamu/mushcode/tests/04-eval-blocks.test.ts +110 -0
  146. package/node_modules/@ursamu/mushcode/tests/05-braced-strings.test.ts +119 -0
  147. package/node_modules/@ursamu/mushcode/tests/06-commands.test.ts +222 -0
  148. package/node_modules/@ursamu/mushcode/tests/07-dollar-patterns.test.ts +156 -0
  149. package/node_modules/@ursamu/mushcode/tests/08-lock-expressions.test.ts +159 -0
  150. package/node_modules/@ursamu/mushcode/tests/09-edge-cases.test.ts +162 -0
  151. package/node_modules/@ursamu/mushcode/tests/10-regression.test.ts +211 -0
  152. package/node_modules/@ursamu/mushcode/tests/11-tags.test.ts +357 -0
  153. package/node_modules/@ursamu/mushcode/tests/12-locations.test.ts +162 -0
  154. package/node_modules/@ursamu/mushcode/tests/13-eval.test.ts +389 -0
  155. package/node_modules/@ursamu/mushcode/tests/analyze.test.ts +194 -0
  156. package/node_modules/@ursamu/mushcode/tests/helpers.ts +69 -0
  157. package/node_modules/@ursamu/mushcode/tests/lint.test.ts +232 -0
  158. package/node_modules/@ursamu/mushcode/tests/print.test.ts +204 -0
  159. package/node_modules/@ursamu/mushcode/tests/traverse.test.ts +211 -0
  160. package/package.json +10 -1
@@ -0,0 +1,3837 @@
1
+ // @generated by Peggy 5.1.0.
2
+ //
3
+ // https://peggyjs.org/
4
+
5
+
6
+
7
+ // ── Module-level helpers (shared across all parses) ──────────────────────
8
+
9
+ // Holds the `location` function injected by the per-parse initializer below.
10
+ // Safe because Peggy parsers are synchronous — no interleaving between parses.
11
+ let _loc = null;
12
+
13
+ /**
14
+ * Construct a typed AST node, attaching the current source location.
15
+ * `loc` is always present when called from a grammar action; it is absent
16
+ * only on nodes constructed manually in tests or by transform().
17
+ */
18
+ function node(type, props) {
19
+ const n = Object.assign({ type }, props);
20
+ if (_loc) n.loc = _loc();
21
+ return n;
22
+ }
23
+
24
+ /**
25
+ * Merge adjacent Literal nodes to reduce AST noise.
26
+ * e.g. [Literal("foo"), Literal("bar")] → [Literal("foobar")]
27
+ * When merging, loc.end is extended to cover the full span.
28
+ */
29
+ function coalesce(parts) {
30
+ if (!parts || parts.length === 0) return parts;
31
+ const out = [];
32
+ for (const p of parts) {
33
+ if (
34
+ p.type === "Literal" &&
35
+ out.length > 0 &&
36
+ out[out.length - 1].type === "Literal"
37
+ ) {
38
+ const last = out[out.length - 1];
39
+ last.value += p.value;
40
+ // Extend the span to cover the merged token
41
+ if (last.loc && p.loc) {
42
+ last.loc = { start: last.loc.start, end: p.loc.end };
43
+ }
44
+ } else {
45
+ out.push(p);
46
+ }
47
+ }
48
+ return out;
49
+ }
50
+
51
+ class peg$SyntaxError extends SyntaxError {
52
+ constructor(message, expected, found, location) {
53
+ super(message);
54
+ this.expected = expected;
55
+ this.found = found;
56
+ this.location = location;
57
+ this.name = "SyntaxError";
58
+ }
59
+
60
+ format(sources) {
61
+ let str = "Error: " + this.message;
62
+ if (this.location) {
63
+ let src = null;
64
+ const st = sources.find(s => s.source === this.location.source);
65
+ if (st) {
66
+ src = st.text.split(/\r\n|\n|\r/g);
67
+ }
68
+ const s = this.location.start;
69
+ const offset_s = (this.location.source && (typeof this.location.source.offset === "function"))
70
+ ? this.location.source.offset(s)
71
+ : s;
72
+ const loc = this.location.source + ":" + offset_s.line + ":" + offset_s.column;
73
+ if (src) {
74
+ const e = this.location.end;
75
+ const filler = "".padEnd(offset_s.line.toString().length, " ");
76
+ const line = src[s.line - 1];
77
+ const last = s.line === e.line ? e.column : line.length + 1;
78
+ const hatLen = (last - s.column) || 1;
79
+ str += "\n --> " + loc + "\n"
80
+ + filler + " |\n"
81
+ + offset_s.line + " | " + line + "\n"
82
+ + filler + " | " + "".padEnd(s.column - 1, " ")
83
+ + "".padEnd(hatLen, "^");
84
+ } else {
85
+ str += "\n at " + loc;
86
+ }
87
+ }
88
+ return str;
89
+ }
90
+
91
+ static buildMessage(expected, found) {
92
+ function hex(ch) {
93
+ return ch.codePointAt(0).toString(16).toUpperCase();
94
+ }
95
+
96
+ const nonPrintable = Object.prototype.hasOwnProperty.call(RegExp.prototype, "unicode")
97
+ ? new RegExp("[\\p{C}\\p{Mn}\\p{Mc}]", "gu")
98
+ : null;
99
+ function unicodeEscape(s) {
100
+ if (nonPrintable) {
101
+ return s.replace(nonPrintable, ch => "\\u{" + hex(ch) + "}");
102
+ }
103
+ return s;
104
+ }
105
+
106
+ function literalEscape(s) {
107
+ return unicodeEscape(s
108
+ .replace(/\\/g, "\\\\")
109
+ .replace(/"/g, "\\\"")
110
+ .replace(/\0/g, "\\0")
111
+ .replace(/\t/g, "\\t")
112
+ .replace(/\n/g, "\\n")
113
+ .replace(/\r/g, "\\r")
114
+ .replace(/[\x00-\x0F]/g, ch => "\\x0" + hex(ch))
115
+ .replace(/[\x10-\x1F\x7F-\x9F]/g, ch => "\\x" + hex(ch)));
116
+ }
117
+
118
+ function classEscape(s) {
119
+ return unicodeEscape(s
120
+ .replace(/\\/g, "\\\\")
121
+ .replace(/\]/g, "\\]")
122
+ .replace(/\^/g, "\\^")
123
+ .replace(/-/g, "\\-")
124
+ .replace(/\0/g, "\\0")
125
+ .replace(/\t/g, "\\t")
126
+ .replace(/\n/g, "\\n")
127
+ .replace(/\r/g, "\\r")
128
+ .replace(/[\x00-\x0F]/g, ch => "\\x0" + hex(ch))
129
+ .replace(/[\x10-\x1F\x7F-\x9F]/g, ch => "\\x" + hex(ch)));
130
+ }
131
+
132
+ const DESCRIBE_EXPECTATION_FNS = {
133
+ literal(expectation) {
134
+ return "\"" + literalEscape(expectation.text) + "\"";
135
+ },
136
+
137
+ class(expectation) {
138
+ const escapedParts = expectation.parts.map(
139
+ part => (Array.isArray(part)
140
+ ? classEscape(part[0]) + "-" + classEscape(part[1])
141
+ : classEscape(part))
142
+ );
143
+
144
+ return "[" + (expectation.inverted ? "^" : "") + escapedParts.join("") + "]" + (expectation.unicode ? "u" : "");
145
+ },
146
+
147
+ any() {
148
+ return "any character";
149
+ },
150
+
151
+ end() {
152
+ return "end of input";
153
+ },
154
+
155
+ other(expectation) {
156
+ return expectation.description;
157
+ },
158
+ };
159
+
160
+ function describeExpectation(expectation) {
161
+ return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
162
+ }
163
+
164
+ function describeExpected(expected) {
165
+ const descriptions = expected.map(describeExpectation);
166
+ descriptions.sort();
167
+
168
+ if (descriptions.length > 0) {
169
+ let j = 1;
170
+ for (let i = 1; i < descriptions.length; i++) {
171
+ if (descriptions[i - 1] !== descriptions[i]) {
172
+ descriptions[j] = descriptions[i];
173
+ j++;
174
+ }
175
+ }
176
+ descriptions.length = j;
177
+ }
178
+
179
+ switch (descriptions.length) {
180
+ case 1:
181
+ return descriptions[0];
182
+
183
+ case 2:
184
+ return descriptions[0] + " or " + descriptions[1];
185
+
186
+ default:
187
+ return descriptions.slice(0, -1).join(", ")
188
+ + ", or "
189
+ + descriptions[descriptions.length - 1];
190
+ }
191
+ }
192
+
193
+ function describeFound(found) {
194
+ return found ? "\"" + literalEscape(found) + "\"" : "end of input";
195
+ }
196
+
197
+ return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";
198
+ }
199
+ }
200
+
201
+ function peg$parse(input, options) {
202
+ options = options !== undefined ? options : {};
203
+
204
+ const peg$FAILED = {};
205
+ const peg$source = options.grammarSource;
206
+
207
+ const peg$startRuleFunctions = {
208
+ Start: peg$parseStart,
209
+ LockExpr: peg$parseLockExpr,
210
+ };
211
+ let peg$startRuleFunction = peg$parseStart;
212
+
213
+ const peg$c0 = "$";
214
+ const peg$c1 = ":";
215
+ const peg$c2 = "^";
216
+ const peg$c3 = ";";
217
+ const peg$c4 = "*";
218
+ const peg$c5 = "?";
219
+ const peg$c6 = "\\";
220
+ const peg$c7 = "@";
221
+ const peg$c8 = "/";
222
+ const peg$c9 = "=";
223
+ const peg$c10 = "&";
224
+ const peg$c11 = "#";
225
+ const peg$c12 = "{";
226
+ const peg$c13 = "}";
227
+ const peg$c14 = "[";
228
+ const peg$c15 = "]";
229
+ const peg$c16 = "()";
230
+ const peg$c17 = "(";
231
+ const peg$c18 = ")";
232
+ const peg$c19 = ",";
233
+ const peg$c20 = "%";
234
+ const peg$c21 = "q";
235
+ const peg$c22 = "i";
236
+ const peg$c23 = "V";
237
+ const peg$c24 = "v";
238
+ const peg$c25 = "x";
239
+ const peg$c26 = "<";
240
+ const peg$c27 = ">";
241
+ const peg$c28 = "X";
242
+ const peg$c29 = "c";
243
+ const peg$c30 = "C";
244
+ const peg$c31 = "##";
245
+ const peg$c32 = "#@";
246
+ const peg$c33 = "#$";
247
+ const peg$c34 = "|";
248
+ const peg$c35 = "!";
249
+ const peg$c36 = "me";
250
+ const peg$c37 = "-";
251
+ const peg$c38 = "flag^";
252
+ const peg$c39 = "type^";
253
+ const peg$c40 = "attr^";
254
+
255
+ const peg$r0 = /^[^;:*?\\]/;
256
+ const peg$r1 = /^[a-zA-Z]/;
257
+ const peg$r2 = /^[a-zA-Z0-9_\-]/;
258
+ const peg$r3 = /^[a-zA-Z_]/;
259
+ const peg$r4 = /^[^=;[{%\\#]/;
260
+ const peg$r5 = /^[#-$@]/;
261
+ const peg$r6 = /^[^;[{%\\#]/;
262
+ const peg$r7 = /^[^{}[%\\#]/;
263
+ const peg$r8 = /^[^[\]{}%\\#]/;
264
+ const peg$r9 = /^[a-zA-Z0-9_]/;
265
+ const peg$r10 = /^[^[\](){}%\\#]/;
266
+ const peg$r11 = /^[^,[\](){}%\\#]/;
267
+ const peg$r12 = /^[0-9a-zA-Z_]/;
268
+ const peg$r13 = /^[0-9]/;
269
+ const peg$r14 = /^[A-Za-z]/;
270
+ const peg$r15 = /^[^>]/;
271
+ const peg$r16 = /^[a-zA-Z0-9]/;
272
+ const peg$r17 = /^[#NnSOPAsopaL!0-9RBTMrtblw@+|%kK:]/;
273
+ const peg$r18 = /^[^|&!()[\]{}\r\n]/;
274
+ const peg$r19 = /^[ \t\r\n]/;
275
+
276
+ const peg$e0 = peg$literalExpectation("$", false);
277
+ const peg$e1 = peg$literalExpectation(":", false);
278
+ const peg$e2 = peg$literalExpectation("^", false);
279
+ const peg$e3 = peg$literalExpectation(";", false);
280
+ const peg$e4 = peg$literalExpectation("*", false);
281
+ const peg$e5 = peg$literalExpectation("?", false);
282
+ const peg$e6 = peg$literalExpectation("\\", false);
283
+ const peg$e7 = peg$anyExpectation();
284
+ const peg$e8 = peg$classExpectation([";", ":", "*", "?", "\\"], true, false, false);
285
+ const peg$e9 = peg$literalExpectation("@", false);
286
+ const peg$e10 = peg$classExpectation([["a", "z"], ["A", "Z"]], false, false, false);
287
+ const peg$e11 = peg$classExpectation([["a", "z"], ["A", "Z"], ["0", "9"], "_", "-"], false, false, false);
288
+ const peg$e12 = peg$literalExpectation("/", false);
289
+ const peg$e13 = peg$literalExpectation("=", false);
290
+ const peg$e14 = peg$literalExpectation("&", false);
291
+ const peg$e15 = peg$classExpectation([["a", "z"], ["A", "Z"], "_"], false, false, false);
292
+ const peg$e16 = peg$classExpectation(["=", ";", "[", "{", "%", "\\", "#"], true, false, false);
293
+ const peg$e17 = peg$literalExpectation("#", false);
294
+ const peg$e18 = peg$classExpectation([["#", "$"], "@"], false, false, false);
295
+ const peg$e19 = peg$classExpectation([";", "[", "{", "%", "\\", "#"], true, false, false);
296
+ const peg$e20 = peg$literalExpectation("{", false);
297
+ const peg$e21 = peg$literalExpectation("}", false);
298
+ const peg$e22 = peg$classExpectation(["{", "}", "[", "%", "\\", "#"], true, false, false);
299
+ const peg$e23 = peg$literalExpectation("[", false);
300
+ const peg$e24 = peg$literalExpectation("]", false);
301
+ const peg$e25 = peg$classExpectation(["[", "]", "{", "}", "%", "\\", "#"], true, false, false);
302
+ const peg$e26 = peg$literalExpectation("()", false);
303
+ const peg$e27 = peg$literalExpectation("(", false);
304
+ const peg$e28 = peg$literalExpectation(")", false);
305
+ const peg$e29 = peg$classExpectation([["a", "z"], ["A", "Z"], ["0", "9"], "_"], false, false, false);
306
+ const peg$e30 = peg$literalExpectation(",", false);
307
+ const peg$e31 = peg$classExpectation(["[", "]", "(", ")", "{", "}", "%", "\\", "#"], true, false, false);
308
+ const peg$e32 = peg$classExpectation([",", "[", "]", "(", ")", "{", "}", "%", "\\", "#"], true, false, false);
309
+ const peg$e33 = peg$literalExpectation("%", false);
310
+ const peg$e34 = peg$literalExpectation("q", false);
311
+ const peg$e35 = peg$classExpectation([["0", "9"], ["a", "z"], ["A", "Z"], "_"], false, false, false);
312
+ const peg$e36 = peg$literalExpectation("i", false);
313
+ const peg$e37 = peg$classExpectation([["0", "9"]], false, false, false);
314
+ const peg$e38 = peg$literalExpectation("V", false);
315
+ const peg$e39 = peg$classExpectation([["A", "Z"], ["a", "z"]], false, false, false);
316
+ const peg$e40 = peg$literalExpectation("v", false);
317
+ const peg$e41 = peg$literalExpectation("x", false);
318
+ const peg$e42 = peg$literalExpectation("<", false);
319
+ const peg$e43 = peg$classExpectation([">"], true, false, false);
320
+ const peg$e44 = peg$literalExpectation(">", false);
321
+ const peg$e45 = peg$literalExpectation("X", false);
322
+ const peg$e46 = peg$literalExpectation("c", false);
323
+ const peg$e47 = peg$literalExpectation("C", false);
324
+ const peg$e48 = peg$classExpectation([["a", "z"], ["A", "Z"], ["0", "9"]], false, false, false);
325
+ const peg$e49 = peg$classExpectation(["#", "N", "n", "S", "O", "P", "A", "s", "o", "p", "a", "L", "!", ["0", "9"], "R", "B", "T", "M", "r", "t", "b", "l", "w", "@", "+", "|", "%", "k", "K", ":"], false, false, false);
326
+ const peg$e50 = peg$literalExpectation("##", false);
327
+ const peg$e51 = peg$literalExpectation("#@", false);
328
+ const peg$e52 = peg$literalExpectation("#$", false);
329
+ const peg$e53 = peg$literalExpectation("|", false);
330
+ const peg$e54 = peg$literalExpectation("!", false);
331
+ const peg$e55 = peg$literalExpectation("me", false);
332
+ const peg$e56 = peg$literalExpectation("-", false);
333
+ const peg$e57 = peg$literalExpectation("flag^", false);
334
+ const peg$e58 = peg$literalExpectation("type^", false);
335
+ const peg$e59 = peg$literalExpectation("attr^", false);
336
+ const peg$e60 = peg$classExpectation(["|", "&", "!", "(", ")", "[", "]", "{", "}", "\r", "\n"], true, false, false);
337
+ const peg$e61 = peg$classExpectation([" ", "\t", "\r", "\n"], false, false, false);
338
+
339
+ function peg$f0(av) { return av; }
340
+ function peg$f1(parts) {
341
+ return node("UserCommand", { parts: coalesce(parts) });
342
+ }
343
+ function peg$f2(pattern, action) {
344
+ return node("DollarPattern", { pattern, action });
345
+ }
346
+ function peg$f3(pattern, action) {
347
+ return node("ListenPattern", { pattern, action });
348
+ }
349
+ function peg$f4(head, tail) {
350
+ const patterns = [head, ...tail.map(t => t[1])];
351
+ return patterns.length === 1
352
+ ? patterns[0]
353
+ : node("PatternAlts", { patterns });
354
+ }
355
+ function peg$f5(parts) {
356
+ return node("Pattern", { parts: coalesce(parts) });
357
+ }
358
+ function peg$f6() { return node("Wildcard", { wildcard: "*" }); }
359
+ function peg$f7() { return node("Wildcard", { wildcard: "?" }); }
360
+ function peg$f8(char) { return node("Escape", { char }); }
361
+ function peg$f9(chars) { return node("Literal", { value: chars }); }
362
+ function peg$f10(head, tail) {
363
+ const commands = [head, ...tail.map(t => t[1])];
364
+ return commands.length === 1
365
+ ? commands[0]
366
+ : node("CommandList", { commands });
367
+ }
368
+ function peg$f11(name, switches, body) {
369
+ return node("AtCommand", {
370
+ name,
371
+ switches,
372
+ object: body ? body.object : null,
373
+ value: body ? body.value : null,
374
+ });
375
+ }
376
+ function peg$f12(n) { return n; }
377
+ function peg$f13(obj, val) {
378
+ return { object: obj, value: val };
379
+ }
380
+ function peg$f14(obj) {
381
+ return { object: obj, value: null };
382
+ }
383
+ function peg$f15(attr, obj, val) {
384
+ return node("AttributeSet", { attribute: attr, object: obj, value: val, hidden: attr.startsWith("_") });
385
+ }
386
+ function peg$f16(attr, obj) {
387
+ return node("AttributeSet", { attribute: attr, object: obj, value: null, hidden: attr.startsWith("_") });
388
+ }
389
+ function peg$f17(parts) {
390
+ return node("UserCommand", { parts: coalesce(parts) });
391
+ }
392
+ function peg$f18(parts) {
393
+ return node("Text", { parts: coalesce(parts) });
394
+ }
395
+ function peg$f19(chars) { return node("Literal", { value: chars }); }
396
+ function peg$f20() { return node("Literal", { value: "#" }); }
397
+ function peg$f21(chars) { return node("Literal", { value: chars }); }
398
+ function peg$f22() { return node("Literal", { value: "#" }); }
399
+ function peg$f23(parts) {
400
+ return node("BracedString", { parts: coalesce(parts) });
401
+ }
402
+ function peg$f24(chars) { return node("Literal", { value: chars }); }
403
+ function peg$f25() { return node("Literal", { value: "#" }); }
404
+ function peg$f26(parts) {
405
+ return node("EvalBlock", { parts: coalesce(parts) });
406
+ }
407
+ function peg$f27(chars) { return node("Literal", { value: chars }); }
408
+ function peg$f28() { return node("Literal", { value: "#" }); }
409
+ function peg$f29(name) {
410
+ return node("FunctionCall", { name, args: [] });
411
+ }
412
+ function peg$f30(name, args) {
413
+ return node("FunctionCall", { name, args });
414
+ }
415
+ function peg$f31(head, tail) {
416
+ return [head, ...tail.map(t => t[1])];
417
+ }
418
+ function peg$f32(parts) {
419
+ return node("Arg", { parts: coalesce(parts) });
420
+ }
421
+ function peg$f33(parts) {
422
+ const inner = coalesce(parts);
423
+ return node("Literal", {
424
+ value: "(" + inner.map(p => p.type === "Literal" ? p.value : "").join("") + ")"
425
+ });
426
+ }
427
+ function peg$f34(chars) { return node("Literal", { value: chars }); }
428
+ function peg$f35() { return node("Literal", { value: "#" }); }
429
+ function peg$f36(chars) { return node("Literal", { value: chars }); }
430
+ function peg$f37() { return node("Literal", { value: "#" }); }
431
+ function peg$f38(code) {
432
+ return node("Substitution", { code });
433
+ }
434
+ function peg$f39(name) { return "q" + name; }
435
+ function peg$f40(n) { return "i" + n; }
436
+ function peg$f41(n) { return "V" + n; }
437
+ function peg$f42(n) { return "v" + n; }
438
+ function peg$f43(s) { return "x<" + s + ">"; }
439
+ function peg$f44(s) { return "X<" + s + ">"; }
440
+ function peg$f45(s) { return "c<" + s + ">"; }
441
+ function peg$f46(s) { return "C<" + s + ">"; }
442
+ function peg$f47(n) { return "x" + n; }
443
+ function peg$f48(n) { return "X" + n; }
444
+ function peg$f49(n) { return "c" + n; }
445
+ function peg$f50(n) { return "C" + n; }
446
+ function peg$f51() { return "\\"; }
447
+ function peg$f52(name) { return "=" + name; }
448
+ function peg$f53(c) { return c; }
449
+ function peg$f54() { return "["; }
450
+ function peg$f55() { return "]"; }
451
+ function peg$f56() { return ","; }
452
+ function peg$f57() { return ";"; }
453
+ function peg$f58() { return node("SpecialVar", { code: "##" }); }
454
+ function peg$f59() { return node("SpecialVar", { code: "#@" }); }
455
+ function peg$f60() { return node("SpecialVar", { code: "#$" }); }
456
+ function peg$f61(name) {
457
+ return node("TagRef", { name });
458
+ }
459
+ function peg$f62(char) {
460
+ return node("Escape", { char });
461
+ }
462
+ function peg$f63(head, tail) {
463
+ if (tail.length === 0) return head;
464
+ return node("LockOr", { operands: [head, ...tail.map(t => t[1])] });
465
+ }
466
+ function peg$f64(head, tail) {
467
+ if (tail.length === 0) return head;
468
+ return node("LockAnd", { operands: [head, ...tail.map(t => t[1])] });
469
+ }
470
+ function peg$f65(operand) { return node("LockNot", { operand }); }
471
+ function peg$f66(expr) { return expr; }
472
+ function peg$f67() { return node("LockMe", {}); }
473
+ function peg$f68(n) {
474
+ return node("LockDbref", { dbref: "#" + n });
475
+ }
476
+ function peg$f69(name) {
477
+ return node("LockFlagCheck", { flag: name });
478
+ }
479
+ function peg$f70(name) {
480
+ return node("LockTypeCheck", { typeName: name });
481
+ }
482
+ function peg$f71(name) {
483
+ return node("LockAttrCheck", { attribute: name });
484
+ }
485
+ function peg$f72(name) {
486
+ return node("LockPlayerName", { name: name.trim() });
487
+ }
488
+ let peg$currPos = options.peg$currPos | 0;
489
+ let peg$savedPos = peg$currPos;
490
+ const peg$posDetailsCache = [{ line: 1, column: 1 }];
491
+ let peg$maxFailPos = peg$currPos;
492
+ let peg$maxFailExpected = options.peg$maxFailExpected || [];
493
+ let peg$silentFails = options.peg$silentFails | 0;
494
+
495
+ let peg$result;
496
+
497
+ if (options.startRule) {
498
+ if (!(options.startRule in peg$startRuleFunctions)) {
499
+ throw new Error("Can't start parsing from rule \"" + options.startRule + "\".");
500
+ }
501
+
502
+ peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
503
+ }
504
+
505
+ function text() {
506
+ return input.substring(peg$savedPos, peg$currPos);
507
+ }
508
+
509
+ function offset() {
510
+ return peg$savedPos;
511
+ }
512
+
513
+ function range() {
514
+ return {
515
+ source: peg$source,
516
+ start: peg$savedPos,
517
+ end: peg$currPos,
518
+ };
519
+ }
520
+
521
+ function location() {
522
+ return peg$computeLocation(peg$savedPos, peg$currPos);
523
+ }
524
+
525
+ function expected(description, location) {
526
+ location = location !== undefined
527
+ ? location
528
+ : peg$computeLocation(peg$savedPos, peg$currPos);
529
+
530
+ throw peg$buildStructuredError(
531
+ [peg$otherExpectation(description)],
532
+ input.substring(peg$savedPos, peg$currPos),
533
+ location
534
+ );
535
+ }
536
+
537
+ function error(message, location) {
538
+ location = location !== undefined
539
+ ? location
540
+ : peg$computeLocation(peg$savedPos, peg$currPos);
541
+
542
+ throw peg$buildSimpleError(message, location);
543
+ }
544
+
545
+ function peg$getUnicode(pos = peg$currPos) {
546
+ const cp = input.codePointAt(pos);
547
+ if (cp === undefined) {
548
+ return "";
549
+ }
550
+ return String.fromCodePoint(cp);
551
+ }
552
+
553
+ function peg$literalExpectation(text, ignoreCase) {
554
+ return { type: "literal", text, ignoreCase };
555
+ }
556
+
557
+ function peg$classExpectation(parts, inverted, ignoreCase, unicode) {
558
+ return { type: "class", parts, inverted, ignoreCase, unicode };
559
+ }
560
+
561
+ function peg$anyExpectation() {
562
+ return { type: "any" };
563
+ }
564
+
565
+ function peg$endExpectation() {
566
+ return { type: "end" };
567
+ }
568
+
569
+ function peg$otherExpectation(description) {
570
+ return { type: "other", description };
571
+ }
572
+
573
+ function peg$computePosDetails(pos) {
574
+ let details = peg$posDetailsCache[pos];
575
+ let p;
576
+
577
+ if (details) {
578
+ return details;
579
+ } else {
580
+ if (pos >= peg$posDetailsCache.length) {
581
+ p = peg$posDetailsCache.length - 1;
582
+ } else {
583
+ p = pos;
584
+ while (!peg$posDetailsCache[--p]) {}
585
+ }
586
+
587
+ details = peg$posDetailsCache[p];
588
+ details = {
589
+ line: details.line,
590
+ column: details.column,
591
+ };
592
+
593
+ while (p < pos) {
594
+ if (input.charCodeAt(p) === 10) {
595
+ details.line++;
596
+ details.column = 1;
597
+ } else {
598
+ details.column++;
599
+ }
600
+
601
+ p++;
602
+ }
603
+
604
+ peg$posDetailsCache[pos] = details;
605
+
606
+ return details;
607
+ }
608
+ }
609
+
610
+ function peg$computeLocation(startPos, endPos, offset) {
611
+ const startPosDetails = peg$computePosDetails(startPos);
612
+ const endPosDetails = peg$computePosDetails(endPos);
613
+
614
+ const res = {
615
+ source: peg$source,
616
+ start: {
617
+ offset: startPos,
618
+ line: startPosDetails.line,
619
+ column: startPosDetails.column,
620
+ },
621
+ end: {
622
+ offset: endPos,
623
+ line: endPosDetails.line,
624
+ column: endPosDetails.column,
625
+ },
626
+ };
627
+ if (offset && peg$source && (typeof peg$source.offset === "function")) {
628
+ res.start = peg$source.offset(res.start);
629
+ res.end = peg$source.offset(res.end);
630
+ }
631
+ return res;
632
+ }
633
+
634
+ function peg$fail(expected) {
635
+ if (peg$currPos < peg$maxFailPos) { return; }
636
+
637
+ if (peg$currPos > peg$maxFailPos) {
638
+ peg$maxFailPos = peg$currPos;
639
+ peg$maxFailExpected = [];
640
+ }
641
+
642
+ peg$maxFailExpected.push(expected);
643
+ }
644
+
645
+ function peg$buildSimpleError(message, location) {
646
+ return new peg$SyntaxError(message, null, null, location);
647
+ }
648
+
649
+ function peg$buildStructuredError(expected, found, location) {
650
+ return new peg$SyntaxError(
651
+ peg$SyntaxError.buildMessage(expected, found),
652
+ expected,
653
+ found,
654
+ location
655
+ );
656
+ }
657
+
658
+ function peg$parseStart() {
659
+ let s0, s1, s2, s3;
660
+
661
+ s0 = peg$currPos;
662
+ s1 = peg$parse_();
663
+ s2 = peg$parseAttributeValue();
664
+ if (s2 !== peg$FAILED) {
665
+ s3 = peg$parse_();
666
+ peg$savedPos = s0;
667
+ s0 = peg$f0(s2);
668
+ } else {
669
+ peg$currPos = s0;
670
+ s0 = peg$FAILED;
671
+ }
672
+
673
+ return s0;
674
+ }
675
+
676
+ function peg$parseAttributeValue() {
677
+ let s0;
678
+
679
+ s0 = peg$parseDollarPattern();
680
+ if (s0 === peg$FAILED) {
681
+ s0 = peg$parseListenPattern();
682
+ if (s0 === peg$FAILED) {
683
+ s0 = peg$parseCommandList();
684
+ }
685
+ }
686
+
687
+ return s0;
688
+ }
689
+
690
+ function peg$parseAtCmdValue() {
691
+ let s0, s1, s2;
692
+
693
+ s0 = peg$parseDollarPattern();
694
+ if (s0 === peg$FAILED) {
695
+ s0 = peg$parseListenPattern();
696
+ if (s0 === peg$FAILED) {
697
+ s0 = peg$currPos;
698
+ s1 = [];
699
+ s2 = peg$parseCmdToken();
700
+ while (s2 !== peg$FAILED) {
701
+ s1.push(s2);
702
+ s2 = peg$parseCmdToken();
703
+ }
704
+ peg$savedPos = s0;
705
+ s1 = peg$f1(s1);
706
+ s0 = s1;
707
+ }
708
+ }
709
+
710
+ return s0;
711
+ }
712
+
713
+ function peg$parseDollarPattern() {
714
+ let s0, s1, s2, s3, s4;
715
+
716
+ s0 = peg$currPos;
717
+ if (input.charCodeAt(peg$currPos) === 36) {
718
+ s1 = peg$c0;
719
+ peg$currPos++;
720
+ } else {
721
+ s1 = peg$FAILED;
722
+ if (peg$silentFails === 0) { peg$fail(peg$e0); }
723
+ }
724
+ if (s1 !== peg$FAILED) {
725
+ s2 = peg$parsePatternSpec();
726
+ if (s2 !== peg$FAILED) {
727
+ if (input.charCodeAt(peg$currPos) === 58) {
728
+ s3 = peg$c1;
729
+ peg$currPos++;
730
+ } else {
731
+ s3 = peg$FAILED;
732
+ if (peg$silentFails === 0) { peg$fail(peg$e1); }
733
+ }
734
+ if (s3 !== peg$FAILED) {
735
+ s4 = peg$parseCommandList();
736
+ if (s4 !== peg$FAILED) {
737
+ peg$savedPos = s0;
738
+ s0 = peg$f2(s2, s4);
739
+ } else {
740
+ peg$currPos = s0;
741
+ s0 = peg$FAILED;
742
+ }
743
+ } else {
744
+ peg$currPos = s0;
745
+ s0 = peg$FAILED;
746
+ }
747
+ } else {
748
+ peg$currPos = s0;
749
+ s0 = peg$FAILED;
750
+ }
751
+ } else {
752
+ peg$currPos = s0;
753
+ s0 = peg$FAILED;
754
+ }
755
+
756
+ return s0;
757
+ }
758
+
759
+ function peg$parseListenPattern() {
760
+ let s0, s1, s2, s3, s4;
761
+
762
+ s0 = peg$currPos;
763
+ if (input.charCodeAt(peg$currPos) === 94) {
764
+ s1 = peg$c2;
765
+ peg$currPos++;
766
+ } else {
767
+ s1 = peg$FAILED;
768
+ if (peg$silentFails === 0) { peg$fail(peg$e2); }
769
+ }
770
+ if (s1 !== peg$FAILED) {
771
+ s2 = peg$parsePatternSpec();
772
+ if (s2 !== peg$FAILED) {
773
+ if (input.charCodeAt(peg$currPos) === 58) {
774
+ s3 = peg$c1;
775
+ peg$currPos++;
776
+ } else {
777
+ s3 = peg$FAILED;
778
+ if (peg$silentFails === 0) { peg$fail(peg$e1); }
779
+ }
780
+ if (s3 !== peg$FAILED) {
781
+ s4 = peg$parseCommandList();
782
+ if (s4 !== peg$FAILED) {
783
+ peg$savedPos = s0;
784
+ s0 = peg$f3(s2, s4);
785
+ } else {
786
+ peg$currPos = s0;
787
+ s0 = peg$FAILED;
788
+ }
789
+ } else {
790
+ peg$currPos = s0;
791
+ s0 = peg$FAILED;
792
+ }
793
+ } else {
794
+ peg$currPos = s0;
795
+ s0 = peg$FAILED;
796
+ }
797
+ } else {
798
+ peg$currPos = s0;
799
+ s0 = peg$FAILED;
800
+ }
801
+
802
+ return s0;
803
+ }
804
+
805
+ function peg$parsePatternSpec() {
806
+ let s0, s1, s2, s3, s4, s5;
807
+
808
+ s0 = peg$currPos;
809
+ s1 = peg$parseSinglePattern();
810
+ if (s1 !== peg$FAILED) {
811
+ s2 = [];
812
+ s3 = peg$currPos;
813
+ if (input.charCodeAt(peg$currPos) === 59) {
814
+ s4 = peg$c3;
815
+ peg$currPos++;
816
+ } else {
817
+ s4 = peg$FAILED;
818
+ if (peg$silentFails === 0) { peg$fail(peg$e3); }
819
+ }
820
+ if (s4 !== peg$FAILED) {
821
+ s5 = peg$parseSinglePattern();
822
+ if (s5 !== peg$FAILED) {
823
+ s4 = [s4, s5];
824
+ s3 = s4;
825
+ } else {
826
+ peg$currPos = s3;
827
+ s3 = peg$FAILED;
828
+ }
829
+ } else {
830
+ peg$currPos = s3;
831
+ s3 = peg$FAILED;
832
+ }
833
+ while (s3 !== peg$FAILED) {
834
+ s2.push(s3);
835
+ s3 = peg$currPos;
836
+ if (input.charCodeAt(peg$currPos) === 59) {
837
+ s4 = peg$c3;
838
+ peg$currPos++;
839
+ } else {
840
+ s4 = peg$FAILED;
841
+ if (peg$silentFails === 0) { peg$fail(peg$e3); }
842
+ }
843
+ if (s4 !== peg$FAILED) {
844
+ s5 = peg$parseSinglePattern();
845
+ if (s5 !== peg$FAILED) {
846
+ s4 = [s4, s5];
847
+ s3 = s4;
848
+ } else {
849
+ peg$currPos = s3;
850
+ s3 = peg$FAILED;
851
+ }
852
+ } else {
853
+ peg$currPos = s3;
854
+ s3 = peg$FAILED;
855
+ }
856
+ }
857
+ peg$savedPos = s0;
858
+ s0 = peg$f4(s1, s2);
859
+ } else {
860
+ peg$currPos = s0;
861
+ s0 = peg$FAILED;
862
+ }
863
+
864
+ return s0;
865
+ }
866
+
867
+ function peg$parseSinglePattern() {
868
+ let s0, s1, s2;
869
+
870
+ s0 = peg$currPos;
871
+ s1 = [];
872
+ s2 = peg$parsePatternPiece();
873
+ if (s2 !== peg$FAILED) {
874
+ while (s2 !== peg$FAILED) {
875
+ s1.push(s2);
876
+ s2 = peg$parsePatternPiece();
877
+ }
878
+ } else {
879
+ s1 = peg$FAILED;
880
+ }
881
+ if (s1 !== peg$FAILED) {
882
+ peg$savedPos = s0;
883
+ s1 = peg$f5(s1);
884
+ }
885
+ s0 = s1;
886
+
887
+ return s0;
888
+ }
889
+
890
+ function peg$parsePatternPiece() {
891
+ let s0, s1, s2, s3;
892
+
893
+ s0 = peg$currPos;
894
+ if (input.charCodeAt(peg$currPos) === 42) {
895
+ s1 = peg$c4;
896
+ peg$currPos++;
897
+ } else {
898
+ s1 = peg$FAILED;
899
+ if (peg$silentFails === 0) { peg$fail(peg$e4); }
900
+ }
901
+ if (s1 !== peg$FAILED) {
902
+ peg$savedPos = s0;
903
+ s1 = peg$f6();
904
+ }
905
+ s0 = s1;
906
+ if (s0 === peg$FAILED) {
907
+ s0 = peg$currPos;
908
+ if (input.charCodeAt(peg$currPos) === 63) {
909
+ s1 = peg$c5;
910
+ peg$currPos++;
911
+ } else {
912
+ s1 = peg$FAILED;
913
+ if (peg$silentFails === 0) { peg$fail(peg$e5); }
914
+ }
915
+ if (s1 !== peg$FAILED) {
916
+ peg$savedPos = s0;
917
+ s1 = peg$f7();
918
+ }
919
+ s0 = s1;
920
+ if (s0 === peg$FAILED) {
921
+ s0 = peg$currPos;
922
+ if (input.charCodeAt(peg$currPos) === 92) {
923
+ s1 = peg$c6;
924
+ peg$currPos++;
925
+ } else {
926
+ s1 = peg$FAILED;
927
+ if (peg$silentFails === 0) { peg$fail(peg$e6); }
928
+ }
929
+ if (s1 !== peg$FAILED) {
930
+ if (input.length > peg$currPos) {
931
+ s2 = input.charAt(peg$currPos);
932
+ peg$currPos++;
933
+ } else {
934
+ s2 = peg$FAILED;
935
+ if (peg$silentFails === 0) { peg$fail(peg$e7); }
936
+ }
937
+ if (s2 !== peg$FAILED) {
938
+ peg$savedPos = s0;
939
+ s0 = peg$f8(s2);
940
+ } else {
941
+ peg$currPos = s0;
942
+ s0 = peg$FAILED;
943
+ }
944
+ } else {
945
+ peg$currPos = s0;
946
+ s0 = peg$FAILED;
947
+ }
948
+ if (s0 === peg$FAILED) {
949
+ s0 = peg$currPos;
950
+ s1 = peg$currPos;
951
+ s2 = [];
952
+ s3 = input.charAt(peg$currPos);
953
+ if (peg$r0.test(s3)) {
954
+ peg$currPos++;
955
+ } else {
956
+ s3 = peg$FAILED;
957
+ if (peg$silentFails === 0) { peg$fail(peg$e8); }
958
+ }
959
+ if (s3 !== peg$FAILED) {
960
+ while (s3 !== peg$FAILED) {
961
+ s2.push(s3);
962
+ s3 = input.charAt(peg$currPos);
963
+ if (peg$r0.test(s3)) {
964
+ peg$currPos++;
965
+ } else {
966
+ s3 = peg$FAILED;
967
+ if (peg$silentFails === 0) { peg$fail(peg$e8); }
968
+ }
969
+ }
970
+ } else {
971
+ s2 = peg$FAILED;
972
+ }
973
+ if (s2 !== peg$FAILED) {
974
+ s1 = input.substring(s1, peg$currPos);
975
+ } else {
976
+ s1 = s2;
977
+ }
978
+ if (s1 !== peg$FAILED) {
979
+ peg$savedPos = s0;
980
+ s1 = peg$f9(s1);
981
+ }
982
+ s0 = s1;
983
+ }
984
+ }
985
+ }
986
+
987
+ return s0;
988
+ }
989
+
990
+ function peg$parseCommandList() {
991
+ let s0, s1, s2, s3, s4, s5;
992
+
993
+ s0 = peg$currPos;
994
+ s1 = peg$parseCommand();
995
+ if (s1 !== peg$FAILED) {
996
+ s2 = [];
997
+ s3 = peg$currPos;
998
+ if (input.charCodeAt(peg$currPos) === 59) {
999
+ s4 = peg$c3;
1000
+ peg$currPos++;
1001
+ } else {
1002
+ s4 = peg$FAILED;
1003
+ if (peg$silentFails === 0) { peg$fail(peg$e3); }
1004
+ }
1005
+ if (s4 !== peg$FAILED) {
1006
+ s5 = peg$parseCommand();
1007
+ if (s5 !== peg$FAILED) {
1008
+ s4 = [s4, s5];
1009
+ s3 = s4;
1010
+ } else {
1011
+ peg$currPos = s3;
1012
+ s3 = peg$FAILED;
1013
+ }
1014
+ } else {
1015
+ peg$currPos = s3;
1016
+ s3 = peg$FAILED;
1017
+ }
1018
+ while (s3 !== peg$FAILED) {
1019
+ s2.push(s3);
1020
+ s3 = peg$currPos;
1021
+ if (input.charCodeAt(peg$currPos) === 59) {
1022
+ s4 = peg$c3;
1023
+ peg$currPos++;
1024
+ } else {
1025
+ s4 = peg$FAILED;
1026
+ if (peg$silentFails === 0) { peg$fail(peg$e3); }
1027
+ }
1028
+ if (s4 !== peg$FAILED) {
1029
+ s5 = peg$parseCommand();
1030
+ if (s5 !== peg$FAILED) {
1031
+ s4 = [s4, s5];
1032
+ s3 = s4;
1033
+ } else {
1034
+ peg$currPos = s3;
1035
+ s3 = peg$FAILED;
1036
+ }
1037
+ } else {
1038
+ peg$currPos = s3;
1039
+ s3 = peg$FAILED;
1040
+ }
1041
+ }
1042
+ peg$savedPos = s0;
1043
+ s0 = peg$f10(s1, s2);
1044
+ } else {
1045
+ peg$currPos = s0;
1046
+ s0 = peg$FAILED;
1047
+ }
1048
+
1049
+ return s0;
1050
+ }
1051
+
1052
+ function peg$parseCommand() {
1053
+ let s0;
1054
+
1055
+ s0 = peg$parseAtCommand();
1056
+ if (s0 === peg$FAILED) {
1057
+ s0 = peg$parseAttributeSet();
1058
+ if (s0 === peg$FAILED) {
1059
+ s0 = peg$parseUserCommand();
1060
+ }
1061
+ }
1062
+
1063
+ return s0;
1064
+ }
1065
+
1066
+ function peg$parseAtCommand() {
1067
+ let s0, s1, s2, s3, s4;
1068
+
1069
+ s0 = peg$currPos;
1070
+ if (input.charCodeAt(peg$currPos) === 64) {
1071
+ s1 = peg$c7;
1072
+ peg$currPos++;
1073
+ } else {
1074
+ s1 = peg$FAILED;
1075
+ if (peg$silentFails === 0) { peg$fail(peg$e9); }
1076
+ }
1077
+ if (s1 !== peg$FAILED) {
1078
+ s2 = peg$parseAtCmdName();
1079
+ if (s2 !== peg$FAILED) {
1080
+ s3 = [];
1081
+ s4 = peg$parseAtSwitch();
1082
+ while (s4 !== peg$FAILED) {
1083
+ s3.push(s4);
1084
+ s4 = peg$parseAtSwitch();
1085
+ }
1086
+ s4 = peg$parseAtCmdBody();
1087
+ if (s4 === peg$FAILED) {
1088
+ s4 = null;
1089
+ }
1090
+ peg$savedPos = s0;
1091
+ s0 = peg$f11(s2, s3, s4);
1092
+ } else {
1093
+ peg$currPos = s0;
1094
+ s0 = peg$FAILED;
1095
+ }
1096
+ } else {
1097
+ peg$currPos = s0;
1098
+ s0 = peg$FAILED;
1099
+ }
1100
+
1101
+ return s0;
1102
+ }
1103
+
1104
+ function peg$parseAtCmdName() {
1105
+ let s0, s1, s2, s3, s4;
1106
+
1107
+ s0 = peg$currPos;
1108
+ s1 = peg$currPos;
1109
+ s2 = input.charAt(peg$currPos);
1110
+ if (peg$r1.test(s2)) {
1111
+ peg$currPos++;
1112
+ } else {
1113
+ s2 = peg$FAILED;
1114
+ if (peg$silentFails === 0) { peg$fail(peg$e10); }
1115
+ }
1116
+ if (s2 !== peg$FAILED) {
1117
+ s3 = [];
1118
+ s4 = input.charAt(peg$currPos);
1119
+ if (peg$r2.test(s4)) {
1120
+ peg$currPos++;
1121
+ } else {
1122
+ s4 = peg$FAILED;
1123
+ if (peg$silentFails === 0) { peg$fail(peg$e11); }
1124
+ }
1125
+ while (s4 !== peg$FAILED) {
1126
+ s3.push(s4);
1127
+ s4 = input.charAt(peg$currPos);
1128
+ if (peg$r2.test(s4)) {
1129
+ peg$currPos++;
1130
+ } else {
1131
+ s4 = peg$FAILED;
1132
+ if (peg$silentFails === 0) { peg$fail(peg$e11); }
1133
+ }
1134
+ }
1135
+ s2 = [s2, s3];
1136
+ s1 = s2;
1137
+ } else {
1138
+ peg$currPos = s1;
1139
+ s1 = peg$FAILED;
1140
+ }
1141
+ if (s1 !== peg$FAILED) {
1142
+ s0 = input.substring(s0, peg$currPos);
1143
+ } else {
1144
+ s0 = s1;
1145
+ }
1146
+
1147
+ return s0;
1148
+ }
1149
+
1150
+ function peg$parseAtSwitch() {
1151
+ let s0, s1, s2, s3, s4, s5, s6;
1152
+
1153
+ s0 = peg$currPos;
1154
+ if (input.charCodeAt(peg$currPos) === 47) {
1155
+ s1 = peg$c8;
1156
+ peg$currPos++;
1157
+ } else {
1158
+ s1 = peg$FAILED;
1159
+ if (peg$silentFails === 0) { peg$fail(peg$e12); }
1160
+ }
1161
+ if (s1 !== peg$FAILED) {
1162
+ s2 = peg$currPos;
1163
+ s3 = peg$currPos;
1164
+ s4 = input.charAt(peg$currPos);
1165
+ if (peg$r1.test(s4)) {
1166
+ peg$currPos++;
1167
+ } else {
1168
+ s4 = peg$FAILED;
1169
+ if (peg$silentFails === 0) { peg$fail(peg$e10); }
1170
+ }
1171
+ if (s4 !== peg$FAILED) {
1172
+ s5 = [];
1173
+ s6 = input.charAt(peg$currPos);
1174
+ if (peg$r2.test(s6)) {
1175
+ peg$currPos++;
1176
+ } else {
1177
+ s6 = peg$FAILED;
1178
+ if (peg$silentFails === 0) { peg$fail(peg$e11); }
1179
+ }
1180
+ while (s6 !== peg$FAILED) {
1181
+ s5.push(s6);
1182
+ s6 = input.charAt(peg$currPos);
1183
+ if (peg$r2.test(s6)) {
1184
+ peg$currPos++;
1185
+ } else {
1186
+ s6 = peg$FAILED;
1187
+ if (peg$silentFails === 0) { peg$fail(peg$e11); }
1188
+ }
1189
+ }
1190
+ s4 = [s4, s5];
1191
+ s3 = s4;
1192
+ } else {
1193
+ peg$currPos = s3;
1194
+ s3 = peg$FAILED;
1195
+ }
1196
+ if (s3 !== peg$FAILED) {
1197
+ s2 = input.substring(s2, peg$currPos);
1198
+ } else {
1199
+ s2 = s3;
1200
+ }
1201
+ if (s2 !== peg$FAILED) {
1202
+ peg$savedPos = s0;
1203
+ s0 = peg$f12(s2);
1204
+ } else {
1205
+ peg$currPos = s0;
1206
+ s0 = peg$FAILED;
1207
+ }
1208
+ } else {
1209
+ peg$currPos = s0;
1210
+ s0 = peg$FAILED;
1211
+ }
1212
+
1213
+ return s0;
1214
+ }
1215
+
1216
+ function peg$parseAtCmdBody() {
1217
+ let s0, s1, s2, s3, s4;
1218
+
1219
+ s0 = peg$currPos;
1220
+ s1 = peg$parse_();
1221
+ s2 = peg$parseObjText();
1222
+ if (s2 !== peg$FAILED) {
1223
+ if (input.charCodeAt(peg$currPos) === 61) {
1224
+ s3 = peg$c9;
1225
+ peg$currPos++;
1226
+ } else {
1227
+ s3 = peg$FAILED;
1228
+ if (peg$silentFails === 0) { peg$fail(peg$e13); }
1229
+ }
1230
+ if (s3 !== peg$FAILED) {
1231
+ s4 = peg$parseAtCmdValue();
1232
+ if (s4 !== peg$FAILED) {
1233
+ peg$savedPos = s0;
1234
+ s0 = peg$f13(s2, s4);
1235
+ } else {
1236
+ peg$currPos = s0;
1237
+ s0 = peg$FAILED;
1238
+ }
1239
+ } else {
1240
+ peg$currPos = s0;
1241
+ s0 = peg$FAILED;
1242
+ }
1243
+ } else {
1244
+ peg$currPos = s0;
1245
+ s0 = peg$FAILED;
1246
+ }
1247
+ if (s0 === peg$FAILED) {
1248
+ s0 = peg$currPos;
1249
+ s1 = peg$parse_();
1250
+ s2 = peg$parseObjText();
1251
+ if (s2 !== peg$FAILED) {
1252
+ peg$savedPos = s0;
1253
+ s0 = peg$f14(s2);
1254
+ } else {
1255
+ peg$currPos = s0;
1256
+ s0 = peg$FAILED;
1257
+ }
1258
+ }
1259
+
1260
+ return s0;
1261
+ }
1262
+
1263
+ function peg$parseAttributeSet() {
1264
+ let s0, s1, s2, s3, s4, s5, s6;
1265
+
1266
+ s0 = peg$currPos;
1267
+ if (input.charCodeAt(peg$currPos) === 38) {
1268
+ s1 = peg$c10;
1269
+ peg$currPos++;
1270
+ } else {
1271
+ s1 = peg$FAILED;
1272
+ if (peg$silentFails === 0) { peg$fail(peg$e14); }
1273
+ }
1274
+ if (s1 !== peg$FAILED) {
1275
+ s2 = peg$parseAttrIdent();
1276
+ if (s2 !== peg$FAILED) {
1277
+ s3 = peg$parse_();
1278
+ s4 = peg$parseObjText();
1279
+ if (s4 !== peg$FAILED) {
1280
+ if (input.charCodeAt(peg$currPos) === 61) {
1281
+ s5 = peg$c9;
1282
+ peg$currPos++;
1283
+ } else {
1284
+ s5 = peg$FAILED;
1285
+ if (peg$silentFails === 0) { peg$fail(peg$e13); }
1286
+ }
1287
+ if (s5 !== peg$FAILED) {
1288
+ s6 = peg$parseAtCmdValue();
1289
+ if (s6 !== peg$FAILED) {
1290
+ peg$savedPos = s0;
1291
+ s0 = peg$f15(s2, s4, s6);
1292
+ } else {
1293
+ peg$currPos = s0;
1294
+ s0 = peg$FAILED;
1295
+ }
1296
+ } else {
1297
+ peg$currPos = s0;
1298
+ s0 = peg$FAILED;
1299
+ }
1300
+ } else {
1301
+ peg$currPos = s0;
1302
+ s0 = peg$FAILED;
1303
+ }
1304
+ } else {
1305
+ peg$currPos = s0;
1306
+ s0 = peg$FAILED;
1307
+ }
1308
+ } else {
1309
+ peg$currPos = s0;
1310
+ s0 = peg$FAILED;
1311
+ }
1312
+ if (s0 === peg$FAILED) {
1313
+ s0 = peg$currPos;
1314
+ if (input.charCodeAt(peg$currPos) === 38) {
1315
+ s1 = peg$c10;
1316
+ peg$currPos++;
1317
+ } else {
1318
+ s1 = peg$FAILED;
1319
+ if (peg$silentFails === 0) { peg$fail(peg$e14); }
1320
+ }
1321
+ if (s1 !== peg$FAILED) {
1322
+ s2 = peg$parseAttrIdent();
1323
+ if (s2 !== peg$FAILED) {
1324
+ s3 = peg$parse_();
1325
+ s4 = peg$parseObjText();
1326
+ if (s4 !== peg$FAILED) {
1327
+ peg$savedPos = s0;
1328
+ s0 = peg$f16(s2, s4);
1329
+ } else {
1330
+ peg$currPos = s0;
1331
+ s0 = peg$FAILED;
1332
+ }
1333
+ } else {
1334
+ peg$currPos = s0;
1335
+ s0 = peg$FAILED;
1336
+ }
1337
+ } else {
1338
+ peg$currPos = s0;
1339
+ s0 = peg$FAILED;
1340
+ }
1341
+ }
1342
+
1343
+ return s0;
1344
+ }
1345
+
1346
+ function peg$parseAttrIdent() {
1347
+ let s0, s1, s2, s3, s4;
1348
+
1349
+ s0 = peg$currPos;
1350
+ s1 = peg$currPos;
1351
+ s2 = input.charAt(peg$currPos);
1352
+ if (peg$r3.test(s2)) {
1353
+ peg$currPos++;
1354
+ } else {
1355
+ s2 = peg$FAILED;
1356
+ if (peg$silentFails === 0) { peg$fail(peg$e15); }
1357
+ }
1358
+ if (s2 !== peg$FAILED) {
1359
+ s3 = [];
1360
+ s4 = input.charAt(peg$currPos);
1361
+ if (peg$r2.test(s4)) {
1362
+ peg$currPos++;
1363
+ } else {
1364
+ s4 = peg$FAILED;
1365
+ if (peg$silentFails === 0) { peg$fail(peg$e11); }
1366
+ }
1367
+ while (s4 !== peg$FAILED) {
1368
+ s3.push(s4);
1369
+ s4 = input.charAt(peg$currPos);
1370
+ if (peg$r2.test(s4)) {
1371
+ peg$currPos++;
1372
+ } else {
1373
+ s4 = peg$FAILED;
1374
+ if (peg$silentFails === 0) { peg$fail(peg$e11); }
1375
+ }
1376
+ }
1377
+ s2 = [s2, s3];
1378
+ s1 = s2;
1379
+ } else {
1380
+ peg$currPos = s1;
1381
+ s1 = peg$FAILED;
1382
+ }
1383
+ if (s1 !== peg$FAILED) {
1384
+ s0 = input.substring(s0, peg$currPos);
1385
+ } else {
1386
+ s0 = s1;
1387
+ }
1388
+
1389
+ return s0;
1390
+ }
1391
+
1392
+ function peg$parseUserCommand() {
1393
+ let s0, s1, s2;
1394
+
1395
+ s0 = peg$currPos;
1396
+ s1 = [];
1397
+ s2 = peg$parseCmdToken();
1398
+ while (s2 !== peg$FAILED) {
1399
+ s1.push(s2);
1400
+ s2 = peg$parseCmdToken();
1401
+ }
1402
+ peg$savedPos = s0;
1403
+ s1 = peg$f17(s1);
1404
+ s0 = s1;
1405
+
1406
+ return s0;
1407
+ }
1408
+
1409
+ function peg$parseObjText() {
1410
+ let s0, s1, s2;
1411
+
1412
+ s0 = peg$currPos;
1413
+ s1 = [];
1414
+ s2 = peg$parseObjToken();
1415
+ if (s2 !== peg$FAILED) {
1416
+ while (s2 !== peg$FAILED) {
1417
+ s1.push(s2);
1418
+ s2 = peg$parseObjToken();
1419
+ }
1420
+ } else {
1421
+ s1 = peg$FAILED;
1422
+ }
1423
+ if (s1 !== peg$FAILED) {
1424
+ peg$savedPos = s0;
1425
+ s1 = peg$f18(s1);
1426
+ }
1427
+ s0 = s1;
1428
+
1429
+ return s0;
1430
+ }
1431
+
1432
+ function peg$parseObjToken() {
1433
+ let s0;
1434
+
1435
+ s0 = peg$parseEvalBlock();
1436
+ if (s0 === peg$FAILED) {
1437
+ s0 = peg$parseBracedString();
1438
+ if (s0 === peg$FAILED) {
1439
+ s0 = peg$parseSubstitution();
1440
+ if (s0 === peg$FAILED) {
1441
+ s0 = peg$parseSpecialVar();
1442
+ if (s0 === peg$FAILED) {
1443
+ s0 = peg$parseTagRef();
1444
+ if (s0 === peg$FAILED) {
1445
+ s0 = peg$parseEscape();
1446
+ if (s0 === peg$FAILED) {
1447
+ s0 = peg$parseObjLiteralChars();
1448
+ }
1449
+ }
1450
+ }
1451
+ }
1452
+ }
1453
+ }
1454
+
1455
+ return s0;
1456
+ }
1457
+
1458
+ function peg$parseObjLiteralChars() {
1459
+ let s0, s1, s2, s3;
1460
+
1461
+ s0 = peg$currPos;
1462
+ s1 = peg$currPos;
1463
+ s2 = [];
1464
+ s3 = input.charAt(peg$currPos);
1465
+ if (peg$r4.test(s3)) {
1466
+ peg$currPos++;
1467
+ } else {
1468
+ s3 = peg$FAILED;
1469
+ if (peg$silentFails === 0) { peg$fail(peg$e16); }
1470
+ }
1471
+ if (s3 !== peg$FAILED) {
1472
+ while (s3 !== peg$FAILED) {
1473
+ s2.push(s3);
1474
+ s3 = input.charAt(peg$currPos);
1475
+ if (peg$r4.test(s3)) {
1476
+ peg$currPos++;
1477
+ } else {
1478
+ s3 = peg$FAILED;
1479
+ if (peg$silentFails === 0) { peg$fail(peg$e16); }
1480
+ }
1481
+ }
1482
+ } else {
1483
+ s2 = peg$FAILED;
1484
+ }
1485
+ if (s2 !== peg$FAILED) {
1486
+ s1 = input.substring(s1, peg$currPos);
1487
+ } else {
1488
+ s1 = s2;
1489
+ }
1490
+ if (s1 !== peg$FAILED) {
1491
+ peg$savedPos = s0;
1492
+ s1 = peg$f19(s1);
1493
+ }
1494
+ s0 = s1;
1495
+ if (s0 === peg$FAILED) {
1496
+ s0 = peg$currPos;
1497
+ if (input.charCodeAt(peg$currPos) === 35) {
1498
+ s1 = peg$c11;
1499
+ peg$currPos++;
1500
+ } else {
1501
+ s1 = peg$FAILED;
1502
+ if (peg$silentFails === 0) { peg$fail(peg$e17); }
1503
+ }
1504
+ if (s1 !== peg$FAILED) {
1505
+ s2 = peg$currPos;
1506
+ peg$silentFails++;
1507
+ s3 = input.charAt(peg$currPos);
1508
+ if (peg$r5.test(s3)) {
1509
+ peg$currPos++;
1510
+ } else {
1511
+ s3 = peg$FAILED;
1512
+ if (peg$silentFails === 0) { peg$fail(peg$e18); }
1513
+ }
1514
+ peg$silentFails--;
1515
+ if (s3 === peg$FAILED) {
1516
+ s2 = undefined;
1517
+ } else {
1518
+ peg$currPos = s2;
1519
+ s2 = peg$FAILED;
1520
+ }
1521
+ if (s2 !== peg$FAILED) {
1522
+ peg$savedPos = s0;
1523
+ s0 = peg$f20();
1524
+ } else {
1525
+ peg$currPos = s0;
1526
+ s0 = peg$FAILED;
1527
+ }
1528
+ } else {
1529
+ peg$currPos = s0;
1530
+ s0 = peg$FAILED;
1531
+ }
1532
+ }
1533
+
1534
+ return s0;
1535
+ }
1536
+
1537
+ function peg$parseCmdToken() {
1538
+ let s0;
1539
+
1540
+ s0 = peg$parseEvalBlock();
1541
+ if (s0 === peg$FAILED) {
1542
+ s0 = peg$parseBracedString();
1543
+ if (s0 === peg$FAILED) {
1544
+ s0 = peg$parseSubstitution();
1545
+ if (s0 === peg$FAILED) {
1546
+ s0 = peg$parseSpecialVar();
1547
+ if (s0 === peg$FAILED) {
1548
+ s0 = peg$parseTagRef();
1549
+ if (s0 === peg$FAILED) {
1550
+ s0 = peg$parseEscape();
1551
+ if (s0 === peg$FAILED) {
1552
+ s0 = peg$parseCmdLiteralChars();
1553
+ }
1554
+ }
1555
+ }
1556
+ }
1557
+ }
1558
+ }
1559
+
1560
+ return s0;
1561
+ }
1562
+
1563
+ function peg$parseCmdLiteralChars() {
1564
+ let s0, s1, s2, s3;
1565
+
1566
+ s0 = peg$currPos;
1567
+ s1 = peg$currPos;
1568
+ s2 = [];
1569
+ s3 = input.charAt(peg$currPos);
1570
+ if (peg$r6.test(s3)) {
1571
+ peg$currPos++;
1572
+ } else {
1573
+ s3 = peg$FAILED;
1574
+ if (peg$silentFails === 0) { peg$fail(peg$e19); }
1575
+ }
1576
+ if (s3 !== peg$FAILED) {
1577
+ while (s3 !== peg$FAILED) {
1578
+ s2.push(s3);
1579
+ s3 = input.charAt(peg$currPos);
1580
+ if (peg$r6.test(s3)) {
1581
+ peg$currPos++;
1582
+ } else {
1583
+ s3 = peg$FAILED;
1584
+ if (peg$silentFails === 0) { peg$fail(peg$e19); }
1585
+ }
1586
+ }
1587
+ } else {
1588
+ s2 = peg$FAILED;
1589
+ }
1590
+ if (s2 !== peg$FAILED) {
1591
+ s1 = input.substring(s1, peg$currPos);
1592
+ } else {
1593
+ s1 = s2;
1594
+ }
1595
+ if (s1 !== peg$FAILED) {
1596
+ peg$savedPos = s0;
1597
+ s1 = peg$f21(s1);
1598
+ }
1599
+ s0 = s1;
1600
+ if (s0 === peg$FAILED) {
1601
+ s0 = peg$currPos;
1602
+ if (input.charCodeAt(peg$currPos) === 35) {
1603
+ s1 = peg$c11;
1604
+ peg$currPos++;
1605
+ } else {
1606
+ s1 = peg$FAILED;
1607
+ if (peg$silentFails === 0) { peg$fail(peg$e17); }
1608
+ }
1609
+ if (s1 !== peg$FAILED) {
1610
+ s2 = peg$currPos;
1611
+ peg$silentFails++;
1612
+ s3 = input.charAt(peg$currPos);
1613
+ if (peg$r5.test(s3)) {
1614
+ peg$currPos++;
1615
+ } else {
1616
+ s3 = peg$FAILED;
1617
+ if (peg$silentFails === 0) { peg$fail(peg$e18); }
1618
+ }
1619
+ peg$silentFails--;
1620
+ if (s3 === peg$FAILED) {
1621
+ s2 = undefined;
1622
+ } else {
1623
+ peg$currPos = s2;
1624
+ s2 = peg$FAILED;
1625
+ }
1626
+ if (s2 !== peg$FAILED) {
1627
+ peg$savedPos = s0;
1628
+ s0 = peg$f22();
1629
+ } else {
1630
+ peg$currPos = s0;
1631
+ s0 = peg$FAILED;
1632
+ }
1633
+ } else {
1634
+ peg$currPos = s0;
1635
+ s0 = peg$FAILED;
1636
+ }
1637
+ }
1638
+
1639
+ return s0;
1640
+ }
1641
+
1642
+ function peg$parseBracedString() {
1643
+ let s0, s1, s2, s3;
1644
+
1645
+ s0 = peg$currPos;
1646
+ if (input.charCodeAt(peg$currPos) === 123) {
1647
+ s1 = peg$c12;
1648
+ peg$currPos++;
1649
+ } else {
1650
+ s1 = peg$FAILED;
1651
+ if (peg$silentFails === 0) { peg$fail(peg$e20); }
1652
+ }
1653
+ if (s1 !== peg$FAILED) {
1654
+ s2 = [];
1655
+ s3 = peg$parseBracedToken();
1656
+ while (s3 !== peg$FAILED) {
1657
+ s2.push(s3);
1658
+ s3 = peg$parseBracedToken();
1659
+ }
1660
+ if (input.charCodeAt(peg$currPos) === 125) {
1661
+ s3 = peg$c13;
1662
+ peg$currPos++;
1663
+ } else {
1664
+ s3 = peg$FAILED;
1665
+ if (peg$silentFails === 0) { peg$fail(peg$e21); }
1666
+ }
1667
+ if (s3 !== peg$FAILED) {
1668
+ peg$savedPos = s0;
1669
+ s0 = peg$f23(s2);
1670
+ } else {
1671
+ peg$currPos = s0;
1672
+ s0 = peg$FAILED;
1673
+ }
1674
+ } else {
1675
+ peg$currPos = s0;
1676
+ s0 = peg$FAILED;
1677
+ }
1678
+
1679
+ return s0;
1680
+ }
1681
+
1682
+ function peg$parseBracedToken() {
1683
+ let s0;
1684
+
1685
+ s0 = peg$parseBracedString();
1686
+ if (s0 === peg$FAILED) {
1687
+ s0 = peg$parseEvalBlock();
1688
+ if (s0 === peg$FAILED) {
1689
+ s0 = peg$parseSubstitution();
1690
+ if (s0 === peg$FAILED) {
1691
+ s0 = peg$parseSpecialVar();
1692
+ if (s0 === peg$FAILED) {
1693
+ s0 = peg$parseTagRef();
1694
+ if (s0 === peg$FAILED) {
1695
+ s0 = peg$parseEscape();
1696
+ if (s0 === peg$FAILED) {
1697
+ s0 = peg$parseBracedLiteralChars();
1698
+ }
1699
+ }
1700
+ }
1701
+ }
1702
+ }
1703
+ }
1704
+
1705
+ return s0;
1706
+ }
1707
+
1708
+ function peg$parseBracedLiteralChars() {
1709
+ let s0, s1, s2, s3;
1710
+
1711
+ s0 = peg$currPos;
1712
+ s1 = peg$currPos;
1713
+ s2 = [];
1714
+ s3 = input.charAt(peg$currPos);
1715
+ if (peg$r7.test(s3)) {
1716
+ peg$currPos++;
1717
+ } else {
1718
+ s3 = peg$FAILED;
1719
+ if (peg$silentFails === 0) { peg$fail(peg$e22); }
1720
+ }
1721
+ if (s3 !== peg$FAILED) {
1722
+ while (s3 !== peg$FAILED) {
1723
+ s2.push(s3);
1724
+ s3 = input.charAt(peg$currPos);
1725
+ if (peg$r7.test(s3)) {
1726
+ peg$currPos++;
1727
+ } else {
1728
+ s3 = peg$FAILED;
1729
+ if (peg$silentFails === 0) { peg$fail(peg$e22); }
1730
+ }
1731
+ }
1732
+ } else {
1733
+ s2 = peg$FAILED;
1734
+ }
1735
+ if (s2 !== peg$FAILED) {
1736
+ s1 = input.substring(s1, peg$currPos);
1737
+ } else {
1738
+ s1 = s2;
1739
+ }
1740
+ if (s1 !== peg$FAILED) {
1741
+ peg$savedPos = s0;
1742
+ s1 = peg$f24(s1);
1743
+ }
1744
+ s0 = s1;
1745
+ if (s0 === peg$FAILED) {
1746
+ s0 = peg$currPos;
1747
+ if (input.charCodeAt(peg$currPos) === 35) {
1748
+ s1 = peg$c11;
1749
+ peg$currPos++;
1750
+ } else {
1751
+ s1 = peg$FAILED;
1752
+ if (peg$silentFails === 0) { peg$fail(peg$e17); }
1753
+ }
1754
+ if (s1 !== peg$FAILED) {
1755
+ s2 = peg$currPos;
1756
+ peg$silentFails++;
1757
+ s3 = input.charAt(peg$currPos);
1758
+ if (peg$r5.test(s3)) {
1759
+ peg$currPos++;
1760
+ } else {
1761
+ s3 = peg$FAILED;
1762
+ if (peg$silentFails === 0) { peg$fail(peg$e18); }
1763
+ }
1764
+ peg$silentFails--;
1765
+ if (s3 === peg$FAILED) {
1766
+ s2 = undefined;
1767
+ } else {
1768
+ peg$currPos = s2;
1769
+ s2 = peg$FAILED;
1770
+ }
1771
+ if (s2 !== peg$FAILED) {
1772
+ peg$savedPos = s0;
1773
+ s0 = peg$f25();
1774
+ } else {
1775
+ peg$currPos = s0;
1776
+ s0 = peg$FAILED;
1777
+ }
1778
+ } else {
1779
+ peg$currPos = s0;
1780
+ s0 = peg$FAILED;
1781
+ }
1782
+ }
1783
+
1784
+ return s0;
1785
+ }
1786
+
1787
+ function peg$parseEvalBlock() {
1788
+ let s0, s1, s2, s3;
1789
+
1790
+ s0 = peg$currPos;
1791
+ if (input.charCodeAt(peg$currPos) === 91) {
1792
+ s1 = peg$c14;
1793
+ peg$currPos++;
1794
+ } else {
1795
+ s1 = peg$FAILED;
1796
+ if (peg$silentFails === 0) { peg$fail(peg$e23); }
1797
+ }
1798
+ if (s1 !== peg$FAILED) {
1799
+ s2 = [];
1800
+ s3 = peg$parseEvalToken();
1801
+ while (s3 !== peg$FAILED) {
1802
+ s2.push(s3);
1803
+ s3 = peg$parseEvalToken();
1804
+ }
1805
+ if (input.charCodeAt(peg$currPos) === 93) {
1806
+ s3 = peg$c15;
1807
+ peg$currPos++;
1808
+ } else {
1809
+ s3 = peg$FAILED;
1810
+ if (peg$silentFails === 0) { peg$fail(peg$e24); }
1811
+ }
1812
+ if (s3 !== peg$FAILED) {
1813
+ peg$savedPos = s0;
1814
+ s0 = peg$f26(s2);
1815
+ } else {
1816
+ peg$currPos = s0;
1817
+ s0 = peg$FAILED;
1818
+ }
1819
+ } else {
1820
+ peg$currPos = s0;
1821
+ s0 = peg$FAILED;
1822
+ }
1823
+
1824
+ return s0;
1825
+ }
1826
+
1827
+ function peg$parseEvalToken() {
1828
+ let s0;
1829
+
1830
+ s0 = peg$parseFunctionCall();
1831
+ if (s0 === peg$FAILED) {
1832
+ s0 = peg$parseEvalBlock();
1833
+ if (s0 === peg$FAILED) {
1834
+ s0 = peg$parseBracedString();
1835
+ if (s0 === peg$FAILED) {
1836
+ s0 = peg$parseSubstitution();
1837
+ if (s0 === peg$FAILED) {
1838
+ s0 = peg$parseSpecialVar();
1839
+ if (s0 === peg$FAILED) {
1840
+ s0 = peg$parseTagRef();
1841
+ if (s0 === peg$FAILED) {
1842
+ s0 = peg$parseEscape();
1843
+ if (s0 === peg$FAILED) {
1844
+ s0 = peg$parseEvalLiteralChars();
1845
+ }
1846
+ }
1847
+ }
1848
+ }
1849
+ }
1850
+ }
1851
+ }
1852
+
1853
+ return s0;
1854
+ }
1855
+
1856
+ function peg$parseEvalLiteralChars() {
1857
+ let s0, s1, s2, s3;
1858
+
1859
+ s0 = peg$currPos;
1860
+ s1 = peg$currPos;
1861
+ s2 = [];
1862
+ s3 = input.charAt(peg$currPos);
1863
+ if (peg$r8.test(s3)) {
1864
+ peg$currPos++;
1865
+ } else {
1866
+ s3 = peg$FAILED;
1867
+ if (peg$silentFails === 0) { peg$fail(peg$e25); }
1868
+ }
1869
+ if (s3 !== peg$FAILED) {
1870
+ while (s3 !== peg$FAILED) {
1871
+ s2.push(s3);
1872
+ s3 = input.charAt(peg$currPos);
1873
+ if (peg$r8.test(s3)) {
1874
+ peg$currPos++;
1875
+ } else {
1876
+ s3 = peg$FAILED;
1877
+ if (peg$silentFails === 0) { peg$fail(peg$e25); }
1878
+ }
1879
+ }
1880
+ } else {
1881
+ s2 = peg$FAILED;
1882
+ }
1883
+ if (s2 !== peg$FAILED) {
1884
+ s1 = input.substring(s1, peg$currPos);
1885
+ } else {
1886
+ s1 = s2;
1887
+ }
1888
+ if (s1 !== peg$FAILED) {
1889
+ peg$savedPos = s0;
1890
+ s1 = peg$f27(s1);
1891
+ }
1892
+ s0 = s1;
1893
+ if (s0 === peg$FAILED) {
1894
+ s0 = peg$currPos;
1895
+ if (input.charCodeAt(peg$currPos) === 35) {
1896
+ s1 = peg$c11;
1897
+ peg$currPos++;
1898
+ } else {
1899
+ s1 = peg$FAILED;
1900
+ if (peg$silentFails === 0) { peg$fail(peg$e17); }
1901
+ }
1902
+ if (s1 !== peg$FAILED) {
1903
+ s2 = peg$currPos;
1904
+ peg$silentFails++;
1905
+ s3 = input.charAt(peg$currPos);
1906
+ if (peg$r5.test(s3)) {
1907
+ peg$currPos++;
1908
+ } else {
1909
+ s3 = peg$FAILED;
1910
+ if (peg$silentFails === 0) { peg$fail(peg$e18); }
1911
+ }
1912
+ peg$silentFails--;
1913
+ if (s3 === peg$FAILED) {
1914
+ s2 = undefined;
1915
+ } else {
1916
+ peg$currPos = s2;
1917
+ s2 = peg$FAILED;
1918
+ }
1919
+ if (s2 !== peg$FAILED) {
1920
+ peg$savedPos = s0;
1921
+ s0 = peg$f28();
1922
+ } else {
1923
+ peg$currPos = s0;
1924
+ s0 = peg$FAILED;
1925
+ }
1926
+ } else {
1927
+ peg$currPos = s0;
1928
+ s0 = peg$FAILED;
1929
+ }
1930
+ }
1931
+
1932
+ return s0;
1933
+ }
1934
+
1935
+ function peg$parseFunctionCall() {
1936
+ let s0, s1, s2, s3, s4;
1937
+
1938
+ s0 = peg$currPos;
1939
+ s1 = peg$parseFuncIdent();
1940
+ if (s1 !== peg$FAILED) {
1941
+ if (input.substr(peg$currPos, 2) === peg$c16) {
1942
+ s2 = peg$c16;
1943
+ peg$currPos += 2;
1944
+ } else {
1945
+ s2 = peg$FAILED;
1946
+ if (peg$silentFails === 0) { peg$fail(peg$e26); }
1947
+ }
1948
+ if (s2 !== peg$FAILED) {
1949
+ peg$savedPos = s0;
1950
+ s0 = peg$f29(s1);
1951
+ } else {
1952
+ peg$currPos = s0;
1953
+ s0 = peg$FAILED;
1954
+ }
1955
+ } else {
1956
+ peg$currPos = s0;
1957
+ s0 = peg$FAILED;
1958
+ }
1959
+ if (s0 === peg$FAILED) {
1960
+ s0 = peg$currPos;
1961
+ s1 = peg$parseFuncIdent();
1962
+ if (s1 !== peg$FAILED) {
1963
+ if (input.charCodeAt(peg$currPos) === 40) {
1964
+ s2 = peg$c17;
1965
+ peg$currPos++;
1966
+ } else {
1967
+ s2 = peg$FAILED;
1968
+ if (peg$silentFails === 0) { peg$fail(peg$e27); }
1969
+ }
1970
+ if (s2 !== peg$FAILED) {
1971
+ s3 = peg$parseArgList();
1972
+ if (input.charCodeAt(peg$currPos) === 41) {
1973
+ s4 = peg$c18;
1974
+ peg$currPos++;
1975
+ } else {
1976
+ s4 = peg$FAILED;
1977
+ if (peg$silentFails === 0) { peg$fail(peg$e28); }
1978
+ }
1979
+ if (s4 !== peg$FAILED) {
1980
+ peg$savedPos = s0;
1981
+ s0 = peg$f30(s1, s3);
1982
+ } else {
1983
+ peg$currPos = s0;
1984
+ s0 = peg$FAILED;
1985
+ }
1986
+ } else {
1987
+ peg$currPos = s0;
1988
+ s0 = peg$FAILED;
1989
+ }
1990
+ } else {
1991
+ peg$currPos = s0;
1992
+ s0 = peg$FAILED;
1993
+ }
1994
+ }
1995
+
1996
+ return s0;
1997
+ }
1998
+
1999
+ function peg$parseFuncIdent() {
2000
+ let s0, s1, s2, s3, s4;
2001
+
2002
+ s0 = peg$currPos;
2003
+ s1 = peg$currPos;
2004
+ s2 = input.charAt(peg$currPos);
2005
+ if (peg$r3.test(s2)) {
2006
+ peg$currPos++;
2007
+ } else {
2008
+ s2 = peg$FAILED;
2009
+ if (peg$silentFails === 0) { peg$fail(peg$e15); }
2010
+ }
2011
+ if (s2 !== peg$FAILED) {
2012
+ s3 = [];
2013
+ s4 = input.charAt(peg$currPos);
2014
+ if (peg$r9.test(s4)) {
2015
+ peg$currPos++;
2016
+ } else {
2017
+ s4 = peg$FAILED;
2018
+ if (peg$silentFails === 0) { peg$fail(peg$e29); }
2019
+ }
2020
+ while (s4 !== peg$FAILED) {
2021
+ s3.push(s4);
2022
+ s4 = input.charAt(peg$currPos);
2023
+ if (peg$r9.test(s4)) {
2024
+ peg$currPos++;
2025
+ } else {
2026
+ s4 = peg$FAILED;
2027
+ if (peg$silentFails === 0) { peg$fail(peg$e29); }
2028
+ }
2029
+ }
2030
+ s2 = [s2, s3];
2031
+ s1 = s2;
2032
+ } else {
2033
+ peg$currPos = s1;
2034
+ s1 = peg$FAILED;
2035
+ }
2036
+ if (s1 !== peg$FAILED) {
2037
+ s0 = input.substring(s0, peg$currPos);
2038
+ } else {
2039
+ s0 = s1;
2040
+ }
2041
+
2042
+ return s0;
2043
+ }
2044
+
2045
+ function peg$parseArgList() {
2046
+ let s0, s1, s2, s3, s4, s5;
2047
+
2048
+ s0 = peg$currPos;
2049
+ s1 = peg$parseFuncArg();
2050
+ s2 = [];
2051
+ s3 = peg$currPos;
2052
+ if (input.charCodeAt(peg$currPos) === 44) {
2053
+ s4 = peg$c19;
2054
+ peg$currPos++;
2055
+ } else {
2056
+ s4 = peg$FAILED;
2057
+ if (peg$silentFails === 0) { peg$fail(peg$e30); }
2058
+ }
2059
+ if (s4 !== peg$FAILED) {
2060
+ s5 = peg$parseFuncArg();
2061
+ s4 = [s4, s5];
2062
+ s3 = s4;
2063
+ } else {
2064
+ peg$currPos = s3;
2065
+ s3 = peg$FAILED;
2066
+ }
2067
+ while (s3 !== peg$FAILED) {
2068
+ s2.push(s3);
2069
+ s3 = peg$currPos;
2070
+ if (input.charCodeAt(peg$currPos) === 44) {
2071
+ s4 = peg$c19;
2072
+ peg$currPos++;
2073
+ } else {
2074
+ s4 = peg$FAILED;
2075
+ if (peg$silentFails === 0) { peg$fail(peg$e30); }
2076
+ }
2077
+ if (s4 !== peg$FAILED) {
2078
+ s5 = peg$parseFuncArg();
2079
+ s4 = [s4, s5];
2080
+ s3 = s4;
2081
+ } else {
2082
+ peg$currPos = s3;
2083
+ s3 = peg$FAILED;
2084
+ }
2085
+ }
2086
+ peg$savedPos = s0;
2087
+ s0 = peg$f31(s1, s2);
2088
+
2089
+ return s0;
2090
+ }
2091
+
2092
+ function peg$parseFuncArg() {
2093
+ let s0, s1, s2;
2094
+
2095
+ s0 = peg$currPos;
2096
+ s1 = [];
2097
+ s2 = peg$parseArgToken();
2098
+ while (s2 !== peg$FAILED) {
2099
+ s1.push(s2);
2100
+ s2 = peg$parseArgToken();
2101
+ }
2102
+ peg$savedPos = s0;
2103
+ s1 = peg$f32(s1);
2104
+ s0 = s1;
2105
+
2106
+ return s0;
2107
+ }
2108
+
2109
+ function peg$parseArgToken() {
2110
+ let s0;
2111
+
2112
+ s0 = peg$parseFunctionCall();
2113
+ if (s0 === peg$FAILED) {
2114
+ s0 = peg$parseEvalBlock();
2115
+ if (s0 === peg$FAILED) {
2116
+ s0 = peg$parseBracedString();
2117
+ if (s0 === peg$FAILED) {
2118
+ s0 = peg$parseBalancedParens();
2119
+ if (s0 === peg$FAILED) {
2120
+ s0 = peg$parseSubstitution();
2121
+ if (s0 === peg$FAILED) {
2122
+ s0 = peg$parseSpecialVar();
2123
+ if (s0 === peg$FAILED) {
2124
+ s0 = peg$parseTagRef();
2125
+ if (s0 === peg$FAILED) {
2126
+ s0 = peg$parseEscape();
2127
+ if (s0 === peg$FAILED) {
2128
+ s0 = peg$parseArgLiteralChars();
2129
+ }
2130
+ }
2131
+ }
2132
+ }
2133
+ }
2134
+ }
2135
+ }
2136
+ }
2137
+
2138
+ return s0;
2139
+ }
2140
+
2141
+ function peg$parseBalancedParens() {
2142
+ let s0, s1, s2, s3;
2143
+
2144
+ s0 = peg$currPos;
2145
+ if (input.charCodeAt(peg$currPos) === 40) {
2146
+ s1 = peg$c17;
2147
+ peg$currPos++;
2148
+ } else {
2149
+ s1 = peg$FAILED;
2150
+ if (peg$silentFails === 0) { peg$fail(peg$e27); }
2151
+ }
2152
+ if (s1 !== peg$FAILED) {
2153
+ s2 = [];
2154
+ s3 = peg$parseBalancedParenToken();
2155
+ while (s3 !== peg$FAILED) {
2156
+ s2.push(s3);
2157
+ s3 = peg$parseBalancedParenToken();
2158
+ }
2159
+ if (input.charCodeAt(peg$currPos) === 41) {
2160
+ s3 = peg$c18;
2161
+ peg$currPos++;
2162
+ } else {
2163
+ s3 = peg$FAILED;
2164
+ if (peg$silentFails === 0) { peg$fail(peg$e28); }
2165
+ }
2166
+ if (s3 !== peg$FAILED) {
2167
+ peg$savedPos = s0;
2168
+ s0 = peg$f33(s2);
2169
+ } else {
2170
+ peg$currPos = s0;
2171
+ s0 = peg$FAILED;
2172
+ }
2173
+ } else {
2174
+ peg$currPos = s0;
2175
+ s0 = peg$FAILED;
2176
+ }
2177
+
2178
+ return s0;
2179
+ }
2180
+
2181
+ function peg$parseBalancedParenToken() {
2182
+ let s0;
2183
+
2184
+ s0 = peg$parseFunctionCall();
2185
+ if (s0 === peg$FAILED) {
2186
+ s0 = peg$parseEvalBlock();
2187
+ if (s0 === peg$FAILED) {
2188
+ s0 = peg$parseBracedString();
2189
+ if (s0 === peg$FAILED) {
2190
+ s0 = peg$parseBalancedParens();
2191
+ if (s0 === peg$FAILED) {
2192
+ s0 = peg$parseSubstitution();
2193
+ if (s0 === peg$FAILED) {
2194
+ s0 = peg$parseSpecialVar();
2195
+ if (s0 === peg$FAILED) {
2196
+ s0 = peg$parseTagRef();
2197
+ if (s0 === peg$FAILED) {
2198
+ s0 = peg$parseEscape();
2199
+ if (s0 === peg$FAILED) {
2200
+ s0 = peg$parseBalancedParenLiteral();
2201
+ }
2202
+ }
2203
+ }
2204
+ }
2205
+ }
2206
+ }
2207
+ }
2208
+ }
2209
+
2210
+ return s0;
2211
+ }
2212
+
2213
+ function peg$parseBalancedParenLiteral() {
2214
+ let s0, s1, s2, s3;
2215
+
2216
+ s0 = peg$currPos;
2217
+ s1 = peg$currPos;
2218
+ s2 = [];
2219
+ s3 = input.charAt(peg$currPos);
2220
+ if (peg$r10.test(s3)) {
2221
+ peg$currPos++;
2222
+ } else {
2223
+ s3 = peg$FAILED;
2224
+ if (peg$silentFails === 0) { peg$fail(peg$e31); }
2225
+ }
2226
+ if (s3 !== peg$FAILED) {
2227
+ while (s3 !== peg$FAILED) {
2228
+ s2.push(s3);
2229
+ s3 = input.charAt(peg$currPos);
2230
+ if (peg$r10.test(s3)) {
2231
+ peg$currPos++;
2232
+ } else {
2233
+ s3 = peg$FAILED;
2234
+ if (peg$silentFails === 0) { peg$fail(peg$e31); }
2235
+ }
2236
+ }
2237
+ } else {
2238
+ s2 = peg$FAILED;
2239
+ }
2240
+ if (s2 !== peg$FAILED) {
2241
+ s1 = input.substring(s1, peg$currPos);
2242
+ } else {
2243
+ s1 = s2;
2244
+ }
2245
+ if (s1 !== peg$FAILED) {
2246
+ peg$savedPos = s0;
2247
+ s1 = peg$f34(s1);
2248
+ }
2249
+ s0 = s1;
2250
+ if (s0 === peg$FAILED) {
2251
+ s0 = peg$currPos;
2252
+ if (input.charCodeAt(peg$currPos) === 35) {
2253
+ s1 = peg$c11;
2254
+ peg$currPos++;
2255
+ } else {
2256
+ s1 = peg$FAILED;
2257
+ if (peg$silentFails === 0) { peg$fail(peg$e17); }
2258
+ }
2259
+ if (s1 !== peg$FAILED) {
2260
+ s2 = peg$currPos;
2261
+ peg$silentFails++;
2262
+ s3 = input.charAt(peg$currPos);
2263
+ if (peg$r5.test(s3)) {
2264
+ peg$currPos++;
2265
+ } else {
2266
+ s3 = peg$FAILED;
2267
+ if (peg$silentFails === 0) { peg$fail(peg$e18); }
2268
+ }
2269
+ peg$silentFails--;
2270
+ if (s3 === peg$FAILED) {
2271
+ s2 = undefined;
2272
+ } else {
2273
+ peg$currPos = s2;
2274
+ s2 = peg$FAILED;
2275
+ }
2276
+ if (s2 !== peg$FAILED) {
2277
+ peg$savedPos = s0;
2278
+ s0 = peg$f35();
2279
+ } else {
2280
+ peg$currPos = s0;
2281
+ s0 = peg$FAILED;
2282
+ }
2283
+ } else {
2284
+ peg$currPos = s0;
2285
+ s0 = peg$FAILED;
2286
+ }
2287
+ }
2288
+
2289
+ return s0;
2290
+ }
2291
+
2292
+ function peg$parseArgLiteralChars() {
2293
+ let s0, s1, s2, s3;
2294
+
2295
+ s0 = peg$currPos;
2296
+ s1 = peg$currPos;
2297
+ s2 = [];
2298
+ s3 = input.charAt(peg$currPos);
2299
+ if (peg$r11.test(s3)) {
2300
+ peg$currPos++;
2301
+ } else {
2302
+ s3 = peg$FAILED;
2303
+ if (peg$silentFails === 0) { peg$fail(peg$e32); }
2304
+ }
2305
+ if (s3 !== peg$FAILED) {
2306
+ while (s3 !== peg$FAILED) {
2307
+ s2.push(s3);
2308
+ s3 = input.charAt(peg$currPos);
2309
+ if (peg$r11.test(s3)) {
2310
+ peg$currPos++;
2311
+ } else {
2312
+ s3 = peg$FAILED;
2313
+ if (peg$silentFails === 0) { peg$fail(peg$e32); }
2314
+ }
2315
+ }
2316
+ } else {
2317
+ s2 = peg$FAILED;
2318
+ }
2319
+ if (s2 !== peg$FAILED) {
2320
+ s1 = input.substring(s1, peg$currPos);
2321
+ } else {
2322
+ s1 = s2;
2323
+ }
2324
+ if (s1 !== peg$FAILED) {
2325
+ peg$savedPos = s0;
2326
+ s1 = peg$f36(s1);
2327
+ }
2328
+ s0 = s1;
2329
+ if (s0 === peg$FAILED) {
2330
+ s0 = peg$currPos;
2331
+ if (input.charCodeAt(peg$currPos) === 35) {
2332
+ s1 = peg$c11;
2333
+ peg$currPos++;
2334
+ } else {
2335
+ s1 = peg$FAILED;
2336
+ if (peg$silentFails === 0) { peg$fail(peg$e17); }
2337
+ }
2338
+ if (s1 !== peg$FAILED) {
2339
+ s2 = peg$currPos;
2340
+ peg$silentFails++;
2341
+ s3 = input.charAt(peg$currPos);
2342
+ if (peg$r5.test(s3)) {
2343
+ peg$currPos++;
2344
+ } else {
2345
+ s3 = peg$FAILED;
2346
+ if (peg$silentFails === 0) { peg$fail(peg$e18); }
2347
+ }
2348
+ peg$silentFails--;
2349
+ if (s3 === peg$FAILED) {
2350
+ s2 = undefined;
2351
+ } else {
2352
+ peg$currPos = s2;
2353
+ s2 = peg$FAILED;
2354
+ }
2355
+ if (s2 !== peg$FAILED) {
2356
+ peg$savedPos = s0;
2357
+ s0 = peg$f37();
2358
+ } else {
2359
+ peg$currPos = s0;
2360
+ s0 = peg$FAILED;
2361
+ }
2362
+ } else {
2363
+ peg$currPos = s0;
2364
+ s0 = peg$FAILED;
2365
+ }
2366
+ }
2367
+
2368
+ return s0;
2369
+ }
2370
+
2371
+ function peg$parseSubstitution() {
2372
+ let s0, s1, s2;
2373
+
2374
+ s0 = peg$currPos;
2375
+ if (input.charCodeAt(peg$currPos) === 37) {
2376
+ s1 = peg$c20;
2377
+ peg$currPos++;
2378
+ } else {
2379
+ s1 = peg$FAILED;
2380
+ if (peg$silentFails === 0) { peg$fail(peg$e33); }
2381
+ }
2382
+ if (s1 !== peg$FAILED) {
2383
+ s2 = peg$parseSubCode();
2384
+ if (s2 !== peg$FAILED) {
2385
+ peg$savedPos = s0;
2386
+ s0 = peg$f38(s2);
2387
+ } else {
2388
+ peg$currPos = s0;
2389
+ s0 = peg$FAILED;
2390
+ }
2391
+ } else {
2392
+ peg$currPos = s0;
2393
+ s0 = peg$FAILED;
2394
+ }
2395
+
2396
+ return s0;
2397
+ }
2398
+
2399
+ function peg$parseSubCode() {
2400
+ let s0, s1, s2, s3, s4, s5, s6;
2401
+
2402
+ s0 = peg$currPos;
2403
+ if (input.charCodeAt(peg$currPos) === 113) {
2404
+ s1 = peg$c21;
2405
+ peg$currPos++;
2406
+ } else {
2407
+ s1 = peg$FAILED;
2408
+ if (peg$silentFails === 0) { peg$fail(peg$e34); }
2409
+ }
2410
+ if (s1 !== peg$FAILED) {
2411
+ s2 = peg$currPos;
2412
+ s3 = [];
2413
+ s4 = input.charAt(peg$currPos);
2414
+ if (peg$r12.test(s4)) {
2415
+ peg$currPos++;
2416
+ } else {
2417
+ s4 = peg$FAILED;
2418
+ if (peg$silentFails === 0) { peg$fail(peg$e35); }
2419
+ }
2420
+ if (s4 !== peg$FAILED) {
2421
+ while (s4 !== peg$FAILED) {
2422
+ s3.push(s4);
2423
+ s4 = input.charAt(peg$currPos);
2424
+ if (peg$r12.test(s4)) {
2425
+ peg$currPos++;
2426
+ } else {
2427
+ s4 = peg$FAILED;
2428
+ if (peg$silentFails === 0) { peg$fail(peg$e35); }
2429
+ }
2430
+ }
2431
+ } else {
2432
+ s3 = peg$FAILED;
2433
+ }
2434
+ if (s3 !== peg$FAILED) {
2435
+ s2 = input.substring(s2, peg$currPos);
2436
+ } else {
2437
+ s2 = s3;
2438
+ }
2439
+ if (s2 !== peg$FAILED) {
2440
+ peg$savedPos = s0;
2441
+ s0 = peg$f39(s2);
2442
+ } else {
2443
+ peg$currPos = s0;
2444
+ s0 = peg$FAILED;
2445
+ }
2446
+ } else {
2447
+ peg$currPos = s0;
2448
+ s0 = peg$FAILED;
2449
+ }
2450
+ if (s0 === peg$FAILED) {
2451
+ s0 = peg$currPos;
2452
+ if (input.charCodeAt(peg$currPos) === 105) {
2453
+ s1 = peg$c22;
2454
+ peg$currPos++;
2455
+ } else {
2456
+ s1 = peg$FAILED;
2457
+ if (peg$silentFails === 0) { peg$fail(peg$e36); }
2458
+ }
2459
+ if (s1 !== peg$FAILED) {
2460
+ s2 = input.charAt(peg$currPos);
2461
+ if (peg$r13.test(s2)) {
2462
+ peg$currPos++;
2463
+ } else {
2464
+ s2 = peg$FAILED;
2465
+ if (peg$silentFails === 0) { peg$fail(peg$e37); }
2466
+ }
2467
+ if (s2 !== peg$FAILED) {
2468
+ peg$savedPos = s0;
2469
+ s0 = peg$f40(s2);
2470
+ } else {
2471
+ peg$currPos = s0;
2472
+ s0 = peg$FAILED;
2473
+ }
2474
+ } else {
2475
+ peg$currPos = s0;
2476
+ s0 = peg$FAILED;
2477
+ }
2478
+ if (s0 === peg$FAILED) {
2479
+ s0 = peg$currPos;
2480
+ if (input.charCodeAt(peg$currPos) === 86) {
2481
+ s1 = peg$c23;
2482
+ peg$currPos++;
2483
+ } else {
2484
+ s1 = peg$FAILED;
2485
+ if (peg$silentFails === 0) { peg$fail(peg$e38); }
2486
+ }
2487
+ if (s1 !== peg$FAILED) {
2488
+ s2 = input.charAt(peg$currPos);
2489
+ if (peg$r14.test(s2)) {
2490
+ peg$currPos++;
2491
+ } else {
2492
+ s2 = peg$FAILED;
2493
+ if (peg$silentFails === 0) { peg$fail(peg$e39); }
2494
+ }
2495
+ if (s2 !== peg$FAILED) {
2496
+ peg$savedPos = s0;
2497
+ s0 = peg$f41(s2);
2498
+ } else {
2499
+ peg$currPos = s0;
2500
+ s0 = peg$FAILED;
2501
+ }
2502
+ } else {
2503
+ peg$currPos = s0;
2504
+ s0 = peg$FAILED;
2505
+ }
2506
+ if (s0 === peg$FAILED) {
2507
+ s0 = peg$currPos;
2508
+ if (input.charCodeAt(peg$currPos) === 118) {
2509
+ s1 = peg$c24;
2510
+ peg$currPos++;
2511
+ } else {
2512
+ s1 = peg$FAILED;
2513
+ if (peg$silentFails === 0) { peg$fail(peg$e40); }
2514
+ }
2515
+ if (s1 !== peg$FAILED) {
2516
+ s2 = input.charAt(peg$currPos);
2517
+ if (peg$r14.test(s2)) {
2518
+ peg$currPos++;
2519
+ } else {
2520
+ s2 = peg$FAILED;
2521
+ if (peg$silentFails === 0) { peg$fail(peg$e39); }
2522
+ }
2523
+ if (s2 !== peg$FAILED) {
2524
+ peg$savedPos = s0;
2525
+ s0 = peg$f42(s2);
2526
+ } else {
2527
+ peg$currPos = s0;
2528
+ s0 = peg$FAILED;
2529
+ }
2530
+ } else {
2531
+ peg$currPos = s0;
2532
+ s0 = peg$FAILED;
2533
+ }
2534
+ if (s0 === peg$FAILED) {
2535
+ s0 = peg$currPos;
2536
+ if (input.charCodeAt(peg$currPos) === 120) {
2537
+ s1 = peg$c25;
2538
+ peg$currPos++;
2539
+ } else {
2540
+ s1 = peg$FAILED;
2541
+ if (peg$silentFails === 0) { peg$fail(peg$e41); }
2542
+ }
2543
+ if (s1 !== peg$FAILED) {
2544
+ if (input.charCodeAt(peg$currPos) === 60) {
2545
+ s2 = peg$c26;
2546
+ peg$currPos++;
2547
+ } else {
2548
+ s2 = peg$FAILED;
2549
+ if (peg$silentFails === 0) { peg$fail(peg$e42); }
2550
+ }
2551
+ if (s2 !== peg$FAILED) {
2552
+ s3 = peg$currPos;
2553
+ s4 = [];
2554
+ s5 = input.charAt(peg$currPos);
2555
+ if (peg$r15.test(s5)) {
2556
+ peg$currPos++;
2557
+ } else {
2558
+ s5 = peg$FAILED;
2559
+ if (peg$silentFails === 0) { peg$fail(peg$e43); }
2560
+ }
2561
+ while (s5 !== peg$FAILED) {
2562
+ s4.push(s5);
2563
+ s5 = input.charAt(peg$currPos);
2564
+ if (peg$r15.test(s5)) {
2565
+ peg$currPos++;
2566
+ } else {
2567
+ s5 = peg$FAILED;
2568
+ if (peg$silentFails === 0) { peg$fail(peg$e43); }
2569
+ }
2570
+ }
2571
+ s3 = input.substring(s3, peg$currPos);
2572
+ if (input.charCodeAt(peg$currPos) === 62) {
2573
+ s4 = peg$c27;
2574
+ peg$currPos++;
2575
+ } else {
2576
+ s4 = peg$FAILED;
2577
+ if (peg$silentFails === 0) { peg$fail(peg$e44); }
2578
+ }
2579
+ if (s4 !== peg$FAILED) {
2580
+ peg$savedPos = s0;
2581
+ s0 = peg$f43(s3);
2582
+ } else {
2583
+ peg$currPos = s0;
2584
+ s0 = peg$FAILED;
2585
+ }
2586
+ } else {
2587
+ peg$currPos = s0;
2588
+ s0 = peg$FAILED;
2589
+ }
2590
+ } else {
2591
+ peg$currPos = s0;
2592
+ s0 = peg$FAILED;
2593
+ }
2594
+ if (s0 === peg$FAILED) {
2595
+ s0 = peg$currPos;
2596
+ if (input.charCodeAt(peg$currPos) === 88) {
2597
+ s1 = peg$c28;
2598
+ peg$currPos++;
2599
+ } else {
2600
+ s1 = peg$FAILED;
2601
+ if (peg$silentFails === 0) { peg$fail(peg$e45); }
2602
+ }
2603
+ if (s1 !== peg$FAILED) {
2604
+ if (input.charCodeAt(peg$currPos) === 60) {
2605
+ s2 = peg$c26;
2606
+ peg$currPos++;
2607
+ } else {
2608
+ s2 = peg$FAILED;
2609
+ if (peg$silentFails === 0) { peg$fail(peg$e42); }
2610
+ }
2611
+ if (s2 !== peg$FAILED) {
2612
+ s3 = peg$currPos;
2613
+ s4 = [];
2614
+ s5 = input.charAt(peg$currPos);
2615
+ if (peg$r15.test(s5)) {
2616
+ peg$currPos++;
2617
+ } else {
2618
+ s5 = peg$FAILED;
2619
+ if (peg$silentFails === 0) { peg$fail(peg$e43); }
2620
+ }
2621
+ while (s5 !== peg$FAILED) {
2622
+ s4.push(s5);
2623
+ s5 = input.charAt(peg$currPos);
2624
+ if (peg$r15.test(s5)) {
2625
+ peg$currPos++;
2626
+ } else {
2627
+ s5 = peg$FAILED;
2628
+ if (peg$silentFails === 0) { peg$fail(peg$e43); }
2629
+ }
2630
+ }
2631
+ s3 = input.substring(s3, peg$currPos);
2632
+ if (input.charCodeAt(peg$currPos) === 62) {
2633
+ s4 = peg$c27;
2634
+ peg$currPos++;
2635
+ } else {
2636
+ s4 = peg$FAILED;
2637
+ if (peg$silentFails === 0) { peg$fail(peg$e44); }
2638
+ }
2639
+ if (s4 !== peg$FAILED) {
2640
+ peg$savedPos = s0;
2641
+ s0 = peg$f44(s3);
2642
+ } else {
2643
+ peg$currPos = s0;
2644
+ s0 = peg$FAILED;
2645
+ }
2646
+ } else {
2647
+ peg$currPos = s0;
2648
+ s0 = peg$FAILED;
2649
+ }
2650
+ } else {
2651
+ peg$currPos = s0;
2652
+ s0 = peg$FAILED;
2653
+ }
2654
+ if (s0 === peg$FAILED) {
2655
+ s0 = peg$currPos;
2656
+ if (input.charCodeAt(peg$currPos) === 99) {
2657
+ s1 = peg$c29;
2658
+ peg$currPos++;
2659
+ } else {
2660
+ s1 = peg$FAILED;
2661
+ if (peg$silentFails === 0) { peg$fail(peg$e46); }
2662
+ }
2663
+ if (s1 !== peg$FAILED) {
2664
+ if (input.charCodeAt(peg$currPos) === 60) {
2665
+ s2 = peg$c26;
2666
+ peg$currPos++;
2667
+ } else {
2668
+ s2 = peg$FAILED;
2669
+ if (peg$silentFails === 0) { peg$fail(peg$e42); }
2670
+ }
2671
+ if (s2 !== peg$FAILED) {
2672
+ s3 = peg$currPos;
2673
+ s4 = [];
2674
+ s5 = input.charAt(peg$currPos);
2675
+ if (peg$r15.test(s5)) {
2676
+ peg$currPos++;
2677
+ } else {
2678
+ s5 = peg$FAILED;
2679
+ if (peg$silentFails === 0) { peg$fail(peg$e43); }
2680
+ }
2681
+ while (s5 !== peg$FAILED) {
2682
+ s4.push(s5);
2683
+ s5 = input.charAt(peg$currPos);
2684
+ if (peg$r15.test(s5)) {
2685
+ peg$currPos++;
2686
+ } else {
2687
+ s5 = peg$FAILED;
2688
+ if (peg$silentFails === 0) { peg$fail(peg$e43); }
2689
+ }
2690
+ }
2691
+ s3 = input.substring(s3, peg$currPos);
2692
+ if (input.charCodeAt(peg$currPos) === 62) {
2693
+ s4 = peg$c27;
2694
+ peg$currPos++;
2695
+ } else {
2696
+ s4 = peg$FAILED;
2697
+ if (peg$silentFails === 0) { peg$fail(peg$e44); }
2698
+ }
2699
+ if (s4 !== peg$FAILED) {
2700
+ peg$savedPos = s0;
2701
+ s0 = peg$f45(s3);
2702
+ } else {
2703
+ peg$currPos = s0;
2704
+ s0 = peg$FAILED;
2705
+ }
2706
+ } else {
2707
+ peg$currPos = s0;
2708
+ s0 = peg$FAILED;
2709
+ }
2710
+ } else {
2711
+ peg$currPos = s0;
2712
+ s0 = peg$FAILED;
2713
+ }
2714
+ if (s0 === peg$FAILED) {
2715
+ s0 = peg$currPos;
2716
+ if (input.charCodeAt(peg$currPos) === 67) {
2717
+ s1 = peg$c30;
2718
+ peg$currPos++;
2719
+ } else {
2720
+ s1 = peg$FAILED;
2721
+ if (peg$silentFails === 0) { peg$fail(peg$e47); }
2722
+ }
2723
+ if (s1 !== peg$FAILED) {
2724
+ if (input.charCodeAt(peg$currPos) === 60) {
2725
+ s2 = peg$c26;
2726
+ peg$currPos++;
2727
+ } else {
2728
+ s2 = peg$FAILED;
2729
+ if (peg$silentFails === 0) { peg$fail(peg$e42); }
2730
+ }
2731
+ if (s2 !== peg$FAILED) {
2732
+ s3 = peg$currPos;
2733
+ s4 = [];
2734
+ s5 = input.charAt(peg$currPos);
2735
+ if (peg$r15.test(s5)) {
2736
+ peg$currPos++;
2737
+ } else {
2738
+ s5 = peg$FAILED;
2739
+ if (peg$silentFails === 0) { peg$fail(peg$e43); }
2740
+ }
2741
+ while (s5 !== peg$FAILED) {
2742
+ s4.push(s5);
2743
+ s5 = input.charAt(peg$currPos);
2744
+ if (peg$r15.test(s5)) {
2745
+ peg$currPos++;
2746
+ } else {
2747
+ s5 = peg$FAILED;
2748
+ if (peg$silentFails === 0) { peg$fail(peg$e43); }
2749
+ }
2750
+ }
2751
+ s3 = input.substring(s3, peg$currPos);
2752
+ if (input.charCodeAt(peg$currPos) === 62) {
2753
+ s4 = peg$c27;
2754
+ peg$currPos++;
2755
+ } else {
2756
+ s4 = peg$FAILED;
2757
+ if (peg$silentFails === 0) { peg$fail(peg$e44); }
2758
+ }
2759
+ if (s4 !== peg$FAILED) {
2760
+ peg$savedPos = s0;
2761
+ s0 = peg$f46(s3);
2762
+ } else {
2763
+ peg$currPos = s0;
2764
+ s0 = peg$FAILED;
2765
+ }
2766
+ } else {
2767
+ peg$currPos = s0;
2768
+ s0 = peg$FAILED;
2769
+ }
2770
+ } else {
2771
+ peg$currPos = s0;
2772
+ s0 = peg$FAILED;
2773
+ }
2774
+ if (s0 === peg$FAILED) {
2775
+ s0 = peg$currPos;
2776
+ if (input.charCodeAt(peg$currPos) === 120) {
2777
+ s1 = peg$c25;
2778
+ peg$currPos++;
2779
+ } else {
2780
+ s1 = peg$FAILED;
2781
+ if (peg$silentFails === 0) { peg$fail(peg$e41); }
2782
+ }
2783
+ if (s1 !== peg$FAILED) {
2784
+ s2 = input.charAt(peg$currPos);
2785
+ if (peg$r16.test(s2)) {
2786
+ peg$currPos++;
2787
+ } else {
2788
+ s2 = peg$FAILED;
2789
+ if (peg$silentFails === 0) { peg$fail(peg$e48); }
2790
+ }
2791
+ if (s2 !== peg$FAILED) {
2792
+ peg$savedPos = s0;
2793
+ s0 = peg$f47(s2);
2794
+ } else {
2795
+ peg$currPos = s0;
2796
+ s0 = peg$FAILED;
2797
+ }
2798
+ } else {
2799
+ peg$currPos = s0;
2800
+ s0 = peg$FAILED;
2801
+ }
2802
+ if (s0 === peg$FAILED) {
2803
+ s0 = peg$currPos;
2804
+ if (input.charCodeAt(peg$currPos) === 88) {
2805
+ s1 = peg$c28;
2806
+ peg$currPos++;
2807
+ } else {
2808
+ s1 = peg$FAILED;
2809
+ if (peg$silentFails === 0) { peg$fail(peg$e45); }
2810
+ }
2811
+ if (s1 !== peg$FAILED) {
2812
+ s2 = input.charAt(peg$currPos);
2813
+ if (peg$r16.test(s2)) {
2814
+ peg$currPos++;
2815
+ } else {
2816
+ s2 = peg$FAILED;
2817
+ if (peg$silentFails === 0) { peg$fail(peg$e48); }
2818
+ }
2819
+ if (s2 !== peg$FAILED) {
2820
+ peg$savedPos = s0;
2821
+ s0 = peg$f48(s2);
2822
+ } else {
2823
+ peg$currPos = s0;
2824
+ s0 = peg$FAILED;
2825
+ }
2826
+ } else {
2827
+ peg$currPos = s0;
2828
+ s0 = peg$FAILED;
2829
+ }
2830
+ if (s0 === peg$FAILED) {
2831
+ s0 = peg$currPos;
2832
+ if (input.charCodeAt(peg$currPos) === 99) {
2833
+ s1 = peg$c29;
2834
+ peg$currPos++;
2835
+ } else {
2836
+ s1 = peg$FAILED;
2837
+ if (peg$silentFails === 0) { peg$fail(peg$e46); }
2838
+ }
2839
+ if (s1 !== peg$FAILED) {
2840
+ s2 = input.charAt(peg$currPos);
2841
+ if (peg$r16.test(s2)) {
2842
+ peg$currPos++;
2843
+ } else {
2844
+ s2 = peg$FAILED;
2845
+ if (peg$silentFails === 0) { peg$fail(peg$e48); }
2846
+ }
2847
+ if (s2 !== peg$FAILED) {
2848
+ peg$savedPos = s0;
2849
+ s0 = peg$f49(s2);
2850
+ } else {
2851
+ peg$currPos = s0;
2852
+ s0 = peg$FAILED;
2853
+ }
2854
+ } else {
2855
+ peg$currPos = s0;
2856
+ s0 = peg$FAILED;
2857
+ }
2858
+ if (s0 === peg$FAILED) {
2859
+ s0 = peg$currPos;
2860
+ if (input.charCodeAt(peg$currPos) === 67) {
2861
+ s1 = peg$c30;
2862
+ peg$currPos++;
2863
+ } else {
2864
+ s1 = peg$FAILED;
2865
+ if (peg$silentFails === 0) { peg$fail(peg$e47); }
2866
+ }
2867
+ if (s1 !== peg$FAILED) {
2868
+ s2 = input.charAt(peg$currPos);
2869
+ if (peg$r16.test(s2)) {
2870
+ peg$currPos++;
2871
+ } else {
2872
+ s2 = peg$FAILED;
2873
+ if (peg$silentFails === 0) { peg$fail(peg$e48); }
2874
+ }
2875
+ if (s2 !== peg$FAILED) {
2876
+ peg$savedPos = s0;
2877
+ s0 = peg$f50(s2);
2878
+ } else {
2879
+ peg$currPos = s0;
2880
+ s0 = peg$FAILED;
2881
+ }
2882
+ } else {
2883
+ peg$currPos = s0;
2884
+ s0 = peg$FAILED;
2885
+ }
2886
+ if (s0 === peg$FAILED) {
2887
+ s0 = peg$currPos;
2888
+ if (input.charCodeAt(peg$currPos) === 92) {
2889
+ s1 = peg$c6;
2890
+ peg$currPos++;
2891
+ } else {
2892
+ s1 = peg$FAILED;
2893
+ if (peg$silentFails === 0) { peg$fail(peg$e6); }
2894
+ }
2895
+ if (s1 !== peg$FAILED) {
2896
+ peg$savedPos = s0;
2897
+ s1 = peg$f51();
2898
+ }
2899
+ s0 = s1;
2900
+ if (s0 === peg$FAILED) {
2901
+ s0 = peg$currPos;
2902
+ if (input.charCodeAt(peg$currPos) === 61) {
2903
+ s1 = peg$c9;
2904
+ peg$currPos++;
2905
+ } else {
2906
+ s1 = peg$FAILED;
2907
+ if (peg$silentFails === 0) { peg$fail(peg$e13); }
2908
+ }
2909
+ if (s1 !== peg$FAILED) {
2910
+ s2 = peg$currPos;
2911
+ s3 = peg$currPos;
2912
+ s4 = input.charAt(peg$currPos);
2913
+ if (peg$r3.test(s4)) {
2914
+ peg$currPos++;
2915
+ } else {
2916
+ s4 = peg$FAILED;
2917
+ if (peg$silentFails === 0) { peg$fail(peg$e15); }
2918
+ }
2919
+ if (s4 !== peg$FAILED) {
2920
+ s5 = [];
2921
+ s6 = input.charAt(peg$currPos);
2922
+ if (peg$r2.test(s6)) {
2923
+ peg$currPos++;
2924
+ } else {
2925
+ s6 = peg$FAILED;
2926
+ if (peg$silentFails === 0) { peg$fail(peg$e11); }
2927
+ }
2928
+ while (s6 !== peg$FAILED) {
2929
+ s5.push(s6);
2930
+ s6 = input.charAt(peg$currPos);
2931
+ if (peg$r2.test(s6)) {
2932
+ peg$currPos++;
2933
+ } else {
2934
+ s6 = peg$FAILED;
2935
+ if (peg$silentFails === 0) { peg$fail(peg$e11); }
2936
+ }
2937
+ }
2938
+ s4 = [s4, s5];
2939
+ s3 = s4;
2940
+ } else {
2941
+ peg$currPos = s3;
2942
+ s3 = peg$FAILED;
2943
+ }
2944
+ if (s3 !== peg$FAILED) {
2945
+ s2 = input.substring(s2, peg$currPos);
2946
+ } else {
2947
+ s2 = s3;
2948
+ }
2949
+ if (s2 !== peg$FAILED) {
2950
+ peg$savedPos = s0;
2951
+ s0 = peg$f52(s2);
2952
+ } else {
2953
+ peg$currPos = s0;
2954
+ s0 = peg$FAILED;
2955
+ }
2956
+ } else {
2957
+ peg$currPos = s0;
2958
+ s0 = peg$FAILED;
2959
+ }
2960
+ if (s0 === peg$FAILED) {
2961
+ s0 = peg$currPos;
2962
+ s1 = input.charAt(peg$currPos);
2963
+ if (peg$r17.test(s1)) {
2964
+ peg$currPos++;
2965
+ } else {
2966
+ s1 = peg$FAILED;
2967
+ if (peg$silentFails === 0) { peg$fail(peg$e49); }
2968
+ }
2969
+ if (s1 !== peg$FAILED) {
2970
+ peg$savedPos = s0;
2971
+ s1 = peg$f53(s1);
2972
+ }
2973
+ s0 = s1;
2974
+ if (s0 === peg$FAILED) {
2975
+ s0 = peg$currPos;
2976
+ if (input.charCodeAt(peg$currPos) === 91) {
2977
+ s1 = peg$c14;
2978
+ peg$currPos++;
2979
+ } else {
2980
+ s1 = peg$FAILED;
2981
+ if (peg$silentFails === 0) { peg$fail(peg$e23); }
2982
+ }
2983
+ if (s1 !== peg$FAILED) {
2984
+ peg$savedPos = s0;
2985
+ s1 = peg$f54();
2986
+ }
2987
+ s0 = s1;
2988
+ if (s0 === peg$FAILED) {
2989
+ s0 = peg$currPos;
2990
+ if (input.charCodeAt(peg$currPos) === 93) {
2991
+ s1 = peg$c15;
2992
+ peg$currPos++;
2993
+ } else {
2994
+ s1 = peg$FAILED;
2995
+ if (peg$silentFails === 0) { peg$fail(peg$e24); }
2996
+ }
2997
+ if (s1 !== peg$FAILED) {
2998
+ peg$savedPos = s0;
2999
+ s1 = peg$f55();
3000
+ }
3001
+ s0 = s1;
3002
+ if (s0 === peg$FAILED) {
3003
+ s0 = peg$currPos;
3004
+ if (input.charCodeAt(peg$currPos) === 44) {
3005
+ s1 = peg$c19;
3006
+ peg$currPos++;
3007
+ } else {
3008
+ s1 = peg$FAILED;
3009
+ if (peg$silentFails === 0) { peg$fail(peg$e30); }
3010
+ }
3011
+ if (s1 !== peg$FAILED) {
3012
+ peg$savedPos = s0;
3013
+ s1 = peg$f56();
3014
+ }
3015
+ s0 = s1;
3016
+ if (s0 === peg$FAILED) {
3017
+ s0 = peg$currPos;
3018
+ if (input.charCodeAt(peg$currPos) === 59) {
3019
+ s1 = peg$c3;
3020
+ peg$currPos++;
3021
+ } else {
3022
+ s1 = peg$FAILED;
3023
+ if (peg$silentFails === 0) { peg$fail(peg$e3); }
3024
+ }
3025
+ if (s1 !== peg$FAILED) {
3026
+ peg$savedPos = s0;
3027
+ s1 = peg$f57();
3028
+ }
3029
+ s0 = s1;
3030
+ }
3031
+ }
3032
+ }
3033
+ }
3034
+ }
3035
+ }
3036
+ }
3037
+ }
3038
+ }
3039
+ }
3040
+ }
3041
+ }
3042
+ }
3043
+ }
3044
+ }
3045
+ }
3046
+ }
3047
+ }
3048
+
3049
+ return s0;
3050
+ }
3051
+
3052
+ function peg$parseSpecialVar() {
3053
+ let s0, s1;
3054
+
3055
+ s0 = peg$currPos;
3056
+ if (input.substr(peg$currPos, 2) === peg$c31) {
3057
+ s1 = peg$c31;
3058
+ peg$currPos += 2;
3059
+ } else {
3060
+ s1 = peg$FAILED;
3061
+ if (peg$silentFails === 0) { peg$fail(peg$e50); }
3062
+ }
3063
+ if (s1 !== peg$FAILED) {
3064
+ peg$savedPos = s0;
3065
+ s1 = peg$f58();
3066
+ }
3067
+ s0 = s1;
3068
+ if (s0 === peg$FAILED) {
3069
+ s0 = peg$currPos;
3070
+ if (input.substr(peg$currPos, 2) === peg$c32) {
3071
+ s1 = peg$c32;
3072
+ peg$currPos += 2;
3073
+ } else {
3074
+ s1 = peg$FAILED;
3075
+ if (peg$silentFails === 0) { peg$fail(peg$e51); }
3076
+ }
3077
+ if (s1 !== peg$FAILED) {
3078
+ peg$savedPos = s0;
3079
+ s1 = peg$f59();
3080
+ }
3081
+ s0 = s1;
3082
+ if (s0 === peg$FAILED) {
3083
+ s0 = peg$currPos;
3084
+ if (input.substr(peg$currPos, 2) === peg$c33) {
3085
+ s1 = peg$c33;
3086
+ peg$currPos += 2;
3087
+ } else {
3088
+ s1 = peg$FAILED;
3089
+ if (peg$silentFails === 0) { peg$fail(peg$e52); }
3090
+ }
3091
+ if (s1 !== peg$FAILED) {
3092
+ peg$savedPos = s0;
3093
+ s1 = peg$f60();
3094
+ }
3095
+ s0 = s1;
3096
+ }
3097
+ }
3098
+
3099
+ return s0;
3100
+ }
3101
+
3102
+ function peg$parseTagRef() {
3103
+ let s0, s1, s2, s3, s4, s5, s6;
3104
+
3105
+ s0 = peg$currPos;
3106
+ if (input.charCodeAt(peg$currPos) === 35) {
3107
+ s1 = peg$c11;
3108
+ peg$currPos++;
3109
+ } else {
3110
+ s1 = peg$FAILED;
3111
+ if (peg$silentFails === 0) { peg$fail(peg$e17); }
3112
+ }
3113
+ if (s1 !== peg$FAILED) {
3114
+ s2 = peg$currPos;
3115
+ s3 = peg$currPos;
3116
+ s4 = input.charAt(peg$currPos);
3117
+ if (peg$r3.test(s4)) {
3118
+ peg$currPos++;
3119
+ } else {
3120
+ s4 = peg$FAILED;
3121
+ if (peg$silentFails === 0) { peg$fail(peg$e15); }
3122
+ }
3123
+ if (s4 !== peg$FAILED) {
3124
+ s5 = [];
3125
+ s6 = input.charAt(peg$currPos);
3126
+ if (peg$r2.test(s6)) {
3127
+ peg$currPos++;
3128
+ } else {
3129
+ s6 = peg$FAILED;
3130
+ if (peg$silentFails === 0) { peg$fail(peg$e11); }
3131
+ }
3132
+ while (s6 !== peg$FAILED) {
3133
+ s5.push(s6);
3134
+ s6 = input.charAt(peg$currPos);
3135
+ if (peg$r2.test(s6)) {
3136
+ peg$currPos++;
3137
+ } else {
3138
+ s6 = peg$FAILED;
3139
+ if (peg$silentFails === 0) { peg$fail(peg$e11); }
3140
+ }
3141
+ }
3142
+ s4 = [s4, s5];
3143
+ s3 = s4;
3144
+ } else {
3145
+ peg$currPos = s3;
3146
+ s3 = peg$FAILED;
3147
+ }
3148
+ if (s3 !== peg$FAILED) {
3149
+ s2 = input.substring(s2, peg$currPos);
3150
+ } else {
3151
+ s2 = s3;
3152
+ }
3153
+ if (s2 !== peg$FAILED) {
3154
+ peg$savedPos = s0;
3155
+ s0 = peg$f61(s2);
3156
+ } else {
3157
+ peg$currPos = s0;
3158
+ s0 = peg$FAILED;
3159
+ }
3160
+ } else {
3161
+ peg$currPos = s0;
3162
+ s0 = peg$FAILED;
3163
+ }
3164
+
3165
+ return s0;
3166
+ }
3167
+
3168
+ function peg$parseEscape() {
3169
+ let s0, s1, s2;
3170
+
3171
+ s0 = peg$currPos;
3172
+ if (input.charCodeAt(peg$currPos) === 92) {
3173
+ s1 = peg$c6;
3174
+ peg$currPos++;
3175
+ } else {
3176
+ s1 = peg$FAILED;
3177
+ if (peg$silentFails === 0) { peg$fail(peg$e6); }
3178
+ }
3179
+ if (s1 !== peg$FAILED) {
3180
+ if (input.length > peg$currPos) {
3181
+ s2 = input.charAt(peg$currPos);
3182
+ peg$currPos++;
3183
+ } else {
3184
+ s2 = peg$FAILED;
3185
+ if (peg$silentFails === 0) { peg$fail(peg$e7); }
3186
+ }
3187
+ if (s2 !== peg$FAILED) {
3188
+ peg$savedPos = s0;
3189
+ s0 = peg$f62(s2);
3190
+ } else {
3191
+ peg$currPos = s0;
3192
+ s0 = peg$FAILED;
3193
+ }
3194
+ } else {
3195
+ peg$currPos = s0;
3196
+ s0 = peg$FAILED;
3197
+ }
3198
+
3199
+ return s0;
3200
+ }
3201
+
3202
+ function peg$parseLockExpr() {
3203
+ let s0;
3204
+
3205
+ s0 = peg$parseLockOr();
3206
+
3207
+ return s0;
3208
+ }
3209
+
3210
+ function peg$parseLockOr() {
3211
+ let s0, s1, s2, s3, s4, s5;
3212
+
3213
+ s0 = peg$currPos;
3214
+ s1 = peg$parseLockAnd();
3215
+ if (s1 !== peg$FAILED) {
3216
+ s2 = [];
3217
+ s3 = peg$currPos;
3218
+ if (input.charCodeAt(peg$currPos) === 124) {
3219
+ s4 = peg$c34;
3220
+ peg$currPos++;
3221
+ } else {
3222
+ s4 = peg$FAILED;
3223
+ if (peg$silentFails === 0) { peg$fail(peg$e53); }
3224
+ }
3225
+ if (s4 !== peg$FAILED) {
3226
+ s5 = peg$parseLockAnd();
3227
+ if (s5 !== peg$FAILED) {
3228
+ s4 = [s4, s5];
3229
+ s3 = s4;
3230
+ } else {
3231
+ peg$currPos = s3;
3232
+ s3 = peg$FAILED;
3233
+ }
3234
+ } else {
3235
+ peg$currPos = s3;
3236
+ s3 = peg$FAILED;
3237
+ }
3238
+ while (s3 !== peg$FAILED) {
3239
+ s2.push(s3);
3240
+ s3 = peg$currPos;
3241
+ if (input.charCodeAt(peg$currPos) === 124) {
3242
+ s4 = peg$c34;
3243
+ peg$currPos++;
3244
+ } else {
3245
+ s4 = peg$FAILED;
3246
+ if (peg$silentFails === 0) { peg$fail(peg$e53); }
3247
+ }
3248
+ if (s4 !== peg$FAILED) {
3249
+ s5 = peg$parseLockAnd();
3250
+ if (s5 !== peg$FAILED) {
3251
+ s4 = [s4, s5];
3252
+ s3 = s4;
3253
+ } else {
3254
+ peg$currPos = s3;
3255
+ s3 = peg$FAILED;
3256
+ }
3257
+ } else {
3258
+ peg$currPos = s3;
3259
+ s3 = peg$FAILED;
3260
+ }
3261
+ }
3262
+ peg$savedPos = s0;
3263
+ s0 = peg$f63(s1, s2);
3264
+ } else {
3265
+ peg$currPos = s0;
3266
+ s0 = peg$FAILED;
3267
+ }
3268
+
3269
+ return s0;
3270
+ }
3271
+
3272
+ function peg$parseLockAnd() {
3273
+ let s0, s1, s2, s3, s4, s5;
3274
+
3275
+ s0 = peg$currPos;
3276
+ s1 = peg$parseLockNot();
3277
+ if (s1 !== peg$FAILED) {
3278
+ s2 = [];
3279
+ s3 = peg$currPos;
3280
+ if (input.charCodeAt(peg$currPos) === 38) {
3281
+ s4 = peg$c10;
3282
+ peg$currPos++;
3283
+ } else {
3284
+ s4 = peg$FAILED;
3285
+ if (peg$silentFails === 0) { peg$fail(peg$e14); }
3286
+ }
3287
+ if (s4 !== peg$FAILED) {
3288
+ s5 = peg$parseLockNot();
3289
+ if (s5 !== peg$FAILED) {
3290
+ s4 = [s4, s5];
3291
+ s3 = s4;
3292
+ } else {
3293
+ peg$currPos = s3;
3294
+ s3 = peg$FAILED;
3295
+ }
3296
+ } else {
3297
+ peg$currPos = s3;
3298
+ s3 = peg$FAILED;
3299
+ }
3300
+ while (s3 !== peg$FAILED) {
3301
+ s2.push(s3);
3302
+ s3 = peg$currPos;
3303
+ if (input.charCodeAt(peg$currPos) === 38) {
3304
+ s4 = peg$c10;
3305
+ peg$currPos++;
3306
+ } else {
3307
+ s4 = peg$FAILED;
3308
+ if (peg$silentFails === 0) { peg$fail(peg$e14); }
3309
+ }
3310
+ if (s4 !== peg$FAILED) {
3311
+ s5 = peg$parseLockNot();
3312
+ if (s5 !== peg$FAILED) {
3313
+ s4 = [s4, s5];
3314
+ s3 = s4;
3315
+ } else {
3316
+ peg$currPos = s3;
3317
+ s3 = peg$FAILED;
3318
+ }
3319
+ } else {
3320
+ peg$currPos = s3;
3321
+ s3 = peg$FAILED;
3322
+ }
3323
+ }
3324
+ peg$savedPos = s0;
3325
+ s0 = peg$f64(s1, s2);
3326
+ } else {
3327
+ peg$currPos = s0;
3328
+ s0 = peg$FAILED;
3329
+ }
3330
+
3331
+ return s0;
3332
+ }
3333
+
3334
+ function peg$parseLockNot() {
3335
+ let s0, s1, s2;
3336
+
3337
+ s0 = peg$currPos;
3338
+ if (input.charCodeAt(peg$currPos) === 33) {
3339
+ s1 = peg$c35;
3340
+ peg$currPos++;
3341
+ } else {
3342
+ s1 = peg$FAILED;
3343
+ if (peg$silentFails === 0) { peg$fail(peg$e54); }
3344
+ }
3345
+ if (s1 !== peg$FAILED) {
3346
+ s2 = peg$parseLockNot();
3347
+ if (s2 !== peg$FAILED) {
3348
+ peg$savedPos = s0;
3349
+ s0 = peg$f65(s2);
3350
+ } else {
3351
+ peg$currPos = s0;
3352
+ s0 = peg$FAILED;
3353
+ }
3354
+ } else {
3355
+ peg$currPos = s0;
3356
+ s0 = peg$FAILED;
3357
+ }
3358
+ if (s0 === peg$FAILED) {
3359
+ s0 = peg$parseLockPrimary();
3360
+ }
3361
+
3362
+ return s0;
3363
+ }
3364
+
3365
+ function peg$parseLockPrimary() {
3366
+ let s0, s1, s2, s3, s4, s5;
3367
+
3368
+ s0 = peg$currPos;
3369
+ if (input.charCodeAt(peg$currPos) === 40) {
3370
+ s1 = peg$c17;
3371
+ peg$currPos++;
3372
+ } else {
3373
+ s1 = peg$FAILED;
3374
+ if (peg$silentFails === 0) { peg$fail(peg$e27); }
3375
+ }
3376
+ if (s1 !== peg$FAILED) {
3377
+ s2 = peg$parse_();
3378
+ s3 = peg$parseLockOr();
3379
+ if (s3 !== peg$FAILED) {
3380
+ s4 = peg$parse_();
3381
+ if (input.charCodeAt(peg$currPos) === 41) {
3382
+ s5 = peg$c18;
3383
+ peg$currPos++;
3384
+ } else {
3385
+ s5 = peg$FAILED;
3386
+ if (peg$silentFails === 0) { peg$fail(peg$e28); }
3387
+ }
3388
+ if (s5 !== peg$FAILED) {
3389
+ peg$savedPos = s0;
3390
+ s0 = peg$f66(s3);
3391
+ } else {
3392
+ peg$currPos = s0;
3393
+ s0 = peg$FAILED;
3394
+ }
3395
+ } else {
3396
+ peg$currPos = s0;
3397
+ s0 = peg$FAILED;
3398
+ }
3399
+ } else {
3400
+ peg$currPos = s0;
3401
+ s0 = peg$FAILED;
3402
+ }
3403
+ if (s0 === peg$FAILED) {
3404
+ s0 = peg$currPos;
3405
+ if (input.substr(peg$currPos, 2) === peg$c36) {
3406
+ s1 = peg$c36;
3407
+ peg$currPos += 2;
3408
+ } else {
3409
+ s1 = peg$FAILED;
3410
+ if (peg$silentFails === 0) { peg$fail(peg$e55); }
3411
+ }
3412
+ if (s1 !== peg$FAILED) {
3413
+ s2 = peg$currPos;
3414
+ peg$silentFails++;
3415
+ s3 = input.charAt(peg$currPos);
3416
+ if (peg$r9.test(s3)) {
3417
+ peg$currPos++;
3418
+ } else {
3419
+ s3 = peg$FAILED;
3420
+ if (peg$silentFails === 0) { peg$fail(peg$e29); }
3421
+ }
3422
+ peg$silentFails--;
3423
+ if (s3 === peg$FAILED) {
3424
+ s2 = undefined;
3425
+ } else {
3426
+ peg$currPos = s2;
3427
+ s2 = peg$FAILED;
3428
+ }
3429
+ if (s2 !== peg$FAILED) {
3430
+ peg$savedPos = s0;
3431
+ s0 = peg$f67();
3432
+ } else {
3433
+ peg$currPos = s0;
3434
+ s0 = peg$FAILED;
3435
+ }
3436
+ } else {
3437
+ peg$currPos = s0;
3438
+ s0 = peg$FAILED;
3439
+ }
3440
+ if (s0 === peg$FAILED) {
3441
+ s0 = peg$parseLockDbref();
3442
+ if (s0 === peg$FAILED) {
3443
+ s0 = peg$parseLockFlagCheck();
3444
+ if (s0 === peg$FAILED) {
3445
+ s0 = peg$parseLockTypeCheck();
3446
+ if (s0 === peg$FAILED) {
3447
+ s0 = peg$parseLockAttrCheck();
3448
+ if (s0 === peg$FAILED) {
3449
+ s0 = peg$parseLockPlayerName();
3450
+ }
3451
+ }
3452
+ }
3453
+ }
3454
+ }
3455
+ }
3456
+
3457
+ return s0;
3458
+ }
3459
+
3460
+ function peg$parseLockDbref() {
3461
+ let s0, s1, s2, s3, s4, s5, s6;
3462
+
3463
+ s0 = peg$currPos;
3464
+ if (input.charCodeAt(peg$currPos) === 35) {
3465
+ s1 = peg$c11;
3466
+ peg$currPos++;
3467
+ } else {
3468
+ s1 = peg$FAILED;
3469
+ if (peg$silentFails === 0) { peg$fail(peg$e17); }
3470
+ }
3471
+ if (s1 !== peg$FAILED) {
3472
+ s2 = peg$currPos;
3473
+ s3 = peg$currPos;
3474
+ if (input.charCodeAt(peg$currPos) === 45) {
3475
+ s4 = peg$c37;
3476
+ peg$currPos++;
3477
+ } else {
3478
+ s4 = peg$FAILED;
3479
+ if (peg$silentFails === 0) { peg$fail(peg$e56); }
3480
+ }
3481
+ if (s4 === peg$FAILED) {
3482
+ s4 = null;
3483
+ }
3484
+ s5 = [];
3485
+ s6 = input.charAt(peg$currPos);
3486
+ if (peg$r13.test(s6)) {
3487
+ peg$currPos++;
3488
+ } else {
3489
+ s6 = peg$FAILED;
3490
+ if (peg$silentFails === 0) { peg$fail(peg$e37); }
3491
+ }
3492
+ if (s6 !== peg$FAILED) {
3493
+ while (s6 !== peg$FAILED) {
3494
+ s5.push(s6);
3495
+ s6 = input.charAt(peg$currPos);
3496
+ if (peg$r13.test(s6)) {
3497
+ peg$currPos++;
3498
+ } else {
3499
+ s6 = peg$FAILED;
3500
+ if (peg$silentFails === 0) { peg$fail(peg$e37); }
3501
+ }
3502
+ }
3503
+ } else {
3504
+ s5 = peg$FAILED;
3505
+ }
3506
+ if (s5 !== peg$FAILED) {
3507
+ s4 = [s4, s5];
3508
+ s3 = s4;
3509
+ } else {
3510
+ peg$currPos = s3;
3511
+ s3 = peg$FAILED;
3512
+ }
3513
+ if (s3 !== peg$FAILED) {
3514
+ s2 = input.substring(s2, peg$currPos);
3515
+ } else {
3516
+ s2 = s3;
3517
+ }
3518
+ if (s2 !== peg$FAILED) {
3519
+ peg$savedPos = s0;
3520
+ s0 = peg$f68(s2);
3521
+ } else {
3522
+ peg$currPos = s0;
3523
+ s0 = peg$FAILED;
3524
+ }
3525
+ } else {
3526
+ peg$currPos = s0;
3527
+ s0 = peg$FAILED;
3528
+ }
3529
+
3530
+ return s0;
3531
+ }
3532
+
3533
+ function peg$parseLockFlagCheck() {
3534
+ let s0, s1, s2, s3, s4;
3535
+
3536
+ s0 = peg$currPos;
3537
+ if (input.substr(peg$currPos, 5) === peg$c38) {
3538
+ s1 = peg$c38;
3539
+ peg$currPos += 5;
3540
+ } else {
3541
+ s1 = peg$FAILED;
3542
+ if (peg$silentFails === 0) { peg$fail(peg$e57); }
3543
+ }
3544
+ if (s1 !== peg$FAILED) {
3545
+ s2 = peg$currPos;
3546
+ s3 = [];
3547
+ s4 = input.charAt(peg$currPos);
3548
+ if (peg$r3.test(s4)) {
3549
+ peg$currPos++;
3550
+ } else {
3551
+ s4 = peg$FAILED;
3552
+ if (peg$silentFails === 0) { peg$fail(peg$e15); }
3553
+ }
3554
+ if (s4 !== peg$FAILED) {
3555
+ while (s4 !== peg$FAILED) {
3556
+ s3.push(s4);
3557
+ s4 = input.charAt(peg$currPos);
3558
+ if (peg$r3.test(s4)) {
3559
+ peg$currPos++;
3560
+ } else {
3561
+ s4 = peg$FAILED;
3562
+ if (peg$silentFails === 0) { peg$fail(peg$e15); }
3563
+ }
3564
+ }
3565
+ } else {
3566
+ s3 = peg$FAILED;
3567
+ }
3568
+ if (s3 !== peg$FAILED) {
3569
+ s2 = input.substring(s2, peg$currPos);
3570
+ } else {
3571
+ s2 = s3;
3572
+ }
3573
+ if (s2 !== peg$FAILED) {
3574
+ peg$savedPos = s0;
3575
+ s0 = peg$f69(s2);
3576
+ } else {
3577
+ peg$currPos = s0;
3578
+ s0 = peg$FAILED;
3579
+ }
3580
+ } else {
3581
+ peg$currPos = s0;
3582
+ s0 = peg$FAILED;
3583
+ }
3584
+
3585
+ return s0;
3586
+ }
3587
+
3588
+ function peg$parseLockTypeCheck() {
3589
+ let s0, s1, s2, s3, s4;
3590
+
3591
+ s0 = peg$currPos;
3592
+ if (input.substr(peg$currPos, 5) === peg$c39) {
3593
+ s1 = peg$c39;
3594
+ peg$currPos += 5;
3595
+ } else {
3596
+ s1 = peg$FAILED;
3597
+ if (peg$silentFails === 0) { peg$fail(peg$e58); }
3598
+ }
3599
+ if (s1 !== peg$FAILED) {
3600
+ s2 = peg$currPos;
3601
+ s3 = [];
3602
+ s4 = input.charAt(peg$currPos);
3603
+ if (peg$r3.test(s4)) {
3604
+ peg$currPos++;
3605
+ } else {
3606
+ s4 = peg$FAILED;
3607
+ if (peg$silentFails === 0) { peg$fail(peg$e15); }
3608
+ }
3609
+ if (s4 !== peg$FAILED) {
3610
+ while (s4 !== peg$FAILED) {
3611
+ s3.push(s4);
3612
+ s4 = input.charAt(peg$currPos);
3613
+ if (peg$r3.test(s4)) {
3614
+ peg$currPos++;
3615
+ } else {
3616
+ s4 = peg$FAILED;
3617
+ if (peg$silentFails === 0) { peg$fail(peg$e15); }
3618
+ }
3619
+ }
3620
+ } else {
3621
+ s3 = peg$FAILED;
3622
+ }
3623
+ if (s3 !== peg$FAILED) {
3624
+ s2 = input.substring(s2, peg$currPos);
3625
+ } else {
3626
+ s2 = s3;
3627
+ }
3628
+ if (s2 !== peg$FAILED) {
3629
+ peg$savedPos = s0;
3630
+ s0 = peg$f70(s2);
3631
+ } else {
3632
+ peg$currPos = s0;
3633
+ s0 = peg$FAILED;
3634
+ }
3635
+ } else {
3636
+ peg$currPos = s0;
3637
+ s0 = peg$FAILED;
3638
+ }
3639
+
3640
+ return s0;
3641
+ }
3642
+
3643
+ function peg$parseLockAttrCheck() {
3644
+ let s0, s1, s2, s3, s4, s5, s6;
3645
+
3646
+ s0 = peg$currPos;
3647
+ if (input.substr(peg$currPos, 5) === peg$c40) {
3648
+ s1 = peg$c40;
3649
+ peg$currPos += 5;
3650
+ } else {
3651
+ s1 = peg$FAILED;
3652
+ if (peg$silentFails === 0) { peg$fail(peg$e59); }
3653
+ }
3654
+ if (s1 !== peg$FAILED) {
3655
+ s2 = peg$currPos;
3656
+ s3 = peg$currPos;
3657
+ s4 = input.charAt(peg$currPos);
3658
+ if (peg$r3.test(s4)) {
3659
+ peg$currPos++;
3660
+ } else {
3661
+ s4 = peg$FAILED;
3662
+ if (peg$silentFails === 0) { peg$fail(peg$e15); }
3663
+ }
3664
+ if (s4 !== peg$FAILED) {
3665
+ s5 = [];
3666
+ s6 = input.charAt(peg$currPos);
3667
+ if (peg$r2.test(s6)) {
3668
+ peg$currPos++;
3669
+ } else {
3670
+ s6 = peg$FAILED;
3671
+ if (peg$silentFails === 0) { peg$fail(peg$e11); }
3672
+ }
3673
+ while (s6 !== peg$FAILED) {
3674
+ s5.push(s6);
3675
+ s6 = input.charAt(peg$currPos);
3676
+ if (peg$r2.test(s6)) {
3677
+ peg$currPos++;
3678
+ } else {
3679
+ s6 = peg$FAILED;
3680
+ if (peg$silentFails === 0) { peg$fail(peg$e11); }
3681
+ }
3682
+ }
3683
+ s4 = [s4, s5];
3684
+ s3 = s4;
3685
+ } else {
3686
+ peg$currPos = s3;
3687
+ s3 = peg$FAILED;
3688
+ }
3689
+ if (s3 !== peg$FAILED) {
3690
+ s2 = input.substring(s2, peg$currPos);
3691
+ } else {
3692
+ s2 = s3;
3693
+ }
3694
+ if (s2 !== peg$FAILED) {
3695
+ peg$savedPos = s0;
3696
+ s0 = peg$f71(s2);
3697
+ } else {
3698
+ peg$currPos = s0;
3699
+ s0 = peg$FAILED;
3700
+ }
3701
+ } else {
3702
+ peg$currPos = s0;
3703
+ s0 = peg$FAILED;
3704
+ }
3705
+
3706
+ return s0;
3707
+ }
3708
+
3709
+ function peg$parseLockPlayerName() {
3710
+ let s0, s1, s2, s3, s4;
3711
+
3712
+ s0 = peg$currPos;
3713
+ if (input.charCodeAt(peg$currPos) === 61) {
3714
+ s1 = peg$c9;
3715
+ peg$currPos++;
3716
+ } else {
3717
+ s1 = peg$FAILED;
3718
+ if (peg$silentFails === 0) { peg$fail(peg$e13); }
3719
+ }
3720
+ if (s1 !== peg$FAILED) {
3721
+ s2 = peg$currPos;
3722
+ s3 = [];
3723
+ s4 = input.charAt(peg$currPos);
3724
+ if (peg$r18.test(s4)) {
3725
+ peg$currPos++;
3726
+ } else {
3727
+ s4 = peg$FAILED;
3728
+ if (peg$silentFails === 0) { peg$fail(peg$e60); }
3729
+ }
3730
+ if (s4 !== peg$FAILED) {
3731
+ while (s4 !== peg$FAILED) {
3732
+ s3.push(s4);
3733
+ s4 = input.charAt(peg$currPos);
3734
+ if (peg$r18.test(s4)) {
3735
+ peg$currPos++;
3736
+ } else {
3737
+ s4 = peg$FAILED;
3738
+ if (peg$silentFails === 0) { peg$fail(peg$e60); }
3739
+ }
3740
+ }
3741
+ } else {
3742
+ s3 = peg$FAILED;
3743
+ }
3744
+ if (s3 !== peg$FAILED) {
3745
+ s2 = input.substring(s2, peg$currPos);
3746
+ } else {
3747
+ s2 = s3;
3748
+ }
3749
+ if (s2 !== peg$FAILED) {
3750
+ peg$savedPos = s0;
3751
+ s0 = peg$f72(s2);
3752
+ } else {
3753
+ peg$currPos = s0;
3754
+ s0 = peg$FAILED;
3755
+ }
3756
+ } else {
3757
+ peg$currPos = s0;
3758
+ s0 = peg$FAILED;
3759
+ }
3760
+
3761
+ return s0;
3762
+ }
3763
+
3764
+ function peg$parse_() {
3765
+ let s0, s1;
3766
+
3767
+ s0 = [];
3768
+ s1 = input.charAt(peg$currPos);
3769
+ if (peg$r19.test(s1)) {
3770
+ peg$currPos++;
3771
+ } else {
3772
+ s1 = peg$FAILED;
3773
+ if (peg$silentFails === 0) { peg$fail(peg$e61); }
3774
+ }
3775
+ while (s1 !== peg$FAILED) {
3776
+ s0.push(s1);
3777
+ s1 = input.charAt(peg$currPos);
3778
+ if (peg$r19.test(s1)) {
3779
+ peg$currPos++;
3780
+ } else {
3781
+ s1 = peg$FAILED;
3782
+ if (peg$silentFails === 0) { peg$fail(peg$e61); }
3783
+ }
3784
+ }
3785
+
3786
+ return s0;
3787
+ }
3788
+
3789
+
3790
+ // Per-parse initializer: capture the `location` function for this parse run.
3791
+ // Called once at the start of every peg$parse() invocation.
3792
+ _loc = location;
3793
+
3794
+ peg$result = peg$startRuleFunction();
3795
+
3796
+ const peg$success = (peg$result !== peg$FAILED && peg$currPos === input.length);
3797
+ function peg$throw() {
3798
+ if (peg$result !== peg$FAILED && peg$currPos < input.length) {
3799
+ peg$fail(peg$endExpectation());
3800
+ }
3801
+
3802
+ throw peg$buildStructuredError(
3803
+ peg$maxFailExpected,
3804
+ peg$maxFailPos < input.length ? peg$getUnicode(peg$maxFailPos) : null,
3805
+ peg$maxFailPos < input.length
3806
+ ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)
3807
+ : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)
3808
+ );
3809
+ }
3810
+ if (options.peg$library) {
3811
+ return /** @type {any} */ ({
3812
+ peg$result,
3813
+ peg$currPos,
3814
+ peg$FAILED,
3815
+ peg$maxFailExpected,
3816
+ peg$maxFailPos,
3817
+ peg$success,
3818
+ peg$throw: peg$success ? undefined : peg$throw,
3819
+ });
3820
+ }
3821
+ if (peg$success) {
3822
+ return peg$result;
3823
+ } else {
3824
+ peg$throw();
3825
+ }
3826
+ }
3827
+
3828
+ const peg$allowedStartRules = [
3829
+ "Start",
3830
+ "LockExpr"
3831
+ ];
3832
+
3833
+ export {
3834
+ peg$allowedStartRules as StartRules,
3835
+ peg$SyntaxError as SyntaxError,
3836
+ peg$parse as parse
3837
+ };