gvergnaud / hotscript

A library of composable functions for the type-level! Transform your TypeScript types in any way you want using functions you already know.
3.51k stars 59 forks source link

feat(parser): add parser combinators #78

Open ecyrbe opened 1 year ago

ecyrbe commented 1 year ago

This is a Combinator Parser with a lot of goodies:

About recursive parsers (resolved) we get recursive too deep and probably infinite error. i only see trampolines as a workaround. This means complexify a lot the library. Because this implies returning a `ParserFn` in the composed parsers and calling those in a loop. ### solution was simply to remove `ParserFn` constraint

Combinators in this PR: