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
71137083
Kaydet (Commit)
71137083
authored
Ock 07, 2001
tarafından
Fred Drake
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix problems with validation of import statement parse trees.
This closes SF bug #127271.
üst
1109db44
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
5 deletions
+24
-5
parsermodule.c
Modules/parsermodule.c
+24
-5
No files found.
Modules/parsermodule.c
Dosyayı görüntüle @
71137083
...
...
@@ -1558,6 +1558,25 @@ validate_import_as_name(node *tree)
}
/* dotted_name: NAME ("." NAME)*
*/
static
int
validate_dotted_name
(
node
*
tree
)
{
int
nch
=
NCH
(
tree
);
int
res
=
(
validate_ntype
(
tree
,
dotted_name
)
&&
is_odd
(
nch
)
&&
validate_name
(
CHILD
(
tree
,
0
),
NULL
));
int
i
;
for
(
i
=
1
;
res
&&
(
i
<
nch
);
i
+=
2
)
{
res
=
(
validate_dot
(
CHILD
(
tree
,
i
))
&&
validate_name
(
CHILD
(
tree
,
i
+
1
),
NULL
));
}
return
res
;
}
/* dotted_as_name: dotted_name [NAME NAME]
*/
static
int
...
...
@@ -1568,9 +1587,9 @@ validate_dotted_as_name(node *tree)
if
(
res
)
{
if
(
nch
==
1
)
res
=
validate_
ntype
(
CHILD
(
tree
,
0
),
dotted_name
);
res
=
validate_
dotted_name
(
CHILD
(
tree
,
0
)
);
else
if
(
nch
==
3
)
res
=
(
validate_
ntype
(
CHILD
(
tree
,
0
),
dotted_name
)
res
=
(
validate_
dotted_name
(
CHILD
(
tree
,
0
)
)
&&
validate_name
(
CHILD
(
tree
,
1
),
"as"
)
&&
validate_name
(
CHILD
(
tree
,
2
),
NULL
));
else
{
...
...
@@ -1601,12 +1620,12 @@ validate_import_stmt(node *tree)
res
=
validate_dotted_as_name
(
CHILD
(
tree
,
1
));
for
(
j
=
2
;
res
&&
(
j
<
nch
);
j
+=
2
)
res
=
(
validate_comma
(
CHILD
(
tree
,
j
))
&&
validate_
ntype
(
CHILD
(
tree
,
j
+
1
),
dotted_name
));
&&
validate_
dotted_as_name
(
CHILD
(
tree
,
j
+
1
)
));
}
else
if
(
res
&&
(
res
=
validate_name
(
CHILD
(
tree
,
0
),
"from"
)))
{
res
=
((
nch
>=
4
)
&&
is_even
(
nch
)
&&
validate_
name
(
CHILD
(
tree
,
2
),
"import"
)
&&
validate_
dotted_as_name
(
CHILD
(
tree
,
1
)
));
&&
validate_
dotted_name
(
CHILD
(
tree
,
1
)
)
&&
validate_
name
(
CHILD
(
tree
,
2
),
"import"
));
if
(
nch
==
4
)
{
if
(
TYPE
(
CHILD
(
tree
,
3
))
==
import_as_name
)
res
=
validate_import_as_name
(
CHILD
(
tree
,
3
));
...
...
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