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
dd97fbb2
Kaydet (Commit)
dd97fbb2
authored
Nis 10, 2011
tarafından
Eli Bendersky
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #9904: fix and clarify some comments + fix indentation in symtable code
üst
19299835
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
8 deletions
+11
-8
symtable.h
Include/symtable.h
+7
-4
symtable.c
Python/symtable.c
+4
-4
No files found.
Include/symtable.h
Dosyayı görüntüle @
dd97fbb2
...
@@ -23,10 +23,13 @@ struct symtable {
...
@@ -23,10 +23,13 @@ struct symtable {
PyObject
*
st_blocks
;
/* dict: map AST node addresses
PyObject
*
st_blocks
;
/* dict: map AST node addresses
* to symbol table entries */
* to symbol table entries */
PyObject
*
st_stack
;
/* list: stack of namespace info */
PyObject
*
st_stack
;
/* list: stack of namespace info */
PyObject
*
st_global
;
/* borrowed ref to st_top->st_symbols */
PyObject
*
st_global
;
/* borrowed ref to st_top->ste_symbols */
int
st_nblocks
;
/* number of blocks used */
int
st_nblocks
;
/* number of blocks used. kept for
consistency with the corresponding
compiler structure */
PyObject
*
st_private
;
/* name of current class or NULL */
PyObject
*
st_private
;
/* name of current class or NULL */
PyFutureFeatures
*
st_future
;
/* module's future features */
PyFutureFeatures
*
st_future
;
/* module's future features that affect
the symbol table */
};
};
typedef
struct
_symtable_entry
{
typedef
struct
_symtable_entry
{
...
@@ -34,7 +37,7 @@ typedef struct _symtable_entry {
...
@@ -34,7 +37,7 @@ typedef struct _symtable_entry {
PyObject
*
ste_id
;
/* int: key in ste_table->st_blocks */
PyObject
*
ste_id
;
/* int: key in ste_table->st_blocks */
PyObject
*
ste_symbols
;
/* dict: variable names to flags */
PyObject
*
ste_symbols
;
/* dict: variable names to flags */
PyObject
*
ste_name
;
/* string: name of current block */
PyObject
*
ste_name
;
/* string: name of current block */
PyObject
*
ste_varnames
;
/* list of
variable name
s */
PyObject
*
ste_varnames
;
/* list of
function parameter
s */
PyObject
*
ste_children
;
/* list of child blocks */
PyObject
*
ste_children
;
/* list of child blocks */
_Py_block_ty
ste_type
;
/* module, class, or function */
_Py_block_ty
ste_type
;
/* module, class, or function */
int
ste_unoptimized
;
/* false if namespace is optimized */
int
ste_unoptimized
;
/* false if namespace is optimized */
...
...
Python/symtable.c
Dosyayı görüntüle @
dd97fbb2
...
@@ -750,7 +750,7 @@ analyze_block(PySTEntryObject *ste, PyObject *bound, PyObject *free,
...
@@ -750,7 +750,7 @@ analyze_block(PySTEntryObject *ste, PyObject *bound, PyObject *free,
goto
error
;
goto
error
;
}
}
/* Recursively call analyze_block() on each child block.
/* Recursively call analyze_
child_
block() on each child block.
newbound, newglobal now contain the names visible in
newbound, newglobal now contain the names visible in
nested blocks. The free variables in the children will
nested blocks. The free variables in the children will
...
@@ -1205,9 +1205,9 @@ symtable_visit_stmt(struct symtable *st, stmt_ty s)
...
@@ -1205,9 +1205,9 @@ symtable_visit_stmt(struct symtable *st, stmt_ty s)
case
Raise_kind
:
case
Raise_kind
:
if
(
s
->
v
.
Raise
.
exc
)
{
if
(
s
->
v
.
Raise
.
exc
)
{
VISIT
(
st
,
expr
,
s
->
v
.
Raise
.
exc
);
VISIT
(
st
,
expr
,
s
->
v
.
Raise
.
exc
);
if
(
s
->
v
.
Raise
.
cause
)
{
if
(
s
->
v
.
Raise
.
cause
)
{
VISIT
(
st
,
expr
,
s
->
v
.
Raise
.
cause
);
VISIT
(
st
,
expr
,
s
->
v
.
Raise
.
cause
);
}
}
}
}
break
;
break
;
case
TryExcept_kind
:
case
TryExcept_kind
:
...
...
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