Commits

Christian Tismer committed fd7331a Merge

Merge with default

Comments (0)

Files changed (4)

pypy/doc/you-want-to-help.rst

   It's not only what we believe in, but also that PyPy's architecture is
   working very well with TDD in mind and not so well without it. Often
   the development means progressing in an unrelated corner, one unittest
-  at a time and then flipping a giant switch. It's worth repeating - PyPy
+  at a time; and then flipping a giant switch, bringing it all together.
+  (It generally works out of the box.  If it doesn't, then we didn't
+  write enough unit tests.)  It's worth repeating - PyPy
   approach is great if you do TDD, not so great otherwise.
 
 * PyPy uses an entirely different set of tools - most of them included
 Architecture
 ============
 
-PyPy has layers. The 100 mile view:
+PyPy has layers. The 100 miles view:
 
-* `RPython`_ is a language in which we write interpreter in PyPy. Not the entire
-  PyPy project is written in RPython, only parts that are compiled in
+* `RPython`_ is the language in which we write interpreters. Not the entire
+  PyPy project is written in RPython, only the parts that are compiled in
   the translation process. The interesting point is that RPython has no parser,
   it's compiled from the live python objects, which make it possible to do
   all kinds of metaprogramming during import time. In short, Python is a meta
   programming language for RPython.
 
-  RPython standard library is to be found in ``rlib`` subdirectory.
+  The RPython standard library is to be found in the ``rlib`` subdirectory.
 
 .. _`RPython`: coding-guide.html#RPython
 
-* Translation toolchain - this is the part that takes care about translating
-  RPython to flow graphs and then to C. There is more in `architecture`_
+* The translation toolchain - this is the part that takes care about translating
+  RPython to flow graphs and then to C. There is more in the `architecture`_
   document written about it.
 
   It mostly lives in ``rpython``, ``annotator`` and ``objspace/flow``.

pypy/rlib/parsing/pypackrat.py

 
 from pypy.rlib.parsing.tree import Nonterminal, Symbol
-from makepackrat import PackratParser, BacktrackException, Status
+from pypy.rlib.parsing.makepackrat import PackratParser, BacktrackException, Status
+
+
 class Parser(object):
     def NAME(self):
         return self._NAME().result

pypy/rpython/rstr.py

         v_char = hop.inputarg(rstr.char_repr, arg=1)
         v_left = hop.inputconst(Bool, left)
         v_right = hop.inputconst(Bool, right)
+        hop.exception_is_here()
         return hop.gendirectcall(self.ll.ll_strip, v_str, v_char, v_left, v_right)
 
     def rtype_method_lstrip(self, hop):

pypy/rpython/test/test_rstr.py

     def _make_split_test(self, split_fn):
         const = self.const
         def fn(i):
-            s = [const(''), const('0.1.2.4.8'), const('.1.2'), const('1.2.'), const('.1.2.4.')][i]
-            l = getattr(s, split_fn)(const('.'))
-            sum = 0
-            for num in l:
-                if len(num):
-                    sum += ord(num[0]) - ord(const('0')[0])
-            return sum + len(l) * 100
+            try:
+                s = [const(''), const('0.1.2.4.8'), const('.1.2'), const('1.2.'), const('.1.2.4.')][i]
+                l = getattr(s, split_fn)(const('.'))
+                sum = 0
+                for num in l:
+                    if len(num):
+                        sum += ord(num[0]) - ord(const('0')[0])
+                return sum + len(l) * 100
+            except MemoryError:
+                return 42
         return fn
 
     def test_split(self):