Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(regular_expression): implement visitor pattern trait for regex AST #6055

Commits on Sep 26, 2024

  1. feat(regular_expression): implement visitor pattern trait for regex A…

    …ST (#6055)
    
    - resolves #5977
    - supersedes #5951
    
    To facilitate easier traversal of the Regex AST, this PR defines a `Visit` trait with default implementations that will walk the entirety of the Regex AST. Methods in the `Visit` trait can be overridden with custom implementations to do things like analyzing only certain nodes in a regular expression, which will be useful for regex-related `oxc_linter` rules.
    
    In the future, we should consider automatically generating this code as it is very repetitive, but for now a handwritten visitor is sufficient.
    camchenry committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    7764793 View commit details
    Browse the repository at this point in the history