state-machine-cat 12.0.21 → 12.0.23

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.
@@ -1,363 +1,349 @@
1
1
  import parserHelpers from "../parser-helpers.mjs";
2
- function peg$subclass(child, parent) {
3
- function C() {
4
- this.constructor = child;
5
- }
6
- C.prototype = parent.prototype;
7
- child.prototype = new C();
8
- }
9
- function peg$SyntaxError(message, expected, found, location) {
10
- var self = Error.call(this, message);
11
- if (Object.setPrototypeOf) {
12
- Object.setPrototypeOf(self, peg$SyntaxError.prototype);
13
- }
14
- self.expected = expected;
15
- self.found = found;
16
- self.location = location;
17
- self.name = "SyntaxError";
18
- return self;
19
- }
20
- peg$subclass(peg$SyntaxError, Error);
21
- function peg$padEnd(str, targetLength, padString) {
22
- padString = padString || " ";
23
- if (str.length > targetLength) {
2
+ class peg$SyntaxError extends SyntaxError {
3
+ constructor(message, expected, found, location) {
4
+ super(message);
5
+ this.expected = expected;
6
+ this.found = found;
7
+ this.location = location;
8
+ this.name = "SyntaxError";
9
+ }
10
+ format(sources) {
11
+ let str = "Error: " + this.message;
12
+ if (this.location) {
13
+ let src = null;
14
+ const st = sources.find((s) => s.source === this.location.source);
15
+ if (st) {
16
+ src = st.text.split(/\r\n|\n|\r/g);
17
+ }
18
+ const s = this.location.start;
19
+ const offset_s =
20
+ this.location.source &&
21
+ typeof this.location.source.offset === "function"
22
+ ? this.location.source.offset(s)
23
+ : s;
24
+ const loc =
25
+ this.location.source + ":" + offset_s.line + ":" + offset_s.column;
26
+ if (src) {
27
+ const e = this.location.end;
28
+ const filler = "".padEnd(offset_s.line.toString().length, " ");
29
+ const line = src[s.line - 1];
30
+ const last = s.line === e.line ? e.column : line.length + 1;
31
+ const hatLen = last - s.column || 1;
32
+ str +=
33
+ "\n --> " +
34
+ loc +
35
+ "\n" +
36
+ filler +
37
+ " |\n" +
38
+ offset_s.line +
39
+ " | " +
40
+ line +
41
+ "\n" +
42
+ filler +
43
+ " | " +
44
+ "".padEnd(s.column - 1, " ") +
45
+ "".padEnd(hatLen, "^");
46
+ } else {
47
+ str += "\n at " + loc;
48
+ }
49
+ }
24
50
  return str;
25
51
  }
26
- targetLength -= str.length;
27
- padString += padString.repeat(targetLength);
28
- return str + padString.slice(0, targetLength);
29
- }
30
- peg$SyntaxError.prototype.format = function (sources) {
31
- var str = "Error: " + this.message;
32
- if (this.location) {
33
- var src = null;
34
- var k;
35
- for (k = 0; k < sources.length; k++) {
36
- if (sources[k].source === this.location.source) {
37
- src = sources[k].text.split(/\r\n|\n|\r/g);
38
- break;
39
- }
40
- }
41
- var s = this.location.start;
42
- var offset_s =
43
- this.location.source && typeof this.location.source.offset === "function"
44
- ? this.location.source.offset(s)
45
- : s;
46
- var loc =
47
- this.location.source + ":" + offset_s.line + ":" + offset_s.column;
48
- if (src) {
49
- var e = this.location.end;
50
- var filler = peg$padEnd("", offset_s.line.toString().length, " ");
51
- var line = src[s.line - 1];
52
- var last = s.line === e.line ? e.column : line.length + 1;
53
- var hatLen = last - s.column || 1;
54
- str +=
55
- "\n --> " +
56
- loc +
57
- "\n" +
58
- filler +
59
- " |\n" +
60
- offset_s.line +
61
- " | " +
62
- line +
63
- "\n" +
64
- filler +
65
- " | " +
66
- peg$padEnd("", s.column - 1, " ") +
67
- peg$padEnd("", hatLen, "^");
68
- } else {
69
- str += "\n at " + loc;
52
+ static buildMessage(expected, found) {
53
+ function hex(ch) {
54
+ return ch.codePointAt(0).toString(16).toUpperCase();
55
+ }
56
+ const nonPrintable = Object.prototype.hasOwnProperty.call(
57
+ RegExp.prototype,
58
+ "unicode",
59
+ )
60
+ ? new RegExp("[\\p{C}\\p{Mn}\\p{Mc}]", "gu")
61
+ : null;
62
+ function unicodeEscape(s) {
63
+ if (nonPrintable) {
64
+ return s.replace(nonPrintable, (ch) => "\\u{" + hex(ch) + "}");
65
+ }
66
+ return s;
67
+ }
68
+ function literalEscape(s) {
69
+ return unicodeEscape(
70
+ s
71
+ .replace(/\\/g, "\\\\")
72
+ .replace(/"/g, '\\"')
73
+ .replace(/\0/g, "\\0")
74
+ .replace(/\t/g, "\\t")
75
+ .replace(/\n/g, "\\n")
76
+ .replace(/\r/g, "\\r")
77
+ .replace(/[\x00-\x0F]/g, (ch) => "\\x0" + hex(ch))
78
+ .replace(/[\x10-\x1F\x7F-\x9F]/g, (ch) => "\\x" + hex(ch)),
79
+ );
70
80
  }
71
- }
72
- return str;
73
- };
74
- peg$SyntaxError.buildMessage = function (expected, found) {
75
- var DESCRIBE_EXPECTATION_FNS = {
76
- literal: function (expectation) {
77
- return '"' + literalEscape(expectation.text) + '"';
78
- },
79
- class: function (expectation) {
80
- var escapedParts = expectation.parts.map(function (part) {
81
- return Array.isArray(part)
82
- ? classEscape(part[0]) + "-" + classEscape(part[1])
83
- : classEscape(part);
84
- });
85
- return (
86
- "[" + (expectation.inverted ? "^" : "") + escapedParts.join("") + "]"
81
+ function classEscape(s) {
82
+ return unicodeEscape(
83
+ s
84
+ .replace(/\\/g, "\\\\")
85
+ .replace(/\]/g, "\\]")
86
+ .replace(/\^/g, "\\^")
87
+ .replace(/-/g, "\\-")
88
+ .replace(/\0/g, "\\0")
89
+ .replace(/\t/g, "\\t")
90
+ .replace(/\n/g, "\\n")
91
+ .replace(/\r/g, "\\r")
92
+ .replace(/[\x00-\x0F]/g, (ch) => "\\x0" + hex(ch))
93
+ .replace(/[\x10-\x1F\x7F-\x9F]/g, (ch) => "\\x" + hex(ch)),
87
94
  );
88
- },
89
- any: function () {
90
- return "any character";
91
- },
92
- end: function () {
93
- return "end of input";
94
- },
95
- other: function (expectation) {
96
- return expectation.description;
97
- },
98
- };
99
- function hex(ch) {
100
- return ch.charCodeAt(0).toString(16).toUpperCase();
101
- }
102
- function literalEscape(s) {
103
- return s
104
- .replace(/\\/g, "\\\\")
105
- .replace(/"/g, '\\"')
106
- .replace(/\0/g, "\\0")
107
- .replace(/\t/g, "\\t")
108
- .replace(/\n/g, "\\n")
109
- .replace(/\r/g, "\\r")
110
- .replace(/[\x00-\x0F]/g, function (ch) {
111
- return "\\x0" + hex(ch);
112
- })
113
- .replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) {
114
- return "\\x" + hex(ch);
115
- });
116
- }
117
- function classEscape(s) {
118
- return s
119
- .replace(/\\/g, "\\\\")
120
- .replace(/\]/g, "\\]")
121
- .replace(/\^/g, "\\^")
122
- .replace(/-/g, "\\-")
123
- .replace(/\0/g, "\\0")
124
- .replace(/\t/g, "\\t")
125
- .replace(/\n/g, "\\n")
126
- .replace(/\r/g, "\\r")
127
- .replace(/[\x00-\x0F]/g, function (ch) {
128
- return "\\x0" + hex(ch);
129
- })
130
- .replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) {
131
- return "\\x" + hex(ch);
132
- });
133
- }
134
- function describeExpectation(expectation) {
135
- return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
136
- }
137
- function describeExpected(expected) {
138
- var descriptions = expected.map(describeExpectation);
139
- var i, j;
140
- descriptions.sort();
141
- if (descriptions.length > 0) {
142
- for (i = 1, j = 1; i < descriptions.length; i++) {
143
- if (descriptions[i - 1] !== descriptions[i]) {
144
- descriptions[j] = descriptions[i];
145
- j++;
146
- }
147
- }
148
- descriptions.length = j;
149
- }
150
- switch (descriptions.length) {
151
- case 1:
152
- return descriptions[0];
153
- case 2:
154
- return descriptions[0] + " or " + descriptions[1];
155
- default:
95
+ }
96
+ const DESCRIBE_EXPECTATION_FNS = {
97
+ literal(expectation) {
98
+ return '"' + literalEscape(expectation.text) + '"';
99
+ },
100
+ class(expectation) {
101
+ const escapedParts = expectation.parts.map((part) =>
102
+ Array.isArray(part)
103
+ ? classEscape(part[0]) + "-" + classEscape(part[1])
104
+ : classEscape(part),
105
+ );
156
106
  return (
157
- descriptions.slice(0, -1).join(", ") +
158
- ", or " +
159
- descriptions[descriptions.length - 1]
107
+ "[" +
108
+ (expectation.inverted ? "^" : "") +
109
+ escapedParts.join("") +
110
+ "]" +
111
+ (expectation.unicode ? "u" : "")
160
112
  );
161
- }
162
- }
163
- function describeFound(found) {
164
- return found ? '"' + literalEscape(found) + '"' : "end of input";
113
+ },
114
+ any() {
115
+ return "any character";
116
+ },
117
+ end() {
118
+ return "end of input";
119
+ },
120
+ other(expectation) {
121
+ return expectation.description;
122
+ },
123
+ };
124
+ function describeExpectation(expectation) {
125
+ return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
126
+ }
127
+ function describeExpected(expected) {
128
+ const descriptions = expected.map(describeExpectation);
129
+ descriptions.sort();
130
+ if (descriptions.length > 0) {
131
+ let j = 1;
132
+ for (let i = 1; i < descriptions.length; i++) {
133
+ if (descriptions[i - 1] !== descriptions[i]) {
134
+ descriptions[j] = descriptions[i];
135
+ j++;
136
+ }
137
+ }
138
+ descriptions.length = j;
139
+ }
140
+ switch (descriptions.length) {
141
+ case 1:
142
+ return descriptions[0];
143
+ case 2:
144
+ return descriptions[0] + " or " + descriptions[1];
145
+ default:
146
+ return (
147
+ descriptions.slice(0, -1).join(", ") +
148
+ ", or " +
149
+ descriptions[descriptions.length - 1]
150
+ );
151
+ }
152
+ }
153
+ function describeFound(found) {
154
+ return found ? '"' + literalEscape(found) + '"' : "end of input";
155
+ }
156
+ return (
157
+ "Expected " +
158
+ describeExpected(expected) +
159
+ " but " +
160
+ describeFound(found) +
161
+ " found."
162
+ );
165
163
  }
166
- return (
167
- "Expected " +
168
- describeExpected(expected) +
169
- " but " +
170
- describeFound(found) +
171
- " found."
172
- );
173
- };
164
+ }
174
165
  function peg$parse(input, options) {
175
166
  options = options !== undefined ? options : {};
176
- var peg$FAILED = {};
177
- var peg$source = options.grammarSource;
178
- var peg$startRuleFunctions = { program: peg$parseprogram };
179
- var peg$startRuleFunction = peg$parseprogram;
180
- var peg$c0 = ",";
181
- var peg$c1 = ";";
182
- var peg$c2 = "[";
183
- var peg$c3 = "]";
184
- var peg$c4 = ":";
185
- var peg$c5 = "{";
186
- var peg$c6 = "}";
187
- var peg$c7 = "=";
188
- var peg$c8 = "label";
189
- var peg$c9 = "color";
190
- var peg$c10 = "class";
191
- var peg$c11 = "active";
192
- var peg$c12 = "type";
193
- var peg$c13 = "regular";
194
- var peg$c14 = "initial";
195
- var peg$c15 = "terminate";
196
- var peg$c16 = "final";
197
- var peg$c17 = "parallel";
198
- var peg$c18 = "history";
199
- var peg$c19 = "deephistory";
200
- var peg$c20 = "choice";
201
- var peg$c21 = "forkjoin";
202
- var peg$c22 = "fork";
203
- var peg$c23 = "join";
204
- var peg$c24 = "junction";
205
- var peg$c25 = "width";
206
- var peg$c26 = "external";
207
- var peg$c27 = "internal";
208
- var peg$c28 = "->";
209
- var peg$c29 = "=>>";
210
- var peg$c30 = "=>";
211
- var peg$c31 = ">>";
212
- var peg$c32 = ":>";
213
- var peg$c33 = "--";
214
- var peg$c34 = "==";
215
- var peg$c35 = "<-";
216
- var peg$c36 = "<<=";
217
- var peg$c37 = "<=";
218
- var peg$c38 = "<<";
219
- var peg$c39 = "<:";
220
- var peg$c40 = "#";
221
- var peg$c41 = ".";
222
- var peg$c42 = '"';
223
- var peg$c43 = '\\"';
224
- var peg$c44 = "/*";
225
- var peg$c45 = "*/";
226
- var peg$c46 = "//";
227
- var peg$r0 = /^[0-9]/;
228
- var peg$r1 = /^[a-zA-Z0-9_\- ]/;
229
- var peg$r2 = /^[,;{]/;
230
- var peg$r3 = /^[;{]/;
231
- var peg$r4 = /^[^;, "\t\n\r=\-><:{[]/;
232
- var peg$r5 = /^[ \t]/;
233
- var peg$r6 = /^[\r\n]/;
234
- var peg$r7 = /^[^\r\n]/;
235
- var peg$e0 = peg$otherExpectation("statemachine");
236
- var peg$e1 = peg$literalExpectation(",", false);
237
- var peg$e2 = peg$literalExpectation(";", false);
238
- var peg$e3 = peg$otherExpectation("state");
239
- var peg$e4 = peg$literalExpectation("[", false);
240
- var peg$e5 = peg$literalExpectation("]", false);
241
- var peg$e6 = peg$literalExpectation(":", false);
242
- var peg$e7 = peg$literalExpectation("{", false);
243
- var peg$e8 = peg$literalExpectation("}", false);
244
- var peg$e9 = peg$otherExpectation("extended state attributes");
245
- var peg$e10 = peg$otherExpectation("extended state attribute");
246
- var peg$e11 = peg$literalExpectation("=", false);
247
- var peg$e12 = peg$otherExpectation("state attribute name");
248
- var peg$e13 = peg$literalExpectation("label", true);
249
- var peg$e14 = peg$literalExpectation("color", true);
250
- var peg$e15 = peg$otherExpectation("class attribute");
251
- var peg$e16 = peg$literalExpectation("class", true);
252
- var peg$e17 = peg$otherExpectation("state flag");
253
- var peg$e18 = peg$literalExpectation("active", true);
254
- var peg$e19 = peg$otherExpectation("state type");
255
- var peg$e20 = peg$literalExpectation("type", true);
256
- var peg$e21 = peg$otherExpectation("state type type");
257
- var peg$e22 = peg$literalExpectation("regular", false);
258
- var peg$e23 = peg$literalExpectation("initial", false);
259
- var peg$e24 = peg$literalExpectation("terminate", false);
260
- var peg$e25 = peg$literalExpectation("final", false);
261
- var peg$e26 = peg$literalExpectation("parallel", false);
262
- var peg$e27 = peg$literalExpectation("history", false);
263
- var peg$e28 = peg$literalExpectation("deephistory", false);
264
- var peg$e29 = peg$literalExpectation("choice", false);
265
- var peg$e30 = peg$literalExpectation("forkjoin", false);
266
- var peg$e31 = peg$literalExpectation("fork", false);
267
- var peg$e32 = peg$literalExpectation("join", false);
268
- var peg$e33 = peg$literalExpectation("junction", false);
269
- var peg$e34 = peg$otherExpectation("transition");
270
- var peg$e35 = peg$otherExpectation("extended transition attributes");
271
- var peg$e36 = peg$otherExpectation("extended transition attribute");
272
- var peg$e37 = peg$otherExpectation("transition attribute name");
273
- var peg$e38 = peg$otherExpectation("transition type name");
274
- var peg$e39 = peg$otherExpectation("numeric transition attribute name");
275
- var peg$e40 = peg$literalExpectation("width", true);
276
- var peg$e41 = peg$otherExpectation("transition type value");
277
- var peg$e42 = peg$literalExpectation("external", false);
278
- var peg$e43 = peg$literalExpectation("internal", false);
279
- var peg$e44 = peg$otherExpectation("left to right arrow");
280
- var peg$e45 = peg$literalExpectation("->", false);
281
- var peg$e46 = peg$literalExpectation("=>>", false);
282
- var peg$e47 = peg$literalExpectation("=>", false);
283
- var peg$e48 = peg$literalExpectation(">>", false);
284
- var peg$e49 = peg$literalExpectation(":>", false);
285
- var peg$e50 = peg$literalExpectation("--", false);
286
- var peg$e51 = peg$literalExpectation("==", false);
287
- var peg$e52 = peg$otherExpectation("right to left arrow");
288
- var peg$e53 = peg$literalExpectation("<-", false);
289
- var peg$e54 = peg$literalExpectation("<<=", false);
290
- var peg$e55 = peg$literalExpectation("<=", false);
291
- var peg$e56 = peg$literalExpectation("<<", false);
292
- var peg$e57 = peg$literalExpectation("<:", false);
293
- var peg$e58 = peg$literalExpectation("#", false);
294
- var peg$e59 = peg$literalExpectation(".", false);
295
- var peg$e60 = peg$classExpectation([["0", "9"]], false, false);
296
- var peg$e61 = peg$otherExpectation("double quoted string");
297
- var peg$e62 = peg$literalExpectation('"', false);
298
- var peg$e63 = peg$literalExpectation('\\"', false);
299
- var peg$e64 = peg$anyExpectation();
300
- var peg$e65 = peg$otherExpectation("valid class string");
301
- var peg$e66 = peg$classExpectation(
167
+ const peg$FAILED = {};
168
+ const peg$source = options.grammarSource;
169
+ const peg$startRuleFunctions = {
170
+ program: peg$parseprogram,
171
+ };
172
+ let peg$startRuleFunction = peg$parseprogram;
173
+ const peg$c0 = ",";
174
+ const peg$c1 = ";";
175
+ const peg$c2 = "[";
176
+ const peg$c3 = "]";
177
+ const peg$c4 = ":";
178
+ const peg$c5 = "{";
179
+ const peg$c6 = "}";
180
+ const peg$c7 = "=";
181
+ const peg$c8 = "label";
182
+ const peg$c9 = "color";
183
+ const peg$c10 = "class";
184
+ const peg$c11 = "active";
185
+ const peg$c12 = "type";
186
+ const peg$c13 = "regular";
187
+ const peg$c14 = "initial";
188
+ const peg$c15 = "terminate";
189
+ const peg$c16 = "final";
190
+ const peg$c17 = "parallel";
191
+ const peg$c18 = "history";
192
+ const peg$c19 = "deephistory";
193
+ const peg$c20 = "choice";
194
+ const peg$c21 = "forkjoin";
195
+ const peg$c22 = "fork";
196
+ const peg$c23 = "join";
197
+ const peg$c24 = "junction";
198
+ const peg$c25 = "width";
199
+ const peg$c26 = "external";
200
+ const peg$c27 = "internal";
201
+ const peg$c28 = "->";
202
+ const peg$c29 = "=>>";
203
+ const peg$c30 = "=>";
204
+ const peg$c31 = ">>";
205
+ const peg$c32 = ":>";
206
+ const peg$c33 = "--";
207
+ const peg$c34 = "==";
208
+ const peg$c35 = "<-";
209
+ const peg$c36 = "<<=";
210
+ const peg$c37 = "<=";
211
+ const peg$c38 = "<<";
212
+ const peg$c39 = "<:";
213
+ const peg$c40 = "#";
214
+ const peg$c41 = ".";
215
+ const peg$c42 = '"';
216
+ const peg$c43 = '\\"';
217
+ const peg$c44 = "/*";
218
+ const peg$c45 = "*/";
219
+ const peg$c46 = "//";
220
+ const peg$r0 = /^[0-9]/;
221
+ const peg$r1 = /^[a-zA-Z0-9_\- ]/;
222
+ const peg$r2 = /^[,;{]/;
223
+ const peg$r3 = /^[;{]/;
224
+ const peg$r4 = /^[^;, "\t\n\r=\-><:{[]/;
225
+ const peg$r5 = /^[ \t]/;
226
+ const peg$r6 = /^[\r\n]/;
227
+ const peg$r7 = /^[^\r\n]/;
228
+ const peg$e0 = peg$literalExpectation(",", false);
229
+ const peg$e1 = peg$literalExpectation(";", false);
230
+ const peg$e2 = peg$otherExpectation("state");
231
+ const peg$e3 = peg$literalExpectation("[", false);
232
+ const peg$e4 = peg$literalExpectation("]", false);
233
+ const peg$e5 = peg$literalExpectation(":", false);
234
+ const peg$e6 = peg$literalExpectation("{", false);
235
+ const peg$e7 = peg$literalExpectation("}", false);
236
+ const peg$e8 = peg$otherExpectation("extended state attribute");
237
+ const peg$e9 = peg$literalExpectation("=", false);
238
+ const peg$e10 = peg$otherExpectation("state attribute name");
239
+ const peg$e11 = peg$literalExpectation("label", true);
240
+ const peg$e12 = peg$literalExpectation("color", true);
241
+ const peg$e13 = peg$otherExpectation("class attribute");
242
+ const peg$e14 = peg$literalExpectation("class", true);
243
+ const peg$e15 = peg$otherExpectation("state flag");
244
+ const peg$e16 = peg$literalExpectation("active", true);
245
+ const peg$e17 = peg$otherExpectation("state type");
246
+ const peg$e18 = peg$literalExpectation("type", true);
247
+ const peg$e19 = peg$otherExpectation("state type type");
248
+ const peg$e20 = peg$literalExpectation("regular", false);
249
+ const peg$e21 = peg$literalExpectation("initial", false);
250
+ const peg$e22 = peg$literalExpectation("terminate", false);
251
+ const peg$e23 = peg$literalExpectation("final", false);
252
+ const peg$e24 = peg$literalExpectation("parallel", false);
253
+ const peg$e25 = peg$literalExpectation("history", false);
254
+ const peg$e26 = peg$literalExpectation("deephistory", false);
255
+ const peg$e27 = peg$literalExpectation("choice", false);
256
+ const peg$e28 = peg$literalExpectation("forkjoin", false);
257
+ const peg$e29 = peg$literalExpectation("fork", false);
258
+ const peg$e30 = peg$literalExpectation("join", false);
259
+ const peg$e31 = peg$literalExpectation("junction", false);
260
+ const peg$e32 = peg$otherExpectation("transition");
261
+ const peg$e33 = peg$otherExpectation("extended transition attribute");
262
+ const peg$e34 = peg$otherExpectation("transition attribute name");
263
+ const peg$e35 = peg$otherExpectation("transition type name");
264
+ const peg$e36 = peg$otherExpectation("numeric transition attribute name");
265
+ const peg$e37 = peg$literalExpectation("width", true);
266
+ const peg$e38 = peg$otherExpectation("transition type value");
267
+ const peg$e39 = peg$literalExpectation("external", false);
268
+ const peg$e40 = peg$literalExpectation("internal", false);
269
+ const peg$e41 = peg$otherExpectation("left to right arrow");
270
+ const peg$e42 = peg$literalExpectation("->", false);
271
+ const peg$e43 = peg$literalExpectation("=>>", false);
272
+ const peg$e44 = peg$literalExpectation("=>", false);
273
+ const peg$e45 = peg$literalExpectation(">>", false);
274
+ const peg$e46 = peg$literalExpectation(":>", false);
275
+ const peg$e47 = peg$literalExpectation("--", false);
276
+ const peg$e48 = peg$literalExpectation("==", false);
277
+ const peg$e49 = peg$otherExpectation("right to left arrow");
278
+ const peg$e50 = peg$literalExpectation("<-", false);
279
+ const peg$e51 = peg$literalExpectation("<<=", false);
280
+ const peg$e52 = peg$literalExpectation("<=", false);
281
+ const peg$e53 = peg$literalExpectation("<<", false);
282
+ const peg$e54 = peg$literalExpectation("<:", false);
283
+ const peg$e55 = peg$literalExpectation("#", false);
284
+ const peg$e56 = peg$literalExpectation(".", false);
285
+ const peg$e57 = peg$classExpectation([["0", "9"]], false, false, false);
286
+ const peg$e58 = peg$otherExpectation("double quoted string");
287
+ const peg$e59 = peg$literalExpectation('"', false);
288
+ const peg$e60 = peg$literalExpectation('\\"', false);
289
+ const peg$e61 = peg$anyExpectation();
290
+ const peg$e62 = peg$otherExpectation("valid class string");
291
+ const peg$e63 = peg$classExpectation(
302
292
  [["a", "z"], ["A", "Z"], ["0", "9"], "_", "-", " "],
303
293
  false,
304
294
  false,
295
+ false,
305
296
  );
306
- var peg$e67 = peg$classExpectation([",", ";", "{"], false, false);
307
- var peg$e68 = peg$classExpectation([";", "{"], false, false);
308
- var peg$e69 = peg$otherExpectation("identifier");
309
- var peg$e70 = peg$classExpectation(
297
+ const peg$e64 = peg$classExpectation([",", ";", "{"], false, false, false);
298
+ const peg$e65 = peg$classExpectation([";", "{"], false, false, false);
299
+ const peg$e66 = peg$otherExpectation("identifier");
300
+ const peg$e67 = peg$classExpectation(
310
301
  [";", ",", " ", '"', "\t", "\n", "\r", "=", "-", ">", "<", ":", "{", "["],
311
302
  true,
312
303
  false,
304
+ false,
313
305
  );
314
- var peg$e71 = peg$otherExpectation("whitespace");
315
- var peg$e72 = peg$classExpectation([" ", "\t"], false, false);
316
- var peg$e73 = peg$otherExpectation("line end");
317
- var peg$e74 = peg$classExpectation(["\r", "\n"], false, false);
318
- var peg$e75 = peg$literalExpectation("/*", false);
319
- var peg$e76 = peg$literalExpectation("*/", false);
320
- var peg$e77 = peg$literalExpectation("//", false);
321
- var peg$e78 = peg$classExpectation(["\r", "\n"], true, false);
322
- var peg$e79 = peg$otherExpectation("comment");
323
- var peg$f0 = function (statemachine) {
306
+ const peg$e68 = peg$otherExpectation("whitespace");
307
+ const peg$e69 = peg$classExpectation([" ", "\t"], false, false, false);
308
+ const peg$e70 = peg$otherExpectation("line end");
309
+ const peg$e71 = peg$classExpectation(["\r", "\n"], false, false, false);
310
+ const peg$e72 = peg$literalExpectation("/*", false);
311
+ const peg$e73 = peg$literalExpectation("*/", false);
312
+ const peg$e74 = peg$literalExpectation("//", false);
313
+ const peg$e75 = peg$classExpectation(["\r", "\n"], true, false, false);
314
+ const peg$e76 = peg$otherExpectation("comment");
315
+ function peg$f0(statemachine) {
324
316
  statemachine.states = parserHelpers.extractUndeclaredStates(statemachine);
325
317
  return parserHelpers.classifyForkJoins(statemachine);
326
- };
327
- var peg$f1 = function (states, transitions) {
318
+ }
319
+ function peg$f1(states, transitions) {
328
320
  let lStateMachine = {};
329
321
  parserHelpers.setIf(lStateMachine, "states", states);
330
322
  parserHelpers.setIfNotEmpty(lStateMachine, "transitions", transitions);
331
323
  return lStateMachine;
332
- };
333
- var peg$f2 = function (state) {
324
+ }
325
+ function peg$f2(state) {
334
326
  return state;
335
- };
336
- var peg$f3 = function (state) {
327
+ }
328
+ function peg$f3(state) {
337
329
  return state;
338
- };
339
- var peg$f4 = function (states) {
330
+ }
331
+ function peg$f4(states) {
340
332
  return parserHelpers.uniq(
341
333
  states[0].concat(states[1]),
342
334
  parserHelpers.stateEqual,
343
335
  );
344
- };
345
- var peg$f5 = function (notes, id, attrs) {
336
+ }
337
+ function peg$f5(notes, id, attrs) {
346
338
  return attrs;
347
- };
348
- var peg$f6 = function (notes, id, extended_state_attributes, act) {
339
+ }
340
+ function peg$f6(notes, id, extended_state_attributes, act) {
349
341
  return act;
350
- };
351
- var peg$f7 = function (notes, id, extended_state_attributes, actions, sm) {
342
+ }
343
+ function peg$f7(notes, id, extended_state_attributes, actions, sm) {
352
344
  return sm;
353
- };
354
- var peg$f8 = function (
355
- notes,
356
- id,
357
- extended_state_attributes,
358
- actions,
359
- statemachine,
360
- ) {
345
+ }
346
+ function peg$f8(notes, id, extended_state_attributes, actions, statemachine) {
361
347
  let lState = parserHelpers.initState(id);
362
348
  (extended_state_attributes || []).forEach((pExtendedAttribute) =>
363
349
  parserHelpers.setIf(
@@ -383,38 +369,38 @@ function peg$parse(input, options) {
383
369
  );
384
370
  }
385
371
  return lState;
386
- };
387
- var peg$f9 = function (name, value) {
372
+ }
373
+ function peg$f9(name, value) {
388
374
  return { name, value };
389
- };
390
- var peg$f10 = function (name, value) {
375
+ }
376
+ function peg$f10(name, value) {
391
377
  return { name, value };
392
- };
393
- var peg$f11 = function (name) {
378
+ }
379
+ function peg$f11(name) {
394
380
  return { name, value: true };
395
- };
396
- var peg$f12 = function (name, value) {
381
+ }
382
+ function peg$f12(name, value) {
397
383
  return { name, value, typeExplicitlySet: true };
398
- };
399
- var peg$f13 = function (name) {
384
+ }
385
+ function peg$f13(name) {
400
386
  return name.toLowerCase();
401
- };
402
- var peg$f14 = function (name) {
387
+ }
388
+ function peg$f14(name) {
403
389
  return name.toLowerCase();
404
- };
405
- var peg$f15 = function (name) {
390
+ }
391
+ function peg$f15(name) {
406
392
  return name.toLowerCase();
407
- };
408
- var peg$f16 = function (name) {
393
+ }
394
+ function peg$f16(name) {
409
395
  return name.toLowerCase();
410
- };
411
- var peg$f17 = function (notes, trans, attrs) {
396
+ }
397
+ function peg$f17(notes, trans, attrs) {
412
398
  return attrs;
413
- };
414
- var peg$f18 = function (notes, trans, extended_attributes, lbl) {
399
+ }
400
+ function peg$f18(notes, trans, extended_attributes, lbl) {
415
401
  return lbl;
416
- };
417
- var peg$f19 = function (notes, trans, extended_attributes, label) {
402
+ }
403
+ function peg$f19(notes, trans, extended_attributes, label) {
418
404
  if (label) {
419
405
  trans.label = label;
420
406
  trans = Object.assign(
@@ -432,83 +418,83 @@ function peg$parse(input, options) {
432
418
  parserHelpers.setIfNotEmpty(trans, "note", notes);
433
419
  trans.id = options.counter.next();
434
420
  return trans;
435
- };
436
- var peg$f20 = function (from_, to) {
421
+ }
422
+ function peg$f20(from_, to) {
437
423
  return {
438
424
  from: from_,
439
425
  to: to,
440
426
  };
441
- };
442
- var peg$f21 = function (to, from_) {
427
+ }
428
+ function peg$f21(to, from_) {
443
429
  return {
444
430
  from: from_,
445
431
  to: to,
446
432
  };
447
- };
448
- var peg$f22 = function (name, value) {
433
+ }
434
+ function peg$f22(name, value) {
449
435
  return { name, value };
450
- };
451
- var peg$f23 = function (name, value) {
436
+ }
437
+ function peg$f23(name, value) {
452
438
  return { name, value };
453
- };
454
- var peg$f24 = function (name, value) {
439
+ }
440
+ function peg$f24(name, value) {
455
441
  return { name, value };
456
- };
457
- var peg$f25 = function (name, value) {
442
+ }
443
+ function peg$f25(name, value) {
458
444
  return { name, value };
459
- };
460
- var peg$f26 = function (name) {
445
+ }
446
+ function peg$f26(name) {
461
447
  return name.toLowerCase();
462
- };
463
- var peg$f27 = function (name) {
448
+ }
449
+ function peg$f27(name) {
464
450
  return name.toLowerCase();
465
- };
466
- var peg$f28 = function (name) {
451
+ }
452
+ function peg$f28(name) {
467
453
  return name;
468
- };
469
- var peg$f29 = function (com) {
454
+ }
455
+ function peg$f29(com) {
470
456
  return com.join("").trim();
471
- };
472
- var peg$f30 = function (digits) {
457
+ }
458
+ function peg$f30(digits) {
473
459
  return parseFloat(digits.join(""));
474
- };
475
- var peg$f31 = function (digits) {
460
+ }
461
+ function peg$f31(digits) {
476
462
  return parseInt(digits.join(""), 10);
477
- };
478
- var peg$f32 = function (s) {
463
+ }
464
+ function peg$f32(s) {
479
465
  return s.join("").replace(/\\\"/g, '"');
480
- };
481
- var peg$f33 = function (c) {
466
+ }
467
+ function peg$f33(c) {
482
468
  return c;
483
- };
484
- var peg$f34 = function (s) {
469
+ }
470
+ function peg$f34(s) {
485
471
  return s.join("");
486
- };
487
- var peg$f35 = function (c) {
472
+ }
473
+ function peg$f35(c) {
488
474
  return c;
489
- };
490
- var peg$f36 = function (s) {
475
+ }
476
+ function peg$f36(s) {
491
477
  return s.join("").trim();
492
- };
493
- var peg$f37 = function (s) {
478
+ }
479
+ function peg$f37(s) {
494
480
  return s.join("").trim();
495
- };
496
- var peg$f38 = function (c) {
481
+ }
482
+ function peg$f38(c) {
497
483
  return c;
498
- };
499
- var peg$f39 = function (c) {
484
+ }
485
+ function peg$f39(c) {
500
486
  return c;
501
- };
502
- var peg$f40 = function (chars) {
487
+ }
488
+ function peg$f40(chars) {
503
489
  return chars.join("");
504
- };
505
- var peg$currPos = options.peg$currPos | 0;
506
- var peg$savedPos = peg$currPos;
507
- var peg$posDetailsCache = [{ line: 1, column: 1 }];
508
- var peg$maxFailPos = peg$currPos;
509
- var peg$maxFailExpected = options.peg$maxFailExpected || [];
510
- var peg$silentFails = options.peg$silentFails | 0;
511
- var peg$result;
490
+ }
491
+ let peg$currPos = options.peg$currPos | 0;
492
+ let peg$savedPos = peg$currPos;
493
+ const peg$posDetailsCache = [{ line: 1, column: 1 }];
494
+ let peg$maxFailPos = peg$currPos;
495
+ let peg$maxFailExpected = options.peg$maxFailExpected || [];
496
+ let peg$silentFails = options.peg$silentFails | 0;
497
+ let peg$result;
512
498
  if (options.startRule) {
513
499
  if (!(options.startRule in peg$startRuleFunctions)) {
514
500
  throw new Error(
@@ -551,16 +537,18 @@ function peg$parse(input, options) {
551
537
  : peg$computeLocation(peg$savedPos, peg$currPos);
552
538
  throw peg$buildSimpleError(message, location);
553
539
  }
540
+ function peg$getUnicode(pos = peg$currPos) {
541
+ const cp = input.codePointAt(pos);
542
+ if (cp === undefined) {
543
+ return "";
544
+ }
545
+ return String.fromCodePoint(cp);
546
+ }
554
547
  function peg$literalExpectation(text, ignoreCase) {
555
- return { type: "literal", text: text, ignoreCase: ignoreCase };
548
+ return { type: "literal", text, ignoreCase };
556
549
  }
557
- function peg$classExpectation(parts, inverted, ignoreCase) {
558
- return {
559
- type: "class",
560
- parts: parts,
561
- inverted: inverted,
562
- ignoreCase: ignoreCase,
563
- };
550
+ function peg$classExpectation(parts, inverted, ignoreCase, unicode) {
551
+ return { type: "class", parts, inverted, ignoreCase, unicode };
564
552
  }
565
553
  function peg$anyExpectation() {
566
554
  return { type: "any" };
@@ -569,11 +557,11 @@ function peg$parse(input, options) {
569
557
  return { type: "end" };
570
558
  }
571
559
  function peg$otherExpectation(description) {
572
- return { type: "other", description: description };
560
+ return { type: "other", description };
573
561
  }
574
562
  function peg$computePosDetails(pos) {
575
- var details = peg$posDetailsCache[pos];
576
- var p;
563
+ let details = peg$posDetailsCache[pos];
564
+ let p;
577
565
  if (details) {
578
566
  return details;
579
567
  } else {
@@ -602,9 +590,9 @@ function peg$parse(input, options) {
602
590
  }
603
591
  }
604
592
  function peg$computeLocation(startPos, endPos, offset) {
605
- var startPosDetails = peg$computePosDetails(startPos);
606
- var endPosDetails = peg$computePosDetails(endPos);
607
- var res = {
593
+ const startPosDetails = peg$computePosDetails(startPos);
594
+ const endPosDetails = peg$computePosDetails(endPos);
595
+ const res = {
608
596
  source: peg$source,
609
597
  start: {
610
598
  offset: startPos,
@@ -645,7 +633,7 @@ function peg$parse(input, options) {
645
633
  );
646
634
  }
647
635
  function peg$parseprogram() {
648
- var s0, s1, s2, s3;
636
+ let s0, s1, s2, s3;
649
637
  s0 = peg$currPos;
650
638
  s1 = peg$parse_();
651
639
  s2 = peg$parsestatemachine();
@@ -655,7 +643,7 @@ function peg$parse(input, options) {
655
643
  return s0;
656
644
  }
657
645
  function peg$parsestatemachine() {
658
- var s0, s1, s2, s3;
646
+ let s0, s1, s2, s3;
659
647
  peg$silentFails++;
660
648
  s0 = peg$currPos;
661
649
  s1 = peg$parsestates();
@@ -671,14 +659,10 @@ function peg$parse(input, options) {
671
659
  peg$savedPos = s0;
672
660
  s0 = peg$f1(s1, s2);
673
661
  peg$silentFails--;
674
- s1 = peg$FAILED;
675
- if (peg$silentFails === 0) {
676
- peg$fail(peg$e0);
677
- }
678
662
  return s0;
679
663
  }
680
664
  function peg$parsestates() {
681
- var s0, s1, s2, s3, s4, s5;
665
+ let s0, s1, s2, s3, s4, s5;
682
666
  s0 = peg$currPos;
683
667
  s1 = peg$currPos;
684
668
  s2 = [];
@@ -691,7 +675,7 @@ function peg$parse(input, options) {
691
675
  } else {
692
676
  s5 = peg$FAILED;
693
677
  if (peg$silentFails === 0) {
694
- peg$fail(peg$e1);
678
+ peg$fail(peg$e0);
695
679
  }
696
680
  }
697
681
  if (s5 !== peg$FAILED) {
@@ -716,7 +700,7 @@ function peg$parse(input, options) {
716
700
  } else {
717
701
  s5 = peg$FAILED;
718
702
  if (peg$silentFails === 0) {
719
- peg$fail(peg$e1);
703
+ peg$fail(peg$e0);
720
704
  }
721
705
  }
722
706
  if (s5 !== peg$FAILED) {
@@ -740,7 +724,7 @@ function peg$parse(input, options) {
740
724
  } else {
741
725
  s5 = peg$FAILED;
742
726
  if (peg$silentFails === 0) {
743
- peg$fail(peg$e2);
727
+ peg$fail(peg$e1);
744
728
  }
745
729
  }
746
730
  if (s5 !== peg$FAILED) {
@@ -769,7 +753,7 @@ function peg$parse(input, options) {
769
753
  return s0;
770
754
  }
771
755
  function peg$parsestate() {
772
- var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14;
756
+ let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14;
773
757
  peg$silentFails++;
774
758
  s0 = peg$currPos;
775
759
  s1 = [];
@@ -789,7 +773,7 @@ function peg$parse(input, options) {
789
773
  } else {
790
774
  s6 = peg$FAILED;
791
775
  if (peg$silentFails === 0) {
792
- peg$fail(peg$e4);
776
+ peg$fail(peg$e3);
793
777
  }
794
778
  }
795
779
  if (s6 !== peg$FAILED) {
@@ -800,7 +784,7 @@ function peg$parse(input, options) {
800
784
  } else {
801
785
  s8 = peg$FAILED;
802
786
  if (peg$silentFails === 0) {
803
- peg$fail(peg$e5);
787
+ peg$fail(peg$e4);
804
788
  }
805
789
  }
806
790
  if (s8 !== peg$FAILED) {
@@ -825,7 +809,7 @@ function peg$parse(input, options) {
825
809
  } else {
826
810
  s8 = peg$FAILED;
827
811
  if (peg$silentFails === 0) {
828
- peg$fail(peg$e6);
812
+ peg$fail(peg$e5);
829
813
  }
830
814
  }
831
815
  if (s8 !== peg$FAILED) {
@@ -854,7 +838,7 @@ function peg$parse(input, options) {
854
838
  } else {
855
839
  s10 = peg$FAILED;
856
840
  if (peg$silentFails === 0) {
857
- peg$fail(peg$e7);
841
+ peg$fail(peg$e6);
858
842
  }
859
843
  }
860
844
  if (s10 !== peg$FAILED) {
@@ -868,7 +852,7 @@ function peg$parse(input, options) {
868
852
  } else {
869
853
  s14 = peg$FAILED;
870
854
  if (peg$silentFails === 0) {
871
- peg$fail(peg$e8);
855
+ peg$fail(peg$e7);
872
856
  }
873
857
  }
874
858
  if (s14 !== peg$FAILED) {
@@ -900,13 +884,13 @@ function peg$parse(input, options) {
900
884
  if (s0 === peg$FAILED) {
901
885
  s1 = peg$FAILED;
902
886
  if (peg$silentFails === 0) {
903
- peg$fail(peg$e3);
887
+ peg$fail(peg$e2);
904
888
  }
905
889
  }
906
890
  return s0;
907
891
  }
908
892
  function peg$parseextended_state_attributes() {
909
- var s0, s1;
893
+ let s0, s1;
910
894
  peg$silentFails++;
911
895
  s0 = [];
912
896
  s1 = peg$parseextended_state_attribute();
@@ -915,14 +899,10 @@ function peg$parse(input, options) {
915
899
  s1 = peg$parseextended_state_attribute();
916
900
  }
917
901
  peg$silentFails--;
918
- s1 = peg$FAILED;
919
- if (peg$silentFails === 0) {
920
- peg$fail(peg$e9);
921
- }
922
902
  return s0;
923
903
  }
924
904
  function peg$parseextended_state_attribute() {
925
- var s0, s1, s2, s3, s4, s5, s6, s7;
905
+ let s0, s1, s2, s3, s4, s5, s6, s7;
926
906
  peg$silentFails++;
927
907
  s0 = peg$currPos;
928
908
  s1 = peg$parse_();
@@ -935,7 +915,7 @@ function peg$parse(input, options) {
935
915
  } else {
936
916
  s4 = peg$FAILED;
937
917
  if (peg$silentFails === 0) {
938
- peg$fail(peg$e11);
918
+ peg$fail(peg$e9);
939
919
  }
940
920
  }
941
921
  if (s4 !== peg$FAILED) {
@@ -969,7 +949,7 @@ function peg$parse(input, options) {
969
949
  } else {
970
950
  s4 = peg$FAILED;
971
951
  if (peg$silentFails === 0) {
972
- peg$fail(peg$e11);
952
+ peg$fail(peg$e9);
973
953
  }
974
954
  }
975
955
  if (s4 !== peg$FAILED) {
@@ -1015,7 +995,7 @@ function peg$parse(input, options) {
1015
995
  } else {
1016
996
  s4 = peg$FAILED;
1017
997
  if (peg$silentFails === 0) {
1018
- peg$fail(peg$e11);
998
+ peg$fail(peg$e9);
1019
999
  }
1020
1000
  }
1021
1001
  if (s4 !== peg$FAILED) {
@@ -1044,13 +1024,13 @@ function peg$parse(input, options) {
1044
1024
  if (s0 === peg$FAILED) {
1045
1025
  s1 = peg$FAILED;
1046
1026
  if (peg$silentFails === 0) {
1047
- peg$fail(peg$e10);
1027
+ peg$fail(peg$e8);
1048
1028
  }
1049
1029
  }
1050
1030
  return s0;
1051
1031
  }
1052
1032
  function peg$parseextended_state_string_attribute_name() {
1053
- var s0, s1;
1033
+ let s0, s1;
1054
1034
  peg$silentFails++;
1055
1035
  s0 = peg$currPos;
1056
1036
  s1 = input.substr(peg$currPos, 5);
@@ -1059,7 +1039,7 @@ function peg$parse(input, options) {
1059
1039
  } else {
1060
1040
  s1 = peg$FAILED;
1061
1041
  if (peg$silentFails === 0) {
1062
- peg$fail(peg$e13);
1042
+ peg$fail(peg$e11);
1063
1043
  }
1064
1044
  }
1065
1045
  if (s1 === peg$FAILED) {
@@ -1069,7 +1049,7 @@ function peg$parse(input, options) {
1069
1049
  } else {
1070
1050
  s1 = peg$FAILED;
1071
1051
  if (peg$silentFails === 0) {
1072
- peg$fail(peg$e14);
1052
+ peg$fail(peg$e12);
1073
1053
  }
1074
1054
  }
1075
1055
  }
@@ -1082,13 +1062,13 @@ function peg$parse(input, options) {
1082
1062
  if (s0 === peg$FAILED) {
1083
1063
  s1 = peg$FAILED;
1084
1064
  if (peg$silentFails === 0) {
1085
- peg$fail(peg$e12);
1065
+ peg$fail(peg$e10);
1086
1066
  }
1087
1067
  }
1088
1068
  return s0;
1089
1069
  }
1090
1070
  function peg$parseclass_attribute_name() {
1091
- var s0, s1;
1071
+ let s0, s1;
1092
1072
  peg$silentFails++;
1093
1073
  s0 = peg$currPos;
1094
1074
  s1 = input.substr(peg$currPos, 5);
@@ -1097,7 +1077,7 @@ function peg$parse(input, options) {
1097
1077
  } else {
1098
1078
  s1 = peg$FAILED;
1099
1079
  if (peg$silentFails === 0) {
1100
- peg$fail(peg$e16);
1080
+ peg$fail(peg$e14);
1101
1081
  }
1102
1082
  }
1103
1083
  if (s1 !== peg$FAILED) {
@@ -1109,13 +1089,13 @@ function peg$parse(input, options) {
1109
1089
  if (s0 === peg$FAILED) {
1110
1090
  s1 = peg$FAILED;
1111
1091
  if (peg$silentFails === 0) {
1112
- peg$fail(peg$e15);
1092
+ peg$fail(peg$e13);
1113
1093
  }
1114
1094
  }
1115
1095
  return s0;
1116
1096
  }
1117
1097
  function peg$parseextended_state_boolean_attribute_name() {
1118
- var s0, s1;
1098
+ let s0, s1;
1119
1099
  peg$silentFails++;
1120
1100
  s0 = peg$currPos;
1121
1101
  s1 = input.substr(peg$currPos, 6);
@@ -1124,7 +1104,7 @@ function peg$parse(input, options) {
1124
1104
  } else {
1125
1105
  s1 = peg$FAILED;
1126
1106
  if (peg$silentFails === 0) {
1127
- peg$fail(peg$e18);
1107
+ peg$fail(peg$e16);
1128
1108
  }
1129
1109
  }
1130
1110
  if (s1 !== peg$FAILED) {
@@ -1136,13 +1116,13 @@ function peg$parse(input, options) {
1136
1116
  if (s0 === peg$FAILED) {
1137
1117
  s1 = peg$FAILED;
1138
1118
  if (peg$silentFails === 0) {
1139
- peg$fail(peg$e17);
1119
+ peg$fail(peg$e15);
1140
1120
  }
1141
1121
  }
1142
1122
  return s0;
1143
1123
  }
1144
1124
  function peg$parseextended_state_type_attribute_name() {
1145
- var s0, s1;
1125
+ let s0, s1;
1146
1126
  peg$silentFails++;
1147
1127
  s0 = peg$currPos;
1148
1128
  s1 = input.substr(peg$currPos, 4);
@@ -1151,7 +1131,7 @@ function peg$parse(input, options) {
1151
1131
  } else {
1152
1132
  s1 = peg$FAILED;
1153
1133
  if (peg$silentFails === 0) {
1154
- peg$fail(peg$e20);
1134
+ peg$fail(peg$e18);
1155
1135
  }
1156
1136
  }
1157
1137
  if (s1 !== peg$FAILED) {
@@ -1163,13 +1143,13 @@ function peg$parse(input, options) {
1163
1143
  if (s0 === peg$FAILED) {
1164
1144
  s1 = peg$FAILED;
1165
1145
  if (peg$silentFails === 0) {
1166
- peg$fail(peg$e19);
1146
+ peg$fail(peg$e17);
1167
1147
  }
1168
1148
  }
1169
1149
  return s0;
1170
1150
  }
1171
1151
  function peg$parseextended_state_type_attribute_type() {
1172
- var s0, s1;
1152
+ let s0, s1;
1173
1153
  peg$silentFails++;
1174
1154
  if (input.substr(peg$currPos, 7) === peg$c13) {
1175
1155
  s0 = peg$c13;
@@ -1177,7 +1157,7 @@ function peg$parse(input, options) {
1177
1157
  } else {
1178
1158
  s0 = peg$FAILED;
1179
1159
  if (peg$silentFails === 0) {
1180
- peg$fail(peg$e22);
1160
+ peg$fail(peg$e20);
1181
1161
  }
1182
1162
  }
1183
1163
  if (s0 === peg$FAILED) {
@@ -1187,7 +1167,7 @@ function peg$parse(input, options) {
1187
1167
  } else {
1188
1168
  s0 = peg$FAILED;
1189
1169
  if (peg$silentFails === 0) {
1190
- peg$fail(peg$e23);
1170
+ peg$fail(peg$e21);
1191
1171
  }
1192
1172
  }
1193
1173
  if (s0 === peg$FAILED) {
@@ -1197,7 +1177,7 @@ function peg$parse(input, options) {
1197
1177
  } else {
1198
1178
  s0 = peg$FAILED;
1199
1179
  if (peg$silentFails === 0) {
1200
- peg$fail(peg$e24);
1180
+ peg$fail(peg$e22);
1201
1181
  }
1202
1182
  }
1203
1183
  if (s0 === peg$FAILED) {
@@ -1207,7 +1187,7 @@ function peg$parse(input, options) {
1207
1187
  } else {
1208
1188
  s0 = peg$FAILED;
1209
1189
  if (peg$silentFails === 0) {
1210
- peg$fail(peg$e25);
1190
+ peg$fail(peg$e23);
1211
1191
  }
1212
1192
  }
1213
1193
  if (s0 === peg$FAILED) {
@@ -1217,7 +1197,7 @@ function peg$parse(input, options) {
1217
1197
  } else {
1218
1198
  s0 = peg$FAILED;
1219
1199
  if (peg$silentFails === 0) {
1220
- peg$fail(peg$e26);
1200
+ peg$fail(peg$e24);
1221
1201
  }
1222
1202
  }
1223
1203
  if (s0 === peg$FAILED) {
@@ -1227,7 +1207,7 @@ function peg$parse(input, options) {
1227
1207
  } else {
1228
1208
  s0 = peg$FAILED;
1229
1209
  if (peg$silentFails === 0) {
1230
- peg$fail(peg$e27);
1210
+ peg$fail(peg$e25);
1231
1211
  }
1232
1212
  }
1233
1213
  if (s0 === peg$FAILED) {
@@ -1237,7 +1217,7 @@ function peg$parse(input, options) {
1237
1217
  } else {
1238
1218
  s0 = peg$FAILED;
1239
1219
  if (peg$silentFails === 0) {
1240
- peg$fail(peg$e28);
1220
+ peg$fail(peg$e26);
1241
1221
  }
1242
1222
  }
1243
1223
  if (s0 === peg$FAILED) {
@@ -1247,7 +1227,7 @@ function peg$parse(input, options) {
1247
1227
  } else {
1248
1228
  s0 = peg$FAILED;
1249
1229
  if (peg$silentFails === 0) {
1250
- peg$fail(peg$e29);
1230
+ peg$fail(peg$e27);
1251
1231
  }
1252
1232
  }
1253
1233
  if (s0 === peg$FAILED) {
@@ -1257,7 +1237,7 @@ function peg$parse(input, options) {
1257
1237
  } else {
1258
1238
  s0 = peg$FAILED;
1259
1239
  if (peg$silentFails === 0) {
1260
- peg$fail(peg$e30);
1240
+ peg$fail(peg$e28);
1261
1241
  }
1262
1242
  }
1263
1243
  if (s0 === peg$FAILED) {
@@ -1267,7 +1247,7 @@ function peg$parse(input, options) {
1267
1247
  } else {
1268
1248
  s0 = peg$FAILED;
1269
1249
  if (peg$silentFails === 0) {
1270
- peg$fail(peg$e31);
1250
+ peg$fail(peg$e29);
1271
1251
  }
1272
1252
  }
1273
1253
  if (s0 === peg$FAILED) {
@@ -1277,7 +1257,7 @@ function peg$parse(input, options) {
1277
1257
  } else {
1278
1258
  s0 = peg$FAILED;
1279
1259
  if (peg$silentFails === 0) {
1280
- peg$fail(peg$e32);
1260
+ peg$fail(peg$e30);
1281
1261
  }
1282
1262
  }
1283
1263
  if (s0 === peg$FAILED) {
@@ -1287,7 +1267,7 @@ function peg$parse(input, options) {
1287
1267
  } else {
1288
1268
  s0 = peg$FAILED;
1289
1269
  if (peg$silentFails === 0) {
1290
- peg$fail(peg$e33);
1270
+ peg$fail(peg$e31);
1291
1271
  }
1292
1272
  }
1293
1273
  }
@@ -1305,13 +1285,13 @@ function peg$parse(input, options) {
1305
1285
  if (s0 === peg$FAILED) {
1306
1286
  s1 = peg$FAILED;
1307
1287
  if (peg$silentFails === 0) {
1308
- peg$fail(peg$e21);
1288
+ peg$fail(peg$e19);
1309
1289
  }
1310
1290
  }
1311
1291
  return s0;
1312
1292
  }
1313
1293
  function peg$parsetransition() {
1314
- var s0, s1, s2, s3, s4, s5, s6, s7, s8;
1294
+ let s0, s1, s2, s3, s4, s5, s6, s7, s8;
1315
1295
  peg$silentFails++;
1316
1296
  s0 = peg$currPos;
1317
1297
  s1 = [];
@@ -1329,7 +1309,7 @@ function peg$parse(input, options) {
1329
1309
  } else {
1330
1310
  s4 = peg$FAILED;
1331
1311
  if (peg$silentFails === 0) {
1332
- peg$fail(peg$e4);
1312
+ peg$fail(peg$e3);
1333
1313
  }
1334
1314
  }
1335
1315
  if (s4 !== peg$FAILED) {
@@ -1340,7 +1320,7 @@ function peg$parse(input, options) {
1340
1320
  } else {
1341
1321
  s6 = peg$FAILED;
1342
1322
  if (peg$silentFails === 0) {
1343
- peg$fail(peg$e5);
1323
+ peg$fail(peg$e4);
1344
1324
  }
1345
1325
  }
1346
1326
  if (s6 !== peg$FAILED) {
@@ -1365,7 +1345,7 @@ function peg$parse(input, options) {
1365
1345
  } else {
1366
1346
  s5 = peg$FAILED;
1367
1347
  if (peg$silentFails === 0) {
1368
- peg$fail(peg$e6);
1348
+ peg$fail(peg$e5);
1369
1349
  }
1370
1350
  }
1371
1351
  if (s5 !== peg$FAILED) {
@@ -1392,7 +1372,7 @@ function peg$parse(input, options) {
1392
1372
  } else {
1393
1373
  s5 = peg$FAILED;
1394
1374
  if (peg$silentFails === 0) {
1395
- peg$fail(peg$e2);
1375
+ peg$fail(peg$e1);
1396
1376
  }
1397
1377
  }
1398
1378
  if (s5 !== peg$FAILED) {
@@ -1410,13 +1390,13 @@ function peg$parse(input, options) {
1410
1390
  if (s0 === peg$FAILED) {
1411
1391
  s1 = peg$FAILED;
1412
1392
  if (peg$silentFails === 0) {
1413
- peg$fail(peg$e34);
1393
+ peg$fail(peg$e32);
1414
1394
  }
1415
1395
  }
1416
1396
  return s0;
1417
1397
  }
1418
1398
  function peg$parsetransitionbase() {
1419
- var s0, s1, s2, s3, s4, s5, s6, s7;
1399
+ let s0, s1, s2, s3, s4, s5, s6, s7;
1420
1400
  s0 = peg$currPos;
1421
1401
  s1 = peg$parse_();
1422
1402
  s2 = peg$parseidentifier();
@@ -1472,7 +1452,7 @@ function peg$parse(input, options) {
1472
1452
  return s0;
1473
1453
  }
1474
1454
  function peg$parseextended_transition_attributes() {
1475
- var s0, s1;
1455
+ let s0, s1;
1476
1456
  peg$silentFails++;
1477
1457
  s0 = [];
1478
1458
  s1 = peg$parseextended_transition_attribute();
@@ -1481,14 +1461,10 @@ function peg$parse(input, options) {
1481
1461
  s1 = peg$parseextended_transition_attribute();
1482
1462
  }
1483
1463
  peg$silentFails--;
1484
- s1 = peg$FAILED;
1485
- if (peg$silentFails === 0) {
1486
- peg$fail(peg$e35);
1487
- }
1488
1464
  return s0;
1489
1465
  }
1490
1466
  function peg$parseextended_transition_attribute() {
1491
- var s0, s1, s2, s3, s4, s5, s6, s7;
1467
+ let s0, s1, s2, s3, s4, s5, s6, s7;
1492
1468
  peg$silentFails++;
1493
1469
  s0 = peg$currPos;
1494
1470
  s1 = peg$parse_();
@@ -1501,7 +1477,7 @@ function peg$parse(input, options) {
1501
1477
  } else {
1502
1478
  s4 = peg$FAILED;
1503
1479
  if (peg$silentFails === 0) {
1504
- peg$fail(peg$e11);
1480
+ peg$fail(peg$e9);
1505
1481
  }
1506
1482
  }
1507
1483
  if (s4 !== peg$FAILED) {
@@ -1535,7 +1511,7 @@ function peg$parse(input, options) {
1535
1511
  } else {
1536
1512
  s4 = peg$FAILED;
1537
1513
  if (peg$silentFails === 0) {
1538
- peg$fail(peg$e11);
1514
+ peg$fail(peg$e9);
1539
1515
  }
1540
1516
  }
1541
1517
  if (s4 !== peg$FAILED) {
@@ -1569,7 +1545,7 @@ function peg$parse(input, options) {
1569
1545
  } else {
1570
1546
  s4 = peg$FAILED;
1571
1547
  if (peg$silentFails === 0) {
1572
- peg$fail(peg$e11);
1548
+ peg$fail(peg$e9);
1573
1549
  }
1574
1550
  }
1575
1551
  if (s4 !== peg$FAILED) {
@@ -1603,7 +1579,7 @@ function peg$parse(input, options) {
1603
1579
  } else {
1604
1580
  s4 = peg$FAILED;
1605
1581
  if (peg$silentFails === 0) {
1606
- peg$fail(peg$e11);
1582
+ peg$fail(peg$e9);
1607
1583
  }
1608
1584
  }
1609
1585
  if (s4 !== peg$FAILED) {
@@ -1632,13 +1608,13 @@ function peg$parse(input, options) {
1632
1608
  if (s0 === peg$FAILED) {
1633
1609
  s1 = peg$FAILED;
1634
1610
  if (peg$silentFails === 0) {
1635
- peg$fail(peg$e36);
1611
+ peg$fail(peg$e33);
1636
1612
  }
1637
1613
  }
1638
1614
  return s0;
1639
1615
  }
1640
1616
  function peg$parseextended_transition_string_attribute_name() {
1641
- var s0, s1;
1617
+ let s0, s1;
1642
1618
  peg$silentFails++;
1643
1619
  s0 = peg$currPos;
1644
1620
  s1 = input.substr(peg$currPos, 5);
@@ -1647,7 +1623,7 @@ function peg$parse(input, options) {
1647
1623
  } else {
1648
1624
  s1 = peg$FAILED;
1649
1625
  if (peg$silentFails === 0) {
1650
- peg$fail(peg$e14);
1626
+ peg$fail(peg$e12);
1651
1627
  }
1652
1628
  }
1653
1629
  if (s1 !== peg$FAILED) {
@@ -1659,13 +1635,13 @@ function peg$parse(input, options) {
1659
1635
  if (s0 === peg$FAILED) {
1660
1636
  s1 = peg$FAILED;
1661
1637
  if (peg$silentFails === 0) {
1662
- peg$fail(peg$e37);
1638
+ peg$fail(peg$e34);
1663
1639
  }
1664
1640
  }
1665
1641
  return s0;
1666
1642
  }
1667
1643
  function peg$parseextended_transition_type_name() {
1668
- var s0, s1;
1644
+ let s0, s1;
1669
1645
  peg$silentFails++;
1670
1646
  s0 = peg$currPos;
1671
1647
  s1 = input.substr(peg$currPos, 4);
@@ -1674,7 +1650,7 @@ function peg$parse(input, options) {
1674
1650
  } else {
1675
1651
  s1 = peg$FAILED;
1676
1652
  if (peg$silentFails === 0) {
1677
- peg$fail(peg$e20);
1653
+ peg$fail(peg$e18);
1678
1654
  }
1679
1655
  }
1680
1656
  if (s1 !== peg$FAILED) {
@@ -1686,13 +1662,13 @@ function peg$parse(input, options) {
1686
1662
  if (s0 === peg$FAILED) {
1687
1663
  s1 = peg$FAILED;
1688
1664
  if (peg$silentFails === 0) {
1689
- peg$fail(peg$e38);
1665
+ peg$fail(peg$e35);
1690
1666
  }
1691
1667
  }
1692
1668
  return s0;
1693
1669
  }
1694
1670
  function peg$parseextended_transition_numeric_attribute_name() {
1695
- var s0, s1;
1671
+ let s0, s1;
1696
1672
  peg$silentFails++;
1697
1673
  s0 = peg$currPos;
1698
1674
  s1 = input.substr(peg$currPos, 5);
@@ -1701,7 +1677,7 @@ function peg$parse(input, options) {
1701
1677
  } else {
1702
1678
  s1 = peg$FAILED;
1703
1679
  if (peg$silentFails === 0) {
1704
- peg$fail(peg$e40);
1680
+ peg$fail(peg$e37);
1705
1681
  }
1706
1682
  }
1707
1683
  if (s1 !== peg$FAILED) {
@@ -1713,13 +1689,13 @@ function peg$parse(input, options) {
1713
1689
  if (s0 === peg$FAILED) {
1714
1690
  s1 = peg$FAILED;
1715
1691
  if (peg$silentFails === 0) {
1716
- peg$fail(peg$e39);
1692
+ peg$fail(peg$e36);
1717
1693
  }
1718
1694
  }
1719
1695
  return s0;
1720
1696
  }
1721
1697
  function peg$parseextended_transition_type_value() {
1722
- var s0, s1;
1698
+ let s0, s1;
1723
1699
  peg$silentFails++;
1724
1700
  if (input.substr(peg$currPos, 8) === peg$c26) {
1725
1701
  s0 = peg$c26;
@@ -1727,7 +1703,7 @@ function peg$parse(input, options) {
1727
1703
  } else {
1728
1704
  s0 = peg$FAILED;
1729
1705
  if (peg$silentFails === 0) {
1730
- peg$fail(peg$e42);
1706
+ peg$fail(peg$e39);
1731
1707
  }
1732
1708
  }
1733
1709
  if (s0 === peg$FAILED) {
@@ -1737,7 +1713,7 @@ function peg$parse(input, options) {
1737
1713
  } else {
1738
1714
  s0 = peg$FAILED;
1739
1715
  if (peg$silentFails === 0) {
1740
- peg$fail(peg$e43);
1716
+ peg$fail(peg$e40);
1741
1717
  }
1742
1718
  }
1743
1719
  }
@@ -1745,13 +1721,13 @@ function peg$parse(input, options) {
1745
1721
  if (s0 === peg$FAILED) {
1746
1722
  s1 = peg$FAILED;
1747
1723
  if (peg$silentFails === 0) {
1748
- peg$fail(peg$e41);
1724
+ peg$fail(peg$e38);
1749
1725
  }
1750
1726
  }
1751
1727
  return s0;
1752
1728
  }
1753
1729
  function peg$parsefwdarrowtoken() {
1754
- var s0, s1;
1730
+ let s0, s1;
1755
1731
  peg$silentFails++;
1756
1732
  if (input.substr(peg$currPos, 2) === peg$c28) {
1757
1733
  s0 = peg$c28;
@@ -1759,7 +1735,7 @@ function peg$parse(input, options) {
1759
1735
  } else {
1760
1736
  s0 = peg$FAILED;
1761
1737
  if (peg$silentFails === 0) {
1762
- peg$fail(peg$e45);
1738
+ peg$fail(peg$e42);
1763
1739
  }
1764
1740
  }
1765
1741
  if (s0 === peg$FAILED) {
@@ -1769,7 +1745,7 @@ function peg$parse(input, options) {
1769
1745
  } else {
1770
1746
  s0 = peg$FAILED;
1771
1747
  if (peg$silentFails === 0) {
1772
- peg$fail(peg$e46);
1748
+ peg$fail(peg$e43);
1773
1749
  }
1774
1750
  }
1775
1751
  if (s0 === peg$FAILED) {
@@ -1779,7 +1755,7 @@ function peg$parse(input, options) {
1779
1755
  } else {
1780
1756
  s0 = peg$FAILED;
1781
1757
  if (peg$silentFails === 0) {
1782
- peg$fail(peg$e47);
1758
+ peg$fail(peg$e44);
1783
1759
  }
1784
1760
  }
1785
1761
  if (s0 === peg$FAILED) {
@@ -1789,7 +1765,7 @@ function peg$parse(input, options) {
1789
1765
  } else {
1790
1766
  s0 = peg$FAILED;
1791
1767
  if (peg$silentFails === 0) {
1792
- peg$fail(peg$e48);
1768
+ peg$fail(peg$e45);
1793
1769
  }
1794
1770
  }
1795
1771
  if (s0 === peg$FAILED) {
@@ -1799,7 +1775,7 @@ function peg$parse(input, options) {
1799
1775
  } else {
1800
1776
  s0 = peg$FAILED;
1801
1777
  if (peg$silentFails === 0) {
1802
- peg$fail(peg$e49);
1778
+ peg$fail(peg$e46);
1803
1779
  }
1804
1780
  }
1805
1781
  if (s0 === peg$FAILED) {
@@ -1809,7 +1785,7 @@ function peg$parse(input, options) {
1809
1785
  } else {
1810
1786
  s0 = peg$FAILED;
1811
1787
  if (peg$silentFails === 0) {
1812
- peg$fail(peg$e50);
1788
+ peg$fail(peg$e47);
1813
1789
  }
1814
1790
  }
1815
1791
  if (s0 === peg$FAILED) {
@@ -1819,7 +1795,7 @@ function peg$parse(input, options) {
1819
1795
  } else {
1820
1796
  s0 = peg$FAILED;
1821
1797
  if (peg$silentFails === 0) {
1822
- peg$fail(peg$e51);
1798
+ peg$fail(peg$e48);
1823
1799
  }
1824
1800
  }
1825
1801
  }
@@ -1832,13 +1808,13 @@ function peg$parse(input, options) {
1832
1808
  if (s0 === peg$FAILED) {
1833
1809
  s1 = peg$FAILED;
1834
1810
  if (peg$silentFails === 0) {
1835
- peg$fail(peg$e44);
1811
+ peg$fail(peg$e41);
1836
1812
  }
1837
1813
  }
1838
1814
  return s0;
1839
1815
  }
1840
1816
  function peg$parsebckarrowtoken() {
1841
- var s0, s1;
1817
+ let s0, s1;
1842
1818
  peg$silentFails++;
1843
1819
  if (input.substr(peg$currPos, 2) === peg$c35) {
1844
1820
  s0 = peg$c35;
@@ -1846,7 +1822,7 @@ function peg$parse(input, options) {
1846
1822
  } else {
1847
1823
  s0 = peg$FAILED;
1848
1824
  if (peg$silentFails === 0) {
1849
- peg$fail(peg$e53);
1825
+ peg$fail(peg$e50);
1850
1826
  }
1851
1827
  }
1852
1828
  if (s0 === peg$FAILED) {
@@ -1856,7 +1832,7 @@ function peg$parse(input, options) {
1856
1832
  } else {
1857
1833
  s0 = peg$FAILED;
1858
1834
  if (peg$silentFails === 0) {
1859
- peg$fail(peg$e54);
1835
+ peg$fail(peg$e51);
1860
1836
  }
1861
1837
  }
1862
1838
  if (s0 === peg$FAILED) {
@@ -1866,7 +1842,7 @@ function peg$parse(input, options) {
1866
1842
  } else {
1867
1843
  s0 = peg$FAILED;
1868
1844
  if (peg$silentFails === 0) {
1869
- peg$fail(peg$e55);
1845
+ peg$fail(peg$e52);
1870
1846
  }
1871
1847
  }
1872
1848
  if (s0 === peg$FAILED) {
@@ -1876,7 +1852,7 @@ function peg$parse(input, options) {
1876
1852
  } else {
1877
1853
  s0 = peg$FAILED;
1878
1854
  if (peg$silentFails === 0) {
1879
- peg$fail(peg$e56);
1855
+ peg$fail(peg$e53);
1880
1856
  }
1881
1857
  }
1882
1858
  if (s0 === peg$FAILED) {
@@ -1886,7 +1862,7 @@ function peg$parse(input, options) {
1886
1862
  } else {
1887
1863
  s0 = peg$FAILED;
1888
1864
  if (peg$silentFails === 0) {
1889
- peg$fail(peg$e57);
1865
+ peg$fail(peg$e54);
1890
1866
  }
1891
1867
  }
1892
1868
  }
@@ -1897,13 +1873,13 @@ function peg$parse(input, options) {
1897
1873
  if (s0 === peg$FAILED) {
1898
1874
  s1 = peg$FAILED;
1899
1875
  if (peg$silentFails === 0) {
1900
- peg$fail(peg$e52);
1876
+ peg$fail(peg$e49);
1901
1877
  }
1902
1878
  }
1903
1879
  return s0;
1904
1880
  }
1905
1881
  function peg$parsenote() {
1906
- var s0, s1, s2, s3, s4;
1882
+ let s0, s1, s2, s3, s4;
1907
1883
  s0 = peg$currPos;
1908
1884
  s1 = peg$parse_();
1909
1885
  if (input.charCodeAt(peg$currPos) === 35) {
@@ -1912,7 +1888,7 @@ function peg$parse(input, options) {
1912
1888
  } else {
1913
1889
  s2 = peg$FAILED;
1914
1890
  if (peg$silentFails === 0) {
1915
- peg$fail(peg$e58);
1891
+ peg$fail(peg$e55);
1916
1892
  }
1917
1893
  }
1918
1894
  if (s2 !== peg$FAILED) {
@@ -1931,7 +1907,7 @@ function peg$parse(input, options) {
1931
1907
  return s0;
1932
1908
  }
1933
1909
  function peg$parsepositive_number() {
1934
- var s0;
1910
+ let s0;
1935
1911
  s0 = peg$parsepositive_real();
1936
1912
  if (s0 === peg$FAILED) {
1937
1913
  s0 = peg$parsecardinal();
@@ -1939,7 +1915,7 @@ function peg$parse(input, options) {
1939
1915
  return s0;
1940
1916
  }
1941
1917
  function peg$parsepositive_real() {
1942
- var s0, s1, s2, s3, s4;
1918
+ let s0, s1, s2, s3, s4;
1943
1919
  s0 = peg$currPos;
1944
1920
  s1 = peg$currPos;
1945
1921
  s2 = peg$parsecardinal();
@@ -1950,7 +1926,7 @@ function peg$parse(input, options) {
1950
1926
  } else {
1951
1927
  s3 = peg$FAILED;
1952
1928
  if (peg$silentFails === 0) {
1953
- peg$fail(peg$e59);
1929
+ peg$fail(peg$e56);
1954
1930
  }
1955
1931
  }
1956
1932
  if (s3 !== peg$FAILED) {
@@ -1978,7 +1954,7 @@ function peg$parse(input, options) {
1978
1954
  return s0;
1979
1955
  }
1980
1956
  function peg$parsecardinal() {
1981
- var s0, s1, s2;
1957
+ let s0, s1, s2;
1982
1958
  s0 = peg$currPos;
1983
1959
  s1 = [];
1984
1960
  s2 = input.charAt(peg$currPos);
@@ -1987,7 +1963,7 @@ function peg$parse(input, options) {
1987
1963
  } else {
1988
1964
  s2 = peg$FAILED;
1989
1965
  if (peg$silentFails === 0) {
1990
- peg$fail(peg$e60);
1966
+ peg$fail(peg$e57);
1991
1967
  }
1992
1968
  }
1993
1969
  if (s2 !== peg$FAILED) {
@@ -1999,7 +1975,7 @@ function peg$parse(input, options) {
1999
1975
  } else {
2000
1976
  s2 = peg$FAILED;
2001
1977
  if (peg$silentFails === 0) {
2002
- peg$fail(peg$e60);
1978
+ peg$fail(peg$e57);
2003
1979
  }
2004
1980
  }
2005
1981
  }
@@ -2014,7 +1990,7 @@ function peg$parse(input, options) {
2014
1990
  return s0;
2015
1991
  }
2016
1992
  function peg$parsetransitionstring() {
2017
- var s0;
1993
+ let s0;
2018
1994
  s0 = peg$parsequotedstring();
2019
1995
  if (s0 === peg$FAILED) {
2020
1996
  s0 = peg$parseunquotedtransitionstring();
@@ -2022,7 +1998,7 @@ function peg$parse(input, options) {
2022
1998
  return s0;
2023
1999
  }
2024
2000
  function peg$parsestring() {
2025
- var s0;
2001
+ let s0;
2026
2002
  s0 = peg$parsequotedstring();
2027
2003
  if (s0 === peg$FAILED) {
2028
2004
  s0 = peg$parseunquotedstring();
@@ -2030,7 +2006,7 @@ function peg$parse(input, options) {
2030
2006
  return s0;
2031
2007
  }
2032
2008
  function peg$parsequotedstring() {
2033
- var s0, s1, s2, s3;
2009
+ let s0, s1, s2, s3;
2034
2010
  peg$silentFails++;
2035
2011
  s0 = peg$currPos;
2036
2012
  if (input.charCodeAt(peg$currPos) === 34) {
@@ -2039,7 +2015,7 @@ function peg$parse(input, options) {
2039
2015
  } else {
2040
2016
  s1 = peg$FAILED;
2041
2017
  if (peg$silentFails === 0) {
2042
- peg$fail(peg$e62);
2018
+ peg$fail(peg$e59);
2043
2019
  }
2044
2020
  }
2045
2021
  if (s1 !== peg$FAILED) {
@@ -2050,7 +2026,7 @@ function peg$parse(input, options) {
2050
2026
  } else {
2051
2027
  s3 = peg$FAILED;
2052
2028
  if (peg$silentFails === 0) {
2053
- peg$fail(peg$e62);
2029
+ peg$fail(peg$e59);
2054
2030
  }
2055
2031
  }
2056
2032
  if (s3 !== peg$FAILED) {
@@ -2068,13 +2044,13 @@ function peg$parse(input, options) {
2068
2044
  if (s0 === peg$FAILED) {
2069
2045
  s1 = peg$FAILED;
2070
2046
  if (peg$silentFails === 0) {
2071
- peg$fail(peg$e61);
2047
+ peg$fail(peg$e58);
2072
2048
  }
2073
2049
  }
2074
2050
  return s0;
2075
2051
  }
2076
2052
  function peg$parsestringcontent() {
2077
- var s0, s1, s2, s3;
2053
+ let s0, s1, s2, s3;
2078
2054
  s0 = [];
2079
2055
  s1 = peg$currPos;
2080
2056
  s2 = peg$currPos;
@@ -2085,7 +2061,7 @@ function peg$parse(input, options) {
2085
2061
  } else {
2086
2062
  s3 = peg$FAILED;
2087
2063
  if (peg$silentFails === 0) {
2088
- peg$fail(peg$e62);
2064
+ peg$fail(peg$e59);
2089
2065
  }
2090
2066
  }
2091
2067
  peg$silentFails--;
@@ -2102,7 +2078,7 @@ function peg$parse(input, options) {
2102
2078
  } else {
2103
2079
  s3 = peg$FAILED;
2104
2080
  if (peg$silentFails === 0) {
2105
- peg$fail(peg$e63);
2081
+ peg$fail(peg$e60);
2106
2082
  }
2107
2083
  }
2108
2084
  if (s3 === peg$FAILED) {
@@ -2112,7 +2088,7 @@ function peg$parse(input, options) {
2112
2088
  } else {
2113
2089
  s3 = peg$FAILED;
2114
2090
  if (peg$silentFails === 0) {
2115
- peg$fail(peg$e64);
2091
+ peg$fail(peg$e61);
2116
2092
  }
2117
2093
  }
2118
2094
  }
@@ -2138,7 +2114,7 @@ function peg$parse(input, options) {
2138
2114
  } else {
2139
2115
  s3 = peg$FAILED;
2140
2116
  if (peg$silentFails === 0) {
2141
- peg$fail(peg$e62);
2117
+ peg$fail(peg$e59);
2142
2118
  }
2143
2119
  }
2144
2120
  peg$silentFails--;
@@ -2155,7 +2131,7 @@ function peg$parse(input, options) {
2155
2131
  } else {
2156
2132
  s3 = peg$FAILED;
2157
2133
  if (peg$silentFails === 0) {
2158
- peg$fail(peg$e63);
2134
+ peg$fail(peg$e60);
2159
2135
  }
2160
2136
  }
2161
2137
  if (s3 === peg$FAILED) {
@@ -2165,7 +2141,7 @@ function peg$parse(input, options) {
2165
2141
  } else {
2166
2142
  s3 = peg$FAILED;
2167
2143
  if (peg$silentFails === 0) {
2168
- peg$fail(peg$e64);
2144
+ peg$fail(peg$e61);
2169
2145
  }
2170
2146
  }
2171
2147
  }
@@ -2184,7 +2160,7 @@ function peg$parse(input, options) {
2184
2160
  return s0;
2185
2161
  }
2186
2162
  function peg$parseclass_string() {
2187
- var s0, s1, s2, s3;
2163
+ let s0, s1, s2, s3;
2188
2164
  peg$silentFails++;
2189
2165
  s0 = peg$currPos;
2190
2166
  if (input.charCodeAt(peg$currPos) === 34) {
@@ -2193,7 +2169,7 @@ function peg$parse(input, options) {
2193
2169
  } else {
2194
2170
  s1 = peg$FAILED;
2195
2171
  if (peg$silentFails === 0) {
2196
- peg$fail(peg$e62);
2172
+ peg$fail(peg$e59);
2197
2173
  }
2198
2174
  }
2199
2175
  if (s1 !== peg$FAILED) {
@@ -2204,7 +2180,7 @@ function peg$parse(input, options) {
2204
2180
  } else {
2205
2181
  s3 = peg$FAILED;
2206
2182
  if (peg$silentFails === 0) {
2207
- peg$fail(peg$e62);
2183
+ peg$fail(peg$e59);
2208
2184
  }
2209
2185
  }
2210
2186
  if (s3 !== peg$FAILED) {
@@ -2222,13 +2198,13 @@ function peg$parse(input, options) {
2222
2198
  if (s0 === peg$FAILED) {
2223
2199
  s1 = peg$FAILED;
2224
2200
  if (peg$silentFails === 0) {
2225
- peg$fail(peg$e65);
2201
+ peg$fail(peg$e62);
2226
2202
  }
2227
2203
  }
2228
2204
  return s0;
2229
2205
  }
2230
2206
  function peg$parseclass_stringcontent() {
2231
- var s0, s1, s2, s3;
2207
+ let s0, s1, s2, s3;
2232
2208
  s0 = [];
2233
2209
  s1 = peg$currPos;
2234
2210
  s2 = peg$currPos;
@@ -2239,7 +2215,7 @@ function peg$parse(input, options) {
2239
2215
  } else {
2240
2216
  s3 = peg$FAILED;
2241
2217
  if (peg$silentFails === 0) {
2242
- peg$fail(peg$e62);
2218
+ peg$fail(peg$e59);
2243
2219
  }
2244
2220
  }
2245
2221
  peg$silentFails--;
@@ -2256,7 +2232,7 @@ function peg$parse(input, options) {
2256
2232
  } else {
2257
2233
  s3 = peg$FAILED;
2258
2234
  if (peg$silentFails === 0) {
2259
- peg$fail(peg$e66);
2235
+ peg$fail(peg$e63);
2260
2236
  }
2261
2237
  }
2262
2238
  if (s3 !== peg$FAILED) {
@@ -2281,7 +2257,7 @@ function peg$parse(input, options) {
2281
2257
  } else {
2282
2258
  s3 = peg$FAILED;
2283
2259
  if (peg$silentFails === 0) {
2284
- peg$fail(peg$e62);
2260
+ peg$fail(peg$e59);
2285
2261
  }
2286
2262
  }
2287
2263
  peg$silentFails--;
@@ -2298,7 +2274,7 @@ function peg$parse(input, options) {
2298
2274
  } else {
2299
2275
  s3 = peg$FAILED;
2300
2276
  if (peg$silentFails === 0) {
2301
- peg$fail(peg$e66);
2277
+ peg$fail(peg$e63);
2302
2278
  }
2303
2279
  }
2304
2280
  if (s3 !== peg$FAILED) {
@@ -2316,7 +2292,7 @@ function peg$parse(input, options) {
2316
2292
  return s0;
2317
2293
  }
2318
2294
  function peg$parseunquotedtransitionstring() {
2319
- var s0, s1;
2295
+ let s0, s1;
2320
2296
  s0 = peg$currPos;
2321
2297
  s1 = peg$parsetransitionnonsep();
2322
2298
  peg$savedPos = s0;
@@ -2325,7 +2301,7 @@ function peg$parse(input, options) {
2325
2301
  return s0;
2326
2302
  }
2327
2303
  function peg$parseunquotedstring() {
2328
- var s0, s1;
2304
+ let s0, s1;
2329
2305
  s0 = peg$currPos;
2330
2306
  s1 = peg$parsenonsep();
2331
2307
  peg$savedPos = s0;
@@ -2334,7 +2310,7 @@ function peg$parse(input, options) {
2334
2310
  return s0;
2335
2311
  }
2336
2312
  function peg$parsenonsep() {
2337
- var s0, s1, s2, s3;
2313
+ let s0, s1, s2, s3;
2338
2314
  s0 = [];
2339
2315
  s1 = peg$currPos;
2340
2316
  s2 = peg$currPos;
@@ -2345,7 +2321,7 @@ function peg$parse(input, options) {
2345
2321
  } else {
2346
2322
  s3 = peg$FAILED;
2347
2323
  if (peg$silentFails === 0) {
2348
- peg$fail(peg$e67);
2324
+ peg$fail(peg$e64);
2349
2325
  }
2350
2326
  }
2351
2327
  peg$silentFails--;
@@ -2362,7 +2338,7 @@ function peg$parse(input, options) {
2362
2338
  } else {
2363
2339
  s3 = peg$FAILED;
2364
2340
  if (peg$silentFails === 0) {
2365
- peg$fail(peg$e64);
2341
+ peg$fail(peg$e61);
2366
2342
  }
2367
2343
  }
2368
2344
  if (s3 !== peg$FAILED) {
@@ -2387,7 +2363,7 @@ function peg$parse(input, options) {
2387
2363
  } else {
2388
2364
  s3 = peg$FAILED;
2389
2365
  if (peg$silentFails === 0) {
2390
- peg$fail(peg$e67);
2366
+ peg$fail(peg$e64);
2391
2367
  }
2392
2368
  }
2393
2369
  peg$silentFails--;
@@ -2404,7 +2380,7 @@ function peg$parse(input, options) {
2404
2380
  } else {
2405
2381
  s3 = peg$FAILED;
2406
2382
  if (peg$silentFails === 0) {
2407
- peg$fail(peg$e64);
2383
+ peg$fail(peg$e61);
2408
2384
  }
2409
2385
  }
2410
2386
  if (s3 !== peg$FAILED) {
@@ -2422,7 +2398,7 @@ function peg$parse(input, options) {
2422
2398
  return s0;
2423
2399
  }
2424
2400
  function peg$parsetransitionnonsep() {
2425
- var s0, s1, s2, s3;
2401
+ let s0, s1, s2, s3;
2426
2402
  s0 = [];
2427
2403
  s1 = peg$currPos;
2428
2404
  s2 = peg$currPos;
@@ -2433,7 +2409,7 @@ function peg$parse(input, options) {
2433
2409
  } else {
2434
2410
  s3 = peg$FAILED;
2435
2411
  if (peg$silentFails === 0) {
2436
- peg$fail(peg$e68);
2412
+ peg$fail(peg$e65);
2437
2413
  }
2438
2414
  }
2439
2415
  peg$silentFails--;
@@ -2450,7 +2426,7 @@ function peg$parse(input, options) {
2450
2426
  } else {
2451
2427
  s3 = peg$FAILED;
2452
2428
  if (peg$silentFails === 0) {
2453
- peg$fail(peg$e64);
2429
+ peg$fail(peg$e61);
2454
2430
  }
2455
2431
  }
2456
2432
  if (s3 !== peg$FAILED) {
@@ -2475,7 +2451,7 @@ function peg$parse(input, options) {
2475
2451
  } else {
2476
2452
  s3 = peg$FAILED;
2477
2453
  if (peg$silentFails === 0) {
2478
- peg$fail(peg$e68);
2454
+ peg$fail(peg$e65);
2479
2455
  }
2480
2456
  }
2481
2457
  peg$silentFails--;
@@ -2492,7 +2468,7 @@ function peg$parse(input, options) {
2492
2468
  } else {
2493
2469
  s3 = peg$FAILED;
2494
2470
  if (peg$silentFails === 0) {
2495
- peg$fail(peg$e64);
2471
+ peg$fail(peg$e61);
2496
2472
  }
2497
2473
  }
2498
2474
  if (s3 !== peg$FAILED) {
@@ -2510,7 +2486,7 @@ function peg$parse(input, options) {
2510
2486
  return s0;
2511
2487
  }
2512
2488
  function peg$parseidentifier() {
2513
- var s0, s1, s2;
2489
+ let s0, s1, s2;
2514
2490
  peg$silentFails++;
2515
2491
  s0 = peg$currPos;
2516
2492
  s1 = [];
@@ -2520,7 +2496,7 @@ function peg$parse(input, options) {
2520
2496
  } else {
2521
2497
  s2 = peg$FAILED;
2522
2498
  if (peg$silentFails === 0) {
2523
- peg$fail(peg$e70);
2499
+ peg$fail(peg$e67);
2524
2500
  }
2525
2501
  }
2526
2502
  if (s2 !== peg$FAILED) {
@@ -2532,7 +2508,7 @@ function peg$parse(input, options) {
2532
2508
  } else {
2533
2509
  s2 = peg$FAILED;
2534
2510
  if (peg$silentFails === 0) {
2535
- peg$fail(peg$e70);
2511
+ peg$fail(peg$e67);
2536
2512
  }
2537
2513
  }
2538
2514
  }
@@ -2551,13 +2527,13 @@ function peg$parse(input, options) {
2551
2527
  if (s0 === peg$FAILED) {
2552
2528
  s1 = peg$FAILED;
2553
2529
  if (peg$silentFails === 0) {
2554
- peg$fail(peg$e69);
2530
+ peg$fail(peg$e66);
2555
2531
  }
2556
2532
  }
2557
2533
  return s0;
2558
2534
  }
2559
2535
  function peg$parsewhitespace() {
2560
- var s0, s1;
2536
+ let s0, s1;
2561
2537
  peg$silentFails++;
2562
2538
  s0 = input.charAt(peg$currPos);
2563
2539
  if (peg$r5.test(s0)) {
@@ -2565,20 +2541,20 @@ function peg$parse(input, options) {
2565
2541
  } else {
2566
2542
  s0 = peg$FAILED;
2567
2543
  if (peg$silentFails === 0) {
2568
- peg$fail(peg$e72);
2544
+ peg$fail(peg$e69);
2569
2545
  }
2570
2546
  }
2571
2547
  peg$silentFails--;
2572
2548
  if (s0 === peg$FAILED) {
2573
2549
  s1 = peg$FAILED;
2574
2550
  if (peg$silentFails === 0) {
2575
- peg$fail(peg$e71);
2551
+ peg$fail(peg$e68);
2576
2552
  }
2577
2553
  }
2578
2554
  return s0;
2579
2555
  }
2580
2556
  function peg$parselineend() {
2581
- var s0, s1;
2557
+ let s0, s1;
2582
2558
  peg$silentFails++;
2583
2559
  s0 = input.charAt(peg$currPos);
2584
2560
  if (peg$r6.test(s0)) {
@@ -2586,46 +2562,46 @@ function peg$parse(input, options) {
2586
2562
  } else {
2587
2563
  s0 = peg$FAILED;
2588
2564
  if (peg$silentFails === 0) {
2589
- peg$fail(peg$e74);
2565
+ peg$fail(peg$e71);
2590
2566
  }
2591
2567
  }
2592
2568
  peg$silentFails--;
2593
2569
  if (s0 === peg$FAILED) {
2594
2570
  s1 = peg$FAILED;
2595
2571
  if (peg$silentFails === 0) {
2596
- peg$fail(peg$e73);
2572
+ peg$fail(peg$e70);
2597
2573
  }
2598
2574
  }
2599
2575
  return s0;
2600
2576
  }
2601
2577
  function peg$parsemlcomstart() {
2602
- var s0;
2578
+ let s0;
2603
2579
  if (input.substr(peg$currPos, 2) === peg$c44) {
2604
2580
  s0 = peg$c44;
2605
2581
  peg$currPos += 2;
2606
2582
  } else {
2607
2583
  s0 = peg$FAILED;
2608
2584
  if (peg$silentFails === 0) {
2609
- peg$fail(peg$e75);
2585
+ peg$fail(peg$e72);
2610
2586
  }
2611
2587
  }
2612
2588
  return s0;
2613
2589
  }
2614
2590
  function peg$parsemlcomend() {
2615
- var s0;
2591
+ let s0;
2616
2592
  if (input.substr(peg$currPos, 2) === peg$c45) {
2617
2593
  s0 = peg$c45;
2618
2594
  peg$currPos += 2;
2619
2595
  } else {
2620
2596
  s0 = peg$FAILED;
2621
2597
  if (peg$silentFails === 0) {
2622
- peg$fail(peg$e76);
2598
+ peg$fail(peg$e73);
2623
2599
  }
2624
2600
  }
2625
2601
  return s0;
2626
2602
  }
2627
2603
  function peg$parsemlcomtok() {
2628
- var s0, s1, s2;
2604
+ let s0, s1, s2;
2629
2605
  s0 = peg$currPos;
2630
2606
  s1 = peg$currPos;
2631
2607
  peg$silentFails++;
@@ -2635,7 +2611,7 @@ function peg$parse(input, options) {
2635
2611
  } else {
2636
2612
  s2 = peg$FAILED;
2637
2613
  if (peg$silentFails === 0) {
2638
- peg$fail(peg$e76);
2614
+ peg$fail(peg$e73);
2639
2615
  }
2640
2616
  }
2641
2617
  peg$silentFails--;
@@ -2652,7 +2628,7 @@ function peg$parse(input, options) {
2652
2628
  } else {
2653
2629
  s2 = peg$FAILED;
2654
2630
  if (peg$silentFails === 0) {
2655
- peg$fail(peg$e64);
2631
+ peg$fail(peg$e61);
2656
2632
  }
2657
2633
  }
2658
2634
  if (s2 !== peg$FAILED) {
@@ -2669,7 +2645,7 @@ function peg$parse(input, options) {
2669
2645
  return s0;
2670
2646
  }
2671
2647
  function peg$parsemlcomment() {
2672
- var s0, s1, s2, s3;
2648
+ let s0, s1, s2, s3;
2673
2649
  s0 = peg$currPos;
2674
2650
  s1 = peg$parsemlcomstart();
2675
2651
  if (s1 !== peg$FAILED) {
@@ -2694,33 +2670,33 @@ function peg$parse(input, options) {
2694
2670
  return s0;
2695
2671
  }
2696
2672
  function peg$parseslcomstart() {
2697
- var s0;
2673
+ let s0;
2698
2674
  if (input.substr(peg$currPos, 2) === peg$c46) {
2699
2675
  s0 = peg$c46;
2700
2676
  peg$currPos += 2;
2701
2677
  } else {
2702
2678
  s0 = peg$FAILED;
2703
2679
  if (peg$silentFails === 0) {
2704
- peg$fail(peg$e77);
2680
+ peg$fail(peg$e74);
2705
2681
  }
2706
2682
  }
2707
2683
  return s0;
2708
2684
  }
2709
2685
  function peg$parseslcomtok() {
2710
- var s0;
2686
+ let s0;
2711
2687
  s0 = input.charAt(peg$currPos);
2712
2688
  if (peg$r7.test(s0)) {
2713
2689
  peg$currPos++;
2714
2690
  } else {
2715
2691
  s0 = peg$FAILED;
2716
2692
  if (peg$silentFails === 0) {
2717
- peg$fail(peg$e78);
2693
+ peg$fail(peg$e75);
2718
2694
  }
2719
2695
  }
2720
2696
  return s0;
2721
2697
  }
2722
2698
  function peg$parseslcomment() {
2723
- var s0, s1, s2, s3;
2699
+ let s0, s1, s2, s3;
2724
2700
  s0 = peg$currPos;
2725
2701
  s1 = peg$parseslcomstart();
2726
2702
  if (s1 !== peg$FAILED) {
@@ -2739,7 +2715,7 @@ function peg$parse(input, options) {
2739
2715
  return s0;
2740
2716
  }
2741
2717
  function peg$parsecomment() {
2742
- var s0, s1;
2718
+ let s0, s1;
2743
2719
  peg$silentFails++;
2744
2720
  s0 = peg$parseslcomment();
2745
2721
  if (s0 === peg$FAILED) {
@@ -2749,13 +2725,13 @@ function peg$parse(input, options) {
2749
2725
  if (s0 === peg$FAILED) {
2750
2726
  s1 = peg$FAILED;
2751
2727
  if (peg$silentFails === 0) {
2752
- peg$fail(peg$e79);
2728
+ peg$fail(peg$e76);
2753
2729
  }
2754
2730
  }
2755
2731
  return s0;
2756
2732
  }
2757
2733
  function peg$parse_() {
2758
- var s0, s1;
2734
+ let s0, s1;
2759
2735
  s0 = [];
2760
2736
  s1 = peg$parsewhitespace();
2761
2737
  if (s1 === peg$FAILED) {
@@ -2777,6 +2753,19 @@ function peg$parse(input, options) {
2777
2753
  return s0;
2778
2754
  }
2779
2755
  peg$result = peg$startRuleFunction();
2756
+ const peg$success = peg$result !== peg$FAILED && peg$currPos === input.length;
2757
+ function peg$throw() {
2758
+ if (peg$result !== peg$FAILED && peg$currPos < input.length) {
2759
+ peg$fail(peg$endExpectation());
2760
+ }
2761
+ throw peg$buildStructuredError(
2762
+ peg$maxFailExpected,
2763
+ peg$maxFailPos < input.length ? peg$getUnicode(peg$maxFailPos) : null,
2764
+ peg$maxFailPos < input.length
2765
+ ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)
2766
+ : peg$computeLocation(peg$maxFailPos, peg$maxFailPos),
2767
+ );
2768
+ }
2780
2769
  if (options.peg$library) {
2781
2770
  return {
2782
2771
  peg$result,
@@ -2784,21 +2773,14 @@ function peg$parse(input, options) {
2784
2773
  peg$FAILED,
2785
2774
  peg$maxFailExpected,
2786
2775
  peg$maxFailPos,
2776
+ peg$success,
2777
+ peg$throw: peg$success ? undefined : peg$throw,
2787
2778
  };
2788
2779
  }
2789
- if (peg$result !== peg$FAILED && peg$currPos === input.length) {
2780
+ if (peg$success) {
2790
2781
  return peg$result;
2791
2782
  } else {
2792
- if (peg$result !== peg$FAILED && peg$currPos < input.length) {
2793
- peg$fail(peg$endExpectation());
2794
- }
2795
- throw peg$buildStructuredError(
2796
- peg$maxFailExpected,
2797
- peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,
2798
- peg$maxFailPos < input.length
2799
- ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)
2800
- : peg$computeLocation(peg$maxFailPos, peg$maxFailPos),
2801
- );
2783
+ peg$throw();
2802
2784
  }
2803
2785
  }
2804
2786
  const peg$allowedStartRules = ["program"];