SyntaxHighlighting: update KSyntaxHighlighting engine to v5.63.0

Task-number: QTCREATORBUG-22558
Change-Id: I0902d5d866fc83fca2d508cab24dea8d7176240c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2019-11-05 08:59:26 +01:00
parent f85f1df157
commit 5634f112bd
32 changed files with 3169 additions and 312 deletions

View File

@@ -9,7 +9,7 @@
Copyright 2004 Alexander Neundorf (neundorf@kde.org)
Copyright 2005 Dominik Haumann (dhdev@gmx.de)
Copyright 2007,2008,2013,2014 Matthew Woehlke (mw_triad@users.sourceforge.net)
Copyright 2013-2015,2017-2018 Alex Turbov (i.zaufi@gmail.com)
Copyright 2013-2015,2017-2019 Alex Turbov (i.zaufi@gmail.com)
**********************************************************************
* This library is free software; you can redistribute it and/or *
@@ -31,7 +31,7 @@
<language
name="CMake"
version="11"
version="16"
kateversion="2.4"
section="Other"
extensions="CMakeLists.txt;*.cmake;*.cmake.in"
@@ -70,6 +70,12 @@
{%- endfor %}
</list>
<list name="environment-variables">
{%- for var in environment_variables.kw %}
<item>{{var}}</item>
{%- endfor %}
</list>
{%- for kind in properties.kinds %}
<list name="{{ kind|replace('_', '-') }}">
{%- for prop in properties[kind].kw %}
@@ -197,11 +203,27 @@
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="Detect Variable Substitutions">
<RegExpr attribute="Environment Variable Substitution" context="#stay" String="\$ENV\{\s*[\w-]+\s*\}" />
<RegExpr attribute="Cache Variable Substitution" context="#stay" String="\$CACHE\{\s*[\w-]+\s*\}" />
<RegExpr attribute="Environment Variable Substitution" context="EnvVarSubst" String="\$ENV\{\s*[\w-]+\s*\}" lookAhead="true" />
<Detect2Chars attribute="Variable Substitution" context="VarSubst" char="$" char1="{" />
<RegExpr attribute="@Variable Substitution" context="@VarSubst" String="@&id_re;@" lookAhead="true" />
</context>
<context attribute="Environment Variable Substitution" lineEndContext="#pop" name="EnvVarSubst">
<DetectIdentifier />
<DetectChar attribute="Environment Variable Substitution" context="EnvVarSubstVar" char="{" />
<DetectChar attribute="Environment Variable Substitution" context="#pop" char="}" />
</context>
<context attribute="Environment Variable Substitution" lineEndContext="#pop" name="EnvVarSubstVar">
<keyword attribute="Standard Environment Variable" context="#stay" String="environment-variables" insensitive="false" />
{%- for var in environment_variables.re %}
<RegExpr attribute="Standard Environment Variable" context="#stay" String="{{var}}" />
{%- endfor %}
<DetectIdentifier />
<DetectChar attribute="Environment Variable Substitution" context="#pop#pop" char="}" />
</context>
<context attribute="Variable Substitution" lineEndContext="#pop" name="VarSubst">
<IncludeRules context="Detect Builtin Variables" />
<DetectIdentifier />
@@ -300,10 +322,12 @@
<itemData name="Strings" defStyleNum="dsString" spellChecking="true" />
<itemData name="Escapes" defStyleNum="dsChar" spellChecking="false" />
<itemData name="Builtin Variable" defStyleNum="dsDecVal" color="#c09050" selColor="#c09050" spellChecking="false" />
<itemData name="Internal Name" defStyleNum="dsDecVal" color="#303030" selColor="#303030" spellChecking="false" />
<itemData name="Variable Substitution" defStyleNum="dsDecVal" spellChecking="false" />
<itemData name="@Variable Substitution" defStyleNum="dsBaseN" spellChecking="false" />
<itemData name="Internal Name" defStyleNum="dsDecVal" color="#303030" selColor="#303030" spellChecking="false" />
<itemData name="Cache Variable Substitution" defStyleNum="dsFloat" spellChecking="false" />
<itemData name="Environment Variable Substitution" defStyleNum="dsFloat" spellChecking="false" />
<itemData name="Standard Environment Variable" defStyleNum="dsFloat" spellChecking="false" />
<itemData name="Generator Expression Keyword" defStyleNum="dsKeyword" color="#b84040" selColor="#b84040" spellChecking="false" />
<itemData name="Generator Expression" defStyleNum="dsOthers" color="#b86050" selColor="#b86050" spellChecking="false" />
<itemData name="Comment" defStyleNum="dsComment" spellChecking="true" />

View File

@@ -7,6 +7,7 @@ global-properties:
- AUTORCC_SOURCE_GROUP
- CMAKE_C_KNOWN_FEATURES
- CMAKE_CXX_KNOWN_FEATURES
- CMAKE_ROLE # Since 3.14
- DEBUG_CONFIGURATIONS
- DISABLED_FEATURES
- ENABLED_FEATURES
@@ -42,6 +43,7 @@ global-properties:
- FeatureSummary_<TYPE>_DESCRIPTION
directory-properties:
- ADDITIONAL_CLEAN_FILES # Since 3.15
- ADDITIONAL_MAKE_CLEAN_FILES
- BINARY_DIR
- BUILDSYSTEM_TARGETS
@@ -78,6 +80,7 @@ directory-properties:
# NOTE Copy-n-pasting this list from official docs may contain a redudant item `Example`! Check it!
target-properties:
- ADDITIONAL_CLEAN_FILES # Since 3.15
- ALIASED_TARGET
- ANDROID_ANT_ADDITIONAL_OPTIONS
- ANDROID_API
@@ -101,17 +104,24 @@ target-properties:
- ARCHIVE_OUTPUT_NAME_<CONFIG>
- ARCHIVE_OUTPUT_NAME
- AUTOGEN_BUILD_DIR
- AUTOGEN_ORIGIN_DEPENDS # Since 3.14
- AUTOGEN_TARGET_DEPENDS
- AUTOMOC_COMPILER_PREDEFINES # Since ???
- AUTOMOC_DEPEND_FILTERS
- AUTOMOC_MOC_OPTIONS
- AUTOMOC_EXECUTABLE # Since 3.14
- AUTOMOC_MACRO_NAMES
- AUTOMOC_MOC_OPTIONS # Since ???
- AUTOMOC
- AUTOUIC
- AUTOUIC_EXECUTABLE # Since 3.14
- AUTOUIC_OPTIONS
- AUTOUIC_SEARCH_PATHS
- AUTORCC
- AUTORCC_EXECUTABLE # Since 3.14
- AUTORCC_OPTIONS
- BINARY_DIR
- BUILD_RPATH
- BUILD_RPATH_USE_ORIGIN # Since 3.14
- BUILD_WITH_INSTALL_NAME_DIR
- BUILD_WITH_INSTALL_RPATH
- BUNDLE_EXTENSION
@@ -246,6 +256,7 @@ target-properties:
- MACOSX_RPATH
- MANUALLY_ADDED_DEPENDENCIES
- MAP_IMPORTED_CONFIG_<CONFIG>
- MSVC_RUNTIME_LIBRARY # Since 3.15
- NAME
- NO_SONAME
- NO_SYSTEM_FROM_IMPORTED
@@ -278,6 +289,9 @@ target-properties:
- STATIC_LIBRARY_FLAGS
- STATIC_LIBRARY_OPTIONS # Since 3.13
- SUFFIX
- Swift_DEPENDENCIES_FILE # Since 3.15
- Swift_MODULE_DIRECTORY # Since 3.15
- Swift_MODULE_NAME # Since 3.15
- TYPE
- VERSION
- VISIBILITY_INLINES_HIDDEN
@@ -298,8 +312,13 @@ target-properties:
- VS_GLOBAL_<variable>
- VS_IOT_EXTENSIONS_VERSION
- VS_IOT_STARTUP_TASK
- VS_JUST_MY_CODE_DEBUGGING # Since 3.15
- VS_KEYWORD
- VS_MOBILE_EXTENSIONS_VERSION
- VS_NO_SOLUTION_DEPLOY # Since 3.15
- VS_PACKAGE_REFERENCES # Since 3.15
- VS_PROJECT_IMPORT # Since 3.15
- VS_PACKAGE_REFERENCES
- VS_SCC_AUXPATH
- VS_SCC_LOCALPATH
- VS_SCC_PROJECTNAME
@@ -314,9 +333,12 @@ target-properties:
- WINDOWS_EXPORT_ALL_SYMBOLS
- XCODE_ATTRIBUTE_<an-attribute>
- XCODE_EXPLICIT_FILE_TYPE
- XCODE_GENERATE_SCHEME # Since 3.15
- XCODE_PRODUCT_TYPE
- XCODE_SCHEME_ADDRESS_SANITIZER # Since 3.13
- XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN # Since 3.13
- XCODE_SCHEME_ARGUMENTS # Since 3.13
- XCODE_SCHEME_DEBUG_AS_ROOT # Since 3.15
- XCODE_SCHEME_THREAD_SANITIZER # Since 3.13
- XCODE_SCHEME_THREAD_SANITIZER_STOP # Since 3.13
- XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER # Since 3.13
@@ -331,7 +353,6 @@ target-properties:
- XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE # Since 3.13
- XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS # Since 3.13
- XCODE_SCHEME_EXECUTABLE # Since 3.13
- XCODE_SCHEME_ARGUMENTS # Since 3.13
- XCODE_SCHEME_ENVIRONMENT # Since 3.13
- XCTEST
@@ -383,6 +404,8 @@ source-properties:
- SKIP_AUTOMOC
- SKIP_AUTORCC
- SKIP_AUTOUIC
- Swift_DEPENDENCIES_FILE # Since 3.15
- Swift_DIAGNOSTICS_FILE # Since 3.15
- SYMBOLIC
- VS_COPY_TO_OUT_DIR
- VS_CSHARP_<tagname>
@@ -423,69 +446,95 @@ install-properties:
- CPACK_WIX_ACL
generator-expressions:
# Boolean Generator Expressions
# * Logical Operators
- 0
- 1
- AND
- ANGLE-R
- BOOL
- BUILD_INTERFACE
- COMMA
- COMPILE_FEATURES
- COMPILE_LANGUAGE
- CONFIG
- CXX_COMPILER_ID
- CXX_COMPILER_VERSION
- C_COMPILER_ID
- C_COMPILER_VERSION
- EQUAL
- GENEX_EVAL # Since 3.12
- IF
- INSTALL_INTERFACE
- INSTALL_PREFIX
- IN_LIST # Since 3.12
- JOIN
- LINK_ONLY
- LOWER_CASE
- MAKE_C_IDENTIFIER
- NOT
- AND
- OR
- PLATFORM_ID
- SEMICOLON
- SHELL_PATH
- NOT
# * String Comparisons
- STREQUAL
- TARGET_BUNDLE_CONTENT_DIR
- TARGET_BUNDLE_DIR
- TARGET_EXISTS # Since 3.12
- TARGET_FILE
- TARGET_FILE_DIR
- TARGET_FILE_NAME
- TARGET_GENEX_EVAL # Since 3.12
- TARGET_LINKER_FILE
- TARGET_LINKER_FILE_DIR
- TARGET_LINKER_FILE_NAME
- TARGET_NAME
- TARGET_NAME_IF_EXISTS # Since 3.12
- TARGET_OBJECTS
- TARGET_PDB_FILE
- TARGET_PDB_FILE_DIR
- TARGET_PDB_FILE_NAME
- TARGET_POLICY
- TARGET_PROPERTY
- TARGET_SONAME_FILE
- TARGET_SONAME_FILE_DIR
- TARGET_SONAME_FILE_NAME
- UPPER_CASE
- VERSION_EQUAL
- VERSION_GREATER
- VERSION_GREATER_EQUAL
- EQUAL
- IN_LIST # Since 3.12
- VERSION_LESS
- VERSION_GREATER
- VERSION_EQUAL
- VERSION_LESS_EQUAL
- VERSION_GREATER_EQUAL
# * Variable Queries
- TARGET_EXISTS # Since 3.12
- CONFIG
- PLATFORM_ID
- C_COMPILER_ID
- CXX_COMPILER_ID
- CUDA_COMPILER_ID # Since 3.15
- Fortran_COMPILER_ID
- C_COMPILER_VERSION
- CXX_COMPILER_VERSION
- CUDA_COMPILER_VERSION # Since 3.15
- Fortran_COMPILER_VERSION
- TARGET_POLICY
- COMPILE_FEATURES
- COMPILE_LANG_AND_ID # Since 3.15
- COMPILE_LANGUAGE
# String-Valued Generator Expressions
# * Escaped Characters
- ANGLE-R
- COMMA
- SEMICOLON
# * Conditional Expressions
- IF
# * String Transformations
- JOIN
- REMOVE_DUPLICATES # Since 3.15
- FILTER # Since 3.15
- LOWER_CASE
- UPPER_CASE
- GENEX_EVAL # Since 3.12
- TARGET_GENEX_EVAL # Since 3.12
# * Variable Queries (NOTE Already included above)
# * Target-Dependent Queries
- TARGET_NAME_IF_EXISTS # Since 3.12
- TARGET_FILE
- TARGET_FILE_BASE_NAME # Since 3.15
- TARGET_FILE_PREFIX # Since 3.15
- TARGET_FILE_SUFFIX # Since 3.15
- TARGET_FILE_NAME
- TARGET_FILE_DIR
- TARGET_LINKER_FILE
- TARGET_LINKER_FILE_BASE_NAME # Since 3.15
- TARGET_LINKER_FILE_PREFIX # Since 3.15
- TARGET_LINKER_FILE_SUFFIX # Since 3.15
- TARGET_LINKER_FILE_NAME
- TARGET_LINKER_FILE_DIR
- TARGET_SONAME_FILE
- TARGET_SONAME_FILE
- TARGET_SONAME_FILE_NAME
- TARGET_SONAME_FILE_DIR
- TARGET_PDB_FILE
- TARGET_PDB_FILE_BASE_NAME # Since 3.15
- TARGET_PDB_FILE_NAME
- TARGET_PDB_FILE_DIR
- TARGET_BUNDLE_DIR
- TARGET_BUNDLE_CONTENT_DIR
- TARGET_PROPERTY
- INSTALL_PREFIX
# Output-Related Expressions
- TARGET_NAME
- LINK_ONLY
- INSTALL_INTERFACE
- BUILD_INTERFACE
- MAKE_C_IDENTIFIER
- TARGET_OBJECTS
- SHELL_PATH
variables:
# Variables that Provide Information
- CMAKE_AR
- CMAKE_ARGC
- CMAKE_ARGV0
- CMAKE_ARGV<n>
- CMAKE_BINARY_DIR
- CMAKE_BUILD_TOOL
- CMAKE_CACHEFILE_DIR
@@ -558,6 +607,7 @@ variables:
- CMAKE_SOURCE_DIR
- CMAKE_STATIC_LIBRARY_PREFIX
- CMAKE_STATIC_LIBRARY_SUFFIX
- CMAKE_Swift_MODULE_DIRECTORY # Since 3.15
- CMAKE_TOOLCHAIN_FILE
- CMAKE_TWEAK_VERSION
- CMAKE_VERBOSE_MAKEFILE
@@ -611,7 +661,9 @@ variables:
- CMAKE_ECLIPSE_VERSION
- CMAKE_ERROR_DEPRECATED
- CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION
- CMAKE_EXECUTE_PROCESS_COMMAND_ECHO # Since 3.15
- CMAKE_EXPORT_COMPILE_COMMANDS
- CMAKE_EXPORT_PACKAGE_REGISTRY # Since 3.15
- CMAKE_EXPORT_NO_PACKAGE_REGISTRY
- CMAKE_FIND_APPBUNDLE
- CMAKE_FIND_FRAMEWORK
@@ -621,6 +673,8 @@ variables:
- CMAKE_FIND_NO_INSTALL_PREFIX
- CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY
- CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY
- CMAKE_FIND_PACKAGE_PREFER_CONFIG # Since 3.15
- CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS # Since 3.14
- CMAKE_FIND_PACKAGE_WARN_NO_MODULE
- CMAKE_FIND_ROOT_PATH
- CMAKE_FIND_ROOT_PATH_MODE_INCLUDE
@@ -639,6 +693,7 @@ variables:
- CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT
- CMAKE_LIBRARY_PATH
- CMAKE_LINK_DIRECTORIES_BEFORE # Since 3.13
- CMAKE_MAXIMUM_RECURSION_DEPTH # Since 3.14
- CMAKE_MFC_FLAG
- CMAKE_MODULE_PATH
- CMAKE_NOT_USING_CONFIG_FLAGS
@@ -646,6 +701,8 @@ variables:
- CMAKE_POLICY_WARNING_CMP<NNNN>
- CMAKE_PREFIX_PATH
- CMAKE_PROGRAM_PATH
- CMAKE_PROJECT_INCLUDE # Since 3.15
- CMAKE_PROJECT_INCLUDE_BEFORE # Since 3.15
- CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE
- CMAKE_SKIP_INSTALL_ALL_DEPENDENCY
- CMAKE_STAGING_PREFIX
@@ -757,6 +814,7 @@ variables:
- CMAKE_ANDROID_STL_TYPE
- CMAKE_ARCHIVE_OUTPUT_DIRECTORY
- CMAKE_ARCHIVE_OUTPUT_DIRECTORY_<CONFIG>
- CMAKE_AUTOGEN_ORIGIN_DEPENDS # Since 3.14
- CMAKE_AUTOGEN_PARALLEL
- CMAKE_AUTOGEN_VERBOSE # Since 3.13
- CMAKE_AUTOMOC
@@ -768,6 +826,7 @@ variables:
- CMAKE_AUTOUIC_OPTIONS
- CMAKE_AUTOUIC_SEARCH_PATHS
- CMAKE_BUILD_RPATH
- CMAKE_BUILD_RPATH_USE_ORIGIN # Since 3.14
- CMAKE_BUILD_WITH_INSTALL_NAME_DIR
- CMAKE_BUILD_WITH_INSTALL_RPATH
- CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY
@@ -781,8 +840,13 @@ variables:
- CMAKE_EXE_LINKER_FLAGS_<CONFIG>_INIT
- CMAKE_EXE_LINKER_FLAGS_INIT
- CMAKE_FOLDER # Since 3.12
- CMAKE_FRAMEWORK # Since 3.15
- CMAKE_Fortran_FORMAT
- CMAKE_Fortran_MODULE_DIRECTORY
- CMAKE_GLOBAL_AUTOGEN_TARGET # Since 3.14
- CMAKE_GLOBAL_AUTOGEN_TARGET_NAME # Since 3.14
- CMAKE_GLOBAL_AUTORCC_TARGET # Since 3.14
- CMAKE_GLOBAL_AUTORCC_TARGET_NAME # Since 3.14
- CMAKE_GNUtoMS
- CMAKE_INCLUDE_CURRENT_DIR
- CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE
@@ -814,6 +878,8 @@ variables:
- CMAKE_MODULE_LINKER_FLAGS_<CONFIG>
- CMAKE_MODULE_LINKER_FLAGS_<CONFIG>_INIT
- CMAKE_MODULE_LINKER_FLAGS_INIT
- CMAKE_MSVCIDE_RUN_PATH # Since 3.15
- CMAKE_MSVC_RUNTIME_LIBRARY # Since 3.15
- CMAKE_NINJA_OUTPUT_PATH_PREFIX
- CMAKE_NO_BUILTIN_CHRPATH
- CMAKE_NO_SYSTEM_FROM_IMPORTED
@@ -843,6 +909,7 @@ variables:
- CMAKE_VS_GLOBALS # Since 3.13
- CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD
- CMAKE_VS_INCLUDE_PACKAGE_TO_DEFAULT_BUILD
- CMAKE_VS_JUST_MY_CODE_DEBUGGING # Since 3.15
- CMAKE_VS_SDK_EXCLUDE_DIRECTORIES # Since 3.12
- CMAKE_VS_SDK_EXECUTABLE_DIRECTORIES # Since 3.12
- CMAKE_VS_SDK_INCLUDE_DIRECTORIES # Since 3.12
@@ -986,6 +1053,7 @@ variables:
- CTEST_P4_UPDATE_OPTIONS
- CTEST_SCP_COMMAND
- CTEST_SITE
- CTEST_SUBMIT_URL # Since 3.14
- CTEST_SOURCE_DIRECTORY
- CTEST_SVN_COMMAND
- CTEST_SVN_OPTIONS
@@ -996,6 +1064,7 @@ variables:
- CTEST_UPDATE_COMMAND
- CTEST_UPDATE_OPTIONS
- CTEST_UPDATE_VERSION_ONLY
- CTEST_UPDATE_VERSION_OVERRIDE # Since 3.15
- CTEST_USE_LAUNCHERS
# Variables for CPack
- CPACK_ABSOLUTE_DESTINATION_FILES
@@ -1064,6 +1133,7 @@ variables:
- CMAKE_REQUIRED_DEFINITIONS
- CMAKE_REQUIRED_FLAGS
- CMAKE_REQUIRED_INCLUDES
- CMAKE_REQUIRED_LINK_OPTIONS # Since 3.14
- CMAKE_REQUIRED_LIBRARIES
- CMAKE_REQUIRED_QUIET
# - CheckTypeSize
@@ -1198,6 +1268,7 @@ variables:
- CPACK_IFW_PACKAGE_BANNER
- CPACK_IFW_PACKAGE_BACKGROUND
- CPACK_IFW_PACKAGE_WIZARD_STYLE
- CPACK_IFW_PACKAGE_STYLE_SHEET # Since 3.15
- CPACK_IFW_PACKAGE_WIZARD_DEFAULT_WIDTH
- CPACK_IFW_PACKAGE_WIZARD_DEFAULT_HEIGHT
- CPACK_IFW_PACKAGE_TITLE_COLOR
@@ -1546,7 +1617,59 @@ variables:
# - UseSWIG
- CMAKE_SWIG_FLAGS
- CMAKE_SWIG_OUTDIR
- SWIG_OUTFILE_DIR
- SWIG_MODULE_<name>_EXTRA_DEPS
- SWIG_SOURCE_FILE_EXTENSIONS # Since 3.14
# https://cmake.org/cmake/help/latest/manual/cmake-env-variables.7.html
# NOTE Added to syntax file version 14 at 3.15.0 version of CMake
environment-variables:
# Environment Variables that Control the Build
- CMAKE_BUILD_PARALLEL_LEVEL
- CMAKE_CONFIG_TYPE
- CMAKE_GENERATOR
- CMAKE_GENERATOR_INSTANCE
- CMAKE_GENERATOR_PLATFORM
- CMAKE_GENERATOR_TOOLSET
- CMAKE_MSVCIDE_RUN_PATH
- CMAKE_NO_VERBOSE
- CMAKE_OSX_ARCHITECTURES
- DESTDIR
- LDFLAGS
- MACOSX_DEPLOYMENT_TARGET
- <PackageName>_ROOT
- VERBOSE
# Environment Variables for Languages
- ASM<DIALECT>
- ASM<DIALECT>FLAGS
- CC
- CFLAGS
- CSFLAGS
- CUDACXX
- CUDAFLAGS
- CUDAHOSTCXX
- CXX
- CXXFLAGS
- FC
- FFLAGS
- RC
- RCFLAGS
- SWIFTC
# Environment Variables for CTest
- CMAKE_CONFIG_TYPE
- CTEST_INTERACTIVE_DEBUG_MODE
- CTEST_OUTPUT_ON_FAILURE
- CTEST_PARALLEL_LEVEL
- CTEST_PROGRESS_OUTPUT
- CTEST_USE_LAUNCHERS_DEFAULT
- DASHBOARD_TEST_FROM_CTEST
# Here are the `find_package` specific variables described at the
# https://cmake.org/cmake/help/latest/command/find_package.html
- <PackageName>_DIR
- CMAKE_PREFIX_PATH
- CMAKE_FRAMEWORK_PATH
- CMAKE_APPBUNDLE_PATH
- PATH
scripting-commands:
-
@@ -1670,11 +1793,21 @@ scripting-commands:
, ERROR_FILE
, OUTPUT_QUIET
, ERROR_QUIET
, COMMAND_ECHO # Since 3.15
, OUTPUT_STRIP_TRAILING_WHITESPACE
, ERROR_STRIP_TRAILING_WHITESPACE
, ENCODING
]
special-args: [NONE, AUTO, ANSI, OEM, UTF8]
special-args: [
NONE
, AUTO
, ANSI
, OEM
, UTF8
, STDERR # Since 3.15: the value for `COMMAND_ECHO`
, STDOUT # Since 3.15: the value for `COMMAND_ECHO`
]
nested-parentheses?: true
-
name: file
named-args: [
@@ -1746,6 +1879,7 @@ scripting-commands:
, DIRECTORY_PERMISSIONS
, NO_SOURCE_PERMISSIONS
, USE_SOURCE_PERMISSIONS
, FOLLOW_SYMLINK_CHAIN # Since 3.15
, FILES_MATCHING
, PATTERN
, REGEX
@@ -1760,6 +1894,9 @@ scripting-commands:
# Sub-options of UPLOAD/DOWNLOAD since 3.11
, NETRC
, NETRC_FILE
# New sub-options since 3.14
, READ_SYMLINK
, SIZE
]
special-args: [
UTF-8
@@ -1871,7 +2008,21 @@ scripting-commands:
property-args: &get_directory_property [directory-properties]
-
name: get_filename_component
named-args: [DIRECTORY, NAME, EXT, NAME_WE, PATH, CACHE, BASE_DIR, ABSOLUTE, REALPATH, PROGRAM, PROGRAM_ARGS]
named-args: [
DIRECTORY
, NAME
, EXT
, NAME_WE
, PATH
, CACHE
, BASE_DIR
, ABSOLUTE
, REALPATH
, PROGRAM
, PROGRAM_ARGS
, LAST_EXT # Since 3.14
, NAME_WLE # Since 3.14
]
-
name: get_property
named-args: [GLOBAL, DIRECTORY, TARGET, SOURCE, INSTALL, TEST, CACHE, VARIABLE, PROPERTY, SET, DEFINED, BRIEF_DOCS, FULL_DOCS]
@@ -1933,6 +2084,10 @@ scripting-commands:
, FOR
# NOTE Another `REGEX` named arg has already added
, OUTPUT_VARIABLE
# Since 3.15
# NOTE Another `PREPEND` named arg has already added
, POP_FRONT
, POP_BACK
]
# Since 3.13
special-args: [STRING, FILE_BASENAME, SENSITIVE, INSENSITIVE, ASCENDING, DESCENDING]
@@ -1951,7 +2106,19 @@ scripting-commands:
special-args: [DECIMAL, HEXADECIMAL]
-
name: message
named-args: [STATUS, WARNING, AUTHOR_WARNING, SEND_ERROR, FATAL_ERROR, DEPRECATION]
named-args: [
STATUS
, WARNING
, AUTHOR_WARNING
, SEND_ERROR
, FATAL_ERROR
, DEPRECATION
# Since 3.15
, NOTICE
, VERBOSE
, DEBUG
, TRACE
]
-
name: option
-
@@ -1993,6 +2160,7 @@ scripting-commands:
, SUBSTRING
, STRIP
, GENEX_STRIP
, REPEAT # Since 3.15
, COMPARE
, LESS
, GREATER
@@ -2055,6 +2223,7 @@ project-commands:
, WORKING_DIRECTORY
, COMMENT
, DEPFILE
, JOB_POOL # Since 3.15
, VERBATIM
, APPEND
, USES_TERMINAL
@@ -2064,6 +2233,7 @@ project-commands:
, PRE_LINK
, POST_BUILD
]
nested-parentheses?: true
-
name: add_custom_target
named-args: [
@@ -2075,12 +2245,14 @@ project-commands:
, WORKING_DIRECTORY
, COMMENT
, DEPFILE
, JOB_POOL # Since 3.15
, VERBATIM
, APPEND
, USES_TERMINAL
, COMMAND_EXPAND_LISTS
, SOURCES
]
nested-parentheses?: true
-
name: add_definitions
-
@@ -2099,6 +2271,7 @@ project-commands:
-
name: add_test
named-args: [NAME, COMMAND, CONFIGURATIONS, WORKING_DIRECTORY]
nested-parentheses?: true
-
name: aux_source_directory
-
@@ -2347,6 +2520,7 @@ project-commands:
, SOURCES
, COMPILE_DEFINITIONS
, LINK_LIBRARIES
, LINK_OPTIONS # Since 3.14
, COPY_FILE
, COPY_FILE_ERROR
, <LANG>_STANDARD
@@ -2361,6 +2535,7 @@ project-commands:
, CMAKE_FLAGS
, COMPILE_DEFINITIONS
, LINK_LIBRARIES
, LINK_OPTIONS # Since 3.14
, COMPILE_OUTPUT_VARIABLE
, RUN_OUTPUT_VARIABLE
, OUTPUT_VARIABLE
@@ -2414,7 +2589,19 @@ ctest-commands:
named-args: [TRACK, APPEND, QUIET]
-
name: ctest_submit
named-args: [PARTS, FILES, HTTPHEADER, RETRY_COUNT, RETRY_DELAY, RETURN_VALUE, QUIET, CDASH_UPLOAD, CDASH_UPLOAD_TYPE]
named-args: [
PARTS
, FILES
, BUILD_ID # Since 3.15
, SUBMIT_URL # Since 3.14
, HTTPHEADER
, RETRY_COUNT
, RETRY_DELAY
, RETURN_VALUE
, QUIET
, CDASH_UPLOAD
, CDASH_UPLOAD_TYPE
]
-
name: ctest_test
named-args: [

View File

@@ -3,7 +3,7 @@
#
# Generate Kate syntax file for CMake
#
# Copyright (c) 2017, Alex Turbov <i.zaufi@gmail.com>
# Copyright (c) 2017-2019 Alex Turbov <i.zaufi@gmail.com>
#
# To install prerequisites:
#
@@ -33,6 +33,7 @@ _PROPERTY_KEYS = [
, 'install-properties'
]
_KW_RE_LIST = ['kw', 're']
_VAR_KIND_LIST = ['variables', 'environment-variables']
def try_transform_placeholder_string_to_regex(name):
@@ -44,6 +45,9 @@ def try_transform_placeholder_string_to_regex(name):
if 'CMAKE_MATCH_' in m:
return '\\bCMAKE_MATCH_[0-9]+\\b'
if 'CMAKE_ARGV' in m:
return '\\bCMAKE_ARGV[0-9]+\\b'
return '\\b{}\\b'.format('&id_re;'.join(list(m))) if 1 < len(m) else name
@@ -109,11 +113,20 @@ def cmd_is_nulary(cmd):
def cli(input_yaml, template):
data = yaml.load(input_yaml)
# Partition `variables` list into "pure" words and regexes to match
data['variables'] = {
k: sorted(set(v)) for k, v in zip(_KW_RE_LIST, [*partition_iterable(lambda x: _TEMPLATED_NAME.search(x) is None, data['variables'])])
}
data['variables']['re'] = [*map(lambda x: try_transform_placeholder_string_to_regex(x), data['variables']['re'])]
# Partition `variables` and `environment-variables` lists into "pure" (key)words and regexes to match
for var_key in _VAR_KIND_LIST:
data[var_key] = {
k: sorted(set(v)) for k, v in zip(
_KW_RE_LIST
, [*partition_iterable(lambda x: _TEMPLATED_NAME.search(x) is None, data[var_key])]
)
}
data[var_key]['re'] = [
*map(
lambda x: try_transform_placeholder_string_to_regex(x)
, data[var_key]['re']
)
]
# Transform properties and make all-properties list
data['properties'] = {}
@@ -122,17 +135,27 @@ def cli(input_yaml, template):
props, props_re = partition_iterable(lambda x: _TEMPLATED_NAME.search(x) is None, data[prop])
del data[prop]
data['properties'][python_prop_list_name] = {k: sorted(set(v)) for k, v in zip(_KW_RE_LIST, [props, props_re])}
data['properties'][python_prop_list_name]['re'] = [*map(lambda x: try_transform_placeholder_string_to_regex(x), props_re)]
data['properties'][python_prop_list_name] = {
k: sorted(set(v)) for k, v in zip(_KW_RE_LIST, [props, props_re])
}
data['properties'][python_prop_list_name]['re'] = [
*map(lambda x: try_transform_placeholder_string_to_regex(x), props_re)
]
data['properties']['kinds'] = [*map(lambda name: name.replace('-', '_'), _PROPERTY_KEYS)]
# Make all commands list
data['commands'] = [*map(lambda cmd: transform_command(cmd), data['scripting-commands'] + data['project-commands'] + data['ctest-commands'])]
data['commands'] = [
*map(
lambda cmd: transform_command(cmd)
, data['scripting-commands'] + data['project-commands'] + data['ctest-commands'])
]
# Fix node names to be accessible from Jinja template
data['generator_expressions'] = data['generator-expressions']
data['environment_variables'] = data['environment-variables']
del data['generator-expressions']
del data['environment-variables']
env = jinja2.Environment(
keep_trailing_newline=True

View File

@@ -42,7 +42,14 @@ if ($root == 1)
}
else
{
$file =~ s/<language([^>]+)name="([^"]*)"/<language$1name="$2\/PHP" hidden="true"/s;
if ($file =~ /<language[^>]+hidden="[^"]*"/) {
$file =~ s/<language([^>]+)name="([^"]*)"/<language$1name="$2\/PHP"/s;
$file =~ s/<language([^>]+)hidden="[^"]*"/<language$1hidden="true"/s;
}
else
{
$file =~ s/<language([^>]+)name="([^"]*)"/<language$1name="$2\/PHP" hidden="true"/s;
}
$file =~ s/<language([^>]+)section="[^"]*"/<language$1section="Other"/s;
$file =~ s/<language([^>]+)extensions="[^"]*"/<language$1extensions=""/s;
$file =~ s/<language([^>]+)mimetype="[^"]*"/<language$1mimetype=""/s;
@@ -51,7 +58,8 @@ else
$findphp = "<context name=\"FindPHP\" attribute=\"Normal Text\" lineEndContext=\"#stay\">\n<RegExpr context=\"##PHP/PHP\" String=\"&lt;\\?(?:=|php)?\" lookAhead=\"true\" />\n</context>\n";
$file =~ s/<IncludeRules\s([^>]*)context="([^"#]*)##(?!Alerts|Doxygen|Modelines)([^"]+)"/<IncludeRules $1context="$2##$3\/PHP"/g;
$file =~ s/(<context\s[^>]*>)/$1\n<IncludeRules context="FindPHP" \/>/g;
$file =~ s/(<context\s[^>]*[^>\/]>)/$1\n<IncludeRules context="FindPHP" \/>/g;
$file =~ s/(<context\s[^>]*[^>\/])\s*\/>/$1>\n<IncludeRules context="FindPHP" \/>\n<\/context>/g;
$file =~ s/(?=<\/contexts\s*>)/$findphp/;
print $file;

View File

@@ -279,9 +279,10 @@
-->
<xs:element name="list">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="item"/>
</xs:sequence>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="item"/>
<xs:element ref="include"/>
</xs:choice>
<xs:attribute name="name" use="required"/>
</xs:complexType>
</xs:element>
@@ -290,6 +291,11 @@
contains string used in <keyword>
-->
<xs:element name="item" type="xs:string"/>
<!--
List include
contains a name of <keyword>
-->
<xs:element name="include" type="xs:string"/>
<!-- List of contexts -->
<xs:element name="contexts">
<xs:complexType>
@@ -305,6 +311,7 @@
lineEndContext: Next context if end of line is encountered
lineEmptyContext: Next context if an empty line is encountered [optional]
fallthrough: Use a fallthrough context [optional]
deprecated since 5.62 but preserved to maintain compatibility in older versions of KF5
fallthroughContext: Fall through to this context [optional]
dynamic: Dynamic context [boolean, optional]
noIndentationBasedFolding: Python uses indentation based folding. However, Python has parts where
@@ -314,7 +321,6 @@
TODO:
- Explain fallthrough.
- Do we need fallthrough at all? It could be true, if fallthroughContext is set, false otherwise.
- Make lineEndContext optional, defaults to '#stay'. Reasonable?
-->
<xs:element name="context">
@@ -344,7 +350,15 @@
<xs:attribute name="attribute" use="required"/>
<xs:attribute name="lineEndContext" use="required"/>
<xs:attribute name="lineEmptyContext"/>
<xs:attribute name="fallthrough" type="xs:boolean"/>
<xs:attribute name="fallthrough">
<xs:simpleType>
<!-- alway true since 5.62 -->
<xs:restriction base="xs:token">
<xs:enumeration value="1"/>
<xs:enumeration value="true"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="fallthroughContext"/>
<xs:attribute name="dynamic" type="xs:boolean"/>
<xs:attribute name="noIndentationBasedFolding" type="xs:boolean"/>

View File

@@ -9,7 +9,7 @@
Copyright 2004 Alexander Neundorf (neundorf@kde.org)
Copyright 2005 Dominik Haumann (dhdev@gmx.de)
Copyright 2007,2008,2013,2014 Matthew Woehlke (mw_triad@users.sourceforge.net)
Copyright 2013-2015,2017-2018 Alex Turbov (i.zaufi@gmail.com)
Copyright 2013-2015,2017-2019 Alex Turbov (i.zaufi@gmail.com)
**********************************************************************
* This library is free software; you can redistribute it and/or *
@@ -31,7 +31,7 @@
<language
name="CMake"
version="12"
version="16"
kateversion="2.4"
section="Other"
extensions="CMakeLists.txt;*.cmake;*.cmake.in"
@@ -248,6 +248,7 @@
</list>
<list name="execute_process_nargs">
<item>COMMAND</item>
<item>COMMAND_ECHO</item>
<item>ENCODING</item>
<item>ERROR_FILE</item>
<item>ERROR_QUIET</item>
@@ -268,6 +269,8 @@
<item>AUTO</item>
<item>NONE</item>
<item>OEM</item>
<item>STDERR</item>
<item>STDOUT</item>
<item>UTF8</item>
</list>
<list name="file_nargs">
@@ -287,6 +290,7 @@
<item>FILES_MATCHING</item>
<item>FILE_PERMISSIONS</item>
<item>FOLLOW_SYMLINKS</item>
<item>FOLLOW_SYMLINK_CHAIN</item>
<item>GENERATE</item>
<item>GLOB</item>
<item>GLOB_RECURSE</item>
@@ -567,6 +571,8 @@
<item>LENGTH</item>
<item>ORDER</item>
<item>OUTPUT_VARIABLE</item>
<item>POP_BACK</item>
<item>POP_FRONT</item>
<item>PREPEND</item>
<item>REGEX</item>
<item>REMOVE_AT</item>
@@ -602,10 +608,14 @@
</list>
<list name="message_nargs">
<item>AUTHOR_WARNING</item>
<item>DEBUG</item>
<item>DEPRECATION</item>
<item>FATAL_ERROR</item>
<item>NOTICE</item>
<item>SEND_ERROR</item>
<item>STATUS</item>
<item>TRACE</item>
<item>VERBOSE</item>
<item>WARNING</item>
</list>
<list name="separate_arguments_nargs">
@@ -671,6 +681,7 @@
<item>RANDOM</item>
<item>RANDOM_SEED</item>
<item>REGEX</item>
<item>REPEAT</item>
<item>REPLACE</item>
<item>REVERSE</item>
<item>SHA1</item>
@@ -737,6 +748,7 @@
<item>DEPENDS</item>
<item>DEPFILE</item>
<item>IMPLICIT_DEPENDS</item>
<item>JOB_POOL</item>
<item>MAIN_DEPENDENCY</item>
<item>OUTPUT</item>
<item>POST_BUILD</item>
@@ -757,6 +769,7 @@
<item>DEPENDS</item>
<item>DEPFILE</item>
<item>IMPLICIT_DEPENDS</item>
<item>JOB_POOL</item>
<item>SOURCES</item>
<item>USES_TERMINAL</item>
<item>VERBATIM</item>
@@ -1135,6 +1148,7 @@
<item>TRACK</item>
</list>
<list name="ctest_submit_nargs">
<item>BUILD_ID</item>
<item>CDASH_UPLOAD</item>
<item>CDASH_UPLOAD_TYPE</item>
<item>FILES</item>
@@ -1144,6 +1158,7 @@
<item>RETRY_COUNT</item>
<item>RETRY_DELAY</item>
<item>RETURN_VALUE</item>
<item>SUBMIT_URL</item>
</list>
<list name="ctest_test_nargs">
<item>APPEND</item>
@@ -1214,7 +1229,6 @@
<item>CMAKE_AR</item>
<item>CMAKE_ARCHIVE_OUTPUT_DIRECTORY</item>
<item>CMAKE_ARGC</item>
<item>CMAKE_ARGV0</item>
<item>CMAKE_AUTOGEN_ORIGIN_DEPENDS</item>
<item>CMAKE_AUTOGEN_PARALLEL</item>
<item>CMAKE_AUTOGEN_VERBOSE</item>
@@ -1288,10 +1302,12 @@
<item>CMAKE_ERROR_DEPRECATED</item>
<item>CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION</item>
<item>CMAKE_EXECUTABLE_SUFFIX</item>
<item>CMAKE_EXECUTE_PROCESS_COMMAND_ECHO</item>
<item>CMAKE_EXE_LINKER_FLAGS</item>
<item>CMAKE_EXE_LINKER_FLAGS_INIT</item>
<item>CMAKE_EXPORT_COMPILE_COMMANDS</item>
<item>CMAKE_EXPORT_NO_PACKAGE_REGISTRY</item>
<item>CMAKE_EXPORT_PACKAGE_REGISTRY</item>
<item>CMAKE_EXTRA_GENERATOR</item>
<item>CMAKE_EXTRA_INCLUDE_FILES</item>
<item>CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES</item>
@@ -1305,6 +1321,7 @@
<item>CMAKE_FIND_PACKAGE_NAME</item>
<item>CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY</item>
<item>CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY</item>
<item>CMAKE_FIND_PACKAGE_PREFER_CONFIG</item>
<item>CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS</item>
<item>CMAKE_FIND_PACKAGE_SORT_DIRECTION</item>
<item>CMAKE_FIND_PACKAGE_SORT_ORDER</item>
@@ -1315,6 +1332,7 @@
<item>CMAKE_FIND_ROOT_PATH_MODE_PACKAGE</item>
<item>CMAKE_FIND_ROOT_PATH_MODE_PROGRAM</item>
<item>CMAKE_FOLDER</item>
<item>CMAKE_FRAMEWORK</item>
<item>CMAKE_FRAMEWORK_PATH</item>
<item>CMAKE_Fortran_FORMAT</item>
<item>CMAKE_Fortran_MODDIR_DEFAULT</item>
@@ -1432,6 +1450,8 @@
<item>CMAKE_MODULE_LINKER_FLAGS</item>
<item>CMAKE_MODULE_LINKER_FLAGS_INIT</item>
<item>CMAKE_MODULE_PATH</item>
<item>CMAKE_MSVCIDE_RUN_PATH</item>
<item>CMAKE_MSVC_RUNTIME_LIBRARY</item>
<item>CMAKE_NETRC</item>
<item>CMAKE_NETRC_FILE</item>
<item>CMAKE_NINJA_OUTPUT_PATH_PREFIX</item>
@@ -1454,6 +1474,8 @@
<item>CMAKE_PROGRAM_PATH</item>
<item>CMAKE_PROJECT_DESCRIPTION</item>
<item>CMAKE_PROJECT_HOMEPAGE_URL</item>
<item>CMAKE_PROJECT_INCLUDE</item>
<item>CMAKE_PROJECT_INCLUDE_BEFORE</item>
<item>CMAKE_PROJECT_NAME</item>
<item>CMAKE_PROJECT_VERSION</item>
<item>CMAKE_PROJECT_VERSION_MAJOR</item>
@@ -1465,6 +1487,7 @@
<item>CMAKE_REQUIRED_FLAGS</item>
<item>CMAKE_REQUIRED_INCLUDES</item>
<item>CMAKE_REQUIRED_LIBRARIES</item>
<item>CMAKE_REQUIRED_LINK_OPTIONS</item>
<item>CMAKE_REQUIRED_QUIET</item>
<item>CMAKE_ROOT</item>
<item>CMAKE_RUNTIME_OUTPUT_DIRECTORY</item>
@@ -1509,6 +1532,7 @@
<item>CMAKE_SYSTEM_PROGRAM_PATH</item>
<item>CMAKE_SYSTEM_VERSION</item>
<item>CMAKE_Swift_LANGUAGE_VERSION</item>
<item>CMAKE_Swift_MODULE_DIRECTORY</item>
<item>CMAKE_THREAD_LIBS_INIT</item>
<item>CMAKE_THREAD_PREFER_PTHREAD</item>
<item>CMAKE_TOOLCHAIN_FILE</item>
@@ -1529,6 +1553,7 @@
<item>CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD</item>
<item>CMAKE_VS_INCLUDE_PACKAGE_TO_DEFAULT_BUILD</item>
<item>CMAKE_VS_INTEL_Fortran_PROJECT_VERSION</item>
<item>CMAKE_VS_JUST_MY_CODE_DEBUGGING</item>
<item>CMAKE_VS_MSBUILD_COMMAND</item>
<item>CMAKE_VS_NsightTegra_VERSION</item>
<item>CMAKE_VS_PLATFORM_NAME</item>
@@ -1658,6 +1683,7 @@
<item>CPACK_IFW_PACKAGE_REMOVE_TARGET_DIR</item>
<item>CPACK_IFW_PACKAGE_RESOURCES</item>
<item>CPACK_IFW_PACKAGE_START_MENU_DIRECTORY</item>
<item>CPACK_IFW_PACKAGE_STYLE_SHEET</item>
<item>CPACK_IFW_PACKAGE_TITLE</item>
<item>CPACK_IFW_PACKAGE_TITLE_COLOR</item>
<item>CPACK_IFW_PACKAGE_WATERMARK</item>
@@ -1908,6 +1934,7 @@
<item>CTEST_UPDATE_COMMAND</item>
<item>CTEST_UPDATE_OPTIONS</item>
<item>CTEST_UPDATE_VERSION_ONLY</item>
<item>CTEST_UPDATE_VERSION_OVERRIDE</item>
<item>CTEST_USE_LAUNCHERS</item>
<item>CYGWIN</item>
<item>EXECUTABLE_OUTPUT_PATH</item>
@@ -1990,6 +2017,45 @@
<item>XCODE</item>
<item>XCODE_VERSION</item>
</list>
<list name="environment-variables">
<item>CC</item>
<item>CFLAGS</item>
<item>CMAKE_APPBUNDLE_PATH</item>
<item>CMAKE_BUILD_PARALLEL_LEVEL</item>
<item>CMAKE_CONFIG_TYPE</item>
<item>CMAKE_FRAMEWORK_PATH</item>
<item>CMAKE_GENERATOR</item>
<item>CMAKE_GENERATOR_INSTANCE</item>
<item>CMAKE_GENERATOR_PLATFORM</item>
<item>CMAKE_GENERATOR_TOOLSET</item>
<item>CMAKE_MSVCIDE_RUN_PATH</item>
<item>CMAKE_NO_VERBOSE</item>
<item>CMAKE_OSX_ARCHITECTURES</item>
<item>CMAKE_PREFIX_PATH</item>
<item>CSFLAGS</item>
<item>CTEST_INTERACTIVE_DEBUG_MODE</item>
<item>CTEST_OUTPUT_ON_FAILURE</item>
<item>CTEST_PARALLEL_LEVEL</item>
<item>CTEST_PROGRESS_OUTPUT</item>
<item>CTEST_USE_LAUNCHERS_DEFAULT</item>
<item>CUDACXX</item>
<item>CUDAFLAGS</item>
<item>CUDAHOSTCXX</item>
<item>CXX</item>
<item>CXXFLAGS</item>
<item>DASHBOARD_TEST_FROM_CTEST</item>
<item>DESTDIR</item>
<item>FC</item>
<item>FFLAGS</item>
<item>LDFLAGS</item>
<item>MACOSX_DEPLOYMENT_TARGET</item>
<item>PATH</item>
<item>RC</item>
<item>RCFLAGS</item>
<item>SWIFTC</item>
<item>VERBOSE</item>
</list>
<list name="global-properties">
<item>ALLOW_DUPLICATE_CUSTOM_TARGETS</item>
<item>AUTOGEN_SOURCE_GROUP</item>
@@ -2032,6 +2098,7 @@
<item>XCODE_EMIT_EFFECTIVE_PLATFORM_NAME</item>
</list>
<list name="directory-properties">
<item>ADDITIONAL_CLEAN_FILES</item>
<item>ADDITIONAL_MAKE_CLEAN_FILES</item>
<item>BINARY_DIR</item>
<item>BUILDSYSTEM_TARGETS</item>
@@ -2064,6 +2131,7 @@
<item>VS_STARTUP_PROJECT</item>
</list>
<list name="target-properties">
<item>ADDITIONAL_CLEAN_FILES</item>
<item>ALIASED_TARGET</item>
<item>ANDROID_ANT_ADDITIONAL_OPTIONS</item>
<item>ANDROID_API</item>
@@ -2207,6 +2275,7 @@
<item>MACOSX_FRAMEWORK_INFO_PLIST</item>
<item>MACOSX_RPATH</item>
<item>MANUALLY_ADDED_DEPENDENCIES</item>
<item>MSVC_RUNTIME_LIBRARY</item>
<item>NAME</item>
<item>NO_SONAME</item>
<item>NO_SYSTEM_FROM_IMPORTED</item>
@@ -2232,6 +2301,9 @@
<item>STATIC_LIBRARY_FLAGS</item>
<item>STATIC_LIBRARY_OPTIONS</item>
<item>SUFFIX</item>
<item>Swift_DEPENDENCIES_FILE</item>
<item>Swift_MODULE_DIRECTORY</item>
<item>Swift_MODULE_NAME</item>
<item>TYPE</item>
<item>VERSION</item>
<item>VISIBILITY_INLINES_HIDDEN</item>
@@ -2249,8 +2321,12 @@
<item>VS_GLOBAL_ROOTNAMESPACE</item>
<item>VS_IOT_EXTENSIONS_VERSION</item>
<item>VS_IOT_STARTUP_TASK</item>
<item>VS_JUST_MY_CODE_DEBUGGING</item>
<item>VS_KEYWORD</item>
<item>VS_MOBILE_EXTENSIONS_VERSION</item>
<item>VS_NO_SOLUTION_DEPLOY</item>
<item>VS_PACKAGE_REFERENCES</item>
<item>VS_PROJECT_IMPORT</item>
<item>VS_SCC_AUXPATH</item>
<item>VS_SCC_LOCALPATH</item>
<item>VS_SCC_PROJECTNAME</item>
@@ -2264,10 +2340,12 @@
<item>WIN32_EXECUTABLE</item>
<item>WINDOWS_EXPORT_ALL_SYMBOLS</item>
<item>XCODE_EXPLICIT_FILE_TYPE</item>
<item>XCODE_GENERATE_SCHEME</item>
<item>XCODE_PRODUCT_TYPE</item>
<item>XCODE_SCHEME_ADDRESS_SANITIZER</item>
<item>XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN</item>
<item>XCODE_SCHEME_ARGUMENTS</item>
<item>XCODE_SCHEME_DEBUG_AS_ROOT</item>
<item>XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER</item>
<item>XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS</item>
<item>XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE</item>
@@ -2309,6 +2387,8 @@
<item>SKIP_AUTORCC</item>
<item>SKIP_AUTOUIC</item>
<item>SYMBOLIC</item>
<item>Swift_DEPENDENCIES_FILE</item>
<item>Swift_DIAGNOSTICS_FILE</item>
<item>VS_COPY_TO_OUT_DIR</item>
<item>VS_DEPLOYMENT_CONTENT</item>
<item>VS_DEPLOYMENT_LOCATION</item>
@@ -2375,61 +2455,76 @@
<list name="generator-expressions">
<item>0</item>
<item>1</item>
<item>AND</item>
<item>ANGLE-R</item>
<item>BOOL</item>
<item>BUILD_INTERFACE</item>
<item>COMMA</item>
<item>COMPILE_FEATURES</item>
<item>COMPILE_LANGUAGE</item>
<item>CONFIG</item>
<item>CXX_COMPILER_ID</item>
<item>CXX_COMPILER_VERSION</item>
<item>C_COMPILER_ID</item>
<item>C_COMPILER_VERSION</item>
<item>EQUAL</item>
<item>GENEX_EVAL</item>
<item>IF</item>
<item>INSTALL_INTERFACE</item>
<item>INSTALL_PREFIX</item>
<item>IN_LIST</item>
<item>JOIN</item>
<item>LINK_ONLY</item>
<item>LOWER_CASE</item>
<item>MAKE_C_IDENTIFIER</item>
<item>NOT</item>
<item>AND</item>
<item>OR</item>
<item>PLATFORM_ID</item>
<item>SEMICOLON</item>
<item>SHELL_PATH</item>
<item>NOT</item>
<item>STREQUAL</item>
<item>TARGET_BUNDLE_CONTENT_DIR</item>
<item>TARGET_BUNDLE_DIR</item>
<item>TARGET_EXISTS</item>
<item>TARGET_FILE</item>
<item>TARGET_FILE_DIR</item>
<item>TARGET_FILE_NAME</item>
<item>TARGET_GENEX_EVAL</item>
<item>TARGET_LINKER_FILE</item>
<item>TARGET_LINKER_FILE_DIR</item>
<item>TARGET_LINKER_FILE_NAME</item>
<item>TARGET_NAME</item>
<item>TARGET_NAME_IF_EXISTS</item>
<item>TARGET_OBJECTS</item>
<item>TARGET_PDB_FILE</item>
<item>TARGET_PDB_FILE_DIR</item>
<item>TARGET_PDB_FILE_NAME</item>
<item>TARGET_POLICY</item>
<item>TARGET_PROPERTY</item>
<item>TARGET_SONAME_FILE</item>
<item>TARGET_SONAME_FILE_DIR</item>
<item>TARGET_SONAME_FILE_NAME</item>
<item>UPPER_CASE</item>
<item>VERSION_EQUAL</item>
<item>VERSION_GREATER</item>
<item>VERSION_GREATER_EQUAL</item>
<item>EQUAL</item>
<item>IN_LIST</item>
<item>VERSION_LESS</item>
<item>VERSION_GREATER</item>
<item>VERSION_EQUAL</item>
<item>VERSION_LESS_EQUAL</item>
<item>VERSION_GREATER_EQUAL</item>
<item>TARGET_EXISTS</item>
<item>CONFIG</item>
<item>PLATFORM_ID</item>
<item>C_COMPILER_ID</item>
<item>CXX_COMPILER_ID</item>
<item>CUDA_COMPILER_ID</item>
<item>Fortran_COMPILER_ID</item>
<item>C_COMPILER_VERSION</item>
<item>CXX_COMPILER_VERSION</item>
<item>CUDA_COMPILER_VERSION</item>
<item>Fortran_COMPILER_VERSION</item>
<item>TARGET_POLICY</item>
<item>COMPILE_FEATURES</item>
<item>COMPILE_LANG_AND_ID</item>
<item>COMPILE_LANGUAGE</item>
<item>ANGLE-R</item>
<item>COMMA</item>
<item>SEMICOLON</item>
<item>IF</item>
<item>JOIN</item>
<item>REMOVE_DUPLICATES</item>
<item>FILTER</item>
<item>LOWER_CASE</item>
<item>UPPER_CASE</item>
<item>GENEX_EVAL</item>
<item>TARGET_GENEX_EVAL</item>
<item>TARGET_NAME_IF_EXISTS</item>
<item>TARGET_FILE</item>
<item>TARGET_FILE_BASE_NAME</item>
<item>TARGET_FILE_PREFIX</item>
<item>TARGET_FILE_SUFFIX</item>
<item>TARGET_FILE_NAME</item>
<item>TARGET_FILE_DIR</item>
<item>TARGET_LINKER_FILE</item>
<item>TARGET_LINKER_FILE_BASE_NAME</item>
<item>TARGET_LINKER_FILE_PREFIX</item>
<item>TARGET_LINKER_FILE_SUFFIX</item>
<item>TARGET_LINKER_FILE_NAME</item>
<item>TARGET_LINKER_FILE_DIR</item>
<item>TARGET_SONAME_FILE</item>
<item>TARGET_SONAME_FILE</item>
<item>TARGET_SONAME_FILE_NAME</item>
<item>TARGET_SONAME_FILE_DIR</item>
<item>TARGET_PDB_FILE</item>
<item>TARGET_PDB_FILE_BASE_NAME</item>
<item>TARGET_PDB_FILE_NAME</item>
<item>TARGET_PDB_FILE_DIR</item>
<item>TARGET_BUNDLE_DIR</item>
<item>TARGET_BUNDLE_CONTENT_DIR</item>
<item>TARGET_PROPERTY</item>
<item>INSTALL_PREFIX</item>
<item>TARGET_NAME</item>
<item>LINK_ONLY</item>
<item>INSTALL_INTERFACE</item>
<item>BUILD_INTERFACE</item>
<item>MAKE_C_IDENTIFIER</item>
<item>TARGET_OBJECTS</item>
<item>SHELL_PATH</item>
</list>
<contexts>
@@ -2662,11 +2757,18 @@
<DetectChar attribute="Normal Text" context="execute_process_ctx_op" char="(" />
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="execute_process_ctx_op">
<DetectChar attribute="Normal Text" context="execute_process_ctx_op_nested" char="(" />
<IncludeRules context="EndCmdPop2" />
<keyword attribute="Named Args" context="#stay" String="execute_process_nargs" />
<keyword attribute="Special Args" context="#stay" String="execute_process_sargs" />
<IncludeRules context="User Function Args" />
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="execute_process_ctx_op_nested">
<IncludeRules context="EndCmdPop" />
<keyword attribute="Named Args" context="#stay" String="execute_process_nargs" />
<keyword attribute="Special Args" context="#stay" String="execute_process_sargs" />
<IncludeRules context="User Function Args" />
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="file_ctx">
<DetectChar attribute="Normal Text" context="file_ctx_op" char="(" />
</context>
@@ -2978,18 +3080,30 @@
<DetectChar attribute="Normal Text" context="add_custom_command_ctx_op" char="(" />
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="add_custom_command_ctx_op">
<DetectChar attribute="Normal Text" context="add_custom_command_ctx_op_nested" char="(" />
<IncludeRules context="EndCmdPop2" />
<keyword attribute="Named Args" context="#stay" String="add_custom_command_nargs" />
<IncludeRules context="User Function Args" />
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="add_custom_command_ctx_op_nested">
<IncludeRules context="EndCmdPop" />
<keyword attribute="Named Args" context="#stay" String="add_custom_command_nargs" />
<IncludeRules context="User Function Args" />
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="add_custom_target_ctx">
<DetectChar attribute="Normal Text" context="add_custom_target_ctx_op" char="(" />
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="add_custom_target_ctx_op">
<DetectChar attribute="Normal Text" context="add_custom_target_ctx_op_nested" char="(" />
<IncludeRules context="EndCmdPop2" />
<keyword attribute="Named Args" context="#stay" String="add_custom_target_nargs" />
<IncludeRules context="User Function Args" />
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="add_custom_target_ctx_op_nested">
<IncludeRules context="EndCmdPop" />
<keyword attribute="Named Args" context="#stay" String="add_custom_target_nargs" />
<IncludeRules context="User Function Args" />
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="add_definitions_ctx">
<DetectChar attribute="Normal Text" context="add_definitions_ctx_op" char="(" />
</context>
@@ -3039,10 +3153,16 @@
<DetectChar attribute="Normal Text" context="add_test_ctx_op" char="(" />
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="add_test_ctx_op">
<DetectChar attribute="Normal Text" context="add_test_ctx_op_nested" char="(" />
<IncludeRules context="EndCmdPop2" />
<keyword attribute="Named Args" context="#stay" String="add_test_nargs" />
<IncludeRules context="User Function Args" />
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="add_test_ctx_op_nested">
<IncludeRules context="EndCmdPop" />
<keyword attribute="Named Args" context="#stay" String="add_test_nargs" />
<IncludeRules context="User Function Args" />
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="aux_source_directory_ctx">
<DetectChar attribute="Normal Text" context="aux_source_directory_ctx_op" char="(" />
</context>
@@ -3619,6 +3739,7 @@
<RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_STANDARD_LIBRARIES\b" />
<RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_VISIBILITY_PRESET\b" />
<RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_ARCHIVE_OUTPUT_DIRECTORY_&id_re;\b" />
<RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_ARGV[0-9]+\b" />
<RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_&id_re;\b" />
<RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_DISABLE_FIND_PACKAGE_&id_re;\b" />
<RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_EXE_LINKER_FLAGS_&id_re;\b" />
@@ -3727,11 +3848,28 @@
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="Detect Variable Substitutions">
<RegExpr attribute="Environment Variable Substitution" context="#stay" String="\$ENV\{\s*[\w-]+\s*\}" />
<RegExpr attribute="Cache Variable Substitution" context="#stay" String="\$CACHE\{\s*[\w-]+\s*\}" />
<RegExpr attribute="Environment Variable Substitution" context="EnvVarSubst" String="\$ENV\{\s*[\w-]+\s*\}" lookAhead="true" />
<Detect2Chars attribute="Variable Substitution" context="VarSubst" char="$" char1="{" />
<RegExpr attribute="@Variable Substitution" context="@VarSubst" String="@&id_re;@" lookAhead="true" />
</context>
<context attribute="Environment Variable Substitution" lineEndContext="#pop" name="EnvVarSubst">
<DetectIdentifier />
<DetectChar attribute="Environment Variable Substitution" context="EnvVarSubstVar" char="{" />
<DetectChar attribute="Environment Variable Substitution" context="#pop" char="}" />
</context>
<context attribute="Environment Variable Substitution" lineEndContext="#pop" name="EnvVarSubstVar">
<keyword attribute="Standard Environment Variable" context="#stay" String="environment-variables" insensitive="false" />
<RegExpr attribute="Standard Environment Variable" context="#stay" String="\b&id_re;_DIR\b" />
<RegExpr attribute="Standard Environment Variable" context="#stay" String="\b&id_re;_ROOT\b" />
<RegExpr attribute="Standard Environment Variable" context="#stay" String="\bASM&id_re;\b" />
<RegExpr attribute="Standard Environment Variable" context="#stay" String="\bASM&id_re;FLAGS\b" />
<DetectIdentifier />
<DetectChar attribute="Environment Variable Substitution" context="#pop#pop" char="}" />
</context>
<context attribute="Variable Substitution" lineEndContext="#pop" name="VarSubst">
<IncludeRules context="Detect Builtin Variables" />
<DetectIdentifier />
@@ -3830,10 +3968,12 @@
<itemData name="Strings" defStyleNum="dsString" spellChecking="true" />
<itemData name="Escapes" defStyleNum="dsChar" spellChecking="false" />
<itemData name="Builtin Variable" defStyleNum="dsDecVal" color="#c09050" selColor="#c09050" spellChecking="false" />
<itemData name="Internal Name" defStyleNum="dsDecVal" color="#303030" selColor="#303030" spellChecking="false" />
<itemData name="Variable Substitution" defStyleNum="dsDecVal" spellChecking="false" />
<itemData name="@Variable Substitution" defStyleNum="dsBaseN" spellChecking="false" />
<itemData name="Internal Name" defStyleNum="dsDecVal" color="#303030" selColor="#303030" spellChecking="false" />
<itemData name="Cache Variable Substitution" defStyleNum="dsFloat" spellChecking="false" />
<itemData name="Environment Variable Substitution" defStyleNum="dsFloat" spellChecking="false" />
<itemData name="Standard Environment Variable" defStyleNum="dsFloat" spellChecking="false" />
<itemData name="Generator Expression Keyword" defStyleNum="dsKeyword" color="#b84040" selColor="#b84040" spellChecking="false" />
<itemData name="Generator Expression" defStyleNum="dsOthers" color="#b86050" selColor="#b86050" spellChecking="false" />
<itemData name="Comment" defStyleNum="dsComment" spellChecking="true" />

View File

@@ -38,7 +38,8 @@ Changelog:
-->
<language name="CSS" version="8" kateversion="5.0" section="Markup" extensions="*.css" indenter="cstyle" mimetype="text/css" author="Wilbert Berendsen (wilbert@kde.nl)" license="LGPL" priority="10">
<language name="CSS" version="9" kateversion="5.0" section="Markup" extensions="*.css" indenter="cstyle" mimetype="text/css" author="Wilbert Berendsen (wilbert@kde.nl)" license="LGPL" priority="10">
<!-- https://www.w3.org/Style/CSS/current-work -->
<highlighting>
<list name="properties">
@@ -1258,8 +1259,9 @@ Changelog:
<item>selection</item>
</list>
<list name="pseudoclass-not">
<list name="pseudoclass-selector">
<item>not</item>
<item>matches</item>
</list>
<list name="pseudoclasses-@page">
@@ -1383,8 +1385,8 @@ Changelog:
<keyword attribute="Value Keyword" context="#stay" String="value keywords" />
<keyword attribute="Value" context="#stay" String="values" />
<keyword attribute="Color" context="#stay" String="colors" />
<RegExpr attribute="Color" context="#stay" String="#([0-9A-Fa-f]{3}){1,2}\b" />
<RegExpr attribute="Number" context="FindUnits" String="[-+]?[0-9.]+(?![-+])" />
<RegExpr attribute="Color" context="#stay" String="#([0-9A-Fa-f]{3,4}){1,2}\b" />
<RegExpr attribute="Number" context="FindUnits" String="[-+]?([0-9]+(\.[0-9]+)?|\.[0-9]+)([eE][+-]?[0-9]+)?(?![-+])" />
<RegExpr attribute="Normal Text" context="#stay" String="[-]?(&nmstart;)(&nmchar;)*" />
</context>
@@ -1393,7 +1395,8 @@ Changelog:
</context>
<context name="FindUnits" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
<RegExpr attribute="Unit" context="#stay" String="(%|(em|ex|ch|rem|vw|vh|vm|px|in|cm|mm|pt|pc|deg|rad|grad|turn|ms|s|Hz|kHz)\b)(?![-+])" />
<!-- https://drafts.csswg.org/css-values-4/#lengths -->
<RegExpr attribute="Unit" context="#stay" String="(%|(em|ex|cap|ch|ic|rem|lh|rlh|vw|vh|vi|vb|vmin|vmax|cm|mm|Q|in|pc|pt|px|deg|rad|grad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx|x)\b)(?![-+])" />
</context>
<!-- find strings // "some words" 'some words' -->
@@ -1548,7 +1551,7 @@ Changelog:
<context name="SelectorPseudo" attribute="Selector Pseudo" lineEndContext="#pop">
<DetectChar attribute="Selector Pseudo" context="SelectorPseudoElements" char=":" />
<keyword attribute="Selector Pseudo" context="SelectorPseudoValueSelector" String="pseudoclass-not" />
<keyword attribute="Selector Pseudo" context="SelectorPseudoValueSelector" String="pseudoclass-selector" />
<keyword attribute="Selector Pseudo" context="SelectorPseudoValue" String="pseudoclasses" />
<RegExpr attribute="Selector Pseudo" context="SelectorPseudoValue" String="[-a-zA-Z][-a-zA-Z0-9]*" />
</context>

View File

@@ -5,7 +5,7 @@
<!ENTITY attributeName "[A-Za-z_:*#\(\[][\)\]\w.:_-]*">
<!ENTITY entref "&amp;(#[0-9]+|#[xX][0-9A-Fa-f]+|&name;);">
]>
<language name="HTML" version="7" kateversion="3.4" section="Markup" extensions="*.htm;*.html;*.shtml;*.shtm" mimetype="text/html" author="Wilbert Berendsen (wilbert@kde.nl)" license="LGPL" priority="10">
<language name="HTML" version="9" kateversion="5.53" section="Markup" extensions="*.htm;*.html;*.shtml;*.shtm" mimetype="text/html" author="Wilbert Berendsen (wilbert@kde.nl)" license="LGPL" priority="10">
<highlighting>
<contexts>
@@ -20,8 +20,19 @@
<StringDetect attribute="CDATA" context="CDATA" String="&lt;![CDATA[" beginRegion="cdata" />
<RegExpr attribute="Doctype" context="Doctype" String="&lt;!DOCTYPE\s+" insensitive="true" beginRegion="doctype" />
<RegExpr attribute="Processing Instruction" context="PI" String="&lt;\?[\w:-]*" beginRegion="pi" />
<IncludeRules context="FindSpecialHTMLTags" />
<IncludeRules context="FindHTMLTags" />
<!-- as long as kde gives DTDs the text/html mimetype--><IncludeRules context="FindDTDRules" />
<IncludeRules context="FindEntityRefs" />
</context>
<!-- This allows you to insert HTML tags in other syntax definitions -->
<context name="FindSpecialHTMLTags" attribute="Normal Text" lineEndContext="#stay">
<RegExpr attribute="Element" context="CSS" String="&lt;style\b" insensitive="true" beginRegion="style" />
<RegExpr attribute="Element" context="JS" String="&lt;script\b" insensitive="true" beginRegion="script" />
</context>
<context name="FindHTMLTags" attribute="Normal Text" lineEndContext="#stay">
<RegExpr attribute="Element" context="El Open" String="&lt;pre\b" insensitive="true" beginRegion="pre" />
<RegExpr attribute="Element" context="El Open" String="&lt;div\b" insensitive="true" beginRegion="div" />
<RegExpr attribute="Element" context="El Open" String="&lt;table\b" insensitive="true" beginRegion="table" />
@@ -54,8 +65,6 @@
<RegExpr attribute="Element" context="El Close" String="&lt;/nav\b" insensitive="true" endRegion="nav" />
<RegExpr attribute="Element" context="El Close" String="&lt;/section\b" insensitive="true" endRegion="section" />
<RegExpr attribute="Element" context="El Close" String="&lt;/&name;" />
<!-- as long as kde gives DTDs the text/html mimetype--><IncludeRules context="FindDTDRules" />
<IncludeRules context="FindEntityRefs" />
</context>
<context name="FindEntityRefs" attribute="Other Text" lineEndContext="#stay">

View File

@@ -12,7 +12,7 @@
** http://tools.ietf.org/html/rfc4627
***************************************************************************
-->
<language name="JSON" section="Markup" version="3" kateversion="2.4" extensions="*.json;.kateproject;.arcconfig;*.gltf" mimetype="application/json" author="Sebastian Pipping (sebastian@pipping.org)" license="GPL">
<language name="JSON" section="Markup" version="4" kateversion="2.4" extensions="*.json;.kateproject;.arcconfig;*.geojson;*.gltf" mimetype="application/json" author="Sebastian Pipping (sebastian@pipping.org)" license="GPL">
<highlighting>
<list name="Constants">
<item>null</item>

View File

@@ -6,6 +6,7 @@
Dual-Licensed under both GPL and BSD licenses.
Extended 2009 Claes Holmerson. http://github.com/claes/kate-markdown/
Extended 2019 Nibaldo González S. <nibgonz@gmail.com> (changes under MIT license).
-->
<!--
The [^\s]{1} is in the regex to avoid interfering with bullet list which
@@ -15,189 +16,623 @@
Match space or newline, followed by "*", followed by one non-space,
followed by anything non-asterisk, followed by "*", followed by
space, end-of-sentence punctuation, or the end of the line.
TODO: We can be more specific and highlight text combinations in bold,
italic and strikethrough.
Example: **bold text and _italic and bold text_**
__bold and ~~strikeout and bold~~__
-->
<!DOCTYPE language SYSTEM "language.dtd"
[
<!ENTITY strongemphasisregex "(\s|^)[\*_]{3}[^\*_]+[\*_]{3}(\s|\.|,|;|:|\-|\?|$)">
<!ENTITY strongregex "(\s|^)[\*_]{2}[^\s]{1}[^\*_]+[\*_]{2}(\s|\.|,|;|:|\-|\?|$)">
<!ENTITY emphasisregex "(\s|^)[\*_]{1}[^\s]{1}[^\*_]+[\*_]{1}(\s|\.|,|;|:|\-|\?|$)">
<!ENTITY reflinkregex '\[[^\]\^]+\]\s*\[[^\]]*\]\s*(\s+\"[^\"]*\"){0,1}'>
<!ENTITY reflinktargetregex '\[[^\]\^]+\]\:\s+[^\s]+(\s+\"[^\"]*\"){0,1}'>
<!ENTITY footnoteregex "\[\^[^\]]+\]">
<!ENTITY inlinelinkregex "\[[^\]\^]+\]\s*\([^\(]*\)">
<!ENTITY inlineimageregex "\!\[[^\]\^]+\]\([^\(]*\)">
<!ENTITY refimageregex "\!\[[^\]\^]+\]\[[^\[]*\]">
<!ENTITY autolinkregex '&lt;(https?|ftp):[^\"&gt;\s]+&gt;'>
<!ENTITY mailtolinkregex "&lt;(?:mailto:)?([-.\w]+\@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)&gt;">
<!ENTITY rulerregex "\s*([\*\-_]\s?){3,}\s*">
<!-- NOTE: To correctly detect bold, italic or strike out text, use minimal="true" in RegExpr rules -->
<!ENTITY contentregex_ast "(?:(?:[^\*\s\\]|\\.)(?:[^\\]|\\.)*)?(?:[^\*\s\\]|\\\S)">
<!ENTITY contentregex_und "(?:(?:[^_\s\\]|\\.)(?:[^\\]|\\.)*)?(?:[^_\s\\]|\\\S)">
<!-- strong + emphasis text -->
<!ENTITY strongemphasisregex_ast "\*{3,5}&contentregex_ast;\*{3}">
<!ENTITY strongemphasisregex_und "\b_{3,5}&contentregex_und;_{3}">
<!ENTITY strongemphasisregex_ast_und "\*{2,5}(?:(?:_|_{3}|_{5})&contentregex_und;_+|(?:_{2}|_{4})&contentregex_und;_)\*{2}">
<!ENTITY strongemphasisregex_ast_und2 "\*_{2,5}&contentregex_und;_{2,5}\*(?!\*)">
<!ENTITY strongemphasisregex_und_ast "\b_{2,5}(?:(?:\*|\*{3}|\*{5})&contentregex_ast;\*+|(?:\*{2}|\*{4})&contentregex_ast;\*)_{2}">
<!ENTITY strongemphasisregex_und_ast2 "\b_(?:\*{2,5}&contentregex_ast;\*{2,5}_{0,4}|_{0,4}\*{2,5}&contentregex_ast;\*{2,5})_\b">
<!-- strong text -->
<!ENTITY strongregex_ast "\*{2}(?:&contentregex_ast;\*{2}|\*{1,3}&contentregex_ast;\*{2}(?!\*))">
<!ENTITY strongregex_und "\b_{2}(?:&contentregex_und;_{2}|_{1,3}&contentregex_und;_{2}(?!_))">
<!-- emphasis text -->
<!ENTITY emphasisregex_ast "\*(?:&contentregex_ast;\*|\*{1,4}&contentregex_ast;\*(?!\*))">
<!ENTITY emphasisregex_und "\b_(?:&contentregex_und;_+|_{1,4}&contentregex_und;_)\b">
<!-- links -->
<!ENTITY startlink "(?:https?|ftp)\://">
<!ENTITY link "&startlink;[^&quot;&gt;\s]+">
<!-- link in normal text -->
<!ENTITY implicitlink "\b&startlink;[^&quot;&gt;\s`\)]*[^\s!&quot;&apos;`\(\)\*,\.:;&lt;&gt;\?~\]\}\\](?=[[:punct:]]*(?:[\s\)]|$))">
<!-- references: [name], [name][id], [name][id] "title", [name](https://example.com) -->
<!ENTITY refchar "(?:\\.|[^\]\\])">
<!ENTITY refname "(?:\\.|[^\s\[\]\\])&refchar;*">
<!ENTITY reflinkid "\s*(?:&refname;)?">
<!ENTITY reflinkidregex "(?:\s?\[&reflinkid;\]|\((?:\\.|[^\(\)\\])*\))">
<!ENTITY reflinkregex "\[(?:(?=\s*&refname;\])|\s+(?=\]))">
<!-- target ref.: [id]: https://example.com "Title" -->
<!ENTITY reflinktargetregex '\[\s*(?:&refname;|\s)\]\:\s+(?=\S)'>
<!-- footnote: [^name] -->
<!ENTITY footnoteregex "\[\^&refchar;+\]">
<!-- image: ![title](https://example.com), ![title][id] -->
<!ENTITY startinlineimage "\!\[(?:\\.|[^\[\]\\])*\]\(">
<!ENTITY endinlineimage "(?:\\.|[^\(\)\\])*\)">
<!ENTITY inlineimageregex "&startinlineimage;(?=&endinlineimage;)">
<!ENTITY refimageregex "\!\[(?:\\.|[^\[\]\\])*\]\[&reflinkid;\]">
<!-- autolink & email: <https://example.com>, <example@kde.org>, <mailto:example@kde.org> -->
<!ENTITY autolinkregex '&lt;&link;&gt;'>
<!ENTITY email "[\-\.\w]+\@[\-a-z0-9]+(?:\.[\-a-z0-9]+)*\.[a-z]+">
<!ENTITY mailtolinkregex "&lt;(?:mailto:)?(?=&email;&gt;)">
<!-- horizontal rule: avoid conflicts with strong-emphasis text, lists and code blocks -->
<!ENTITY rulerregex "\s*(?:(?:\*\s*){3,}|(?:_\s*){3,}|(?:\-\s*){3,})\s*$">
<!-- two spaces at end of line generates linebreak -->
<!ENTITY linebreakregex " $">
<!ENTITY strikeoutregex "[~]{2}[^~].*[^~][~]{2}">
<!-- pandoc style -->
<!-- strikethrough text, pandoc style -->
<!ENTITY strikeoutregex "[~]{2}[^~](?:.*[^~])?[~]{2}">
<!-- start of fenced code block -->
<!ENTITY fcode "(`{3,}|~{3,})">
<!-- end of line & empty line -->
<!ENTITY end "\s*$">
<!ENTITY emptyline "^\s*$">
<!-- indented code block -->
<!ENTITY indentedcodeblock "(?:\s{4}|\t).*$">
<!-- bullet of list -->
<!ENTITY listbullet "[\*\+\-]">
<!-- metadata key & name of html tag -->
<!ENTITY metadatakey "[a-zA-Z0-9][\w\-\s]*\:">
<!ENTITY htmlname "[A-Za-z_\:][\w\.\:\-]*">
<!-- comment -->
<!ENTITY startcomment "&lt;!--">
<!ENTITY endcomment "--&gt;">
<!ENTITY checkbox "\[[ x]\](?=\s)">
]>
<language name="Markdown" version="6" kateversion="5.0" section="Markup" extensions="*.md;*.mmd;*.markdown" priority="15" author="Darrin Yeager, Claes Holmerson" license="GPL,BSD">
<language name="Markdown" version="10" kateversion="5.53" section="Markup" extensions="*.md;*.mmd;*.markdown" priority="15" author="Darrin Yeager, Claes Holmerson" license="GPL,BSD">
<highlighting>
<contexts>
<context attribute="Normal Text" lineEndContext="#stay" name="Normal Text">
<DetectChar context="blockquote" char="&gt;" column="0"/>
<RegExpr attribute="h1" String="^#\s.*[#]?$"/>
<RegExpr attribute="h2" String="^##\s.*[#]?$"/>
<RegExpr attribute="h3" String="^###\s.*[#]?$"/>
<RegExpr attribute="h4" String="^####\s.*[#]?$"/>
<RegExpr attribute="h5" String="^#####\s.*[#]?$"/>
<RegExpr attribute="h6" String="^######\s.*[#]?$"/>
<RegExpr attribute="ruler" String="&rulerregex;"/>
<RegExpr attribute="strong" String="&strongregex;"/>
<RegExpr attribute="emphasis" String="&emphasisregex;"/>
<RegExpr attribute="strongemphasis" String="&strongemphasisregex;"/>
<RegExpr attribute="code" String="^([\s]{4,}|\t+).*$"/>
<RegExpr context="bullet" String="^[\*\+\-]\s"/>
<RegExpr context="numlist" String="^[\d]+\.\s"/>
<RegExpr attribute="meta" String="^(Title|Author|Date|Copyright|Revision|CSS|LaTeX\ XSLT|Categories|Tags|BaseName|Excerpt):(.*)+$"/>
<!-- Start of the Markdown document: find metadata or code block -->
<context name="Start Document" attribute="Normal Text" lineEndContext="Normal Text" lineEmptyContext="Normal Text" fallthrough="true" fallthroughContext="Normal Text">
<!-- Some titles: (Title|Author|Date|Copyright|Revision|CSS|LaTeX\ XSLT|Categories|Tags|BaseName|Excerpt) -->
<!-- Metadata: Markdown format -->
<RegExpr attribute="Metadata" context="metadata" String="\-{3}&end;" column="0" beginRegion="metadata"/>
<!-- Metadata: MultiMarkdown format -->
<RegExpr attribute="Metadata Title" context="metadata-mm-value" String="^&metadatakey;(?=\s|$)" column="0"/>
<!-- Code Block -->
<RegExpr attribute="Code" context="find-code-block-start" String="^&indentedcodeblock;" column="0"/>
</context>
<context name="metadata" attribute="Metadata" lineEndContext="#stay">
<StringDetect attribute="Metadata" context="#pop!Normal Text" String="---" column="0" endRegion="metadata"/>
<StringDetect attribute="Metadata" context="#pop!Normal Text" String="..." column="0" endRegion="metadata"/>
<RegExpr attribute="Metadata Title" String="^&metadatakey;(?=\s|$)" column="0"/>
</context>
<context name="metadata-mm-value" attribute="Metadata" lineEndContext="#pop!metadata-mm"/>
<context name="metadata-mm" attribute="Metadata" lineEndContext="#stay" lineEmptyContext="#pop!Normal Text" fallthrough="true" fallthroughContext="#pop!Normal Text">
<!-- Find Metadata key or value -->
<RegExpr attribute="Metadata Title" context="#pop!metadata-mm-value" String="^&metadatakey;(?=\s|$)" column="0"/>
<RegExpr attribute="Metadata" context="#pop!metadata-mm-value" String="^(?:\s{4}|\t)" column="0"/>
</context>
<context name="find-code-block-start" attribute="Normal Text" lineEndContext="#stay" lineEmptyContext="#stay" fallthrough="true" fallthroughContext="#pop!Normal Text">
<IncludeRules context="find-code-block"/>
</context>
<!-- Normal Text Document -->
<context name="Normal Text" attribute="Normal Text" lineEndContext="#stay" lineEmptyContext="find-code-block">
<!-- Header -->
<DetectChar context="find-header" char="#" column="0" lookAhead="true"/>
<RegExpr attribute="Header H1" String="(?:\=\s*){2,}$" firstNonSpace="true"/>
<!-- Highlight code block after line only with spaces or comment -->
<RegExpr attribute="Normal Text" context="find-code-block" String="&emptyline;" column="0"/>
<StringDetect attribute="Comment" context="find-code-block" String="&startcomment;" column="0" lookAhead="true"/>
<!-- Horizontal rules, Blockquotes and Lists.
NOTE: The indentation of the lists is captured. -->
<RegExpr attribute="Horizontal Rule" context="find-code-block" String="^&rulerregex;" column="0"/>
<DetectChar attribute="Blockquote" context="blockquote" char="&gt;" firstNonSpace="true"/>
<RegExpr attribute="List" context="list" String="(\s*)&listbullet;(\s+)" column="0"/>
<RegExpr attribute="Number List" context="numlist" String="(\s*)\d\.(\s+)" column="0"/>
<RegExpr attribute="Number List" context="numlist2" String="(\s*)\d\d+\.(\s+)" column="0"/>
<!-- Find Strong, Emphasis and Strikethrough Text -->
<DetectChar context="find-strong-normal" char="*" lookAhead="true"/>
<DetectChar context="find-emphasis-normal" char="_" lookAhead="true"/>
<RegExpr attribute="Strikethrough Text" minimal="true" String="&strikeoutregex;"/>
<!-- Common -->
<IncludeRules context="inc"/>
<RegExpr attribute="Normal Text: Link" String="&implicitlink;"/>
</context>
<context attribute="blockquote" lineEndContext="#stay" lineEmptyContext="#pop" name="blockquote">
<RegExpr attribute="bq-strong" String="&strongregex;"/>
<RegExpr attribute="bq-emphasis" String="&emphasisregex;"/>
<!-- Find indented code blocks. These are only allowed after an empty line or on the first line -->
<context name="find-code-block" attribute="Normal Text" lineEndContext="#stay" lineEmptyContext="#stay" fallthrough="true" fallthroughContext="#pop">
<RegExpr attribute="Code" String="^&indentedcodeblock;" column="0"/>
<RegExpr attribute="Normal Text" String="&end;" />
<RegExpr attribute="Comment" context="comment" String="\s*&startcomment;" column="0" beginRegion="comment"/>
<RegExpr attribute="Comment" context="comment" String="\s*&startcomment;(?=.*&endcomment;)" beginRegion="comment"/>
</context>
<context name="find-header" attribute="Normal Text" lineEndContext="#pop">
<RegExpr attribute="Header H1" context="#pop" String="^#\s.*[#]?$"/>
<RegExpr attribute="Header H2" context="#pop" String="^##\s.*[#]?$"/>
<RegExpr attribute="Header H3" context="#pop" String="^###\s.*[#]?$"/>
<RegExpr attribute="Header H4" context="#pop" String="^####\s.*[#]?$"/>
<RegExpr attribute="Header H5" context="#pop" String="^#####\s.*[#]?$"/>
<RegExpr attribute="Header H6" context="#pop" String="^######\s.*[#]?$"/>
<DetectChar attribute="Normal Text" context="#pop" char="#"/>
</context>
<context name="find-strong-normal" attribute="Normal Text" lineEndContext="#pop">
<RegExpr attribute="Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast_und;"/>
<RegExpr attribute="Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast_und2;"/>
<RegExpr attribute="Strong Text" context="#pop" minimal="true" String="&strongregex_ast;"/>
<RegExpr attribute="Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast;"/>
<RegExpr attribute="Emphasis Text" context="#pop" minimal="true" String="&emphasisregex_ast;"/>
<DetectChar attribute="Normal Text" context="#pop" char="*"/>
</context>
<context name="find-emphasis-normal" attribute="Normal Text" lineEndContext="#pop">
<RegExpr attribute="Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_und_ast;"/>
<RegExpr attribute="Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_und_ast2;"/>
<RegExpr attribute="Strong Text" context="#pop" minimal="true" String="&strongregex_und;"/>
<RegExpr attribute="Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_und;"/>
<RegExpr attribute="Emphasis Text" context="#pop" minimal="true" String="&emphasisregex_und;"/>
<DetectChar attribute="Normal Text" context="#pop" char="_"/>
</context>
<!-- Blockquote -->
<context name="blockquote" attribute="Blockquote: Normal Text" lineEndContext="#stay" lineEmptyContext="#pop">
<IncludeRules context="default-blockquote-1"/>
<!-- Find code block -->
<RegExpr attribute="Normal Text" context="#pop!find-code-block" String="&emptyline;" column="0"/>
<StringDetect attribute="Comment" context="#pop!find-code-block" String="&startcomment;" column="0" lookAhead="true"/>
<IncludeRules context="default-blockquote-2"/>
</context>
<!-- Blockquote within a list -->
<context name="blockquote-list" attribute="Blockquote: Normal Text" lineEndContext="#stay" lineEmptyContext="#pop">
<IncludeRules context="default-blockquote-1"/>
<!-- Don't find code block -->
<RegExpr attribute="Normal Text" context="#pop" String="&emptyline;" column="0"/>
<StringDetect attribute="Comment" context="#pop!comment" String="&startcomment;" firstNonSpace="true"/>
<IncludeRules context="default-blockquote-2"/>
</context>
<context name="default-blockquote-1" attribute="Blockquote: Normal Text" lineEndContext="#stay">
<DetectChar attribute="Blockquote" char="&gt;" firstNonSpace="true"/>
<!-- End with header, horizontal rule or list/numlist -->
<RegExpr context="#pop" String="(?:\s*(?:&listbullet;|[\d]+\.)\s|#{1,6}\s|&rulerregex;)" column="0" lookAhead="true"/>
</context>
<context name="default-blockquote-2" attribute="Blockquote: Normal Text" lineEndContext="#stay">
<!-- Strong, emphasis, strong-emphasis and strikethrough text -->
<AnyChar context="find-strong-emphasis-blockquote" String="*_" lookAhead="true"/>
<RegExpr attribute="Blockquote: Strikethrough Text" minimal="true" String="&strikeoutregex;"/>
<!-- Common -->
<IncludeRules context="inc"/>
<RegExpr attribute="Blockquote: Link" String="&implicitlink;"/>
</context>
<context attribute="bullet" lineEndContext="#stay" lineEmptyContext="#pop" name="bullet">
<RegExpr attribute="bl-strong" String="&strongregex;"/>
<RegExpr attribute="bl-emphasis" String="&emphasisregex;"/>
<context name="find-strong-emphasis-blockquote" attribute="Blockquote: Normal Text" lineEndContext="#pop">
<RegExpr attribute="Blockquote: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast_und;"/>
<RegExpr attribute="Blockquote: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_und_ast;"/>
<RegExpr attribute="Blockquote: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast_und2;"/>
<RegExpr attribute="Blockquote: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_und_ast2;"/>
<RegExpr attribute="Blockquote: Strong Text" context="#pop" minimal="true" String="&strongregex_ast;"/>
<RegExpr attribute="Blockquote: Strong Text" context="#pop" minimal="true" String="&strongregex_und;"/>
<RegExpr attribute="Blockquote: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast;"/>
<RegExpr attribute="Blockquote: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_und;"/>
<RegExpr attribute="Blockquote: Emphasis Text" context="#pop" minimal="true" String="&emphasisregex_ast;" />
<RegExpr attribute="Blockquote: Emphasis Text" context="#pop" minimal="true" String="&emphasisregex_und;"/>
<AnyChar attribute="Blockquote: Normal Text" context="#pop" String="*_"/>
</context>
<!-- List and Numbered List -->
<!-- NOTE: The indentation of the lists is captured. New paragraphs, code blocks, blockquotes or
horizontal rules must have an indentation equal to or greater than the list, to be part of it. -->
<!-- * list -->
<context name="list" attribute="List: Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="content-list">
<!-- Find indented code blocks, blockquotes and horizontal rules -->
<RegExpr attribute="Code" String="%1%2\s&indentedcodeblock;" column="0" dynamic="true"/>
<RegExpr attribute="Blockquote" context="blockquote-list" String="%1%2\s+&gt;" column="0" dynamic="true"/>
<RegExpr attribute="Horizontal Rule" String="%1%2\s+&rulerregex;" column="0" dynamic="true"/>
<RegExpr String="&emptyline;" column="0"/>
<!-- Text with the same indentation captured corresponds to the item list -->
<RegExpr context="content-list" String="%1%2\s" column="0" lookAhead="true" dynamic="true"/>
<!-- Finish when the text has a lower indentation than the list -->
<RegExpr context="#pop" String="^\s*\S" column="0" lookAhead="true"/>
<!-- Highlight checkbox at the start of the item (task list) -->
<RegExpr attribute="List: Checkbox" context="content-list" String="\s*&checkbox;"/>
</context>
<!-- 1. numlist (one digit) -->
<context name="numlist" attribute="List: Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="content-list">
<!-- Find indented code blocks, blockquotes and horizontal rules -->
<RegExpr attribute="Code" String="%1%2\s{2}&indentedcodeblock;" column="0" dynamic="true"/>
<RegExpr attribute="Blockquote" context="blockquote-list" String="%1%2\s{2,}&gt;" column="0" dynamic="true"/>
<RegExpr attribute="Horizontal Rule" String="%1%2\s{2,}&rulerregex;" column="0" dynamic="true"/>
<RegExpr String="&emptyline;" column="0"/>
<!-- Text with the same indentation captured -->
<RegExpr context="content-list" String="%1%2\s{2}" column="0" lookAhead="true" dynamic="true"/>
<!-- Finish when the text has a lower indentation than the list -->
<RegExpr context="#pop" String="^\s*\S" column="0" lookAhead="true"/>
</context>
<!-- 10. numlist (two or more digits) -->
<context name="numlist2" attribute="List: Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="content-list">
<!-- Find indented code blocks, blockquotes and horizontal rules -->
<RegExpr attribute="Code" String="%1%2\s{3}&indentedcodeblock;" column="0" dynamic="true"/>
<RegExpr attribute="Blockquote" context="blockquote-list" String="%1%2\s{3,}&gt;" column="0" dynamic="true"/>
<RegExpr attribute="Horizontal Rule" String="%1%2\s{3,}&rulerregex;" column="0" dynamic="true"/>
<RegExpr String="&emptyline;" column="0"/>
<!-- Text with the same indentation captured -->
<RegExpr context="content-list" String="%1%2\s{3}" column="0" lookAhead="true" dynamic="true"/>
<!-- Finish when the text has a lower indentation than the list -->
<RegExpr context="#pop" String="^\s*\S" column="0" lookAhead="true"/>
</context>
<!-- NOTE: Empty lines, blockquotes and horizontal rules send to contexts "list", "numlist" or "numlist2" (#pop),
to check the indentation of the text and determine if the content of the list ends. -->
<context name="content-list" attribute="List: Normal Text" lineEndContext="#stay" lineEmptyContext="#pop">
<RegExpr context="#pop" String="&emptyline;" column="0"/>
<!-- Blockquote and horzontal rule (check indentation) -->
<RegExpr context="#pop" String="^\s*(?:&gt;|&rulerregex;)" column="0" lookAhead="true"/>
<!-- End with header or new list/numlist -->
<RegExpr context="#pop#pop" String="(?:\s*(?:&listbullet;|[\d]+\.)\s|#{1,6}\s)" column="0" lookAhead="true"/>
<!-- Strong, emphasis, strong-emphasis and strikethrough text -->
<AnyChar context="find-strong-emphasis-list" String="*_" lookAhead="true"/>
<RegExpr attribute="List: Strikethrough Text" minimal="true" String="&strikeoutregex;"/>
<!-- Common -->
<IncludeRules context="inc"/>
<RegExpr attribute="List: Link" String="&implicitlink;"/>
</context>
<context attribute="numlist" lineEndContext="#stay" lineEmptyContext="#pop" name="numlist">
<RegExpr attribute="nl-strong" String="&strongregex;"/>
<RegExpr attribute="nl-emphasis" String="&emphasisregex;"/>
<IncludeRules context="inc"/>
<context name="find-strong-emphasis-list" attribute="List: Normal Text" lineEndContext="#pop">
<RegExpr attribute="List: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast_und;"/>
<RegExpr attribute="List: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_und_ast;"/>
<RegExpr attribute="List: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast_und2;"/>
<RegExpr attribute="List: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_und_ast2;"/>
<RegExpr attribute="List: Strong Text" context="#pop" minimal="true" String="&strongregex_ast;"/>
<RegExpr attribute="List: Strong Text" context="#pop" minimal="true" String="&strongregex_und;"/>
<RegExpr attribute="List: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast;"/>
<RegExpr attribute="List: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_und;"/>
<RegExpr attribute="List: Emphasis Text" context="#pop" minimal="true" String="&emphasisregex_ast;" />
<RegExpr attribute="List: Emphasis Text" context="#pop" minimal="true" String="&emphasisregex_und;"/>
<AnyChar attribute="List: Normal Text" context="#pop" String="*_"/>
</context>
<context attribute="comment" lineEndContext="#stay" name="comment">
<RegExpr String="--&gt;" attribute="comment" context="#pop" endRegion="comment"/>
<!-- Comments -->
<context name="comment" attribute="Comment" lineEndContext="#stay">
<StringDetect attribute="Comment" context="#pop" String="&endcomment;" endRegion="comment"/>
<IncludeRules context="##Alerts"/>
<IncludeRules context="##Modelines"/>
</context>
<context attribute="code" lineEndContext="#stay" name="bash-code">
<WordDetect attribute="code" context="#pop" String="```"/>
<!-- Fenced Code Blocks -->
<context name="find-lang-fenced-code" attribute="Normal Text" lineEndContext="#pop">
<!-- Apply syntax highlighting to fenced code blocks for some languages -->
<RegExpr attribute="Fenced Code" context="#pop!code" String="&fcode;&end;"/>
<RegExpr attribute="Fenced Code" context="#pop!bash-code" String="&fcode;\s*(?:bash(?:rc|_profile|_login|_logout)?|shell|sh|zsh|profile|PKGBUILD|APKBUILD|ebuild|eclass|nix)&end;" insensitive="true"/>
<RegExpr attribute="Fenced Code" context="#pop!cpp-code" String="&fcode;\s*(?:[ch]pp|[ch]\+\+|[ch]xx|h?cc|hh|cuh?|ino|pde|moc)&end;" insensitive="true"/>
<RegExpr attribute="Fenced Code" context="#pop!csharp-code" String="&fcode;\s*(?:cs|csharp|c\#)&end;" insensitive="true"/>
<RegExpr attribute="Fenced Code" context="#pop!cmake-code" String="&fcode;\s*(?:cmake|CMakeLists(?:\.txt)?)&end;" insensitive="true"/>
<RegExpr attribute="Fenced Code" context="#pop!css-code" String="&fcode;\s*css&end;" insensitive="true"/>
<RegExpr attribute="Fenced Code" context="#pop!c-code" String="&fcode;\s*[ch]&end;" insensitive="true"/>
<RegExpr attribute="Fenced Code" context="#pop!doxygen-code" String="&fcode;\s*doxygen&end;" insensitive="true"/> <!-- Block comment of Doxygen -->
<RegExpr attribute="Fenced Code" context="#pop!email-code" String="&fcode;\s*(?:email|emlx?|mbo?x)&end;" insensitive="true"/>
<RegExpr attribute="Fenced Code" context="#pop!go-code" String="&fcode;\s*go(?:lang)?&end;" insensitive="true"/>
<RegExpr attribute="Fenced Code" context="#pop!hamlet-code" String="&fcode;\s*[wxs]?hamlet&end;" insensitive="true"/> <!-- Included in the Haskell definition -->
<RegExpr attribute="Fenced Code" context="#pop!haskell-code" String="&fcode;\s*(?:haskell|c?hs|hs\-boot)&end;" insensitive="true"/>
<RegExpr attribute="Fenced Code" context="#pop!html-code" String="&fcode;\s*(?:[sx]?html?|inc|tmpl|tpl)&end;" insensitive="true"/>
<RegExpr attribute="Fenced Code" context="#pop!java-code" String="&fcode;\s*(?:java|bsh)&end;" insensitive="true"/>
<RegExpr attribute="Fenced Code" context="#pop!javascript-code" String="&fcode;\s*(?:javascript|m?js|es6|kwinscript|julius)&end;" insensitive="true"/>
<RegExpr attribute="Fenced Code" context="#pop!jsx-code" String="&fcode;\s*(?:jsx|tsx|(?:java|type)script\-react)&end;" insensitive="true"/> <!-- Included in the HTML definition. Also apply for TSX. -->
<RegExpr attribute="Fenced Code" context="#pop!json-code" String="&fcode;\s*(?:json5?|gltf)&end;" insensitive="true"/>
<RegExpr attribute="Fenced Code" context="#pop!matlab-code" String="&fcode;\s*matlab&end;" insensitive="true"/>
<RegExpr attribute="Fenced Code" context="#pop!markdown-code" String="&fcode;\s*(?:markdown|m?md)&end;" insensitive="true"/>
<RegExpr attribute="Fenced Code" context="#pop!mustache-code" String="&fcode;\s*(?:handlebars|hbs|mustache|mst|ractive|hogan|hulk)&end;" insensitive="true"/> <!-- Included in the HTML definition -->
<RegExpr attribute="Fenced Code" context="#pop!perl-code" String="&fcode;\s*(?:perl|p[lm]|pod|psgi|vcl|perl6|p[lm]?6|nqp)&end;" insensitive="true"/>
<RegExpr attribute="Fenced Code" context="#pop!php-code" String="&fcode;\s*(?:php[3457t]?|wml|phtml?|aw|ctp)&end;" insensitive="true"/>
<RegExpr attribute="Fenced Code" context="#pop!python-code" String="&fcode;\s*(?:python[23]?|py[23w]?|[rc]py|sconstruct|gypi?)&end;" insensitive="true"/>
<RegExpr attribute="Fenced Code" context="#pop!qml-code" String="&fcode;\s*qml(?:types)?&end;" insensitive="true"/>
<RegExpr attribute="Fenced Code" context="#pop!r-code" String="&fcode;\s*(?:r|rprofile|rscript)&end;" insensitive="true"/>
<RegExpr attribute="Fenced Code" context="#pop!rest-code" String="&fcode;\s*(?:rst|rest|restructuredtext)&end;" insensitive="true"/> <!-- Included in the CMake definition -->
<RegExpr attribute="Fenced Code" context="#pop!ruby-code" String="&fcode;\s*(?:ruby|rbx?|rjs|rake|f?cgi|gemspec|irbrc|ru|prawn|Appraisals|(?:Rake|Cap|Chef|Gem|Guard|Hobo|Vagrant||Rant|Berks|Thor|Puppet)file|rxml|(?:xml|js)\.erb)&end;" insensitive="true"/>
<RegExpr attribute="Fenced Code" context="#pop!rust-code" String="&fcode;\s*(?:rust|rs)&end;" insensitive="true"/>
<RegExpr attribute="Fenced Code" context="#pop!mysql-code" String="&fcode;\s*(?:mysql|sql|ddl)&end;" insensitive="true"/> <!-- Included in the PHP definition -->
<RegExpr attribute="Fenced Code" context="#pop!typescript-code" String="&fcode;\s*(?:typescript|ts)&end;" insensitive="true"/>
<RegExpr attribute="Fenced Code" context="#pop!xml-code" String="&fcode;\s*(?:xml|xsd|xspf|tld|jsp|c?pt|dtml|rss|opml|svg|daml|rdf|ui|kcfg|qrc|wsdl|scxml|xbel|dae|sch|brd|docbook)&end;" insensitive="true"/>
<RegExpr attribute="Fenced Code" context="#pop!code" String="&fcode;.*$"/>
</context>
<context name="code" attribute="Code" lineEndContext="#stay"> <!-- Unknown language -->
<RegExpr attribute="Fenced Code" context="#pop" String="%1[~`]*(?=&end;)" firstNonSpace="true" dynamic="true" endRegion="code-block"/>
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="bash-code">
<IncludeRules context="code"/>
<IncludeRules context="##Bash" includeAttrib="true"/>
</context>
<context attribute="code" lineEndContext="#stay" name="cmake-code">
<WordDetect attribute="code" context="#pop" String="```"/>
<context attribute="Normal Text" lineEndContext="#stay" name="cmake-code">
<IncludeRules context="code"/>
<IncludeRules context="##CMake" includeAttrib="true"/>
</context>
<context attribute="code" lineEndContext="#stay" name="cpp-code">
<WordDetect attribute="code" context="#pop" String="```"/>
<context attribute="Normal Text" lineEndContext="#stay" name="c-code">
<IncludeRules context="code"/>
<IncludeRules context="##C" includeAttrib="true"/>
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="cpp-code">
<IncludeRules context="code"/>
<IncludeRules context="##C++" includeAttrib="true"/>
</context>
<context attribute="code" lineEndContext="#stay" name="css-code">
<WordDetect attribute="code" context="#pop" String="```"/>
<context attribute="Normal Text" lineEndContext="#stay" name="csharp-code">
<IncludeRules context="code"/>
<IncludeRules context="##C#" includeAttrib="true"/>
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="css-code">
<IncludeRules context="code"/>
<IncludeRules context="##CSS" includeAttrib="true"/>
</context>
<context attribute="code" lineEndContext="#stay" name="email-code">
<WordDetect attribute="code" context="#pop" String="```"/>
<context attribute="Normal Text" lineEndContext="#stay" name="doxygen-code">
<IncludeRules context="code"/>
<IncludeRules context="BlockComment##Doxygen" includeAttrib="true"/>
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="email-code">
<IncludeRules context="code"/>
<IncludeRules context="##Email" includeAttrib="true"/>
</context>
<context attribute="code" lineEndContext="#stay" name="haskell-code">
<WordDetect attribute="code" context="#pop" String="```"/>
<context attribute="Normal Text" lineEndContext="#stay" name="go-code">
<IncludeRules context="code"/>
<IncludeRules context="##Go" includeAttrib="true"/>
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="hamlet-code">
<IncludeRules context="code"/>
<IncludeRules context="##Hamlet" includeAttrib="true"/>
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="haskell-code">
<IncludeRules context="code"/>
<IncludeRules context="##Haskell" includeAttrib="true"/>
</context>
<context attribute="code" lineEndContext="#stay" name="html-code">
<WordDetect attribute="code" context="#pop" String="```"/>
<context attribute="Normal Text" lineEndContext="#stay" name="html-code">
<IncludeRules context="code"/>
<IncludeRules context="##HTML" includeAttrib="true"/>
</context>
<context attribute="code" lineEndContext="#stay" name="json-code">
<WordDetect attribute="code" context="#pop" String="```"/>
<context attribute="Normal Text" lineEndContext="#stay" name="java-code">
<IncludeRules context="code"/>
<IncludeRules context="##Java" includeAttrib="true"/>
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="javascript-code">
<IncludeRules context="code"/>
<IncludeRules context="Normal##JavaScript" includeAttrib="true"/>
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="jsx-code">
<IncludeRules context="code"/>
<IncludeRules context="Normal##JavaScript React" includeAttrib="true"/>
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="json-code">
<IncludeRules context="code"/>
<IncludeRules context="##JSON" includeAttrib="true"/>
</context>
<context attribute="code" lineEndContext="#stay" name="php-code">
<WordDetect attribute="code" context="#pop" String="```"/>
<context attribute="Normal Text" lineEndContext="#stay" lineEmptyContext="find-code-block" name="markdown-code">
<IncludeRules context="code"/>
<IncludeRules context="Normal Text"/>
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="matlab-code">
<IncludeRules context="code"/>
<IncludeRules context="##Matlab" includeAttrib="true"/>
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="mustache-code">
<IncludeRules context="code"/>
<IncludeRules context="##Mustache/Handlebars (HTML)" includeAttrib="true"/>
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="perl-code">
<IncludeRules context="code"/>
<IncludeRules context="##Perl" includeAttrib="true"/>
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="php-code">
<IncludeRules context="code"/>
<IncludeRules context="phpsource##PHP/PHP" includeAttrib="true"/>
</context>
<context attribute="code" lineEndContext="#stay" name="python-code">
<WordDetect attribute="code" context="#pop" String="```"/>
<context attribute="Normal Text" lineEndContext="#stay" name="python-code">
<IncludeRules context="code"/>
<IncludeRules context="##Python" includeAttrib="true"/>
</context>
<context attribute="code" lineEndContext="#stay" name="qml-code">
<WordDetect attribute="code" context="#pop" String="```"/>
<context attribute="Normal Text" lineEndContext="#stay" name="qml-code">
<IncludeRules context="code"/>
<IncludeRules context="##QML" includeAttrib="true"/>
</context>
<context attribute="code" lineEndContext="#stay" name="rust-code">
<WordDetect attribute="code" context="#pop" String="```"/>
<context attribute="Normal Text" lineEndContext="#stay" name="r-code">
<IncludeRules context="code"/>
<IncludeRules context="##R Script" includeAttrib="true"/>
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="rest-code">
<IncludeRules context="code"/>
<IncludeRules context="##reStructuredText" includeAttrib="true"/>
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="ruby-code">
<IncludeRules context="code"/>
<IncludeRules context="##Ruby" includeAttrib="true"/>
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="rust-code">
<IncludeRules context="code"/>
<IncludeRules context="##Rust" includeAttrib="true"/>
</context>
<context attribute="code" lineEndContext="#stay" name="xml-code">
<WordDetect attribute="code" context="#pop" String="```"/>
<context attribute="Normal Text" lineEndContext="#stay" name="mysql-code">
<IncludeRules context="code"/>
<IncludeRules context="##SQL (MySQL)" includeAttrib="true"/>
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="typescript-code">
<IncludeRules context="code"/>
<IncludeRules context="Normal##TypeScript" includeAttrib="true"/>
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="xml-code">
<IncludeRules context="code"/>
<IncludeRules context="##XML" includeAttrib="true"/>
</context>
<context attribute="code" lineEndContext="#stay" name="code">
<WordDetect attribute="code" context="#pop" String="```"/>
<!-- Common -->
<context name="inc" attribute="Normal Text" lineEndContext="#stay">
<!-- Code -->
<RegExpr attribute="Code" String="`[^`]+`(?!`)"/>
<RegExpr attribute="Code" minimal="true" String="`{2}[^`](?:.*[^`])?`{2}(?!`)"/>
<RegExpr attribute="Code" minimal="true" String="`{3}[^`](?:.*[^`])?`{3}(?!`)"/>
<RegExpr attribute="Code" minimal="true" String="`{4}[^`](?:.*[^`])?`{4}(?!`)"/>
<RegExpr attribute="Code" minimal="true" String="`{5,}[^`](?:.*[^`])?`{5,}"/>
<!-- Find Fenced Code Block -->
<RegExpr attribute="Fenced Code" context="find-lang-fenced-code" String="`{3,}(?=[^`]*$)" firstNonSpace="true" lookAhead="true" beginRegion="code-block"/>
<RegExpr attribute="Fenced Code" context="find-lang-fenced-code" String="~{3,}(?=[^~]*$)" firstNonSpace="true" lookAhead="true" beginRegion="code-block"/>
<!-- Comment -->
<StringDetect attribute="Comment" context="comment" String="&startcomment;" beginRegion="comment"/>
<!-- Links and References -->
<RegExpr attribute="Reference-Link Target" context="reflinktarget" String="&reflinktargetregex;" firstNonSpace="true"/>
<RegExpr attribute="Footnote" String="&footnoteregex;"/>
<RegExpr attribute="Reference-Link" context="find-reflink" String="&reflinkregex;"/>
<RegExpr attribute="Inline Image" context="inlineimage" String="&inlineimageregex;"/>
<RegExpr attribute="Reference Image" String="&refimageregex;"/>
<RegExpr attribute="Auto-Link" context="autolink" String="&autolinkregex;" lookAhead="true"/>
<RegExpr attribute="Mailto-Link" context="mailtolink" String="&mailtolinkregex;"/>
<!-- Line Break -->
<RegExpr attribute="Line Break" minimal="true" String="&linebreakregex;"/>
<!-- Backslash Escapes -->
<Detect2Chars attribute="Backslash Escape" char="\" char1="\"/>
<Detect2Chars attribute="Backslash Escape" char="\" char1="`"/>
<Detect2Chars attribute="Backslash Escape" char="\" char1="*"/>
<Detect2Chars attribute="Backslash Escape" char="\" char1="_"/>
<Detect2Chars attribute="Backslash Escape" char="\" char1="{"/>
<Detect2Chars attribute="Backslash Escape" char="\" char1="}"/>
<Detect2Chars attribute="Backslash Escape" char="\" char1="["/>
<Detect2Chars attribute="Backslash Escape" char="\" char1="]"/>
<Detect2Chars attribute="Backslash Escape" char="\" char1="("/>
<Detect2Chars attribute="Backslash Escape" char="\" char1=")"/>
<Detect2Chars attribute="Backslash Escape" char="\" char1="#"/>
<Detect2Chars attribute="Backslash Escape" char="\" char1="+"/>
<Detect2Chars attribute="Backslash Escape" char="\" char1="-"/>
<Detect2Chars attribute="Backslash Escape" char="\" char1="."/>
<Detect2Chars attribute="Backslash Escape" char="\" char1="!"/>
<Detect2Chars attribute="Backslash Escape" char="\" char1="&lt;"/>
<Detect2Chars attribute="Backslash Escape" char="\" char1="&gt;"/>
<Detect2Chars attribute="Backslash Escape" char="\" char1="&amp;"/>
<!-- Inline HTML -->
<RegExpr attribute="EntityRef" String="&amp;(?:#[0-9]+|#[xX][0-9A-Fa-f]+|&htmlname;);"/>
<RegExpr context="find-html-block" String="&lt;/?&htmlname;(?:[\s&gt;]|/&gt;|$)" lookAhead="true"/>
</context>
<context attribute="common" name="inc" lineEndContext="#stay">
<RegExpr attribute="code" String="`[^`]+`"/>
<RegExpr context="comment" String="&lt;!--" beginRegion="comment"/>
<RegExpr attribute="reflink" String="&reflinkregex;"/>
<RegExpr attribute="footnote" String="&footnoteregex;"/>
<RegExpr attribute="inlinelink" String="&inlinelinkregex;"/>
<RegExpr attribute="reflinktarget" String="&reflinktargetregex;"/>
<RegExpr attribute="inlineimage" String="&inlineimageregex;"/>
<RegExpr attribute="refimage" String="&refimageregex;"/>
<RegExpr attribute="autolink" String="&autolinkregex;"/>
<RegExpr attribute="mailtolink" String="&mailtolinkregex;"/>
<RegExpr attribute="strikeout" minimal="true" String="&strikeoutregex;"/>
<RegExpr attribute="linebreak" minimal="true" String="&linebreakregex;"/>
<WordDetect attribute="code" context="bash-code" String="```bash"/>
<WordDetect attribute="code" context="cmake-code" String="```cmake"/>
<WordDetect attribute="code" context="cpp-code" String="```cpp"/>
<WordDetect attribute="code" context="css-code" String="```css"/>
<WordDetect attribute="code" context="email-code" String="```email"/>
<WordDetect attribute="code" context="haskell-code" String="```haskell"/>
<WordDetect attribute="code" context="html-code" String="```html"/>
<WordDetect attribute="code" context="json-code" String="```json"/>
<WordDetect attribute="code" context="php-code" String="```php"/>
<WordDetect attribute="code" context="python-code" String="```python"/>
<WordDetect attribute="code" context="qml-code" String="```qml"/>
<WordDetect attribute="code" context="rust-code" String="```rust"/>
<WordDetect attribute="code" context="xml-code" String="```xml"/>
<StringDetect attribute="code" context="code" String="```"/>
<context name="find-html-block" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
<IncludeRules context="FindSpecialHTMLTags##HTML"/>
<IncludeRules context="FindHTMLTags##HTML"/>
</context>
<!-- Links and email: <https://example.com>, <example@kde.org> -->
<context name="autolink" attribute="Auto-Link" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
<DetectChar attribute="Auto-Link" char="&lt;"/>
<DetectChar attribute="Auto-Link" context="#pop" char="&gt;"/>
<RegExpr attribute="Link" String="&startlink;[^&quot;&gt;\s]+"/>
</context>
<context name="mailtolink" attribute="Email" lineEndContext="#pop">
<DetectChar attribute="Mailto-Link" context="#pop" char="&gt;"/>
</context>
<!-- References: [example][id], [example](http://example.com) -->
<context name="find-reflink" attribute="Reference-Link Name" lineEndContext="#pop">
<Detect2Chars attribute="Reference-Link Name" char="\" char1="]"/>
<RegExpr attribute="Reference-Link" context="#pop!find-reflink-id" String="\](?=&reflinkidregex;)"/> <!-- Find id -->
<DetectChar attribute="Reference-Link" context="#pop" char="]"/>
<!-- Image as link or reference -->
<RegExpr attribute="Inline Image" context="inlineimage" String="&startinlineimage;(?=&endinlineimage;&refchar;*\])"/>
<RegExpr attribute="Reference Image" String="&refimageregex;(?=&refchar;*\])"/>
<RegExpr attribute="Reference-Link Name" context="#stay" String="(?:\[(?:\\.|[^\[\]\\])*\](?:\\.|[^\[\]\\])*)+(?=\])" minimal="true"/>
</context>
<context name="find-reflink-id" attribute="Reference-Link" lineEndContext="#pop">
<DetectSpaces />
<!-- Ref.: [an example][id] "Optional title" -->
<DetectChar attribute="Reference-Link" context="#pop!reflink-id" char="["/>
<!-- Inline Ref.: [an example](http://example.com/ "Title") -->
<DetectChar attribute="Reference-Link" context="#pop!reflink-inline-id" char="("/>
</context>
<context name="reflink-inline-id" attribute="Reference-Link" lineEndContext="#pop">
<Detect2Chars attribute="Reference-Link" char="\" char1=")"/>
<DetectChar attribute="Reference-Link" context="#pop" char=")"/>
<RegExpr attribute="Reference-Link: Link" String="\b&startlink;(?:\\.|[^&quot;&gt;\s\)\\])+"/>
<RegExpr attribute="Reference-Link: Email" String="\b&email;\b"/>
</context>
<context name="reflink-id" attribute="Reference-Link ID" lineEndContext="#pop">
<Detect2Chars attribute="Reference-Link ID" char="\" char1="]"/>
<DetectChar attribute="Reference-Link" context="#pop!reflink-title" char="]"/>
<RegExpr attribute="Reference-Link: Link" String="\b&startlink;(?:\\.|[^&quot;&gt;\s\]\\])+"/>
</context>
<!-- [an example][id] "title" -->
<context name="reflink-title" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
<RegExpr attribute="Reference-Link" context="#pop" String="\s+&quot;(?:\\.|[^&quot;\\])*&quot;"/>
</context>
<!-- Target Ref.: [foo]: http://example.com/ "Optional Title Here" -->
<context name="reflinktarget" attribute="Reference-Link Target" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
<RegExpr attribute="Reference-Link Target: Link" context="#pop!reflinktarget-title" String="\s*&link;(?=\s|$)"/>
<RegExpr attribute="Reference-Link Target" context="#pop!reflinktarget-link" String="\s*&lt;(?=&link;&gt;(?:\s|$))"/>
<RegExpr attribute="Reference-Link Target" context="#pop!reflinktarget-title" String="\s*#[\w\.\:\-]+\b"/>
</context>
<context name="reflinktarget-link" attribute="Reference-Link Target" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
<DetectChar attribute="Reference-Link Target" context="#pop!reflinktarget-title" char="&gt;"/>
<RegExpr attribute="Reference-Link Target: Link" String="&link;"/>
</context>
<context name="reflinktarget-title" attribute="Reference-Link Target" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
<DetectSpaces attribute="Reference-Link Target"/>
<RegExpr attribute="Reference-Link Target" context="#pop" String="&quot;(?:\\.|[^&quot;\\])*&quot;"/>
<RegExpr attribute="Reference-Link Target" context="#pop" String="&apos;(?:\\.|[^&apos;\\])*&apos;"/>
<RegExpr attribute="Reference-Link Target" context="#pop" String="\((?:\\.|[^\)\\])*\)"/>
</context>
<!-- Image -->
<context name="inlineimage" attribute="Inline Image" lineEndContext="#pop">
<DetectChar attribute="Inline Image" context="#pop" char=")"/>
<Detect2Chars attribute="Inline Image" char="\" char1=")"/>
<RegExpr attribute="Inline Image: Link" String="\b&startlink;(?:\\.|[^&quot;&gt;\s\)\\])+"/>
</context>
</contexts>
<itemDatas>
<itemData name="Normal Text" defStyleNum="dsNormal"/>
<itemData name="common" defStyleNum="dsNormal"/>
<itemData name="strongemphasis" defStyleNum="dsNormal" italic="true" bold="true"/>
<itemData name="emphasis" defStyleNum="dsNormal" italic="true"/>
<itemData name="strong" defStyleNum="dsNormal" bold="true"/>
<itemData name="ruler" defStyleNum="dsNormal" bold="true"/>
<itemData name="strikeout" defStyleNum="dsNormal" strikeOut="true"/>
<itemData name="linebreak" defStyleNum="dsNormal" underline="true" color="#999999"/>
<itemData name="h1" defStyleNum="dsFunction" bold="true"/>
<itemData name="h2" defStyleNum="dsFunction" bold="true"/>
<itemData name="h3" defStyleNum="dsFunction" bold="true"/>
<itemData name="h4" defStyleNum="dsFunction" bold="true"/>
<itemData name="h5" defStyleNum="dsFunction" bold="true"/>
<itemData name="h6" defStyleNum="dsFunction" bold="true"/>
<itemData name="blockquote" defStyleNum="dsDataType"/>
<itemData name="bq-emphasis" defStyleNum="dsDataType" italic="true"/>
<itemData name="bq-strong" defStyleNum="dsDataType" bold="true"/>
<itemData name="bullet" defStyleNum="dsString"/>
<itemData name="bl-emphasis" defStyleNum="dsString" italic="true"/>
<itemData name="bl-strong" defStyleNum="dsString" bold="true"/>
<itemData name="numlist" defStyleNum="dsString"/>
<itemData name="nl-emphasis" defStyleNum="dsString" italic="true"/>
<itemData name="nl-strong" defStyleNum="dsString" bold="true"/>
<itemData name="comment" defStyleNum="dsComment"/>
<itemData name="code" defStyleNum="dsBaseN"/>
<itemData name="reflink" defStyleNum="dsOthers" underline="true"/>
<itemData name="inlinelink" defStyleNum="dsOthers" underline="true"/>
<itemData name="autolink" defStyleNum="dsOthers" underline="true"/>
<itemData name="mailtolink" defStyleNum="dsOthers" underline="true"/>
<itemData name="footnote" defStyleNum="dsOthers" italic="true"/>
<itemData name="meta" defStyleNum="dsComment"/>
<itemData name="reflinktarget" defStyleNum="dsOthers" italic="false" bold="false"/>
<itemData name="inlineimage" defStyleNum="dsAlert" italic="false" bold="false"/>
<itemData name="refimage" defStyleNum="dsAlert" italic="false" bold="false"/>
<itemData name="Emphasis Text" defStyleNum="dsNormal" italic="true"/>
<itemData name="Strong Text" defStyleNum="dsNormal" bold="true"/>
<itemData name="Strong-Emphasis Text" defStyleNum="dsNormal" italic="true" bold="true"/>
<itemData name="Strikethrough Text" defStyleNum="dsNormal" strikeOut="true"/>
<itemData name="Normal Text: Link" defStyleNum="dsNormal" underline="true" spellChecking="false"/>
<itemData name="Horizontal Rule" defStyleNum="dsNormal" bold="true" spellChecking="false"/>
<itemData name="Line Break" defStyleNum="dsNormal" underline="true" color="#999999" spellChecking="false"/>
<itemData name="Header H1" defStyleNum="dsFunction" bold="true"/>
<itemData name="Header H2" defStyleNum="dsFunction" bold="true"/>
<itemData name="Header H3" defStyleNum="dsFunction" bold="true"/>
<itemData name="Header H4" defStyleNum="dsFunction" bold="true"/>
<itemData name="Header H5" defStyleNum="dsFunction" bold="true"/>
<itemData name="Header H6" defStyleNum="dsFunction" bold="true"/>
<itemData name="Blockquote" defStyleNum="dsAttribute" spellChecking="false"/>
<itemData name="Blockquote: Normal Text" defStyleNum="dsAttribute"/>
<itemData name="Blockquote: Emphasis Text" defStyleNum="dsAttribute" italic="true"/>
<itemData name="Blockquote: Strong Text" defStyleNum="dsAttribute" bold="true"/>
<itemData name="Blockquote: Strong-Emphasis Text" defStyleNum="dsAttribute" italic="true" bold="true"/>
<itemData name="Blockquote: Strikethrough Text" defStyleNum="dsAttribute" strikeOut="true"/>
<itemData name="Blockquote: Link" defStyleNum="dsAttribute" underline="true" spellChecking="false"/>
<itemData name="List" defStyleNum="dsSpecialString" bold="1" spellChecking="false"/>
<itemData name="Number List" defStyleNum="dsSpecialString" spellChecking="false"/>
<itemData name="List: Normal Text" defStyleNum="dsNormal"/>
<itemData name="List: Emphasis Text" defStyleNum="dsNormal" italic="true"/>
<itemData name="List: Strong Text" defStyleNum="dsNormal" bold="true"/>
<itemData name="List: Strong-Emphasis Text" defStyleNum="dsNormal" italic="true" bold="true"/>
<itemData name="List: Strikethrough Text" defStyleNum="dsNormal" strikeOut="true"/>
<itemData name="List: Link" defStyleNum="dsNormal" underline="true" spellChecking="false"/>
<itemData name="List: Checkbox" defStyleNum="dsVariable" spellChecking="false"/>
<itemData name="Comment" defStyleNum="dsComment"/>
<itemData name="Code" defStyleNum="dsInformation"/>
<itemData name="Fenced Code" defStyleNum="dsInformation" spellChecking="false"/>
<itemData name="Auto-Link" defStyleNum="dsOthers" spellChecking="false"/>
<itemData name="Link" defStyleNum="dsOthers" underline="true" spellChecking="false"/>
<itemData name="Mailto-Link" defStyleNum="dsOthers" spellChecking="false"/>
<itemData name="Email" defStyleNum="dsOthers" italic="true" underline="true" spellChecking="false"/>
<itemData name="Footnote" defStyleNum="dsOthers" italic="true"/>
<itemData name="Reference-Link" defStyleNum="dsComment" italic="false"/>
<itemData name="Reference-Link Name" defStyleNum="dsOthers" underline="true" italic="false"/>
<itemData name="Reference-Link ID" defStyleNum="dsComment" italic="false"/>
<itemData name="Reference-Link: Link" defStyleNum="dsComment" underline="true" italic="false" spellChecking="false"/>
<itemData name="Reference-Link: Email" defStyleNum="dsComment" italic="true" underline="true" spellChecking="false"/>
<itemData name="Reference-Link Target" defStyleNum="dsOthers" italic="false" bold="false"/>
<itemData name="Reference-Link Target: Link" defStyleNum="dsOthers" underline="true" spellChecking="false"/>
<itemData name="Inline Image" defStyleNum="dsAlert" italic="false" bold="false"/>
<itemData name="Reference Image" defStyleNum="dsAlert" italic="false" bold="false"/>
<itemData name="Inline Image: Link" defStyleNum="dsAlert" italic="false" bold="false" underline="true"/>
<itemData name="Metadata Title" defStyleNum="dsAnnotation"/>
<itemData name="Metadata" defStyleNum="dsComment" italic="0"/>
<itemData name="Backslash Escape" defStyleNum="dsSpecialChar" spellChecking="false"/>
<itemData name="EntityRef" defStyleNum="dsDecVal" spellChecking="false"/>
</itemDatas>
</highlighting>
<general>
<keywords additionalDeliminator="`"/>
<comments>
<comment name="multiLine" start="&lt;!--" end="--&gt;" region="comment"/>
<comment name="multiLine" start="&startcomment;" end="&endcomment;" region="comment"/>
</comments>
</general>
</language>
<!-- kate: replace-tabs on; indent-width 2; tab-width 2; -->

View File

@@ -39,7 +39,7 @@
Enhance tr/// and y/// support.
-->
<language name="Perl" version="8" kateversion="2.4" section="Scripts" extensions="*.pl;*.PL;*.pm;*.pl6;*.PL6;*.p6;*.pm6;" mimetype="application/x-perl;text/x-perl" priority="5" author="Anders Lund (anders@alweb.dk)" license="LGPLv2">
<language name="Perl" version="9" kateversion="2.4" section="Scripts" extensions="*.pl;*.PL;*.pm" mimetype="application/x-perl;text/x-perl" priority="5" author="Anders Lund (anders@alweb.dk)" license="LGPLv2">
<highlighting>
<list name="keywords">
<item>if</item>

File diff suppressed because it is too large Load Diff

View File

@@ -32,7 +32,6 @@
#include <QCommandLineParser>
#include <QCoreApplication>
#include <QFile>
#include <QVector>
#include <iostream>

View File

@@ -24,7 +24,6 @@
#include <QCoreApplication>
#include <QFile>
#include <QFileInfo>
#include <QTextStream>
#include <QVariant>
#include <QXmlStreamReader>
#include <QJsonDocument>
@@ -59,6 +58,7 @@ QStringList readListing(const QString &fileName)
if (xml.hasError()) {
qWarning() << "XML error while reading" << fileName << " - "
<< qPrintable(xml.errorString()) << "@ offset" << xml.characterOffset();
listing.clear();
}
return listing;
@@ -69,7 +69,7 @@ QStringList readListing(const QString &fileName)
* @param extensions extensions string to check
* @return valid?
*/
bool checkExtensions(QString extensions)
bool checkExtensions(const QString &extensions)
{
// get list of extensions
const QStringList extensionParts = extensions.split(QLatin1Char(';'), QString::SkipEmptyParts);
@@ -163,6 +163,7 @@ bool checkSingleChars(const QString &hlFilename, QXmlStreamReader &xml)
const QString c = xml.attributes().value(QLatin1String("char")).toString();
if (c.size() != 1) {
qWarning() << hlFilename << "line" << xml.lineNumber() << "'char' must contain exactly one char:" << c;
return false;
}
}
@@ -170,6 +171,7 @@ bool checkSingleChars(const QString &hlFilename, QXmlStreamReader &xml)
const QString c = xml.attributes().value(QLatin1String("char1")).toString();
if (c.size() != 1) {
qWarning() << hlFilename << "line" << xml.lineNumber() << "'char1' must contain exactly one char:" << c;
return false;
}
}
@@ -285,6 +287,7 @@ public:
const QString name = xml.attributes().value(QLatin1String("name")).toString();
if (m_existingNames.contains(name)) {
qWarning() << m_filename << "list duplicate:" << name;
m_success = false;
}
m_existingNames.insert(name);
} else if (xml.name() == QLatin1String("keyword")) {
@@ -296,7 +299,7 @@ public:
bool check() const
{
bool success = true;
bool success = m_success;
const auto invalidNames = m_usedNames - m_existingNames;
if (!invalidNames.isEmpty()) {
qWarning() << m_filename << "Reference of non-existing keyword list:" << invalidNames;
@@ -306,6 +309,7 @@ public:
const auto unusedNames = m_existingNames - m_usedNames;
if (!unusedNames.isEmpty()) {
qWarning() << m_filename << "Unused keyword lists:" << unusedNames;
success = false;
}
return success;
@@ -315,14 +319,27 @@ private:
QString m_filename;
QSet<QString> m_usedNames;
QSet<QString> m_existingNames;
bool m_success = true;
};
/**
* Helper class to search for non-existing contexts
* Helper class to search for non-existing contexts and invalid version
*/
class ContextChecker
{
public:
void setKateVersion(const QStringRef &verStr, const QString &hlFilename, const QString &hlName)
{
const auto idx = verStr.indexOf(QLatin1Char('.'));
if (idx <= 0) {
qWarning() << hlFilename << "invalid kateversion" << verStr;
m_success = false;
} else {
auto &language = m_contextMap[hlName];
language.version = {verStr.left(idx).toInt(), verStr.mid(idx + 1).toInt()};
}
}
void processElement(const QString &hlFilename, const QString &hlName, QXmlStreamReader &xml)
{
if (xml.name() == QLatin1String("context")) {
@@ -336,22 +353,28 @@ public:
if (language.existingContextNames.contains(name)) {
qWarning() << hlFilename << "Duplicate context:" << name;
m_success = false;
} else {
language.existingContextNames.insert(name);
}
if (xml.attributes().value(QLatin1String("fallthroughContext")).toString() == QLatin1String("#stay")) {
qWarning() << hlFilename << "possible infinite loop due to fallthroughContext=\"#stay\" in context " << name;
m_success = false;
}
processContext(hlName, xml.attributes().value(QLatin1String("lineEndContext")).toString());
processContext(hlName, xml.attributes().value(QLatin1String("lineEmptyContext")).toString());
processContext(hlName, xml.attributes().value(QLatin1String("fallthroughContext")).toString());
} else if (xml.name() == QLatin1String("include")) {
// <include> tag inside <list>
processVersion(hlFilename, hlName, xml, {5, 53}, QLatin1String("<include>"));
} else {
if (xml.attributes().hasAttribute(QLatin1String("context"))) {
const QString context = xml.attributes().value(QLatin1String("context")).toString();
if (context.isEmpty()) {
qWarning() << hlFilename << "Missing context name in line" << xml.lineNumber();
m_success = false;
} else {
processContext(hlName, context);
}
@@ -361,7 +384,30 @@ public:
bool check() const
{
bool success = true;
bool success = m_success;
// recursive search for the required miximal version
struct GetRequiredVersion
{
QHash<const Language*, Version> versionMap;
Version operator()(const QHash<QString, Language> &contextMap, const Language &language)
{
auto& version = versionMap[&language];
if (version < language.version) {
version = language.version;
for (auto &languageName : language.usedLanguageName) {
auto it = contextMap.find(languageName);
if (it != contextMap.end()) {
version = std::max(operator()(contextMap, *it), version);
}
}
}
return version;
};
};
GetRequiredVersion getRequiredVersion;
for (auto &language : m_contextMap) {
const auto invalidContextNames = language.usedContextNames - language.existingContextNames;
if (!invalidContextNames.isEmpty()) {
@@ -374,6 +420,12 @@ public:
qWarning() << language.hlFilename << "Unused contexts:" << unusedNames;
success = false;
}
auto requiredVersion = getRequiredVersion(m_contextMap, language);
if (language.version < requiredVersion) {
qWarning().nospace() << language.hlFilename << " depends on a language in version " << requiredVersion.majorRevision << "." << requiredVersion.minorRevision << ". Please, increase kateversion.";
success = false;
}
}
return success;
@@ -405,6 +457,7 @@ private:
} else if (list.size() == 2) {
// specific context of other language, e.g. Comment##ISO C++
m_contextMap[list[1]].usedContextNames.insert(list[0]);
m_contextMap[language].usedLanguageName.insert(list[1]);
}
return;
}
@@ -418,6 +471,34 @@ private:
}
private:
struct Version
{
int majorRevision;
int minorRevision;
Version(int majorRevision = 0, int minorRevision = 0)
: majorRevision(majorRevision)
, minorRevision(minorRevision)
{}
bool operator<(const Version &version) const
{
return majorRevision < version.majorRevision || (majorRevision == version.majorRevision && minorRevision < version.minorRevision);
}
};
void processVersion(const QString &hlFilename, const QString &hlName, QXmlStreamReader &xml, Version const& requiredVersion, QLatin1String item)
{
auto &language = m_contextMap[hlName];
if (language.version < requiredVersion) {
qWarning().nospace() << hlFilename << " " << item << " in line " << xml.lineNumber() << " is only available since version " << requiredVersion.majorRevision << "." << requiredVersion.minorRevision << ". Please, increase kateversion.";
// update the version to cancel future warnings
language.version = requiredVersion;
m_success = false;
}
}
class Language
{
public:
@@ -435,6 +516,12 @@ private:
// holds all existing context names
QSet<QString> existingContextNames;
// holds all existing language names
QSet<QString> usedLanguageName;
// kateversion language attribute
Version version;
};
/**
@@ -442,6 +529,7 @@ private:
* Example key: "Doxygen"
*/
QHash<QString, Language> m_contextMap;
bool m_success = true;
};
/**
@@ -461,6 +549,7 @@ public:
if (!name.isEmpty()) {
if (m_existingAttributeNames.contains(name)) {
qWarning() << m_filename << "itemData duplicate:" << name;
m_success = false;
} else {
m_existingAttributeNames.insert(name);
}
@@ -469,6 +558,7 @@ public:
const QString name = xml.attributes().value(QLatin1String("attribute")).toString();
if (name.isEmpty()) {
qWarning() << m_filename << "specified attribute is empty:" << xml.name();
m_success = false;
} else {
m_usedAttributeNames.insert(name);
}
@@ -477,7 +567,7 @@ public:
bool check() const
{
bool success = true;
bool success = m_success;
const auto invalidNames = m_usedAttributeNames - m_existingAttributeNames;
if (!invalidNames.isEmpty()) {
qWarning() << m_filename << "Reference of non-existing itemData attributes:" << invalidNames;
@@ -487,6 +577,7 @@ public:
auto unusedNames = m_existingAttributeNames - m_usedAttributeNames;
if (!unusedNames.isEmpty()) {
qWarning() << m_filename << "Unused itemData:" << unusedNames;
success = false;
}
return success;
@@ -496,6 +587,7 @@ private:
QString m_filename;
QSet<QString> m_usedAttributeNames;
QSet<QString> m_existingAttributeNames;
bool m_success = true;
};
}
@@ -594,8 +686,11 @@ int main(int argc, char *argv[])
AttributeChecker attributeChecker(hlFilename);
KeywordChecker keywordChecker(hlFilename);
const QString hlName = hl[QStringLiteral("name")].toString();
contextChecker.setKateVersion(xml.attributes().value(QStringLiteral("kateversion")), hlFilename, hlName);
// scan for broken regex or keywords with spaces
while (!xml.atEnd()) {
xml.readNext();

View File

@@ -69,6 +69,8 @@ if(BUILD_QCH)
LINK_QCHS
Qt5Core_QCH
Qt5Gui_QCH
INCLUDE_DIRS
${CMAKE_CURRENT_BINARY_DIR}
BLANK_MACROS
KSYNTAXHIGHLIGHTING_EXPORT
KSYNTAXHIGHLIGHTING_DEPRECATED

View File

@@ -61,10 +61,8 @@ void Context::load(QXmlStreamReader& reader)
m_attribute = reader.attributes().value(QStringLiteral("attribute")).toString();
m_lineEndContext.parse(reader.attributes().value(QStringLiteral("lineEndContext")));
m_lineEmptyContext.parse(reader.attributes().value(QStringLiteral("lineEmptyContext")));
m_fallthrough = Xml::attrToBool(reader.attributes().value(QStringLiteral("fallthrough")));
m_fallthroughContext.parse(reader.attributes().value(QStringLiteral("fallthroughContext")));
if (m_fallthroughContext.isStay())
m_fallthrough = false;
m_fallthrough = !m_fallthroughContext.isStay();
m_noIndentationBasedFolding = Xml::attrToBool(reader.attributes().value(QStringLiteral("noIndentationBasedFolding")));
reader.readNext();

View File

@@ -39,7 +39,6 @@
#include "xml_p.h"
#include <QCoreApplication>
#include <QDebug>
#include <QFile>
#include <QHash>
#include <QJsonObject>
@@ -234,6 +233,19 @@ QStringList Definition::keywordList(const QString& name) const
return list ? list->keywords() : QStringList();
}
bool Definition::setKeywordList(const QString& name, const QStringList& content)
{
d->load(DefinitionData::OnlyKeywords(true));
KeywordList* list = d->keywordList(name);
if (list)
{
list->setKeywordList(content);
return true;
}
else
return false;
}
QVector<Format> Definition::formats() const
{
d->load();

View File

@@ -26,9 +26,8 @@
#include "ksyntaxhighlighting_export.h"
#include <QTypeInfo>
#include <QPair>
#include <QVector>
#include <memory>
QT_BEGIN_NAMESPACE
@@ -329,10 +328,28 @@ public:
/**
* Returns the list of keywords for the keyword list @p name.
* @since 5.49
* @see keywordLists()
* @see keywordLists(), setKeywordList()
*/
QStringList keywordList(const QString& name) const;
/**
* Set the contents of the keyword list @p name to @p content.
* Only existing keywordLists() can be changed. For non-existent keyword lists,
* false is returned.
*
* Whenever you change a keyword list, make sure to trigger a rehighlight of
* your documents. In case you are using QSyntaxHighlighter via SyntaxHighlighter,
* this can be done by calling SyntaxHighlighter::rehighlight().
*
* @note In general, changing keyword lists via setKeywordList() is discouraged,
* since if a keyword list name in the syntax highlighting definition
* file changes, the call setKeywordList() may suddenly fail.
*
* @see keywordList(), keywordLists()
* @since 5.62
*/
bool setKeywordList(const QString& name, const QStringList& content);
/**
* Returns a list of all Format items used by this definition.
* The order of the Format items equals the order of the itemDatas in the xml file.

View File

@@ -101,7 +101,7 @@ public:
QVector<QPair<QChar, QString>> characterEncodings;
QString fileName;
QString name = QStringLiteral(QT_TRANSLATE_NOOP("Syntax highlighting", "None"));
QString name = QStringLiteral(QT_TRANSLATE_NOOP("Language", "None"));
QString section;
QString style;
QString indenter;

View File

@@ -27,7 +27,6 @@
#include "ksyntaxhighlighting_logging.h"
#include "ksyntaxhighlighting_version.h"
#include <QDebug>
#include <QDir>
#include <QFile>
#include <QNetworkAccessManager>

View File

@@ -30,7 +30,6 @@
#include "xml_p.h"
#include <QColor>
#include <QDebug>
#include <QMetaEnum>
#include <QXmlStreamReader>
@@ -207,6 +206,46 @@ bool Format::spellCheck() const
return d->spellCheck;
}
bool Format::hasBoldOverride() const
{
return d->style.hasBold;
}
bool Format::hasItalicOverride() const
{
return d->style.hasItalic;
}
bool Format::hasUnderlineOverride() const
{
return d->style.hasUnderline;
}
bool Format::hasStrikeThroughOverride() const
{
return d->style.hasStrikeThrough;
}
bool Format::hasTextColorOverride() const
{
return d->style.textColor;
}
bool Format::hasBackgroundColorOverride() const
{
return d->style.backgroundColor;
}
bool Format::hasSelectedTextColorOverride() const
{
return d->style.selectedTextColor;
}
bool Format::hasSelectedBackgroundColorOverride() const
{
return d->style.selectedBackgroundColor;
}
void FormatPrivate::load(QXmlStreamReader& reader)
{

View File

@@ -28,7 +28,6 @@
#include "theme.h"
#include <QExplicitlySharedDataPointer>
#include <QTypeInfo>
QT_BEGIN_NAMESPACE
class QColor;
@@ -139,6 +138,70 @@ public:
*/
bool spellCheck() const;
/** Returns @c true if the syntax definition file sets a value for the bold text
* attribute and, therefore, overrides the theme and the default formatting
* style. If the return is @p true, this value is obtained by isBold().
* @see isBold()
* @since 5.62
*/
bool hasBoldOverride() const;
/** Returns @c true if the syntax definition file sets a value for the italic text
* attribute and, therefore, overrides the theme and the default formatting style.
* If the return is @p true, this value is obtained by isItalic().
* @see isItalic()
* @since 5.62
*/
bool hasItalicOverride() const;
/** Returns @c true if the syntax definition file sets a value for the underlined
* text attribute and, therefore, overrides the theme and the default formatting
* style. If the return is @p true, this value is obtained by isUnderline().
* @see isUnderline()
* @since 5.62
*/
bool hasUnderlineOverride() const;
/** Returns @c true if the syntax definition file specifies a value for the
* struck through text attribute. If the return is @p true, this value
* is obtained by isStrikeThrough().
* @see isStrikeThrough()
* @since 5.62
*/
bool hasStrikeThroughOverride() const;
/** Returns @c true if the syntax definition file sets a value for the foreground
* text color attribute and, therefore, overrides the theme and the default formatting
* style. If the return is @p true, this value is obtained by textColor().
* @see textColor(), hasTextColor()
* @since 5.62
*/
bool hasTextColorOverride() const;
/** Returns @c true if the syntax definition file sets a value for the background
* color attribute and, therefore, overrides the theme and the default formatting
* style. If the return is @p true, this value is obtained by backgroundColor().
* @see backgroundColor(), hasBackgroundColor()
* @since 5.62
*/
bool hasBackgroundColorOverride() const;
/** Returns @c true if the syntax definition file specifies a value for the
* selected text color attribute. If the return is @p true, this value is
* obtained by selectedTextColor().
* @see selectedTextColor()
* @since 5.62
*/
bool hasSelectedTextColorOverride() const;
/** Returns @c true if the syntax definition file specifies a value for the
* selected background color attribute. If the return is @p true, this
* value is obtained by selectedBackgroundColor().
* @see selectedBackgroundColor()
* @since 5.62
*/
bool hasSelectedBackgroundColorOverride() const;
private:
friend class FormatPrivate;
QExplicitlySharedDataPointer<FormatPrivate> d;

View File

@@ -29,7 +29,6 @@
#include "theme.h"
#include "ksyntaxhighlighting_logging.h"
#include <QDebug>
#include <QFile>
#include <QFileInfo>
#include <QTextStream>

View File

@@ -26,7 +26,6 @@
#include "definition_p.h"
#include "ksyntaxhighlighting_logging.h"
#include <QDebug>
#include <QXmlStreamReader>
#include <algorithm>

View File

@@ -24,9 +24,8 @@
#ifndef KSYNTAXHIGHLIGHTING_KEYWORDLIST_P_H
#define KSYNTAXHIGHLIGHTING_KEYWORDLIST_P_H
#include <QSet>
#include <QString>
#include <QVector>
#include <QStringList>
#include <vector>
@@ -60,6 +59,14 @@ public:
return m_keywords;
}
void setKeywordList(const QStringList& keywords)
{
m_keywords = keywords;
m_keywordsSortedCaseSensitive.clear();
m_keywordsSortedCaseInsensitive.clear();
initLookupForCaseSensitivity(m_caseSensitive);
}
/** Checks if @p str is a keyword in this list. */
bool contains(const QStringRef &str) const
{

View File

@@ -30,7 +30,6 @@
#include "ksyntaxhighlighting_logging.h"
#include "wildcardmatcher_p.h"
#include <QDebug>
#include <QDirIterator>
#include <QFile>
#include <QFileInfo>

View File

@@ -101,9 +101,6 @@ Definition Rule::definition() const
void Rule::setDefinition(const Definition &def)
{
m_def = def;
// cache for DefinitionData::wordDelimiters, is accessed VERY often
m_wordDelimiter = &DefinitionData::get(m_def.definition())->wordDelimiters;
}
bool Rule::load(QXmlStreamReader &reader)
@@ -140,6 +137,9 @@ bool Rule::load(QXmlStreamReader &reader)
void Rule::resolveContext()
{
m_context.resolve(m_def.definition());
// cache for DefinitionData::wordDelimiters, is accessed VERY often
m_wordDelimiter = &DefinitionData::get(m_def.definition())->wordDelimiters;
}
void Rule::resolveAttributeFormat(Context *lookupContext)
@@ -612,8 +612,10 @@ MatchResult RegExpr::doMatch(const QString& text, int offset, const QStringList
/**
* no match
* the pattern of a dynamic regex depends on the previous contexts
* so that skipOffset cannot be computed
*/
return MatchResult(offset, result.capturedStart());
return MatchResult(offset, m_dynamic ? 0 : result.capturedStart());
}
@@ -650,13 +652,17 @@ MatchResult WordDetect::doMatch(const QString& text, int offset, const QStringLi
if (text.size() - offset < m_word.size())
return offset;
if (offset > 0 && !isWordDelimiter(text.at(offset - 1)))
/**
* detect delimiter characters on the inner and outer boundaries of the string
* NOTE: m_word isn't empty
*/
if (offset > 0 && !isWordDelimiter(text.at(offset - 1)) && !isWordDelimiter(text.at(offset)))
return offset;
if (text.midRef(offset, m_word.size()).compare(m_word, m_caseSensitivity) != 0)
return offset;
if (text.size() == offset + m_word.size() || isWordDelimiter(text.at(offset + m_word.size())))
if (text.size() == offset + m_word.size() || isWordDelimiter(text.at(offset + m_word.size())) || isWordDelimiter(text.at(offset + m_word.size() - 1)))
return offset + m_word.size();
return offset;

View File

@@ -34,7 +34,6 @@
#include <QRegularExpression>
#include <QString>
#include <QVector>
#include <memory>

View File

@@ -27,7 +27,6 @@
#include "ksyntaxhighlighting_export.h"
#include <QExplicitlySharedDataPointer>
#include <QTypeInfo>
namespace KSyntaxHighlighting {

View File

@@ -29,7 +29,6 @@
#include "state.h"
#include "theme.h"
#include <QDebug>
Q_DECLARE_METATYPE(QTextBlock)

View File

@@ -24,7 +24,6 @@
#ifndef KSYNTAXHIGHLIGHTING_TEXTSTYLEDATA_P_H
#define KSYNTAXHIGHLIGHTING_TEXTSTYLEDATA_P_H
#include <QColor>
namespace KSyntaxHighlighting {

View File

@@ -32,7 +32,6 @@
#include <QJsonValue>
#include <QMetaEnum>
#include <QDebug>
using namespace KSyntaxHighlighting;