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
20e192b6
Kaydet (Commit)
20e192b6
authored
Mar 01, 2006
tarafından
Brett Cannon
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Update for 'with' statement.
üst
a9f06872
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
17 deletions
+24
-17
python.vim
Misc/Vim/python.vim
+7
-5
syntax_test.py
Misc/Vim/syntax_test.py
+11
-3
vim_syntax.py
Misc/Vim/vim_syntax.py
+6
-9
No files found.
Misc/Vim/python.vim
Dosyayı görüntüle @
20e192b6
...
...
@@ -14,8 +14,9 @@ if exists("python_highlight_all")
let
python_highlight_space_errors
=
1
endif
syn
keyword pythonStatement assert
break
continue del except exec
finally
syn
keyword pythonStatement global lambda pass print raise
return
try
yield
syn
keyword pythonStatement
as
assert
break
continue del except exec
finally
syn
keyword pythonStatement global lambda pass print raise
return
try
with
syn
keyword pythonStatement yield
syn
keyword pythonStatement def class nextgroup
=
pythonFunction skipwhite
...
...
@@ -82,8 +83,9 @@ if exists("python_highlight_exceptions")
syn
keyword pythonException UnicodeTranslateError MemoryError StopIteration
syn
keyword pythonException PendingDeprecationWarning EnvironmentError
syn
keyword pythonException LookupError OSError DeprecationWarning
syn
keyword pythonException UnicodeError FloatingPointError ReferenceError
syn
keyword pythonException NameError OverflowWarning IOError SyntaxError
syn
keyword pythonException UnicodeError UnicodeEncodeError
syn
keyword pythonException FloatingPointError ReferenceError NameError
syn
keyword pythonException OverflowWarning IOError SyntaxError
syn
keyword pythonException FutureWarning SystemExit Exception EOFError
syn
keyword pythonException StandardError ValueError TabError KeyError
syn
keyword pythonException ZeroDivisionError SystemError
...
...
@@ -92,7 +94,7 @@ if exists("python_highlight_exceptions")
syn
keyword pythonException RuntimeWarning KeyboardInterrupt UserWarning
syn
keyword pythonException SyntaxWarning UnboundLocalError ArithmeticError
syn
keyword pythonException Warning NotImplementedError AttributeError
syn
keyword pythonException OverflowError
UnicodeEncodeError
syn
keyword pythonException OverflowError
BaseException
endif
...
...
Misc/Vim/syntax_test.py
Dosyayı görüntüle @
20e192b6
...
...
@@ -13,20 +13,28 @@ repository.
# OPTIONAL: XXX catch your attention
# Statements
from
__future__
import
with_statement
# Import
from
sys
import
path
as
thing
assert
True
# keyword
def
foo
():
# function definition
return
[]
class
Bar
(
object
):
# Class definition
pass
def
__context__
(
self
):
return
self
def
__enter__
(
self
):
pass
def
__exit__
(
self
,
*
args
):
pass
foo
()
# UNCOLOURED: function call
while
False
:
# 'while'
continue
for
x
in
foo
():
# 'for'
break
with
Bar
()
as
stuff
:
pass
if
False
:
pass
# 'if'
elif
False
:
pass
else
False
:
pass
from
sys
import
path
as
thing
# Import
else
:
pass
# Constants
'single-quote'
,
u'unicode'
# Strings of all kinds; prefixes not highlighted
...
...
Misc/Vim/vim_syntax.py
Dosyayı görüntüle @
20e192b6
from
__future__
import
with_statement
import
keyword
import
exceptions
import
__builtin__
...
...
@@ -143,11 +145,9 @@ def fill_stmt(iterable, fill_len):
except
StopIteration
:
if
buffer_
:
break
if
not
buffer_
and
overflow
:
yield
buffer_
return
else
:
return
if
overflow
:
yield
overflow
return
if
total_len
>
fill_len
:
overflow
=
buffer_
.
pop
()
total_len
-=
len
(
overflow
)
-
1
...
...
@@ -158,8 +158,7 @@ def fill_stmt(iterable, fill_len):
FILL
=
80
def
main
(
file_path
):
FILE
=
open
(
file_path
,
'w'
)
try
:
with
open
(
file_path
,
'w'
)
as
FILE
:
# Comment for file
print
>>
FILE
,
comment_header
print
>>
FILE
,
''
...
...
@@ -222,8 +221,6 @@ def main(file_path):
print
>>
FILE
,
''
# Statements at the end of the file
print
>>
FILE
,
statement_footer
finally
:
FILE
.
close
()
if
__name__
==
'__main__'
:
main
(
"python.vim"
)
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