Request
Often times regex patterns share common subpatterns. Rewriting these can be error-prone, hard to maintain, and can result in a hard to read schema. Instead, it would be nice if variables in the schema could reference earlier variables. For example:
int:{0,1}\-\d+
wheel_speed:wheel_speed=<?speed>(\g<int>)
Possible implementation
When building the AST, if a \g<name> syntax is encountered, substitute the AST node with a copy of <name>'s AST.
Request
Often times regex patterns share common subpatterns. Rewriting these can be error-prone, hard to maintain, and can result in a hard to read schema. Instead, it would be nice if variables in the schema could reference earlier variables. For example:
Possible implementation
When building the AST, if a
\g<name>syntax is encountered, substitute the AST node with a copy of<name>'s AST.