yhirose / cpp-peglib

A single file C++ header-only PEG (Parsing Expression Grammars) library
MIT License
879 stars 112 forks source link

Expose a choice field for SemanticValues in dictionaries #291

Closed joankaradimov closed 5 months ago

joankaradimov commented 5 months ago

I notice that the Trie behaves more like a set and its match method returns the match length. Would it be viable to make it behave like a map with its match returning the choice index (that can be kept as an additional field in the Info struct).

I think that would make for a more consistent interface. And allow for more performant grammar handling in certain cases.

yhirose commented 5 months ago

Sounds good.