Add type casting comparison to CompareTrees.

It can now resolve e.g. (string)llGetPermissions() == (string)llGetPermissions() to TRUE.
This commit is contained in:
Sei Lisa 2017-10-21 11:03:43 +02:00
parent dc117c2cbf
commit ea9711642c

View file

@ -163,6 +163,9 @@ class foldconst(object):
and all(self.CompareTrees(node1['ch'][i],
node2['ch'][i])
for i in xrange(len(node1['ch'])))
or node1['nt'] == node2['nt'] == 'CAST'
and node1['t'] == node2['t']
and self.CompareTrees(node1['ch'][0], node2['ch'][0])
)
def FoldStmt(self, parent, index):