Skip to content

Commit 1275c27

Browse files
committed
turns out this is unnecessary
1 parent ade7c8e commit 1275c27

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

src/parser/parser_lib.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
import { assert } from "@std/assert/assert";
22
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";
84
import { Clearable, ClearableCacheSet, Lazy } from "../cache.ts";
9-
import { flattenError, throwError } from "../../misc/misc.ts";
5+
import { throwError } from "../../misc/misc.ts";
106

117
export type ValueRest<T> = Readonly<{ rest: string; value: T }>;
128
export 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
}

0 commit comments

Comments
 (0)