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
cbd78133
Kaydet (Commit)
cbd78133
authored
Haz 08, 2008
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
add an ast_warn helper function to make adding those Py3k warnings easier
üst
3219df15
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
ast.c
Python/ast.c
+15
-7
No files found.
Python/ast.c
Dosyayı görüntüle @
cbd78133
...
...
@@ -113,6 +113,19 @@ ast_error_finish(const char *filename)
PyErr_Restore
(
type
,
value
,
tback
);
}
static
int
ast_warn
(
struct
compiling
*
c
,
const
node
*
n
,
char
*
msg
)
{
if
(
PyErr_WarnExplicit
(
PyExc_SyntaxWarning
,
msg
,
c
->
c_filename
,
LINENO
(
n
),
NULL
,
NULL
)
<
0
)
{
/* if -Werr, change it to a SyntaxError */
if
(
PyErr_Occurred
()
&&
PyErr_ExceptionMatches
(
PyExc_SyntaxWarning
))
ast_error
(
n
,
msg
);
return
0
;
}
return
1
;
}
/* num_stmts() returns number of contained statements.
Use this routine to determine how big a sequence is needed for
...
...
@@ -1363,14 +1376,9 @@ ast_for_atom(struct compiling *c, const node *n)
}
case
BACKQUOTE
:
{
/* repr */
expr_ty
expression
;
if
(
Py_Py3kWarningFlag
)
{
if
(
PyErr_WarnExplicit
(
PyExc_SyntaxWarning
,
"backquote not supported in 3.x; use repr()"
,
c
->
c_filename
,
LINENO
(
n
),
NULL
,
NULL
))
{
if
(
Py_Py3kWarningFlag
&&
!
ast_warn
(
c
,
n
,
"backquote not supported in 3.x; use repr()"
))
return
NULL
;
}
}
expression
=
ast_for_testlist
(
c
,
CHILD
(
n
,
1
));
if
(
!
expression
)
return
NULL
;
...
...
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