def convert_unary(unary):
    if hasattr(unary, 'unary'):
        nested_unary = unary.unary()
    else:
        nested_unary = unary.unary_nofunc()
    if hasattr(unary, 'postfix_nofunc'):
        first = unary.postfix()
        tail = unary.postfix_nofunc()
        postfix = ([first] + tail)
    else:
        postfix = unary.postfix()
    if unary.ADD():
        return convert_unary(nested_unary)
    elif unary.SUB():
        tmp_convert_nested_unary = convert_unary(nested_unary)
        if tmp_convert_nested_unary.is_Matrix:
            return mat_mul_flat((- 1), tmp_convert_nested_unary, evaluate=False)
        elif tmp_convert_nested_unary.func.is_Number:
            return (- tmp_convert_nested_unary)
        else:
            return mul_flat((- 1), tmp_convert_nested_unary)
    elif postfix:
        return convert_postfix_list(postfix)
def convert_unary(unary):
    if hasattr(unary, 'unary'):
        nested_unary = unary.unary()
    else:
        nested_unary = unary.unary_nofunc()
    if hasattr(unary, 'postfix_nofunc'):
        first = unary.postfix()
        tail = unary.postfix_nofunc()
        postfix = ([first] + tail)
    else:
        postfix = unary.postfix()
    if unary.ADD():
        return convert_unary(nested_unary)
    elif unary.SUB():
        tmp_convert_nested_unary = convert_unary(nested_unary)
        if tmp_convert_nested_unary.is_Matrix:
            return mat_mul_flat((- 1), tmp_convert_nested_unary, evaluate=False)
        elif tmp_convert_nested_unary.func.is_Number:
            return (- tmp_convert_nested_unary)
        else:
            return mul_flat((- 1), tmp_convert_nested_unary)
    elif postfix:
        return convert_postfix_list(postfix)