Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 23b0dc5

Browse files
committed
Remove line meant to test trailing whitespace since that kind of whitespace is
automatically removed. Also annotate what each line is meant to test.
1 parent d6e7e73 commit 23b0dc5

1 file changed

Lines changed: 40 additions & 19 deletions

File tree

Misc/Vim/syntax_test.py

Lines changed: 40 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,35 @@
11
"""Test file for syntax highlighting of editors.
22
33
Meant to cover a wide range of different types of statements and expressions.
4-
Not necessarily sensical.
4+
Not necessarily sensical or comprehensive (assume that if one exception is
5+
highlighted that all are, for instance).
6+
7+
Highlighting extraneous whitespace at the end of the line is not represented
8+
here as all trailing whitespace is automatically removed from .py files in the
9+
repository.
510
611
"""
7-
assert True
8-
def foo(): pass
9-
foo() # Uncoloured
10-
while False: pass
11-
1 and 2
12-
if False: pass
13-
from sys import path
1412
# Comment
15-
# XXX catch your attention
16-
'single-quote', u'unicode'
13+
# OPTIONAL: XXX catch your attention
14+
15+
# Statements
16+
assert True # keyword
17+
def foo(): # function definition
18+
return []
19+
class Bar(object): # Class definition
20+
pass
21+
foo() # UNCOLOURED: function call
22+
while False: # 'while'
23+
continue
24+
for x in foo(): # 'for'
25+
break
26+
if False: pass # 'if'
27+
elif False: pass
28+
else False: pass
29+
from sys import path as thing # Import
30+
31+
# Constants
32+
'single-quote', u'unicode' # Strings of all kinds; prefixes not highlighted
1733
"double-quote"
1834
"""triple double-quote"""
1935
'''triple single-quote'''
@@ -23,14 +39,19 @@ def foo(): pass
2339
'\04' # octal
2440
'\xFF' # hex
2541
'\u1111' # unicode character
26-
1
42+
1 # Integral
2743
1L
28-
1.0
44+
1.0 # Float
2945
.1
30-
1+2j
31-
[] # Uncoloured
32-
{} # Uncoloured
33-
() # Uncoloured
34-
all
35-
GeneratorExit
36-
trailing_whitespace = path
46+
1+2j # Complex
47+
48+
# Expressions
49+
1 and 2 or 3 # Boolean operators
50+
2 < 3 # UNCOLOURED: comparison operators
51+
spam = 42 # UNCOLOURED: assignment
52+
2 + 3 # UNCOLOURED: number operators
53+
[] # UNCOLOURED: list
54+
{} # UNCOLOURED: dict
55+
(1,) # UNCOLOURED: tuple
56+
all # Built-in functions
57+
GeneratorExit # Exceptions

0 commit comments

Comments
 (0)