From ea9711642c055338f103777b12837383bbc673bf Mon Sep 17 00:00:00 2001 From: Sei Lisa Date: Sat, 21 Oct 2017 11:03:43 +0200 Subject: [PATCH] Add type casting comparison to CompareTrees. It can now resolve e.g. (string)llGetPermissions() == (string)llGetPermissions() to TRUE. --- lslopt/lslfoldconst.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lslopt/lslfoldconst.py b/lslopt/lslfoldconst.py index 0f20ce8..6353083 100644 --- a/lslopt/lslfoldconst.py +++ b/lslopt/lslfoldconst.py @@ -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):