ParserPath constructor
Constructs a path from a list of parsers and indexes.
Implementation
new(this.parsers, this.indexes)
: assert(parsers.isNotEmpty, 'parsers cannot be empty'),
assert(indexes.length == parsers.length - 1, 'indexes wrong size'),
assert(
(() {
for (var i = 0; i < indexes.length; i++) {
if (parsers[i].children[indexes[i]] != parsers[i + 1]) {
return false;
}
}
return true;
})(),
'indexes invalid',
);