How to get lineno of “end-of-statement” in Python ast
问题 I am trying to work on a script that manipulates another script in Python, the script to be modified has structure like: class SomethingRecord(Record): description = 'This records something' author = 'john smith' I use ast to locate the description line number, and I use some code to change the original file with new description string base on the line number. So far so good. Now the only issue is description occasionally is a multi-line string, e.g. description = ('line 1' 'line 2' 'line 3')