forked from python/cpython
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue python#20186: Converted the symtable module to Argument Clinic.
Original patch by Georg Brandl.
- Loading branch information
1 parent
685c203
commit 5106ad1
Showing
2 changed files
with
61 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/*[clinic input] | ||
preserve | ||
[clinic start generated code]*/ | ||
|
||
PyDoc_STRVAR(_symtable_symtable__doc__, | ||
"symtable($module, str, filename, startstr, /)\n" | ||
"--\n" | ||
"\n" | ||
"Return symbol and scope dictionaries used internally by compiler."); | ||
|
||
#define _SYMTABLE_SYMTABLE_METHODDEF \ | ||
{"symtable", (PyCFunction)_symtable_symtable, METH_FASTCALL, _symtable_symtable__doc__}, | ||
|
||
static PyObject * | ||
_symtable_symtable_impl(PyObject *module, const char *str, | ||
PyObject *filename, const char *startstr); | ||
|
||
static PyObject * | ||
_symtable_symtable(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) | ||
{ | ||
PyObject *return_value = NULL; | ||
const char *str; | ||
PyObject *filename; | ||
const char *startstr; | ||
|
||
if (!_PyArg_ParseStack(args, nargs, "sO&s:symtable", | ||
&str, PyUnicode_FSDecoder, &filename, &startstr)) { | ||
goto exit; | ||
} | ||
|
||
if (!_PyArg_NoStackKeywords("symtable", kwnames)) { | ||
goto exit; | ||
} | ||
return_value = _symtable_symtable_impl(module, str, filename, startstr); | ||
|
||
exit: | ||
return return_value; | ||
} | ||
/*[clinic end generated code: output=071dee4d836e2cfd input=a9049054013a1b77]*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters