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
31441302
Kaydet (Commit)
31441302
authored
Eki 21, 2005
tarafından
Armin Rigo
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
ANSI-C-ify the placement of local var declarations.
üst
b2308bb9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
9 deletions
+14
-9
ast.c
Python/ast.c
+8
-6
compile.c
Python/compile.c
+2
-1
symtable.c
Python/symtable.c
+4
-2
No files found.
Python/ast.c
Dosyayı görüntüle @
31441302
...
...
@@ -512,14 +512,14 @@ static asdl_seq *
seq_for_testlist
(
struct
compiling
*
c
,
const
node
*
n
)
{
/* testlist: test (',' test)* [','] */
asdl_seq
*
seq
;
expr_ty
expression
;
int
i
;
assert
(
TYPE
(
n
)
==
testlist
||
TYPE
(
n
)
==
listmaker
||
TYPE
(
n
)
==
testlist_gexp
||
TYPE
(
n
)
==
testlist_safe
);
asdl_seq
*
seq
;
expr_ty
expression
;
int
i
;
seq
=
asdl_seq_new
((
NCH
(
n
)
+
1
)
/
2
);
if
(
!
seq
)
...
...
@@ -641,12 +641,13 @@ ast_for_arguments(struct compiling *c, const node *n)
compiler_complex_args
(
CHILD
(
ch
,
1
)));
}
else
if
(
TYPE
(
CHILD
(
ch
,
0
))
==
NAME
)
{
expr_ty
name
;
if
(
!
strcmp
(
STR
(
CHILD
(
ch
,
0
)),
"None"
))
{
ast_error
(
CHILD
(
ch
,
0
),
"assignment to None"
);
goto
error
;
}
expr_ty
name
=
Name
(
NEW_IDENTIFIER
(
CHILD
(
ch
,
0
)),
Param
,
LINENO
(
ch
));
name
=
Name
(
NEW_IDENTIFIER
(
CHILD
(
ch
,
0
)),
Param
,
LINENO
(
ch
));
if
(
!
name
)
goto
error
;
asdl_seq_APPEND
(
args
,
name
);
...
...
@@ -1897,12 +1898,13 @@ ast_for_expr_stmt(struct compiling *c, const node *n)
if
(
!
targets
)
return
NULL
;
for
(
i
=
0
;
i
<
NCH
(
n
)
-
2
;
i
+=
2
)
{
expr_ty
e
;
node
*
ch
=
CHILD
(
n
,
i
);
if
(
TYPE
(
ch
)
==
yield_expr
)
{
ast_error
(
ch
,
"assignment to yield expression not possible"
);
goto
error
;
}
e
xpr_ty
e
=
ast_for_testlist
(
c
,
ch
,
0
);
e
=
ast_for_testlist
(
c
,
ch
,
0
);
/* set context to assign */
if
(
!
e
)
...
...
Python/compile.c
Dosyayı görüntüle @
31441302
...
...
@@ -2329,8 +2329,9 @@ compiler_import_as(struct compiler *c, identifier name, identifier asname)
src
=
dot
+
1
;
while
(
dot
)
{
/* NB src is only defined when dot != NULL */
PyObject
*
attr
;
dot
=
strchr
(
src
,
'.'
);
PyObject
*
attr
=
PyString_FromStringAndSize
(
src
,
attr
=
PyString_FromStringAndSize
(
src
,
dot
?
dot
-
src
:
strlen
(
src
));
ADDOP_O
(
c
,
LOAD_ATTR
,
attr
,
names
);
src
=
dot
+
1
;
...
...
Python/symtable.c
Dosyayı görüntüle @
31441302
...
...
@@ -444,12 +444,13 @@ analyze_cells(PyObject *scope, PyObject *free)
static
int
check_unoptimized
(
const
PySTEntryObject
*
ste
)
{
char
buf
[
300
];
const
char
*
trailer
;
if
(
ste
->
ste_type
==
ModuleBlock
||
!
ste
->
ste_unoptimized
||
!
(
ste
->
ste_free
||
ste
->
ste_child_free
))
return
1
;
const
char
*
trailer
=
(
ste
->
ste_child_free
?
trailer
=
(
ste
->
ste_child_free
?
"contains a nested function with free variables"
:
"is a nested function"
);
...
...
@@ -621,8 +622,9 @@ analyze_block(PySTEntryObject *ste, PyObject *bound, PyObject *free,
/* Recursively call analyze_block() on each child block */
for
(
i
=
0
;
i
<
PyList_GET_SIZE
(
ste
->
ste_children
);
++
i
)
{
PyObject
*
c
=
PyList_GET_ITEM
(
ste
->
ste_children
,
i
);
PySTEntryObject
*
entry
;
assert
(
c
&&
PySTEntry_Check
(
c
));
PySTEntryObject
*
entry
=
(
PySTEntryObject
*
)
c
;
entry
=
(
PySTEntryObject
*
)
c
;
if
(
!
analyze_block
(
entry
,
newbound
,
newfree
,
newglobal
))
goto
error
;
if
(
entry
->
ste_free
||
entry
->
ste_child_free
)
...
...
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