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
d951e7b3
Kaydet (Commit)
d951e7b3
authored
Kas 25, 2008
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
check the return value of NEW_IDENTIFIER in some more places
üst
45dea65b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
9 deletions
+18
-9
ast.c
Python/ast.c
+18
-9
No files found.
Python/ast.c
Dosyayı görüntüle @
d951e7b3
...
...
@@ -654,6 +654,7 @@ static int
handle_keywordonly_args
(
struct
compiling
*
c
,
const
node
*
n
,
int
start
,
asdl_seq
*
kwonlyargs
,
asdl_seq
*
kwdefaults
)
{
PyObject
*
argname
;
node
*
ch
;
expr_ty
expression
,
annotation
;
arg_ty
arg
;
...
...
@@ -690,11 +691,12 @@ handle_keywordonly_args(struct compiling *c, const node *n, int start,
annotation
=
NULL
;
}
ch
=
CHILD
(
ch
,
0
);
arg
=
arg
(
NEW_IDENTIFIER
(
ch
),
annotation
,
c
->
c_arena
);
if
(
!
arg
)
{
ast_error
(
ch
,
"expecting name"
);
argname
=
NEW_IDENTIFIER
(
ch
);
if
(
!
argname
)
goto
error
;
arg
=
arg
(
argname
,
annotation
,
c
->
c_arena
);
if
(
!
arg
)
goto
error
;
}
asdl_seq_SET
(
kwonlyargs
,
j
++
,
arg
);
i
+=
2
;
/* the name and the comma */
break
;
...
...
@@ -3000,7 +3002,7 @@ ast_for_classdef(struct compiling *c, const node *n, asdl_seq *decorator_seq)
/* classdef: 'class' NAME ['(' arglist ')'] ':' suite */
PyObject
*
classname
;
asdl_seq
*
s
;
expr_ty
call
,
dummy
;
expr_ty
call
;
REQ
(
n
,
classdef
);
...
...
@@ -3028,10 +3030,17 @@ ast_for_classdef(struct compiling *c, const node *n, asdl_seq *decorator_seq)
/* class NAME '(' arglist ')' ':' suite */
/* build up a fake Call node so we can extract its pieces */
dummy
=
Name
(
NEW_IDENTIFIER
(
CHILD
(
n
,
1
)),
Load
,
LINENO
(
n
),
n
->
n_col_offset
,
c
->
c_arena
);
call
=
ast_for_call
(
c
,
CHILD
(
n
,
3
),
dummy
);
if
(
!
call
)
return
NULL
;
{
PyObject
*
dummy_name
;
expr_ty
dummy
;
dummy_name
=
NEW_IDENTIFIER
(
CHILD
(
n
,
1
));
if
(
!
dummy_name
)
return
NULL
;
dummy
=
Name
(
dummy_name
,
Load
,
LINENO
(
n
),
n
->
n_col_offset
,
c
->
c_arena
);
call
=
ast_for_call
(
c
,
CHILD
(
n
,
3
),
dummy
);
if
(
!
call
)
return
NULL
;
}
s
=
ast_for_suite
(
c
,
CHILD
(
n
,
6
));
if
(
!
s
)
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