File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed
Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change 11import { assert } from "@std/assert/assert" ;
22import { MemoizationCacheResult , memoize } from "@std/cache/memoize" ;
3- import {
4- ArrayResult ,
5- ArrayResultError ,
6- isArrayResult ,
7- } from "../array_result.ts" ;
3+ import { ArrayResult , ArrayResultError } from "../array_result.ts" ;
84import { Clearable , ClearableCacheSet , Lazy } from "../cache.ts" ;
9- import { flattenError , throwError } from "../../misc/misc.ts" ;
5+ import { throwError } from "../../misc/misc.ts" ;
106
117export type ValueRest < T > = Readonly < { rest : string ; value : T } > ;
128export type ParserResult < T > = ArrayResult < ValueRest < T > > ;
@@ -20,10 +16,7 @@ export class Parser<T> {
2016 if ( Parser . cache != null ) {
2117 const cache = new Map < string , MemoizationCacheResult < ParserResult < T > > > ( ) ;
2218 Parser . addToCache ( cache ) ;
23- this . rawParser = memoize ( this . nonMemoizedParser , {
24- cache,
25- errorIsCacheable : ( error ) => isArrayResult ( flattenError ( error ) ) ,
26- } ) ;
19+ this . rawParser = memoize ( this . nonMemoizedParser , { cache } ) ;
2720 } else {
2821 this . rawParser = this . nonMemoizedParser ;
2922 }
You can’t perform that action at this time.
0 commit comments