mirror of
https://github.com/python/cpython.git
synced 2025-11-03 19:34:08 +00:00
Remove line meant to test trailing whitespace since that kind of whitespace is
automatically removed. Also annotate what each line is meant to test.
This commit is contained in:
parent
d6e7e73ff8
commit
23b0dc5053
1 changed files with 40 additions and 19 deletions
|
|
@ -1,19 +1,35 @@
|
||||||
"""Test file for syntax highlighting of editors.
|
"""Test file for syntax highlighting of editors.
|
||||||
|
|
||||||
Meant to cover a wide range of different types of statements and expressions.
|
Meant to cover a wide range of different types of statements and expressions.
|
||||||
Not necessarily sensical.
|
Not necessarily sensical or comprehensive (assume that if one exception is
|
||||||
|
highlighted that all are, for instance).
|
||||||
|
|
||||||
|
Highlighting extraneous whitespace at the end of the line is not represented
|
||||||
|
here as all trailing whitespace is automatically removed from .py files in the
|
||||||
|
repository.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
assert True
|
|
||||||
def foo(): pass
|
|
||||||
foo() # Uncoloured
|
|
||||||
while False: pass
|
|
||||||
1 and 2
|
|
||||||
if False: pass
|
|
||||||
from sys import path
|
|
||||||
# Comment
|
# Comment
|
||||||
# XXX catch your attention
|
# OPTIONAL: XXX catch your attention
|
||||||
'single-quote', u'unicode'
|
|
||||||
|
# Statements
|
||||||
|
assert True # keyword
|
||||||
|
def foo(): # function definition
|
||||||
|
return []
|
||||||
|
class Bar(object): # Class definition
|
||||||
|
pass
|
||||||
|
foo() # UNCOLOURED: function call
|
||||||
|
while False: # 'while'
|
||||||
|
continue
|
||||||
|
for x in foo(): # 'for'
|
||||||
|
break
|
||||||
|
if False: pass # 'if'
|
||||||
|
elif False: pass
|
||||||
|
else False: pass
|
||||||
|
from sys import path as thing # Import
|
||||||
|
|
||||||
|
# Constants
|
||||||
|
'single-quote', u'unicode' # Strings of all kinds; prefixes not highlighted
|
||||||
"double-quote"
|
"double-quote"
|
||||||
"""triple double-quote"""
|
"""triple double-quote"""
|
||||||
'''triple single-quote'''
|
'''triple single-quote'''
|
||||||
|
|
@ -23,14 +39,19 @@ ur'unicode raw'
|
||||||
'\04' # octal
|
'\04' # octal
|
||||||
'\xFF' # hex
|
'\xFF' # hex
|
||||||
'\u1111' # unicode character
|
'\u1111' # unicode character
|
||||||
1
|
1 # Integral
|
||||||
1L
|
1L
|
||||||
1.0
|
1.0 # Float
|
||||||
.1
|
.1
|
||||||
1+2j
|
1+2j # Complex
|
||||||
[] # Uncoloured
|
|
||||||
{} # Uncoloured
|
# Expressions
|
||||||
() # Uncoloured
|
1 and 2 or 3 # Boolean operators
|
||||||
all
|
2 < 3 # UNCOLOURED: comparison operators
|
||||||
GeneratorExit
|
spam = 42 # UNCOLOURED: assignment
|
||||||
trailing_whitespace = path
|
2 + 3 # UNCOLOURED: number operators
|
||||||
|
[] # UNCOLOURED: list
|
||||||
|
{} # UNCOLOURED: dict
|
||||||
|
(1,) # UNCOLOURED: tuple
|
||||||
|
all # Built-in functions
|
||||||
|
GeneratorExit # Exceptions
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue