Currently, I am trying to choose some parser library.
pom looks nice due to lack of "macros hell" compared to nom.
I guess you feel the same :)
However, I have one requirement which spoils all nice code - I must create parsed values inside special allocator/arena object. Thus I need to be able to access it within each and every function returning Parser struct. I guess it's something Serde calls "stateful serialization".
The easiest way to do that is to embed another generic struct field within Parser which would be accessible everywhere somehow - provide additional Parser reference in all combinators or stuff like that. Currently I see no other way to do that but to fork/branch "pom" and thread additional parameter through each combinator.
Could you suggest any other way to avoid forking?
BR
Hi
Currently, I am trying to choose some parser library. pom looks nice due to lack of "macros hell" compared to nom. I guess you feel the same :)
However, I have one requirement which spoils all nice code - I must create parsed values inside special allocator/arena object. Thus I need to be able to access it within each and every function returning Parser struct. I guess it's something Serde calls "stateful serialization".
The easiest way to do that is to embed another generic struct field within Parser which would be accessible everywhere somehow - provide additional Parser reference in all combinators or stuff like that. Currently I see no other way to do that but to fork/branch "pom" and thread additional parameter through each combinator.
Could you suggest any other way to avoid forking? BR