[pypy-svn] r14815 - pypy/dist/pypy/rpython

ac at codespeak.net ac at codespeak.net
Wed Jul 20 14:48:34 CEST 2005


Author: ac
Date: Wed Jul 20 14:48:34 2005
New Revision: 14815

Modified:
   pypy/dist/pypy/rpython/rstr.py
Log:
Implement multiplication of int and char.

Modified: pypy/dist/pypy/rpython/rstr.py
==============================================================================
--- pypy/dist/pypy/rpython/rstr.py	(original)
+++ pypy/dist/pypy/rpython/rstr.py	Wed Jul 20 14:48:34 2005
@@ -370,6 +370,12 @@
         return hop.gendirectcall(ll_char_mul, v_char, v_int)
     rtype_inplace_mul = rtype_mul
 
+class __extend__(pairtype(IntegetRepr, CharRepr)):
+    def rtype_mul(_, hop):
+        v_int, v_char = hop.inputargs(Signed, char_repr)
+        return hop.gendirectcall(ll_char_mul, v_char, v_int)
+    rtype_inplace_mul = rtype_mul
+
 class __extend__(pairtype(CharRepr, CharRepr)):
     def rtype_eq(_, hop): return _rtype_compare_template(hop, 'eq')
     def rtype_ne(_, hop): return _rtype_compare_template(hop, 'ne')



More information about the Pypy-commit mailing list