Closed t3rn0 closed 1 year ago
Let's say we have code
>>> source = """a = 1; b = 2 # some comment""" >>> ast.dump(ast.parse(source)) "Module(body=[Assign(targets=[Name(id='a', ctx=Store())], value=Constant(value=1, kind=None), type_comment=None), Assign(targets=[Name(id='b', ctx=Store())], value=Constant(value=2, kind=None), type_comment=None)], type_ignores=[])" >>> >>> astcom.dump(astcom.parse(source)) >>> "Module(body=[Assign(targets=[Name(id='a', ctx=Store())], value=Constant(value=1, kind=None), type_comment=None, comments=('some comment',)), Assign(targets=[Name(id='b', ctx=Store())], value=Constant(value=2, kind=None), type_comment=None, comments=())], type_ignores=[])"
Parsed tree has two nodes. Which node do we want to place the comment on? To "a"-part? To "b"-part? To both?
With the current version (0.1.2) the comment goes to "a"-part but I don't think it's the right choice
Let's say we have code
Parsed tree has two nodes. Which node do we want to place the comment on? To "a"-part? To "b"-part? To both?
With the current version (0.1.2) the comment goes to "a"-part but I don't think it's the right choice