Skip to content

feat: Support references to variables defined earlier in the schema. #191

@SharafMohamed

Description

@SharafMohamed

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions