예제 #1
0
파일: rsre_char.py 프로젝트: njues/Sypy
def getlower(char_ord, flags):
    if flags & SRE_FLAG_LOCALE:
        if char_ord < 256:  # cheating!  Well, CPython does too.
            char_ord = tolower(char_ord)
        return char_ord
    elif flags & SRE_FLAG_UNICODE:
        assert unicodedb is not None
        char_ord = unicodedb.tolower(char_ord)
    else:
        if int_between(ord('A'), char_ord, ord('Z') + 1):  # ASCII lower
            char_ord += ord('a') - ord('A')
    return char_ord
예제 #2
0
파일: rsre_char.py 프로젝트: Debug-Orz/Sypy
def getlower(char_ord, flags):
    if flags & SRE_FLAG_LOCALE:
        if char_ord < 256:      # cheating!  Well, CPython does too.
            char_ord = tolower(char_ord)
        return char_ord
    elif flags & SRE_FLAG_UNICODE:
        assert unicodedb is not None
        char_ord = unicodedb.tolower(char_ord)
    else:
        if int_between(ord('A'), char_ord, ord('Z') + 1):   # ASCII lower
            char_ord += ord('a') - ord('A')
    return char_ord
예제 #3
0
파일: test_rint.py 프로젝트: ieure/pypy
 def fn(a, b, c):
     return int_between(a, b, c)
예제 #4
0
파일: rsre_char.py 프로젝트: Debug-Orz/Sypy
def is_space(code):
    return (code == 32) | int_between(9, code, 14)
예제 #5
0
파일: rsre_char.py 프로젝트: Debug-Orz/Sypy
def is_digit(code):
    return int_between(48, code, 58)
예제 #6
0
파일: rsre_char.py 프로젝트: Debug-Orz/Sypy
def set_range(pat, index, char_code):
    # <RANGE> <lower> <upper>
    match = int_between(pat[index+1], char_code, pat[index+2] + 1)
    return match, index + 3
예제 #7
0
파일: rsre_char.py 프로젝트: njues/Sypy
def is_space(code):
    return (code == 32) | int_between(9, code, 14)
예제 #8
0
파일: rsre_char.py 프로젝트: njues/Sypy
def is_digit(code):
    return int_between(48, code, 58)
예제 #9
0
파일: rsre_char.py 프로젝트: njues/Sypy
def set_range(pat, index, char_code):
    # <RANGE> <lower> <upper>
    match = int_between(pat[index + 1], char_code, pat[index + 2] + 1)
    return match, index + 3
예제 #10
0
 def fn(a, b, c):
     return int_between(a, b, c)