Closed rrhg closed 2 years ago
Thank you for opening this issue. I've missed out that there can be multiple statements in one line. With the current version (0.1.2) it's possible to parse the code from your example
Thanks!. That was fast. I'll try again.
related to the subject https://github.com/t3rn0/ast-comments/issues/4#issue-1447534472
code = "a=1;b=1;print(a+b)"
no error ==>
tree = ast.parse(code)
error from ==>
tree = ast_comments.parse(code)
File "/home/.../ast_comments.py", line 39, in _enrich nodes = sorted([(x.lineno, x) for x in ast.walk(tree) if isinstance(x, ast.stmt)]) TypeError: '<' not supported between instances of 'Assign' and 'Assign'