diff options
Diffstat (limited to 'kate/data/python.xml')
-rw-r--r-- | kate/data/python.xml | 248 |
1 files changed, 190 insertions, 58 deletions
diff --git a/kate/data/python.xml b/kate/data/python.xml index 9296f4c7e..4207ca8a2 100644 --- a/kate/data/python.xml +++ b/kate/data/python.xml @@ -1,64 +1,80 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE language> <!-- Python syntax highlightning v0.9 by Per Wigren --> -<language name="Python" version="1.24" kateversion="2.4" section="Scripts" extensions="*.py;*.pyw;SConstruct;SConscript" mimetype="application/x-python;text/x-python" casesensitive="1" author="Per Wigren" license=""> +<!-- 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 --> +<language name="Python" version="1.99" kateversion="2.4" section="Scripts" extensions="*.py;*.pyw" mimetype="application/x-python;text/x-python" casesensitive="1" author="Michael Bueker" license=""> <highlighting> <list name="prep"> <item> import </item> <item> from </item> <item> as </item> </list> - - <list name="statements"> - <item> and </item> - <item> assert </item> - <item> break </item> + <list name="defs"> <item> class </item> - <item> continue </item> <item> def </item> <item> del </item> + <item> global </item> + <item> lambda </item> + </list> + <list name="operators"> + <item> and </item> + <item> assert </item> + <item> in </item> + <item> is </item> + <item> not </item> + <item> or </item> + </list> + <list name="commands"> + <item> exec </item> + <item> print </item> + </list> + <list name="flow"> + <item> break </item> + <item> continue </item> <item> elif </item> <item> else </item> <item> except </item> - <item> exec </item> <item> finally </item> <item> for </item> - <item> global </item> <item> if </item> - <item> in </item> - <item> is </item> - <item> lambda </item> - <item> not </item> - <item> or </item> <item> pass </item> - <item> print </item> <item> raise </item> <item> return </item> <item> try </item> <item> while </item> <item> yield </item> </list> - <list name="builtinfuncs"> + <item> __future__ </item> + <item> __import__ </item> + <item> __name__ </item> <item> abs </item> + <item> all </item> + <item> any </item> <item> apply </item> + <item> basestring </item> + <item> bool </item> <item> buffer </item> <item> callable </item> <item> chr </item> + <item> classmethod </item> <item> cmp </item> <item> coerce </item> <item> compile </item> <item> complex </item> - <item> copyright </item> - <item> credits </item> <item> delattr </item> + <item> dict </item> <item> dir </item> <item> divmod </item> + <item> enumerate </item> <item> eval </item> <item> execfile </item> - <item> exit </item> + <item> file </item> <item> filter </item> <item> float </item> + <item> frozenset </item> <item> getattr </item> <item> globals </item> <item> hasattr </item> @@ -72,27 +88,33 @@ <item> issubclass </item> <item> iter </item> <item> len </item> - <item> license </item> <item> list </item> <item> locals </item> <item> long </item> <item> map </item> <item> max </item> <item> min </item> + <item> object </item> <item> oct </item> <item> open </item> <item> ord </item> <item> pow </item> - <item> quit </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> @@ -101,74 +123,167 @@ <item> xrange </item> <item> zip </item> </list> - <list name="specialvars"> <item> None </item> <item> self </item> - <item> cls </item> <item> True </item> <item> False </item> <item> NotImplemented </item> <item> Ellipsis </item> </list> - + <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> + </list> + <list name="exceptions"> + <item>ArithmeticError</item> + <item>AssertionError</item> + <item>AttributeError</item> + <item>BaseException</item> + <item>DeprecationWarning</item> + <item>EnvironmentError</item> + <item>EOFError</item> + <item>Exception</item> + <item>FloatingPointError</item> + <item>FutureWarning</item> + <item>GeneratorExit</item> + <item>IOError</item> + <item>ImportError</item> + <item>ImportWarning</item> + <item>IndexError</item> + <item>KeyError</item> + <item>KeyboardInterrupt</item> + <item>LookupError</item> + <item>MemoryError</item> + <item>NameError</item> + <item>NotImplementedError</item> + <item>OSError</item> + <item>OverflowError</item> + <item>PendingDeprecationWarning</item> + <item>ReferenceError</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>TypeError</item> + <item>UnboundLocalError</item> + <item>UserWarning</item> + <item>UnicodeError</item> + <item>UnicodeWarning</item> + <item>UnicodeEncodeError</item> + <item>UnicodeDecodeError</item> + <item>UnicodeTranslateError</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="Preprocessor" String="prep" context="#stay"/> - <keyword attribute="Keyword" String="statements" context="#stay"/> + <keyword attribute="Definition Keyword" String="defs" context="#stay"/> + <keyword attribute="Operator" String="operators" context="#stay"/> + <keyword attribute="Command Keyword" String="commands" 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"/> - <RegExpr attribute="Normal" String="[a-zA-Z_]\w+" 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="Normal" String="[a-zA-Z_][a-zA-Z_0-9]+" context="#stay"/> - <RegExpr attribute="Complex" String=" (((\d*\.\d+|\d+\.)|(\d+|(\d*\.\d+|\d+\.))[eE][+-]?\d+)|\d+)[jJ]" context="#stay"/> - <RegExpr attribute="Float" String="(\d+\.\d*|\.\d+)([eE]\d+)?" context="#stay"/> - <RegExpr attribute="Int" String="([1-9]\d*([eE]\d+)?|0)" context="#stay"/> - <RegExpr attribute="Long" String="[1-9]\d*([eE][\d.]+)?[Ll]" context="#stay"/> - <RegExpr attribute="Hex" String="0[Xx][\da-fA-F]+" context="#stay"/> - <RegExpr attribute="Octal" String="0[1-9]\d*" context="#stay"/> + <RegExpr attribute="Complex" String=" ((([0-9]*\.[0-9]+|[0-9]+\.)|([0-9]+|([0-9]*\.[0-9]+|[0-9]+\.))[eE](\+|-)?[0-9]+)|[0-9]+)[jJ]" context="#stay"/> + <RegExpr attribute="Float" String="([0-9]+\.[0-9]*|\.[0-9]+)([eE][0-9]+)?" context="#stay"/> + <RegExpr attribute="Int" String="([1-9][0-9]*([eE][0-9]+)?|0)" context="#stay"/> + <RegExpr attribute="Long" String="[1-9][0-9]*([eE][0-9.]+)?[Ll]" context="#stay"/> + <RegExpr attribute="Hex" String="0[Xx][0-9a-fA-F]+" context="#stay"/> + <RegExpr attribute="Octal" String="0[1-9][0-9]*" context="#stay"/> + + <RegExpr attribute="Raw String" String="[rR]'''" context="Raw Tripple A-string"/> + <RegExpr attribute="Raw String" String="[rR]"""" context="Raw Tripple Q-string"/> <RegExpr attribute="Raw String" String="[rR]'" context="Raw A-string"/> <RegExpr attribute="Raw String" String="[rR]"" context="Raw Q-string"/> <RegExpr attribute="Comment" String="#.*$" context="#stay"/> - <StringDetect attribute="Comment" String="'''" context="Tripple A-comment" firstNonSpace="true" beginRegion="Tripple A-region"/> - <StringDetect attribute="Comment" String=""""" context="Tripple Q-comment" firstNonSpace="true" beginRegion="Tripple Q-region"/> + <RegExpr attribute="Comment" String="^\s*'''" context="Tripple A-comment" beginRegion="Tripple A-region"/> + <RegExpr attribute="Comment" String="^\s*"""" context="Tripple Q-comment" beginRegion="Tripple Q-region"/> <StringDetect attribute="String" String="'''" context="Tripple A-string" beginRegion="Tripple A-region"/> <StringDetect attribute="String" String=""""" context="Tripple Q-string" beginRegion="Tripple Q-region"/> <DetectChar attribute="String" char="'" context="Single A-string"/> <DetectChar attribute="String" char=""" context="Single Q-string"/> - + <DetectChar attribute="Operator" char="(" context="parenthesised" beginRegion="parenthesis"/> <DetectChar attribute="Operator" char=")" context="#pop" endRegion="parenthesis"/> - <RegExpr attribute="Operator" String="[+*/\(\)%\|\[\]\{\}:=;\!<>!^&~-]" context="#stay"/> + + <RegExpr attribute="Operator" String="[+*/%\|=;\!<>!^&~-]" context="#stay"/> + <RegExpr attribute="String Substitution" String="%[a-zA-Z]" context="#stay"/> </context> - - <context name="parenthesised" attribute="Normal Text" lineEndContext="#stay" noIndentationBasedFolding="True"> + + <context name="parenthesised" attribute="Normal Text" lineEndContext="#stay" noIndentationBasedFolding="true"> <IncludeRules context="Normal" /> </context> - - <context name="Tripple A-comment" attribute="Comment" lineEndContext="#stay" noIndentationBasedFolding="True"> - <HlCChar attribute="Comment" context="#stay"/> + + <context name="Tripple A-comment" attribute="Comment" lineEndContext="#stay" noIndentationBasedFolding="true"> <StringDetect attribute="Comment" String="'''" context="#pop" endRegion="Tripple A-region"/> </context> - <context name="Tripple Q-comment" attribute="Comment" lineEndContext="#stay" noIndentationBasedFolding="True"> + <context name="Tripple Q-comment" attribute="Comment" lineEndContext="#stay" noIndentationBasedFolding="true"> <HlCChar attribute="Comment" context="#stay"/> - <StringDetect attribute="Comment" String=""""" context="#pop" endRegion="Tripple Q-region"/> + <RegExpr attribute="Comment" String=""""" context="#pop" endRegion="Tripple Q-region"/> + </context> + + <context name="Tripple A-string" attribute="String" lineEndContext="#stay" noIndentationBasedFolding="true"> + <HlCStringChar attribute="String Char" context="#stay"/> + <RegExpr attribute="String Substitution" String="%\([a-zA-Z0-9_]+\)[a-zA-Z]" context="#stay"/> + <RegExpr attribute="String Substitution" String="%[a-zA-Z]" context="#stay"/> + <RegExpr attribute="String" String="'''" context="#pop" endRegion="Tripple A-region"/> </context> - <context name="Tripple A-string" attribute="String" lineEndContext="#stay" noIndentationBasedFolding="True"> - <HlCChar attribute="String" context="#stay"/> - <RegExpr attribute="Operator" String="%[a-zA-Z]" context="#stay"/> - <StringDetect attribute="String" String="'''" context="#pop" endRegion="Tripple A-region"/> + <context name="Raw Tripple A-string" attribute="Raw String" lineEndContext="#stay" noIndentationBasedFolding="true"> + <HlCStringChar attribute="Raw String" context="#stay"/> + <RegExpr attribute="String Substitution" String="%\([a-zA-Z0-9_]+\)[a-zA-Z]" context="#stay"/> + <RegExpr attribute="String Substitution" String="%[a-zA-Z]" context="#stay"/> + <RegExpr attribute="String" String="'''" context="#pop" endRegion="Tripple A-region"/> </context> - <context name="Tripple Q-string" attribute="String" lineEndContext="#stay" noIndentationBasedFolding="True"> - <HlCStringChar attribute="String" context="#stay"/> - <RegExpr attribute="Operator" String="%[a-zA-Z]" context="#stay"/> - <StringDetect attribute="String" String=""""" context="#pop" endRegion="Tripple Q-region"/> + <context name="Tripple Q-string" attribute="String" lineEndContext="#stay" noIndentationBasedFolding="true"> + <HlCStringChar attribute="String Char" context="#stay"/> + <RegExpr attribute="String Substitution" String="%\([a-zA-Z0-9_]+\)[a-zA-Z]" context="#stay"/> + <RegExpr attribute="String Substitution" String="%[a-zA-Z]" context="#stay"/> + <RegExpr attribute="String" String=""""" context="#pop" endRegion="Tripple Q-region"/> + </context> + + <context name="Raw Tripple Q-string" attribute="Raw String" lineEndContext="#stay" noIndentationBasedFolding="true"> + <HlCStringChar attribute="Raw String" context="#stay"/> + <RegExpr attribute="String Substitution" String="%\([a-zA-Z0-9_]+\)[a-zA-Z]" context="#stay"/> + <RegExpr attribute="String Substitution" String="%[a-zA-Z]" context="#stay"/> + <RegExpr attribute="String" String=""""" context="#pop" endRegion="Tripple Q-region"/> </context> <context name="Single A-comment" attribute="Comment" lineEndContext="#stay"> @@ -182,24 +297,30 @@ </context> <context name="Single A-string" attribute="String" lineEndContext="#stay"> - <HlCStringChar attribute="String" context="#stay"/> - <RegExpr attribute="Operator" String="%[a-zA-Z]" context="#stay"/> + <HlCStringChar attribute="String Char" context="#stay"/> + <RegExpr attribute="String Substitution" String="%\([a-zA-Z0-9_]+\)[a-zA-Z]" context="#stay"/> + <RegExpr attribute="String Substitution" String="%[a-zA-Z]" context="#stay"/> <DetectChar attribute="String" char="'" context="#pop"/> </context> <context name="Single Q-string" attribute="String" lineEndContext="#stay"> - <HlCStringChar attribute="String" context="#stay"/> - <RegExpr attribute="Operator" String="%[a-zA-Z]" context="#stay"/> + <HlCStringChar attribute="String Char" context="#stay"/> + <RegExpr attribute="String Substitution" String="%\([a-zA-Z0-9_]+\)[a-zA-Z]" context="#stay"/> + <RegExpr attribute="String Substitution" String="%[a-zA-Z]" context="#stay"/> <DetectChar attribute="String" char=""" context="#pop"/> </context> <context name="Raw A-string" attribute="Raw String" lineEndContext="#stay"> <HlCStringChar attribute="Raw String" context="#stay"/> + <RegExpr attribute="String Substitution" String="%\([a-zA-Z0-9_]+\)[a-zA-Z]" context="#stay"/> + <RegExpr attribute="String Substitution" String="%[a-zA-Z]" context="#stay"/> <DetectChar attribute="Raw String" char="'" context="#pop"/> </context> <context name="Raw Q-string" attribute="Raw String" lineEndContext="#stay"> <HlCStringChar attribute="Raw String" context="#stay"/> + <RegExpr attribute="String Substitution" String="%\([a-zA-Z0-9_]+\)[a-zA-Z]" context="#stay"/> + <RegExpr attribute="String Substitution" String="%[a-zA-Z]" context="#stay"/> <DetectChar attribute="Raw String" char=""" context="#pop"/> </context> @@ -207,11 +328,18 @@ </contexts> <itemDatas> <itemData name="Normal Text" defStyleNum="dsNormal"/> - <itemData name="Operator" defStyleNum="dsChar"/> - <itemData name="Keyword" defStyleNum="dsKeyword"/> + <itemData name="Definition Keyword" defStyleNum="dsKeyword"/> + <itemData name="Operator" defStyleNum="dsNormal"/> + <itemData name="String Substitution" defStyleNum="dsNormal"/> + <itemData name="Command Keyword" defStyleNum="dsKeyword"/> + <itemData name="Flow Control Keyword" defStyleNum="dsKeyword"/> <itemData name="Builtin Function" defStyleNum="dsDataType"/> <itemData name="Special Variable" defStyleNum="dsOthers"/> + <itemData name="Extensions" defStyleNum="dsOthers" color="#0095ff" selColor="#ffffff" bold="1" italic="0"/> + <itemData name="Exceptions" defStyleNum="dsOthers" color="#054d00" selColor="#ffffff" bold="1" italic="0"/> + <itemData name="Overloaders" defStyleNum="dsOthers" color="#000e52" selColor="#ffffff" bold="1" italic="0"/> <itemData name="Preprocessor" defStyleNum="dsChar"/> + <itemData name="String Char" defStyleNum="dsChar"/> <itemData name="Long" defStyleNum="dsOthers"/> <itemData name="Float" defStyleNum="dsFloat"/> <itemData name="Int" defStyleNum="dsDecVal"/> @@ -225,8 +353,12 @@ </highlighting> <general> <folding indentationsensitive="1" /> + <emptyLines> + <emptyLine regexpr="\s+" casesensitive="false"/> + <emptyLine regexpr="\s*#.*$" casesensitive="false"/> + </emptyLines> <comments> - <comment name="singleLine" start="#" position="afterwhitespace"/> + <comment name="singleLine" start="#" position="afterwhitespace"/> </comments> <keywords casesensitive="1" /> </general> |