def Range(s1, s2=None):
 if s2:
  result = CodeRange(ord(s1), (ord(s2) + 1))
  result.str = ('Range(%s,%s)' % (s1, s2))
 else:
  ranges = []
  for i in range(0, len(s1), 2):
   ranges.append(CodeRange(ord(s1[i]), (ord(s1[(i + 1)]) + 1)))
  result = Alt(*ranges)
  result.str = ('Range(%s)' % repr(s1))
 return result

def Range ( s1 , s2 = None ) : if s2 : result = CodeRange ( ord ( s1 ) , ( ord ( s2 ) + 1 ) ) result . str = ( 'Range(%s,%s)' % ( s1 , s2 ) ) else : ranges = [ ] for i in range ( 0 , len ( s1 ) , 2 ) : ranges . append ( CodeRange ( ord ( s1 [ i ] ) , ( ord ( s1 [ ( i + 1 ) ] ) + 1 ) ) ) result = Alt ( * ranges ) result . str = ( 'Range(%s)' % repr ( s1 ) ) return result
range is an re which matches any single character in the range |c1| to |c2| inclusive .