gcanti / gcanti/parser-ts

Combination of alt and many runs infinitely

Open
#58 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
196
Forks
19
PR merge metrics
No merged PRs in 30d

Description

```
const keyword = C.many1(C.notSpace);
const whitespace = S.spaces;

const lang = pipe(
keyword,
P.alt(() => whitespace)
);

const input = `hello world mickey mouse`;
const res = run(P.many(lang), input);
```

expectation: `['hello', ' ', 'word', ' ', 'mickey', ' ' ,'mouse']`
actual: runs forever...

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.