baron
baron copied to clipboard
IDE allow you to refactor code, Baron allows you to write refactoring code.
The following code... ``` import redbaron rb = redbaron.RedBaron('func = print if True else print') print(rb.dumps()) ``` ...produces the following output: ``` func = printif True else print ``` Note...
The following code fails with a `ParsingError`: ``` from redbaron import RedBaron text = ''' if True: pass elif True: pass else: pass ''' RedBaron(text) ``` The python interpreter parses...
[PEP-570](https://www.python.org/dev/peps/pep-0570/) adds support for positional-only arguments. Baron seem to support keyword-only arguments, as shown in `test_case_1` below, which is represented by a `kwargs_only_marker` node. Following this convention i propose creating...
https://www.python.org/dev/peps/pep-0448/
This is a very quick change to provide for rendering structures that are missing nonimportant keys. It simply skips them. A change to provide default values for keys might be...
When we add one or more spaces at the starting of the expression string, the code is breaking. This is syntactically valid. No idea why is it failing. ``` from...
Looks like the grammar needs to be upgraded.
I am getting an extra \n when parsing a class definition: `In [61]: baron.parse("class C:\n pass") Out[61]: [{'decorators': [], 'fifth_formatting': [], 'first_formatting': [{'type': 'space', 'value': ' '}], 'fourth_formatting': [], 'inherit_from':...
Hello. It would be helpful for one of my usecases of baron if it supported non ascii identifiers. Currently (in 0.6.6 but probably also in the latest master) the following...
Baron only supports [PEP-3132](https://www.python.org/dev/peps/pep-3132/) extended unpacking in assignment context, ie. it can parse `a, *b = xs` etc This syntax also valid in various other contexts. For example, for-loop context:...