Skip to content

Commit 99c27fe

Browse files
committed
fix(space): should match at least one space
1 parent 42de622 commit 99c27fe

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/parsers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ export const letter = (): Parser<string> => {
158158
*/
159159
export const space = (): Parser<string> => {
160160
return (ctx) => {
161-
return regex(/\s*/, "expected whitespace")(ctx);
161+
return regex(/\s+/, "expected whitespace")(ctx);
162162
};
163163
};
164164

tests/trie.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Deno.test("trie parser", () => {
1818
}),
1919
{
2020
success: true,
21-
ctx: { text: "Ronaldo, not a bad footballer", index: 7 },
21+
ctx: { text: "Ronaldo, not a bad footballer", index: 8 },
2222
}
2323
);
2424
});

0 commit comments

Comments
 (0)