Repair nested-binder-patterns

This commit is contained in:
Tony Garnock-Jones 2023-03-06 23:26:15 +01:00
parent 44d7d16a82
commit 545282be32
1 changed files with 5 additions and 5 deletions

View File

@ -441,11 +441,6 @@ export class SyndicateParser {
valuePattern(level: number, ... extraStops: Pattern<any>[]): Pattern<ValuePattern> {
return withoutSpace(alt<ValuePattern>(
scope<PCapture>(o => {
o.type = 'PCapture';
o.inner = { type: 'PDiscard' };
return bind(o, 'binder', this.pCaptureBinder);
}),
scope(o => map(this.pDiscard, _ => o.type = 'PDiscard')),
this.pArray(level),
this.pDict(level),
@ -475,6 +470,11 @@ export class SyndicateParser {
return succeed(o);
}
}),
scope<PCapture>(o => {
o.type = 'PCapture';
o.inner = { type: 'PDiscard' };
return bind(o, 'binder', this.pCaptureBinder);
}),
map(this.expr(... extraStops), e => ({ type: 'PConstant', value: e }))
));
}