diff --git a/examples/parser-by-do.ts b/examples/parser-by-do.ts index 549bcae..9069918 100644 --- a/examples/parser-by-do.ts +++ b/examples/parser-by-do.ts @@ -36,7 +36,7 @@ const between = (parser: Parser, pre: Parser, post = pre const or = (left: Parser, right: Parser) => qo(perform => { const [success, result] = perform.try( - [false] as const, + [false], () => [true, perform(left)] as const, ); return success ? result : perform(right); diff --git a/src/do.ts b/src/do.ts index 640f0c2..5e20bd4 100644 --- a/src/do.ts +++ b/src/do.ts @@ -11,7 +11,7 @@ export type PerformOptions = { export type Perform = { (parser: Parser, options?: PerformOptions): T; - try(defaultValue: T, runner: () => U): T | U; + try(defaultValue: T, runner: () => U): T | U; }; export const qo = ( diff --git a/src/string.ts b/src/string.ts index e20b139..9990312 100644 --- a/src/string.ts +++ b/src/string.ts @@ -134,7 +134,7 @@ export const regexGroup = (re: RegExp): Parser => { export const regex: { (re: RegExp): Parser; (re: RegExp, groupId: number | string): Parser; - ( + ( re: RegExp, groupId: number | string, defaultValue: T,