Description
Hi all,
I've created a fork which adds completion support to the library, which allows providing as-you-type autocomplete or TAB-completion experiences: https://github.com/jchapuis/scala-parser-combinators.git
In a nutshell, additions are:
def completions(in: Input): Completions
method which allows querying the list of possible completions for a certain input. This returns a structured type which can contain tagged and ranked completions.- implementations of this method for all the combinators
- a new set of operators which allows tagging and ranking elements of the grammar
I have also implemented fuzzy matching completion parsers which are not present in the fork right now but that I could potentially integrate.
Would you consider this as a possible PR? It's of course extending the "traditional" functionality of parser combinators, so it add extra complexity and testing requirements that are maybe not desirable for the core library. At any rate I'm creating this issue also to to point out that building completion experiences using parser-combinators is feasible and actually works well with the functional nature of these grammars.