diff options
author | cinap_lenrek <cinap_lenrek@localhost> | 2011-05-03 11:25:13 +0000 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@localhost> | 2011-05-03 11:25:13 +0000 |
commit | 458120dd40db6b4df55a4e96b650e16798ef06a0 (patch) | |
tree | 8f82685be24fef97e715c6f5ca4c68d34d5074ee /sys/src/cmd/python/Misc/Vim/syntax_test.py | |
parent | 3a742c699f6806c1145aea5149bf15de15a0afd7 (diff) |
add hg and python
Diffstat (limited to 'sys/src/cmd/python/Misc/Vim/syntax_test.py')
-rw-r--r-- | sys/src/cmd/python/Misc/Vim/syntax_test.py | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/sys/src/cmd/python/Misc/Vim/syntax_test.py b/sys/src/cmd/python/Misc/Vim/syntax_test.py new file mode 100644 index 000000000..ccc7f309c --- /dev/null +++ b/sys/src/cmd/python/Misc/Vim/syntax_test.py @@ -0,0 +1,63 @@ +"""Test file for syntax highlighting of editors. + +Meant to cover a wide range of different types of statements and expressions. +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. + +""" +# Comment +# 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 + 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: pass + +# Constants +'single-quote', u'unicode' # Strings of all kinds; prefixes not highlighted +"double-quote" +"""triple double-quote""" +'''triple single-quote''' +r'raw' +ur'unicode raw' +'escape\n' +'\04' # octal +'\xFF' # hex +'\u1111' # unicode character +1 # Integral +1L +1.0 # Float +.1 +1+2j # Complex + +# Expressions +1 and 2 or 3 # Boolean operators +2 < 3 # UNCOLOURED: comparison operators +spam = 42 # UNCOLOURED: assignment +2 + 3 # UNCOLOURED: number operators +[] # UNCOLOURED: list +{} # UNCOLOURED: dict +(1,) # UNCOLOURED: tuple +all # Built-in functions +GeneratorExit # Exceptions |