Did I find the right examples for you? yes no

All Samples(54)  |  Call(48)  |  Derive(0)  |  Import(6)
AnyBut(s) is an RE which matches any character (including
newline) which is not in the string |s|.

        def AnyBut(s):
    """
    AnyBut(s) is an RE which matches any character (including
    newline) which is not in the string |s|.
    """
    ranges = chars_to_ranges(s)
    ranges.insert(0, -maxint)
    ranges.append(maxint)
    result = CodeRanges(ranges)
    result.str = "AnyBut(%s)" % repr(s)
    return result
        


src/e/s/essig-HEAD/vm/cython/Cython/Compiler/Lexicon.py   essig(Download)
def make_lexicon():
    from Cython.Plex import \
        Str, Any, AnyBut, AnyChar, Rep, Rep1, Opt, Bol, Eol, Eof, \
        TEXT, IGNORE, State, Lexicon
    from Scanning import Method
    sq_string = (
        Str("'") + 
        Rep(AnyBut("\\\n'") | (Str("\\") + AnyChar)) + 
        Str("'")
    )
 
    dq_string = (
        Str('"') + 
        Rep(AnyBut('\\\n"') | (Str("\\") + AnyChar)) + 
    )
 
    non_sq = AnyBut("'") | (Str('\\') + AnyChar)
    tsq_string = (
        Str("'''")
        + Rep(non_sq | (Str("'") + non_sq) | (Str("''") + non_sq)) 
        + Str("'''")
    )
 
    non_dq = AnyBut('"') | (Str('\\') + AnyChar)

src/p/l/plexnet-HEAD/third_party/python/Cython/Compiler/Lexicon.py   plexnet(Download)
def make_lexicon():
    from Cython.Plex import \
        Str, Any, AnyBut, AnyChar, Rep, Rep1, Opt, Bol, Eol, Eof, \
        TEXT, IGNORE, State, Lexicon
    from Scanning import Method
    sq_string = (
        Str("'") + 
        Rep(AnyBut("\\\n'") | (Str("\\") + AnyChar)) + 
        Str("'")
    )
 
    dq_string = (
        Str('"') + 
        Rep(AnyBut('\\\n"') | (Str("\\") + AnyChar)) + 
    )
 
    non_sq = AnyBut("'") | (Str('\\') + AnyChar)
    tsq_string = (
        Str("'''")
        + Rep(non_sq | (Str("'") + non_sq) | (Str("''") + non_sq)) 
        + Str("'''")
    )
 
    non_dq = AnyBut('"') | (Str('\\') + AnyChar)

src/p/y/pylibs-HEAD/Cython/Compiler/Lexicon.py   pylibs(Download)
def make_lexicon():
    from Cython.Plex import \
        Str, Any, AnyBut, AnyChar, Rep, Rep1, Opt, Bol, Eol, Eof, \
        TEXT, IGNORE, State, Lexicon
    from Scanning import Method
    sq_string = (
        Str("'") + 
        Rep(AnyBut("\\\n'") | (Str("\\") + AnyChar)) + 
        Str("'")
    )
 
    dq_string = (
        Str('"') + 
        Rep(AnyBut('\\\n"') | (Str("\\") + AnyChar)) + 
    )
 
    non_sq = AnyBut("'") | (Str('\\') + AnyChar)
    tsq_string = (
        Str("'''")
        + Rep(non_sq | (Str("'") + non_sq) | (Str("''") + non_sq)) 
        + Str("'''")
    )
 
    non_dq = AnyBut('"') | (Str('\\') + AnyChar)

src/c/y/CythonCTypesBackend-HEAD/Cython/Compiler/Lexicon.py   CythonCTypesBackend(Download)
def make_lexicon():
    from Cython.Plex import \
        Str, Any, AnyBut, AnyChar, Rep, Rep1, Opt, Bol, Eol, Eof, \
        TEXT, IGNORE, State, Lexicon
    from Scanning import Method
    sq_string = (
        Str("'") +
        Rep(AnyBut("\\\n'") | (Str("\\") + AnyChar)) +
        Str("'")
    )
 
    dq_string = (
        Str('"') +
        Rep(AnyBut('\\\n"') | (Str("\\") + AnyChar)) +
    )
 
    non_sq = AnyBut("'") | (Str('\\') + AnyChar)
    tsq_string = (
        Str("'''")
        + Rep(non_sq | (Str("'") + non_sq) | (Str("''") + non_sq))
        + Str("'''")
    )
 
    non_dq = AnyBut('"') | (Str('\\') + AnyChar)

src/c/y/cython-HEAD/Cython/Compiler/Lexicon.py   cython(Download)
def make_lexicon():
    from Cython.Plex import \
        Str, Any, AnyBut, AnyChar, Rep, Rep1, Opt, Bol, Eol, Eof, \
        TEXT, IGNORE, State, Lexicon
    from Scanning import Method
    four_hex = two_hex + two_hex
    escapeseq = Str("\\") + (two_oct | three_oct |
                             Str('N{') + Rep(AnyBut('}')) + Str('}') |
                             Str('u') + four_hex | Str('x') + two_hex |
                             Str('U') + four_hex + four_hex | AnyChar)
    lineterm = Eol + Opt(Str("\n"))
 
    comment = Str("#") + Rep(AnyBut("\n"))
 
    return Lexicon([
        State('SQ_STRING', [
            (escapeseq, 'ESCAPE'),
            (Rep1(AnyBut("'\"\n\\")), 'CHARS'),
            (Str('"'), 'CHARS'),
            (Str("\n"), Method('unclosed_string_action')),
        State('DQ_STRING', [
            (escapeseq, 'ESCAPE'),
            (Rep1(AnyBut('"\n\\')), 'CHARS'),
            (Str("'"), 'CHARS'),
            (Str("\n"), Method('unclosed_string_action')),

src/c/y/Cython-0.20.1/Cython/Compiler/Lexicon.py   Cython(Download)
def make_lexicon():
    from Cython.Plex import \
        Str, Any, AnyBut, AnyChar, Rep, Rep1, Opt, Bol, Eol, Eof, \
        TEXT, IGNORE, State, Lexicon
    from Scanning import Method
    four_hex = two_hex + two_hex
    escapeseq = Str("\\") + (two_oct | three_oct |
                             Str('N{') + Rep(AnyBut('}')) + Str('}') |
                             Str('u') + four_hex | Str('x') + two_hex |
                             Str('U') + four_hex + four_hex | AnyChar)
    lineterm = Eol + Opt(Str("\n"))
 
    comment = Str("#") + Rep(AnyBut("\n"))
 
    return Lexicon([
        State('SQ_STRING', [
            (escapeseq, 'ESCAPE'),
            (Rep1(AnyBut("'\"\n\\")), 'CHARS'),
            (Str('"'), 'CHARS'),
            (Str("\n"), Method('unclosed_string_action')),
        State('DQ_STRING', [
            (escapeseq, 'ESCAPE'),
            (Rep1(AnyBut('"\n\\')), 'CHARS'),
            (Str("'"), 'CHARS'),
            (Str("\n"), Method('unclosed_string_action')),