seq -> sequence shorthand ref #87
This commit is contained in:
parent
4c43d3d850
commit
ff418c9f0c
1 changed files with 10 additions and 0 deletions
|
|
@ -647,6 +647,11 @@ export class Pattern {
|
||||||
return sequence(this, ...pats);
|
return sequence(this, ...pats);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// shorthand for sequence
|
||||||
|
seq(...pats) {
|
||||||
|
return sequence(this, ...pats);
|
||||||
|
}
|
||||||
|
|
||||||
cat(...pats) {
|
cat(...pats) {
|
||||||
return cat(this, ...pats);
|
return cat(this, ...pats);
|
||||||
}
|
}
|
||||||
|
|
@ -899,6 +904,11 @@ export function sequence(...pats) {
|
||||||
return fastcat(...pats);
|
return fastcat(...pats);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// shorthand for sequence
|
||||||
|
export function seq(...pats) {
|
||||||
|
return fastcat(...pats);
|
||||||
|
}
|
||||||
|
|
||||||
function _sequenceCount(x) {
|
function _sequenceCount(x) {
|
||||||
if (Array.isArray(x)) {
|
if (Array.isArray(x)) {
|
||||||
if (x.length == 0) {
|
if (x.length == 0) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue