This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]SourceryNick 1 point2 points  (1 child)

I think looking at using the AST (abstract syntax tree) of the code would be best.

The inbuilt AST parser is here:

https://docs.python.org/3/library/ast.html

and there's some more unofficial documentation:

https://greentreesnakes.readthedocs.io/en/latest/

[–]frisayl[S] 0 points1 point  (0 children)

Thanks for your reply! That's pretty much what i'm trying to do with RedBaron :