[pypy-svn] pypy default: add support for some rlocale to the jvm backend
antocuni
commits-noreply at bitbucket.org
Mon Apr 11 12:01:13 CEST 2011
Author: Antonio Cuni <anto.cuni at gmail.com>
Branch:
Changeset: r43277:bf822ab5a563
Date: 2011-04-11 08:30 +0000
http://bitbucket.org/pypy/pypy/changeset/bf822ab5a563/
Log: add support for some rlocale to the jvm backend
diff --git a/pypy/translator/jvm/src/pypy/PyPy.java b/pypy/translator/jvm/src/pypy/PyPy.java
--- a/pypy/translator/jvm/src/pypy/PyPy.java
+++ b/pypy/translator/jvm/src/pypy/PyPy.java
@@ -1187,9 +1187,42 @@
return Character.toLowerCase(c);
}
+ public int locale_tolower(int chr)
+ {
+ return Character.toLowerCase(chr);
+ }
+
+ public int locale_isupper(int chr)
+ {
+ return boolean2int(Character.isUpperCase(chr));
+ }
+
+ public int locale_islower(int chr)
+ {
+ return boolean2int(Character.isLowerCase(chr));
+ }
+
+ public int locale_isalpha(int chr)
+ {
+ return boolean2int(Character.isLetter(chr));
+ }
+
+ public int locale_isalnum(int chr)
+ {
+ return boolean2int(Character.isLetterOrDigit(chr));
+ }
+
+
// ----------------------------------------------------------------------
// Self Test
+ public static int boolean2int(boolean b)
+ {
+ if (b)
+ return 1;
+ return 0;
+ }
+
public static int __counter = 0, __failures = 0;
public static void ensure(boolean f) {
if (f) {
More information about the Pypy-commit
mailing list