tree-hugger icon indicating copy to clipboard operation
tree-hugger copied to clipboard

Add a factory function to generate the proper paerser object

Open rcshubhadeep opened this issue 4 years ago • 0 comments

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 avatar Nov 04 '20 18:11 rcshubhadeep