t3rn0 / ast-comments

Extension to the built-in ast module. Finds comments in source code and adds them to the parsed tree.
MIT License
31 stars 10 forks source link

unparse tree with comments #8

Closed t3rn0 closed 1 year ago

t3rn0 commented 1 year ago

I decided to drop the idea that comments somehow depend on "real" AST nodes. So there are no more comments attributes in nodes. Instead I added separate Comment node type. Same as any other AST node it inherits from AST and can be stored and manipulated accordingly