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
180e6350
Kaydet (Commit)
180e6350
authored
Tem 22, 2011
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
None is ok for identifiers but not strings
üst
efad2449
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
20 deletions
+16
-20
asdl_c.py
Parser/asdl_c.py
+8
-10
Python-ast.c
Python/Python-ast.c
+8
-10
No files found.
Parser/asdl_c.py
Dosyayı görüntüle @
180e6350
...
...
@@ -794,24 +794,22 @@ static int obj2ast_object(PyObject* obj, PyObject** out, PyArena* arena)
return 0;
}
static int obj2ast_stringlike(PyObject* obj, PyObject** out, PyArena* arena,
const char *name)
static int obj2ast_identifier(PyObject* obj, PyObject** out, PyArena* arena)
{
if (!PyUnicode_CheckExact(
name)
) {
PyErr_
Format(PyExc_TypeError, "AST
%
s must be of type str", name
);
if (!PyUnicode_CheckExact(
obj) && obj != Py_None
) {
PyErr_
SetString(PyExc_TypeError, "AST identifier must be of type str"
);
return 1;
}
return obj2ast_object(obj, out, arena);
}
static int obj2ast_identifier(PyObject* obj, PyObject** out, PyArena* arena)
{
return obj2ast_stringlike(obj, out, arena, "identifier");
}
static int obj2ast_string(PyObject* obj, PyObject** out, PyArena* arena)
{
return obj2ast_stringlike(obj, out, arena, "string");
if (!PyUnicode_CheckExact(obj)) {
PyErr_SetString(PyExc_TypeError, "AST string must be of type str");
return 1;
}
return obj2ast_object(obj, out, arena);
}
static int obj2ast_int(PyObject* obj, int* out, PyArena* arena)
...
...
Python/Python-ast.c
Dosyayı görüntüle @
180e6350
...
...
@@ -600,24 +600,22 @@ static int obj2ast_object(PyObject* obj, PyObject** out, PyArena* arena)
return 0;
}
static
int
obj2ast_stringlike
(
PyObject
*
obj
,
PyObject
**
out
,
PyArena
*
arena
,
const
char
*
name
)
static int obj2ast_identifier(PyObject* obj, PyObject** out, PyArena* arena)
{
if
(
!
PyUnicode_CheckExact
(
name
)
)
{
PyErr_
Format
(
PyExc_TypeError
,
"AST %s must be of type str"
,
name
);
if (!PyUnicode_CheckExact(
obj) && obj != Py_None
) {
PyErr_
SetString(PyExc_TypeError, "AST identifier must be of type str"
);
return 1;
}
return obj2ast_object(obj, out, arena);
}
static
int
obj2ast_identifier
(
PyObject
*
obj
,
PyObject
**
out
,
PyArena
*
arena
)
{
return
obj2ast_stringlike
(
obj
,
out
,
arena
,
"identifier"
);
}
static int obj2ast_string(PyObject* obj, PyObject** out, PyArena* arena)
{
return
obj2ast_stringlike
(
obj
,
out
,
arena
,
"string"
);
if (!PyUnicode_CheckExact(obj)) {
PyErr_SetString(PyExc_TypeError, "AST string must be of type str");
return 1;
}
return obj2ast_object(obj, out, arena);
}
static int obj2ast_int(PyObject* obj, int* out, PyArena* arena)
...
...
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