superpower icon indicating copy to clipboard operation
superpower copied to clipboard

A C# parser construction toolkit with high-quality error reporting

Results 14 superpower issues
Sort by recently updated
recently updated
newest added

This is a PR to fix #88. It is likely that custom tokenizers need to set Result.Backtrack, this PR adds a constructor that makes it possible to set this property...

To cleanly support defaulting optional reference type parsers to `null` I believe we need something like: ```csharp public static TokenListParser OptionalOrNull( this TokenListParser parser) where T: notnull { return parser...

enhancement
up-for-grabs

In Sprache, you provided `IPositionAware` and `Positioned` to make a parse result, well, aware of the position it’s parsed. I see this feature useful for giving a precise position of...

enhancement
up-for-grabs

There's a nice introductory blog at [here](https://nblumhardt.com/2016/09/superpower/). While very nice, it's written in 2016, and targeting v1 (it seems). It seems much has changed and improved after a few years,...

Motivation: Best practices recommend implementing an "IEquatable" interface for custom structs. This improves the performance of comparison operations and eliminates boxing.

Consider that at a certain point during parsing I know that the parsing is not going to succeed. E.g. parser A matched (so I know that alternatives like C and...

help-wanted

I have tried to build an alternative tokenizer, based on the TokenizerBuilder in this repo. I hit a problem where the code for TokenizerBuilder uses Result.Backtrack - this is an...

enhancement

I am pre-parsing some text to extract the parts I need to parse, and don't want to allocate more than necessary. For this reason it would be nice to be...

discussion

Sprache had a Text() combinator that was basically a shorthand for .Select(cs=>new string(cs)) on a Parser. Would it be useful to re-introduce this in Superpower, also using it on TextParser?...

enhancement
up-for-grabs

The Serilog parser has two extension methods SelectCatch(,,string error message) that does a select, but if that select throws, instead results in an error with the given message. I think...

enhancement