Project

General

Profile

« Previous | Next » 

Revision 5354

sql.py: simplify_parens(): Also remove parens around true and false

View differences:

sql.py
1032 1032
    return '(?:'+op_re+value_re+'|'+value_re+op_re+')'
1033 1033

  
1034 1034
def simplify_parens(expr):
1035
    return regexp.sub_nested(r'\((\([^()]*\))\)', r'\1', expr)
1035
    return regexp.sub_nested(r'\((true|false|\([^()]*\))\)', r'\1', expr)
1036 1036

  
1037 1037
def simplify_expr(expr):
1038 1038
    expr = expr.replace('(NULL IS NULL)', 'true')

Also available in: Unified diff