Alex Gaynor avatar Alex Gaynor committed 0bdcf29 Merge


Comments (0)

Files changed (4)


 def ll_enumerate_elements(storage):
     for i, elem in enumerate(storage.shape.chars):
         if elem in [INSTANCE, STRING, UNICODE]:
-            yield[i].ptr
+            yield[i].ptr
         elif elem == INT:
-            yield rffi.cast(lltype.Signed,[i])
+            yield rffi.cast(lltype.Signed,[i])
         elif elem == FLOAT:
             yield longlong2float.longlong2float(rffi.cast(lltype.Signed,[i]))
         elif elem == BOOL:
-            yield rffi.cast(lltype.Bool,[i])
+            yield rffi.cast(lltype.Bool,[i])
             assert False


             storage.setbool(2, True)
             return storage
-        llres = self.interpret(f, [])
+        llres = self.interpret(f, [])._obj
         lst = list(rerased_raw.ll_enumerate_elements(llres))
         assert hlstr(lst[0]) == "abc"
         assert lst[1:] == [13, True, 3.5]


 from pypy.rlib import exports
 from pypy.rlib.rfloat import isfinite
 from pypy.rlib.rstackovf import _StackOverflow
-from pypy.rlib.rerased_raw import xxx
+from pypy.rlib.rerased_raw import ll_enumerate_elements
 from pypy.translator.c import extfunc
 from pypy.translator.tool.cbuild import ExternalCompilationInfo
 from py.builtin import BaseException
             shapefld = [fld for fld in T._flds if fld != arrayfld][0]
             shape = getattr(self.obj, shapefld)
             yield shape
-            for elem in shape.chars:
-                import pdb
-                pdb.set_trace()
-        for name in T._names:
-            yield getattr(self.obj, name)
+            for elem in ll_enumerate_elements(self.obj):
+                yield elem
+        else:
+            for name in T._names:
+                yield getattr(self.obj, name)
     def getlength(self):
         T = self.getTYPE()


 from pypy.translator.c.test.test_genc import compile
 class CCompiledMixin(object):
+    # for individual tests see
+    # ===> ../../../rlib/test/
     def interpret(self, f, args):
         fn = compile(f, [type(arg) for arg in args], gcpolicy='boehm')
         return fn(*args)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.