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

make Comment attributes lineno, col_offset, end_lineno, end_col_offset printable #28

Closed kapulkin closed 6 months ago

kapulkin commented 7 months ago

dump() with include_attributes=True will print Comment attributes.

kapulkin commented 6 months ago

Oh, you are right, this was a copy-paste typo. Thank you, I applied your commit.

kapulkin commented 6 months ago

@t3rn0 check my branch https://github.com/kapulkin/ast-comments/tree/inline-comments-in-fields, please. I completely rewrote the algorithm to fix problem with inline comments overlap. Now comments can be stored not only inside blocks, but also as a comment field inside nodes.

I will be happy to any comments and bug reports.