| 1 | n/a | """Test file for syntax highlighting of editors. |
|---|
| 2 | n/a | |
|---|
| 3 | n/a | Meant to cover a wide range of different types of statements and expressions. |
|---|
| 4 | n/a | Not necessarily sensical or comprehensive (assume that if one exception is |
|---|
| 5 | n/a | highlighted that all are, for instance). |
|---|
| 6 | n/a | |
|---|
| 7 | n/a | Extraneous trailing whitespace can't be tested because of svn pre-commit hook |
|---|
| 8 | n/a | checks for such things. |
|---|
| 9 | n/a | |
|---|
| 10 | n/a | """ |
|---|
| 11 | n/a | # Comment |
|---|
| 12 | n/a | # OPTIONAL: XXX catch your attention |
|---|
| 13 | n/a | |
|---|
| 14 | n/a | # Statements |
|---|
| 15 | n/a | from __future__ import with_statement # Import |
|---|
| 16 | n/a | from sys import path as thing |
|---|
| 17 | n/a | assert True # keyword |
|---|
| 18 | n/a | def foo(): # function definition |
|---|
| 19 | n/a | return [] |
|---|
| 20 | n/a | class Bar(object): # Class definition |
|---|
| 21 | n/a | def __enter__(self): |
|---|
| 22 | n/a | pass |
|---|
| 23 | n/a | def __exit__(self, *args): |
|---|
| 24 | n/a | pass |
|---|
| 25 | n/a | foo() # UNCOLOURED: function call |
|---|
| 26 | n/a | while False: # 'while' |
|---|
| 27 | n/a | continue |
|---|
| 28 | n/a | for x in foo(): # 'for' |
|---|
| 29 | n/a | break |
|---|
| 30 | n/a | with Bar() as stuff: |
|---|
| 31 | n/a | pass |
|---|
| 32 | n/a | if False: pass # 'if' |
|---|
| 33 | n/a | elif False: pass |
|---|
| 34 | n/a | else: pass |
|---|
| 35 | n/a | |
|---|
| 36 | n/a | # Constants |
|---|
| 37 | n/a | 'single-quote', u'unicode' # Strings of all kinds; prefixes not highlighted |
|---|
| 38 | n/a | "double-quote" |
|---|
| 39 | n/a | """triple double-quote""" |
|---|
| 40 | n/a | '''triple single-quote''' |
|---|
| 41 | n/a | r'raw' |
|---|
| 42 | n/a | ur'unicode raw' |
|---|
| 43 | n/a | 'escape\n' |
|---|
| 44 | n/a | '\04' # octal |
|---|
| 45 | n/a | '\xFF' # hex |
|---|
| 46 | n/a | '\u1111' # unicode character |
|---|
| 47 | n/a | 1 # Integral |
|---|
| 48 | n/a | 1L |
|---|
| 49 | n/a | 1.0 # Float |
|---|
| 50 | n/a | .1 |
|---|
| 51 | n/a | 1+2j # Complex |
|---|
| 52 | n/a | |
|---|
| 53 | n/a | # Expressions |
|---|
| 54 | n/a | 1 and 2 or 3 # Boolean operators |
|---|
| 55 | n/a | 2 < 3 # UNCOLOURED: comparison operators |
|---|
| 56 | n/a | spam = 42 # UNCOLOURED: assignment |
|---|
| 57 | n/a | 2 + 3 # UNCOLOURED: number operators |
|---|
| 58 | n/a | [] # UNCOLOURED: list |
|---|
| 59 | n/a | {} # UNCOLOURED: dict |
|---|
| 60 | n/a | (1,) # UNCOLOURED: tuple |
|---|
| 61 | n/a | all # Built-in functions |
|---|
| 62 | n/a | GeneratorExit # Exceptions |
|---|