Warning, /frameworks/syntax-highlighting/data/syntax/python.xml is written in an unsupported language. File is not indexed.

0001 <?xml version="1.0" encoding="UTF-8"?>
0002 <!DOCTYPE language
0003 [
0004         <!ENTITY digitPart "[0-9](?:_?[0-9])*">
0005         <!ENTITY beforeDigit "(?&lt;![\.\w[:^ascii:]])">
0006         <!ENTITY beforePointFloat "(?&lt;![\w[:^ascii:]])">
0007 
0008         <!-- Python 2 style. Syntax:
0009                 1. start character '%'
0010                 2. [optional] Mapping key, e.g. '(foo)'
0011                 3. [optional] Conversion flags, one of '#0- +'
0012                 4. [optional] Minimum width, integer or '*'
0013                 5. [optional] Precision, '.' followed by integer or '*'
0014                 6. [optional] Length modifier, one of 'hlL'
0015                 7. conversion type, one of 'crsdiouxXeEfFgG%'
0016                 [Special cases: %prog and %default - see http://docs.python.org/library/optparse.html]
0017         -->
0018         <!ENTITY strsubstitution_py2 "&#37;(?:(?:\([a-zA-Z0-9_]+\))?[#0\- +]?(?:[1-9][0-9]*|\*)?(?:\.(?:[1-9][0-9]*|\*))?[hlL]?[crsdiouxXeEfFgG&#37;]|prog|default)">
0019         <!-- http://docs.python.org/2/library/string.html#format-string-syntax:
0020              replacement_field ::=  "{" [field_name] ["!" conversion] [":" format_spec] "}"
0021              field_name        ::=  arg_name ("." attribute_name | "[" element_index "]")*
0022              arg_name          ::=  [identifier | integer]
0023              attribute_name    ::=  identifier
0024              element_index     ::=  integer | index_string
0025              index_string      ::=  <any source character except "]"> +
0026              conversion        ::=  "r" | "s"
0027              format_spec       ::=  [[fill]align][sign][#][0][width][,][.precision][type]
0028              fill              ::=  <any character>
0029              align             ::=  "<" | ">" | "=" | "^"
0030              sign              ::=  "+" | "-" | " "
0031              width             ::=  integer
0032              precision         ::=  integer
0033              type              ::=  "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "s" | "x" | "X" | "%"
0034         -->
0035         <!ENTITY strsubstitution_py3 "\{(?:(?:[a-zA-Z0-9_]+|[0-9]+)(?:\.[a-zA-Z0-9_]+|\[[^ \]]+\])*)?(?:![rs])?(?::(?:[^}]?[&lt;&gt;=^])?[ +-]?#?0?[0-9]*(?:\.[0-9]+)?[bcdeEfFgGnosxX&#37;]?)?\}">
0036 
0037         <!ENTITY rawString "(?:ru|u?r|)(?:'(?:[^']++|\\')*+'|&quot;(?:[^&quot;]++|\\&quot;)*+&quot;)">
0038         <!ENTITY formatString "(?:r?f|fr?)(?:'(?:[^'{]++|\\'|\{\{|\{[^}]++\})*+'|&quot;(?:[^&quot;]++|\\&quot;|\{\{|\{[^}]*+\})*+&quot;)">
0039         <!ENTITY string "&rawString;|&formatString;">
0040 ]>
0041 <!-- Python syntax highlightning v0.9 by Per Wigren -->
0042 <!-- Python syntax highlighting v1.9 by Michael Bueker (improved keyword differentiation) -->
0043 <!-- Python syntax highlighting v1.97 by Paul Giannaros -->
0044 <!-- Python syntax highlighting v1.99 by Primoz Anzur -->
0045 <!-- Python syntax highlighting v2.01 by Paul Giannaros:
0046         * full format character support
0047         * unicode string modifier supported -->
0048 <!-- v2.02 remove RegExpr for nums and make indent consistent -->
0049 <!-- v2.03 highlight decorators, remove operator regex, don't highlight parens as operators -->
0050 <!-- v2.04 make alerts visible even if they are directly after ''' or # without a space -->
0051 <!-- v2.06 decorator names can (and often do) contain periods -->
0052 <!-- v2.07 add support for %prog and co, see bug 142832 -->
0053 <!-- v2.08 add missing overloaders, new Python 3 statements, builtins, and keywords -->
0054 <!-- v2.29 recognize escape sequenzes correctly -->
0055 <language name="Python" version="26" style="python" indenter="python" kateversion="5.0" section="Scripts" extensions="*.py;*.pyw;*.pyi;SConstruct;SConscript;*.FCMacro" mimetype="application/x-python;text/x-python;text/x-python3" casesensitive="1" author="Michael Bueker" license="">
0056         <highlighting>
0057                 <list name="import">
0058                         <item>import</item>
0059                         <item>from</item>
0060                         <item>as</item>
0061                 </list>
0062                 <list name="defs">
0063                         <item>class</item>
0064                         <item>def</item>
0065                         <item>del</item>
0066                         <item>global</item>
0067                         <item>lambda</item>
0068                         <item>nonlocal</item>
0069                 </list>
0070                 <list name="operators">
0071                         <item>and</item>
0072                         <item>in</item>
0073                         <item>is</item>
0074                         <item>not</item>
0075                         <item>or</item>
0076                 </list>
0077                 <list name="flow">
0078                         <item>assert</item>
0079                         <item>break</item>
0080                         <item>continue</item>
0081                         <item>elif</item>
0082                         <item>else</item>
0083                         <item>except</item>
0084                         <item>finally</item>
0085                         <item>for</item>
0086                         <item>if</item>
0087                         <item>pass</item>
0088                         <item>raise</item>
0089                         <item>return</item>
0090                         <item>try</item>
0091                         <item>while</item>
0092                         <item>with</item>
0093                         <item>async</item>
0094                         <item>await</item>
0095                 </list>
0096                 <list name="flow_yield">
0097                         <item>yield</item>
0098                         <!--
0099                                 "yield from" added here as a keyword for autocompletion. The actual handling
0100                                 is in context="yield" so that we won't need to add space as a weakDeliminator.
0101                         -->
0102                         <item>yield from</item>
0103                 </list>
0104                 <list name="patternmatching">
0105                         <item>match</item>
0106                         <item>case</item>
0107                 </list>
0108                 <list name="builtinfuncs">
0109                         <!-- https://docs.python.org/3.11/library/functions.html#built-in-funcs -->
0110                         <item>__import__</item>
0111                         <item>abs</item>
0112                         <item>aiter</item>
0113                         <item>all</item>
0114                         <item>anext</item>
0115                         <item>any</item>
0116                         <item>apply</item>
0117                         <item>ascii</item>
0118                         <item>basestring</item>
0119                         <item>bin</item>
0120                         <item>breakpoint</item>
0121                         <item>bool</item>
0122                         <item>buffer</item>
0123                         <item>bytearray</item>
0124                         <item>bytes</item>
0125                         <item>callable</item>
0126                         <item>chr</item>
0127                         <item>classmethod</item>
0128                         <item>cmp</item>
0129                         <item>coerce</item>
0130                         <item>compile</item>
0131                         <item>complex</item>
0132                         <item>delattr</item>
0133                         <item>dict</item>
0134                         <item>dir</item>
0135                         <item>divmod</item>
0136                         <item>enumerate</item>
0137                         <item>eval</item>
0138                         <item>exec</item>
0139                         <item>execfile</item>
0140                         <item>file</item>
0141                         <item>filter</item>
0142                         <item>float</item>
0143                         <item>format</item>
0144                         <item>frozenset</item>
0145                         <item>getattr</item>
0146                         <item>globals</item>
0147                         <item>hasattr</item>
0148                         <item>hash</item>
0149                         <item>help</item>
0150                         <item>hex</item>
0151                         <item>id</item>
0152                         <item>input</item>
0153                         <item>int</item>
0154                         <item>intern</item>
0155                         <item>isinstance</item>
0156                         <item>issubclass</item>
0157                         <item>iter</item>
0158                         <item>len</item>
0159                         <item>list</item>
0160                         <item>locals</item>
0161                         <item>long</item>
0162                         <item>map</item>
0163                         <item>max</item>
0164                         <item>memoryview</item>
0165                         <item>min</item>
0166                         <item>next</item>
0167                         <item>object</item>
0168                         <item>oct</item>
0169                         <item>open</item>
0170                         <item>ord</item>
0171                         <item>pow</item>
0172                         <item>print</item>
0173                         <item>property</item>
0174                         <item>range</item>
0175                         <item>raw_input</item>
0176                         <item>reduce</item>
0177                         <item>reload</item>
0178                         <item>repr</item>
0179                         <item>reversed</item>
0180                         <item>round</item>
0181                         <item>set</item>
0182                         <item>setattr</item>
0183                         <item>slice</item>
0184                         <item>sorted</item>
0185                         <item>staticmethod</item>
0186                         <item>str</item>
0187                         <item>sum</item>
0188                         <item>super</item>
0189                         <item>tuple</item>
0190                         <item>type</item>
0191                         <item>unichr</item>
0192                         <item>unicode</item>
0193                         <item>vars</item>
0194                         <item>xrange</item>
0195                         <item>zip</item>
0196                 </list>
0197                 <list name="specialvars">
0198                         <item>None</item>
0199                         <item>self</item>
0200                         <item>True</item>
0201                         <item>False</item>
0202                         <item>NotImplemented</item>
0203                         <item>Ellipsis</item>
0204                         <item>__debug__</item>
0205                         <item>__file__</item>
0206                         <item>__name__</item>
0207                         <item>__qualname__</item>
0208                 </list>
0209                 <list name="bindings">
0210                         <item>SIGNAL</item>
0211                         <item>SLOT</item>
0212                         <item>connect</item>
0213                 </list>
0214                 <list name="overloaders">
0215                         <!-- https://docs.python.org/3.10/reference/datamodel.html#special-method-names -->
0216                         <item>__new__</item>
0217                         <item>__init__</item>
0218                         <item>__del__</item>
0219                         <item>__repr__</item>
0220                         <item>__str__</item>
0221                         <item>__lt__</item>
0222                         <item>__le__</item>
0223                         <item>__eq__</item>
0224                         <item>__ne__</item>
0225                         <item>__gt__</item>
0226                         <item>__ge__</item>
0227                         <item>__cmp__</item>
0228                         <item>__rcmp__</item>
0229                         <item>__hash__</item>
0230                         <item>__bool__</item>
0231                         <item>__nonzero__</item>
0232                         <item>__unicode__</item>
0233                         <item>__getattr__</item>
0234                         <item>__setattr__</item>
0235                         <item>__delattr__</item>
0236                         <item>__getattribute__</item>
0237                         <item>__get__</item>
0238                         <item>__set__</item>
0239                         <item>__delete__</item>
0240                         <item>__call__</item>
0241                         <item>__len__</item>
0242                         <item>__length_hint__</item>
0243                         <item>__getitem__</item>
0244                         <item>__setitem__</item>
0245                         <item>__delitem__</item>
0246                         <item>__missing__</item>
0247                         <item>__iter__</item>
0248                         <item>__reversed__</item>
0249                         <item>__contains__</item>
0250                         <item>__getslice__</item>
0251                         <item>__setslice__</item>
0252                         <item>__delslice__</item>
0253                         <item>__add__</item>
0254                         <item>__sub__</item>
0255                         <item>__mul__</item>
0256                         <item>__matmul__</item>
0257                         <item>__floordiv__</item>
0258                         <item>__mod__</item>
0259                         <item>__divmod__</item>
0260                         <item>__pow__</item>
0261                         <item>__lshift__</item>
0262                         <item>__rshift__</item>
0263                         <item>__and__</item>
0264                         <item>__xor__</item>
0265                         <item>__or__</item>
0266                         <item>__div__</item>
0267                         <item>__truediv__</item>
0268                         <item>__radd__</item>
0269                         <item>__rsub__</item>
0270                         <item>__rmul__</item>
0271                         <item>__rmatmul__</item>
0272                         <item>__rdiv__</item>
0273                         <item>__rtruediv__</item>
0274                         <item>__rfloordiv__</item>
0275                         <item>__rmod__</item>
0276                         <item>__rdivmod__</item>
0277                         <item>__rpow__</item>
0278                         <item>__rlshift__</item>
0279                         <item>__rrshift__</item>
0280                         <item>__rand__</item>
0281                         <item>__rxor__</item>
0282                         <item>__ror__</item>
0283                         <item>__iadd__</item>
0284                         <item>__isub__</item>
0285                         <item>__imul__</item>
0286                         <item>__imatmul__</item>
0287                         <item>__idiv__</item>
0288                         <item>__itruediv__</item>
0289                         <item>__ifloordiv__</item>
0290                         <item>__imod__</item>
0291                         <item>__ipow__</item>
0292                         <item>__ilshift__</item>
0293                         <item>__irshift__</item>
0294                         <item>__iand__</item>
0295                         <item>__ixor__</item>
0296                         <item>__ior__</item>
0297                         <item>__neg__</item>
0298                         <item>__pos__</item>
0299                         <item>__abs__</item>
0300                         <item>__invert__</item>
0301                         <item>__complex__</item>
0302                         <item>__int__</item>
0303                         <item>__long__</item>
0304                         <item>__float__</item>
0305                         <item>__oct__</item>
0306                         <item>__hex__</item>
0307                         <item>__index__</item>
0308                         <item>__round__</item>
0309                         <item>__trunc__</item>
0310                         <item>__floor__</item>
0311                         <item>__ceil__</item>
0312                         <item>__coerce__</item>
0313                         <item>__enter__</item>
0314                         <item>__exit__</item>
0315                         <item>__match_args__</item>
0316                         <item>__bytes__</item>
0317                         <item>__format__</item>
0318                         <item>__next__</item>
0319                         <item>__dir__</item>
0320                         <item>__await__</item>
0321                         <item>__aiter__</item>
0322                         <item>__anext__</item>
0323                         <item>__aenter__</item>
0324                         <item>__aexit__</item>
0325                         <item>__slots__</item>
0326                         <item>__init_subclass__</item>
0327                         <item>__set_name__</item>
0328                         <item>__prepare__</item>
0329                         <item>__instancecheck__</item>
0330                         <item>__subclasscheck__</item>
0331                         <item>__class_getitem__</item>
0332                 </list>
0333                 <list name="exceptions">
0334                         <!--
0335                                 Exceptions list resources used:
0336                                 - http://docs.python.org/2.7/library/exceptions.html#exception-hierarchy
0337                                 - http://docs.python.org/3.10/library/exceptions.html#exception-hierarchy
0338                         -->
0339                         <item>ArithmeticError</item>
0340                         <item>AssertionError</item>
0341                         <item>AttributeError</item>
0342                         <item>BaseException</item>
0343                         <item>BlockingIOError</item>
0344                         <item>BrokenPipeError</item>
0345                         <item>BufferError</item>
0346                         <item>BytesWarning</item>
0347                         <item>ChildProcessError</item>
0348                         <item>ConnectionAbortedError</item>
0349                         <item>ConnectionError</item>
0350                         <item>ConnectionRefusedError</item>
0351                         <item>ConnectionResetError</item>
0352                         <item>DeprecationWarning</item>
0353                         <item>EnvironmentError</item>
0354                         <item>EOFError</item>
0355                         <item>EncodingWarning</item>
0356                         <item>Exception</item>
0357                         <item>FileExistsError</item>
0358                         <item>FileNotFoundError</item>
0359                         <item>FloatingPointError</item>
0360                         <item>FutureWarning</item>
0361                         <item>GeneratorExit</item>
0362                         <item>ImportError</item>
0363                         <item>ImportWarning</item>
0364                         <item>IndentationError</item>
0365                         <item>IndexError</item>
0366                         <item>InterruptedError</item>
0367                         <item>IOError</item>
0368                         <item>IsADirectoryError</item>
0369                         <item>KeyboardInterrupt</item>
0370                         <item>KeyError</item>
0371                         <item>LookupError</item>
0372                         <item>MemoryError</item>
0373                         <item>ModuleNotFoundError</item>
0374                         <item>NameError</item>
0375                         <item>NotADirectoryError</item>
0376                         <item>NotImplementedError</item>
0377                         <item>OSError</item>
0378                         <item>OverflowError</item>
0379                         <item>PendingDeprecationWarning</item>
0380                         <item>PermissionError</item>
0381                         <item>ProcessLookupError</item>
0382                         <item>RecursionError</item>
0383                         <item>ReferenceError</item>
0384                         <item>ResourceWarning</item>
0385                         <item>RuntimeError</item>
0386                         <item>RuntimeWarning</item>
0387                         <item>StandardError</item>
0388                         <item>StopAsyncIteration</item>
0389                         <item>StopIteration</item>
0390                         <item>SyntaxError</item>
0391                         <item>SyntaxWarning</item>
0392                         <item>SystemError</item>
0393                         <item>SystemExit</item>
0394                         <item>TabError</item>
0395                         <item>TimeoutError</item>
0396                         <item>TypeError</item>
0397                         <item>UnboundLocalError</item>
0398                         <item>UnicodeDecodeError</item>
0399                         <item>UnicodeEncodeError</item>
0400                         <item>UnicodeError</item>
0401                         <item>UnicodeTranslateError</item>
0402                         <item>UnicodeWarning</item>
0403                         <item>UserWarning</item>
0404                         <item>ValueError</item>
0405                         <item>Warning</item>
0406                         <item>WindowsError</item>
0407                         <item>ZeroDivisionError</item>
0408                 </list>
0409                 <contexts>
0410                         <context name="Normal" attribute="Normal Text" lineEndContext="#stay">
0411                                 <DetectSpaces attribute="Normal Text"/>
0412 
0413                                 <keyword attribute="Import" String="import" context="#stay"/>
0414                                 <keyword attribute="Definition Keyword" String="defs" context="#stay"/>
0415                                 <keyword attribute="Operator Keyword" String="operators" context="#stay"/>
0416                                 <keyword attribute="Flow Control Keyword" String="flow" context="#stay"/>
0417                                 <keyword attribute="Flow Control Keyword" String="flow_yield" context="yield"/>
0418                                 <keyword attribute="Flow Control Keyword" String="patternmatching" context="Pattern Matching" lookAhead="1" firstNonSpace="1"/>
0419                                 <keyword attribute="Builtin Function" String="builtinfuncs" context="#stay"/>
0420                                 <keyword attribute="Special Variable" String="specialvars" context="#stay"/>
0421                                 <keyword attribute="Extensions" String="bindings" context="#stay"/>
0422                                 <keyword attribute="Exceptions" String="exceptions" context="#stay"/>
0423                                 <keyword attribute="Overloaders" String="overloaders" context="#stay"/>
0424 
0425                                 <DetectChar attribute="Normal Text" char="{" context="Dictionary" beginRegion="Dictionary"/>
0426                                 <DetectChar attribute="Normal Text" char="[" context="List" beginRegion="List"/>
0427                                 <DetectChar attribute="Normal Text" char="(" context="Tuple" beginRegion="Tuple"/>
0428 
0429                                 <DetectChar attribute="Comment" char="#" context="Hash comment"/>
0430 
0431                                 <IncludeRules context="Number" />
0432                                 <IncludeRules context="CommentVariants" />
0433                                 <IncludeRules context="StringVariants" />
0434 
0435                                 <DetectIdentifier attribute="Normal Text"/>
0436 
0437                                 <RegExpr attribute="Decorator" String="@[_a-zA-Z[:^ascii:]][\._a-zA-Z0-9[:^ascii:]]*" firstNonSpace="true"/>
0438                                 <Detect2Chars attribute="Operator" char=":" char1="=" context="#stay"/>
0439                                 <AnyChar attribute="Operator" String="+*/%|=;&lt;&gt;!^&amp;~-@" context="#stay"/>
0440 
0441                                 <LineContinue attribute="Operator" context="MultiLineExpr"/>
0442 
0443                                 <Int attribute="Error"/>
0444                         </context>
0445                         <context name="MultiLineExpr" attribute="Normal Text" lineEndContext="#pop" fallthrough="1" fallthroughContext="#pop">
0446                                 <DetectSpaces attribute="Normal Text"/>
0447                                 <IncludeRules context="StringVariants" />
0448                         </context>
0449 
0450                         <!-- https://docs.python.org/2/reference/lexical_analysis.html#integer-and-long-integer-literals -->
0451                         <!-- https://docs.python.org/3/reference/lexical_analysis.html#integer-literals -->
0452                         <context name="Number" attribute="Normal Text" lineEndContext="#pop">
0453                                 <!-- fast path -->
0454                                 <RegExpr String="&beforeDigit;[0-9]|&beforePointFloat;\.[0-9]" context="AssumeNumber" lookAhead="1"/>
0455                         </context>
0456                         <context name="AssumeNumber" attribute="Normal Text" lineEndContext="#pop">
0457                                 <!-- Complex: 1j ; 1.1j ; 1.j ; .1j ; 1e3j ; 1.1e3j ; 1.e3j ; .1e3j -->
0458                                 <RegExpr attribute="Complex" String="(?:&digitPart;(?:\.(?:&digitPart;)?)?|&beforePointFloat;\.&digitPart;)(?:[eE][\+\-]?&digitPart;)?[jJ]" context="CheckSuffixError"/>
0459                                 <!-- Hexadecimal: 0xA1, Binary: 0b01, Octal: 0o71 -->
0460                                 <RegExpr attribute="Hex" String="0[xX](?:_?[0-9a-fA-F])+" context="CheckSuffixError"/>
0461                                 <RegExpr attribute="Binary" String="0[bB](?:_?[01])+" context="CheckSuffixError"/>
0462                                 <RegExpr attribute="Octal" String="0[oO](?:_?[0-7])+" context="CheckSuffixError"/>
0463                                 <!-- Float: 1.1 ; 1. ; .1 ; 1e3 ; 1.1e3 ; 1.e3 ; .1e3 -->
0464                                 <RegExpr attribute="Float" String="(?:&digitPart;(?:\.(?:&digitPart;)?)?|\.&digitPart;)[eE][\+\-]?&digitPart;|&digitPart;\.(?:&digitPart;)?|\.&digitPart;" context="CheckSuffixError"/>
0465                                 <!-- Decimal: 123 ; 000 -->
0466                                 <!-- l and L are python2 suffixes -->
0467                                 <RegExpr attribute="Int" String="(?:[1-9](?:_?\d)*|0(?:_?0)*)[lL]?" context="CheckSuffixError"/>
0468                         </context>
0469                         <context name="CheckSuffixError" attribute="Normal Text" lineEndContext="#pop#pop" fallthrough="1" fallthroughContext="#pop#pop">
0470                                 <RegExpr attribute="Error" String="[\w\d]+" context="#pop#pop"/>
0471                         </context>
0472 
0473                         <context name="yield" attribute="Flow Control Keyword" lineEndContext="#pop" fallthrough="1" fallthroughContext="#pop">
0474                                 <DetectSpaces attribute="Normal Text" context="#stay"/>
0475                                 <WordDetect attribute="Flow Control Keyword" context="#pop" String="from"/>
0476                         </context>
0477 
0478                         <context name="Pattern Matching" attribute="Flow Control Keyword" lineEndContext="#pop">
0479                                 <!--
0480                                         Python 3.10: https://docs.python.org/3.10/reference/compound_stmts.html#the-match-statement
0481                                         ( 'match' | 'case' ) expression ':'
0482                                         exclude:
0483                                         ( 'match' | 'case' ) ( 'if' | 'for' | '.' | ':' | '=' | ',' | ']' | ')' ) ...
0484                                 -->
0485                                 <RegExpr attribute="Flow Control Keyword" String="\w++(?=\s+(?!(?:if|for)\b)[\w'&quot;~]|\s*+(?![.:=\]),]|(?:if|for)\b)((?:&string;|[^#;(){}]|\(\)|\((?1)\)|\{\}|\{(\s*+(?:(?:&string;|[a-zA-Z0-9.]++)\s*+:\s*+(?:&string;|[^#;(){},]|\(\)|\((?1)\)|\{\}|\{(?2)\})++,?)*+)\})+?):)|" context="#pop"/>
0486                                 <DetectIdentifier attribute="Normal Text" context="#pop"/>
0487                         </context>
0488 
0489                         <context name="#CheckForString" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
0490                                 <DetectSpaces/>
0491                                 <LineContinue attribute="Normal Text" context="#pop!CheckForStringNext"/>
0492                         </context>
0493 
0494                         <context name="CheckForStringNext" attribute="Normal Text" lineEndContext="#pop#pop" fallthrough="true" fallthroughContext="#pop#pop">
0495                                 <DetectSpaces/>
0496                                 <LineContinue attribute="Normal Text" context="#stay"/>
0497                                 <IncludeRules context="StringVariants"/>
0498                         </context>
0499 
0500                         <!-- https://docs.python.org/2/reference/lexical_analysis.html#string-literals -->
0501                         <!-- https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals -->
0502                         <context name="StringVariants" attribute="Normal Text" lineEndContext="#stay">
0503                                 <!-- fast path -->
0504                                 <RegExpr String="(?:u|r|b|f|ur|fr|rf|br|rb)?['&quot;]" insensitive="true" context="AssumeStringVariants" lookAhead="1"/>
0505                         </context>
0506                         <context name="AssumeStringVariants" attribute="Normal Text" lineEndContext="#stay">
0507                                 <RegExpr attribute="String" String="u?'''"                insensitive="true" context="#pop!Triple A-string" beginRegion="Triple A-region"/>
0508                                 <RegExpr attribute="String" String="u?&quot;&quot;&quot;" insensitive="true" context="#pop!Triple Q-string" beginRegion="Triple Q-region"/>
0509                                 <RegExpr attribute="String" String="u?'"                  insensitive="true" context="#pop!Single A-string"/>
0510                                 <RegExpr attribute="String" String="u?&quot;"             insensitive="true" context="#pop!Single Q-string"/>
0511 
0512                                 <RegExpr attribute="Raw String" String="u?r'''"                insensitive="true" context="#pop!Raw Triple A-string" beginRegion="Triple A-region"/>
0513                                 <RegExpr attribute="Raw String" String="u?r&quot;&quot;&quot;" insensitive="true" context="#pop!Raw Triple Q-string" beginRegion="Triple Q-region"/>
0514                                 <RegExpr attribute="Raw String" String="u?r'"                  insensitive="true" context="#pop!Raw A-string"/>
0515                                 <RegExpr attribute="Raw String" String="u?r&quot;"             insensitive="true" context="#pop!Raw Q-string"/>
0516 
0517                                 <StringDetect attribute="F-String" String="f'''"                insensitive="true" context="#pop!Triple A-F-String" beginRegion="Triple A-region"/>
0518                                 <StringDetect attribute="F-String" String="f&quot;&quot;&quot;" insensitive="true" context="#pop!Triple Q-F-String" beginRegion="Triple Q-region"/>
0519                                 <StringDetect attribute="F-String" String="f'"                  insensitive="true" context="#pop!Single A-F-String"/>
0520                                 <StringDetect attribute="F-String" String="f&quot;"             insensitive="true" context="#pop!Single Q-F-String"/>
0521 
0522                                 <RegExpr attribute="Raw F-String" String="(?:fr|rf)'''"                insensitive="true" context="#pop!Raw Triple A-F-String" beginRegion="Triple A-region"/>
0523                                 <RegExpr attribute="Raw F-String" String="(?:fr|rf)&quot;&quot;&quot;" insensitive="true" context="#pop!Raw Triple Q-F-String" beginRegion="Triple Q-region"/>
0524                                 <RegExpr attribute="Raw F-String" String="(?:fr|rf)'"                  insensitive="true" context="#pop!Raw A-F-String"/>
0525                                 <RegExpr attribute="Raw F-String" String="(?:fr|rf)&quot;"             insensitive="true" context="#pop!Raw Q-F-String"/>
0526 
0527                                 <StringDetect attribute="B-String" String="b'''"                insensitive="true" context="#pop!Triple A-B-String" beginRegion="Triple A-region"/>
0528                                 <StringDetect attribute="B-String" String="b&quot;&quot;&quot;" insensitive="true" context="#pop!Triple Q-B-String" beginRegion="Triple Q-region"/>
0529                                 <StringDetect attribute="B-String" String="b'"                  insensitive="true" context="#pop!Single A-B-String"/>
0530                                 <StringDetect attribute="B-String" String="b&quot;"             insensitive="true" context="#pop!Single Q-B-String"/>
0531 
0532                                 <RegExpr attribute="Raw B-String" String="(?:br|rb)'''"                insensitive="true" context="#pop!Raw Triple A-B-String" beginRegion="Triple A-region"/>
0533                                 <RegExpr attribute="Raw B-String" String="(?:br|rb)&quot;&quot;&quot;" insensitive="true" context="#pop!Raw Triple Q-B-String" beginRegion="Triple Q-region"/>
0534                                 <RegExpr attribute="Raw B-String" String="(?:br|rb)'"                  insensitive="true" context="#pop!Raw A-B-String"/>
0535                                 <RegExpr attribute="Raw B-String" String="(?:br|rb)&quot;"             insensitive="true" context="#pop!Raw Q-B-String"/>
0536                         </context>
0537 
0538                         <!-- https://docs.python.org/2/reference/lexical_analysis.html#string-literals -->
0539                         <!-- https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals -->
0540                         <context name="CommentVariants" attribute="Normal Text" lineEndContext="#stay">
0541                                 <!-- fast path -->
0542                                 <RegExpr String="(?:u|r|ur)?['&quot;]" insensitive="true" firstNonSpace="true" context="AssumeCommentVariants" lookAhead="1"/>
0543                         </context>
0544                         <context name="AssumeCommentVariants" attribute="Normal Text" lineEndContext="#stay">
0545                                 <RegExpr attribute="Comment" String="(?:u?r?)'''"                insensitive="true" context="#pop!Triple A-comment" beginRegion="Triple A-region"/>
0546                                 <RegExpr attribute="Comment" String="(?:u?r?)&quot;&quot;&quot;" insensitive="true" context="#pop!Triple Q-comment" beginRegion="Triple Q-region"/>
0547                                 <RegExpr attribute="Comment" String="(?:u?r?)'"                  insensitive="true" context="#pop!Single A-comment"/>
0548                                 <RegExpr attribute="Comment" String="(?:u?r?)&quot;"             insensitive="true" context="#pop!Single Q-comment"/>
0549                         </context>
0550 
0551                         <context name="Dictionary" attribute="Normal Text" lineEndContext="#stay" noIndentationBasedFolding="true">
0552                                 <DetectSpaces/>
0553                                 <DetectChar attribute="Normal Text" char="}" context="#pop" endRegion="Dictionary"/>
0554                                 <IncludeRules context="StringVariants" />
0555                                 <IncludeRules context="Normal" />
0556                         </context>
0557 
0558                         <context name="List" attribute="Normal Text" lineEndContext="#stay" noIndentationBasedFolding="true">
0559                                 <DetectSpaces/>
0560                                 <DetectChar attribute="Normal Text" char="]" context="#pop" endRegion="List"/>
0561                                 <IncludeRules context="StringVariants" />
0562                                 <IncludeRules context="Normal" />
0563                         </context>
0564 
0565                         <context name="Tuple" attribute="Normal Text" lineEndContext="#stay" noIndentationBasedFolding="true">
0566                                 <DetectSpaces/>
0567                                 <DetectChar attribute="Normal Text" char=")" context="#pop" endRegion="Tuple"/>
0568                                 <IncludeRules context="StringVariants" />
0569                                 <IncludeRules context="Normal" />
0570                         </context>
0571 
0572                         <context name="UnfinishedStringError" attribute="Error" lineEndContext="#stay" noIndentationBasedFolding="true">
0573                                 <!-- A single string/comment reached the end of the line without a \ line escape -->
0574                                 <!-- We set the following line (or part of it) to the "Error" attribute so that this error is easier to spot -->
0575                                 <RegExpr attribute="Error" String="^(\s{4,}|[^[\]()&quot;']{4,}([&quot;'].*)?)" context="#pop" column="0"/>
0576                         </context>
0577 
0578                         <!-- Comments -->
0579 
0580                         <context name="Hash comment" attribute="Comment" lineEndContext="#pop">
0581                                 <DetectSpaces />
0582                                 <IncludeRules context="##Comments" />
0583                                 <DetectIdentifier/>
0584                         </context>
0585 
0586                         <context name="Triple A-comment" attribute="Comment" lineEndContext="#stay" noIndentationBasedFolding="true">
0587                                 <DetectSpaces/>
0588                                 <StringDetect attribute="Comment" String="'''" context="#pop" endRegion="Triple A-region"/>
0589                                 <IncludeRules context="##Comments" />
0590                                 <DetectIdentifier/>
0591                                 <IncludeRules context="stringescape"/>
0592                                 <LineContinue attribute="String Char" context="#stay"/>
0593                         </context>
0594 
0595                         <context name="Triple Q-comment" attribute="Comment" lineEndContext="#stay" noIndentationBasedFolding="true">
0596                                 <DetectSpaces/>
0597                                 <StringDetect attribute="Comment" String="&quot;&quot;&quot;" context="#pop" endRegion="Triple Q-region"/>
0598                                 <IncludeRules context="##Comments" />
0599                                 <DetectIdentifier/>
0600                                 <IncludeRules context="stringescape"/>
0601                                 <LineContinue attribute="String Char" context="#stay"/>
0602                         </context>
0603 
0604                         <context name="Single A-comment" attribute="Comment" lineEndContext="#pop!UnfinishedStringError">
0605                                 <DetectSpaces/>
0606                                 <DetectChar attribute="Comment" char="'" context="#pop"/>
0607                                 <IncludeRules context="##Comments" />
0608                                 <DetectIdentifier/>
0609                                 <IncludeRules context="stringescape"/>
0610                                 <LineContinue attribute="String Char" context="#stay"/>
0611                         </context>
0612 
0613                         <context name="Single Q-comment" attribute="Comment" lineEndContext="#pop!UnfinishedStringError">
0614                                 <DetectSpaces/>
0615                                 <DetectChar attribute="Comment" char="&quot;" context="#pop"/>
0616                                 <IncludeRules context="##Comments" />
0617                                 <DetectIdentifier/>
0618                                 <IncludeRules context="stringescape"/>
0619                                 <LineContinue attribute="String Char" context="#stay"/>
0620                         </context>
0621 
0622                         <!-- Strings -->
0623 
0624                         <!-- format characters -->
0625                         <context name="stringformat" attribute="String Substitution" lineEndContext="#stay">
0626                                 <RegExpr attribute="String Substitution" String="&strsubstitution_py2;|&strsubstitution_py3;" context="#stay"/>
0627                                 <Detect2Chars attribute="String Substitution" char="{" char1="{" context="#stay" />
0628                                 <Detect2Chars attribute="String Substitution" char="}" char1="}" context="#stay" />
0629                         </context>
0630 
0631                         <!-- escape characters -->
0632                         <context name="stringescape" attribute="String Char" lineEndContext="#stay">
0633                                 <!-- As this highlighting style is for both, Python 2 and 3,
0634                                 we do not know if a normal string is “unicode” or not. So we
0635                                 -->
0636                                 <RegExpr attribute="String Char" String="\\[\\'&quot;abfnrtv]|\\[0-7]{1,3}|\\x[0-9A-Fa-f]{2}|\\u[0-9A-Fa-f]{4}|\\U[0-9A-Fa-f]{8}|\\N\{[a-zA-Z0-9\- ]+\}" context="#stay"/>
0637                         </context>
0638 
0639                         <!-- escape characters -->
0640                         <context name="bytesescape" attribute="String Char" lineEndContext="#stay">
0641                                 <!-- As this highlighting style is for both, Python 2 and 3,
0642                                 we do not know if a normal string is “unicode” or not. So we
0643                                 -->
0644                                 <RegExpr attribute="String Char" String="\\[\\'&quot;abfnrtv]|\\[0-7]{1,3}|\\x[0-9A-Fa-f]{2}" context="#stay"/>
0645                         </context>
0646 
0647                         <!-- f-literals -->
0648                         <context name="stringinterpolation" attribute="F-String" lineEndContext="#stay">
0649                                 <Detect2Chars attribute="String Char" char="{" char1="{" context="#stay"/>
0650                                 <DetectChar attribute="String Substitution" char="{" context="String Interpolation"/>
0651                                 <Detect2Chars attribute="String Char" char="}" char1="}" context="#stay"/>
0652                                 <DetectChar attribute="Error" char="}" context="#stay"/>
0653                         </context>
0654                         <context name="String Interpolation" attribute="String Substitution" lineEndContext="#stay">
0655                                 <DetectChar attribute="Error" char="\" context="#pop"/>
0656                                 <!-- format specifiers: [[fill]align][sign][#][0][minimumwidth][.precision][type] -->
0657                                 <RegExpr attribute="String Substitution" String="(?:![rsa])?(?::(?:[^}]?[&lt;&gt;=^])?[ +-]?#?0?[0-9]*(?:\.[0-9]+)?[bcdeEfFgGnosxX%]?)?\}" context="#pop"/>
0658                                 <IncludeRules context="Normal"/> <!-- TODO: create expression context instead -->
0659                         </context>
0660 
0661 
0662                         <!--
0663                         It follows a Binary tree of string kinds (not even touching byte literals).
0664                         The levels are:
0665                         1. triple- vs. single-quoted
0666                         2. apostrophe vs. quotation mark
0667                         3. static vs. interpolated (f-literal)
0668                         4. escaped vs. raw
0669                         Adding byte literals wouldn’t make the current 2⁴ into 2⁵ contexts, as there are no byte f-literals
0670                         -->
0671 
0672                         <!-- Triple-quoted A-strings -->
0673                         <context name="Triple A-string" attribute="String" lineEndContext="#stay" noIndentationBasedFolding="true">
0674                                 <DetectSpaces attribute="String"/>
0675                                 <DetectIdentifier attribute="String"/>
0676                                 <IncludeRules context="stringescape"/>
0677                                 <IncludeRules context="stringformat"/>
0678                                 <StringDetect attribute="String" String="'''" context="#pop!#CheckForString" endRegion="Triple A-region"/>
0679                                 <LineContinue attribute="String Char" context="#stay"/>
0680                         </context>
0681 
0682                         <context name="Raw Triple A-string" attribute="Raw String" lineEndContext="#stay" noIndentationBasedFolding="true">
0683                                 <DetectSpaces attribute="Raw String"/>
0684                                 <DetectIdentifier attribute="Raw String"/>
0685                                 <Detect2Chars attribute="Raw String" char="\" char1="'"/>
0686                                 <Detect2Chars attribute="Raw String" char="\" char1="\"/>
0687                                 <IncludeRules context="stringformat"/>
0688                                 <StringDetect attribute="Raw String" String="'''" context="#pop!#CheckForString" endRegion="Triple A-region"/>
0689                         </context>
0690 
0691                         <context name="Triple A-F-String" attribute="F-String" lineEndContext="#stay" noIndentationBasedFolding="true">
0692                                 <DetectSpaces attribute="F-String"/>
0693                                 <DetectIdentifier attribute="F-String"/>
0694                                 <IncludeRules context="stringescape"/>
0695                                 <IncludeRules context="stringinterpolation"/>
0696                                 <StringDetect attribute="F-String" String="'''" context="#pop!#CheckForString" endRegion="Triple A-region"/>
0697                                 <LineContinue attribute="String Char" context="#stay"/>
0698                         </context>
0699 
0700                         <context name="Raw Triple A-F-String" attribute="Raw F-String" lineEndContext="#stay" noIndentationBasedFolding="true">
0701                                 <DetectSpaces attribute="Raw F-String"/>
0702                                 <DetectIdentifier attribute="Raw F-String"/>
0703                                 <Detect2Chars attribute="Raw F-String" char="\" char1="'"/>
0704                                 <Detect2Chars attribute="Raw F-String" char="\" char1="\"/>
0705                                 <IncludeRules context="stringinterpolation"/>
0706                                 <StringDetect attribute="Raw F-String" String="'''" context="#pop!#CheckForString" endRegion="Triple A-region"/>
0707                         </context>
0708 
0709                         <context name="Triple A-B-String" attribute="B-String" lineEndContext="#stay" noIndentationBasedFolding="true">
0710                                 <RegExpr attribute="B-String" String="([\x20-\x26\x28-\x5B\x5D-\x7E]++|\\(?=[^\\'&quot;abfnrtvx0-7])|\\x(?![0-9a-fA-F]{2})|'(?!''))++"/>
0711                                 <IncludeRules context="bytesescape"/>
0712                                 <StringDetect attribute="B-String" String="'''" context="#pop!#CheckForString" endRegion="Triple A-region"/>
0713                                 <LineContinue attribute="String Char" context="#stay"/>
0714                                 <RegExpr attribute="Error" String="."/>
0715                         </context>
0716 
0717                         <context name="Raw Triple A-B-String" attribute="Raw B-String" lineEndContext="#stay" noIndentationBasedFolding="true">
0718                                 <RegExpr attribute="Raw B-String" String="([\x20-\x26\x28-\x5B\x5D-\x7E]++|\\.?|'(?!''))++"/>
0719                                 <StringDetect attribute="Raw B-String" String="'''" context="#pop!#CheckForString" endRegion="Triple A-region"/>
0720                                 <RegExpr attribute="Error" String="."/>
0721                         </context>
0722 
0723                         <!-- Triple-quoted Q-strings -->
0724                         <context name="Triple Q-string" attribute="String" lineEndContext="#stay" noIndentationBasedFolding="true">
0725                                 <DetectSpaces attribute="String"/>
0726                                 <DetectIdentifier attribute="String"/>
0727                                 <IncludeRules context="stringescape"/>
0728                                 <IncludeRules context="stringformat"/>
0729                                 <StringDetect attribute="String" String="&quot;&quot;&quot;" context="#pop!#CheckForString" endRegion="Triple Q-region"/>
0730                                 <LineContinue attribute="String Char" context="#stay"/>
0731                         </context>
0732 
0733                         <context name="Raw Triple Q-string" attribute="Raw String" lineEndContext="#stay" noIndentationBasedFolding="true">
0734                                 <DetectSpaces attribute="Raw String"/>
0735                                 <DetectIdentifier attribute="Raw String"/>
0736                                 <Detect2Chars attribute="Raw String" char="\" char1="&quot;"/>
0737                                 <Detect2Chars attribute="Raw String" char="\" char1="\"/>
0738                                 <IncludeRules context="stringformat"/>
0739                                 <StringDetect attribute="Raw String" String="&quot;&quot;&quot;" context="#pop!#CheckForString" endRegion="Triple Q-region"/>
0740                         </context>
0741 
0742                         <context name="Triple Q-F-String" attribute="F-String" lineEndContext="#stay" noIndentationBasedFolding="true">
0743                                 <DetectSpaces attribute="F-String"/>
0744                                 <DetectIdentifier attribute="F-String"/>
0745                                 <IncludeRules context="stringescape"/>
0746                                 <IncludeRules context="stringinterpolation"/>
0747                                 <StringDetect attribute="F-String" String="&quot;&quot;&quot;" context="#pop!#CheckForString" endRegion="Triple Q-region"/>
0748                                 <LineContinue attribute="String Char" context="#stay"/>
0749                         </context>
0750 
0751                         <context name="Raw Triple Q-F-String" attribute="Raw F-String" lineEndContext="#stay" noIndentationBasedFolding="true">
0752                                 <DetectSpaces attribute="Raw F-String"/>
0753                                 <DetectIdentifier attribute="Raw F-String"/>
0754                                 <Detect2Chars attribute="Raw F-String" char="\" char1="&quot;"/>
0755                                 <Detect2Chars attribute="Raw F-String" char="\" char1="\"/>
0756                                 <IncludeRules context="stringinterpolation"/>
0757                                 <StringDetect attribute="Raw F-String" String="&quot;&quot;&quot;" context="#pop!#CheckForString" endRegion="Triple Q-region"/>
0758                         </context>
0759 
0760                         <context name="Triple Q-B-String" attribute="B-String" lineEndContext="#stay" noIndentationBasedFolding="true">
0761                                 <RegExpr attribute="B-String" String="([\x20\x21\x23-\x5B\x5D-\x7E]++|\\(?=[^\\'&quot;abfnrtvx0-7])|\\x(?![0-9a-fA-F]{2})|&quot;(?!&quot;&quot;))++"/>
0762                                 <IncludeRules context="bytesescape"/>
0763                                 <StringDetect attribute="B-String" String="&quot;&quot;&quot;" context="#pop!#CheckForString" endRegion="Triple Q-region"/>
0764                                 <LineContinue attribute="String Char" context="#stay"/>
0765                                 <RegExpr attribute="Error" String="."/>
0766                         </context>
0767 
0768                         <context name="Raw Triple Q-B-String" attribute="Raw B-String" lineEndContext="#stay" noIndentationBasedFolding="true">
0769                                 <RegExpr attribute="Raw B-String" String="([\x20\x21\x23-\x5B\x5D-\x7E]++|\\.?|&quot;(?!&quot;&quot;))++"/>
0770                                 <StringDetect attribute="Raw B-String" String="&quot;&quot;&quot;" context="#pop!#CheckForString" endRegion="Triple Q-region"/>
0771                                 <RegExpr attribute="Error" String="."/>
0772                         </context>
0773 
0774 
0775                         <!-- Single-quoted A-strings -->
0776                         <context name="Single A-string" attribute="String" lineEndContext="#pop!UnfinishedStringError">
0777                                 <DetectSpaces attribute="String"/>
0778                                 <DetectIdentifier attribute="String"/>
0779                                 <IncludeRules context="stringescape"/>
0780                                 <IncludeRules context="stringformat"/>
0781                                 <DetectChar attribute="String" char="'" context="#pop!#CheckForString"/>
0782                                 <LineContinue attribute="String Char" context="#stay"/>
0783                         </context>
0784 
0785                         <context name="Raw A-string" attribute="Raw String" lineEndContext="#pop!UnfinishedStringError">
0786                                 <DetectSpaces attribute="Raw String"/>
0787                                 <DetectIdentifier attribute="Raw String"/>
0788                                 <Detect2Chars attribute="Raw String" char="\" char1="'"/>
0789                                 <Detect2Chars attribute="Raw String" char="\" char1="\"/>
0790                                 <IncludeRules context="stringformat"/>
0791                                 <DetectChar attribute="Raw String" char="'" context="#pop!#CheckForString"/>
0792                                 <LineContinue attribute="Raw String" context="#stay"/>
0793                         </context>
0794 
0795                         <context name="Single A-F-String" attribute="F-String" lineEndContext="#pop!UnfinishedStringError">
0796                                 <DetectSpaces attribute="F-String"/>
0797                                 <DetectIdentifier attribute="F-String"/>
0798                                 <IncludeRules context="stringescape"/>
0799                                 <IncludeRules context="stringinterpolation"/>
0800                                 <DetectChar attribute="F-String" char="'" context="#pop!#CheckForString"/>
0801                                 <LineContinue attribute="String Char" context="#stay"/>
0802                         </context>
0803 
0804                         <context name="Raw A-F-String" attribute="Raw F-String" lineEndContext="#pop!UnfinishedStringError">
0805                                 <DetectSpaces attribute="Raw F-String"/>
0806                                 <DetectIdentifier attribute="Raw F-String"/>
0807                                 <Detect2Chars attribute="Raw F-String" char="\" char1="'"/>
0808                                 <Detect2Chars attribute="Raw F-String" char="\" char1="\"/>
0809                                 <IncludeRules context="stringinterpolation"/>
0810                                 <DetectChar attribute="Raw F-String" char="'" context="#pop!#CheckForString"/>
0811                                 <LineContinue attribute="Raw F-String" context="#stay"/>
0812                         </context>
0813 
0814                         <context name="Single A-B-String" attribute="B-String" lineEndContext="#pop!UnfinishedStringError">
0815                                 <RegExpr attribute="B-String" String="([\x20-\x26\x28-\x5B\x5D-\x7E]++|\\(?=[^\\'&quot;abfnrtvx0-7])|\\x(?![0-9a-fA-F]{2}))++"/>
0816                                 <IncludeRules context="bytesescape"/>
0817                                 <DetectChar attribute="B-String" char="'" context="#pop!#CheckForString"/>
0818                                 <LineContinue attribute="String Char" context="#stay"/>
0819                                 <RegExpr attribute="Error" String="."/>
0820                         </context>
0821 
0822                         <context name="Raw A-B-String" attribute="Raw B-String" lineEndContext="#pop!UnfinishedStringError">
0823                                 <RegExpr attribute="Raw B-String" String="([\x20-\x26\x28-\x5B\x5D-\x7E]++|\\.)++"/>
0824                                 <DetectChar attribute="Raw B-String" char="'" context="#pop!#CheckForString"/>
0825                                 <LineContinue attribute="Raw B-String" context="#stay"/>
0826                                 <RegExpr attribute="Error" String="."/>
0827                         </context>
0828 
0829                         <!-- Single-quoted Q-strings -->
0830                         <context name="Single Q-string" attribute="String" lineEndContext="#pop!UnfinishedStringError">
0831                                 <DetectSpaces attribute="String"/>
0832                                 <DetectIdentifier attribute="String"/>
0833                                 <IncludeRules context="stringescape"/>
0834                                 <IncludeRules context="stringformat"/>
0835                                 <DetectChar attribute="String" char="&quot;" context="#pop!#CheckForString"/>
0836                                 <LineContinue attribute="String Char" context="#stay"/>
0837                         </context>
0838 
0839                         <context name="Raw Q-string" attribute="Raw String" lineEndContext="#pop!UnfinishedStringError">
0840                                 <DetectSpaces attribute="Raw String"/>
0841                                 <DetectIdentifier attribute="Raw String"/>
0842                                 <Detect2Chars attribute="Raw String" char="\" char1="&quot;"/>
0843                                 <Detect2Chars attribute="Raw String" char="\" char1="\"/>
0844                                 <IncludeRules context="stringformat"/>
0845                                 <DetectChar attribute="Raw String" char="&quot;" context="#pop!#CheckForString"/>
0846                                 <LineContinue attribute="Raw String" context="#stay"/>
0847                         </context>
0848 
0849                         <context name="Single Q-F-String" attribute="F-String" lineEndContext="#pop!UnfinishedStringError">
0850                                 <DetectSpaces attribute="F-String"/>
0851                                 <DetectIdentifier attribute="F-String"/>
0852                                 <IncludeRules context="stringescape"/>
0853                                 <IncludeRules context="stringinterpolation"/>
0854                                 <DetectChar attribute="F-String" char="&quot;" context="#pop!#CheckForString"/>
0855                                 <LineContinue attribute="String Char" context="#stay"/>
0856                         </context>
0857 
0858                         <context name="Raw Q-F-String" attribute="Raw F-String" lineEndContext="#pop!UnfinishedStringError">
0859                                 <DetectSpaces attribute="Raw F-String"/>
0860                                 <DetectIdentifier attribute="Raw F-String"/>
0861                                 <Detect2Chars attribute="Raw F-String" char="\" char1="&quot;"/>
0862                                 <Detect2Chars attribute="Raw F-String" char="\" char1="\"/>
0863                                 <IncludeRules context="stringinterpolation"/>
0864                                 <DetectChar attribute="Raw F-String" char="&quot;" context="#pop!#CheckForString"/>
0865                                 <LineContinue attribute="Raw F-String" context="#stay"/>
0866                         </context>
0867 
0868                         <context name="Single Q-B-String" attribute="B-String" lineEndContext="#pop!UnfinishedStringError">
0869                                 <RegExpr attribute="B-String" String="([\x20\x21\x23-\x5B\x5D-\x7E]++|\\(?=[^\\'&quot;abfnrtvx0-7])|\\x(?![0-9a-fA-F]{2}))++"/>
0870                                 <IncludeRules context="bytesescape"/>
0871                                 <DetectChar attribute="B-String" char="&quot;" context="#pop!#CheckForString"/>
0872                                 <LineContinue attribute="String Char" context="#stay"/>
0873                                 <RegExpr attribute="Error" String="."/>
0874                         </context>
0875 
0876                         <context name="Raw Q-B-String" attribute="Raw B-String" lineEndContext="#pop!UnfinishedStringError">
0877                                 <RegExpr attribute="Raw B-String" String="([\x20\x21\x23-\x5B\x5D-\x7E]++|\\.)++"/>
0878                                 <DetectChar attribute="Raw B-String" char="&quot;" context="#pop!#CheckForString"/>
0879                                 <Detect2Chars attribute="Raw B-String" char="\" char1="\"/>
0880                                 <LineContinue attribute="Raw B-String" context="#stay"/>
0881                                 <RegExpr attribute="Error" String="."/>
0882                         </context>
0883 
0884                 </contexts>
0885 
0886                 <itemDatas>
0887                         <itemData name="Normal Text" defStyleNum="dsNormal" spellChecking="false"/>
0888                         <itemData name="Definition Keyword" defStyleNum="dsKeyword" spellChecking="false"/>
0889                         <itemData name="Operator" defStyleNum="dsOperator" spellChecking="false"/>
0890                         <itemData name="Operator Keyword" defStyleNum="dsKeyword" spellChecking="false"/>
0891                         <itemData name="Flow Control Keyword" defStyleNum="dsControlFlow" spellChecking="false"/>
0892                         <itemData name="Builtin Function" defStyleNum="dsBuiltIn" spellChecking="false"/>
0893                         <itemData name="Special Variable" defStyleNum="dsVariable" spellChecking="false"/>
0894                         <itemData name="Extensions" defStyleNum="dsExtension" spellChecking="false"/>
0895                         <itemData name="Exceptions" defStyleNum="dsPreprocessor" spellChecking="false"/>
0896                         <itemData name="Overloaders" defStyleNum="dsFunction" spellChecking="false"/>
0897                         <itemData name="Import" defStyleNum="dsImport" spellChecking="false"/>
0898                         <itemData name="Float" defStyleNum="dsFloat" spellChecking="false"/>
0899                         <itemData name="Int" defStyleNum="dsDecVal" spellChecking="false"/>
0900                         <itemData name="Hex" defStyleNum="dsBaseN" spellChecking="false"/>
0901                         <itemData name="Octal" defStyleNum="dsBaseN" spellChecking="false"/>
0902                         <itemData name="Binary" defStyleNum="dsBaseN" spellChecking="false"/>
0903                         <itemData name="Complex" defStyleNum="dsOthers" spellChecking="false"/>
0904                         <itemData name="Comment" defStyleNum="dsComment"/>
0905                         <itemData name="String" defStyleNum="dsString"/>
0906                         <itemData name="Raw String" defStyleNum="dsVerbatimString"/>
0907                         <itemData name="F-String" defStyleNum="dsSpecialString"/>
0908                         <itemData name="Raw F-String" defStyleNum="dsVerbatimString"/>
0909                         <itemData name="B-String" defStyleNum="dsString" spellChecking="false"/>
0910                         <itemData name="Raw B-String" defStyleNum="dsVerbatimString" spellChecking="false"/>
0911                         <itemData name="String Char" defStyleNum="dsChar" spellChecking="false"/>
0912                         <itemData name="String Substitution" defStyleNum="dsSpecialChar" spellChecking="false"/>
0913                         <itemData name="Decorator" defStyleNum="dsAttribute" spellChecking="false"/>
0914                         <itemData name="Error" defStyleNum="dsError"/>
0915                 </itemDatas>
0916         </highlighting>
0917         <general>
0918                 <folding indentationsensitive="1" />
0919                 <emptyLines>
0920                         <emptyLine regexpr="(?:\s+|\s*#.*)"/>
0921                 </emptyLines>
0922                 <comments>
0923                         <comment name="singleLine" start="#" position="afterwhitespace"/>
0924                 </comments>
0925                 <keywords casesensitive="1" additionalDeliminator="#'"/>
0926         </general>
0927 </language>
0928 
0929 <!-- kate: space-indent off; indent-width 2; -->