Commit 5465d26d authored by Marius Wachtler's avatar Marius Wachtler

add parser module

main motivation for this is that old versions of pytest use this module
in additon enable some cpython test we pass and add all shared libraries we generate to CMakeList.txt
parent b791a4e5
......@@ -138,17 +138,21 @@ add_library(FROM_CPYTHON OBJECT ${STDMODULE_SRCS} ${STDOBJECT_SRCS} ${STDPYTHON_
add_dependencies(FROM_CPYTHON copy_stdlib)
set(STDMODULES
${CMAKE_BINARY_DIR}/from_cpython/Lib/future_builtins.pyston.so
${CMAKE_BINARY_DIR}/from_cpython/Lib/_multiprocessing.pyston.so
${CMAKE_BINARY_DIR}/from_cpython/Lib/pyexpat.pyston.so
${CMAKE_BINARY_DIR}/from_cpython/Lib/_elementtree.pyston.so
${CMAKE_BINARY_DIR}/from_cpython/Lib/bz2.pyston.so
${CMAKE_BINARY_DIR}/from_cpython/Lib/cmath.pyston.so
${CMAKE_BINARY_DIR}/from_cpython/Lib/cPickle.pyston.so
${CMAKE_BINARY_DIR}/from_cpython/Lib/_ctypes.pyston.so
${CMAKE_BINARY_DIR}/from_cpython/Lib/_curses.pyston.so
${CMAKE_BINARY_DIR}/from_cpython/Lib/_elementtree.pyston.so
${CMAKE_BINARY_DIR}/from_cpython/Lib/future_builtins.pyston.so
${CMAKE_BINARY_DIR}/from_cpython/Lib/grp.pyston.so
${CMAKE_BINARY_DIR}/from_cpython/Lib/_locale.pyston.so
${CMAKE_BINARY_DIR}/from_cpython/Lib/mmap.pyston.so
${CMAKE_BINARY_DIR}/from_cpython/Lib/_multiprocessing.pyston.so
${CMAKE_BINARY_DIR}/from_cpython/Lib/parser.pyston.so
${CMAKE_BINARY_DIR}/from_cpython/Lib/pyexpat.pyston.so
${CMAKE_BINARY_DIR}/from_cpython/Lib/readline.pyston.so
${CMAKE_BINARY_DIR}/from_cpython/Lib/termios.pyston.so
${CMAKE_BINARY_DIR}/from_cpython/Lib/_curses.pyston.so
${CMAKE_BINARY_DIR}/from_cpython/Lib/mmap.pyston.so
)
add_custom_command(OUTPUT ${STDMODULES}
......@@ -181,6 +185,7 @@ add_custom_command(OUTPUT ${STDMODULES}
Modules/mmapmodule.c
Modules/_localemodule.c
Modules/cPickle.c
Modules/parsermodule.c
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
add_custom_target(sharedmods ALL DEPENDS ${CMAKE_BINARY_DIR}/from_cpython/Lib/_multiprocessing.pyston.so)
......
# expected: fail
import parser
import unittest
import sys
......
# expected: fail
"""
Test suite for SocketServer.py.
"""
......
# expected: fail
# Test some Unicode file name semantics
# We dont test many operations on files other than
# that their names can be used with Unicode characters.
......
# expected: fail
""" Test script for the unicodedata module.
Written by Marc-Andre Lemburg (mal@lemburg.com).
......
......@@ -3453,6 +3453,9 @@ initparser(void)
if (PyModule_AddObject(module, "ParserError", parser_error) != 0)
return;
// Pyston change:
PyType_Ready(&PyST_Type);
Py_INCREF(&PyST_Type);
PyModule_AddObject(module, "ASTType", (PyObject*)&PyST_Type);
Py_INCREF(&PyST_Type);
......
......@@ -159,6 +159,12 @@ def cPickle_ext():
"Modules/cPickle.c",
]))
@unique
def parser_ext():
return Extension("parser", sources = map(relpath, [
"Modules/parsermodule.c",
]))
ext_modules = [future_builtins_ext(),
multiprocessing_ext(),
pyexpat_ext(),
......@@ -173,7 +179,8 @@ ext_modules = [future_builtins_ext(),
termios_ext(),
mmap_ext(),
locale_ext(),
cPickle_ext()
cPickle_ext(),
parser_ext()
]
......
......@@ -1133,6 +1133,11 @@ cleanup:
: 0)
#endif
extern "C" void PyParser_SetError(perrdetail* err) noexcept {
err_input(err);
}
extern "C" grammar _PyParser_Grammar;
/* Preferred access to parser is through AST. */
......
......@@ -136,7 +136,6 @@ test_nis [unknown]
test_optparse assertion instead of exceptions for long("invalid number")
test_ossaudiodev [unknown]
test_os [unknown]
test_parser [unknown]
test_pdb [unknown]
test_peepholer [unknown]
test_pep352 various unique bugs
......@@ -157,7 +156,6 @@ test_scope eval of code object from existing function (not currentl
test_scriptpackages [unknown]
test_shelve [unknown]
test_site [unknown]
test_socketserver missing imp.lock_held, otherwise works
test_socket [unknown]
test_sort argument specification issue in listSort?
test_sqlite [unknown]
......@@ -194,8 +192,6 @@ test_ttk_textonly [unknown]
test_types PyErr_WarnEx
test_undocumented_details function.func_closure
test_unicode argument passing issue?
test_unicodedata [unknown]
test_unicode_file exit code 139, no error message
test_unittest serialize_ast assert
test_univnewlines [unknown]
test_userdict segfault: repr of recursive dict?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment