javalang icon indicating copy to clipboard operation
javalang copied to clipboard

Checking if two trees are equal

Open joshio1 opened this issue 8 years ago • 1 comments

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.

joshio1 avatar May 23 '17 18:05 joshio1

I believe the __equals__ method should be called __eq__ to do the trick..

DerBaer0 avatar May 09 '18 08:05 DerBaer0