openresty/sregex

Serialize AST

turbo opened this issue · 0 comments

turbo commented

I've been writing a project in Lua/OR and so far relied on a custom regex implementation in Lua-Land because I need access to the AST of parsed expressions. That's not possible with the PCRE bindings in OR. It seems like sregex is one step closer because parsing, compiling, and executing are different steps, with the parser returning "a pointer to the AST" according to the readme.

Is there a way to access that AST and serialize it (to JSON or similar) for further processing?