示例#1
0
文件: dotnet.py 项目: sota/pypy
 def annotation_to_lltype(cls, ann):
     if isinstance(ann, SomeChar):
         return ootype.Char
     elif isinstance(ann, SomeString):
         return ootype.String
     else:
         return annotation_to_lltype(ann)
示例#2
0
 def annotation_to_lltype(cls, ann):
     if isinstance(ann, SomeChar):
         return ootype.Char
     elif isinstance(ann, SomeString):
         return ootype.String
     else:
         return annotation_to_lltype(ann)
示例#3
0
文件: unaryop.py 项目: charred/pypy
 def call(p, args):
     args_s, kwds_s = args.unpack()
     if kwds_s:
         raise Exception("keyword arguments to call to a low-level fn ptr")
     info = 'argument to ll function pointer call'
     llargs = [annotation_to_lltype(s_arg,info)._defl() for s_arg in args_s]
     v = p.ll_ptrtype._example()(*llargs)
     return ll_to_annotation(v)
示例#4
0
文件: builtin.py 项目: charred/pypy
def cast_primitive(T, s_v):
    assert T.is_constant()
    return ll_to_annotation(lltype.cast_primitive(T.const, annotation_to_lltype(s_v)._defl()))
示例#5
0
文件: builtin.py 项目: charred/pypy
def typeOf(s_val):
    lltype = annotation_to_lltype(s_val, info="in typeOf(): ")
    return immutablevalue(lltype)
示例#6
0
文件: unaryop.py 项目: charred/pypy
 def setattr(p, s_attr, s_value): # just doing checking
     assert s_attr.is_constant(), "setattr on ptr %r with non-constant field-name" % p.ll_ptrtype
     example = p.ll_ptrtype._example()
     if getattr(example, s_attr.const) is not None:  # ignore Void s_value
         v_lltype = annotation_to_lltype(s_value)
         setattr(example, s_attr.const, v_lltype._defl())
示例#7
0
文件: database.py 项目: sota/pypy-old
 def annotation_to_cts(self, _tp):
     s_tp = annotation(_tp)
     TP = annotation_to_lltype(s_tp)
     return self.lltype_to_cts(TP)