Skip to content

Commit

Permalink
fix token parser
Browse files Browse the repository at this point in the history
  • Loading branch information
keean committed Jul 15, 2021
1 parent 5ed25da commit dfe26f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,8 @@ export function string(s: string): Parser<string> {
/**
* `string` matches string `token` and consumes any trailing spaces, or fails.
*/
export function token<A>(token: Parser<A>): Parser<A> {
return first(token, optSpaces());
export function token<A>(tok: Parser<A>): Parser<A> {
return first(tok, optSpaces);
}

type UnwrapParser<T> = T extends Parser<infer U> ? U : T;
Expand Down

0 comments on commit dfe26f1

Please sign in to comment.