[Python-checkins] cpython (2.7): #15512: Declarations reorganization

jesus.cea python-checkins at python.org
Fri Aug 3 15:51:40 CEST 2012


http://hg.python.org/cpython/rev/c5bf5a82a3f2
changeset: 78399:c5bf5a82a3f2
branch: 2.7
parent: 78396:0827fef8652d
user: Jesus Cea <jcea at jcea.es>
date: Fri Aug 03 15:51:11 2012 +0200
summary:
 #15512: Declarations reorganization
files:
 Modules/parsermodule.c | 46 +++++++++++++++--------------
 1 files changed, 24 insertions(+), 22 deletions(-)
diff --git a/Modules/parsermodule.c b/Modules/parsermodule.c
--- a/Modules/parsermodule.c
+++ b/Modules/parsermodule.c
@@ -172,8 +172,30 @@
 static PyObject* parser_sizeof(PyST_Object *, void *);
 static int parser_compare(PyST_Object *left, PyST_Object *right);
 static PyObject *parser_getattr(PyObject *self, char *name);
-static PyMethodDef parser_methods[];
-
+static PyObject* parser_compilest(PyST_Object *, PyObject *, PyObject *);
+static PyObject* parser_isexpr(PyST_Object *, PyObject *, PyObject *);
+static PyObject* parser_issuite(PyST_Object *, PyObject *, PyObject *);
+static PyObject* parser_st2list(PyST_Object *, PyObject *, PyObject *);
+static PyObject* parser_st2tuple(PyST_Object *, PyObject *, PyObject *);
+
+#define PUBLIC_METHOD_TYPE (METH_VARARGS|METH_KEYWORDS)
+
+static PyMethodDef
+parser_methods[] = {
+ {"compile", (PyCFunction)parser_compilest, PUBLIC_METHOD_TYPE,
+ PyDoc_STR("Compile this ST object into a code object.")},
+ {"isexpr", (PyCFunction)parser_isexpr, PUBLIC_METHOD_TYPE,
+ PyDoc_STR("Determines if this ST object was created from an expression.")},
+ {"issuite", (PyCFunction)parser_issuite, PUBLIC_METHOD_TYPE,
+ PyDoc_STR("Determines if this ST object was created from a suite.")},
+ {"tolist", (PyCFunction)parser_st2list, PUBLIC_METHOD_TYPE,
+ PyDoc_STR("Creates a list-tree representation of this ST.")},
+ {"totuple", (PyCFunction)parser_st2tuple, PUBLIC_METHOD_TYPE,
+ PyDoc_STR("Creates a tuple-tree representation of this ST.")},
+ {"__sizeof__", (PyCFunction)parser_sizeof, METH_NOARGS,
+ PyDoc_STR("Returns size in memory, in bytes.")},
+ {NULL, NULL, 0, NULL}
+};
 
 static
 PyTypeObject PyST_Type = {
@@ -503,26 +525,6 @@
 }
 
 
-#define PUBLIC_METHOD_TYPE (METH_VARARGS|METH_KEYWORDS)
-
-static PyMethodDef
-parser_methods[] = {
- {"compile", (PyCFunction)parser_compilest, PUBLIC_METHOD_TYPE,
- PyDoc_STR("Compile this ST object into a code object.")},
- {"isexpr", (PyCFunction)parser_isexpr, PUBLIC_METHOD_TYPE,
- PyDoc_STR("Determines if this ST object was created from an expression.")},
- {"issuite", (PyCFunction)parser_issuite, PUBLIC_METHOD_TYPE,
- PyDoc_STR("Determines if this ST object was created from a suite.")},
- {"tolist", (PyCFunction)parser_st2list, PUBLIC_METHOD_TYPE,
- PyDoc_STR("Creates a list-tree representation of this ST.")},
- {"totuple", (PyCFunction)parser_st2tuple, PUBLIC_METHOD_TYPE,
- PyDoc_STR("Creates a tuple-tree representation of this ST.")},
- {"__sizeof__", (PyCFunction)parser_sizeof, METH_NOARGS,
- PyDoc_STR("Returns size in memory, in bytes.")},
- {NULL, NULL, 0, NULL}
-};
-
-
 static PyObject*
 parser_getattr(PyObject *self, char *name)
 {
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /