def try_eval(self):
        """ Recursively evals the node. Returns None
        if it is still unresolved.
        """
        item = self.symbol.item

        if isinstance(item, int):
            return item

        if isinstance(item, Label):
            if item.defined:
                if isinstance(item.value, Expr):
                    return item.value.try_eval()
                else:
                    return item.value
            else:
                if Expr.ignore:
                    return None

                # Try to resolve into the global namespace
                error(self.symbol.lineno, "Undefined label '%s'" % item.name)
                return None

        try:
            if isinstance(item, tuple):
                return tuple([x.try_eval() for x in item])

            if isinstance(item, list):
                return [x.try_eval() for x in item]

            if item == '-' and len(self.children) == 1:
                return -self.left.try_eval()

            try:
                return self.funct[item](self.left.try_eval(), self.right.try_eval())
            except ZeroDivisionError:
                error(self.symbol.lineno, 'Division by 0')
            except KeyError:
                pass

        except TypeError:
            pass

        return None
def try_eval ( self ) : item = self . symbol . item if isinstance ( item , int ) : return item if isinstance ( item , Label ) : if item . defined : if isinstance ( item . value , Expr ) : return item . value . try_eval ( ) else : return item . value else : if Expr . ignore : return None error ( self . symbol . lineno , "Undefined label '%s'" % item . name ) return None try : if isinstance ( item , tuple ) : return tuple ( [ x . try_eval ( ) for x in item ] ) if isinstance ( item , list ) : return [ x . try_eval ( ) for x in item ] if item == '-' and len ( self . children ) == 1 : return - self . left . try_eval ( ) try : return self . funct [ item ] ( self . left . try_eval ( ) , self . right . try_eval ( ) ) except ZeroDivisionError : error ( self . symbol . lineno , 'Division by 0' ) except KeyError : pass except TypeError : pass return None
Recursively evals the node. Returns None
        if it is still unresolved.