Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
5106ad13
Kaydet (Commit)
5106ad13
authored
Şub 04, 2017
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #20186: Converted the symtable module to Argument Clinic.
Original patch by Georg Brandl.
üst
685c203e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
11 deletions
+61
-11
symtablemodule.c.h
Modules/clinic/symtablemodule.c.h
+39
-0
symtablemodule.c
Modules/symtablemodule.c
+22
-11
No files found.
Modules/clinic/symtablemodule.c.h
0 → 100644
Dosyayı görüntüle @
5106ad13
/*[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]*/
Modules/symtablemodule.c
Dosyayı görüntüle @
5106ad13
...
...
@@ -4,20 +4,33 @@
#include "Python-ast.h"
#include "symtable.h"
#include "clinic/symtablemodule.c.h"
/*[clinic input]
module _symtable
[clinic start generated code]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=f4685845a7100605]*/
/*[clinic input]
_symtable.symtable
str: str
filename: object(converter='PyUnicode_FSDecoder')
startstr: str
/
Return symbol and scope dictionaries used internally by compiler.
[clinic start generated code]*/
static
PyObject
*
symtable_symtable
(
PyObject
*
self
,
PyObject
*
args
)
_symtable_symtable_impl
(
PyObject
*
module
,
const
char
*
str
,
PyObject
*
filename
,
const
char
*
startstr
)
/*[clinic end generated code: output=914b369c9b785956 input=6c615e84d5f408e3]*/
{
struct
symtable
*
st
;
PyObject
*
t
;
char
*
str
;
PyObject
*
filename
;
char
*
startstr
;
int
start
;
if
(
!
PyArg_ParseTuple
(
args
,
"sO&s:symtable"
,
&
str
,
PyUnicode_FSDecoder
,
&
filename
,
&
startstr
))
return
NULL
;
if
(
strcmp
(
startstr
,
"exec"
)
==
0
)
start
=
Py_file_input
;
else
if
(
strcmp
(
startstr
,
"eval"
)
==
0
)
...
...
@@ -42,9 +55,7 @@ symtable_symtable(PyObject *self, PyObject *args)
}
static
PyMethodDef
symtable_methods
[]
=
{
{
"symtable"
,
symtable_symtable
,
METH_VARARGS
,
PyDoc_STR
(
"Return symbol and scope dictionaries"
" used internally by compiler."
)},
_SYMTABLE_SYMTABLE_METHODDEF
{
NULL
,
NULL
}
/* sentinel */
};
...
...
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