baron
baron copied to clipboard
unindented comment breaks parsing
This isolated situation broke baron parsing, if the comment is indented everything is fine.
def a():
# stuff
pass
if __name__ == '__main__':
pass
Another case
try:
pass
except:
#
def a():
pass
I am still forced to remove all comments from code before parsing because wrongly indented comments break the parser. Could comment-only lines be tokenized as a whole, together with their initial space? This would probably fix the wrong indentation entirely.