Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
d72cf427
Commit
d72cf427
authored
Feb 27, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #333 from undingen/unicodedata
Add the unicodedata module
parents
98157b47
83ebbc16
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
4 deletions
+14
-4
Makefile
Makefile
+1
-1
from_cpython/CMakeLists.txt
from_cpython/CMakeLists.txt
+1
-1
from_cpython/Modules/unicodedata.c
from_cpython/Modules/unicodedata.c
+4
-0
src/capi/modsupport.cpp
src/capi/modsupport.cpp
+1
-2
src/runtime/types.cpp
src/runtime/types.cpp
+2
-0
test/tests/unicodedata_test.py
test/tests/unicodedata_test.py
+5
-0
No files found.
Makefile
View file @
d72cf427
...
...
@@ -291,7 +291,7 @@ STDLIB_OBJS := stdlib.bc.o stdlib.stripped.bc.o
STDLIB_RELEASE_OBJS
:=
stdlib.release.bc.o
ASM_SRCS
:=
$(
wildcard
src/runtime/
*
.S
)
STDMODULE_SRCS
:=
errnomodule.c shamodule.c sha256module.c sha512module.c _math.c mathmodule.c md5.c md5module.c _randommodule.c _sre.c operator.c binascii.c pwdmodule.c posixmodule.c _struct.c datetimemodule.c _functoolsmodule.c _collectionsmodule.c itertoolsmodule.c resource.c signalmodule.c selectmodule.c fcntlmodule.c timemodule.c arraymodule.c zlibmodule.c _codecsmodule.c socketmodule.c
$(EXTRA_STDMODULE_SRCS)
STDMODULE_SRCS
:=
errnomodule.c shamodule.c sha256module.c sha512module.c _math.c mathmodule.c md5.c md5module.c _randommodule.c _sre.c operator.c binascii.c pwdmodule.c posixmodule.c _struct.c datetimemodule.c _functoolsmodule.c _collectionsmodule.c itertoolsmodule.c resource.c signalmodule.c selectmodule.c fcntlmodule.c timemodule.c arraymodule.c zlibmodule.c _codecsmodule.c socketmodule.c
unicodedata.c
$(EXTRA_STDMODULE_SRCS)
STDOBJECT_SRCS
:=
structseq.c capsule.c stringobject.c exceptions.c unicodeobject.c unicodectype.c bytearrayobject.c bytes_methods.c
$(EXTRA_STDOBJECT_SRCS)
STDPYTHON_SRCS
:=
pyctype.c getargs.c formatter_string.c pystrtod.c dtoa.c formatter_unicode.c
$(EXTRA_STDPYTHON_SRCS)
FROM_CPYTHON_SRCS
:=
$(
addprefix
from_cpython/Modules/,
$(STDMODULE_SRCS)
)
$(
addprefix
from_cpython/Objects/,
$(STDOBJECT_SRCS)
)
$(
addprefix
from_cpython/Python/,
$(STDPYTHON_SRCS)
)
...
...
from_cpython/CMakeLists.txt
View file @
d72cf427
...
...
@@ -15,7 +15,7 @@ endforeach(STDLIB_FILE)
add_custom_target
(
copy_stdlib ALL DEPENDS
${
STDLIB_TARGETS
}
)
# compile specified files in from_cpython/Modules
file
(
GLOB_RECURSE STDMODULE_SRCS Modules errnomodule.c shamodule.c sha256module.c sha512module.c _math.c mathmodule.c md5.c md5module.c _randommodule.c _sre.c operator.c binascii.c pwdmodule.c posixmodule.c _struct.c datetimemodule.c _functoolsmodule.c _collectionsmodule.c itertoolsmodule.c resource.c signalmodule.c selectmodule.c fcntlmodule.c timemodule.c arraymodule.c zlibmodule.c _codecsmodule.c socketmodule.c
)
file
(
GLOB_RECURSE STDMODULE_SRCS Modules errnomodule.c shamodule.c sha256module.c sha512module.c _math.c mathmodule.c md5.c md5module.c _randommodule.c _sre.c operator.c binascii.c pwdmodule.c posixmodule.c _struct.c datetimemodule.c _functoolsmodule.c _collectionsmodule.c itertoolsmodule.c resource.c signalmodule.c selectmodule.c fcntlmodule.c timemodule.c arraymodule.c zlibmodule.c _codecsmodule.c socketmodule.c
unicodedata.c
)
# compile specified files in from_cpython/Objects
file
(
GLOB_RECURSE STDOBJECT_SRCS Objects structseq.c capsule.c stringobject.c exceptions.c unicodeobject.c unicodectype.c bytearrayobject.c bytes_methods.c
)
...
...
from_cpython/Modules/unicodedata.c
View file @
d72cf427
...
...
@@ -1252,6 +1252,10 @@ initunicodedata(void)
Py_TYPE
(
&
UCD_Type
)
=
&
PyType_Type
;
// Pyston change: let the GC know about our type
if
(
PyType_Ready
(
&
UCD_Type
))
return
;
m
=
Py_InitModule3
(
"unicodedata"
,
unicodedata_functions
,
unicodedata_docstring
);
if
(
!
m
)
...
...
src/capi/modsupport.cpp
View file @
d72cf427
...
...
@@ -289,9 +289,8 @@ extern "C" PyObject* Py_InitModule4(const char* name, PyMethodDef* methods, cons
int
apiver
)
noexcept
{
BoxedModule
*
module
=
createModule
(
name
,
"__builtin__"
);
// Pass self as is, even if NULL we are not allowed to change it to None
Box
*
passthrough
=
static_cast
<
Box
*>
(
self
);
if
(
!
passthrough
)
passthrough
=
None
;
while
(
methods
&&
methods
->
ml_name
)
{
if
(
VERBOSITY
())
...
...
src/runtime/types.cpp
View file @
d72cf427
...
...
@@ -65,6 +65,7 @@ extern "C" void initzlib();
extern
"C"
void
init_codecs
();
extern
"C"
void
init_socket
();
extern
"C"
void
_PyUnicode_Init
();
extern
"C"
void
initunicodedata
();
namespace
pyston
{
...
...
@@ -1445,6 +1446,7 @@ void setupRuntime() {
initzlib
();
init_codecs
();
init_socket
();
initunicodedata
();
setupSysEnd
();
...
...
test/tests/unicodedata_test.py
0 → 100644
View file @
d72cf427
# skip-if: '-x' in EXTRA_JIT_ARGS
import
unicodedata
print
unicodedata
.
lookup
(
"EURO SIGN"
)
==
u"
\
u20ac
"
print
unicodedata
.
name
(
u"/"
)
print
unicodedata
.
category
(
u"A"
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment