summaryrefslogtreecommitdiff
path: root/support/highlight/langDefs/py.lang
blob: f298c1bc1a9dccf8b6562d5e4c49e1362982e199 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Python language definition file
#
# Author: Andre Simon
#   Mail: andre.simon1@gmx.de
#   Date: 3.4.2002
# ------------------------------------------
# This file is part of highlight, a free source code converter released under the GPL.
#
# The file is used to describe keywords and special symbols of programming languages.
# See README in the highlight directory for details.
#
# New definition files for future releases of highlight are always appreciated ;)
#
# ----------
# andre.simon1@gmx.de
# http:/www.andre-simon.de/

# "keyword" groups are taken from the VIM-Syntaxfile of Neil Schemenauer
# (almost: None is a keyword now; True and False are planned to become
# keywords)

$DESCRIPTION=Python

#keywords
$KEYWORDS(kwa)= break continue del except exec finally pass print raise
return try global assert lambda yield def class for while if elif else
and in is not or import from as None True False

#builtins, including types
$KEYWORDS(kwb)= bool enumerate set frozenset help reversed sorted sum
Ellipsis NotImplemented __import__ abs apply buffer callable chr
classmethod cmp coerce compile complex delattr dict dir divmod eval
execfile file filter float getattr globals hasattr hash hex id input
int intern isinstance issubclass iter len list locals long map max min
object oct open ord pow property range raw_input reduce reload repr
round setattr slice staticmethod str super tuple type unichr unicode
vars xrange zip

#exceptions
$KEYWORDS(kwc)= ArithmeticError AssertionError AttributeError
DeprecationWarning EOFError EnvironmentError Exception
FloatingPointError IOError ImportError IndentationError IndexError
KeyError KeyboardInterrupt LookupError MemoryError NameError
NotImplementedError OSError OverflowError OverflowWarning
ReferenceError RuntimeError RuntimeWarning StandardError StopIteration
SyntaxError SyntaxWarning SystemError SystemExit TabError TypeError
UnboundLocalError UnicodeError UnicodeEncodeError UnicodeDecodeError
UnicodeTranslateError UserWarning ValueError Warning WindowsError
ZeroDivisionError

$KEYWORDS(kwd)=regex((\w+)\s*\()

$STRINGDELIMITERS=""" ''' " ' 

$RAWSTRINGPREFIX=r

$SL_COMMENT=#

$IGNORECASE=false

$ESCCHAR=regex(\\\d{3}|\\x\p{XDigit}{2}|\\[ntvbrfa\\\?'"])

$SYMBOLS= ( ) [ ] { } , ; . : & | < > !  = / * %  + - @