File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed
Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -374,17 +374,16 @@ export function optionalWithCheck<T>(
374374) : Parser < null | T > {
375375 return choiceWithCheck ( parser , checkedAsWhole ( nothing ) ) ;
376376}
377- export const allWithCheck = memoize ( < T > (
378- parser : CheckedParser < T > ,
379- ) : Parser < ReadonlyArray < T > > =>
380- choiceWithCheck < ReadonlyArray < T > > (
381- new CheckedParser (
382- parser . check ,
383- sequence ( parser . parser , lazy ( lazyEval ( ( ) => allWithCheck ( parser ) ) ) )
384- . map ( ( [ first , rest ] ) => [ first , ...rest ] ) ,
377+ export const allWithCheck = memoize (
378+ < T > ( parser : CheckedParser < T > ) : Parser < ReadonlyArray < T > > =>
379+ choiceWithCheck < ReadonlyArray < T > > (
380+ new CheckedParser (
381+ parser . check ,
382+ sequence ( parser . parser , lazy ( lazyEval ( ( ) => allWithCheck ( parser ) ) ) )
383+ . map ( ( [ first , rest ] ) => [ first , ...rest ] ) ,
384+ ) ,
385+ checkedAsWhole ( emptyArray ) ,
385386 ) ,
386- checkedAsWhole ( emptyArray ) ,
387- )
388387) ;
389388export function allAtLeastOnceWithCheck < T > (
390389 parser : CheckedParser < T > ,
You can’t perform that action at this time.
0 commit comments