Commit a822d3f4 authored by Christoph Cullmann's avatar Christoph Cullmann

sync xml data

parent c121d980
cmake_minimum_required(VERSION 3.5)
set(KF5_VERSION "5.63.0")
set(KF5_VERSION "5.64.0")
project(KSyntaxHighlighting VERSION ${KF5_VERSION})
find_package(ECM 5.63.0 REQUIRED NO_MODULE)
find_package(ECM 5.64.0 REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
if(POLICY CMP0063)
cmake_policy(SET CMP0063 NEW)
......@@ -12,6 +12,7 @@ endif()
include(KDEInstallDirs)
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include(KDECMakeSettings)
include(KDEClangFormat)
include(FeatureSummary)
include(GenerateExportHeader)
......@@ -85,6 +86,8 @@ if (NO_STANDARD_PATHS)
add_definitions(-DNO_STANDARD_PATHS)
endif()
add_definitions(-DQT_NO_FOREACH)
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050d00)
add_definitions(-DQT_DEPRECATED_WARNINGS_SINCE=0x060000)
#
# Actually build the stuff
......@@ -139,3 +142,8 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ksyntaxhighlighting_version.h"
install(FILES org_kde_ksyntaxhighlighting.categories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
# add clang-format target for all our real source files
file(GLOB ALL_CLANG_FORMAT_TEST_FILES autotests/*.cpp autotests/*.h)
file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES examples/*.cpp examples/*.h src/*.cpp src/*.h)
kde_clang_format(${ALL_CLANG_FORMAT_TEST_FILES} ${ALL_CLANG_FORMAT_SOURCE_FILES})
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<language name="Debian Changelog" version="8" kateversion="2.4" section="Other" extensions="" mimetype="">
<language name="Debian Changelog" version="9" kateversion="2.4" section="Other" extensions="" mimetype="">
<highlighting>
<list name="keywords">
<item>urgency</item>
......@@ -202,6 +202,11 @@
<item>eoan-proposed</item>
<item>eoan-updates</item>
<item>eoan-backports</item>
<item>focal</item>
<item>focal-security</item>
<item>focal-proposed</item>
<item>focal-updates</item>
<item>focal-backports</item>
</list>
<list name="urgencies">
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd"
[
<!ENTITY simpleName "([a-z][a-z\d]*:)?[a-z][a-z\d]*">
<!ENTITY baseName "([a-zA-Z_\$]|[^[:ascii:]])(([\w\$\-\.]|[^[:ascii:]])*([\w\$]|[^[:ascii:]]))?">
<!ENTITY name "(&baseName;:)?&baseName;">
<!ENTITY baseNameWithBound "(\b[a-zA-Z_\$]|[^[:ascii:]])(([\w\$\-\.]|[^[:ascii:]])*([\w\$]|[^[:ascii:]]))?">
<!ENTITY nameWithBound "(&baseNameWithBound;:)?&baseNameWithBound;"> <!-- Use this instead of "\b&name;" -->
<!ENTITY simpleName "(?:[a-z][a-z\d]*:)?[a-z][a-z\d]*">
<!ENTITY baseName "(?:[a-zA-Z_\$]|[^[:ascii:]])(?:(?:[\w\$\-\.]|[^[:ascii:]])*(?:[\w\$]|[^[:ascii:]]))?">
<!ENTITY name "(?:&baseName;:)?&baseName;">
<!ENTITY baseNameWithBound "(?:\b[a-zA-Z_\$]|[^[:ascii:]])(?:(?:[\w\$\-\.]|[^[:ascii:]])*(?:[\w\$]|[^[:ascii:]]))?">
<!ENTITY nameWithBound "(?:&baseNameWithBound;:)?&baseNameWithBound;"> <!-- Use this instead of "\b&name;" -->
<!ENTITY simpleTag "&lt;\s*&simpleName;"> <!-- Element tag -->
<!ENTITY tag "&lt;\s*(&name;|&gt;)">
<!ENTITY entref "&amp;([a-zA-Z\d]+|#\d+|#x[a-fA-F\d]+);">
<!ENTITY tag "&lt;\s*(?:&name;|&gt;)">
<!ENTITY entref "&amp;(?:[a-zA-Z\d]+|#\d+|#x[a-fA-F\d]+);">
<!ENTITY identifier "([a-zA-Z_$]|[^[:ascii:]])([\w$]|[^[:ascii:]])*">
<!ENTITY identifier "(?:[a-zA-Z_$]|[^[:ascii:]])(?:[\w$]|[^[:ascii:]])*">
]>
<!--
......@@ -48,7 +48,7 @@
* v1 [2018-06-20]: Initial version
-->
<language name="JavaScript React" version="5" kateversion="5.0" section="Scripts" indenter="cstyle"
<language name="JavaScript React" version="6" kateversion="5.0" section="Scripts" indenter="cstyle"
priority="8" extensions="*.jsx" mimetype="text/jsx;text/x-jsx;application/jsx;application/x-jsx;"
author="Nibaldo González (nibgonz@gmail.com)" license="MIT">
......@@ -104,7 +104,7 @@
<context name="VarDeclaration" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop">
<DetectSpaces />
<DetectChar context="#pop!NoTag" attribute="Symbol" char=":" />
<RegExpr context="#stay" attribute="Normal Text" String="&identifier;(?=\s*([\?!]\s*)?:)" />
<RegExpr context="#stay" attribute="Normal Text" String="&identifier;(?=\s*(?:[\?!]\s*)?:)" />
<AnyChar context="#stay" attribute="Symbol" String="?!" />
<IncludeRules context="AllComments" />
</context>
......@@ -148,13 +148,13 @@
<!-- Tag in new line -->
<RegExpr context="ValidTag" attribute="Normal Text" String="&tag;" firstNonSpace="true" lookAhead="true" />
<!-- Highlight tags only after some keywords -->
<RegExpr context="ValidTag" attribute="ControlFlow" String="\b(return|await)\s*(?=&tag;|/\*)" />
<RegExpr context="ValidTag" attribute="Module" String="\b(default)\s*(?=&tag;|/\*)" />
<RegExpr context="ValidTag" attribute="Reserved" String="\b(yield)\s*(?=&tag;|/\*)" />
<RegExpr context="ValidTag" attribute="ControlFlow" String="\b(?:return|await)\s*(?=&tag;|/\*)" />
<RegExpr context="ValidTag" attribute="Module" String="\b(?:default)\s*(?=&tag;|/\*)" />
<RegExpr context="ValidTag" attribute="Reserved" String="\b(?:yield)\s*(?=&tag;|/\*)" />
<!-- Characters before a valid tag -->
<RegExpr context="ValidTag" attribute="Special Operators" String="\=&gt;\s*(?=&tag;|/\*)" />
<RegExpr context="ValidTag" attribute="Symbol" String="([,\=&gt;:\*\?]|&amp;&amp;|\|\|)\s*(?=&tag;|/\*)" />
<RegExpr context="ValidTag" attribute="Symbol" String="(?:[,\=&gt;:\*\?]|&amp;&amp;|\|\|)\s*(?=&tag;|/\*)" />
<RegExpr context="ValidTag" attribute="Normal Text" String="[\(\[]\s*(?=&tag;|/\*)" />
<!-- The "Object-BeforeTag" context looks for a valid Tag and then sends the "Object" context -->
<DetectChar context="Object-BeforeTag" attribute="Symbol" char="{" beginRegion="Brace" />
......@@ -200,9 +200,9 @@
<RegExpr context="ElementTagContent" attribute="Element Tag" String="&lt;\s*&gt;" beginRegion="Element" />
<!-- Detect non-ASCII character in the tag name (component). This prevents highlighting as Element,
tag names that don't start with a non-ASCII character. -->
<RegExpr context="ComponentTagNonASCII" attribute="Component Tag" String="&lt;\s*(?=([a-z][a-z\d]*:)?([a-z][a-z\d]*)?[^[:ascii:]])" beginRegion="ComponentElement" /> <!-- &simpleName; -->
<RegExpr context="ComponentTagNonASCII" attribute="Component Tag" String="&lt;\s*(?=(?:[a-z][a-z\d]*:)?(?:[a-z][a-z\d]*)?[^[:ascii:]])" beginRegion="ComponentElement" /> <!-- &simpleName; -->
<!-- Element & component tags -->
<RegExpr context="ElementTag" attribute="Element Tag" String="&simpleTag;(?=[^\w\$\-\.:]|$|[\-\.]+([^\w\$\-\.]|$)|:([^a-zA-Z_\$]|$))" beginRegion="Element" />
<RegExpr context="ElementTag" attribute="Element Tag" String="&simpleTag;(?=[^\w\$\-\.:]|$|[\-\.]+(?:[^\w\$\-\.]|$)|:(?:[^a-zA-Z_\$]|$))" beginRegion="Element" />
<RegExpr context="ComponentTagFindType" attribute="Component Tag" String="&tag;" beginRegion="ComponentElement" />
</context>
<context name="FindEntityRefs" attribute="Normal Text" lineEndContext="#stay">
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd"
[
<!ENTITY identifier "([a-zA-Z_$]|[^[:ascii:]])([\w$]|[^[:ascii:]])*">
<!ENTITY identifier "(?:[a-zA-Z_$]|[^[:ascii:]])(?:[\w$]|[^[:ascii:]])*">
]>
<!-- Author: Anders Lund <anders@alweb.dk> //-->
<!-- Minor changes: Joseph Wenninger <jowenn@kde.org> //-->
<!-- Full JavaScript 1.0 support by Whitehawk Stormchaser //-->
<language name="JavaScript" version="12" kateversion="5.0" section="Scripts" extensions="*.js;*.kwinscript;*.julius"
<language name="JavaScript" version="13" kateversion="5.0" section="Scripts" extensions="*.js;*.kwinscript;*.julius"
mimetype="text/x-javascript;application/x-javascript;application/javascript;text/javascript" indenter="cstyle"
author="Anders Lund (anders@alweb.dk), Joseph Wenninger (jowenn@kde.org), Whitehawk Stormchaser (zerokode@gmx.net)" license="">
<highlighting>
......@@ -93,7 +93,7 @@
<Float attribute="Float" context="NoRegExp" />
<!-- Invalid Binary, Octal or Hex -->
<RegExpr attribute="Error" context="NoRegExp" String="\b0(b[01]*[2-9a-z]|o[0-7]*[89a-z]|x[0-9a-f]*[g-z])\w*\b" insensitive="true" />
<RegExpr attribute="Error" context="NoRegExp" String="\b0(?:b[01]*[2-9a-z]|o[0-7]*[89a-z]|x[0-9a-f]*[g-z])\w*\b" insensitive="true" />
<HlCHex attribute="Hex" context="NoRegExp" />
<RegExpr attribute="Octal" context="NoRegExp" String="\b0[oO][0-7]+" />
<RegExpr attribute="Binary" context="NoRegExp" String="\b0[bB][01]+" />
......@@ -174,11 +174,11 @@
<IncludeRules context="Escape" />
<DetectChar attribute="String" context="#pop" char="'" />
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="Escape">
<LineContinue attribute="Escape" context="#stay" />
<!-- Hexadecimal, unicode & octal -->
<RegExpr attribute="Escape" context="#stay" String="\\(x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|u\{[0-9a-fA-F]+\}|[0-3][0-7]{1,2}|[4-7][0-7]|[1-7])" />
<RegExpr attribute="Escape" context="#stay" String="\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|u\{[0-9a-fA-F]+\}|[0-3][0-7]{1,2}|[4-7][0-7]|[1-7])" />
<Detect2Chars attribute="Error" context="#stay" char="\" char1="x" />
<Detect2Chars attribute="Error" context="#stay" char="\" char1="u" />
<DetectChar attribute="Escape" context="Character Escape" char="\" />
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<language name="Meson" section="Other"
version="2" kateversion="2.4"
version="4" kateversion="2.4"
extensions="meson.build;meson_options.txt"
mimetype="text/x-meson"
priority="5"
license="LGPL">
<highlighting>
<list name = "flowControl">
<list name="flowControl">
<item>if</item>
<item>else</item>
<item>endif</item>
<item>foreach</item>
<item>endforeach</item>
</list>
<list name = "builtinfuncs">
<list name="builtinfuncs">
<item>add_global_arguments</item>
<item>add_global_link_arguments</item>
<item>add_languages</item>
<item>add_project_arguments</item>
<item>add_project_link_arguments</item>
<item>add_test_setup</item>
<item>alias_target</item>
<item>assert</item>
<item>benchmark</item>
<item>both_libraries</item>
<item>build_target</item>
<item>configuration_data</item>
<item>configure_file</item>
<item>custom_target</item>
<item>declare_dependency</item>
<item>dependency</item>
<item>disabler</item>
<item>environment</item>
<item>error</item>
<item>executable</item>
<item>find_program</item>
<item>find_library</item>
<item>files</item>
<item>find_library</item>
<item>find_program</item>
<item>generator</item>
<item>get_option</item>
<item>gettext</item>
<item>get_variable</item>
<item>import</item>
<item>include_directories</item>
<item>install_data</item>
<item>install_headers</item>
<item>install_man</item>
<item>install_subdir</item>
<item>is_subproject</item>
<item>is_disabler</item>
<item>is_variable</item>
<item>jar</item>
<item>join_paths</item>
<item>library</item>
<item>message</item>
<item>pkgconfig_gen</item>
<item>project</item>
<item>run_command</item>
<item>run_target</item>
<item>set_variable</item>
<item>shared_library</item>
<item>shared_module</item>
<item>static_library</item>
<item>subdir</item>
<item>subdir_done</item>
<item>subproject</item>
<item>test</item>
<item>vcs_tag</item>
<item>warning</item>
</list>
<list name = "logicalOperations">
<list name="logicalOperations">
<item>and</item>
<item>or</item>
<item>not</item>
......@@ -61,6 +77,118 @@
<item>true</item>
<item>false</item>
</list>
<list name="mesonObjet">
<item>meson</item>
</list>
<list name="machineObjet">
<item>build_machine</item>
<item>host_machine</item>
<item>target_machine</item>
</list>
<list name="mesonMembers">
<item>add_dist_script</item>
<item>add_install_script</item>
<item>add_postconf_script</item>
<item>backend</item>
<item>build_root</item>
<item>source_root</item>
<item>current_build_dir</item>
<item>current_source_dir</item>
<item>get_cross_property</item>
<item>get_compiler</item>
<item>has_exe_wrapper</item>
<item>install_dependency_manifest</item>
<item>is_cross_build</item>
<item>is_subproject</item>
<item>is_unity</item>
<item>override_find_program</item>
<item>project_version</item>
<item>project_license</item>
<item>project_name</item>
<item>version</item>
</list>
<list name="machineMembers">
<item>cpu_family</item>
<item>cpu</item>
<item>system</item>
<item>endian</item>
</list>
<list name="builtinmembers">
<item>alignment</item>
<item>append</item>
<item>as_system</item>
<item>cmd_array</item>
<item>compiled</item>
<item>compiles</item>
<item>compute_int</item>
<item>contains</item>
<item>endswith</item>
<item>extract_all_objects</item>
<item>extract_objects</item>
<item>find_library</item>
<item>first_supported_argument</item>
<item>first_supported_link_argument</item>
<item>format</item>
<item>found</item>
<item>full_path</item>
<item>get_argument_syntax</item>
<item>get_configtool_variable</item>
<item>get_define</item>
<item>get_id</item>
<item>get</item>
<item>get_pkgconfig_variable</item>
<item>get_supported_arguments</item>
<item>get_supported_function_attributes</item>
<item>get_supported_link_arguments</item>
<item>get_unquoted</item>
<item>get_variable</item>
<item>gettext</item>
<item>has_argument</item>
<item>has_function_attribute</item>
<item>has_function</item>
<item>has_header_symbol</item>
<item>has</item>
<item>has_key</item>
<item>has_link_argument</item>
<item>has_member</item>
<item>has_members</item>
<item>has_multi_arguments</item>
<item>has_multi_link_arguments</item>
<item>has_type</item>
<item>include_type</item>
<item>is_even</item>
<item>is_odd</item>
<item>join</item>
<item>length</item>
<item>links</item>
<item>merge_from</item>
<item>name</item>
<item>partial_dependency</item>
<item>path</item>
<item>pkgconfig_gen</item>
<item>prepend</item>
<item>private_dir_include</item>
<item>process</item>
<item>returncode</item>
<item>run</item>
<item>set10</item>
<item>set</item>
<item>set_quoted</item>
<item>sizeof</item>
<item>split</item>
<item>startswith</item>
<item>stderr</item>
<item>stdout</item>
<item>strip</item>
<item>symbols_have_underscore_prefix</item>
<item>to_lower</item>
<item>to_string</item>
<item>to_upper</item>
<item>type_name</item>
<item>underscorify</item>
<item>version_compare</item>
<item>version</item>
</list>
<contexts>
<context name="Normal" attribute="Normal Text" lineEndContext="#stay">
......@@ -68,11 +196,34 @@
<keyword attribute="Operator" String="logicalOperations" context="#stay"/>
<keyword attribute="Builtin Function" String="builtinfuncs" context="#stay"/>
<keyword attribute="Boolean Values" String="booleans" context="#stay"/>
<keyword attribute="Builtin Objet" String="mesonObjet" context="mesonObjet"/>
<keyword attribute="Builtin Objet" String="machineObjet" context="machineObjet"/>
<Int attribute="Int" context="#stay"/>
<DetectChar attribute="Comment" char="#" context="comment"/>
<AnyChar attribute="Operator" String="+-*/=&lt;&gt;" context="#stay"/>
<DetectChar attribute="Normal Text" char="[" context="List" beginRegion="List"/>
<IncludeRules context="StringVariants" />
<DetectChar attribute="Normal Text" char="." context="members"/>
</context>
<context name="mesonObjet" attribute="Normal Text" lineEndContext="#pop" fallthrough="1" fallthroughContext="#pop">
<DetectChar attribute="Normal Text" char="." context="mesonMembers"/>
</context>
<context name="mesonMembers" attribute="Normal Text" lineEndContext="#pop#pop" fallthrough="1" fallthroughContext="#pop#pop">
<keyword attribute="Builtin Function" String="mesonMembers" context="#pop#pop"/>
</context>
<context name="machineObjet" attribute="Normal Text" lineEndContext="#pop" fallthrough="1" fallthroughContext="#pop">
<DetectChar attribute="Normal Text" char="." context="machineMembers"/>
</context>
<context name="machineMembers" attribute="Normal Text" lineEndContext="#pop#pop" fallthrough="1" fallthroughContext="#pop#pop">
<keyword attribute="Builtin Function" String="machineMembers" context="#pop#pop"/>
</context>
<context name="members" attribute="Normal Text" lineEndContext="#pop" fallthrough="1" fallthroughContext="#pop#pop">
<keyword attribute="Builtin Member Function" String="builtinmembers" context="#pop"/>
</context>
<context name="List" attribute="Normal Text" lineEndContext="#stay" noIndentationBasedFolding="true">
......@@ -108,10 +259,19 @@
<itemData name="Int" defStyleNum="dsDecVal" spellChecking="false"/>
<itemData name="Flow Control Keyword" defStyleNum="dsKeyword" spellChecking="false"/>
<itemData name="Builtin Function" defStyleNum="dsDataType" spellChecking="false"/>
<itemData name="Builtin Objet" defStyleNum="dsDataType" spellChecking="false"/>
<itemData name="Builtin Member Function" defStyleNum="dsDataType" spellChecking="false"/>
<itemData name="Boolean Values" defStyleNum="dsKeyword" spellChecking="false"/>
<itemData name="String Char" defStyleNum="dsChar" spellChecking="false"/>
<itemData name="String" defStyleNum="dsString"/>
<itemData name="Comment" defStyleNum="dsComment"/>
</itemDatas>
</highlighting>
</language>
\ No newline at end of file
<general>
<comments>
<comment name="singleLine" start="#"/>
</comments>
</general>
</language>
......@@ -8,7 +8,7 @@
Copyright (c) 2012-2014 by Alex Turbov (i.zaufi@gmail.com)
-->
<language name="Modelines"
version="4"
version="5"
kateversion="5.0"
section="Other"
extensions=""
......@@ -130,10 +130,10 @@
<context name="Normal" attribute="Comment" lineEndContext="#pop">
<DetectSpaces />
<keyword String="ModelineStartKeyword" context="Modeline" attribute="Keyword" />
<RegExpr String="kate-(mimetype|wildcard)\(.*\):" context="Modeline" attribute="Keyword" />
<RegExpr String="kate-(?:mimetype|wildcard)\(.*\):" context="Modeline" attribute="Keyword" />
</context>
<context name="Modeline" attribute="Comment" lineEndContext="#pop">
<context name="Modeline" attribute="Comment" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
<DetectSpaces />
<keyword String="Booleans" context="Booleans" attribute="Variable" />
<keyword String="Integrals" context="Integrals" attribute="Variable" />
......@@ -142,7 +142,7 @@
<LineContinue context="#pop" />
</context>
<context name="Booleans" attribute="Comment" lineEndContext="#pop">
<context name="Booleans" attribute="Comment" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
<DetectSpaces />
<keyword String="True" attribute="Option ON" context="#stay" />
<keyword String="False" attribute="Option OFF" context="#stay" />
......@@ -150,7 +150,7 @@
<LineContinue context="#pop" />
</context>
<context name="Integrals" attribute="Comment" lineEndContext="#pop">
<context name="Integrals" attribute="Comment" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
<DetectSpaces />
<Int attribute="Number" context="#stay" />
<DetectChar char="&end;" context="#pop" attribute="Variable" />
......@@ -164,13 +164,13 @@
<LineContinue context="#pop" />
</context>
<context name="RemoveSpaces" attribute="Comment" lineEndContext="#pop">
<context name="RemoveSpaces" attribute="Comment" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
<DetectSpaces />
<keyword String="RemoveSpacesOptions" attribute="Value" context="#pop!RemoveSpacesEnd" />
<DetectChar char="&end;" context="#pop" attribute="Variable" />
<LineContinue context="#pop" />
</context>
<context name="RemoveSpacesEnd" attribute="Comment" lineEndContext="#pop">
<context name="RemoveSpacesEnd" attribute="Comment" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
<DetectChar char="&end;" context="#pop" attribute="Variable" />
</context>
......
<!DOCTYPE language SYSTEM "language.dtd">
<language
name="PowerShell"
version="4"
version="5"
kateversion="5.0"
extensions="*.ps1;*.ps1m;*.ps1d"
section="Scripts"
......@@ -892,7 +892,12 @@
<RegExpr attribute="Symbol" context="Member" String="[.]{1,1}" />
<AnyChar attribute="Symbol" context="#stay" String=":!%&amp;()+,-/.*&lt;=&gt;?[]|~^&#59;"/>
</context>
<context attribute="String Char" lineEndContext="#stay" name="StringEscape">
<RegExpr attribute="String Char" String="`[`&quot;0abefnrtv]" context="#stay"/>
<RegExpr attribute="String Char" String="`u\{[0-9A-Fa-f]+\}" context="#stay"/>
</context>
<context attribute="String" lineEndContext="#pop" name="String">
<IncludeRules context="StringEscape"/>
<LineContinue attribute="String" context="#pop"/>
<DetectChar attribute="String" context="#pop" char="&quot;"/>
</context>
......@@ -916,6 +921,7 @@
<itemData name="Function" defStyleNum="dsFunction" spellChecking="false"/>
<itemData name="Data Type" defStyleNum="dsDataType" spellChecking="false"/>
<itemData name="String" defStyleNum="dsString"/>
<itemData name="String Char" defStyleNum="dsChar" spellChecking="false"/>
<itemData name="HereString" defStyleNum="dsVerbatimString"/>
<itemData name="Comment" defStyleNum="dsComment"/>
<itemData name="Cmdlets" defStyleNum="dsBuiltIn" spellChecking="false"/>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd"
[
<!ENTITY simpleName "([a-z][a-z\d]*:)?[a-z][a-z\d]*">
<!ENTITY baseName "([a-zA-Z_\$]|[^[:ascii:]])(([\w\$\-\.]|[^[:ascii:]])*([\w\$]|[^[:ascii:]]))?">
<!ENTITY name "(&baseName;:)?&baseName;">
<!ENTITY baseNameWithBound "(\b[a-zA-Z_\$]|[^[:ascii:]])(([\w\$\-\.]|[^[:ascii:]])*([\w\$]|[^[:ascii:]]))?">
<!ENTITY nameWithBound "(&baseNameWithBound;:)?&baseNameWithBound;"> <!-- Use this instead of "\b&name;" -->
<!ENTITY simpleName "(?:[a-z][a-z\d]*:)?[a-z][a-z\d]*">
<!ENTITY baseName "(?:[a-zA-Z_\$]|[^[:ascii:]])(?:(?:[\w\$\-\.]|[^[:ascii:]])*(?:[\w\$]|[^[:ascii:]]))?">
<!ENTITY name "(?:&baseName;:)?&baseName;">
<!ENTITY baseNameWithBound "(?:\b[a-zA-Z_\$]|[^[:ascii:]])(?:(?:[\w\$\-\.]|[^[:ascii:]])*(?:[\w\$]|[^[:ascii:]]))?">
<!ENTITY nameWithBound "(?:&baseNameWithBound;:)?&baseNameWithBound;"> <!-- Use this instead of "\b&name;" -->
<!ENTITY simpleTag "&lt;\s*&simpleName;"> <!-- Element tag -->
<!ENTITY tag "&lt;\s*(&name;|&gt;)">
<!ENTITY entref "&amp;([a-zA-Z\d]+|#\d+|#x[a-fA-F\d]+);">
<!ENTITY tag "&lt;\s*(?:&name;|&gt;)">
<!ENTITY entref "&amp;(?:[a-zA-Z\d]+|#\d+|#x[a-fA-F\d]+);">
<!ENTITY identifier "([a-zA-Z_$]|[^[:ascii:]])([\w$]|[^[:ascii:]])*">
<!ENTITY identifier "(?:[a-zA-Z_$]|[^[:ascii:]])(?:[\w$]|[^[:ascii:]])*">
<!ENTITY objectOp "[\?!]?">
<!ENTITY endLine "\s*($|//|(/\*.*\*/\s*)+$)">
<!ENTITY endLine "\s*(?:$|//|(?:/\*.*\*/\s*)+(?:$|//))">
]>
<!--
......@@ -38,7 +38,8 @@
available at: https://github.com/Microsoft/TypeScript-TmLanguage
Change log:
* v4 [2019-08-30]: Adapt to version 5 of "typescript.xml".
* v6 [2019-10-01]: Highlight "<T extends" as a type assertion, not as a Tag.
* v5 [2019-08-30]: Adapt to version 5 of "typescript.xml".
* v4 [2019-07-16]: Adapt to version 4 of "typescript.xml".
* v3 [2019-02-20]: Don't highlight tags within declarations of
types, variables, classes and interfaces.
......@@ -51,7 +52,7 @@
* v1 [2018-11-18]: Initial version
-->
<language name="TypeScript React" version="5" kateversion="5.53" section="Scripts" indenter="cstyle"
<language name="TypeScript React" version="6" kateversion="5.53" section="Scripts" indenter="cstyle"
priority="8" extensions="*.tsx" mimetype="text/tsx;text/x-tsx;application/tsx;application/x-tsx;"
author="Nibaldo González (nibgonz@gmail.com)" license="MIT">
......@@ -78,7 +79,7 @@
<DetectChar context="Template" attribute="Template" char="`" />
<DetectChar context="Object" attribute="Symbol" char="{" beginRegion="Brace" />
<DetectChar context="Types" attribute="Symbol" char=":" />
<RegExpr context="TypesAngleBracket" attribute="Symbol" String="&lt;(?=(&identifier;|[\[\{\(&lt;]).*&gt;)" />
<RegExpr context="TypesAngleBracket" attribute="Symbol" String="&lt;(?=(?:&identifier;|[\[\{\(&lt;]).*&gt;)" />
<DetectChar context="#stay" attribute="Symbol" char="[" beginRegion="List" />
<DetectChar context="NoRegExp" attribute="Symbol" char="]" endRegion="List" />
<RegExpr context="ConditionalExpression" attribute="Symbol" String="\?(?=.*&identifier;\s*\:)" />
......@@ -170,6 +171,7 @@
<IncludeRules context="Normal##TypeScript" />
</context>
<context name="TypesAngleBracket" attribute="Normal Text" lineEndContext="#pop">
<RegExpr context="#pop!ValidTag" attribute="Symbol" String="&gt;\s*(?=&tag;|/\*)" />
<DetectChar context="#pop" attribute="Symbol" char="&gt;" />
<IncludeRules context="TypesAngleBracketEnd##TypeScript" />
<IncludeRules context="FixPopLineEndContext##TypeScript" />
......@@ -238,13 +240,13 @@
<!-- Tag in new line -->
<RegExpr context="ValidTag" attribute="Normal Text" String="&tag;" firstNonSpace="true" lookAhead="true" />
<!-- Highlight tags only after some keywords -->
<RegExpr context="ValidTag" attribute="ControlFlow" String="\b(return|await)\s*(?=&tag;|/\*)" />
<RegExpr context="ValidTag" attribute="Module" String="\b(default)\s*(?=&tag;|/\*)" />
<RegExpr context="ValidTag" attribute="Reserved" String="\b(yield)\s*(?=&tag;|/\*)" />
<RegExpr context="ValidTag" attribute="ControlFlow" String="\b(?:return|await)\s*(?=&tag;|/\*)" />
<RegExpr context="ValidTag" attribute="Module" String="\b(?:default)\s*(?=&tag;|/\*)" />
<RegExpr context="ValidTag" attribute="Reserved" String="\b(?:yield)\s*(?=&tag;|/\*)" />
<!-- Characters before a valid tag -->
<RegExpr context="ValidTag" attribute="Special Operators" String="\=&gt;\s*(?=&tag;|/\*)" />
<RegExpr context="ValidTag" attribute="Symbol" String="([\[,\=&gt;\*\?]|&amp;&amp;|\|\|)\s*(?=&tag;|/\*)" />
<RegExpr context="ValidTag" attribute="Symbol" String="(?:[\[,\=&gt;\*\?]|&amp;&amp;|\|\|)\s*(?=&tag;|/\*)" />
<RegExpr context="ValidTag" attribute="Normal Text" String="\(\s*(?=&tag;|/\*)" />
<!-- The "Object-BeforeTag" context looks for a valid Tag and then sends the "Object" context -->
<RegExpr context="Object-BeforeTag" attribute="Symbol" String="\{\s*(?=&tag;|/\*)" beginRegion="Brace" />
......@@ -297,6 +299,11 @@
NOTE: The highlighting of Tags after a multiline comment does not work with: lineEndContext="#pop" -->
<context name="ValidTag" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop">
<RegExpr context="#stay" attribute="Normal Text" String="\s+(?=&lt;|/\*)" />
<!-- Because TSX cannot have "cast" expression, we can say "<T extends" starts the type parameter of arrow
See: https://github.com/microsoft/TypeScript-TmLanguage/commit/11b1a4f8dc3a3eaa4df71e8cc1ad6f01a688961d#diff-d5222b162266b45fd998419db416fddd -->
<RegExpr context="#pop!TypesAngleBracket" attribute="Symbol" String="&lt;(?=\s*&identifier;\s+extends\s*[^\=&gt;])" />
<IncludeRules context="FindTags" />
<IncludeRules context="AllComments" />
</context>
......@@ -307,9 +314,9 @@
<RegExpr context="ElementTagContent" attribute="Element Tag" String="&lt;\s*&gt;" beginRegion="Element" />
<!-- Detect non-ASCII character in the tag name (component). This prevents highlighting as Element,
tag names that don't start with a non-ASCII character. -->
<RegExpr context="ComponentTagNonASCII" attribute="Component Tag" String="&lt;\s*(?=([a-z][a-z\d]*:)?([a-z][a-z\d]*)?[^[:ascii:]])" beginRegion="ComponentElement" /> <!-- &simpleName; -->
<RegExpr context="ComponentTagNonASCII" attribute="Component Tag" String="&lt;\s*(?=(?:[a-z][a-z\d]*:)?(?:[a-z][a-z\d]*)?[^[:ascii:]])" beginRegion="ComponentElement" /> <!-- &simpleName; -->
<!-- Element & component tags -->
<RegExpr context="ElementTag" attribute="Element Tag" String="&simpleTag;(?=[^\w\$\-\.:]|$|[\-\.]+([^\w\$\-\.]|$)|:([^a-zA-Z_\$]|$))" beginRegion="Element" />
<RegExpr context="ElementTag" attribute="Element Tag" String="&simpleTag;(?=[^\w\$\-\.:]|$|[\-\.]+(?:[^\w\$\-\.]|$)|:(?:[^a-zA-Z_\$]|$))" beginRegion="Element" />
<RegExpr context="ComponentTagFindType" attribute="Component Tag" String="&tag;" beginRegion="ComponentElement" />
</context>
<context name="FindEntityRefs" attribute="Normal Text" lineEndContext="#stay">
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd"
[
<!ENTITY identifier "([a-zA-Z_$]|[^[:ascii:]])([\w$]|[^[:ascii:]])*">
<!ENTITY numSuffix "(?=n?([^\w]|$))">
<!ENTITY objectOp "[\?!]?">
<!ENTITY endLine "\s*($|//|(/\*.*\*/\s*)+$)">
<!ENTITY identifier "(?:[a-zA-Z_$]|[^[:ascii:]])(?:[\w$]|[^[:ascii:]])*">
<!ENTITY numSuffix "(?=n?(?:[^\w]|$))">
<!ENTITY objectOp "[\?!]?">
<!ENTITY objectPoint "\s*&objectOp;\.">
<!ENTITY endLine "\s*(?:$|//|(?:/\*.*\*/\s*)+(?:$|//))">
<!ENTITY utilityTypes "\b(?:Partial|Readonly|Record|Pick|Omit|Exclude|Extract|NonNullable|ReturnType|InstanceType|Required|ThisType)(?=\s*&lt;)">
]>
<!--
......@@ -39,6 +41,8 @@
incorporate these keywords (for example: "qml.xml").
Change log:
* v6 [2019-10-01]: Add "asserts" keyword in type predicates.
Highlight types after the "as" keyword.
* v5 [2019-08-30]: Avoid that ?: be used as conditional expressions.
* v4 [2019-07-16]: Fixed highlighting of keywords before ":" in conditional expressions.
* v3 [2019-02-18]: Add support to bigint and the "is" keyword.
......@@ -50,7 +54,7 @@
-->
<language name="TypeScript"
version="5"
version="6"
kateversion="5.53"
section="Scripts"
extensions="*.ts"
......@@ -75,7 +79,6 @@
<include>reserved##JavaScript</include>
<item>type</item>
<item>arguments</item>
<!-- Class -->
<item>readonly</item>
<item>abstract</item>
......@@ -1661,9 +1664,9 @@
<IncludeRules context="FindStrings" />
<!-- Abstract -->
<RegExpr context="#stay" attribute="Reserved" String="\b(abstract)(?=\s+(class|interface)\b)" />
<RegExpr context="#stay" attribute="Reserved" String="\babstract(?=\s+(?:class|interface)\b)" />
<!-- New -->
<RegExpr context="NewTarget" attribute="Keyword" String="\bnew(?=\s*&objectOp;\.\s*target\b)" />
<RegExpr context="NewTarget" attribute="Keyword" String="\bnew(?=&objectPoint;\s*target\b)" />
<RegExpr context="MemberObject" attribute="Objects" String="\bnew(?=&objectOp;\.)" />
<WordDetect context="#stay" attribute="Keyword" String="new" />
......@@ -1682,12 +1685,15 @@
<keyword context="#stay" attribute="Keyword" String="keywords" /> <!-- NoRegExp? -->
<keyword context="#stay" attribute="Reserved" String="reserved" />
<!-- Utility Types -->
<RegExpr context="#stay" attribute="Built-in Objects" String="&utilityTypes;" />
<!-- Built-in Classes -->
<IncludeRules context="BuiltInClasses" />
<!-- Objects -->
<RegExpr context="MemberObject" attribute="Objects" String="&identifier;(?=\s*&objectOp;\.)" />
<RegExpr context="MemberObject" attribute="Objects" String="&identifier;(?=&objectPoint;)" />
<DetectChar context="MemberObject" char="." />
<RegExpr context="Types" attribute="Module" String="\bas(?=\s)" />
<!-- Import -->
<WordDetect context="Import" attribute="Module" String="import" />
<!-- Export types -->
......@@ -1709,9 +1715,9 @@
<RegExpr context="ConditionalExpression" attribute="Symbol" String="\?(?=.*&identifier;\s*\:)" />
<DetectChar context="#stay" attribute="Symbol" char="?" /> <!-- Fix of conditional expression from the JavaScript highlighting -->
<!-- Highlight types after ":" and between "<" and ">" -->
<!-- Type Parameter: Highlight types after ":" and between "<" and ">" -->
<DetectChar context="Types" attribute="Symbol" char=":" />
<RegExpr context="TypesAngleBracket" attribute="Symbol" String="&lt;(?=(&identifier;|[\[\{\(&lt;]).*&gt;)" />
<RegExpr context="TypesAngleBracket" attribute="Symbol" String="&lt;(?=(?:&identifier;|[\[\{\(&lt;]).*&gt;)" />
<IncludeRules context="Normal##JavaScript" />
</context>
......@@ -1737,6 +1743,8 @@
<WordDetect context=