annotate runtime/syntax/python2.vim @ 33951:45a50fd59a73 v9.0.2170

patch 9.0.2170: Vim9: no support for const/final class/objects vars Commit: https://github.com/vim/vim/commit/e5437c542709b77ade084f96e60d84d4e847e6d3 Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Sat Dec 16 14:11:19 2023 +0100 patch 9.0.2170: Vim9: no support for const/final class/objects vars Problem: Vim9: no support for const/final class/objects vars Solution: Support final and const object and class variables closes: #13655 Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Sat, 16 Dec 2023 14:15:05 +0100
parents b2412874362f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
32061
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
1 " Vim syntax file
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
2 " Language: Python 2
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
3 " Maintainer: Zvezdan Petkovic <zpetkovic@acm.org>
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
4 " Last Change: 2016 Oct 29
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
5 " Credits: Neil Schemenauer <nas@python.ca>
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
6 " Dmitry Vasiliev
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
7 "
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
8 " This version is a major rewrite by Zvezdan Petkovic.
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
9 "
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
10 " - introduced highlighting of doctests
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
11 " - updated keywords, built-ins, and exceptions
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
12 " - corrected regular expressions for
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
13 "
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
14 " * functions
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
15 " * decorators
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
16 " * strings
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
17 " * escapes
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
18 " * numbers
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
19 " * space error
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
20 "
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
21 " - corrected synchronization
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
22 " - more highlighting is ON by default, except
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
23 " - space error highlighting is OFF by default
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
24 "
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
25 " Optional highlighting can be controlled using these variables.
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
26 "
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
27 " let python_no_builtin_highlight = 1
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
28 " let python_no_doctest_code_highlight = 1
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
29 " let python_no_doctest_highlight = 1
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
30 " let python_no_exception_highlight = 1
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
31 " let python_no_number_highlight = 1
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
32 " let python_space_error_highlight = 1
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
33 "
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
34 " All the options above can be switched on together.
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
35 "
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
36 " let python_highlight_all = 1
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
37 "
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
38 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
39 " NOTE: This file is a copy of the last commit of runtime/syntax/python.vim
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
40 " that still supported Python 2. There is support for Python 3, up to 3.5,
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
41 " and it was kept in the file as is, because it supports the straddling code
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
42 " (Python 2 and 3 compatible) better.
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
43 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
44
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
45 " quit when a syntax file was already loaded.
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
46 if exists("b:current_syntax")
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
47 finish
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
48 endif
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
49
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
50 " We need nocompatible mode in order to continue lines with backslashes.
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
51 " Original setting will be restored.
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
52 let s:cpo_save = &cpo
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
53 set cpo&vim
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
54
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
55 if exists("python_no_doctest_highlight")
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
56 let python_no_doctest_code_highlight = 1
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
57 endif
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
58
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
59 if exists("python_highlight_all")
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
60 if exists("python_no_builtin_highlight")
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
61 unlet python_no_builtin_highlight
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
62 endif
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
63 if exists("python_no_doctest_code_highlight")
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
64 unlet python_no_doctest_code_highlight
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
65 endif
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
66 if exists("python_no_doctest_highlight")
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
67 unlet python_no_doctest_highlight
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
68 endif
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
69 if exists("python_no_exception_highlight")
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
70 unlet python_no_exception_highlight
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
71 endif
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
72 if exists("python_no_number_highlight")
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
73 unlet python_no_number_highlight
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
74 endif
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
75 let python_space_error_highlight = 1
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
76 endif
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
77
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
78 " Keep Python keywords in alphabetical order inside groups for easy
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
79 " comparison with the table in the 'Python Language Reference'
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
80 " https://docs.python.org/2/reference/lexical_analysis.html#keywords,
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
81 " https://docs.python.org/3/reference/lexical_analysis.html#keywords.
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
82 " Groups are in the order presented in NAMING CONVENTIONS in syntax.txt.
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
83 " Exceptions come last at the end of each group (class and def below).
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
84 "
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
85 " Keywords 'with' and 'as' are new in Python 2.6
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
86 " (use 'from __future__ import with_statement' in Python 2.5).
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
87 "
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
88 " Some compromises had to be made to support both Python 3 and 2.
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
89 " We include Python 3 features, but when a definition is duplicated,
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
90 " the last definition takes precedence.
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
91 "
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
92 " - 'False', 'None', and 'True' are keywords in Python 3 but they are
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
93 " built-ins in 2 and will be highlighted as built-ins below.
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
94 " - 'exec' is a built-in in Python 3 and will be highlighted as
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
95 " built-in below.
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
96 " - 'nonlocal' is a keyword in Python 3 and will be highlighted.
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
97 " - 'print' is a built-in in Python 3 and will be highlighted as
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
98 " built-in below (use 'from __future__ import print_function' in 2)
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
99 " - async and await were added in Python 3.5 and are soft keywords.
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
100 "
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
101 syn keyword pythonStatement False None True
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
102 syn keyword pythonStatement as assert break continue del exec global
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
103 syn keyword pythonStatement lambda nonlocal pass print return with yield
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
104 syn keyword pythonStatement class def nextgroup=pythonFunction skipwhite
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
105 syn keyword pythonConditional elif else if
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
106 syn keyword pythonRepeat for while
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
107 syn keyword pythonOperator and in is not or
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
108 syn keyword pythonException except finally raise try
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
109 syn keyword pythonInclude from import
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
110 syn keyword pythonAsync async await
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
111
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
112 " Decorators (new in Python 2.4)
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
113 " A dot must be allowed because of @MyClass.myfunc decorators.
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
114 syn match pythonDecorator "@" display contained
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
115 syn match pythonDecoratorName "@\s*\h\%(\w\|\.\)*" display contains=pythonDecorator
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
116
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
117 " Python 3.5 introduced the use of the same symbol for matrix multiplication:
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
118 " https://www.python.org/dev/peps/pep-0465/. We now have to exclude the
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
119 " symbol from highlighting when used in that context.
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
120 " Single line multiplication.
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
121 syn match pythonMatrixMultiply
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
122 \ "\%(\w\|[])]\)\s*@"
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
123 \ contains=ALLBUT,pythonDecoratorName,pythonDecorator,pythonFunction,pythonDoctestValue
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
124 \ transparent
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
125 " Multiplication continued on the next line after backslash.
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
126 syn match pythonMatrixMultiply
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
127 \ "[^\\]\\\s*\n\%(\s*\.\.\.\s\)\=\s\+@"
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
128 \ contains=ALLBUT,pythonDecoratorName,pythonDecorator,pythonFunction,pythonDoctestValue
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
129 \ transparent
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
130 " Multiplication in a parenthesized expression over multiple lines with @ at
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
131 " the start of each continued line; very similar to decorators and complex.
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
132 syn match pythonMatrixMultiply
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
133 \ "^\s*\%(\%(>>>\|\.\.\.\)\s\+\)\=\zs\%(\h\|\%(\h\|[[(]\).\{-}\%(\w\|[])]\)\)\s*\n\%(\s*\.\.\.\s\)\=\s\+@\%(.\{-}\n\%(\s*\.\.\.\s\)\=\s\+@\)*"
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
134 \ contains=ALLBUT,pythonDecoratorName,pythonDecorator,pythonFunction,pythonDoctestValue
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
135 \ transparent
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
136
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
137 syn match pythonFunction "\h\w*" display contained
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
138
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
139 syn match pythonComment "#.*$" contains=pythonTodo,@Spell
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
140 syn keyword pythonTodo FIXME NOTE NOTES TODO XXX contained
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
141
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
142 " Triple-quoted strings can contain doctests.
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
143 syn region pythonString matchgroup=pythonQuotes
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
144 \ start=+[uU]\=\z(['"]\)+ end="\z1" skip="\\\\\|\\\z1"
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
145 \ contains=pythonEscape,@Spell
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
146 syn region pythonString matchgroup=pythonTripleQuotes
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
147 \ start=+[uU]\=\z('''\|"""\)+ end="\z1" keepend
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
148 \ contains=pythonEscape,pythonSpaceError,pythonDoctest,@Spell
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
149 syn region pythonRawString matchgroup=pythonQuotes
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
150 \ start=+[uU]\=[rR]\z(['"]\)+ end="\z1" skip="\\\\\|\\\z1"
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
151 \ contains=@Spell
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
152 syn region pythonRawString matchgroup=pythonTripleQuotes
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
153 \ start=+[uU]\=[rR]\z('''\|"""\)+ end="\z1" keepend
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
154 \ contains=pythonSpaceError,pythonDoctest,@Spell
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
155
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
156 syn match pythonEscape +\\[abfnrtv'"\\]+ contained
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
157 syn match pythonEscape "\\\o\{1,3}" contained
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
158 syn match pythonEscape "\\x\x\{2}" contained
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
159 syn match pythonEscape "\%(\\u\x\{4}\|\\U\x\{8}\)" contained
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
160 " Python allows case-insensitive Unicode IDs: http://www.unicode.org/charts/
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
161 syn match pythonEscape "\\N{\a\+\%(\s\a\+\)*}" contained
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
162 syn match pythonEscape "\\$"
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
163
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
164 " It is very important to understand all details before changing the
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
165 " regular expressions below or their order.
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
166 " The word boundaries are *not* the floating-point number boundaries
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
167 " because of a possible leading or trailing decimal point.
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
168 " The expressions below ensure that all valid number literals are
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
169 " highlighted, and invalid number literals are not. For example,
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
170 "
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
171 " - a decimal point in '4.' at the end of a line is highlighted,
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
172 " - a second dot in 1.0.0 is not highlighted,
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
173 " - 08 is not highlighted,
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
174 " - 08e0 or 08j are highlighted,
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
175 "
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
176 " and so on, as specified in the 'Python Language Reference'.
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
177 " https://docs.python.org/2/reference/lexical_analysis.html#numeric-literals
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
178 " https://docs.python.org/3/reference/lexical_analysis.html#numeric-literals
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
179 if !exists("python_no_number_highlight")
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
180 " numbers (including longs and complex)
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
181 syn match pythonNumber "\<0[oO]\=\o\+[Ll]\=\>"
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
182 syn match pythonNumber "\<0[xX]\x\+[Ll]\=\>"
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
183 syn match pythonNumber "\<0[bB][01]\+[Ll]\=\>"
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
184 syn match pythonNumber "\<\%([1-9]\d*\|0\)[Ll]\=\>"
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
185 syn match pythonNumber "\<\d\+[jJ]\>"
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
186 syn match pythonNumber "\<\d\+[eE][+-]\=\d\+[jJ]\=\>"
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
187 syn match pythonNumber
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
188 \ "\<\d\+\.\%([eE][+-]\=\d\+\)\=[jJ]\=\%(\W\|$\)\@="
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
189 syn match pythonNumber
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
190 \ "\%(^\|\W\)\zs\d*\.\d\+\%([eE][+-]\=\d\+\)\=[jJ]\=\>"
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
191 endif
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
192
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
193 " Group the built-ins in the order in the 'Python Library Reference' for
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
194 " easier comparison.
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
195 " https://docs.python.org/2/library/constants.html
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
196 " https://docs.python.org/3/library/constants.html
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
197 " http://docs.python.org/2/library/functions.html
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
198 " http://docs.python.org/3/library/functions.html
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
199 " http://docs.python.org/2/library/functions.html#non-essential-built-in-functions
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
200 " http://docs.python.org/3/library/functions.html#non-essential-built-in-functions
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
201 " Python built-in functions are in alphabetical order.
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
202 if !exists("python_no_builtin_highlight")
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
203 " built-in constants
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
204 " 'False', 'True', and 'None' are also reserved words in Python 3
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
205 syn keyword pythonBuiltin False True None
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
206 syn keyword pythonBuiltin NotImplemented Ellipsis __debug__
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
207 " built-in functions
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
208 syn keyword pythonBuiltin abs all any bin bool bytearray callable chr
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
209 syn keyword pythonBuiltin classmethod compile complex delattr dict dir
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
210 syn keyword pythonBuiltin divmod enumerate eval filter float format
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
211 syn keyword pythonBuiltin frozenset getattr globals hasattr hash
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
212 syn keyword pythonBuiltin help hex id input int isinstance
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
213 syn keyword pythonBuiltin issubclass iter len list locals map max
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
214 syn keyword pythonBuiltin memoryview min next object oct open ord pow
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
215 syn keyword pythonBuiltin print property range repr reversed round set
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
216 syn keyword pythonBuiltin setattr slice sorted staticmethod str
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
217 syn keyword pythonBuiltin sum super tuple type vars zip __import__
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
218 " Python 2 only
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
219 syn keyword pythonBuiltin basestring cmp execfile file
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
220 syn keyword pythonBuiltin long raw_input reduce reload unichr
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
221 syn keyword pythonBuiltin unicode xrange
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
222 " Python 3 only
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
223 syn keyword pythonBuiltin ascii bytes exec
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
224 " non-essential built-in functions; Python 2 only
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
225 syn keyword pythonBuiltin apply buffer coerce intern
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
226 " avoid highlighting attributes as builtins
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
227 syn match pythonAttribute /\.\h\w*/hs=s+1
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
228 \ contains=ALLBUT,pythonBuiltin,pythonFunction,pythonAsync
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
229 \ transparent
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
230 endif
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
231
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
232 " From the 'Python Library Reference' class hierarchy at the bottom.
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
233 " http://docs.python.org/2/library/exceptions.html
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
234 " http://docs.python.org/3/library/exceptions.html
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
235 if !exists("python_no_exception_highlight")
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
236 " builtin base exceptions (used mostly as base classes for other exceptions)
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
237 syn keyword pythonExceptions BaseException Exception
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
238 syn keyword pythonExceptions ArithmeticError BufferError
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
239 syn keyword pythonExceptions LookupError
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
240 " builtin base exceptions removed in Python 3
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
241 syn keyword pythonExceptions EnvironmentError StandardError
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
242 " builtin exceptions (actually raised)
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
243 syn keyword pythonExceptions AssertionError AttributeError
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
244 syn keyword pythonExceptions EOFError FloatingPointError GeneratorExit
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
245 syn keyword pythonExceptions ImportError IndentationError
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
246 syn keyword pythonExceptions IndexError KeyError KeyboardInterrupt
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
247 syn keyword pythonExceptions MemoryError NameError NotImplementedError
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
248 syn keyword pythonExceptions OSError OverflowError ReferenceError
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
249 syn keyword pythonExceptions RuntimeError StopIteration SyntaxError
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
250 syn keyword pythonExceptions SystemError SystemExit TabError TypeError
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
251 syn keyword pythonExceptions UnboundLocalError UnicodeError
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
252 syn keyword pythonExceptions UnicodeDecodeError UnicodeEncodeError
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
253 syn keyword pythonExceptions UnicodeTranslateError ValueError
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
254 syn keyword pythonExceptions ZeroDivisionError
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
255 " builtin OS exceptions in Python 3
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
256 syn keyword pythonExceptions BlockingIOError BrokenPipeError
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
257 syn keyword pythonExceptions ChildProcessError ConnectionAbortedError
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
258 syn keyword pythonExceptions ConnectionError ConnectionRefusedError
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
259 syn keyword pythonExceptions ConnectionResetError FileExistsError
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
260 syn keyword pythonExceptions FileNotFoundError InterruptedError
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
261 syn keyword pythonExceptions IsADirectoryError NotADirectoryError
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
262 syn keyword pythonExceptions PermissionError ProcessLookupError
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
263 syn keyword pythonExceptions RecursionError StopAsyncIteration
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
264 syn keyword pythonExceptions TimeoutError
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
265 " builtin exceptions deprecated/removed in Python 3
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
266 syn keyword pythonExceptions IOError VMSError WindowsError
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
267 " builtin warnings
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
268 syn keyword pythonExceptions BytesWarning DeprecationWarning FutureWarning
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
269 syn keyword pythonExceptions ImportWarning PendingDeprecationWarning
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
270 syn keyword pythonExceptions RuntimeWarning SyntaxWarning UnicodeWarning
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
271 syn keyword pythonExceptions UserWarning Warning
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
272 " builtin warnings in Python 3
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
273 syn keyword pythonExceptions ResourceWarning
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
274 endif
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
275
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
276 if exists("python_space_error_highlight")
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
277 " trailing whitespace
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
278 syn match pythonSpaceError display excludenl "\s\+$"
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
279 " mixed tabs and spaces
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
280 syn match pythonSpaceError display " \+\t"
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
281 syn match pythonSpaceError display "\t\+ "
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
282 endif
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
283
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
284 " Do not spell doctests inside strings.
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
285 " Notice that the end of a string, either ''', or """, will end the contained
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
286 " doctest too. Thus, we do *not* need to have it as an end pattern.
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
287 if !exists("python_no_doctest_highlight")
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
288 if !exists("python_no_doctest_code_highlight")
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
289 syn region pythonDoctest
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
290 \ start="^\s*>>>\s" end="^\s*$"
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
291 \ contained contains=ALLBUT,pythonDoctest,pythonFunction,@Spell
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
292 syn region pythonDoctestValue
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
293 \ start=+^\s*\%(>>>\s\|\.\.\.\s\|"""\|'''\)\@!\S\++ end="$"
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
294 \ contained
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
295 else
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
296 syn region pythonDoctest
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
297 \ start="^\s*>>>" end="^\s*$"
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
298 \ contained contains=@NoSpell
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
299 endif
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
300 endif
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
301
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
302 " Sync at the beginning of class, function, or method definition.
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
303 syn sync match pythonSync grouphere NONE "^\%(def\|class\)\s\+\h\w*\s*[(:]"
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
304
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
305 " The default highlight links. Can be overridden later.
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
306 hi def link pythonStatement Statement
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
307 hi def link pythonConditional Conditional
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
308 hi def link pythonRepeat Repeat
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
309 hi def link pythonOperator Operator
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
310 hi def link pythonException Exception
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
311 hi def link pythonInclude Include
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
312 hi def link pythonAsync Statement
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
313 hi def link pythonDecorator Define
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
314 hi def link pythonDecoratorName Function
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
315 hi def link pythonFunction Function
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
316 hi def link pythonComment Comment
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
317 hi def link pythonTodo Todo
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
318 hi def link pythonString String
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
319 hi def link pythonRawString String
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
320 hi def link pythonQuotes String
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
321 hi def link pythonTripleQuotes pythonQuotes
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
322 hi def link pythonEscape Special
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
323 if !exists("python_no_number_highlight")
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
324 hi def link pythonNumber Number
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
325 endif
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
326 if !exists("python_no_builtin_highlight")
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
327 hi def link pythonBuiltin Function
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
328 endif
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
329 if !exists("python_no_exception_highlight")
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
330 hi def link pythonExceptions Structure
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
331 endif
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
332 if exists("python_space_error_highlight")
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
333 hi def link pythonSpaceError Error
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
334 endif
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
335 if !exists("python_no_doctest_highlight")
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
336 hi def link pythonDoctest Special
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
337 hi def link pythonDoctestValue Define
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
338 endif
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
339
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
340 let b:current_syntax = "python"
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
341
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
342 let &cpo = s:cpo_save
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
343 unlet s:cpo_save
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
344
b2412874362f Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
345 " vim:set sw=2 sts=2 ts=8 noet: