summaryrefslogtreecommitdiffstats
path: root/kate/data/python.xml
blob: 9296f4c7e731ce389752c2fe4610c1285c639bed (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language>
<!-- Python syntax highlightning v0.9 by Per Wigren -->
<language name="Python" version="1.24" kateversion="2.4" section="Scripts" extensions="*.py;*.pyw;SConstruct;SConscript" mimetype="application/x-python;text/x-python" casesensitive="1" author="Per Wigren" license="">
	<highlighting>
		<list name="prep">
			<item> import </item>
			<item> from </item>
			<item> as </item>
		</list>

		<list name="statements">
      <item> and </item>
			<item> assert </item>
			<item> break </item>
			<item> class </item>
			<item> continue </item>
			<item> def </item>
			<item> del </item>
			<item> elif </item>
			<item> else </item>
			<item> except </item>
			<item> exec </item>
			<item> finally </item>
			<item> for </item>
			<item> global </item>
			<item> if </item>
			<item> in </item>
			<item> is </item>
			<item> lambda </item>
			<item> not </item>
			<item> or </item>
			<item> pass </item>
			<item> print </item>
			<item> raise </item>
			<item> return </item>
			<item> try </item>
			<item> while </item>
			<item> yield </item>
		</list>

		<list name="builtinfuncs">
			<item> abs </item>
			<item> apply </item>
			<item> buffer </item>
			<item> callable </item>
			<item> chr </item>
			<item> cmp </item>
			<item> coerce </item>
			<item> compile </item>
			<item> complex </item>
			<item> copyright </item>
			<item> credits </item>
			<item> delattr </item>
			<item> dir </item>
			<item> divmod </item>
			<item> eval </item>
			<item> execfile </item>
			<item> exit </item>
			<item> filter </item>
			<item> float </item>
			<item> getattr </item>
			<item> globals </item>
			<item> hasattr </item>
			<item> hash </item>
			<item> hex </item>
			<item> id </item>
			<item> input </item>
			<item> int </item>
			<item> intern </item>
			<item> isinstance </item>
			<item> issubclass </item>
			<item> iter </item>
			<item> len </item>
			<item> license </item>
			<item> list </item>
			<item> locals </item>
			<item> long </item>
			<item> map </item>
			<item> max </item>
			<item> min </item>
			<item> oct </item>
			<item> open </item>
			<item> ord </item>
			<item> pow </item>
			<item> quit </item>
			<item> range </item>
			<item> raw_input </item>
			<item> reduce </item>
			<item> reload </item>
			<item> repr </item>
			<item> round </item>
			<item> setattr </item>
			<item> slice </item>
			<item> str </item>
			<item> tuple </item>
			<item> type </item>
			<item> unichr </item>
			<item> unicode </item>
			<item> vars </item>
			<item> xrange </item>
			<item> zip </item>
		</list>

		<list name="specialvars">
			<item> None </item>
			<item> self </item>
			<item> cls </item>
			<item> True </item>
			<item> False </item>
			<item> NotImplemented </item>
			<item> Ellipsis </item>
		</list>

		<contexts>
			<context name="Normal" attribute="Normal Text" lineEndContext="#stay">
				<keyword attribute="Preprocessor" String="prep" context="#stay"/>
				<keyword attribute="Keyword" String="statements" context="#stay"/>
				<keyword attribute="Builtin Function" String="builtinfuncs" context="#stay"/>
				<keyword attribute="Special Variable" String="specialvars" context="#stay"/>
				<RegExpr attribute="Normal" String="[a-zA-Z_]\w+" context="#stay"/>

				<RegExpr attribute="Complex" String=" (((\d*\.\d+|\d+\.)|(\d+|(\d*\.\d+|\d+\.))[eE][+-]?\d+)|\d+)[jJ]" context="#stay"/>
				<RegExpr attribute="Float" String="(\d+\.\d*|\.\d+)([eE]\d+)?" context="#stay"/>
				<RegExpr attribute="Int" String="([1-9]\d*([eE]\d+)?|0)" context="#stay"/>
				<RegExpr attribute="Long" String="[1-9]\d*([eE][\d.]+)?[Ll]" context="#stay"/>
				<RegExpr attribute="Hex" String="0[Xx][\da-fA-F]+" context="#stay"/>
				<RegExpr attribute="Octal" String="0[1-9]\d*" context="#stay"/>

				<RegExpr attribute="Raw String" String="[rR]'" context="Raw A-string"/>
				<RegExpr attribute="Raw String" String="[rR]&quot;" context="Raw Q-string"/>

				<RegExpr attribute="Comment" String="#.*$" context="#stay"/>
				<StringDetect attribute="Comment" String="'''" context="Tripple A-comment" firstNonSpace="true" beginRegion="Tripple A-region"/>
				<StringDetect attribute="Comment" String="&quot;&quot;&quot;" context="Tripple Q-comment" firstNonSpace="true" beginRegion="Tripple Q-region"/>

				<StringDetect attribute="String" String="'''" context="Tripple A-string" beginRegion="Tripple A-region"/>
				<StringDetect attribute="String" String="&quot;&quot;&quot;" context="Tripple Q-string" beginRegion="Tripple Q-region"/>
				<DetectChar attribute="String" char="'" context="Single A-string"/>
				<DetectChar attribute="String" char="&quot;" context="Single Q-string"/>

				<DetectChar attribute="Operator" char="(" context="parenthesised" beginRegion="parenthesis"/>
				<DetectChar attribute="Operator" char=")" context="#pop" endRegion="parenthesis"/>
				<RegExpr attribute="Operator" String="[+*/\(\)%\|\[\]\{\}:=;\!&lt;&gt;!^&amp;~-]" context="#stay"/>

			</context>

			<context name="parenthesised" attribute="Normal Text" lineEndContext="#stay" noIndentationBasedFolding="True">
				<IncludeRules context="Normal" />
			</context>

			<context name="Tripple A-comment" attribute="Comment" lineEndContext="#stay" noIndentationBasedFolding="True">
				<HlCChar attribute="Comment" context="#stay"/>
				<StringDetect attribute="Comment" String="'''" context="#pop" endRegion="Tripple A-region"/>
			</context>

			<context name="Tripple Q-comment" attribute="Comment" lineEndContext="#stay" noIndentationBasedFolding="True">
				<HlCChar attribute="Comment" context="#stay"/>
				<StringDetect attribute="Comment" String="&quot;&quot;&quot;" context="#pop" endRegion="Tripple Q-region"/>
			</context>

			<context name="Tripple A-string" attribute="String" lineEndContext="#stay" noIndentationBasedFolding="True">
				<HlCChar attribute="String" context="#stay"/>
				<RegExpr attribute="Operator" String="%[a-zA-Z]" context="#stay"/>
				<StringDetect attribute="String" String="'''" context="#pop" endRegion="Tripple A-region"/>
			</context>

			<context name="Tripple Q-string" attribute="String" lineEndContext="#stay" noIndentationBasedFolding="True">
				<HlCStringChar attribute="String" context="#stay"/>
				<RegExpr attribute="Operator" String="%[a-zA-Z]" context="#stay"/>
				<StringDetect attribute="String" String="&quot;&quot;&quot;" context="#pop" endRegion="Tripple Q-region"/>
			</context>

			<context name="Single A-comment" attribute="Comment" lineEndContext="#stay">
				<HlCStringChar attribute="Comment" context="#stay"/>
				<DetectChar attribute="Comment" char="'" context="#pop"/>
			</context>

			<context name="Single Q-comment" attribute="Comment" lineEndContext="#stay">
				<HlCStringChar attribute="Comment" context="#stay"/>
				<DetectChar attribute="Comment" char="&quot;" context="#pop"/>
			</context>

			<context name="Single A-string" attribute="String" lineEndContext="#stay">
				<HlCStringChar attribute="String" context="#stay"/>
				<RegExpr attribute="Operator" String="%[a-zA-Z]" context="#stay"/>
				<DetectChar attribute="String" char="'" context="#pop"/>
			</context>

			<context name="Single Q-string" attribute="String" lineEndContext="#stay">
				<HlCStringChar attribute="String" context="#stay"/>
				<RegExpr attribute="Operator" String="%[a-zA-Z]" context="#stay"/>
				<DetectChar attribute="String" char="&quot;" context="#pop"/>
			</context>

			<context name="Raw A-string" attribute="Raw String" lineEndContext="#stay">
				<HlCStringChar attribute="Raw String" context="#stay"/>
				<DetectChar attribute="Raw String" char="'" context="#pop"/>
			</context>

			<context name="Raw Q-string" attribute="Raw String" lineEndContext="#stay">
				<HlCStringChar attribute="Raw String" context="#stay"/>
				<DetectChar attribute="Raw String" char="&quot;" context="#pop"/>
			</context>


		</contexts>
		<itemDatas>
			<itemData name="Normal Text" defStyleNum="dsNormal"/>
			<itemData name="Operator" defStyleNum="dsChar"/>
			<itemData name="Keyword" defStyleNum="dsKeyword"/>
			<itemData name="Builtin Function" defStyleNum="dsDataType"/>
			<itemData name="Special Variable" defStyleNum="dsOthers"/>
			<itemData name="Preprocessor" defStyleNum="dsChar"/>
			<itemData name="Long" defStyleNum="dsOthers"/>
			<itemData name="Float" defStyleNum="dsFloat"/>
			<itemData name="Int" defStyleNum="dsDecVal"/>
			<itemData name="Hex" defStyleNum="dsOthers"/>
			<itemData name="Octal" defStyleNum="dsOthers"/>
			<itemData name="Complex" defStyleNum="dsOthers"/>
			<itemData name="Comment" defStyleNum="dsComment"/>
			<itemData name="String" defStyleNum="dsString"/>
			<itemData name="Raw String" defStyleNum="dsString"/>
		</itemDatas>
	</highlighting>
   <general>
     <folding indentationsensitive="1" />
     <comments>
       <comment name="singleLine" start="#" position="afterwhitespace"/>
     </comments>
     <keywords casesensitive="1" />
   </general>
</language>