podlite 0.0.57 → 0.0.59

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 (72) hide show
  1. package/CHANGELOG.podlite +14 -0
  2. package/esm/cli.js +31 -5
  3. package/esm/cli.js.map +1 -1
  4. package/esm/index.js +10 -2
  5. package/esm/index.js.map +1 -1
  6. package/esm/lint/formatters/json.d.ts +9 -0
  7. package/esm/lint/formatters/json.js +5 -0
  8. package/esm/lint/formatters/json.js.map +1 -0
  9. package/esm/lint/formatters/text.d.ts +9 -0
  10. package/esm/lint/formatters/text.js +41 -0
  11. package/esm/lint/formatters/text.js.map +1 -0
  12. package/esm/lint/grammar/lint.d.ts +14 -0
  13. package/esm/lint/grammar/lint.js +910 -0
  14. package/esm/lint/grammar/lint.js.map +1 -0
  15. package/esm/lint/grammar/scan.d.ts +9 -0
  16. package/esm/lint/grammar/scan.js +36 -0
  17. package/esm/lint/grammar/scan.js.map +1 -0
  18. package/esm/lint/index.d.ts +7 -1
  19. package/esm/lint/index.js +45 -10
  20. package/esm/lint/index.js.map +1 -1
  21. package/esm/lint/loader.d.ts +5 -0
  22. package/esm/lint/loader.js +19 -0
  23. package/esm/lint/loader.js.map +1 -0
  24. package/esm/lint/rules/heading-hierarchy.d.ts +3 -0
  25. package/esm/lint/rules/heading-hierarchy.js +27 -0
  26. package/esm/lint/rules/heading-hierarchy.js.map +1 -0
  27. package/esm/lint/rules/id-unique.d.ts +10 -0
  28. package/esm/lint/rules/id-unique.js +41 -0
  29. package/esm/lint/rules/id-unique.js.map +1 -0
  30. package/esm/lint/rules/index.d.ts +2 -0
  31. package/esm/lint/rules/index.js +4 -0
  32. package/esm/lint/rules/index.js.map +1 -0
  33. package/esm/lint/rules/syntax-valid.d.ts +4 -0
  34. package/esm/lint/rules/syntax-valid.js +30 -0
  35. package/esm/lint/rules/syntax-valid.js.map +1 -0
  36. package/esm/lint/types.d.ts +4 -0
  37. package/lib/cli.js +31 -5
  38. package/lib/cli.js.map +1 -1
  39. package/lib/index.js +10 -2
  40. package/lib/index.js.map +1 -1
  41. package/lib/lint/formatters/json.d.ts +9 -0
  42. package/lib/lint/formatters/json.js +9 -0
  43. package/lib/lint/formatters/json.js.map +1 -0
  44. package/lib/lint/formatters/text.d.ts +9 -0
  45. package/lib/lint/formatters/text.js +45 -0
  46. package/lib/lint/formatters/text.js.map +1 -0
  47. package/lib/lint/grammar/lint.d.ts +14 -0
  48. package/lib/lint/grammar/lint.js +910 -0
  49. package/lib/lint/grammar/lint.js.map +1 -0
  50. package/lib/lint/grammar/scan.d.ts +9 -0
  51. package/lib/lint/grammar/scan.js +40 -0
  52. package/lib/lint/grammar/scan.js.map +1 -0
  53. package/lib/lint/index.d.ts +7 -1
  54. package/lib/lint/index.js +45 -10
  55. package/lib/lint/index.js.map +1 -1
  56. package/lib/lint/loader.d.ts +5 -0
  57. package/lib/lint/loader.js +44 -0
  58. package/lib/lint/loader.js.map +1 -0
  59. package/lib/lint/rules/heading-hierarchy.d.ts +3 -0
  60. package/lib/lint/rules/heading-hierarchy.js +30 -0
  61. package/lib/lint/rules/heading-hierarchy.js.map +1 -0
  62. package/lib/lint/rules/id-unique.d.ts +10 -0
  63. package/lib/lint/rules/id-unique.js +45 -0
  64. package/lib/lint/rules/id-unique.js.map +1 -0
  65. package/lib/lint/rules/index.d.ts +2 -0
  66. package/lib/lint/rules/index.js +7 -0
  67. package/lib/lint/rules/index.js.map +1 -0
  68. package/lib/lint/rules/syntax-valid.d.ts +4 -0
  69. package/lib/lint/rules/syntax-valid.js +34 -0
  70. package/lib/lint/rules/syntax-valid.js.map +1 -0
  71. package/lib/lint/types.d.ts +4 -0
  72. package/package.json +11 -8
@@ -0,0 +1,910 @@
1
+ /*
2
+ * Generated by Pegmill 0.1.0
3
+ *
4
+ * https://github.com/zag/pegmill
5
+ */
6
+ 'use strict';
7
+ function peg$subclass(child, parent) {
8
+ function ctor() {
9
+ this.constructor = child;
10
+ }
11
+ ctor.prototype = parent.prototype;
12
+ child.prototype = new ctor();
13
+ }
14
+ function peg$SyntaxError(message, expected, found, location) {
15
+ this.message = message;
16
+ this.expected = expected;
17
+ this.found = found;
18
+ this.location = location;
19
+ this.name = 'SyntaxError';
20
+ if (typeof Error.captureStackTrace === 'function') {
21
+ Error.captureStackTrace(this, peg$SyntaxError);
22
+ }
23
+ }
24
+ peg$subclass(peg$SyntaxError, Error);
25
+ peg$SyntaxError.buildMessage = function (expected, found) {
26
+ var DESCRIBE_EXPECTATION_FNS = {
27
+ literal: function (expectation) {
28
+ return '"' + literalEscape(expectation.text) + '"';
29
+ },
30
+ class: function (expectation) {
31
+ var escapedParts = '', i;
32
+ for (i = 0; i < expectation.parts.length; i++) {
33
+ escapedParts +=
34
+ expectation.parts[i] instanceof Array
35
+ ? classEscape(expectation.parts[i][0]) + '-' + classEscape(expectation.parts[i][1])
36
+ : classEscape(expectation.parts[i]);
37
+ }
38
+ return '[' + (expectation.inverted ? '^' : '') + escapedParts + ']';
39
+ },
40
+ any: function (expectation) {
41
+ return 'any character';
42
+ },
43
+ end: function (expectation) {
44
+ return 'end of input';
45
+ },
46
+ other: function (expectation) {
47
+ return expectation.description;
48
+ },
49
+ };
50
+ function hex(ch) {
51
+ return ch.charCodeAt(0).toString(16).toUpperCase();
52
+ }
53
+ function literalEscape(s) {
54
+ return s
55
+ .replace(/\\/g, '\\\\')
56
+ .replace(/"/g, '\\"')
57
+ .replace(/\0/g, '\\0')
58
+ .replace(/\t/g, '\\t')
59
+ .replace(/\n/g, '\\n')
60
+ .replace(/\r/g, '\\r')
61
+ .replace(/[\x00-\x0F]/g, function (ch) {
62
+ return '\\x0' + hex(ch);
63
+ })
64
+ .replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) {
65
+ return '\\x' + hex(ch);
66
+ });
67
+ }
68
+ function classEscape(s) {
69
+ return s
70
+ .replace(/\\/g, '\\\\')
71
+ .replace(/\]/g, '\\]')
72
+ .replace(/\^/g, '\\^')
73
+ .replace(/-/g, '\\-')
74
+ .replace(/\0/g, '\\0')
75
+ .replace(/\t/g, '\\t')
76
+ .replace(/\n/g, '\\n')
77
+ .replace(/\r/g, '\\r')
78
+ .replace(/[\x00-\x0F]/g, function (ch) {
79
+ return '\\x0' + hex(ch);
80
+ })
81
+ .replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) {
82
+ return '\\x' + hex(ch);
83
+ });
84
+ }
85
+ function describeExpectation(expectation) {
86
+ return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
87
+ }
88
+ function describeExpected(expected) {
89
+ var descriptions = new Array(expected.length), i, j;
90
+ for (i = 0; i < expected.length; i++) {
91
+ descriptions[i] = describeExpectation(expected[i]);
92
+ }
93
+ descriptions.sort();
94
+ if (descriptions.length > 0) {
95
+ for (i = 1, j = 1; i < descriptions.length; i++) {
96
+ if (descriptions[i - 1] !== descriptions[i]) {
97
+ descriptions[j] = descriptions[i];
98
+ j++;
99
+ }
100
+ }
101
+ descriptions.length = j;
102
+ }
103
+ switch (descriptions.length) {
104
+ case 1:
105
+ return descriptions[0];
106
+ case 2:
107
+ return descriptions[0] + ' or ' + descriptions[1];
108
+ default:
109
+ return descriptions.slice(0, -1).join(', ') + ', or ' + descriptions[descriptions.length - 1];
110
+ }
111
+ }
112
+ function describeFound(found) {
113
+ return found ? '"' + literalEscape(found) + '"' : 'end of input';
114
+ }
115
+ return 'Expected ' + describeExpected(expected) + ' but ' + describeFound(found) + ' found.';
116
+ };
117
+ function peg$parse(input, options) {
118
+ options = options !== void 0 ? options : {};
119
+ var peg$FAILED = {}, peg$startRuleFunctions = { start: peg$parsestart }, peg$startRuleFunction = peg$parsestart, peg$c0 = peg$anyExpectation(), peg$c1 = ':', peg$c2 = peg$literalExpectation(':', false), peg$c3 = '<', peg$c4 = peg$literalExpectation('<', false), peg$c5 = /^[^>]/, peg$c6 = peg$classExpectation(['>'], true, false), peg$c7 = '>', peg$c8 = peg$literalExpectation('>', false), peg$c9 = function (name, value) {
120
+ if (value.indexOf('<') !== -1) {
121
+ options.diagnostics.push({
122
+ rule: 'attr-nested-angle',
123
+ severity: 'error',
124
+ message: 'attribute value contains a nested <…> that closes the attribute early; use a non-conflicting delimiter ("...", [...], (...), <<...>>) or plain text',
125
+ location: location(),
126
+ });
127
+ }
128
+ return null;
129
+ }, peg$c10 = '=begin', peg$c11 = peg$literalExpectation('=begin', false), peg$c12 = function (name) {
130
+ const top = options._blockStack[options._blockStack.length - 1];
131
+ if (top && top.name === name) {
132
+ options.diagnostics.push({
133
+ rule: 'delimited-block-balance',
134
+ severity: 'error',
135
+ message: '=begin ' +
136
+ name +
137
+ ' nested inside =begin ' +
138
+ name +
139
+ ' (opened at line ' +
140
+ top.location.start.line +
141
+ '); indent inner =begin/=end markers by one space to make them verbatim content',
142
+ location: location(),
143
+ });
144
+ }
145
+ options._blockStack.push({ name: name, location: location() });
146
+ options._inDirective = true;
147
+ return null;
148
+ }, peg$c13 = '=end', peg$c14 = peg$literalExpectation('=end', false), peg$c15 = function (name) {
149
+ const top = options._blockStack[options._blockStack.length - 1];
150
+ if (!top) {
151
+ options.diagnostics.push({
152
+ rule: 'delimited-block-balance',
153
+ severity: 'error',
154
+ message: '=end ' + name + ' without matching =begin',
155
+ location: location(),
156
+ });
157
+ }
158
+ else if (top.name !== name) {
159
+ options.diagnostics.push({
160
+ rule: 'delimited-block-balance',
161
+ severity: 'error',
162
+ message: '=end ' + name + ' does not match =begin ' + top.name + ' (opened at line ' + top.location.start.line + ')',
163
+ location: location(),
164
+ });
165
+ options._blockStack.pop();
166
+ }
167
+ else {
168
+ options._blockStack.pop();
169
+ }
170
+ options._inDirective = false;
171
+ return null;
172
+ }, peg$c16 = '=for', peg$c17 = peg$literalExpectation('=for', false), peg$c18 = function () {
173
+ options._inDirective = true;
174
+ return null;
175
+ }, peg$c19 = function (name) {
176
+ if (options._inDirective) {
177
+ options.diagnostics.push({
178
+ rule: 'attr-continuation-dropped',
179
+ severity: 'warning',
180
+ message: 'attribute :' + name + '<…> on continuation line is silently dropped; flatten onto the directive line',
181
+ location: location(),
182
+ });
183
+ }
184
+ return null;
185
+ }, peg$c20 = /^[ \t]/, peg$c21 = peg$classExpectation([' ', '\t'], false, false), peg$c22 = '\n', peg$c23 = peg$literalExpectation('\n', false), peg$c24 = function () {
186
+ options._inDirective = false;
187
+ return null;
188
+ }, peg$c25 = peg$otherExpectation('identifier'), peg$c26 = /^[a-zA-Z]/, peg$c27 = peg$classExpectation([
189
+ ['a', 'z'],
190
+ ['A', 'Z'],
191
+ ], false, false), peg$c28 = /^[a-zA-Z0-9_\-]/, peg$c29 = peg$classExpectation([['a', 'z'], ['A', 'Z'], ['0', '9'], '_', '-'], false, false), peg$c30 = peg$otherExpectation('start-of-line'), peg$c31 = function () {
192
+ return location().start.column === 1;
193
+ }, peg$c32 = peg$otherExpectation('whitespace'), peg$currPos = 0, peg$savedPos = 0, peg$posDetailsCache = [{ line: 1, column: 1 }], peg$maxFailPos = 0, peg$maxFailExpected = [], peg$silentFails = 0, peg$result;
194
+ if ('startRule' in options) {
195
+ if (!(options.startRule in peg$startRuleFunctions)) {
196
+ throw new Error('Can\'t start parsing from rule "' + options.startRule + '".');
197
+ }
198
+ peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
199
+ }
200
+ function text() {
201
+ return input.substring(peg$savedPos, peg$currPos);
202
+ }
203
+ function location() {
204
+ return peg$computeLocation(peg$savedPos, peg$currPos);
205
+ }
206
+ function expected(description, location) {
207
+ location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos);
208
+ throw peg$buildStructuredError([peg$otherExpectation(description)], input.substring(peg$savedPos, peg$currPos), location);
209
+ }
210
+ function error(message, location) {
211
+ location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos);
212
+ throw peg$buildSimpleError(message, location);
213
+ }
214
+ function peg$literalExpectation(text, ignoreCase) {
215
+ return { type: 'literal', text: text, ignoreCase: ignoreCase };
216
+ }
217
+ function peg$classExpectation(parts, inverted, ignoreCase) {
218
+ return { type: 'class', parts: parts, inverted: inverted, ignoreCase: ignoreCase };
219
+ }
220
+ function peg$anyExpectation() {
221
+ return { type: 'any' };
222
+ }
223
+ function peg$endExpectation() {
224
+ return { type: 'end' };
225
+ }
226
+ function peg$otherExpectation(description) {
227
+ return { type: 'other', description: description };
228
+ }
229
+ function peg$computePosDetails(pos) {
230
+ var details = peg$posDetailsCache[pos], p;
231
+ if (details) {
232
+ return details;
233
+ }
234
+ else {
235
+ p = pos - 1;
236
+ while (!peg$posDetailsCache[p]) {
237
+ p--;
238
+ }
239
+ details = peg$posDetailsCache[p];
240
+ details = {
241
+ line: details.line,
242
+ column: details.column,
243
+ };
244
+ while (p < pos) {
245
+ if (input.charCodeAt(p) === 10) {
246
+ details.line++;
247
+ details.column = 1;
248
+ }
249
+ else {
250
+ details.column++;
251
+ }
252
+ p++;
253
+ }
254
+ peg$posDetailsCache[pos] = details;
255
+ return details;
256
+ }
257
+ }
258
+ function peg$computeLocation(startPos, endPos) {
259
+ var startPosDetails = peg$computePosDetails(startPos), endPosDetails = peg$computePosDetails(endPos);
260
+ return {
261
+ start: {
262
+ offset: startPos,
263
+ line: startPosDetails.line,
264
+ column: startPosDetails.column,
265
+ },
266
+ end: {
267
+ offset: endPos,
268
+ line: endPosDetails.line,
269
+ column: endPosDetails.column,
270
+ },
271
+ };
272
+ }
273
+ function peg$fail(expected) {
274
+ if (peg$currPos < peg$maxFailPos) {
275
+ return;
276
+ }
277
+ if (peg$currPos > peg$maxFailPos) {
278
+ peg$maxFailPos = peg$currPos;
279
+ peg$maxFailExpected = [];
280
+ }
281
+ peg$maxFailExpected.push(expected);
282
+ }
283
+ function peg$buildSimpleError(message, location) {
284
+ return new peg$SyntaxError(message, null, null, location);
285
+ }
286
+ function peg$buildStructuredError(expected, found, location) {
287
+ return new peg$SyntaxError(peg$SyntaxError.buildMessage(expected, found), expected, found, location);
288
+ }
289
+ function peg$parsestart() {
290
+ var s0, s1;
291
+ s0 = [];
292
+ s1 = peg$parserule_match();
293
+ if (s1 === peg$FAILED) {
294
+ if (input.length > peg$currPos) {
295
+ s1 = input.charAt(peg$currPos);
296
+ peg$currPos++;
297
+ }
298
+ else {
299
+ s1 = peg$FAILED;
300
+ if (peg$silentFails === 0) {
301
+ peg$fail(peg$c0);
302
+ }
303
+ }
304
+ }
305
+ while (s1 !== peg$FAILED) {
306
+ s0.push(s1);
307
+ s1 = peg$parserule_match();
308
+ if (s1 === peg$FAILED) {
309
+ if (input.length > peg$currPos) {
310
+ s1 = input.charAt(peg$currPos);
311
+ peg$currPos++;
312
+ }
313
+ else {
314
+ s1 = peg$FAILED;
315
+ if (peg$silentFails === 0) {
316
+ peg$fail(peg$c0);
317
+ }
318
+ }
319
+ }
320
+ }
321
+ return s0;
322
+ }
323
+ function peg$parserule_match() {
324
+ var s0;
325
+ s0 = peg$parseattr_nested_angle();
326
+ if (s0 === peg$FAILED) {
327
+ s0 = peg$parsedelim_begin();
328
+ if (s0 === peg$FAILED) {
329
+ s0 = peg$parsedelim_end();
330
+ if (s0 === peg$FAILED) {
331
+ s0 = peg$parseparagraph_directive();
332
+ if (s0 === peg$FAILED) {
333
+ s0 = peg$parsecontinuation_attr();
334
+ if (s0 === peg$FAILED) {
335
+ s0 = peg$parseblank_line_marker();
336
+ if (s0 === peg$FAILED) {
337
+ s0 = peg$parseline_marker();
338
+ }
339
+ }
340
+ }
341
+ }
342
+ }
343
+ }
344
+ return s0;
345
+ }
346
+ function peg$parseattr_nested_angle() {
347
+ var s0, s1, s2, s3, s4, s5, s6, s7;
348
+ s0 = peg$currPos;
349
+ if (input.charCodeAt(peg$currPos) === 58) {
350
+ s1 = peg$c1;
351
+ peg$currPos++;
352
+ }
353
+ else {
354
+ s1 = peg$FAILED;
355
+ if (peg$silentFails === 0) {
356
+ peg$fail(peg$c2);
357
+ }
358
+ }
359
+ if (s1 !== peg$FAILED) {
360
+ s2 = peg$parseidentifier();
361
+ if (s2 !== peg$FAILED) {
362
+ if (input.charCodeAt(peg$currPos) === 60) {
363
+ s3 = peg$c3;
364
+ peg$currPos++;
365
+ }
366
+ else {
367
+ s3 = peg$FAILED;
368
+ if (peg$silentFails === 0) {
369
+ peg$fail(peg$c4);
370
+ }
371
+ }
372
+ if (s3 !== peg$FAILED) {
373
+ s4 = peg$currPos;
374
+ peg$silentFails++;
375
+ if (input.charCodeAt(peg$currPos) === 60) {
376
+ s5 = peg$c3;
377
+ peg$currPos++;
378
+ }
379
+ else {
380
+ s5 = peg$FAILED;
381
+ if (peg$silentFails === 0) {
382
+ peg$fail(peg$c4);
383
+ }
384
+ }
385
+ peg$silentFails--;
386
+ if (s5 === peg$FAILED) {
387
+ s4 = void 0;
388
+ }
389
+ else {
390
+ peg$currPos = s4;
391
+ s4 = peg$FAILED;
392
+ }
393
+ if (s4 !== peg$FAILED) {
394
+ s5 = peg$currPos;
395
+ s6 = [];
396
+ if (peg$c5.test(input.charAt(peg$currPos))) {
397
+ s7 = input.charAt(peg$currPos);
398
+ peg$currPos++;
399
+ }
400
+ else {
401
+ s7 = peg$FAILED;
402
+ if (peg$silentFails === 0) {
403
+ peg$fail(peg$c6);
404
+ }
405
+ }
406
+ while (s7 !== peg$FAILED) {
407
+ s6.push(s7);
408
+ if (peg$c5.test(input.charAt(peg$currPos))) {
409
+ s7 = input.charAt(peg$currPos);
410
+ peg$currPos++;
411
+ }
412
+ else {
413
+ s7 = peg$FAILED;
414
+ if (peg$silentFails === 0) {
415
+ peg$fail(peg$c6);
416
+ }
417
+ }
418
+ }
419
+ if (s6 !== peg$FAILED) {
420
+ s5 = input.substring(s5, peg$currPos);
421
+ }
422
+ else {
423
+ s5 = s6;
424
+ }
425
+ if (s5 !== peg$FAILED) {
426
+ if (input.charCodeAt(peg$currPos) === 62) {
427
+ s6 = peg$c7;
428
+ peg$currPos++;
429
+ }
430
+ else {
431
+ s6 = peg$FAILED;
432
+ if (peg$silentFails === 0) {
433
+ peg$fail(peg$c8);
434
+ }
435
+ }
436
+ if (s6 !== peg$FAILED) {
437
+ peg$savedPos = s0;
438
+ s1 = peg$c9(s2, s5);
439
+ s0 = s1;
440
+ }
441
+ else {
442
+ peg$currPos = s0;
443
+ s0 = peg$FAILED;
444
+ }
445
+ }
446
+ else {
447
+ peg$currPos = s0;
448
+ s0 = peg$FAILED;
449
+ }
450
+ }
451
+ else {
452
+ peg$currPos = s0;
453
+ s0 = peg$FAILED;
454
+ }
455
+ }
456
+ else {
457
+ peg$currPos = s0;
458
+ s0 = peg$FAILED;
459
+ }
460
+ }
461
+ else {
462
+ peg$currPos = s0;
463
+ s0 = peg$FAILED;
464
+ }
465
+ }
466
+ else {
467
+ peg$currPos = s0;
468
+ s0 = peg$FAILED;
469
+ }
470
+ return s0;
471
+ }
472
+ function peg$parsedelim_begin() {
473
+ var s0, s1, s2, s3, s4;
474
+ s0 = peg$currPos;
475
+ s1 = peg$parsesol();
476
+ if (s1 !== peg$FAILED) {
477
+ if (input.substr(peg$currPos, 6) === peg$c10) {
478
+ s2 = peg$c10;
479
+ peg$currPos += 6;
480
+ }
481
+ else {
482
+ s2 = peg$FAILED;
483
+ if (peg$silentFails === 0) {
484
+ peg$fail(peg$c11);
485
+ }
486
+ }
487
+ if (s2 !== peg$FAILED) {
488
+ s3 = peg$parse__();
489
+ if (s3 !== peg$FAILED) {
490
+ s4 = peg$parseidentifier();
491
+ if (s4 !== peg$FAILED) {
492
+ peg$savedPos = s0;
493
+ s1 = peg$c12(s4);
494
+ s0 = s1;
495
+ }
496
+ else {
497
+ peg$currPos = s0;
498
+ s0 = peg$FAILED;
499
+ }
500
+ }
501
+ else {
502
+ peg$currPos = s0;
503
+ s0 = peg$FAILED;
504
+ }
505
+ }
506
+ else {
507
+ peg$currPos = s0;
508
+ s0 = peg$FAILED;
509
+ }
510
+ }
511
+ else {
512
+ peg$currPos = s0;
513
+ s0 = peg$FAILED;
514
+ }
515
+ return s0;
516
+ }
517
+ function peg$parsedelim_end() {
518
+ var s0, s1, s2, s3, s4;
519
+ s0 = peg$currPos;
520
+ s1 = peg$parsesol();
521
+ if (s1 !== peg$FAILED) {
522
+ if (input.substr(peg$currPos, 4) === peg$c13) {
523
+ s2 = peg$c13;
524
+ peg$currPos += 4;
525
+ }
526
+ else {
527
+ s2 = peg$FAILED;
528
+ if (peg$silentFails === 0) {
529
+ peg$fail(peg$c14);
530
+ }
531
+ }
532
+ if (s2 !== peg$FAILED) {
533
+ s3 = peg$parse__();
534
+ if (s3 !== peg$FAILED) {
535
+ s4 = peg$parseidentifier();
536
+ if (s4 !== peg$FAILED) {
537
+ peg$savedPos = s0;
538
+ s1 = peg$c15(s4);
539
+ s0 = s1;
540
+ }
541
+ else {
542
+ peg$currPos = s0;
543
+ s0 = peg$FAILED;
544
+ }
545
+ }
546
+ else {
547
+ peg$currPos = s0;
548
+ s0 = peg$FAILED;
549
+ }
550
+ }
551
+ else {
552
+ peg$currPos = s0;
553
+ s0 = peg$FAILED;
554
+ }
555
+ }
556
+ else {
557
+ peg$currPos = s0;
558
+ s0 = peg$FAILED;
559
+ }
560
+ return s0;
561
+ }
562
+ function peg$parseparagraph_directive() {
563
+ var s0, s1, s2, s3, s4;
564
+ s0 = peg$currPos;
565
+ s1 = peg$parsesol();
566
+ if (s1 !== peg$FAILED) {
567
+ if (input.substr(peg$currPos, 4) === peg$c16) {
568
+ s2 = peg$c16;
569
+ peg$currPos += 4;
570
+ }
571
+ else {
572
+ s2 = peg$FAILED;
573
+ if (peg$silentFails === 0) {
574
+ peg$fail(peg$c17);
575
+ }
576
+ }
577
+ if (s2 !== peg$FAILED) {
578
+ s3 = peg$parse__();
579
+ if (s3 !== peg$FAILED) {
580
+ s4 = peg$parseidentifier();
581
+ if (s4 !== peg$FAILED) {
582
+ peg$savedPos = s0;
583
+ s1 = peg$c18();
584
+ s0 = s1;
585
+ }
586
+ else {
587
+ peg$currPos = s0;
588
+ s0 = peg$FAILED;
589
+ }
590
+ }
591
+ else {
592
+ peg$currPos = s0;
593
+ s0 = peg$FAILED;
594
+ }
595
+ }
596
+ else {
597
+ peg$currPos = s0;
598
+ s0 = peg$FAILED;
599
+ }
600
+ }
601
+ else {
602
+ peg$currPos = s0;
603
+ s0 = peg$FAILED;
604
+ }
605
+ return s0;
606
+ }
607
+ function peg$parsecontinuation_attr() {
608
+ var s0, s1, s2, s3, s4, s5;
609
+ s0 = peg$currPos;
610
+ s1 = peg$parsesol();
611
+ if (s1 !== peg$FAILED) {
612
+ s2 = peg$parse__();
613
+ if (s2 !== peg$FAILED) {
614
+ if (input.charCodeAt(peg$currPos) === 58) {
615
+ s3 = peg$c1;
616
+ peg$currPos++;
617
+ }
618
+ else {
619
+ s3 = peg$FAILED;
620
+ if (peg$silentFails === 0) {
621
+ peg$fail(peg$c2);
622
+ }
623
+ }
624
+ if (s3 !== peg$FAILED) {
625
+ s4 = peg$parseidentifier();
626
+ if (s4 !== peg$FAILED) {
627
+ if (input.charCodeAt(peg$currPos) === 60) {
628
+ s5 = peg$c3;
629
+ peg$currPos++;
630
+ }
631
+ else {
632
+ s5 = peg$FAILED;
633
+ if (peg$silentFails === 0) {
634
+ peg$fail(peg$c4);
635
+ }
636
+ }
637
+ if (s5 !== peg$FAILED) {
638
+ peg$savedPos = s0;
639
+ s1 = peg$c19(s4);
640
+ s0 = s1;
641
+ }
642
+ else {
643
+ peg$currPos = s0;
644
+ s0 = peg$FAILED;
645
+ }
646
+ }
647
+ else {
648
+ peg$currPos = s0;
649
+ s0 = peg$FAILED;
650
+ }
651
+ }
652
+ else {
653
+ peg$currPos = s0;
654
+ s0 = peg$FAILED;
655
+ }
656
+ }
657
+ else {
658
+ peg$currPos = s0;
659
+ s0 = peg$FAILED;
660
+ }
661
+ }
662
+ else {
663
+ peg$currPos = s0;
664
+ s0 = peg$FAILED;
665
+ }
666
+ return s0;
667
+ }
668
+ function peg$parseblank_line_marker() {
669
+ var s0, s1, s2, s3;
670
+ s0 = peg$currPos;
671
+ s1 = peg$parsesol();
672
+ if (s1 !== peg$FAILED) {
673
+ s2 = [];
674
+ if (peg$c20.test(input.charAt(peg$currPos))) {
675
+ s3 = input.charAt(peg$currPos);
676
+ peg$currPos++;
677
+ }
678
+ else {
679
+ s3 = peg$FAILED;
680
+ if (peg$silentFails === 0) {
681
+ peg$fail(peg$c21);
682
+ }
683
+ }
684
+ while (s3 !== peg$FAILED) {
685
+ s2.push(s3);
686
+ if (peg$c20.test(input.charAt(peg$currPos))) {
687
+ s3 = input.charAt(peg$currPos);
688
+ peg$currPos++;
689
+ }
690
+ else {
691
+ s3 = peg$FAILED;
692
+ if (peg$silentFails === 0) {
693
+ peg$fail(peg$c21);
694
+ }
695
+ }
696
+ }
697
+ if (s2 !== peg$FAILED) {
698
+ if (input.charCodeAt(peg$currPos) === 10) {
699
+ s3 = peg$c22;
700
+ peg$currPos++;
701
+ }
702
+ else {
703
+ s3 = peg$FAILED;
704
+ if (peg$silentFails === 0) {
705
+ peg$fail(peg$c23);
706
+ }
707
+ }
708
+ if (s3 !== peg$FAILED) {
709
+ peg$savedPos = s0;
710
+ s1 = peg$c24();
711
+ s0 = s1;
712
+ }
713
+ else {
714
+ peg$currPos = s0;
715
+ s0 = peg$FAILED;
716
+ }
717
+ }
718
+ else {
719
+ peg$currPos = s0;
720
+ s0 = peg$FAILED;
721
+ }
722
+ }
723
+ else {
724
+ peg$currPos = s0;
725
+ s0 = peg$FAILED;
726
+ }
727
+ return s0;
728
+ }
729
+ function peg$parseline_marker() {
730
+ var s0, s1, s2;
731
+ s0 = peg$currPos;
732
+ s1 = peg$parsesol();
733
+ if (s1 !== peg$FAILED) {
734
+ if (input.length > peg$currPos) {
735
+ s2 = input.charAt(peg$currPos);
736
+ peg$currPos++;
737
+ }
738
+ else {
739
+ s2 = peg$FAILED;
740
+ if (peg$silentFails === 0) {
741
+ peg$fail(peg$c0);
742
+ }
743
+ }
744
+ if (s2 !== peg$FAILED) {
745
+ peg$savedPos = s0;
746
+ s1 = peg$c24();
747
+ s0 = s1;
748
+ }
749
+ else {
750
+ peg$currPos = s0;
751
+ s0 = peg$FAILED;
752
+ }
753
+ }
754
+ else {
755
+ peg$currPos = s0;
756
+ s0 = peg$FAILED;
757
+ }
758
+ return s0;
759
+ }
760
+ function peg$parseidentifier() {
761
+ var s0, s1, s2, s3, s4;
762
+ peg$silentFails++;
763
+ s0 = peg$currPos;
764
+ s1 = peg$currPos;
765
+ if (peg$c26.test(input.charAt(peg$currPos))) {
766
+ s2 = input.charAt(peg$currPos);
767
+ peg$currPos++;
768
+ }
769
+ else {
770
+ s2 = peg$FAILED;
771
+ if (peg$silentFails === 0) {
772
+ peg$fail(peg$c27);
773
+ }
774
+ }
775
+ if (s2 !== peg$FAILED) {
776
+ s3 = [];
777
+ if (peg$c28.test(input.charAt(peg$currPos))) {
778
+ s4 = input.charAt(peg$currPos);
779
+ peg$currPos++;
780
+ }
781
+ else {
782
+ s4 = peg$FAILED;
783
+ if (peg$silentFails === 0) {
784
+ peg$fail(peg$c29);
785
+ }
786
+ }
787
+ while (s4 !== peg$FAILED) {
788
+ s3.push(s4);
789
+ if (peg$c28.test(input.charAt(peg$currPos))) {
790
+ s4 = input.charAt(peg$currPos);
791
+ peg$currPos++;
792
+ }
793
+ else {
794
+ s4 = peg$FAILED;
795
+ if (peg$silentFails === 0) {
796
+ peg$fail(peg$c29);
797
+ }
798
+ }
799
+ }
800
+ if (s3 !== peg$FAILED) {
801
+ s2 = [s2, s3];
802
+ s1 = s2;
803
+ }
804
+ else {
805
+ peg$currPos = s1;
806
+ s1 = peg$FAILED;
807
+ }
808
+ }
809
+ else {
810
+ peg$currPos = s1;
811
+ s1 = peg$FAILED;
812
+ }
813
+ if (s1 !== peg$FAILED) {
814
+ s0 = input.substring(s0, peg$currPos);
815
+ }
816
+ else {
817
+ s0 = s1;
818
+ }
819
+ peg$silentFails--;
820
+ if (s0 === peg$FAILED) {
821
+ s1 = peg$FAILED;
822
+ if (peg$silentFails === 0) {
823
+ peg$fail(peg$c25);
824
+ }
825
+ }
826
+ return s0;
827
+ }
828
+ function peg$parsesol() {
829
+ var s0, s1;
830
+ peg$silentFails++;
831
+ peg$savedPos = peg$currPos;
832
+ s0 = peg$c31();
833
+ if (s0) {
834
+ s0 = void 0;
835
+ }
836
+ else {
837
+ s0 = peg$FAILED;
838
+ }
839
+ peg$silentFails--;
840
+ if (s0 === peg$FAILED) {
841
+ s1 = peg$FAILED;
842
+ if (peg$silentFails === 0) {
843
+ peg$fail(peg$c30);
844
+ }
845
+ }
846
+ return s0;
847
+ }
848
+ function peg$parse__() {
849
+ var s0, s1;
850
+ peg$silentFails++;
851
+ s0 = [];
852
+ if (peg$c20.test(input.charAt(peg$currPos))) {
853
+ s1 = input.charAt(peg$currPos);
854
+ peg$currPos++;
855
+ }
856
+ else {
857
+ s1 = peg$FAILED;
858
+ if (peg$silentFails === 0) {
859
+ peg$fail(peg$c21);
860
+ }
861
+ }
862
+ if (s1 !== peg$FAILED) {
863
+ while (s1 !== peg$FAILED) {
864
+ s0.push(s1);
865
+ if (peg$c20.test(input.charAt(peg$currPos))) {
866
+ s1 = input.charAt(peg$currPos);
867
+ peg$currPos++;
868
+ }
869
+ else {
870
+ s1 = peg$FAILED;
871
+ if (peg$silentFails === 0) {
872
+ peg$fail(peg$c21);
873
+ }
874
+ }
875
+ }
876
+ }
877
+ else {
878
+ s0 = peg$FAILED;
879
+ }
880
+ peg$silentFails--;
881
+ if (s0 === peg$FAILED) {
882
+ s1 = peg$FAILED;
883
+ if (peg$silentFails === 0) {
884
+ peg$fail(peg$c32);
885
+ }
886
+ }
887
+ return s0;
888
+ }
889
+ options.diagnostics = options.diagnostics || [];
890
+ options._blockStack = options._blockStack || [];
891
+ if (typeof options._inDirective !== 'boolean')
892
+ options._inDirective = false;
893
+ peg$result = peg$startRuleFunction();
894
+ if (peg$result !== peg$FAILED && peg$currPos === input.length) {
895
+ return peg$result;
896
+ }
897
+ else {
898
+ if (peg$result !== peg$FAILED && peg$currPos < input.length) {
899
+ peg$fail(peg$endExpectation());
900
+ }
901
+ throw peg$buildStructuredError(peg$maxFailExpected, peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, peg$maxFailPos < input.length
902
+ ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)
903
+ : peg$computeLocation(peg$maxFailPos, peg$maxFailPos));
904
+ }
905
+ }
906
+ module.exports = {
907
+ SyntaxError: peg$SyntaxError,
908
+ parse: peg$parse,
909
+ };
910
+ //# sourceMappingURL=lint.js.map