Project

General

Profile

« Previous | Next » 

Revision 5346

sql.py: Added logic_op_re()

View differences:

lib/sql.py
1026 1026
false_re = paren_re(r'false')
1027 1027
bool_re = r'(?:'+true_re+r'|'+false_re+r')'
1028 1028

  
1029
def logic_op_re(op, value_re):
1030
    op_re = ' '+op+' '
1031
    return '(?:'+op_re+value_re+'|'+value_re+op_re+')'
1032

  
1029 1033
def simplify_expr(expr):
1030 1034
    expr = expr.replace('(NULL IS NULL)', 'true')
1031 1035
    expr = expr.replace('(NULL IS NOT NULL)', 'false')

Also available in: Unified diff