flatparse icon indicating copy to clipboard operation
flatparse copied to clipboard

Restructure modules

Open AndrasKovacs opened this issue 4 years ago • 1 comments

Currently the two module flavors, FlatParse.Basic and FlatParse.Stateful are mostly just plain copies of each other with some differences. The duplication of TH code is especially bad. Suggestion:

Put implementations in Internal modules. Have plain non-Internal modules for exporting stuff. There should be just a single TH implementation which is somehow generic over the module flavor. Perhaps a class could be used for TH dispatch (fortunately, potential class overhead in TH does not yield runtime overhead).

Also, export functions which allow embedding Stateful parsers into Basic ones and the other way around. This is also more convenient with the internal modules.

AndrasKovacs avatar Mar 15 '21 21:03 AndrasKovacs

Note: the actual code generation part of the TH code is still duplicated, but the switch trie is now de-duplicated in Internal, as well as a bunch of other functions.

AndrasKovacs avatar Oct 16 '21 12:10 AndrasKovacs

This is one is now obsoleted by various reorganizations.

AndrasKovacs avatar Feb 06 '23 17:02 AndrasKovacs