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
34e4f52f
Kaydet (Commit)
34e4f52f
authored
Ara 29, 2006
tarafından
Fred Drake
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
avoid dict.has_key, since this might get used by a Py3K built in the
working copy
üst
3203bdc6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
15 deletions
+15
-15
asdl.py
Parser/asdl.py
+1
-1
spark.py
Parser/spark.py
+14
-14
No files found.
Parser/asdl.py
Dosyayı görüntüle @
34e4f52f
...
...
@@ -373,7 +373,7 @@ def check(mod):
v
.
visit
(
mod
)
for
t
in
v
.
types
:
if
not
mod
.
types
.
has_key
(
t
)
and
not
t
in
builtin_types
:
if
t
not
in
mod
.
types
and
not
t
in
builtin_types
:
v
.
errors
+=
1
uses
=
", "
.
join
(
v
.
types
[
t
])
print
"Undefined type
%
s, used in
%
s"
%
(
t
,
uses
)
...
...
Parser/spark.py
Dosyayı görüntüle @
34e4f52f
...
...
@@ -31,7 +31,7 @@ def _namelist(instance):
for
b
in
c
.
__bases__
:
classlist
.
append
(
b
)
for
name
in
c
.
__dict__
.
keys
():
if
n
ot
namedict
.
has_key
(
name
)
:
if
n
ame
not
in
namedict
:
namelist
.
append
(
name
)
namedict
[
name
]
=
1
return
namelist
...
...
@@ -73,7 +73,7 @@ class GenericScanner:
groups
=
m
.
groups
()
for
i
in
range
(
len
(
groups
)):
if
groups
[
i
]
and
self
.
index2func
.
has_key
(
i
)
:
if
groups
[
i
]
and
i
in
self
.
index2func
:
self
.
index2func
[
i
](
groups
[
i
])
pos
=
m
.
end
()
...
...
@@ -141,7 +141,7 @@ class GenericParser:
for
k
,
v
in
self
.
edges
.
items
():
if
v
is
None
:
state
,
sym
=
k
if
s
elf
.
states
.
has_key
(
state
)
:
if
s
tate
in
self
.
states
:
self
.
goto
(
state
,
sym
)
changes
=
1
rv
=
self
.
__dict__
.
copy
()
...
...
@@ -188,7 +188,7 @@ class GenericParser:
if
_preprocess
:
rule
,
fn
=
self
.
preprocess
(
rule
,
func
)
if
self
.
rules
.
has_key
(
lhs
)
:
if
lhs
in
self
.
rules
:
self
.
rules
[
lhs
]
.
append
(
rule
)
else
:
self
.
rules
[
lhs
]
=
[
rule
]
...
...
@@ -226,7 +226,7 @@ class GenericParser:
# grammars.
#
for
sym
in
rhs
:
if
not
self
.
rules
.
has_key
(
sym
)
:
if
sym
not
in
self
.
rules
:
break
else
:
tbd
.
append
(
rule
)
...
...
@@ -269,7 +269,7 @@ class GenericParser:
n
=
len
(
rhs
)
while
i
<
n
:
sym
=
rhs
[
i
]
if
not
self
.
rules
.
has_key
(
sym
)
or
\
if
sym
not
in
self
.
rules
or
\
not
self
.
nullable
[
sym
]:
candidate
=
0
i
=
i
+
1
...
...
@@ -286,7 +286,7 @@ class GenericParser:
if
candidate
:
lhs
=
self
.
_NULLABLE
+
lhs
rule
=
(
lhs
,
rhs
)
if
self
.
newrules
.
has_key
(
lhs
)
:
if
lhs
in
self
.
newrules
:
self
.
newrules
[
lhs
]
.
append
(
rule
)
else
:
self
.
newrules
[
lhs
]
=
[
rule
]
...
...
@@ -365,7 +365,7 @@ class GenericParser:
core
.
sort
()
tcore
=
tuple
(
core
)
if
self
.
cores
.
has_key
(
tcore
)
:
if
tcore
in
self
.
cores
:
return
self
.
cores
[
tcore
]
#
# Nope, doesn't exist. Compute it and the associated
...
...
@@ -389,13 +389,13 @@ class GenericParser:
nextSym
=
rhs
[
pos
]
key
=
(
X
.
stateno
,
nextSym
)
if
n
ot
rules
.
has_key
(
nextSym
)
:
if
not
edges
.
has_key
(
key
)
:
if
n
extSym
not
in
rules
:
if
key
not
in
edges
:
edges
[
key
]
=
None
X
.
T
.
append
(
nextSym
)
else
:
edges
[
key
]
=
None
if
n
ot
predicted
.
has_key
(
nextSym
)
:
if
n
extSym
not
in
predicted
:
predicted
[
nextSym
]
=
1
for
prule
in
rules
[
nextSym
]:
ppos
=
self
.
skip
(
prule
)
...
...
@@ -422,7 +422,7 @@ class GenericParser:
core
=
predicted
.
keys
()
core
.
sort
()
tcore
=
tuple
(
core
)
if
self
.
cores
.
has_key
(
tcore
)
:
if
tcore
in
self
.
cores
:
self
.
edges
[(
k
,
None
)]
=
self
.
cores
[
tcore
]
return
k
...
...
@@ -433,7 +433,7 @@ class GenericParser:
def
goto
(
self
,
state
,
sym
):
key
=
(
state
,
sym
)
if
not
self
.
edges
.
has_key
(
key
)
:
if
key
not
in
self
.
edges
:
#
# No transitions from state on sym.
#
...
...
@@ -631,7 +631,7 @@ class GenericParser:
for
i
in
range
(
len
(
rhs
)
-
1
,
-
1
,
-
1
):
sym
=
rhs
[
i
]
if
not
self
.
newrules
.
has_key
(
sym
)
:
if
sym
not
in
self
.
newrules
:
if
sym
!=
self
.
_BOF
:
attr
[
i
]
=
tokens
[
k
-
1
]
key
=
(
item
,
k
)
...
...
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