-
Notifications
You must be signed in to change notification settings - Fork 19
Home
GregRos edited this page Mar 26, 2025
·
8 revisions
This is a development resource for Parjs v2, which is gearing towards a major redesign of the library. Some stuff isn't fully fleshed out -- but most of it is there.
v2 comes with more than a few lofty goals. You can read more about how those goals will be achieved here. That said, this isn’t really documentation, so none of it is final.
- Overall more functionality to parse different expressions.
- Hierarchical grouping of functionality new API concepts — 🛠️️tuners and 🚀boosters
- More powerful and yet more concise
- Parsers such as
manyTill
won’t discard their results entirely; they will still be accessible. - Better handling of user state.
- Engine-level optimizations
- Reducing total number of function calls by simplifying the parse tree
- Lazy loading
- A separate character parsing API that uses dedicated data structures.
- Parsing characters outside the BMP, such as some CJK ideograms and emoji.
- Constructing character parsers that rely on Unicode character properties.
- A more concise API that’s easier to navigate:
- Similat but simplified failure tiers.
- Exception-like model with distinct failure reasons with more control over recovery.
- Trace data will be more readable and there will be much more of it
- Support for nested and composite failure states.
- Using the darkest black magic of the TypeScript type system.
- Providing completion and validation of things other parsing tools can only dream of.
- Type definitions are part of the code and so will be tested accordingly
- More readable debugging information, and more of it
- Using stack traces to link parsers to your code at the point of definition! Just like a proper stack trace!
- Customizable parser labels.
- Combinators that can be used to set breakpoints during the parsing process.
- Better insight into the workings of the library (partially through this development resource)
- Documentation about writing custom parsers.
- A dedicated docs site with its own theme and stuff at https://parjs.org.
- More complete documentation about each parser and combinator.