Whiteknight / ParserObjects

C# library for parser combinators
https://whiteknight.github.io/ParserObjects
Apache License 2.0
6 stars 0 forks source link

Non-Greedy List Parser #175

Closed Whiteknight closed 1 year ago

Whiteknight commented 1 year ago

Current list parser tries to read as many instances of the match as possible. However, a non-greedy would take both a match parser and a continuation parser and attempt to invoke the continuation parser first before attempting to consume another instance of the match parser.

Consider whether this would be a valuable addition or not.

Whiteknight commented 1 year ago

I have an initial implementation in a branch. Along the way I think I am also going to make some changes to LimitedListParser and SeparatedList() (and also add a SeparatedNonGreedyList()) if I can't think of a less-verbose name)

Whiteknight commented 1 year ago

This is done and merged into v5, along with some changes to List. I'm closing this issue, we will deal with more details (test coverage, code improvement, etc) later.