File tree 1 file changed +3
-10
lines changed
1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change 1
1
import { assert } from "@std/assert/assert" ;
2
2
import { 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" ;
8
4
import { Clearable , ClearableCacheSet , Lazy } from "../cache.ts" ;
9
- import { flattenError , throwError } from "../../misc/misc.ts" ;
5
+ import { throwError } from "../../misc/misc.ts" ;
10
6
11
7
export type ValueRest < T > = Readonly < { rest : string ; value : T } > ;
12
8
export type ParserResult < T > = ArrayResult < ValueRest < T > > ;
@@ -20,10 +16,7 @@ export class Parser<T> {
20
16
if ( Parser . cache != null ) {
21
17
const cache = new Map < string , MemoizationCacheResult < ParserResult < T > > > ( ) ;
22
18
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 } ) ;
27
20
} else {
28
21
this . rawParser = this . nonMemoizedParser ;
29
22
}
You can’t perform that action at this time.
0 commit comments