Skip to content

Add a factory function to generate the proper paerser object #41

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

Open
rcshubhadeep opened this issue Nov 4, 2020 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@rcshubhadeep
Copy link
Contributor

As an alternative to doing this

from tree_hugger.core import PythonParser

pp = PythonParser()

We also suggest having something like this

from tree_hugger.language_factory import get_parser

pp = get_parser('Python')

As most of the parsers expose a very similar API so having a factory makes sense in this regard.

@rcshubhadeep rcshubhadeep added the enhancement New feature or request label Nov 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant