seq -> sequence shorthand ref #87

This commit is contained in:
alex 2022-04-23 11:10:05 +01:00
parent 4c43d3d850
commit ff418c9f0c

View File

@ -647,6 +647,11 @@ export class Pattern {
return sequence(this, ...pats);
}
// shorthand for sequence
seq(...pats) {
return sequence(this, ...pats);
}
cat(...pats) {
return cat(this, ...pats);
}
@ -899,6 +904,11 @@ export function sequence(...pats) {
return fastcat(...pats);
}
// shorthand for sequence
export function seq(...pats) {
return fastcat(...pats);
}
function _sequenceCount(x) {
if (Array.isArray(x)) {
if (x.length == 0) {