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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

RegExpVisitor class is not exported #12

Open
bd82 opened this issue Sep 11, 2020 · 2 comments 路 May be fixed by #13
Open

RegExpVisitor class is not exported #12

bd82 opened this issue Sep 11, 2020 · 2 comments 路 May be fixed by #13

Comments

@bd82
Copy link

bd82 commented Sep 11, 2020

Hello and thanks for this library 馃憤

It seems the RegExp visitor class is not exported at runtime.
However the documentation seems to imply it is.

regexpp/src/index.ts

Lines 1 to 6 in 4bcab0b

import * as AST from "./ast"
import { RegExpParser } from "./parser"
import { RegExpValidator } from "./validator"
import { RegExpVisitor } from "./visitor"
export { AST, RegExpParser, RegExpValidator }

I need the class itself to be exposed in order to modify the traversal, e.g:

  • Halt the traversal when something has been detected.
  • Avoid traversing certain sub-nodes of the AST.

Cheers.
Shahar.

bd82 added a commit to bd82/regexpp that referenced this issue Sep 11, 2020
Also changed the built in visitor methods signature to `protected`
to enable customizing sub-visitor flows by overriding.

fixes mysticatea#12
@bd82 bd82 linked a pull request Sep 11, 2020 that will close this issue
@connor4312
Copy link

馃憤 would love to see this. In VS Code we cannot import submodules, so I republished a version with this fix for now.

@MichaelDeBoey
Copy link

Hi @bd82!

Since this repo is unmaintained, you might want to re-open this issue in the @eslint-community fork https://github.com/eslint-community/regexpp

For more info about why we created this organization, you can read https://eslint.org/blog/2023/03/announcing-eslint-community-org

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants