Did I find the right examples for you? yes no

All Samples(11)  |  Call(0)  |  Derive(0)  |  Import(11)

src/s/y/Sypy-HEAD/jit/backend/llgraph/llimpl.py   Sypy(Download)
def do_unicodelen(string):
    uni = lltype.cast_opaque_ptr(lltype.Ptr(rstr.UNICODE), string)
    return len(uni.chars)
 
def do_unicodegetitem(string, index):
    uni = lltype.cast_opaque_ptr(lltype.Ptr(rstr.UNICODE), string)
def do_unicodesetitem(string, index, newvalue):
    uni = lltype.cast_opaque_ptr(lltype.Ptr(rstr.UNICODE), string)
    uni.chars[index] = unichr(newvalue)
 
def do_copystrcontent(src, dst, srcstart, dststart, length):
def do_copyunicodecontent(src, dst, srcstart, dststart, length):
    src = lltype.cast_opaque_ptr(lltype.Ptr(rstr.UNICODE), src)
    dst = lltype.cast_opaque_ptr(lltype.Ptr(rstr.UNICODE), dst)
    assert 0 <= srcstart <= srcstart + length <= len(src.chars)
    assert 0 <= dststart <= dststart + length <= len(dst.chars)

src/p/l/plexnet-HEAD/third_party/generic/pypy/pypy/rpython/lltypesystem/rbuilder.py   plexnet(Download)
 
from pypy.rpython.rbuilder import AbstractStringBuilderRepr
from pypy.rpython.lltypesystem import lltype
from pypy.rpython.lltypesystem.rstr import STR, UNICODE, char_repr,\
     string_repr, unichar_repr, unicode_repr
                                 ('allocated', lltype.Signed),
                                 ('used', lltype.Signed),
                                 ('buf', lltype.Ptr(UNICODE)),
                                 adtmeths={'grow':staticAdtMethod(unicodebuilder_grow)})
 
class UnicodeBuilderRepr(BaseStringBuilderRepr):
    lowleveltype = lltype.Ptr(UNICODEBUILDER)
    basetp = UNICODE
    string_repr = unicode_repr
    char_repr = unichar_repr

src/s/y/Sypy-HEAD/jit/backend/llsupport/llmodel.py   Sypy(Download)
    def bh_unicodelen(self, string):
        u = lltype.cast_opaque_ptr(lltype.Ptr(rstr.UNICODE), string)
        return len(u.chars)
 
    def bh_strgetitem(self, string, index):
        s = lltype.cast_opaque_ptr(lltype.Ptr(rstr.STR), string)
        return ord(s.chars[index])
 
    def bh_unicodegetitem(self, string, index):
        u = lltype.cast_opaque_ptr(lltype.Ptr(rstr.UNICODE), string)
    def bh_unicodesetitem(self, string, index, newvalue):
        u = lltype.cast_opaque_ptr(lltype.Ptr(rstr.UNICODE), string)
        u.chars[index] = unichr(newvalue)
 
    def bh_copystrcontent(self, src, dst, srcstart, dststart, length):
    def bh_copyunicodecontent(self, src, dst, srcstart, dststart, length):
        src = lltype.cast_opaque_ptr(lltype.Ptr(rstr.UNICODE), src)
        dst = lltype.cast_opaque_ptr(lltype.Ptr(rstr.UNICODE), dst)
        rstr.copy_unicode_contents(src, dst, srcstart, dststart, length)
 

src/s/y/Sypy-HEAD/rpython/lltypesystem/rbuilder.py   Sypy(Download)
from pypy.rpython.lltypesystem import lltype, rstr
from pypy.rpython.lltypesystem.lltype import staticAdtMethod, nullptr
from pypy.rpython.lltypesystem.rstr import (STR, UNICODE, char_repr,
    string_repr, unichar_repr, unicode_repr)
from pypy.rpython.rbuilder import AbstractStringBuilderRepr
                                 ('allocated', lltype.Signed),
                                 ('used', lltype.Signed),
                                 ('buf', lltype.Ptr(UNICODE)),
                              adtmeths={'grow':staticAdtMethod(unicodebuilder_grow)})
 
class UnicodeBuilderRepr(BaseStringBuilderRepr):
    lowleveltype = lltype.Ptr(UNICODEBUILDER)
    basetp = UNICODE
    mallocfn = staticmethod(rstr.mallocunicode)
    string_repr = unicode_repr

src/s/y/Sypy-HEAD/rpython/annlowlevel.py   Sypy(Download)
    def llstr(s):
        from pypy.rpython.lltypesystem.rstr import mallocstr, mallocunicode
        from pypy.rpython.lltypesystem.rstr import STR, UNICODE
        if strtype is str:
            if s is None:
                return lltype.nullptr(STR)
            ll_s = mallocstr(len(s))
        else:
            if s is None:
                return lltype.nullptr(UNICODE)
        def compute_result_annotation(self, s_str):
            from pypy.rpython.lltypesystem.rstr import STR, UNICODE
            if strtype is str:
                return annmodel.lltype_to_annotation(lltype.Ptr(STR))
            else:
                return annmodel.lltype_to_annotation(lltype.Ptr(UNICODE))

src/p/l/plexnet-HEAD/third_party/generic/pypy/pypy/rpython/module/support.py   plexnet(Download)
    def to_runicode(s):
        from pypy.rpython.lltypesystem.rstr import UNICODE, mallocunicode
        if s is None:
            return lltype.nullptr(UNICODE)
        p = mallocunicode(len(s))

src/p/l/plexnet-HEAD/third_party/generic/pypy/pypy/rpython/annlowlevel.py   plexnet(Download)
        def compute_result_annotation(self, s_str):
            from pypy.rpython.lltypesystem.rstr import STR, UNICODE
            if strtype is str:
                return annmodel.lltype_to_annotation(lltype.Ptr(STR))
            else:
                return annmodel.lltype_to_annotation(lltype.Ptr(UNICODE))

src/s/y/Sypy-HEAD/rpython/module/support.py   Sypy(Download)
    def to_runicode(s):
        from pypy.rpython.lltypesystem.rstr import UNICODE, mallocunicode
        if s is None:
            return lltype.nullptr(UNICODE)
        p = mallocunicode(len(s))

src/p/l/plexnet-HEAD/third_party/generic/pypy/pypy/jit/backend/llgraph/llimpl.py   plexnet(Download)
def do_unicodelen(_, string):
    uni = lltype.cast_opaque_ptr(lltype.Ptr(rstr.UNICODE), string)
    return len(uni.chars)
 
def do_unicodegetitem(_, string, index):
    uni = lltype.cast_opaque_ptr(lltype.Ptr(rstr.UNICODE), string)
def do_unicodesetitem(_, string, index, newvalue):
    uni = lltype.cast_opaque_ptr(lltype.Ptr(rstr.UNICODE), string)
    uni.chars[index] = unichr(newvalue)
 
# ---------- call ----------

src/s/y/Sypy-HEAD/jit/metainterp/executor.py   Sypy(Download)
def do_copyunicodecontent(cpu, _, srcbox, dstbox,
                          srcstartbox, dststartbox, lengthbox):
    src = srcbox.getref(lltype.Ptr(rstr.UNICODE))
    dst = dstbox.getref(lltype.Ptr(rstr.UNICODE))
    srcstart = srcstartbox.getint()

  1 | 2 | 3 | 4  Next