javalang
javalang copied to clipboard
Checking if two trees are equal
I was wondering how to check if two trees are equal. There is an equals method in the Node class in ast.py but it does not check the entire hierarchy of the tree from root to leaf and does not handle cases when there are lists etc. Also, is there any way to return the raw unparsed string for a type or a method? If a raw string can be returned, it can easily be compared.
I believe the __equals__ method should be called __eq__ to do the trick..