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
ce73acf5
Kaydet (Commit)
ce73acf5
authored
Nis 10, 1998
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Tim's version 4, with my mods
üst
c9ea7572
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
42 deletions
+18
-42
tabnanny.py
Lib/tabnanny.py
+6
-14
tabnanny.py
Tools/idle/tabnanny.py
+6
-14
tabnanny.py
Tools/scripts/tabnanny.py
+6
-14
No files found.
Lib/tabnanny.py
Dosyayı görüntüle @
ce73acf5
...
@@ -2,9 +2,9 @@
...
@@ -2,9 +2,9 @@
"""The Tab Nanny despises ambiguous indentation. She knows no mercy."""
"""The Tab Nanny despises ambiguous indentation. She knows no mercy."""
# Released to the public domain, by Tim Peters,
4
April 1998.
# Released to the public domain, by Tim Peters,
6
April 1998.
__version__
=
"
3
"
__version__
=
"
4
"
import
os
import
os
import
sys
import
sys
...
@@ -24,7 +24,7 @@ def main():
...
@@ -24,7 +24,7 @@ def main():
if
o
==
'-v'
:
if
o
==
'-v'
:
verbose
=
verbose
+
1
verbose
=
verbose
+
1
if
not
args
:
if
not
args
:
print
"Usage:"
,
sys
.
argv
[
0
],
"file_or_directory ..."
print
"Usage:"
,
sys
.
argv
[
0
],
"
[-v]
file_or_directory ..."
return
return
for
arg
in
args
:
for
arg
in
args
:
check
(
arg
)
check
(
arg
)
...
@@ -245,18 +245,10 @@ if hasattr(tokenize, 'NL'):
...
@@ -245,18 +245,10 @@ if hasattr(tokenize, 'NL'):
INDENT
=
tokenize
.
INDENT
,
INDENT
=
tokenize
.
INDENT
,
DEDENT
=
tokenize
.
DEDENT
,
DEDENT
=
tokenize
.
DEDENT
,
NEWLINE
=
tokenize
.
NEWLINE
,
NEWLINE
=
tokenize
.
NEWLINE
,
COMMENT
=
tokenize
.
COMMENT
,
JUNK
=
(
tokenize
.
COMMENT
,
tokenize
.
NL
)
):
NL
=
tokenize
.
NL
):
global
indents
,
check_equal
global
indents
,
check_equal
# test in decreasing order of frequency, although the check_equal
if
type
==
NEWLINE
:
# test *must* be last; INDENT and DEDENT appear equally often
if
type
in
(
COMMENT
,
NL
):
# the indentation of these guys is meaningless
pass
elif
type
==
NEWLINE
:
# a program statement, or ENDMARKER, will eventually follow,
# a program statement, or ENDMARKER, will eventually follow,
# after some (possibly empty) run of tokens of the form
# after some (possibly empty) run of tokens of the form
# (NL | COMMENT)* (INDENT | DEDENT+)?
# (NL | COMMENT)* (INDENT | DEDENT+)?
...
@@ -281,7 +273,7 @@ if hasattr(tokenize, 'NL'):
...
@@ -281,7 +273,7 @@ if hasattr(tokenize, 'NL'):
assert
check_equal
# else no earlier NEWLINE, or an earlier INDENT
assert
check_equal
# else no earlier NEWLINE, or an earlier INDENT
del
indents
[
-
1
]
del
indents
[
-
1
]
elif
check_equal
:
elif
check_equal
and
type
not
in
JUNK
:
# this is the first "real token" following a NEWLINE, so it
# this is the first "real token" following a NEWLINE, so it
# must be the first token of the next program statement, or an
# must be the first token of the next program statement, or an
# ENDMARKER; the "line" argument exposes the leading whitespace
# ENDMARKER; the "line" argument exposes the leading whitespace
...
...
Tools/idle/tabnanny.py
Dosyayı görüntüle @
ce73acf5
...
@@ -2,9 +2,9 @@
...
@@ -2,9 +2,9 @@
"""The Tab Nanny despises ambiguous indentation. She knows no mercy."""
"""The Tab Nanny despises ambiguous indentation. She knows no mercy."""
# Released to the public domain, by Tim Peters,
4
April 1998.
# Released to the public domain, by Tim Peters,
6
April 1998.
__version__
=
"
3
"
__version__
=
"
4
"
import
os
import
os
import
sys
import
sys
...
@@ -24,7 +24,7 @@ def main():
...
@@ -24,7 +24,7 @@ def main():
if
o
==
'-v'
:
if
o
==
'-v'
:
verbose
=
verbose
+
1
verbose
=
verbose
+
1
if
not
args
:
if
not
args
:
print
"Usage:"
,
sys
.
argv
[
0
],
"file_or_directory ..."
print
"Usage:"
,
sys
.
argv
[
0
],
"
[-v]
file_or_directory ..."
return
return
for
arg
in
args
:
for
arg
in
args
:
check
(
arg
)
check
(
arg
)
...
@@ -245,18 +245,10 @@ if hasattr(tokenize, 'NL'):
...
@@ -245,18 +245,10 @@ if hasattr(tokenize, 'NL'):
INDENT
=
tokenize
.
INDENT
,
INDENT
=
tokenize
.
INDENT
,
DEDENT
=
tokenize
.
DEDENT
,
DEDENT
=
tokenize
.
DEDENT
,
NEWLINE
=
tokenize
.
NEWLINE
,
NEWLINE
=
tokenize
.
NEWLINE
,
COMMENT
=
tokenize
.
COMMENT
,
JUNK
=
(
tokenize
.
COMMENT
,
tokenize
.
NL
)
):
NL
=
tokenize
.
NL
):
global
indents
,
check_equal
global
indents
,
check_equal
# test in decreasing order of frequency, although the check_equal
if
type
==
NEWLINE
:
# test *must* be last; INDENT and DEDENT appear equally often
if
type
in
(
COMMENT
,
NL
):
# the indentation of these guys is meaningless
pass
elif
type
==
NEWLINE
:
# a program statement, or ENDMARKER, will eventually follow,
# a program statement, or ENDMARKER, will eventually follow,
# after some (possibly empty) run of tokens of the form
# after some (possibly empty) run of tokens of the form
# (NL | COMMENT)* (INDENT | DEDENT+)?
# (NL | COMMENT)* (INDENT | DEDENT+)?
...
@@ -281,7 +273,7 @@ if hasattr(tokenize, 'NL'):
...
@@ -281,7 +273,7 @@ if hasattr(tokenize, 'NL'):
assert
check_equal
# else no earlier NEWLINE, or an earlier INDENT
assert
check_equal
# else no earlier NEWLINE, or an earlier INDENT
del
indents
[
-
1
]
del
indents
[
-
1
]
elif
check_equal
:
elif
check_equal
and
type
not
in
JUNK
:
# this is the first "real token" following a NEWLINE, so it
# this is the first "real token" following a NEWLINE, so it
# must be the first token of the next program statement, or an
# must be the first token of the next program statement, or an
# ENDMARKER; the "line" argument exposes the leading whitespace
# ENDMARKER; the "line" argument exposes the leading whitespace
...
...
Tools/scripts/tabnanny.py
Dosyayı görüntüle @
ce73acf5
...
@@ -2,9 +2,9 @@
...
@@ -2,9 +2,9 @@
"""The Tab Nanny despises ambiguous indentation. She knows no mercy."""
"""The Tab Nanny despises ambiguous indentation. She knows no mercy."""
# Released to the public domain, by Tim Peters,
4
April 1998.
# Released to the public domain, by Tim Peters,
6
April 1998.
__version__
=
"
3
"
__version__
=
"
4
"
import
os
import
os
import
sys
import
sys
...
@@ -24,7 +24,7 @@ def main():
...
@@ -24,7 +24,7 @@ def main():
if
o
==
'-v'
:
if
o
==
'-v'
:
verbose
=
verbose
+
1
verbose
=
verbose
+
1
if
not
args
:
if
not
args
:
print
"Usage:"
,
sys
.
argv
[
0
],
"file_or_directory ..."
print
"Usage:"
,
sys
.
argv
[
0
],
"
[-v]
file_or_directory ..."
return
return
for
arg
in
args
:
for
arg
in
args
:
check
(
arg
)
check
(
arg
)
...
@@ -245,18 +245,10 @@ if hasattr(tokenize, 'NL'):
...
@@ -245,18 +245,10 @@ if hasattr(tokenize, 'NL'):
INDENT
=
tokenize
.
INDENT
,
INDENT
=
tokenize
.
INDENT
,
DEDENT
=
tokenize
.
DEDENT
,
DEDENT
=
tokenize
.
DEDENT
,
NEWLINE
=
tokenize
.
NEWLINE
,
NEWLINE
=
tokenize
.
NEWLINE
,
COMMENT
=
tokenize
.
COMMENT
,
JUNK
=
(
tokenize
.
COMMENT
,
tokenize
.
NL
)
):
NL
=
tokenize
.
NL
):
global
indents
,
check_equal
global
indents
,
check_equal
# test in decreasing order of frequency, although the check_equal
if
type
==
NEWLINE
:
# test *must* be last; INDENT and DEDENT appear equally often
if
type
in
(
COMMENT
,
NL
):
# the indentation of these guys is meaningless
pass
elif
type
==
NEWLINE
:
# a program statement, or ENDMARKER, will eventually follow,
# a program statement, or ENDMARKER, will eventually follow,
# after some (possibly empty) run of tokens of the form
# after some (possibly empty) run of tokens of the form
# (NL | COMMENT)* (INDENT | DEDENT+)?
# (NL | COMMENT)* (INDENT | DEDENT+)?
...
@@ -281,7 +273,7 @@ if hasattr(tokenize, 'NL'):
...
@@ -281,7 +273,7 @@ if hasattr(tokenize, 'NL'):
assert
check_equal
# else no earlier NEWLINE, or an earlier INDENT
assert
check_equal
# else no earlier NEWLINE, or an earlier INDENT
del
indents
[
-
1
]
del
indents
[
-
1
]
elif
check_equal
:
elif
check_equal
and
type
not
in
JUNK
:
# this is the first "real token" following a NEWLINE, so it
# this is the first "real token" following a NEWLINE, so it
# must be the first token of the next program statement, or an
# must be the first token of the next program statement, or an
# ENDMARKER; the "line" argument exposes the leading whitespace
# ENDMARKER; the "line" argument exposes the leading whitespace
...
...
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