parser-ts
parser-ts copied to clipboard
String parser combinators for TypeScript
## π Feature request Firstly, great work on this lib and `fp-ts` in general. Definitely has changed the way I think about writing software big time. Secondly, why I'm here,...
I would like to use `parser-ts` to parse PromQL of which formal definition may be found below, 1. https://github.com/prometheus/prometheus/blob/main/promql/parser/generated_parser.y.go 2. https://github.com/prometheus/lezer-promql/blob/main/src/promql.grammar You may notice that the `BinaryExpr` will recursively check...
## π Bug report ### Current Behavior I am trying to build ECMAScript modules (ESM) that is supported by TypeScript nightly build. https://devblogs.microsoft.com/typescript/announcing-typescript-4-5-beta/ `tsc` fails in *.mts (new source file...
This is a bit of a "big" PR, so I can split it if necessary. After going through the entire library for educational purposes, I have came about many things...
Take a look at the following test (which currently fails): ```typescript const fatalParser: P.Parser = i => error(i, ['expected'], true) const parser5 = P.either(C.char('a'), () => fatalParser) assert.deepStrictEqual(S.run('c')(parser5), error(stream(['c']), ['"a"',...
## π Documentation Hello. I noticed that most of the examples uses the run function, that in turn requires babel code-frame. Can babel code frame be avoided? My parser is...
## π Feature request ### Current Behavior Currently there is no hexadecimal digit combinator available in `parser-ts/char`. ### Desired Behavior The "core" library export a `hexDigit` combinator since it's quite...
``` 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);...