3 ms·
This is actually very nice. The documentation is also well done. I might try it for some personal projects. Not sure if the OP is the author, but here are a fe
by gpderetta 5y ago
This is actually very nice. The documentation is also well done. I might try it for some personal projects.
Not sure if the OP is the author, but here are a few comments from someone with no experience in parsing:
- For the documentation, it would be better if it didn't use using namespace, as it make it easier to see which symbols are part of the library and which ones are part of the example.
- There's need to be a note about the lifetime of the buffer under referenced by the string_view parameters. I assume this is just the original buffer passed to parse, but it would be better to be explicit. Also, string_views are probably better passed around by value (the examples are inconsistent).
- The documentation probably need more details about handling parsing errors. Also is there any way to recover from a failed parse?
- It would be nice that a parser with no action could be used to validate a string against a grammar, but it seems that the implicit actions would
prevent that.
- (Very minor) val should probably be called always, and create should just be always with an explicit template parameter and a defaulted argument.
- (Again, very minor) making create, push_back and emplace_back inline variables (available in C++17) instead of types would lead to a slightly more pleasant syntax.
- peter-winter 5y agoYes OP (me) is the author. Thanks for the kind words:) I will consider your suggestions. As for the eror recovery, the newest version has error recovery feature.
- gpderetta 5y agoThank you. I'll try give this a go and report my experience. Are you using this in production at $JOB or is it just a personal project?
- peter-winter 5y agoPersonal. But would galdly use it in production if given opportunity.