-
Notifications
You must be signed in to change notification settings - Fork 16
/
python.xml
684 lines (633 loc) · 28.6 KB
/
python.xml
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
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language>
<!-- Python syntax highlightning v0.9 by Per Wigren -->
<!-- Python syntax highlighting v1.9 by Michael Bueker (improved keyword differentiation) -->
<!-- Python syntax highlighting v1.97 by Paul Giannaros -->
<!-- Python syntax highlighting v1.99 by Primoz Anzur -->
<!-- Python syntax highlighting v2.01 by Paul Giannaros:
* full format character support
* unicode string modifier supported -->
<!-- v2.02 remove RegExpr for nums and make indent consistent -->
<!-- v2.03 highlight decorators, remove operator regex, don't highlight parens as operators -->
<!-- v2.04 make alerts visible even if they are directly after ''' or # without a space -->
<!-- v2.06 decorator names can (and often do) contain periods -->
<!-- v2.07 add support for %prog and co, see bug 142832 -->
<!-- v2.08 add missing overloaders, new Python 3 statements, builtins, and keywords -->
<!-- v2.29 recognize escape sequenzes correctly -->
<language name="Python" version="4" style="python" kateversion="5.0" section="Scripts" extensions="*.py;*.pyw;SConstruct;SConscript" mimetype="application/x-python;text/x-python" casesensitive="1" author="Michael Bueker" license="">
<highlighting>
<list name="import">
<item> import </item>
<item> from </item>
<item> as </item>
</list>
<list name="defs">
<item> class </item>
<item> def </item>
<item> del </item>
<item> global </item>
<item> lambda </item>
<item> nonlocal </item>
</list>
<list name="operators">
<item> and </item>
<item> in </item>
<item> is </item>
<item> not </item>
<item> or </item>
</list>
<list name="flow">
<item> assert </item>
<item> break </item>
<item> continue </item>
<item> elif </item>
<item> else </item>
<item> except </item>
<item> finally </item>
<item> for </item>
<item> if </item>
<item> pass </item>
<item> raise </item>
<item> return </item>
<item> try </item>
<item> while </item>
<item> with </item>
<item> yield </item>
<item> async </item>
<item> await </item>
</list>
<list name="builtinfuncs">
<item> __import__ </item>
<item> abs </item>
<item> all </item>
<item> any </item>
<item> apply </item>
<item> ascii </item>
<item> basestring </item>
<item> bin </item>
<item> bool </item>
<item> buffer </item>
<item> bytearray </item>
<item> bytes </item>
<item> callable </item>
<item> chr </item>
<item> classmethod </item>
<item> cmp </item>
<item> coerce </item>
<item> compile </item>
<item> complex </item>
<item> delattr </item>
<item> dict </item>
<item> dir </item>
<item> divmod </item>
<item> enumerate </item>
<item> eval </item>
<item> exec </item>
<item> execfile </item>
<item> file </item>
<item> filter </item>
<item> float </item>
<item> format </item>
<item> frozenset </item>
<item> getattr </item>
<item> globals </item>
<item> hasattr </item>
<item> hash </item>
<item> help </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> list </item>
<item> locals </item>
<item> long </item>
<item> map </item>
<item> max </item>
<item> memoryview </item>
<item> min </item>
<item> next </item>
<item> object </item>
<item> oct </item>
<item> open </item>
<item> ord </item>
<item> pow </item>
<item> print </item>
<item> property </item>
<item> range </item>
<item> raw_input </item>
<item> reduce </item>
<item> reload </item>
<item> repr </item>
<item> reversed </item>
<item> round </item>
<item> set </item>
<item> setattr </item>
<item> slice </item>
<item> sorted </item>
<item> staticmethod </item>
<item> str </item>
<item> sum </item>
<item> super </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> True </item>
<item> False </item>
<item> NotImplemented </item>
<item> Ellipsis </item>
<item> __debug__ </item>
<item> __file__ </item>
<item> __name__ </item>
</list>
<list name="bindings">
<item> SIGNAL </item>
<item> SLOT </item>
<item> connect </item>
</list>
<list name="overloaders">
<item>__new__</item>
<item>__init__</item>
<item>__del__</item>
<item>__repr__</item>
<item>__str__</item>
<item>__lt__</item>
<item>__le__</item>
<item>__eq__</item>
<item>__ne__</item>
<item>__gt__</item>
<item>__ge__</item>
<item>__cmp__</item>
<item>__rcmp__</item>
<item>__hash__</item>
<item>__nonzero__</item>
<item>__unicode__</item>
<item>__getattr__</item>
<item>__setattr__</item>
<item>__delattr__</item>
<item>__getattribute__</item>
<item>__get__</item>
<item>__set__</item>
<item>__delete__</item>
<item>__call__</item>
<item>__len__</item>
<item>__getitem__</item>
<item>__setitem__</item>
<item>__delitem__</item>
<item>__iter__</item>
<item>__reversed__</item>
<item>__contains__</item>
<item>__getslice__</item>
<item>__setslice__</item>
<item>__delslice__</item>
<item>__add__</item>
<item>__sub__</item>
<item>__mul__</item>
<item>__floordiv__</item>
<item>__mod__</item>
<item>__divmod__</item>
<item>__pow__</item>
<item>__lshift__</item>
<item>__rshift__</item>
<item>__and__</item>
<item>__xor__</item>
<item>__or__</item>
<item>__div__</item>
<item>__truediv__</item>
<item>__radd__</item>
<item>__rsub__</item>
<item>__rmul__</item>
<item>__rdiv__</item>
<item>__rtruediv__</item>
<item>__rfloordiv__</item>
<item>__rmod__</item>
<item>__rdivmod__</item>
<item>__rpow__</item>
<item>__rlshift__</item>
<item>__rrshift__</item>
<item>__rand__</item>
<item>__rxor__</item>
<item>__ror__</item>
<item>__iadd__</item>
<item>__isub__</item>
<item>__imul__</item>
<item>__idiv__</item>
<item>__itruediv__</item>
<item>__ifloordiv__</item>
<item>__imod__</item>
<item>__ipow__</item>
<item>__ilshift__</item>
<item>__irshift__</item>
<item>__iand__</item>
<item>__ixor__</item>
<item>__ior__</item>
<item>__neg__</item>
<item>__pos__</item>
<item>__abs__</item>
<item>__invert__</item>
<item>__complex__</item>
<item>__int__</item>
<item>__long__</item>
<item>__float__</item>
<item>__oct__</item>
<item>__hex__</item>
<item>__index__</item>
<item>__coerce__</item>
<item>__enter__</item>
<item>__exit__</item>
<item>__bytes__</item>
<item>__format__</item>
<item>__next__</item>
<item>__dir__</item>
<item>__await__</item>
<item>__aiter__</item>
<item>__anext__</item>
<item>__aenter__</item>
<item>__aexit__</item>
</list>
<list name="exceptions">
<!--
Exceptions list resources used:
- http://docs.python.org/2.7/library/exceptions.html#exception-hierarchy
- http://docs.python.org/3.4/library/exceptions.html#exception-hierarchy
-->
<item>ArithmeticError</item>
<item>AssertionError</item>
<item>AttributeError</item>
<item>BaseException</item>
<item>BlockingIOError</item>
<item>BrokenPipeError</item>
<item>BufferError</item>
<item>BytesWarning</item>
<item>ChildProcessError</item>
<item>ConnectionAbortedError</item>
<item>ConnectionError</item>
<item>ConnectionRefusedError</item>
<item>ConnectionResetError</item>
<item>DeprecationWarning</item>
<item>EnvironmentError</item>
<item>EOFError</item>
<item>Exception</item>
<item>FileExistsError</item>
<item>FileNotFoundError</item>
<item>FloatingPointError</item>
<item>FutureWarning</item>
<item>GeneratorExit</item>
<item>ImportError</item>
<item>ImportWarning</item>
<item>IndentationError</item>
<item>IndexError</item>
<item>InterruptedError</item>
<item>IOError</item>
<item>IsADirectoryError</item>
<item>KeyboardInterrupt</item>
<item>KeyError</item>
<item>LookupError</item>
<item>MemoryError</item>
<item>NameError</item>
<item>NotADirectoryError</item>
<item>NotImplementedError</item>
<item>OSError</item>
<item>OverflowError</item>
<item>PendingDeprecationWarning</item>
<item>PermissionError</item>
<item>ProcessLookupError</item>
<item>ReferenceError</item>
<item>ResourceWarning</item>
<item>RuntimeError</item>
<item>RuntimeWarning</item>
<item>StandardError</item>
<item>StopIteration</item>
<item>SyntaxError</item>
<item>SyntaxWarning</item>
<item>SystemError</item>
<item>SystemExit</item>
<item>TabError</item>
<item>TimeoutError</item>
<item>TypeError</item>
<item>UnboundLocalError</item>
<item>UnicodeDecodeError</item>
<item>UnicodeEncodeError</item>
<item>UnicodeError</item>
<item>UnicodeTranslateError</item>
<item>UnicodeWarning</item>
<item>UserWarning</item>
<item>ValueError</item>
<item>Warning</item>
<item>WindowsError</item>
<item>ZeroDivisionError</item>
</list>
<contexts>
<context name="Normal" attribute="Normal Text" lineEndContext="#stay">
<keyword attribute="Import" String="import" context="#stay"/>
<keyword attribute="Definition Keyword" String="defs" context="#stay"/>
<keyword attribute="Operator Keyword" String="operators" context="#stay"/>
<keyword attribute="Flow Control Keyword" String="flow" context="#stay"/>
<keyword attribute="Builtin Function" String="builtinfuncs" context="#stay"/>
<keyword attribute="Special Variable" String="specialvars" context="#stay"/>
<keyword attribute="Extensions" String="bindings" context="#stay"/>
<keyword attribute="Exceptions" String="exceptions" context="#stay"/>
<keyword attribute="Overloaders" String="overloaders" context="#stay"/>
<RegExpr attribute="ClassNames" String="[A-Z][a-zA-Z_0-9]+" context="#stay"/>
<RegExpr attribute="Normal Text" String="[a-z_][a-zA-Z_][a-zA-Z_0-9]+" context="#stay"/>
<RegExpr attribute="Complex" String=" ((([0-9]*\.[0-9]+|[0-9]+\.)|([0-9]+|([0-9]*\.[0-9]+|[0-9]+\.))[eE](\+|-)?[0-9]+)|[0-9]+)[jJ]" context="#stay"/>
<Float attribute="Float" context="#stay" />
<HlCHex attribute="Hex" context="#stay"/>
<HlCOct attribute="Octal" context="#stay"/>
<Int attribute="Int" context="#stay">
<StringDetect attribute="Int" String="L" insensitive="true" context="#stay"/>
</Int>
<DetectChar attribute="Normal Text" char="{" context="Dictionary" beginRegion="Dictionary"/>
<DetectChar attribute="Normal Text" char="[" context="List" beginRegion="List"/>
<DetectChar attribute="Normal Text" char="(" context="Tuple" beginRegion="Tuple"/>
<IncludeRules context="CommentVariants" />
<DetectChar attribute="Comment" char="#" context="Hash comment"/>
<IncludeRules context="StringVariants" />
<RegExpr attribute="Decorator" String="@[_a-zA-Z][\._a-zA-Z0-9]*" firstNonSpace="true"/>
<AnyChar attribute="Operator" String="+*/%\|=;\!<>!^&~-@" context="#stay"/>
</context>
<context name="#CheckForString" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
<DetectSpaces/>
<LineContinue attribute="Normal Text" context="CheckForStringNext"/>
</context>
<context name="CheckForStringNext" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
<DetectSpaces/>
<LineContinue attribute="Normal Text" context="CheckForStringNext"/>
<IncludeRules context="StringVariants"/>
</context>
<context name="StringVariants" attribute="Normal Text" lineEndContext="#stay">
<DetectSpaces/>
<RegExpr attribute="String" String="u?'''" insensitive="true" context="Triple A-string" beginRegion="Triple A-region"/>
<RegExpr attribute="String" String="u?"""" insensitive="true" context="Triple Q-string" beginRegion="Triple Q-region"/>
<RegExpr attribute="String" String="u?'" insensitive="true" context="Single A-string"/>
<RegExpr attribute="String" String="u?"" insensitive="true" context="Single Q-string"/>
<RegExpr attribute="Raw String" String="(u?r|ru)'''" insensitive="true" context="Raw Triple A-string" beginRegion="Triple A-region"/>
<RegExpr attribute="Raw String" String="(u?r|ru)"""" insensitive="true" context="Raw Triple Q-string" beginRegion="Triple Q-region"/>
<RegExpr attribute="Raw String" String="(u?r|ru)'" insensitive="true" context="Raw A-string"/>
<RegExpr attribute="Raw String" String="(u?r|ru)"" insensitive="true" context="Raw Q-string"/>
<StringDetect attribute="F-String" String="f'''" insensitive="true" context="Triple A-F-String" beginRegion="Triple A-region"/>
<StringDetect attribute="F-String" String="f"""" insensitive="true" context="Triple Q-F-String" beginRegion="Triple Q-region"/>
<StringDetect attribute="F-String" String="f'" insensitive="true" context="Single A-F-String"/>
<StringDetect attribute="F-String" String="f"" insensitive="true" context="Single Q-F-String"/>
<RegExpr attribute="Raw F-String" String="(fr|rf)'''" insensitive="true" context="Raw Triple A-F-String" beginRegion="Triple A-region"/>
<RegExpr attribute="Raw F-String" String="(fr|rf)"""" insensitive="true" context="Raw Triple Q-F-String" beginRegion="Triple Q-region"/>
<RegExpr attribute="Raw F-String" String="(fr|rf)'" insensitive="true" context="Raw A-F-String"/>
<RegExpr attribute="Raw F-String" String="(fr|rf)"" insensitive="true" context="Raw Q-F-String"/>
</context>
<context name="CommentVariants" attribute="Normal Text" lineEndContext="#stay">
<DetectSpaces/>
<RegExpr attribute="Comment" String="u?'''" insensitive="true" firstNonSpace="true" context="Triple A-comment" beginRegion="Triple A-region"/>
<RegExpr attribute="Comment" String="u?"""" insensitive="true" firstNonSpace="true" context="Triple Q-comment" beginRegion="Triple Q-region"/>
<RegExpr attribute="Comment" String="u?'" insensitive="true" firstNonSpace="true" context="Single A-comment"/>
<RegExpr attribute="Comment" String="u?"" insensitive="true" firstNonSpace="true" context="Single Q-comment"/>
<RegExpr attribute="Comment" String="(u?r|ru)'''" insensitive="true" firstNonSpace="true" context="Triple A-comment" beginRegion="Triple A-region"/>
<RegExpr attribute="Comment" String="(u?r|ru)"""" insensitive="true" firstNonSpace="true" context="Triple Q-comment" beginRegion="Triple Q-region"/>
<RegExpr attribute="Comment" String="(u?r|ru)'" insensitive="true" firstNonSpace="true" context="Single A-comment"/>
<RegExpr attribute="Comment" String="(u?r|ru)"" insensitive="true" firstNonSpace="true" context="Single Q-comment"/>
</context>
<context name="Dictionary" attribute="Normal Text" lineEndContext="#stay" noIndentationBasedFolding="true">
<DetectSpaces/>
<DetectChar attribute="Normal Text" char="}" context="#pop" endRegion="Dictionary"/>
<IncludeRules context="StringVariants" />
<IncludeRules context="Normal" />
</context>
<context name="List" attribute="Normal Text" lineEndContext="#stay" noIndentationBasedFolding="true">
<DetectSpaces/>
<DetectChar attribute="Normal Text" char="]" context="#pop" endRegion="List"/>
<IncludeRules context="StringVariants" />
<IncludeRules context="Normal" />
</context>
<context name="Tuple" attribute="Normal Text" lineEndContext="#stay" noIndentationBasedFolding="true">
<DetectSpaces/>
<DetectChar attribute="Normal Text" char=")" context="#pop" endRegion="Tuple"/>
<IncludeRules context="StringVariants" />
<IncludeRules context="Normal" />
</context>
<!-- Comments -->
<context name="Hash comment" attribute="Comment" lineEndContext="#pop">
<IncludeRules context="##Alerts" />
<IncludeRules context="##Modelines" />
</context>
<context name="Triple A-comment" attribute="Comment" lineEndContext="#stay" noIndentationBasedFolding="true">
<StringDetect attribute="Comment" String="'''" context="#pop" endRegion="Triple A-region"/>
<IncludeRules context="##Alerts_indent" />
</context>
<context name="Triple Q-comment" attribute="Comment" lineEndContext="#stay" noIndentationBasedFolding="true">
<HlCChar attribute="Comment" context="#stay"/>
<StringDetect attribute="Comment" String=""""" context="#pop" endRegion="Triple Q-region"/>
<IncludeRules context="##Alerts_indent" />
</context>
<context name="Single A-comment" attribute="Comment" lineEndContext="#stay">
<HlCStringChar attribute="Comment" context="#stay"/>
<DetectChar attribute="Comment" char="'" context="#pop"/>
<IncludeRules context="##Alerts_indent" />
</context>
<context name="Single Q-comment" attribute="Comment" lineEndContext="#stay">
<HlCStringChar attribute="Comment" context="#stay"/>
<DetectChar attribute="Comment" char=""" context="#pop"/>
<IncludeRules context="##Alerts_indent" />
</context>
<!-- Strings -->
<!-- format characters -->
<context name="stringformat" attribute="String Substitution" lineEndContext="#stay">
<!-- Python 2 style. Syntax:
1. start character '%'
2. [optional] Mapping key, e.g. '(foo)'
3. [optional] Conversion flags, one of '#0- +'
4. [optional] Minimum width, integer or '*'
5. [optional] Precision, '.' followed by integer or '*'
6. [optional] Length modifier, one of 'hlL'
7. conversion type, one of 'crsdiouxXeEfFgG%'
[Special cases: %prog and %default - see http://docs.python.org/library/optparse.html]
-->
<RegExpr attribute="String Substitution" String="%((\([a-zA-Z0-9_]+\))?[#0\- +]?([1-9][0-9]*|\*)?(\.([1-9][0-9]*|\*))?[hlL]?[crsdiouxXeEfFgG%]|prog|default)" context="#stay"/>
<!-- http://docs.python.org/2/library/string.html#format-string-syntax:
replacement_field ::= "{" [field_name] ["!" conversion] [":" format_spec] "}"
field_name ::= arg_name ("." attribute_name | "[" element_index "]")*
arg_name ::= [identifier | integer]
attribute_name ::= identifier
element_index ::= integer | index_string
index_string ::= <any source character except "]"> +
conversion ::= "r" | "s"
format_spec ::= [[fill]align][sign][#][0][width][,][.precision][type]
fill ::= <any character>
align ::= "<" | ">" | "=" | "^"
sign ::= "+" | "-" | " "
width ::= integer
precision ::= integer
type ::= "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "s" | "x" | "X" | "%"
-->
<RegExpr attribute="String Substitution" String="\{(([a-zA-Z0-9_]+|[0-9]+)(\.[a-zA-Z0-9_]+|\[[^ \]]+\])*)?(![rs])?(:([^}]?[<>=^])?[ +-]?#?0?[0-9]*(\.[0-9]+)?[bcdeEfFgGnosxX%]?)?\}" context="#stay"/>
<Detect2Chars attribute="String Substitution" char="{" char1="{" context="#stay" />
<Detect2Chars attribute="String Substitution" char="}" char1="}" context="#stay" />
</context>
<!-- escape characters -->
<context name="stringescape" attribute="String Char" lineEndContext="#stay">
<!-- As this highlighting style is for both, Python 2 and 3,
we do not know if a normal string is “unicode” or not. So we
-->
<RegExpr attribute="String Char" String="\\[\\'"abfnrtv]" context="#stay"/>
<RegExpr attribute="String Char" String="\\[0-7]{1,3}" context="#stay"/>
<RegExpr attribute="String Char" String="\\x[0-9A-Fa-f]{2}" context="#stay"/>
<RegExpr attribute="String Char" String="\\u[0-9A-Fa-f]{4}" context="#stay"/>
<RegExpr attribute="String Char" String="\\U[0-9A-Fa-f]{8}" context="#stay"/>
<RegExpr attribute="String Char" String="\\N\{[a-zA-Z0-9\- ]+\}" context="#stay"/>
</context>
<!-- f-literals -->
<context name="stringinterpolation" attribute="F-String" lineEndContext="#stay">
<Detect2Chars attribute="String Char" char="{" char1="{" context="#stay"/>
<DetectChar attribute="String Substitution" char="{" context="String Interpolation"/>
</context>
<context name="String Interpolation" attribute="String Substitution" lineEndContext="#stay">
<DetectChar attribute="Error" char="\" context="#pop"/>
<RegExpr attribute="String Substitution" String="(![rs])?(:([^}]?[<>=^])?[ +-]?#?0?[0-9]*(\.[0-9]+)?[bcdeEfFgGnosxX%]?)?\}" context="#pop"/>
<IncludeRules context="Normal"/> <!-- TODO: create expression context instead -->
</context>
<!--
It follows a Binary tree of string kinds (not even touching byte literals).
The levels are:
1. triple- vs. single-quoted
2. apostrophe vs. quotation mark
3. static vs. interpolated (f-literal)
4. escaped vs. raw
Adding byte literals wouldn’t make the current 2⁴ into 2⁵ contexts, as there are no byte f-literals
-->
<!-- Triple-quoted A-strings -->
<context name="Triple A-string" attribute="String" lineEndContext="#stay" noIndentationBasedFolding="true">
<IncludeRules context="stringescape"/>
<IncludeRules context="stringformat"/>
<StringDetect attribute="String" String="'''" context="#pop#CheckForString" endRegion="Triple A-region"/>
</context>
<context name="Raw Triple A-string" attribute="Raw String" lineEndContext="#stay" noIndentationBasedFolding="true">
<HlCStringChar attribute="Raw String" context="#stay"/>
<IncludeRules context="stringformat"/>
<StringDetect attribute="Raw String" String="'''" context="#pop#CheckForString" endRegion="Triple A-region"/>
</context>
<context name="Triple A-F-String" attribute="F-String" lineEndContext="#stay" noIndentationBasedFolding="true">
<IncludeRules context="stringescape"/>
<IncludeRules context="stringinterpolation"/>
<StringDetect attribute="F-String" String="'''" context="#pop#CheckForString" endRegion="Triple A-region"/>
</context>
<context name="Raw Triple A-F-String" attribute="Raw F-String" lineEndContext="#stay" noIndentationBasedFolding="true">
<HlCStringChar attribute="Raw F-String" context="#stay"/>
<IncludeRules context="stringinterpolation"/>
<StringDetect attribute="Raw F-String" String="'''" context="#pop#CheckForString" endRegion="Triple A-region"/>
</context>
<!-- Triple-quoted Q-strings -->
<context name="Triple Q-string" attribute="String" lineEndContext="#stay" noIndentationBasedFolding="true">
<IncludeRules context="stringescape"/>
<IncludeRules context="stringformat"/>
<StringDetect attribute="String" String=""""" context="#pop#CheckForString" endRegion="Triple Q-region"/>
</context>
<context name="Raw Triple Q-string" attribute="Raw String" lineEndContext="#stay" noIndentationBasedFolding="true">
<HlCStringChar attribute="Raw String" context="#stay"/>
<IncludeRules context="stringformat"/>
<StringDetect attribute="Raw String" String=""""" context="#pop#CheckForString" endRegion="Triple Q-region"/>
</context>
<context name="Triple Q-F-String" attribute="F-String" lineEndContext="#stay" noIndentationBasedFolding="true">
<IncludeRules context="stringescape"/>
<IncludeRules context="stringinterpolation"/>
<StringDetect attribute="F-String" String=""""" context="#pop#CheckForString" endRegion="Triple Q-region"/>
</context>
<context name="Raw Triple Q-F-String" attribute="Raw F-String" lineEndContext="#stay" noIndentationBasedFolding="true">
<HlCStringChar attribute="Raw F-String" context="#stay"/>
<IncludeRules context="stringinterpolation"/>
<StringDetect attribute="Raw F-String" String=""""" context="#pop#CheckForString" endRegion="Triple Q-region"/>
</context>
<!-- Single-quoted A-strings -->
<context name="Single A-string" attribute="String" lineEndContext="#stay">
<IncludeRules context="stringescape"/>
<IncludeRules context="stringformat"/>
<DetectChar attribute="String" char="'" context="#pop#CheckForString"/>
</context>
<context name="Raw A-string" attribute="Raw String" lineEndContext="#stay">
<HlCStringChar attribute="Raw String" context="#stay"/>
<IncludeRules context="stringformat"/>
<DetectChar attribute="Raw String" char="'" context="#pop#CheckForString"/>
</context>
<context name="Single A-F-String" attribute="F-String" lineEndContext="#stay">
<IncludeRules context="stringescape"/>
<IncludeRules context="stringinterpolation"/>
<DetectChar attribute="F-String" char="'" context="#pop#CheckForString"/>
</context>
<context name="Raw A-F-String" attribute="Raw F-String" lineEndContext="#stay">
<HlCStringChar attribute="Raw F-String" context="#stay"/>
<IncludeRules context="stringinterpolation"/>
<DetectChar attribute="Raw F-String" char="'" context="#pop#CheckForString"/>
</context>
<!-- Single-quoted Q-strings -->
<context name="Single Q-string" attribute="String" lineEndContext="#stay">
<IncludeRules context="stringescape"/>
<IncludeRules context="stringformat"/>
<DetectChar attribute="String" char=""" context="#pop#CheckForString"/>
</context>
<context name="Raw Q-string" attribute="Raw String" lineEndContext="#stay">
<HlCStringChar attribute="Raw String" context="#stay"/>
<IncludeRules context="stringformat"/>
<DetectChar attribute="Raw String" char=""" context="#pop#CheckForString"/>
</context>
<context name="Single Q-F-String" attribute="F-String" lineEndContext="#stay">
<IncludeRules context="stringescape"/>
<IncludeRules context="stringinterpolation"/>
<DetectChar attribute="F-String" char=""" context="#pop#CheckForString"/>
</context>
<context name="Raw Q-F-String" attribute="Raw F-String" lineEndContext="#stay">
<HlCStringChar attribute="Raw F-String" context="#stay"/>
<IncludeRules context="stringinterpolation"/>
<DetectChar attribute="Raw F-String" char=""" context="#pop#CheckForString"/>
</context>
</contexts>
<itemDatas>
<itemData name="Normal Text" defStyleNum="dsNormal" spellChecking="false"/>
<itemData name="Definition Keyword" defStyleNum="dsKeyword" spellChecking="false"/>
<itemData name="Operator" defStyleNum="dsOperator" spellChecking="false"/>
<itemData name="Operator Keyword" defStyleNum="dsKeyword" spellChecking="false"/>
<itemData name="Flow Control Keyword" defStyleNum="dsControlFlow" spellChecking="false"/>
<itemData name="Builtin Function" defStyleNum="dsBuiltIn" spellChecking="false"/>
<itemData name="Special Variable" defStyleNum="dsVariable" spellChecking="false"/>
<itemData name="Extensions" defStyleNum="dsExtension" spellChecking="false"/>
<itemData name="Exceptions" defStyleNum="dsPreprocessor" spellChecking="false"/>
<itemData name="Overloaders" defStyleNum="dsFunction" spellChecking="false"/>
<itemData name="Import" defStyleNum="dsImport" spellChecking="false"/>
<itemData name="Float" defStyleNum="dsFloat" spellChecking="false"/>
<itemData name="Int" defStyleNum="dsDecVal" spellChecking="false"/>
<itemData name="Hex" defStyleNum="dsBaseN" spellChecking="false"/>
<itemData name="Octal" defStyleNum="dsBaseN" spellChecking="false"/>
<itemData name="Complex" defStyleNum="dsOthers" spellChecking="false"/>
<itemData name="Comment" defStyleNum="dsComment"/>
<itemData name="String" defStyleNum="dsString"/>
<itemData name="ClassNames" defStyleNum="dsOthers" color="#FCAD3D" selColor="#ffffff" bold="1" italic="0" spellChecking="false"/>
<itemData name="Raw String" defStyleNum="dsVerbatimString"/>
<itemData name="F-String" defStyleNum="dsSpecialString"/>
<itemData name="Raw F-String" defStyleNum="dsVerbatimString"/>
<itemData name="String Char" defStyleNum="dsChar" spellChecking="false"/>
<itemData name="String Substitution" defStyleNum="dsSpecialChar" spellChecking="false"/>
<itemData name="Decorator" defStyleNum="dsAttribute" spellChecking="false"/>
<itemData name="Error" defStyleNum="dsError"/>
</itemDatas>
</highlighting>
<general>
<folding indentationsensitive="1" />
<emptyLines>
<emptyLine regexpr="(?:\s+|\s*#.*)"/>
</emptyLines>
<comments>
<comment name="singleLine" start="#" position="afterwhitespace"/>
</comments>
<indentation mode="python" />
<keywords casesensitive="1" additionalDeliminator="#'"/>
</general>
</language>
<!-- kate: space-indent off; indent-width 4; -->