mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
* add documentation for ai agents * docs: consolidate CLAUDE.md and CONTRIBUTING.md, add style guidelines - Refactor CLAUDE.md to reference CONTRIBUTING.md for build/test/format info - Expand CONTRIBUTING.md with comprehensive build targets, env vars, and testing - Add code style guidelines section with conventional commits - Standardize SDK prettier config to use single quotes (matching web) - Add project-level Claude Code settings to disable co-author attribution * style(sdk): apply prettier with single quotes Run prettier across sdk/base and sdk/package to apply the standardized quote style (single quotes matching web). * docs: add USER.md for per-developer TODO filtering - Add agents/USER.md to .gitignore (contains user identifier) - Document session startup flow in CLAUDE.md: - Create USER.md if missing, prompting for identifier - Filter TODOs by @username tags - Offer relevant TODOs on session start * docs: add i18n documentation task to agent TODOs * docs: document i18n ID patterns in core/ Add agents/i18n-patterns.md covering rust-i18n setup, translation file format, t!() macro usage, key naming conventions, and locale selection. Remove completed TODO item and add reference in CLAUDE.md. * chore: clarify that all builds work on any OS with Docker
3196 lines
81 KiB
TypeScript
3196 lines
81 KiB
TypeScript
/* eslint-disable */
|
|
|
|
const peggyParser: { parse: any; SyntaxError: any; DefaultTracer?: any } = // Generated by Peggy 3.0.2.
|
|
//
|
|
// https://peggyjs.org/
|
|
// @ts-ignore
|
|
(function () {
|
|
// @ts-ignore
|
|
'use strict'
|
|
|
|
// @ts-ignore
|
|
function peg$subclass(child, parent) {
|
|
// @ts-ignore
|
|
function C() {
|
|
this.constructor = child
|
|
}
|
|
// @ts-ignore
|
|
C.prototype = parent.prototype
|
|
// @ts-ignore
|
|
child.prototype = new C()
|
|
}
|
|
|
|
// @ts-ignore
|
|
function peg$SyntaxError(message, expected, found, location) {
|
|
// @ts-ignore
|
|
var self = Error.call(this, message)
|
|
// istanbul ignore next Check is a necessary evil to support older environments
|
|
// @ts-ignore
|
|
if (Object.setPrototypeOf) {
|
|
// @ts-ignore
|
|
Object.setPrototypeOf(self, peg$SyntaxError.prototype)
|
|
}
|
|
// @ts-ignore
|
|
self.expected = expected
|
|
// @ts-ignore
|
|
self.found = found
|
|
// @ts-ignore
|
|
self.location = location
|
|
// @ts-ignore
|
|
self.name = 'SyntaxError'
|
|
// @ts-ignore
|
|
return self
|
|
}
|
|
|
|
// @ts-ignore
|
|
peg$subclass(peg$SyntaxError, Error)
|
|
|
|
// @ts-ignore
|
|
function peg$padEnd(str, targetLength, padString) {
|
|
// @ts-ignore
|
|
padString = padString || ' '
|
|
// @ts-ignore
|
|
if (str.length > targetLength) {
|
|
return str
|
|
}
|
|
// @ts-ignore
|
|
targetLength -= str.length
|
|
// @ts-ignore
|
|
padString += padString.repeat(targetLength)
|
|
// @ts-ignore
|
|
return str + padString.slice(0, targetLength)
|
|
}
|
|
|
|
// @ts-ignore
|
|
peg$SyntaxError.prototype.format = function (sources) {
|
|
// @ts-ignore
|
|
var str = 'Error: ' + this.message
|
|
// @ts-ignore
|
|
if (this.location) {
|
|
// @ts-ignore
|
|
var src = null
|
|
// @ts-ignore
|
|
var k
|
|
// @ts-ignore
|
|
for (k = 0; k < sources.length; k++) {
|
|
// @ts-ignore
|
|
if (sources[k].source === this.location.source) {
|
|
// @ts-ignore
|
|
src = sources[k].text.split(/\r\n|\n|\r/g)
|
|
// @ts-ignore
|
|
break
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
var s = this.location.start
|
|
// @ts-ignore
|
|
var offset_s =
|
|
this.location.source &&
|
|
typeof this.location.source.offset === 'function'
|
|
? // @ts-ignore
|
|
this.location.source.offset(s)
|
|
: // @ts-ignore
|
|
s
|
|
// @ts-ignore
|
|
var loc =
|
|
this.location.source + ':' + offset_s.line + ':' + offset_s.column
|
|
// @ts-ignore
|
|
if (src) {
|
|
// @ts-ignore
|
|
var e = this.location.end
|
|
// @ts-ignore
|
|
var filler = peg$padEnd('', offset_s.line.toString().length, ' ')
|
|
// @ts-ignore
|
|
var line = src[s.line - 1]
|
|
// @ts-ignore
|
|
var last = s.line === e.line ? e.column : line.length + 1
|
|
// @ts-ignore
|
|
var hatLen = last - s.column || 1
|
|
// @ts-ignore
|
|
str +=
|
|
'\n --> ' +
|
|
loc +
|
|
'\n' +
|
|
// @ts-ignore
|
|
filler +
|
|
' |\n' +
|
|
// @ts-ignore
|
|
offset_s.line +
|
|
' | ' +
|
|
line +
|
|
'\n' +
|
|
// @ts-ignore
|
|
filler +
|
|
' | ' +
|
|
peg$padEnd('', s.column - 1, ' ') +
|
|
// @ts-ignore
|
|
peg$padEnd('', hatLen, '^')
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
str += '\n at ' + loc
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
return str
|
|
}
|
|
|
|
// @ts-ignore
|
|
peg$SyntaxError.buildMessage = function (expected, found) {
|
|
// @ts-ignore
|
|
var DESCRIBE_EXPECTATION_FNS = {
|
|
// @ts-ignore
|
|
literal: function (expectation) {
|
|
// @ts-ignore
|
|
return '"' + literalEscape(expectation.text) + '"'
|
|
},
|
|
|
|
// @ts-ignore
|
|
class: function (expectation) {
|
|
// @ts-ignore
|
|
var escapedParts = expectation.parts.map(function (part) {
|
|
// @ts-ignore
|
|
return Array.isArray(part)
|
|
? // @ts-ignore
|
|
classEscape(part[0]) + '-' + classEscape(part[1])
|
|
: // @ts-ignore
|
|
classEscape(part)
|
|
})
|
|
|
|
// @ts-ignore
|
|
return (
|
|
'[' +
|
|
(expectation.inverted ? '^' : '') +
|
|
escapedParts.join('') +
|
|
']'
|
|
)
|
|
},
|
|
|
|
// @ts-ignore
|
|
any: function () {
|
|
// @ts-ignore
|
|
return 'any character'
|
|
},
|
|
|
|
// @ts-ignore
|
|
end: function () {
|
|
// @ts-ignore
|
|
return 'end of input'
|
|
},
|
|
|
|
// @ts-ignore
|
|
other: function (expectation) {
|
|
// @ts-ignore
|
|
return expectation.description
|
|
},
|
|
}
|
|
|
|
// @ts-ignore
|
|
function hex(ch) {
|
|
// @ts-ignore
|
|
return ch.charCodeAt(0).toString(16).toUpperCase()
|
|
}
|
|
|
|
// @ts-ignore
|
|
function literalEscape(s) {
|
|
// @ts-ignore
|
|
return (
|
|
s
|
|
// @ts-ignore
|
|
.replace(/\\/g, '\\\\')
|
|
// @ts-ignore
|
|
.replace(/"/g, '\\"')
|
|
// @ts-ignore
|
|
.replace(/\0/g, '\\0')
|
|
// @ts-ignore
|
|
.replace(/\t/g, '\\t')
|
|
// @ts-ignore
|
|
.replace(/\n/g, '\\n')
|
|
// @ts-ignore
|
|
.replace(/\r/g, '\\r')
|
|
// @ts-ignore
|
|
.replace(/[\x00-\x0F]/g, function (ch) {
|
|
return '\\x0' + hex(ch)
|
|
})
|
|
// @ts-ignore
|
|
.replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) {
|
|
return '\\x' + hex(ch)
|
|
})
|
|
)
|
|
}
|
|
|
|
// @ts-ignore
|
|
function classEscape(s) {
|
|
// @ts-ignore
|
|
return (
|
|
s
|
|
// @ts-ignore
|
|
.replace(/\\/g, '\\\\')
|
|
// @ts-ignore
|
|
.replace(/\]/g, '\\]')
|
|
// @ts-ignore
|
|
.replace(/\^/g, '\\^')
|
|
// @ts-ignore
|
|
.replace(/-/g, '\\-')
|
|
// @ts-ignore
|
|
.replace(/\0/g, '\\0')
|
|
// @ts-ignore
|
|
.replace(/\t/g, '\\t')
|
|
// @ts-ignore
|
|
.replace(/\n/g, '\\n')
|
|
// @ts-ignore
|
|
.replace(/\r/g, '\\r')
|
|
// @ts-ignore
|
|
.replace(/[\x00-\x0F]/g, function (ch) {
|
|
return '\\x0' + hex(ch)
|
|
})
|
|
// @ts-ignore
|
|
.replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) {
|
|
return '\\x' + hex(ch)
|
|
})
|
|
)
|
|
}
|
|
|
|
// @ts-ignore
|
|
function describeExpectation(expectation) {
|
|
// @ts-ignore
|
|
return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation)
|
|
}
|
|
|
|
// @ts-ignore
|
|
function describeExpected(expected) {
|
|
// @ts-ignore
|
|
var descriptions = expected.map(describeExpectation)
|
|
// @ts-ignore
|
|
var i, j
|
|
|
|
// @ts-ignore
|
|
descriptions.sort()
|
|
|
|
// @ts-ignore
|
|
if (descriptions.length > 0) {
|
|
// @ts-ignore
|
|
for (i = 1, j = 1; i < descriptions.length; i++) {
|
|
// @ts-ignore
|
|
if (descriptions[i - 1] !== descriptions[i]) {
|
|
// @ts-ignore
|
|
descriptions[j] = descriptions[i]
|
|
// @ts-ignore
|
|
j++
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
descriptions.length = j
|
|
}
|
|
|
|
// @ts-ignore
|
|
switch (descriptions.length) {
|
|
// @ts-ignore
|
|
case 1:
|
|
// @ts-ignore
|
|
return descriptions[0]
|
|
|
|
// @ts-ignore
|
|
case 2:
|
|
// @ts-ignore
|
|
return descriptions[0] + ' or ' + descriptions[1]
|
|
|
|
// @ts-ignore
|
|
default:
|
|
// @ts-ignore
|
|
return (
|
|
descriptions.slice(0, -1).join(', ') +
|
|
// @ts-ignore
|
|
', or ' +
|
|
// @ts-ignore
|
|
descriptions[descriptions.length - 1]
|
|
)
|
|
}
|
|
}
|
|
|
|
// @ts-ignore
|
|
function describeFound(found) {
|
|
// @ts-ignore
|
|
return found ? '"' + literalEscape(found) + '"' : 'end of input'
|
|
}
|
|
|
|
// @ts-ignore
|
|
return (
|
|
'Expected ' +
|
|
describeExpected(expected) +
|
|
' but ' +
|
|
describeFound(found) +
|
|
' found.'
|
|
)
|
|
}
|
|
|
|
// @ts-ignore
|
|
function peg$parse(input, options) {
|
|
// @ts-ignore
|
|
options = options !== undefined ? options : {}
|
|
|
|
// @ts-ignore
|
|
var peg$FAILED = {}
|
|
// @ts-ignore
|
|
var peg$source = options.grammarSource
|
|
|
|
// @ts-ignore
|
|
var peg$startRuleFunctions = {
|
|
VersionRange: peg$parseVersionRange,
|
|
Or: peg$parseOr,
|
|
And: peg$parseAnd,
|
|
VersionRangeAtom: peg$parseVersionRangeAtom,
|
|
Parens: peg$parseParens,
|
|
Anchor: peg$parseAnchor,
|
|
VersionSpec: peg$parseVersionSpec,
|
|
FlavorAtom: peg$parseFlavorAtom,
|
|
Not: peg$parseNot,
|
|
Any: peg$parseAny,
|
|
None: peg$parseNone,
|
|
CmpOp: peg$parseCmpOp,
|
|
ExtendedVersion: peg$parseExtendedVersion,
|
|
EmverVersionRange: peg$parseEmverVersionRange,
|
|
EmverVersionRangeAtom: peg$parseEmverVersionRangeAtom,
|
|
EmverParens: peg$parseEmverParens,
|
|
EmverAnchor: peg$parseEmverAnchor,
|
|
EmverNot: peg$parseEmverNot,
|
|
Emver: peg$parseEmver,
|
|
Flavor: peg$parseFlavor,
|
|
FlavorString: peg$parseFlavorString,
|
|
String: peg$parseString,
|
|
Version: peg$parseVersion,
|
|
PreRelease: peg$parsePreRelease,
|
|
PreReleaseSegment: peg$parsePreReleaseSegment,
|
|
VersionNumber: peg$parseVersionNumber,
|
|
Digit: peg$parseDigit,
|
|
_: peg$parse_,
|
|
}
|
|
// @ts-ignore
|
|
var peg$startRuleFunction = peg$parseVersionRange
|
|
|
|
// @ts-ignore
|
|
var peg$c0 = '||'
|
|
var peg$c1 = '&&'
|
|
var peg$c2 = '('
|
|
var peg$c3 = ')'
|
|
var peg$c4 = ':'
|
|
var peg$c5 = '#'
|
|
var peg$c6 = '!'
|
|
var peg$c7 = '*'
|
|
var peg$c8 = '>='
|
|
var peg$c9 = '<='
|
|
var peg$c10 = '>'
|
|
var peg$c11 = '<'
|
|
var peg$c12 = '='
|
|
var peg$c13 = '!='
|
|
var peg$c14 = '^'
|
|
var peg$c15 = '~'
|
|
var peg$c16 = '.'
|
|
var peg$c17 = '-'
|
|
|
|
var peg$r0 = /^[a-z]/
|
|
var peg$r1 = /^[a-zA-Z]/
|
|
var peg$r2 = /^[0-9]/
|
|
var peg$r3 = /^[ \t\n\r]/
|
|
|
|
var peg$e0 = peg$literalExpectation('||', false)
|
|
var peg$e1 = peg$literalExpectation('&&', false)
|
|
var peg$e2 = peg$literalExpectation('(', false)
|
|
var peg$e3 = peg$literalExpectation(')', false)
|
|
var peg$e4 = peg$literalExpectation(':', false)
|
|
var peg$e5 = peg$literalExpectation('#', false)
|
|
var peg$e6 = peg$literalExpectation('!', false)
|
|
var peg$e7 = peg$literalExpectation('*', false)
|
|
var peg$e8 = peg$literalExpectation('>=', false)
|
|
var peg$e9 = peg$literalExpectation('<=', false)
|
|
var peg$e10 = peg$literalExpectation('>', false)
|
|
var peg$e11 = peg$literalExpectation('<', false)
|
|
var peg$e12 = peg$literalExpectation('=', false)
|
|
var peg$e13 = peg$literalExpectation('!=', false)
|
|
var peg$e14 = peg$literalExpectation('^', false)
|
|
var peg$e15 = peg$literalExpectation('~', false)
|
|
var peg$e16 = peg$literalExpectation('.', false)
|
|
var peg$e17 = peg$classExpectation([['a', 'z']], false, false)
|
|
var peg$e18 = peg$classExpectation(
|
|
[
|
|
['a', 'z'],
|
|
['A', 'Z'],
|
|
],
|
|
false,
|
|
false,
|
|
)
|
|
var peg$e19 = peg$literalExpectation('-', false)
|
|
var peg$e20 = peg$classExpectation([['0', '9']], false, false)
|
|
var peg$e21 = peg$otherExpectation('whitespace')
|
|
var peg$e22 = peg$classExpectation([' ', '\t', '\n', '\r'], false, false)
|
|
// @ts-ignore
|
|
|
|
var peg$f0 = function (expr) {
|
|
// @ts-ignore
|
|
return { type: 'Parens', expr }
|
|
} // @ts-ignore
|
|
|
|
var peg$f1 = function (operator, version) {
|
|
// @ts-ignore
|
|
return { type: 'Anchor', operator, version }
|
|
} // @ts-ignore
|
|
|
|
var peg$f2 = function (flavor, upstream, downstream) {
|
|
// @ts-ignore
|
|
return {
|
|
flavor: flavor || null,
|
|
upstream,
|
|
downstream: downstream
|
|
? downstream[1]
|
|
: { number: [0], prerelease: [] },
|
|
}
|
|
} // @ts-ignore
|
|
|
|
var peg$f3 = function (flavor) {
|
|
// @ts-ignore
|
|
return { type: 'Flavor', flavor: flavor }
|
|
} // @ts-ignore
|
|
|
|
var peg$f4 = function (value) {
|
|
// @ts-ignore
|
|
return { type: 'Not', value: value }
|
|
} // @ts-ignore
|
|
|
|
var peg$f5 = function () {
|
|
// @ts-ignore
|
|
return { type: 'Any' }
|
|
} // @ts-ignore
|
|
|
|
var peg$f6 = function () {
|
|
// @ts-ignore
|
|
return { type: 'None' }
|
|
} // @ts-ignore
|
|
|
|
var peg$f7 = function () {
|
|
// @ts-ignore
|
|
return '>='
|
|
} // @ts-ignore
|
|
|
|
var peg$f8 = function () {
|
|
// @ts-ignore
|
|
return '<='
|
|
} // @ts-ignore
|
|
|
|
var peg$f9 = function () {
|
|
// @ts-ignore
|
|
return '>'
|
|
} // @ts-ignore
|
|
|
|
var peg$f10 = function () {
|
|
// @ts-ignore
|
|
return '<'
|
|
} // @ts-ignore
|
|
|
|
var peg$f11 = function () {
|
|
// @ts-ignore
|
|
return '='
|
|
} // @ts-ignore
|
|
|
|
var peg$f12 = function () {
|
|
// @ts-ignore
|
|
return '!='
|
|
} // @ts-ignore
|
|
|
|
var peg$f13 = function () {
|
|
// @ts-ignore
|
|
return '^'
|
|
} // @ts-ignore
|
|
|
|
var peg$f14 = function () {
|
|
// @ts-ignore
|
|
return '~'
|
|
} // @ts-ignore
|
|
|
|
var peg$f15 = function (flavor, upstream, downstream) {
|
|
// @ts-ignore
|
|
return { flavor: flavor || null, upstream, downstream }
|
|
} // @ts-ignore
|
|
|
|
var peg$f16 = function (expr) {
|
|
// @ts-ignore
|
|
return { type: 'Parens', expr }
|
|
} // @ts-ignore
|
|
|
|
var peg$f17 = function (operator, version) {
|
|
// @ts-ignore
|
|
return { type: 'Anchor', operator, version }
|
|
} // @ts-ignore
|
|
|
|
var peg$f18 = function (value) {
|
|
// @ts-ignore
|
|
return { type: 'Not', value: value }
|
|
} // @ts-ignore
|
|
|
|
var peg$f19 = function (major, minor, patch, revision) {
|
|
// @ts-ignore
|
|
return revision
|
|
} // @ts-ignore
|
|
|
|
var peg$f20 = function (major, minor, patch, revision) {
|
|
// @ts-ignore
|
|
return {
|
|
// @ts-ignore
|
|
flavor: null,
|
|
// @ts-ignore
|
|
upstream: {
|
|
// @ts-ignore
|
|
number: [major, minor, patch],
|
|
// @ts-ignore
|
|
prerelease: [],
|
|
},
|
|
// @ts-ignore
|
|
downstream: {
|
|
// @ts-ignore
|
|
number: [revision || 0],
|
|
// @ts-ignore
|
|
prerelease: [],
|
|
},
|
|
}
|
|
} // @ts-ignore
|
|
|
|
var peg$f21 = function (flavor) {
|
|
// @ts-ignore
|
|
return flavor
|
|
} // @ts-ignore
|
|
|
|
var peg$f22 = function () {
|
|
// @ts-ignore
|
|
return text()
|
|
} // @ts-ignore
|
|
|
|
var peg$f23 = function () {
|
|
// @ts-ignore
|
|
return text()
|
|
} // @ts-ignore
|
|
|
|
var peg$f24 = function (number, prerelease) {
|
|
// @ts-ignore
|
|
return {
|
|
// @ts-ignore
|
|
number,
|
|
// @ts-ignore
|
|
prerelease: prerelease || [],
|
|
}
|
|
} // @ts-ignore
|
|
|
|
var peg$f25 = function (first, rest) {
|
|
// @ts-ignore
|
|
return [first].concat(rest.map((r) => r[1]))
|
|
} // @ts-ignore
|
|
|
|
var peg$f26 = function (segment) {
|
|
// @ts-ignore
|
|
return segment
|
|
} // @ts-ignore
|
|
|
|
var peg$f27 = function (first, rest) {
|
|
// @ts-ignore
|
|
return [first].concat(rest.map((r) => r[1]))
|
|
} // @ts-ignore
|
|
|
|
var peg$f28 = function () {
|
|
// @ts-ignore
|
|
return parseInt(text(), 10)
|
|
}
|
|
// @ts-ignore
|
|
var peg$currPos = 0
|
|
// @ts-ignore
|
|
var peg$savedPos = 0
|
|
// @ts-ignore
|
|
var peg$posDetailsCache = [{ line: 1, column: 1 }]
|
|
// @ts-ignore
|
|
var peg$maxFailPos = 0
|
|
// @ts-ignore
|
|
var peg$maxFailExpected = []
|
|
// @ts-ignore
|
|
var peg$silentFails = 0
|
|
|
|
// @ts-ignore
|
|
var peg$result
|
|
|
|
// @ts-ignore
|
|
if ('startRule' in options) {
|
|
// @ts-ignore
|
|
if (!(options.startRule in peg$startRuleFunctions)) {
|
|
// @ts-ignore
|
|
throw new Error(
|
|
'Can\'t start parsing from rule "' + options.startRule + '".',
|
|
)
|
|
}
|
|
|
|
// @ts-ignore
|
|
peg$startRuleFunction = peg$startRuleFunctions[options.startRule]
|
|
}
|
|
|
|
// @ts-ignore
|
|
function text() {
|
|
// @ts-ignore
|
|
return input.substring(peg$savedPos, peg$currPos)
|
|
}
|
|
|
|
// @ts-ignore
|
|
function offset() {
|
|
// @ts-ignore
|
|
return peg$savedPos
|
|
}
|
|
|
|
// @ts-ignore
|
|
function range() {
|
|
// @ts-ignore
|
|
return {
|
|
// @ts-ignore
|
|
source: peg$source,
|
|
// @ts-ignore
|
|
start: peg$savedPos,
|
|
// @ts-ignore
|
|
end: peg$currPos,
|
|
}
|
|
}
|
|
|
|
// @ts-ignore
|
|
function location() {
|
|
// @ts-ignore
|
|
return peg$computeLocation(peg$savedPos, peg$currPos)
|
|
}
|
|
|
|
// @ts-ignore
|
|
function expected(description, location) {
|
|
// @ts-ignore
|
|
location =
|
|
location !== undefined
|
|
? // @ts-ignore
|
|
location
|
|
: // @ts-ignore
|
|
peg$computeLocation(peg$savedPos, peg$currPos)
|
|
|
|
// @ts-ignore
|
|
throw peg$buildStructuredError(
|
|
// @ts-ignore
|
|
[peg$otherExpectation(description)],
|
|
// @ts-ignore
|
|
input.substring(peg$savedPos, peg$currPos),
|
|
// @ts-ignore
|
|
location,
|
|
)
|
|
}
|
|
|
|
// @ts-ignore
|
|
function error(message, location) {
|
|
// @ts-ignore
|
|
location =
|
|
location !== undefined
|
|
? // @ts-ignore
|
|
location
|
|
: // @ts-ignore
|
|
peg$computeLocation(peg$savedPos, peg$currPos)
|
|
|
|
// @ts-ignore
|
|
throw peg$buildSimpleError(message, location)
|
|
}
|
|
|
|
// @ts-ignore
|
|
function peg$literalExpectation(text, ignoreCase) {
|
|
// @ts-ignore
|
|
return { type: 'literal', text: text, ignoreCase: ignoreCase }
|
|
}
|
|
|
|
// @ts-ignore
|
|
function peg$classExpectation(parts, inverted, ignoreCase) {
|
|
// @ts-ignore
|
|
return {
|
|
type: 'class',
|
|
parts: parts,
|
|
inverted: inverted,
|
|
ignoreCase: ignoreCase,
|
|
}
|
|
}
|
|
|
|
// @ts-ignore
|
|
function peg$anyExpectation() {
|
|
// @ts-ignore
|
|
return { type: 'any' }
|
|
}
|
|
|
|
// @ts-ignore
|
|
function peg$endExpectation() {
|
|
// @ts-ignore
|
|
return { type: 'end' }
|
|
}
|
|
|
|
// @ts-ignore
|
|
function peg$otherExpectation(description) {
|
|
// @ts-ignore
|
|
return { type: 'other', description: description }
|
|
}
|
|
|
|
// @ts-ignore
|
|
function peg$computePosDetails(pos) {
|
|
// @ts-ignore
|
|
var details = peg$posDetailsCache[pos]
|
|
// @ts-ignore
|
|
var p
|
|
|
|
// @ts-ignore
|
|
if (details) {
|
|
// @ts-ignore
|
|
return details
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
p = pos - 1
|
|
// @ts-ignore
|
|
while (!peg$posDetailsCache[p]) {
|
|
// @ts-ignore
|
|
p--
|
|
}
|
|
|
|
// @ts-ignore
|
|
details = peg$posDetailsCache[p]
|
|
// @ts-ignore
|
|
details = {
|
|
// @ts-ignore
|
|
line: details.line,
|
|
// @ts-ignore
|
|
column: details.column,
|
|
}
|
|
|
|
// @ts-ignore
|
|
while (p < pos) {
|
|
// @ts-ignore
|
|
if (input.charCodeAt(p) === 10) {
|
|
// @ts-ignore
|
|
details.line++
|
|
// @ts-ignore
|
|
details.column = 1
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
details.column++
|
|
}
|
|
|
|
// @ts-ignore
|
|
p++
|
|
}
|
|
|
|
// @ts-ignore
|
|
peg$posDetailsCache[pos] = details
|
|
|
|
// @ts-ignore
|
|
return details
|
|
}
|
|
}
|
|
|
|
// @ts-ignore
|
|
function peg$computeLocation(startPos, endPos, offset) {
|
|
// @ts-ignore
|
|
var startPosDetails = peg$computePosDetails(startPos)
|
|
// @ts-ignore
|
|
var endPosDetails = peg$computePosDetails(endPos)
|
|
|
|
// @ts-ignore
|
|
var res = {
|
|
// @ts-ignore
|
|
source: peg$source,
|
|
// @ts-ignore
|
|
start: {
|
|
// @ts-ignore
|
|
offset: startPos,
|
|
// @ts-ignore
|
|
line: startPosDetails.line,
|
|
// @ts-ignore
|
|
column: startPosDetails.column,
|
|
},
|
|
// @ts-ignore
|
|
end: {
|
|
// @ts-ignore
|
|
offset: endPos,
|
|
// @ts-ignore
|
|
line: endPosDetails.line,
|
|
// @ts-ignore
|
|
column: endPosDetails.column,
|
|
},
|
|
}
|
|
// @ts-ignore
|
|
if (offset && peg$source && typeof peg$source.offset === 'function') {
|
|
// @ts-ignore
|
|
res.start = peg$source.offset(res.start)
|
|
// @ts-ignore
|
|
res.end = peg$source.offset(res.end)
|
|
}
|
|
// @ts-ignore
|
|
return res
|
|
}
|
|
|
|
// @ts-ignore
|
|
function peg$fail(expected) {
|
|
// @ts-ignore
|
|
if (peg$currPos < peg$maxFailPos) {
|
|
return
|
|
}
|
|
|
|
// @ts-ignore
|
|
if (peg$currPos > peg$maxFailPos) {
|
|
// @ts-ignore
|
|
peg$maxFailPos = peg$currPos
|
|
// @ts-ignore
|
|
peg$maxFailExpected = []
|
|
}
|
|
|
|
// @ts-ignore
|
|
peg$maxFailExpected.push(expected)
|
|
}
|
|
|
|
// @ts-ignore
|
|
function peg$buildSimpleError(message, location) {
|
|
// @ts-ignore
|
|
return new peg$SyntaxError(message, null, null, location)
|
|
}
|
|
|
|
// @ts-ignore
|
|
function peg$buildStructuredError(expected, found, location) {
|
|
// @ts-ignore
|
|
return new peg$SyntaxError(
|
|
// @ts-ignore
|
|
peg$SyntaxError.buildMessage(expected, found),
|
|
// @ts-ignore
|
|
expected,
|
|
// @ts-ignore
|
|
found,
|
|
// @ts-ignore
|
|
location,
|
|
)
|
|
}
|
|
|
|
// @ts-ignore
|
|
function // @ts-ignore
|
|
peg$parseVersionRange() {
|
|
// @ts-ignore
|
|
var s0, s1, s2, s3, s4, s5, s6, s7
|
|
|
|
// @ts-ignore
|
|
s0 = peg$currPos
|
|
// @ts-ignore
|
|
s1 = peg$parseVersionRangeAtom()
|
|
// @ts-ignore
|
|
if (s1 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s2 = []
|
|
// @ts-ignore
|
|
s3 = peg$currPos
|
|
// @ts-ignore
|
|
s4 = peg$parse_()
|
|
// @ts-ignore
|
|
s5 = peg$currPos
|
|
// @ts-ignore
|
|
s6 = peg$parseOr()
|
|
// @ts-ignore
|
|
if (s6 === peg$FAILED) {
|
|
// @ts-ignore
|
|
s6 = peg$parseAnd()
|
|
}
|
|
// @ts-ignore
|
|
if (s6 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s7 = peg$parse_()
|
|
// @ts-ignore
|
|
s6 = [s6, s7]
|
|
// @ts-ignore
|
|
s5 = s6
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s5
|
|
// @ts-ignore
|
|
s5 = peg$FAILED
|
|
}
|
|
// @ts-ignore
|
|
if (s5 === peg$FAILED) {
|
|
// @ts-ignore
|
|
s5 = null
|
|
}
|
|
// @ts-ignore
|
|
s6 = peg$parseVersionRangeAtom()
|
|
// @ts-ignore
|
|
if (s6 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s4 = [s4, s5, s6]
|
|
// @ts-ignore
|
|
s3 = s4
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s3
|
|
// @ts-ignore
|
|
s3 = peg$FAILED
|
|
}
|
|
// @ts-ignore
|
|
while (s3 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s2.push(s3)
|
|
// @ts-ignore
|
|
s3 = peg$currPos
|
|
// @ts-ignore
|
|
s4 = peg$parse_()
|
|
// @ts-ignore
|
|
s5 = peg$currPos
|
|
// @ts-ignore
|
|
s6 = peg$parseOr()
|
|
// @ts-ignore
|
|
if (s6 === peg$FAILED) {
|
|
// @ts-ignore
|
|
s6 = peg$parseAnd()
|
|
}
|
|
// @ts-ignore
|
|
if (s6 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s7 = peg$parse_()
|
|
// @ts-ignore
|
|
s6 = [s6, s7]
|
|
// @ts-ignore
|
|
s5 = s6
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s5
|
|
// @ts-ignore
|
|
s5 = peg$FAILED
|
|
}
|
|
// @ts-ignore
|
|
if (s5 === peg$FAILED) {
|
|
// @ts-ignore
|
|
s5 = null
|
|
}
|
|
// @ts-ignore
|
|
s6 = peg$parseVersionRangeAtom()
|
|
// @ts-ignore
|
|
if (s6 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s4 = [s4, s5, s6]
|
|
// @ts-ignore
|
|
s3 = s4
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s3
|
|
// @ts-ignore
|
|
s3 = peg$FAILED
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
s1 = [s1, s2]
|
|
// @ts-ignore
|
|
s0 = s1
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$FAILED
|
|
}
|
|
|
|
// @ts-ignore
|
|
return s0
|
|
}
|
|
|
|
// @ts-ignore
|
|
function // @ts-ignore
|
|
peg$parseOr() {
|
|
// @ts-ignore
|
|
var s0
|
|
|
|
// @ts-ignore
|
|
if (input.substr(peg$currPos, 2) === peg$c0) {
|
|
// @ts-ignore
|
|
s0 = peg$c0
|
|
// @ts-ignore
|
|
peg$currPos += 2
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
s0 = peg$FAILED
|
|
// @ts-ignore
|
|
if (peg$silentFails === 0) {
|
|
peg$fail(peg$e0)
|
|
}
|
|
}
|
|
|
|
// @ts-ignore
|
|
return s0
|
|
}
|
|
|
|
// @ts-ignore
|
|
function // @ts-ignore
|
|
peg$parseAnd() {
|
|
// @ts-ignore
|
|
var s0
|
|
|
|
// @ts-ignore
|
|
if (input.substr(peg$currPos, 2) === peg$c1) {
|
|
// @ts-ignore
|
|
s0 = peg$c1
|
|
// @ts-ignore
|
|
peg$currPos += 2
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
s0 = peg$FAILED
|
|
// @ts-ignore
|
|
if (peg$silentFails === 0) {
|
|
peg$fail(peg$e1)
|
|
}
|
|
}
|
|
|
|
// @ts-ignore
|
|
return s0
|
|
}
|
|
|
|
// @ts-ignore
|
|
function // @ts-ignore
|
|
peg$parseVersionRangeAtom() {
|
|
// @ts-ignore
|
|
var s0
|
|
|
|
// @ts-ignore
|
|
s0 = peg$parseParens()
|
|
// @ts-ignore
|
|
if (s0 === peg$FAILED) {
|
|
// @ts-ignore
|
|
s0 = peg$parseAnchor()
|
|
// @ts-ignore
|
|
if (s0 === peg$FAILED) {
|
|
// @ts-ignore
|
|
s0 = peg$parseNot()
|
|
// @ts-ignore
|
|
if (s0 === peg$FAILED) {
|
|
// @ts-ignore
|
|
s0 = peg$parseAny()
|
|
// @ts-ignore
|
|
if (s0 === peg$FAILED) {
|
|
// @ts-ignore
|
|
s0 = peg$parseNone()
|
|
// @ts-ignore
|
|
if (s0 === peg$FAILED) {
|
|
// @ts-ignore
|
|
s0 = peg$parseFlavorAtom()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// @ts-ignore
|
|
return s0
|
|
}
|
|
|
|
// @ts-ignore
|
|
function // @ts-ignore
|
|
peg$parseParens() {
|
|
// @ts-ignore
|
|
var s0, s1, s2, s3, s4, s5
|
|
|
|
// @ts-ignore
|
|
s0 = peg$currPos
|
|
// @ts-ignore
|
|
if (input.charCodeAt(peg$currPos) === 40) {
|
|
// @ts-ignore
|
|
s1 = peg$c2
|
|
// @ts-ignore
|
|
peg$currPos++
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
s1 = peg$FAILED
|
|
// @ts-ignore
|
|
if (peg$silentFails === 0) {
|
|
peg$fail(peg$e2)
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
if (s1 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s2 = peg$parse_()
|
|
// @ts-ignore
|
|
s3 = peg$parseVersionRange()
|
|
// @ts-ignore
|
|
if (s3 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s4 = peg$parse_()
|
|
// @ts-ignore
|
|
if (input.charCodeAt(peg$currPos) === 41) {
|
|
// @ts-ignore
|
|
s5 = peg$c3
|
|
// @ts-ignore
|
|
peg$currPos++
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
s5 = peg$FAILED
|
|
// @ts-ignore
|
|
if (peg$silentFails === 0) {
|
|
peg$fail(peg$e3)
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
if (s5 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
peg$savedPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$f0(s3)
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$FAILED
|
|
}
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$FAILED
|
|
}
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$FAILED
|
|
}
|
|
|
|
// @ts-ignore
|
|
return s0
|
|
}
|
|
|
|
// @ts-ignore
|
|
function // @ts-ignore
|
|
peg$parseAnchor() {
|
|
// @ts-ignore
|
|
var s0, s1, s2, s3
|
|
|
|
// @ts-ignore
|
|
s0 = peg$currPos
|
|
// @ts-ignore
|
|
s1 = peg$parseCmpOp()
|
|
// @ts-ignore
|
|
if (s1 === peg$FAILED) {
|
|
// @ts-ignore
|
|
s1 = null
|
|
}
|
|
// @ts-ignore
|
|
s2 = peg$parse_()
|
|
// @ts-ignore
|
|
s3 = peg$parseVersionSpec()
|
|
// @ts-ignore
|
|
if (s3 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
peg$savedPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$f1(s1, s3)
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$FAILED
|
|
}
|
|
|
|
// @ts-ignore
|
|
return s0
|
|
}
|
|
|
|
// @ts-ignore
|
|
function // @ts-ignore
|
|
peg$parseVersionSpec() {
|
|
// @ts-ignore
|
|
var s0, s1, s2, s3, s4, s5
|
|
|
|
// @ts-ignore
|
|
s0 = peg$currPos
|
|
// @ts-ignore
|
|
s1 = peg$parseFlavor()
|
|
// @ts-ignore
|
|
if (s1 === peg$FAILED) {
|
|
// @ts-ignore
|
|
s1 = null
|
|
}
|
|
// @ts-ignore
|
|
s2 = peg$parseVersion()
|
|
// @ts-ignore
|
|
if (s2 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s3 = peg$currPos
|
|
// @ts-ignore
|
|
if (input.charCodeAt(peg$currPos) === 58) {
|
|
// @ts-ignore
|
|
s4 = peg$c4
|
|
// @ts-ignore
|
|
peg$currPos++
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
s4 = peg$FAILED
|
|
// @ts-ignore
|
|
if (peg$silentFails === 0) {
|
|
peg$fail(peg$e4)
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
if (s4 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s5 = peg$parseVersion()
|
|
// @ts-ignore
|
|
if (s5 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s4 = [s4, s5]
|
|
// @ts-ignore
|
|
s3 = s4
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s3
|
|
// @ts-ignore
|
|
s3 = peg$FAILED
|
|
}
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s3
|
|
// @ts-ignore
|
|
s3 = peg$FAILED
|
|
}
|
|
// @ts-ignore
|
|
if (s3 === peg$FAILED) {
|
|
// @ts-ignore
|
|
s3 = null
|
|
}
|
|
// @ts-ignore
|
|
peg$savedPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$f2(s1, s2, s3)
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$FAILED
|
|
}
|
|
|
|
// @ts-ignore
|
|
return s0
|
|
}
|
|
|
|
// @ts-ignore
|
|
function // @ts-ignore
|
|
peg$parseFlavorAtom() {
|
|
// @ts-ignore
|
|
var s0, s1, s2
|
|
|
|
// @ts-ignore
|
|
s0 = peg$currPos
|
|
// @ts-ignore
|
|
if (input.charCodeAt(peg$currPos) === 35) {
|
|
// @ts-ignore
|
|
s1 = peg$c5
|
|
// @ts-ignore
|
|
peg$currPos++
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
s1 = peg$FAILED
|
|
// @ts-ignore
|
|
if (peg$silentFails === 0) {
|
|
peg$fail(peg$e5)
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
if (s1 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s2 = peg$parseFlavorString()
|
|
// @ts-ignore
|
|
peg$savedPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$f3(s2)
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$FAILED
|
|
}
|
|
|
|
// @ts-ignore
|
|
return s0
|
|
}
|
|
|
|
// @ts-ignore
|
|
function // @ts-ignore
|
|
peg$parseNot() {
|
|
// @ts-ignore
|
|
var s0, s1, s2, s3
|
|
|
|
// @ts-ignore
|
|
s0 = peg$currPos
|
|
// @ts-ignore
|
|
if (input.charCodeAt(peg$currPos) === 33) {
|
|
// @ts-ignore
|
|
s1 = peg$c6
|
|
// @ts-ignore
|
|
peg$currPos++
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
s1 = peg$FAILED
|
|
// @ts-ignore
|
|
if (peg$silentFails === 0) {
|
|
peg$fail(peg$e6)
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
if (s1 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s2 = peg$parse_()
|
|
// @ts-ignore
|
|
s3 = peg$parseVersionRangeAtom()
|
|
// @ts-ignore
|
|
if (s3 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
peg$savedPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$f4(s3)
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$FAILED
|
|
}
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$FAILED
|
|
}
|
|
|
|
// @ts-ignore
|
|
return s0
|
|
}
|
|
|
|
// @ts-ignore
|
|
function // @ts-ignore
|
|
peg$parseAny() {
|
|
// @ts-ignore
|
|
var s0, s1
|
|
|
|
// @ts-ignore
|
|
s0 = peg$currPos
|
|
// @ts-ignore
|
|
if (input.charCodeAt(peg$currPos) === 42) {
|
|
// @ts-ignore
|
|
s1 = peg$c7
|
|
// @ts-ignore
|
|
peg$currPos++
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
s1 = peg$FAILED
|
|
// @ts-ignore
|
|
if (peg$silentFails === 0) {
|
|
peg$fail(peg$e7)
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
if (s1 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
peg$savedPos = s0
|
|
// @ts-ignore
|
|
s1 = peg$f5()
|
|
}
|
|
// @ts-ignore
|
|
s0 = s1
|
|
|
|
// @ts-ignore
|
|
return s0
|
|
}
|
|
|
|
// @ts-ignore
|
|
function // @ts-ignore
|
|
peg$parseNone() {
|
|
// @ts-ignore
|
|
var s0, s1
|
|
|
|
// @ts-ignore
|
|
s0 = peg$currPos
|
|
// @ts-ignore
|
|
if (input.charCodeAt(peg$currPos) === 33) {
|
|
// @ts-ignore
|
|
s1 = peg$c6
|
|
// @ts-ignore
|
|
peg$currPos++
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
s1 = peg$FAILED
|
|
// @ts-ignore
|
|
if (peg$silentFails === 0) {
|
|
peg$fail(peg$e6)
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
if (s1 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
peg$savedPos = s0
|
|
// @ts-ignore
|
|
s1 = peg$f6()
|
|
}
|
|
// @ts-ignore
|
|
s0 = s1
|
|
|
|
// @ts-ignore
|
|
return s0
|
|
}
|
|
|
|
// @ts-ignore
|
|
function // @ts-ignore
|
|
peg$parseCmpOp() {
|
|
// @ts-ignore
|
|
var s0, s1
|
|
|
|
// @ts-ignore
|
|
s0 = peg$currPos
|
|
// @ts-ignore
|
|
if (input.substr(peg$currPos, 2) === peg$c8) {
|
|
// @ts-ignore
|
|
s1 = peg$c8
|
|
// @ts-ignore
|
|
peg$currPos += 2
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
s1 = peg$FAILED
|
|
// @ts-ignore
|
|
if (peg$silentFails === 0) {
|
|
peg$fail(peg$e8)
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
if (s1 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
peg$savedPos = s0
|
|
// @ts-ignore
|
|
s1 = peg$f7()
|
|
}
|
|
// @ts-ignore
|
|
s0 = s1
|
|
// @ts-ignore
|
|
if (s0 === peg$FAILED) {
|
|
// @ts-ignore
|
|
s0 = peg$currPos
|
|
// @ts-ignore
|
|
if (input.substr(peg$currPos, 2) === peg$c9) {
|
|
// @ts-ignore
|
|
s1 = peg$c9
|
|
// @ts-ignore
|
|
peg$currPos += 2
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
s1 = peg$FAILED
|
|
// @ts-ignore
|
|
if (peg$silentFails === 0) {
|
|
peg$fail(peg$e9)
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
if (s1 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
peg$savedPos = s0
|
|
// @ts-ignore
|
|
s1 = peg$f8()
|
|
}
|
|
// @ts-ignore
|
|
s0 = s1
|
|
// @ts-ignore
|
|
if (s0 === peg$FAILED) {
|
|
// @ts-ignore
|
|
s0 = peg$currPos
|
|
// @ts-ignore
|
|
if (input.charCodeAt(peg$currPos) === 62) {
|
|
// @ts-ignore
|
|
s1 = peg$c10
|
|
// @ts-ignore
|
|
peg$currPos++
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
s1 = peg$FAILED
|
|
// @ts-ignore
|
|
if (peg$silentFails === 0) {
|
|
peg$fail(peg$e10)
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
if (s1 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
peg$savedPos = s0
|
|
// @ts-ignore
|
|
s1 = peg$f9()
|
|
}
|
|
// @ts-ignore
|
|
s0 = s1
|
|
// @ts-ignore
|
|
if (s0 === peg$FAILED) {
|
|
// @ts-ignore
|
|
s0 = peg$currPos
|
|
// @ts-ignore
|
|
if (input.charCodeAt(peg$currPos) === 60) {
|
|
// @ts-ignore
|
|
s1 = peg$c11
|
|
// @ts-ignore
|
|
peg$currPos++
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
s1 = peg$FAILED
|
|
// @ts-ignore
|
|
if (peg$silentFails === 0) {
|
|
peg$fail(peg$e11)
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
if (s1 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
peg$savedPos = s0
|
|
// @ts-ignore
|
|
s1 = peg$f10()
|
|
}
|
|
// @ts-ignore
|
|
s0 = s1
|
|
// @ts-ignore
|
|
if (s0 === peg$FAILED) {
|
|
// @ts-ignore
|
|
s0 = peg$currPos
|
|
// @ts-ignore
|
|
if (input.charCodeAt(peg$currPos) === 61) {
|
|
// @ts-ignore
|
|
s1 = peg$c12
|
|
// @ts-ignore
|
|
peg$currPos++
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
s1 = peg$FAILED
|
|
// @ts-ignore
|
|
if (peg$silentFails === 0) {
|
|
peg$fail(peg$e12)
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
if (s1 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
peg$savedPos = s0
|
|
// @ts-ignore
|
|
s1 = peg$f11()
|
|
}
|
|
// @ts-ignore
|
|
s0 = s1
|
|
// @ts-ignore
|
|
if (s0 === peg$FAILED) {
|
|
// @ts-ignore
|
|
s0 = peg$currPos
|
|
// @ts-ignore
|
|
if (input.substr(peg$currPos, 2) === peg$c13) {
|
|
// @ts-ignore
|
|
s1 = peg$c13
|
|
// @ts-ignore
|
|
peg$currPos += 2
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
s1 = peg$FAILED
|
|
// @ts-ignore
|
|
if (peg$silentFails === 0) {
|
|
peg$fail(peg$e13)
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
if (s1 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
peg$savedPos = s0
|
|
// @ts-ignore
|
|
s1 = peg$f12()
|
|
}
|
|
// @ts-ignore
|
|
s0 = s1
|
|
// @ts-ignore
|
|
if (s0 === peg$FAILED) {
|
|
// @ts-ignore
|
|
s0 = peg$currPos
|
|
// @ts-ignore
|
|
if (input.charCodeAt(peg$currPos) === 94) {
|
|
// @ts-ignore
|
|
s1 = peg$c14
|
|
// @ts-ignore
|
|
peg$currPos++
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
s1 = peg$FAILED
|
|
// @ts-ignore
|
|
if (peg$silentFails === 0) {
|
|
peg$fail(peg$e14)
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
if (s1 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
peg$savedPos = s0
|
|
// @ts-ignore
|
|
s1 = peg$f13()
|
|
}
|
|
// @ts-ignore
|
|
s0 = s1
|
|
// @ts-ignore
|
|
if (s0 === peg$FAILED) {
|
|
// @ts-ignore
|
|
s0 = peg$currPos
|
|
// @ts-ignore
|
|
if (input.charCodeAt(peg$currPos) === 126) {
|
|
// @ts-ignore
|
|
s1 = peg$c15
|
|
// @ts-ignore
|
|
peg$currPos++
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
s1 = peg$FAILED
|
|
// @ts-ignore
|
|
if (peg$silentFails === 0) {
|
|
peg$fail(peg$e15)
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
if (s1 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
peg$savedPos = s0
|
|
// @ts-ignore
|
|
s1 = peg$f14()
|
|
}
|
|
// @ts-ignore
|
|
s0 = s1
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// @ts-ignore
|
|
return s0
|
|
}
|
|
|
|
// @ts-ignore
|
|
function // @ts-ignore
|
|
peg$parseExtendedVersion() {
|
|
// @ts-ignore
|
|
var s0, s1, s2, s3, s4
|
|
|
|
// @ts-ignore
|
|
s0 = peg$currPos
|
|
// @ts-ignore
|
|
s1 = peg$parseFlavor()
|
|
// @ts-ignore
|
|
if (s1 === peg$FAILED) {
|
|
// @ts-ignore
|
|
s1 = null
|
|
}
|
|
// @ts-ignore
|
|
s2 = peg$parseVersion()
|
|
// @ts-ignore
|
|
if (s2 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
if (input.charCodeAt(peg$currPos) === 58) {
|
|
// @ts-ignore
|
|
s3 = peg$c4
|
|
// @ts-ignore
|
|
peg$currPos++
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
s3 = peg$FAILED
|
|
// @ts-ignore
|
|
if (peg$silentFails === 0) {
|
|
peg$fail(peg$e4)
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
if (s3 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s4 = peg$parseVersion()
|
|
// @ts-ignore
|
|
if (s4 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
peg$savedPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$f15(s1, s2, s4)
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$FAILED
|
|
}
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$FAILED
|
|
}
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$FAILED
|
|
}
|
|
|
|
// @ts-ignore
|
|
return s0
|
|
}
|
|
|
|
// @ts-ignore
|
|
function // @ts-ignore
|
|
peg$parseEmverVersionRange() {
|
|
// @ts-ignore
|
|
var s0, s1, s2, s3, s4, s5, s6, s7
|
|
|
|
// @ts-ignore
|
|
s0 = peg$currPos
|
|
// @ts-ignore
|
|
s1 = peg$parseEmverVersionRangeAtom()
|
|
// @ts-ignore
|
|
if (s1 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s2 = []
|
|
// @ts-ignore
|
|
s3 = peg$currPos
|
|
// @ts-ignore
|
|
s4 = peg$parse_()
|
|
// @ts-ignore
|
|
s5 = peg$currPos
|
|
// @ts-ignore
|
|
s6 = peg$parseOr()
|
|
// @ts-ignore
|
|
if (s6 === peg$FAILED) {
|
|
// @ts-ignore
|
|
s6 = peg$parseAnd()
|
|
}
|
|
// @ts-ignore
|
|
if (s6 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s7 = peg$parse_()
|
|
// @ts-ignore
|
|
s6 = [s6, s7]
|
|
// @ts-ignore
|
|
s5 = s6
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s5
|
|
// @ts-ignore
|
|
s5 = peg$FAILED
|
|
}
|
|
// @ts-ignore
|
|
if (s5 === peg$FAILED) {
|
|
// @ts-ignore
|
|
s5 = null
|
|
}
|
|
// @ts-ignore
|
|
s6 = peg$parseEmverVersionRangeAtom()
|
|
// @ts-ignore
|
|
if (s6 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s4 = [s4, s5, s6]
|
|
// @ts-ignore
|
|
s3 = s4
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s3
|
|
// @ts-ignore
|
|
s3 = peg$FAILED
|
|
}
|
|
// @ts-ignore
|
|
while (s3 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s2.push(s3)
|
|
// @ts-ignore
|
|
s3 = peg$currPos
|
|
// @ts-ignore
|
|
s4 = peg$parse_()
|
|
// @ts-ignore
|
|
s5 = peg$currPos
|
|
// @ts-ignore
|
|
s6 = peg$parseOr()
|
|
// @ts-ignore
|
|
if (s6 === peg$FAILED) {
|
|
// @ts-ignore
|
|
s6 = peg$parseAnd()
|
|
}
|
|
// @ts-ignore
|
|
if (s6 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s7 = peg$parse_()
|
|
// @ts-ignore
|
|
s6 = [s6, s7]
|
|
// @ts-ignore
|
|
s5 = s6
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s5
|
|
// @ts-ignore
|
|
s5 = peg$FAILED
|
|
}
|
|
// @ts-ignore
|
|
if (s5 === peg$FAILED) {
|
|
// @ts-ignore
|
|
s5 = null
|
|
}
|
|
// @ts-ignore
|
|
s6 = peg$parseEmverVersionRangeAtom()
|
|
// @ts-ignore
|
|
if (s6 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s4 = [s4, s5, s6]
|
|
// @ts-ignore
|
|
s3 = s4
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s3
|
|
// @ts-ignore
|
|
s3 = peg$FAILED
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
s1 = [s1, s2]
|
|
// @ts-ignore
|
|
s0 = s1
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$FAILED
|
|
}
|
|
|
|
// @ts-ignore
|
|
return s0
|
|
}
|
|
|
|
// @ts-ignore
|
|
function // @ts-ignore
|
|
peg$parseEmverVersionRangeAtom() {
|
|
// @ts-ignore
|
|
var s0
|
|
|
|
// @ts-ignore
|
|
s0 = peg$parseEmverParens()
|
|
// @ts-ignore
|
|
if (s0 === peg$FAILED) {
|
|
// @ts-ignore
|
|
s0 = peg$parseEmverAnchor()
|
|
// @ts-ignore
|
|
if (s0 === peg$FAILED) {
|
|
// @ts-ignore
|
|
s0 = peg$parseEmverNot()
|
|
// @ts-ignore
|
|
if (s0 === peg$FAILED) {
|
|
// @ts-ignore
|
|
s0 = peg$parseAny()
|
|
// @ts-ignore
|
|
if (s0 === peg$FAILED) {
|
|
// @ts-ignore
|
|
s0 = peg$parseNone()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// @ts-ignore
|
|
return s0
|
|
}
|
|
|
|
// @ts-ignore
|
|
function // @ts-ignore
|
|
peg$parseEmverParens() {
|
|
// @ts-ignore
|
|
var s0, s1, s2, s3, s4, s5
|
|
|
|
// @ts-ignore
|
|
s0 = peg$currPos
|
|
// @ts-ignore
|
|
if (input.charCodeAt(peg$currPos) === 40) {
|
|
// @ts-ignore
|
|
s1 = peg$c2
|
|
// @ts-ignore
|
|
peg$currPos++
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
s1 = peg$FAILED
|
|
// @ts-ignore
|
|
if (peg$silentFails === 0) {
|
|
peg$fail(peg$e2)
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
if (s1 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s2 = peg$parse_()
|
|
// @ts-ignore
|
|
s3 = peg$parseEmverVersionRange()
|
|
// @ts-ignore
|
|
if (s3 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s4 = peg$parse_()
|
|
// @ts-ignore
|
|
if (input.charCodeAt(peg$currPos) === 41) {
|
|
// @ts-ignore
|
|
s5 = peg$c3
|
|
// @ts-ignore
|
|
peg$currPos++
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
s5 = peg$FAILED
|
|
// @ts-ignore
|
|
if (peg$silentFails === 0) {
|
|
peg$fail(peg$e3)
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
if (s5 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
peg$savedPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$f16(s3)
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$FAILED
|
|
}
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$FAILED
|
|
}
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$FAILED
|
|
}
|
|
|
|
// @ts-ignore
|
|
return s0
|
|
}
|
|
|
|
// @ts-ignore
|
|
function // @ts-ignore
|
|
peg$parseEmverAnchor() {
|
|
// @ts-ignore
|
|
var s0, s1, s2, s3
|
|
|
|
// @ts-ignore
|
|
s0 = peg$currPos
|
|
// @ts-ignore
|
|
s1 = peg$parseCmpOp()
|
|
// @ts-ignore
|
|
if (s1 === peg$FAILED) {
|
|
// @ts-ignore
|
|
s1 = null
|
|
}
|
|
// @ts-ignore
|
|
s2 = peg$parse_()
|
|
// @ts-ignore
|
|
s3 = peg$parseEmver()
|
|
// @ts-ignore
|
|
if (s3 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
peg$savedPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$f17(s1, s3)
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$FAILED
|
|
}
|
|
|
|
// @ts-ignore
|
|
return s0
|
|
}
|
|
|
|
// @ts-ignore
|
|
function // @ts-ignore
|
|
peg$parseEmverNot() {
|
|
// @ts-ignore
|
|
var s0, s1, s2, s3
|
|
|
|
// @ts-ignore
|
|
s0 = peg$currPos
|
|
// @ts-ignore
|
|
if (input.charCodeAt(peg$currPos) === 33) {
|
|
// @ts-ignore
|
|
s1 = peg$c6
|
|
// @ts-ignore
|
|
peg$currPos++
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
s1 = peg$FAILED
|
|
// @ts-ignore
|
|
if (peg$silentFails === 0) {
|
|
peg$fail(peg$e6)
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
if (s1 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s2 = peg$parse_()
|
|
// @ts-ignore
|
|
s3 = peg$parseEmverVersionRangeAtom()
|
|
// @ts-ignore
|
|
if (s3 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
peg$savedPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$f18(s3)
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$FAILED
|
|
}
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$FAILED
|
|
}
|
|
|
|
// @ts-ignore
|
|
return s0
|
|
}
|
|
|
|
// @ts-ignore
|
|
function // @ts-ignore
|
|
peg$parseEmver() {
|
|
// @ts-ignore
|
|
var s0, s1, s2, s3, s4, s5, s6, s7, s8
|
|
|
|
// @ts-ignore
|
|
s0 = peg$currPos
|
|
// @ts-ignore
|
|
s1 = peg$parseDigit()
|
|
// @ts-ignore
|
|
if (s1 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
if (input.charCodeAt(peg$currPos) === 46) {
|
|
// @ts-ignore
|
|
s2 = peg$c16
|
|
// @ts-ignore
|
|
peg$currPos++
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
s2 = peg$FAILED
|
|
// @ts-ignore
|
|
if (peg$silentFails === 0) {
|
|
peg$fail(peg$e16)
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
if (s2 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s3 = peg$parseDigit()
|
|
// @ts-ignore
|
|
if (s3 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
if (input.charCodeAt(peg$currPos) === 46) {
|
|
// @ts-ignore
|
|
s4 = peg$c16
|
|
// @ts-ignore
|
|
peg$currPos++
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
s4 = peg$FAILED
|
|
// @ts-ignore
|
|
if (peg$silentFails === 0) {
|
|
peg$fail(peg$e16)
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
if (s4 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s5 = peg$parseDigit()
|
|
// @ts-ignore
|
|
if (s5 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s6 = peg$currPos
|
|
// @ts-ignore
|
|
if (input.charCodeAt(peg$currPos) === 46) {
|
|
// @ts-ignore
|
|
s7 = peg$c16
|
|
// @ts-ignore
|
|
peg$currPos++
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
s7 = peg$FAILED
|
|
// @ts-ignore
|
|
if (peg$silentFails === 0) {
|
|
peg$fail(peg$e16)
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
if (s7 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s8 = peg$parseDigit()
|
|
// @ts-ignore
|
|
if (s8 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
peg$savedPos = s6
|
|
// @ts-ignore
|
|
s6 = peg$f19(s1, s3, s5, s8)
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s6
|
|
// @ts-ignore
|
|
s6 = peg$FAILED
|
|
}
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s6
|
|
// @ts-ignore
|
|
s6 = peg$FAILED
|
|
}
|
|
// @ts-ignore
|
|
if (s6 === peg$FAILED) {
|
|
// @ts-ignore
|
|
s6 = null
|
|
}
|
|
// @ts-ignore
|
|
peg$savedPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$f20(s1, s3, s5, s6)
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$FAILED
|
|
}
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$FAILED
|
|
}
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$FAILED
|
|
}
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$FAILED
|
|
}
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$FAILED
|
|
}
|
|
|
|
// @ts-ignore
|
|
return s0
|
|
}
|
|
|
|
// @ts-ignore
|
|
function // @ts-ignore
|
|
peg$parseFlavor() {
|
|
// @ts-ignore
|
|
var s0, s1, s2, s3
|
|
|
|
// @ts-ignore
|
|
s0 = peg$currPos
|
|
// @ts-ignore
|
|
if (input.charCodeAt(peg$currPos) === 35) {
|
|
// @ts-ignore
|
|
s1 = peg$c5
|
|
// @ts-ignore
|
|
peg$currPos++
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
s1 = peg$FAILED
|
|
// @ts-ignore
|
|
if (peg$silentFails === 0) {
|
|
peg$fail(peg$e5)
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
if (s1 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s2 = peg$parseFlavorString()
|
|
// @ts-ignore
|
|
if (input.charCodeAt(peg$currPos) === 58) {
|
|
// @ts-ignore
|
|
s3 = peg$c4
|
|
// @ts-ignore
|
|
peg$currPos++
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
s3 = peg$FAILED
|
|
// @ts-ignore
|
|
if (peg$silentFails === 0) {
|
|
peg$fail(peg$e4)
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
if (s3 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
peg$savedPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$f21(s2)
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$FAILED
|
|
}
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$FAILED
|
|
}
|
|
|
|
// @ts-ignore
|
|
return s0
|
|
}
|
|
|
|
// @ts-ignore
|
|
function // @ts-ignore
|
|
peg$parseFlavorString() {
|
|
// @ts-ignore
|
|
var s0, s1, s2
|
|
|
|
// @ts-ignore
|
|
s0 = peg$currPos
|
|
// @ts-ignore
|
|
s1 = []
|
|
// @ts-ignore
|
|
if (peg$r0.test(input.charAt(peg$currPos))) {
|
|
// @ts-ignore
|
|
s2 = input.charAt(peg$currPos)
|
|
// @ts-ignore
|
|
peg$currPos++
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
s2 = peg$FAILED
|
|
// @ts-ignore
|
|
if (peg$silentFails === 0) {
|
|
peg$fail(peg$e17)
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
while (s2 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s1.push(s2)
|
|
// @ts-ignore
|
|
if (peg$r0.test(input.charAt(peg$currPos))) {
|
|
// @ts-ignore
|
|
s2 = input.charAt(peg$currPos)
|
|
// @ts-ignore
|
|
peg$currPos++
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
s2 = peg$FAILED
|
|
// @ts-ignore
|
|
if (peg$silentFails === 0) {
|
|
peg$fail(peg$e17)
|
|
}
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
peg$savedPos = s0
|
|
// @ts-ignore
|
|
s1 = peg$f22()
|
|
// @ts-ignore
|
|
s0 = s1
|
|
|
|
// @ts-ignore
|
|
return s0
|
|
}
|
|
|
|
// @ts-ignore
|
|
function // @ts-ignore
|
|
peg$parseString() {
|
|
// @ts-ignore
|
|
var s0, s1, s2
|
|
|
|
// @ts-ignore
|
|
s0 = peg$currPos
|
|
// @ts-ignore
|
|
s1 = []
|
|
// @ts-ignore
|
|
if (peg$r1.test(input.charAt(peg$currPos))) {
|
|
// @ts-ignore
|
|
s2 = input.charAt(peg$currPos)
|
|
// @ts-ignore
|
|
peg$currPos++
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
s2 = peg$FAILED
|
|
// @ts-ignore
|
|
if (peg$silentFails === 0) {
|
|
peg$fail(peg$e18)
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
if (s2 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
while (s2 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s1.push(s2)
|
|
// @ts-ignore
|
|
if (peg$r1.test(input.charAt(peg$currPos))) {
|
|
// @ts-ignore
|
|
s2 = input.charAt(peg$currPos)
|
|
// @ts-ignore
|
|
peg$currPos++
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
s2 = peg$FAILED
|
|
// @ts-ignore
|
|
if (peg$silentFails === 0) {
|
|
peg$fail(peg$e18)
|
|
}
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
s1 = peg$FAILED
|
|
}
|
|
// @ts-ignore
|
|
if (s1 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
peg$savedPos = s0
|
|
// @ts-ignore
|
|
s1 = peg$f23()
|
|
}
|
|
// @ts-ignore
|
|
s0 = s1
|
|
|
|
// @ts-ignore
|
|
return s0
|
|
}
|
|
|
|
// @ts-ignore
|
|
function // @ts-ignore
|
|
peg$parseVersion() {
|
|
// @ts-ignore
|
|
var s0, s1, s2
|
|
|
|
// @ts-ignore
|
|
s0 = peg$currPos
|
|
// @ts-ignore
|
|
s1 = peg$parseVersionNumber()
|
|
// @ts-ignore
|
|
if (s1 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s2 = peg$parsePreRelease()
|
|
// @ts-ignore
|
|
if (s2 === peg$FAILED) {
|
|
// @ts-ignore
|
|
s2 = null
|
|
}
|
|
// @ts-ignore
|
|
peg$savedPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$f24(s1, s2)
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$FAILED
|
|
}
|
|
|
|
// @ts-ignore
|
|
return s0
|
|
}
|
|
|
|
// @ts-ignore
|
|
function // @ts-ignore
|
|
peg$parsePreRelease() {
|
|
// @ts-ignore
|
|
var s0, s1, s2, s3, s4, s5, s6
|
|
|
|
// @ts-ignore
|
|
s0 = peg$currPos
|
|
// @ts-ignore
|
|
if (input.charCodeAt(peg$currPos) === 45) {
|
|
// @ts-ignore
|
|
s1 = peg$c17
|
|
// @ts-ignore
|
|
peg$currPos++
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
s1 = peg$FAILED
|
|
// @ts-ignore
|
|
if (peg$silentFails === 0) {
|
|
peg$fail(peg$e19)
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
if (s1 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s2 = peg$parsePreReleaseSegment()
|
|
// @ts-ignore
|
|
if (s2 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s3 = []
|
|
// @ts-ignore
|
|
s4 = peg$currPos
|
|
// @ts-ignore
|
|
if (input.charCodeAt(peg$currPos) === 46) {
|
|
// @ts-ignore
|
|
s5 = peg$c16
|
|
// @ts-ignore
|
|
peg$currPos++
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
s5 = peg$FAILED
|
|
// @ts-ignore
|
|
if (peg$silentFails === 0) {
|
|
peg$fail(peg$e16)
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
if (s5 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s6 = peg$parsePreReleaseSegment()
|
|
// @ts-ignore
|
|
if (s6 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s5 = [s5, s6]
|
|
// @ts-ignore
|
|
s4 = s5
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s4
|
|
// @ts-ignore
|
|
s4 = peg$FAILED
|
|
}
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s4
|
|
// @ts-ignore
|
|
s4 = peg$FAILED
|
|
}
|
|
// @ts-ignore
|
|
while (s4 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s3.push(s4)
|
|
// @ts-ignore
|
|
s4 = peg$currPos
|
|
// @ts-ignore
|
|
if (input.charCodeAt(peg$currPos) === 46) {
|
|
// @ts-ignore
|
|
s5 = peg$c16
|
|
// @ts-ignore
|
|
peg$currPos++
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
s5 = peg$FAILED
|
|
// @ts-ignore
|
|
if (peg$silentFails === 0) {
|
|
peg$fail(peg$e16)
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
if (s5 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s6 = peg$parsePreReleaseSegment()
|
|
// @ts-ignore
|
|
if (s6 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s5 = [s5, s6]
|
|
// @ts-ignore
|
|
s4 = s5
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s4
|
|
// @ts-ignore
|
|
s4 = peg$FAILED
|
|
}
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s4
|
|
// @ts-ignore
|
|
s4 = peg$FAILED
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
peg$savedPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$f25(s2, s3)
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$FAILED
|
|
}
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$FAILED
|
|
}
|
|
|
|
// @ts-ignore
|
|
return s0
|
|
}
|
|
|
|
// @ts-ignore
|
|
function // @ts-ignore
|
|
peg$parsePreReleaseSegment() {
|
|
// @ts-ignore
|
|
var s0, s1, s2
|
|
|
|
// @ts-ignore
|
|
s0 = peg$currPos
|
|
// @ts-ignore
|
|
if (input.charCodeAt(peg$currPos) === 46) {
|
|
// @ts-ignore
|
|
s1 = peg$c16
|
|
// @ts-ignore
|
|
peg$currPos++
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
s1 = peg$FAILED
|
|
// @ts-ignore
|
|
if (peg$silentFails === 0) {
|
|
peg$fail(peg$e16)
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
if (s1 === peg$FAILED) {
|
|
// @ts-ignore
|
|
s1 = null
|
|
}
|
|
// @ts-ignore
|
|
s2 = peg$parseDigit()
|
|
// @ts-ignore
|
|
if (s2 === peg$FAILED) {
|
|
// @ts-ignore
|
|
s2 = peg$parseString()
|
|
}
|
|
// @ts-ignore
|
|
if (s2 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
peg$savedPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$f26(s2)
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$FAILED
|
|
}
|
|
|
|
// @ts-ignore
|
|
return s0
|
|
}
|
|
|
|
// @ts-ignore
|
|
function // @ts-ignore
|
|
peg$parseVersionNumber() {
|
|
// @ts-ignore
|
|
var s0, s1, s2, s3, s4, s5
|
|
|
|
// @ts-ignore
|
|
s0 = peg$currPos
|
|
// @ts-ignore
|
|
s1 = peg$parseDigit()
|
|
// @ts-ignore
|
|
if (s1 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s2 = []
|
|
// @ts-ignore
|
|
s3 = peg$currPos
|
|
// @ts-ignore
|
|
if (input.charCodeAt(peg$currPos) === 46) {
|
|
// @ts-ignore
|
|
s4 = peg$c16
|
|
// @ts-ignore
|
|
peg$currPos++
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
s4 = peg$FAILED
|
|
// @ts-ignore
|
|
if (peg$silentFails === 0) {
|
|
peg$fail(peg$e16)
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
if (s4 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s5 = peg$parseDigit()
|
|
// @ts-ignore
|
|
if (s5 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s4 = [s4, s5]
|
|
// @ts-ignore
|
|
s3 = s4
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s3
|
|
// @ts-ignore
|
|
s3 = peg$FAILED
|
|
}
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s3
|
|
// @ts-ignore
|
|
s3 = peg$FAILED
|
|
}
|
|
// @ts-ignore
|
|
while (s3 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s2.push(s3)
|
|
// @ts-ignore
|
|
s3 = peg$currPos
|
|
// @ts-ignore
|
|
if (input.charCodeAt(peg$currPos) === 46) {
|
|
// @ts-ignore
|
|
s4 = peg$c16
|
|
// @ts-ignore
|
|
peg$currPos++
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
s4 = peg$FAILED
|
|
// @ts-ignore
|
|
if (peg$silentFails === 0) {
|
|
peg$fail(peg$e16)
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
if (s4 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s5 = peg$parseDigit()
|
|
// @ts-ignore
|
|
if (s5 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s4 = [s4, s5]
|
|
// @ts-ignore
|
|
s3 = s4
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s3
|
|
// @ts-ignore
|
|
s3 = peg$FAILED
|
|
}
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s3
|
|
// @ts-ignore
|
|
s3 = peg$FAILED
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
peg$savedPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$f27(s1, s2)
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
peg$currPos = s0
|
|
// @ts-ignore
|
|
s0 = peg$FAILED
|
|
}
|
|
|
|
// @ts-ignore
|
|
return s0
|
|
}
|
|
|
|
// @ts-ignore
|
|
function // @ts-ignore
|
|
peg$parseDigit() {
|
|
// @ts-ignore
|
|
var s0, s1, s2
|
|
|
|
// @ts-ignore
|
|
s0 = peg$currPos
|
|
// @ts-ignore
|
|
s1 = []
|
|
// @ts-ignore
|
|
if (peg$r2.test(input.charAt(peg$currPos))) {
|
|
// @ts-ignore
|
|
s2 = input.charAt(peg$currPos)
|
|
// @ts-ignore
|
|
peg$currPos++
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
s2 = peg$FAILED
|
|
// @ts-ignore
|
|
if (peg$silentFails === 0) {
|
|
peg$fail(peg$e20)
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
if (s2 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
while (s2 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s1.push(s2)
|
|
// @ts-ignore
|
|
if (peg$r2.test(input.charAt(peg$currPos))) {
|
|
// @ts-ignore
|
|
s2 = input.charAt(peg$currPos)
|
|
// @ts-ignore
|
|
peg$currPos++
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
s2 = peg$FAILED
|
|
// @ts-ignore
|
|
if (peg$silentFails === 0) {
|
|
peg$fail(peg$e20)
|
|
}
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
s1 = peg$FAILED
|
|
}
|
|
// @ts-ignore
|
|
if (s1 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
peg$savedPos = s0
|
|
// @ts-ignore
|
|
s1 = peg$f28()
|
|
}
|
|
// @ts-ignore
|
|
s0 = s1
|
|
|
|
// @ts-ignore
|
|
return s0
|
|
}
|
|
|
|
// @ts-ignore
|
|
function // @ts-ignore
|
|
peg$parse_() {
|
|
// @ts-ignore
|
|
var s0, s1
|
|
|
|
// @ts-ignore
|
|
peg$silentFails++
|
|
// @ts-ignore
|
|
s0 = []
|
|
// @ts-ignore
|
|
if (peg$r3.test(input.charAt(peg$currPos))) {
|
|
// @ts-ignore
|
|
s1 = input.charAt(peg$currPos)
|
|
// @ts-ignore
|
|
peg$currPos++
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
s1 = peg$FAILED
|
|
// @ts-ignore
|
|
if (peg$silentFails === 0) {
|
|
peg$fail(peg$e22)
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
while (s1 !== peg$FAILED) {
|
|
// @ts-ignore
|
|
s0.push(s1)
|
|
// @ts-ignore
|
|
if (peg$r3.test(input.charAt(peg$currPos))) {
|
|
// @ts-ignore
|
|
s1 = input.charAt(peg$currPos)
|
|
// @ts-ignore
|
|
peg$currPos++
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
s1 = peg$FAILED
|
|
// @ts-ignore
|
|
if (peg$silentFails === 0) {
|
|
peg$fail(peg$e22)
|
|
}
|
|
}
|
|
}
|
|
// @ts-ignore
|
|
peg$silentFails--
|
|
// @ts-ignore
|
|
s1 = peg$FAILED
|
|
// @ts-ignore
|
|
if (peg$silentFails === 0) {
|
|
peg$fail(peg$e21)
|
|
}
|
|
|
|
// @ts-ignore
|
|
return s0
|
|
}
|
|
|
|
// @ts-ignore
|
|
peg$result = peg$startRuleFunction()
|
|
|
|
// @ts-ignore
|
|
if (peg$result !== peg$FAILED && peg$currPos === input.length) {
|
|
// @ts-ignore
|
|
return peg$result
|
|
// @ts-ignore
|
|
} else {
|
|
// @ts-ignore
|
|
if (peg$result !== peg$FAILED && peg$currPos < input.length) {
|
|
// @ts-ignore
|
|
peg$fail(peg$endExpectation())
|
|
}
|
|
|
|
// @ts-ignore
|
|
throw peg$buildStructuredError(
|
|
// @ts-ignore
|
|
peg$maxFailExpected,
|
|
// @ts-ignore
|
|
peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,
|
|
// @ts-ignore
|
|
peg$maxFailPos < input.length
|
|
? // @ts-ignore
|
|
peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)
|
|
: // @ts-ignore
|
|
peg$computeLocation(peg$maxFailPos, peg$maxFailPos),
|
|
)
|
|
}
|
|
}
|
|
|
|
// @ts-ignore
|
|
return {
|
|
SyntaxError: peg$SyntaxError,
|
|
parse: peg$parse,
|
|
}
|
|
})()
|
|
|
|
export interface FilePosition {
|
|
offset: number
|
|
line: number
|
|
column: number
|
|
}
|
|
|
|
export interface FileRange {
|
|
start: FilePosition
|
|
end: FilePosition
|
|
source: string
|
|
}
|
|
|
|
export interface LiteralExpectation {
|
|
type: 'literal'
|
|
text: string
|
|
ignoreCase: boolean
|
|
}
|
|
|
|
export interface ClassParts extends Array<string | ClassParts> {}
|
|
|
|
export interface ClassExpectation {
|
|
type: 'class'
|
|
parts: ClassParts
|
|
inverted: boolean
|
|
ignoreCase: boolean
|
|
}
|
|
|
|
export interface AnyExpectation {
|
|
type: 'any'
|
|
}
|
|
|
|
export interface EndExpectation {
|
|
type: 'end'
|
|
}
|
|
|
|
export interface OtherExpectation {
|
|
type: 'other'
|
|
description: string
|
|
}
|
|
|
|
export type Expectation =
|
|
| LiteralExpectation
|
|
| ClassExpectation
|
|
| AnyExpectation
|
|
| EndExpectation
|
|
| OtherExpectation
|
|
|
|
declare class _PeggySyntaxError extends Error {
|
|
public static buildMessage(
|
|
expected: Expectation[],
|
|
found: string | null,
|
|
): string
|
|
public message: string
|
|
public expected: Expectation[]
|
|
public found: string | null
|
|
public location: FileRange
|
|
public name: string
|
|
constructor(
|
|
message: string,
|
|
expected: Expectation[],
|
|
found: string | null,
|
|
location: FileRange,
|
|
)
|
|
format(
|
|
sources: {
|
|
source?: any
|
|
text: string
|
|
}[],
|
|
): string
|
|
}
|
|
|
|
export interface TraceEvent {
|
|
type: string
|
|
rule: string
|
|
result?: any
|
|
location: FileRange
|
|
}
|
|
|
|
declare class _DefaultTracer {
|
|
private indentLevel: number
|
|
public trace(event: TraceEvent): void
|
|
}
|
|
|
|
peggyParser.SyntaxError.prototype.name = 'PeggySyntaxError'
|
|
|
|
export interface ParseOptions {
|
|
filename?: string
|
|
startRule?:
|
|
| 'VersionRange'
|
|
| 'Or'
|
|
| 'And'
|
|
| 'VersionRangeAtom'
|
|
| 'Parens'
|
|
| 'Anchor'
|
|
| 'VersionSpec'
|
|
| 'FlavorAtom'
|
|
| 'Not'
|
|
| 'Any'
|
|
| 'None'
|
|
| 'CmpOp'
|
|
| 'ExtendedVersion'
|
|
| 'EmverVersionRange'
|
|
| 'EmverVersionRangeAtom'
|
|
| 'EmverParens'
|
|
| 'EmverAnchor'
|
|
| 'EmverNot'
|
|
| 'Emver'
|
|
| 'Flavor'
|
|
| 'FlavorString'
|
|
| 'String'
|
|
| 'Version'
|
|
| 'PreRelease'
|
|
| 'PreReleaseSegment'
|
|
| 'VersionNumber'
|
|
| 'Digit'
|
|
| '_'
|
|
tracer?: any
|
|
[key: string]: any
|
|
}
|
|
export type ParseFunction = <Options extends ParseOptions>(
|
|
input: string,
|
|
options?: Options,
|
|
) => Options extends { startRule: infer StartRule }
|
|
? StartRule extends 'VersionRange'
|
|
? VersionRange
|
|
: StartRule extends 'Or'
|
|
? Or
|
|
: StartRule extends 'And'
|
|
? And
|
|
: StartRule extends 'VersionRangeAtom'
|
|
? VersionRangeAtom
|
|
: StartRule extends 'Parens'
|
|
? Parens
|
|
: StartRule extends 'Anchor'
|
|
? Anchor
|
|
: StartRule extends 'VersionSpec'
|
|
? VersionSpec
|
|
: StartRule extends 'FlavorAtom'
|
|
? FlavorAtom
|
|
: StartRule extends 'Not'
|
|
? Not
|
|
: StartRule extends 'Any'
|
|
? Any
|
|
: StartRule extends 'None'
|
|
? None
|
|
: StartRule extends 'CmpOp'
|
|
? CmpOp
|
|
: StartRule extends 'ExtendedVersion'
|
|
? ExtendedVersion
|
|
: StartRule extends 'EmverVersionRange'
|
|
? EmverVersionRange
|
|
: StartRule extends 'EmverVersionRangeAtom'
|
|
? EmverVersionRangeAtom
|
|
: StartRule extends 'EmverParens'
|
|
? EmverParens
|
|
: StartRule extends 'EmverAnchor'
|
|
? EmverAnchor
|
|
: StartRule extends 'EmverNot'
|
|
? EmverNot
|
|
: StartRule extends 'Emver'
|
|
? Emver
|
|
: StartRule extends 'Flavor'
|
|
? Flavor
|
|
: StartRule extends 'FlavorString'
|
|
? FlavorString
|
|
: StartRule extends 'String'
|
|
? String_1
|
|
: StartRule extends 'Version'
|
|
? Version
|
|
: StartRule extends 'PreRelease'
|
|
? PreRelease
|
|
: StartRule extends 'PreReleaseSegment'
|
|
? PreReleaseSegment
|
|
: StartRule extends 'VersionNumber'
|
|
? VersionNumber
|
|
: StartRule extends 'Digit'
|
|
? Digit
|
|
: StartRule extends '_'
|
|
? _
|
|
: VersionRange
|
|
: VersionRange
|
|
export const parse: ParseFunction = peggyParser.parse
|
|
|
|
export const PeggySyntaxError =
|
|
peggyParser.SyntaxError as typeof _PeggySyntaxError
|
|
|
|
export type PeggySyntaxError = _PeggySyntaxError
|
|
|
|
// These types were autogenerated by ts-pegjs
|
|
export type VersionRange = [
|
|
VersionRangeAtom,
|
|
[_, [Or | And, _] | null, VersionRangeAtom][],
|
|
]
|
|
export type Or = '||'
|
|
export type And = '&&'
|
|
export type VersionRangeAtom = Parens | Anchor | Not | Any | None | FlavorAtom
|
|
export type Parens = { type: 'Parens'; expr: VersionRange }
|
|
export type Anchor = {
|
|
type: 'Anchor'
|
|
operator: CmpOp | null
|
|
version: VersionSpec
|
|
}
|
|
export type VersionSpec = {
|
|
flavor: NonNullable<Flavor | null> | null
|
|
upstream: Version
|
|
downstream: any
|
|
}
|
|
export type FlavorAtom = { type: 'Flavor'; flavor: FlavorString }
|
|
export type Not = { type: 'Not'; value: VersionRangeAtom }
|
|
export type Any = { type: 'Any' }
|
|
export type None = { type: 'None' }
|
|
export type CmpOp = '>=' | '<=' | '>' | '<' | '=' | '!=' | '^' | '~'
|
|
export type ExtendedVersion = {
|
|
flavor: NonNullable<Flavor | null> | null
|
|
upstream: Version
|
|
downstream: Version
|
|
}
|
|
export type EmverVersionRange = [
|
|
EmverVersionRangeAtom,
|
|
[_, [Or | And, _] | null, EmverVersionRangeAtom][],
|
|
]
|
|
export type EmverVersionRangeAtom =
|
|
| EmverParens
|
|
| EmverAnchor
|
|
| EmverNot
|
|
| Any
|
|
| None
|
|
export type EmverParens = { type: 'Parens'; expr: EmverVersionRange }
|
|
export type EmverAnchor = {
|
|
type: 'Anchor'
|
|
operator: CmpOp | null
|
|
version: Emver
|
|
}
|
|
export type EmverNot = { type: 'Not'; value: EmverVersionRangeAtom }
|
|
export type Emver = {
|
|
flavor: null
|
|
upstream: { number: [Digit, Digit, Digit]; prerelease: [] }
|
|
downstream: { number: [0 | NonNullable<Digit | null>]; prerelease: [] }
|
|
}
|
|
export type Flavor = FlavorString
|
|
export type FlavorString = string
|
|
export type String_1 = string
|
|
export type Version = {
|
|
number: VersionNumber
|
|
prerelease: never[] | NonNullable<PreRelease | null>
|
|
}
|
|
export type PreRelease = PreReleaseSegment[]
|
|
export type PreReleaseSegment = Digit | String_1
|
|
export type VersionNumber = Digit[]
|
|
export type Digit = number
|
|
export type _ = string[]
|