KSyntaxHighlighter: Sync with original repository

from commit ff67bbbeff62d8b91b83d74c0c27dfee00f39a00.

CMakeLists.txt excluded.

Task-number: QTCREATORBUG-22558
Change-Id: I405e23e63483aa9a7e2daf899a335bd71e1b036e
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Orgad Shaneh
2020-04-28 14:20:36 +03:00
committed by Orgad Shaneh
parent 5d9d0b876a
commit 8542699b89
64 changed files with 1110 additions and 1260 deletions

View File

@@ -9,4 +9,5 @@ callgrind.*
heaptrack.* heaptrack.*
/build*/ /build*/
*.unc-backup* *.unc-backup*
.clang-format
.cmake/

View File

@@ -1,6 +1,8 @@
@PACKAGE_INIT@ @PACKAGE_INIT@
find_package(Qt5 @Qt5Core_VERSION_MAJOR@.@Qt5Core_VERSION_MINOR@ NO_MODULE REQUIRED COMPONENTS Core Gui) include(CMakeFindDependencyMacro)
find_dependency(Qt5Core @REQUIRED_QT_VERSION@)
find_dependency(Qt5Gui @REQUIRED_QT_VERSION@)
include("${CMAKE_CURRENT_LIST_DIR}/KF5SyntaxHighlightingTargets.cmake") include("${CMAKE_CURRENT_LIST_DIR}/KF5SyntaxHighlightingTargets.cmake")
@PACKAGE_INCLUDE_QCHTARGETS@ @PACKAGE_INCLUDE_QCHTARGETS@

View File

@@ -1,22 +1,28 @@
# generate PHP definitions # generate PHP definitions
macro(generate_php_syntax_definition targetFile srcFile) macro(generate_php_syntax_definition targetFile srcFile)
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/syntax) execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/generated/syntax)
execute_process(COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/generators/generate-php.pl execute_process(COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/generators/generate-php.pl
INPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/syntax/${srcFile} INPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/syntax/${srcFile}
OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/syntax/${targetFile}) OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/generated/syntax/${targetFile})
endmacro() endmacro()
generate_php_syntax_definition(javascript-php.xml javascript.xml) generate_php_syntax_definition(javascript-php.xml javascript.xml)
generate_php_syntax_definition(css-php.xml css.xml) generate_php_syntax_definition(css-php.xml css.xml)
generate_php_syntax_definition(html-php.xml html.xml) generate_php_syntax_definition(html-php.xml html.xml)
generate_php_syntax_definition(javascript-react-php.xml javascript-react.xml)
generate_php_syntax_definition(typescript-php.xml typescript.xml)
generate_php_syntax_definition(mustache-php.xml mustache.xml)
# find all definitions # find all definitions
file(GLOB src_defs "${CMAKE_CURRENT_SOURCE_DIR}/syntax/*.xml") file(GLOB src_defs "${CMAKE_CURRENT_SOURCE_DIR}/syntax/*.xml")
set(defs set(defs
${src_defs} ${src_defs}
${CMAKE_CURRENT_BINARY_DIR}/syntax/html-php.xml ${CMAKE_CURRENT_BINARY_DIR}/generated/syntax/html-php.xml
${CMAKE_CURRENT_BINARY_DIR}/syntax/css-php.xml ${CMAKE_CURRENT_BINARY_DIR}/generated/syntax/css-php.xml
${CMAKE_CURRENT_BINARY_DIR}/syntax/javascript-php.xml ${CMAKE_CURRENT_BINARY_DIR}/generated/syntax/javascript-php.xml
${CMAKE_CURRENT_BINARY_DIR}/generated/syntax/javascript-react-php.xml
${CMAKE_CURRENT_BINARY_DIR}/generated/syntax/typescript-php.xml
${CMAKE_CURRENT_BINARY_DIR}/generated/syntax/mustache-php.xml
) )
# theme data resource # theme data resource
@@ -58,4 +64,8 @@ else()
endif() endif()
# set PIC to allow use in static and shared libs # set PIC to allow use in static and shared libs
# this needs some more recent CMake than generally required
set_property(TARGET SyntaxHighlightingData PROPERTY POSITION_INDEPENDENT_CODE 1) set_property(TARGET SyntaxHighlightingData PROPERTY POSITION_INDEPENDENT_CODE 1)
if(NOT ${CMAKE_VERSION} VERSION_LESS "3.13.0")
target_link_libraries(SyntaxHighlightingData PRIVATE Qt5::Core)
endif()

View File

@@ -9,7 +9,7 @@
Copyright 2004 Alexander Neundorf (neundorf@kde.org) Copyright 2004 Alexander Neundorf (neundorf@kde.org)
Copyright 2005 Dominik Haumann (dhdev@gmx.de) Copyright 2005 Dominik Haumann (dhdev@gmx.de)
Copyright 2007,2008,2013,2014 Matthew Woehlke (mw_triad@users.sourceforge.net) Copyright 2007,2008,2013,2014 Matthew Woehlke (mw_triad@users.sourceforge.net)
Copyright 2013-2015,2017-2019 Alex Turbov (i.zaufi@gmail.com) Copyright 2013-2015,2017-2020 Alex Turbov (i.zaufi@gmail.com)
********************************************************************** **********************************************************************
* This library is free software; you can redistribute it and/or * * This library is free software; you can redistribute it and/or *
@@ -31,7 +31,7 @@
<language <language
name="CMake" name="CMake"
version="16" version="22"
kateversion="2.4" kateversion="2.4"
section="Other" section="Other"
extensions="CMakeLists.txt;*.cmake;*.cmake.in" extensions="CMakeLists.txt;*.cmake;*.cmake.in"
@@ -191,9 +191,9 @@
</context> </context>
<context attribute="Normal Text" lineEndContext="#stay" name="Detect Builtin Variables"> <context attribute="Normal Text" lineEndContext="#stay" name="Detect Builtin Variables">
<RegExpr attribute="Internal Name" context="#stay" String="\b_&id_re;\b" />
<keyword attribute="Builtin Variable" context="#stay" String="variables" insensitive="false" /> <keyword attribute="Builtin Variable" context="#stay" String="variables" insensitive="false" />
<IncludeRules context="Detect More Builtin Variables" /> <IncludeRules context="Detect More Builtin Variables" />
<RegExpr attribute="Internal Name" context="#stay" String="\b_&id_re;\b" />
</context> </context>
<context attribute="Normal Text" lineEndContext="#stay" name="Detect More Builtin Variables"> <context attribute="Normal Text" lineEndContext="#stay" name="Detect More Builtin Variables">
@@ -278,6 +278,7 @@
</context> </context>
<context attribute="Comment" lineEndContext="#stay" name="Bracketed Comment" dynamic="true"> <context attribute="Comment" lineEndContext="#stay" name="Bracketed Comment" dynamic="true">
<LineContinue attribute="Comment" context="#stay" />
<RegExpr attribute="Comment" context="#pop" String=".*\]%1\]" dynamic="true" /> <RegExpr attribute="Comment" context="#pop" String=".*\]%1\]" dynamic="true" />
<IncludeRules context="##Alerts" /> <IncludeRules context="##Alerts" />
<IncludeRules context="##Modelines" /> <IncludeRules context="##Modelines" />

View File

@@ -6,6 +6,7 @@ global-properties:
- AUTOMOC_TARGETS_FOLDER - AUTOMOC_TARGETS_FOLDER
- AUTORCC_SOURCE_GROUP - AUTORCC_SOURCE_GROUP
- CMAKE_C_KNOWN_FEATURES - CMAKE_C_KNOWN_FEATURES
- CMAKE_CUDA_KNOWN_FEATURES # Since 3.17
- CMAKE_CXX_KNOWN_FEATURES - CMAKE_CXX_KNOWN_FEATURES
- CMAKE_ROLE # Since 3.14 - CMAKE_ROLE # Since 3.14
- DEBUG_CONFIGURATIONS - DEBUG_CONFIGURATIONS
@@ -81,6 +82,7 @@ directory-properties:
# NOTE Copy-n-pasting this list from official docs may contain a redudant item `Example`! Check it! # NOTE Copy-n-pasting this list from official docs may contain a redudant item `Example`! Check it!
target-properties: target-properties:
- ADDITIONAL_CLEAN_FILES # Since 3.15 - ADDITIONAL_CLEAN_FILES # Since 3.15
- AIX_EXPORT_ALL_SYMBOLS # Since 3.17
- ALIASED_TARGET - ALIASED_TARGET
- ANDROID_ANT_ADDITIONAL_OPTIONS - ANDROID_ANT_ADDITIONAL_OPTIONS
- ANDROID_API - ANDROID_API
@@ -111,6 +113,7 @@ target-properties:
- AUTOMOC_EXECUTABLE # Since 3.14 - AUTOMOC_EXECUTABLE # Since 3.14
- AUTOMOC_MACRO_NAMES - AUTOMOC_MACRO_NAMES
- AUTOMOC_MOC_OPTIONS # Since ??? - AUTOMOC_MOC_OPTIONS # Since ???
- AUTOMOC_PATH_PREFIX # Since 3.16
- AUTOMOC - AUTOMOC
- AUTOUIC - AUTOUIC
- AUTOUIC_EXECUTABLE # Since 3.14 - AUTOUIC_EXECUTABLE # Since 3.14
@@ -148,6 +151,7 @@ target-properties:
- CUDA_PTX_COMPILATION - CUDA_PTX_COMPILATION
- CUDA_SEPARABLE_COMPILATION - CUDA_SEPARABLE_COMPILATION
- CUDA_RESOLVE_DEVICE_SYMBOLS - CUDA_RESOLVE_DEVICE_SYMBOLS
- CUDA_RUNTIME_LIBRARY # Since 3.17
- CUDA_EXTENSIONS - CUDA_EXTENSIONS
- CUDA_STANDARD - CUDA_STANDARD
- CUDA_STANDARD_REQUIRED - CUDA_STANDARD_REQUIRED
@@ -158,6 +162,9 @@ target-properties:
- DEFINE_SYMBOL - DEFINE_SYMBOL
- DEPLOYMENT_ADDITIONAL_FILES # Since 3.13 - DEPLOYMENT_ADDITIONAL_FILES # Since 3.13
- DEPLOYMENT_REMOTE_DIRECTORY - DEPLOYMENT_REMOTE_DIRECTORY
- DEPRECATION # Since 3.17
- DISABLE_PRECOMPILE_HEADERS # Since 3.16
- DOTNET_TARGET_FRAMEWORK # Since 3.17
- DOTNET_TARGET_FRAMEWORK_VERSION # Since 3.12 - DOTNET_TARGET_FRAMEWORK_VERSION # Since 3.12
- EchoString - EchoString
- ENABLE_EXPORTS - ENABLE_EXPORTS
@@ -203,6 +210,7 @@ target-properties:
- IMPORT_SUFFIX - IMPORT_SUFFIX
- INCLUDE_DIRECTORIES - INCLUDE_DIRECTORIES
- INSTALL_NAME_DIR - INSTALL_NAME_DIR
- INSTALL_REMOVE_ENVIRONMENT_RPATH # Since 3.16
- INSTALL_RPATH - INSTALL_RPATH
- INSTALL_RPATH_USE_LINK_PATH - INSTALL_RPATH_USE_LINK_PATH
- INTERFACE_AUTOUIC_OPTIONS - INTERFACE_AUTOUIC_OPTIONS
@@ -214,6 +222,7 @@ target-properties:
- INTERFACE_LINK_DIRECTORIES # Since 3.13 - INTERFACE_LINK_DIRECTORIES # Since 3.13
- INTERFACE_LINK_LIBRARIES - INTERFACE_LINK_LIBRARIES
- INTERFACE_LINK_OPTIONS # Since 3.13 - INTERFACE_LINK_OPTIONS # Since 3.13
- INTERFACE_PRECOMPILE_HEADERS # Since 3.16
- INTERFACE_POSITION_INDEPENDENT_CODE - INTERFACE_POSITION_INDEPENDENT_CODE
- INTERFACE_SOURCES - INTERFACE_SOURCES
- INTERFACE_SYSTEM_INCLUDE_DIRECTORIES - INTERFACE_SYSTEM_INCLUDE_DIRECTORIES
@@ -262,6 +271,8 @@ target-properties:
- NO_SYSTEM_FROM_IMPORTED - NO_SYSTEM_FROM_IMPORTED
- OSX_ARCHITECTURES_<CONFIG> - OSX_ARCHITECTURES_<CONFIG>
- OSX_ARCHITECTURES - OSX_ARCHITECTURES
- OSX_CURRENT_VERSION # Since 3.17
- OSX_COMPATIBILITY_VERSION # Since 3.17
- OUTPUT_NAME_<CONFIG> - OUTPUT_NAME_<CONFIG>
- OUTPUT_NAME - OUTPUT_NAME
- PDB_NAME_<CONFIG> - PDB_NAME_<CONFIG>
@@ -269,6 +280,8 @@ target-properties:
- PDB_OUTPUT_DIRECTORY_<CONFIG> - PDB_OUTPUT_DIRECTORY_<CONFIG>
- PDB_OUTPUT_DIRECTORY - PDB_OUTPUT_DIRECTORY
- POSITION_INDEPENDENT_CODE - POSITION_INDEPENDENT_CODE
- PRECOMPILE_HEADERS # Since 3.16
- PRECOMPILE_HEADERS_REUSE_FROM # Since 3.16
- PREFIX - PREFIX
- PRIVATE_HEADER - PRIVATE_HEADER
- PROJECT_LABEL - PROJECT_LABEL
@@ -293,6 +306,10 @@ target-properties:
- Swift_MODULE_DIRECTORY # Since 3.15 - Swift_MODULE_DIRECTORY # Since 3.15
- Swift_MODULE_NAME # Since 3.15 - Swift_MODULE_NAME # Since 3.15
- TYPE - TYPE
- UNITY_BUILD # Since 3.16
- UNITY_BUILD_BATCH_SIZE # Since 3.16
- UNITY_BUILD_CODE_AFTER_INCLUDE # Since 3.16
- UNITY_BUILD_CODE_BEFORE_INCLUDE # Since 3.16
- VERSION - VERSION
- VISIBILITY_INLINES_HIDDEN - VISIBILITY_INLINES_HIDDEN
- VS_CONFIGURATION_TYPE - VS_CONFIGURATION_TYPE
@@ -306,6 +323,8 @@ target-properties:
- VS_DOTNET_REFERENCES - VS_DOTNET_REFERENCES
- VS_DOTNET_REFERENCES_COPY_LOCAL - VS_DOTNET_REFERENCES_COPY_LOCAL
- VS_DOTNET_TARGET_FRAMEWORK_VERSION - VS_DOTNET_TARGET_FRAMEWORK_VERSION
- VS_DOTNET_DOCUMENTATION_FILE # Since 3.17
- VS_DPI_AWARE # Since 3.16
- VS_GLOBAL_KEYWORD - VS_GLOBAL_KEYWORD
- VS_GLOBAL_PROJECT_TYPES - VS_GLOBAL_PROJECT_TYPES
- VS_GLOBAL_ROOTNAMESPACE - VS_GLOBAL_ROOTNAMESPACE
@@ -339,21 +358,23 @@ target-properties:
- XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN # Since 3.13 - XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN # Since 3.13
- XCODE_SCHEME_ARGUMENTS # Since 3.13 - XCODE_SCHEME_ARGUMENTS # Since 3.13
- XCODE_SCHEME_DEBUG_AS_ROOT # Since 3.15 - XCODE_SCHEME_DEBUG_AS_ROOT # Since 3.15
- XCODE_SCHEME_THREAD_SANITIZER # Since 3.13 - XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING # Since 3.16
- XCODE_SCHEME_THREAD_SANITIZER_STOP # Since 3.13
- XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER # Since 3.13
- XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP # Since 3.13
- XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER # Since 3.13 - XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER # Since 3.13
- XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP # Since 3.13
- XCODE_SCHEME_MALLOC_SCRIBBLE # Since 3.13
- XCODE_SCHEME_MALLOC_GUARD_EDGES # Since 3.13
- XCODE_SCHEME_GUARD_MALLOC # Since 3.13
- XCODE_SCHEME_ZOMBIE_OBJECTS # Since 3.13
- XCODE_SCHEME_MALLOC_STACK # Since 3.13
- XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE # Since 3.13 - XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE # Since 3.13
- XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS # Since 3.13 - XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS # Since 3.13
- XCODE_SCHEME_EXECUTABLE # Since 3.13 - XCODE_SCHEME_EXECUTABLE # Since 3.13
- XCODE_SCHEME_ENVIRONMENT # Since 3.13 - XCODE_SCHEME_ENVIRONMENT # Since 3.13
- XCODE_SCHEME_GUARD_MALLOC # Since 3.13
- XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP # Since 3.13
- XCODE_SCHEME_MALLOC_GUARD_EDGES # Since 3.13
- XCODE_SCHEME_MALLOC_SCRIBBLE # Since 3.13
- XCODE_SCHEME_MALLOC_STACK # Since 3.13
- XCODE_SCHEME_THREAD_SANITIZER # Since 3.13
- XCODE_SCHEME_THREAD_SANITIZER_STOP # Since 3.13
- XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER # Since 3.13
- XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP # Since 3.13
- XCODE_SCHEME_WORKING_DIRECTORY # Since 3.1?
- XCODE_SCHEME_ZOMBIE_OBJECTS # Since 3.13
- XCTEST - XCTEST
test-properties: test-properties:
@@ -375,6 +396,7 @@ test-properties:
- REQUIRED_FILES - REQUIRED_FILES
- RESOURCE_LOCK - RESOURCE_LOCK
- RUN_SERIAL - RUN_SERIAL
- SKIP_REGULAR_EXPRESSION # Since 3.16
- SKIP_RETURN_CODE - SKIP_RETURN_CODE
- TIMEOUT - TIMEOUT
- TIMEOUT_AFTER_MATCH - TIMEOUT_AFTER_MATCH
@@ -404,6 +426,8 @@ source-properties:
- SKIP_AUTOMOC - SKIP_AUTOMOC
- SKIP_AUTORCC - SKIP_AUTORCC
- SKIP_AUTOUIC - SKIP_AUTOUIC
- SKIP_PRECOMPILE_HEADERS # Since 3.16
- SKIP_UNITY_BUILD_INCLUSION # Since 3.16
- Swift_DEPENDENCIES_FILE # Since 3.15 - Swift_DEPENDENCIES_FILE # Since 3.15
- Swift_DIAGNOSTICS_FILE # Since 3.15 - Swift_DIAGNOSTICS_FILE # Since 3.15
- SYMBOLIC - SYMBOLIC
@@ -547,22 +571,29 @@ variables:
- CMAKE_CROSSCOMPILING_EMULATOR - CMAKE_CROSSCOMPILING_EMULATOR
- CMAKE_CTEST_COMMAND - CMAKE_CTEST_COMMAND
- CMAKE_CURRENT_BINARY_DIR - CMAKE_CURRENT_BINARY_DIR
- CMAKE_CURRENT_FUNCTION # Since 3.17
- CMAKE_CURRENT_FUNCTION_LIST_DIR # Since 3.17
- CMAKE_CURRENT_FUNCTION_LIST_FILE # Since 3.17
- CMAKE_CURRENT_FUNCTION_LIST_LINE # Since 3.17
- CMAKE_CURRENT_LIST_DIR - CMAKE_CURRENT_LIST_DIR
- CMAKE_CURRENT_LIST_FILE - CMAKE_CURRENT_LIST_FILE
- CMAKE_CURRENT_LIST_LINE - CMAKE_CURRENT_LIST_LINE
- CMAKE_CURRENT_SOURCE_DIR - CMAKE_CURRENT_SOURCE_DIR
- CMAKE_DIRECTORY_LABELS # Since 3.10 - CMAKE_DIRECTORY_LABELS # Since 3.10
- CMAKE_DL_LIBS - CMAKE_DL_LIBS
- CMAKE_DOTNET_TARGET_FRAMEWORK # Since 3.17
- CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION # Since 3.12 - CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION # Since 3.12
- CMAKE_EDIT_COMMAND - CMAKE_EDIT_COMMAND
- CMAKE_EXECUTABLE_SUFFIX - CMAKE_EXECUTABLE_SUFFIX
- CMAKE_EXTRA_GENERATOR - CMAKE_EXTRA_GENERATOR
- CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES - CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES
- CMAKE_FIND_DEBUG_MODE # Since 3.17
- CMAKE_FIND_PACKAGE_NAME - CMAKE_FIND_PACKAGE_NAME
- CMAKE_FIND_PACKAGE_SORT_DIRECTION - CMAKE_FIND_PACKAGE_SORT_DIRECTION
- CMAKE_FIND_PACKAGE_SORT_ORDER - CMAKE_FIND_PACKAGE_SORT_ORDER
- CMAKE_GENERATOR - CMAKE_GENERATOR
- CMAKE_GENERATOR_INSTANCE # Since 3.11 - CMAKE_GENERATOR_INSTANCE # Since 3.11
- CMAKE_GENERATOR_NO_COMPILER_ENV # "Professional CMake" §17.4
- CMAKE_GENERATOR_PLATFORM - CMAKE_GENERATOR_PLATFORM
- CMAKE_GENERATOR_TOOLSET - CMAKE_GENERATOR_TOOLSET
- CMAKE_HOME_DIRECTORY - CMAKE_HOME_DIRECTORY
@@ -580,6 +611,10 @@ variables:
- CMAKE_MAKE_PROGRAM - CMAKE_MAKE_PROGRAM
- CMAKE_MATCH_COUNT - CMAKE_MATCH_COUNT
- CMAKE_MATCH_<n> - CMAKE_MATCH_<n>
- CMAKE_MESSAGE_CONTEXT # Since 3.17
- CMAKE_MESSAGE_CONTEXT_SHOW # Since 3.17
- CMAKE_MESSAGE_INDENT # Since 3.16
- CMAKE_MESSAGE_LOG_LEVEL # Since 3.17
- CMAKE_MINIMUM_REQUIRED_VERSION - CMAKE_MINIMUM_REQUIRED_VERSION
- CMAKE_MINOR_VERSION - CMAKE_MINOR_VERSION
- CMAKE_NETRC # Since 3.11 - CMAKE_NETRC # Since 3.11
@@ -658,6 +693,7 @@ variables:
- CMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES - CMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES
- CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT - CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT
- CMAKE_ECLIPSE_MAKE_ARGUMENTS - CMAKE_ECLIPSE_MAKE_ARGUMENTS
- CMAKE_ECLIPSE_RESOURCE_ENCODING # Since 3.16
- CMAKE_ECLIPSE_VERSION - CMAKE_ECLIPSE_VERSION
- CMAKE_ERROR_DEPRECATED - CMAKE_ERROR_DEPRECATED
- CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION - CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION
@@ -671,7 +707,7 @@ variables:
- CMAKE_FIND_LIBRARY_PREFIXES - CMAKE_FIND_LIBRARY_PREFIXES
- CMAKE_FIND_LIBRARY_SUFFIXES - CMAKE_FIND_LIBRARY_SUFFIXES
- CMAKE_FIND_NO_INSTALL_PREFIX - CMAKE_FIND_NO_INSTALL_PREFIX
- CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY - CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY # Deprecated since 3.16
- CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY - CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY
- CMAKE_FIND_PACKAGE_PREFER_CONFIG # Since 3.15 - CMAKE_FIND_PACKAGE_PREFER_CONFIG # Since 3.15
- CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS # Since 3.14 - CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS # Since 3.14
@@ -681,6 +717,13 @@ variables:
- CMAKE_FIND_ROOT_PATH_MODE_LIBRARY - CMAKE_FIND_ROOT_PATH_MODE_LIBRARY
- CMAKE_FIND_ROOT_PATH_MODE_PACKAGE - CMAKE_FIND_ROOT_PATH_MODE_PACKAGE
- CMAKE_FIND_ROOT_PATH_MODE_PROGRAM - CMAKE_FIND_ROOT_PATH_MODE_PROGRAM
- CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH # Since 3.16
- CMAKE_FIND_USE_CMAKE_PATH # Since 3.16
- CMAKE_FIND_USE_CMAKE_SYSTEM_PATH # Since 3.16
- CMAKE_FIND_USE_PACKAGE_ROOT_PATH # Since 3.16
- CMAKE_FIND_USE_PACKAGE_REGISTRY # Since 3.16
- CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH # Since 3.16
- CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY # Since 3.16
- CMAKE_FRAMEWORK_PATH - CMAKE_FRAMEWORK_PATH
- CMAKE_IGNORE_PATH - CMAKE_IGNORE_PATH
- CMAKE_INCLUDE_DIRECTORIES_BEFORE - CMAKE_INCLUDE_DIRECTORIES_BEFORE
@@ -725,19 +768,22 @@ variables:
- CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY # Since 3.13 - CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY # Since 3.13
- CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER # Since 3.13 - CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER # Since 3.13
- CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN # Since 3.13 - CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN # Since 3.13
- CMAKE_XCODE_SCHEME_WORKING_DIRECTORY # Since 3.1?
- CMAKE_XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING # Since 3.16
- CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER # Since 3.13
- CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE # Since 3.13
- CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS # Since 3.13
- CMAKE_XCODE_SCHEME_ENVIRONMENT # Since 3.17
- CMAKE_XCODE_SCHEME_GUARD_MALLOC # Since 3.13
- CMAKE_XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP # Since 3.13
- CMAKE_XCODE_SCHEME_MALLOC_GUARD_EDGES # Since 3.13
- CMAKE_XCODE_SCHEME_MALLOC_SCRIBBLE # Since 3.13
- CMAKE_XCODE_SCHEME_MALLOC_STACK # Since 3.13
- CMAKE_XCODE_SCHEME_THREAD_SANITIZER # Since 3.13 - CMAKE_XCODE_SCHEME_THREAD_SANITIZER # Since 3.13
- CMAKE_XCODE_SCHEME_THREAD_SANITIZER_STOP # Since 3.13 - CMAKE_XCODE_SCHEME_THREAD_SANITIZER_STOP # Since 3.13
- CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER # Since 3.13 - CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER # Since 3.13
- CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP # Since 3.13 - CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP # Since 3.13
- CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER # Since 3.13
- CMAKE_XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP # Since 3.13
- CMAKE_XCODE_SCHEME_MALLOC_SCRIBBLE # Since 3.13
- CMAKE_XCODE_SCHEME_MALLOC_GUARD_EDGES # Since 3.13
- CMAKE_XCODE_SCHEME_GUARD_MALLOC # Since 3.13
- CMAKE_XCODE_SCHEME_ZOMBIE_OBJECTS # Since 3.13 - CMAKE_XCODE_SCHEME_ZOMBIE_OBJECTS # Since 3.13
- CMAKE_XCODE_SCHEME_MALLOC_STACK # Since 3.13
- CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE # Since 3.13
- CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS # Since 3.13
- CMAKE_SUPPRESS_DEVELOPER_WARNINGS # Undocumented yet (CMake <= 3.10) - CMAKE_SUPPRESS_DEVELOPER_WARNINGS # Undocumented yet (CMake <= 3.10)
- CMAKE_SUPPRESS_DEVELOPER_ERRORS # Undocumented yet (CMake <= 3.10) - CMAKE_SUPPRESS_DEVELOPER_ERRORS # Undocumented yet (CMake <= 3.10)
# Variables that Describe the System # Variables that Describe the System
@@ -787,6 +833,7 @@ variables:
- XCODE - XCODE
- XCODE_VERSION - XCODE_VERSION
# Variables that Control the Build # Variables that Control the Build
- CMAKE_AIX_EXPORT_ALL_SYMBOLS # Since 3.17
- CMAKE_ANDROID_ANT_ADDITIONAL_OPTIONS - CMAKE_ANDROID_ANT_ADDITIONAL_OPTIONS
- CMAKE_ANDROID_API - CMAKE_ANDROID_API
- CMAKE_ANDROID_API_MIN - CMAKE_ANDROID_API_MIN
@@ -820,6 +867,7 @@ variables:
- CMAKE_AUTOMOC - CMAKE_AUTOMOC
- CMAKE_AUTOMOC_DEPEND_FILTERS - CMAKE_AUTOMOC_DEPEND_FILTERS
- CMAKE_AUTOMOC_MOC_OPTIONS - CMAKE_AUTOMOC_MOC_OPTIONS
- CMAKE_AUTOMOC_PATH_PREFIX # Since 3.16
- CMAKE_AUTORCC - CMAKE_AUTORCC
- CMAKE_AUTORCC_OPTIONS - CMAKE_AUTORCC_OPTIONS
- CMAKE_AUTOUIC - CMAKE_AUTOUIC
@@ -832,8 +880,15 @@ variables:
- CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY - CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY
- CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_<CONFIG> - CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_<CONFIG>
- CMAKE_<CONFIG>_POSTFIX - CMAKE_<CONFIG>_POSTFIX
- CMAKE_CROSS_CONFIGS # Since 3.17
- CMAKE_CTEST_ARGUMENTS # Since 3.17
- CMAKE_CUDA_SEPARABLE_COMPILATION # Since 3.11 - CMAKE_CUDA_SEPARABLE_COMPILATION # Since 3.11
- CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS # Since 3.16
- CMAKE_CUDA_RUNTIME_LIBRARY # Since 3.17
- CMAKE_DEBUG_POSTFIX - CMAKE_DEBUG_POSTFIX
- CMAKE_DEFAULT_BUILD_TYPE # Since 3.17
- CMAKE_DEFAULT_CONFIGS # Since 3.17
- CMAKE_DISABLE_PRECOMPILE_HEADERS # Since 3.17
- CMAKE_ENABLE_EXPORTS - CMAKE_ENABLE_EXPORTS
- CMAKE_EXE_LINKER_FLAGS - CMAKE_EXE_LINKER_FLAGS
- CMAKE_EXE_LINKER_FLAGS_<CONFIG> - CMAKE_EXE_LINKER_FLAGS_<CONFIG>
@@ -851,6 +906,7 @@ variables:
- CMAKE_INCLUDE_CURRENT_DIR - CMAKE_INCLUDE_CURRENT_DIR
- CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE - CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE
- CMAKE_INSTALL_NAME_DIR - CMAKE_INSTALL_NAME_DIR
- CMAKE_INSTALL_REMOVE_ENVIRONMENT_RPATH # Since 3.16
- CMAKE_INSTALL_RPATH - CMAKE_INSTALL_RPATH
- CMAKE_INSTALL_RPATH_USE_LINK_PATH - CMAKE_INSTALL_RPATH_USE_LINK_PATH
- CMAKE_INTERPROCEDURAL_OPTIMIZATION - CMAKE_INTERPROCEDURAL_OPTIMIZATION
@@ -904,6 +960,8 @@ variables:
- CMAKE_TRY_COMPILE_CONFIGURATION - CMAKE_TRY_COMPILE_CONFIGURATION
- CMAKE_TRY_COMPILE_PLATFORM_VARIABLES - CMAKE_TRY_COMPILE_PLATFORM_VARIABLES
- CMAKE_TRY_COMPILE_TARGET_TYPE - CMAKE_TRY_COMPILE_TARGET_TYPE
- CMAKE_UNITY_BUILD # Since 3.16
- CMAKE_UNITY_BUILD_BATCH_SIZE # Since 3.16
- CMAKE_USE_RELATIVE_PATHS - CMAKE_USE_RELATIVE_PATHS
- CMAKE_VISIBILITY_INLINES_HIDDEN - CMAKE_VISIBILITY_INLINES_HIDDEN
- CMAKE_VS_GLOBALS # Since 3.13 - CMAKE_VS_GLOBALS # Since 3.13
@@ -926,6 +984,8 @@ variables:
- CMAKE_COMPILER_IS_GNUCC - CMAKE_COMPILER_IS_GNUCC
- CMAKE_COMPILER_IS_GNUCXX - CMAKE_COMPILER_IS_GNUCXX
- CMAKE_COMPILER_IS_GNUG77 - CMAKE_COMPILER_IS_GNUG77
- CMAKE_CUDA_COMPILE_FEATURES # Since 3.17
- CMAKE_CUDA_HOST_COMPILER # Since 3.17
- CMAKE_CUDA_EXTENSIONS - CMAKE_CUDA_EXTENSIONS
- CMAKE_CUDA_STANDARD - CMAKE_CUDA_STANDARD
- CMAKE_CUDA_STANDARD_REQUIRED - CMAKE_CUDA_STANDARD_REQUIRED
@@ -1072,7 +1132,8 @@ variables:
- CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION - CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION
- CPACK_INCLUDE_TOPLEVEL_DIRECTORY - CPACK_INCLUDE_TOPLEVEL_DIRECTORY
- CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS # Since 3.11 - CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS # Since 3.11
- CPACK_INSTALL_SCRIPT - CPACK_INSTALL_SCRIPT # Deprecated since 3.16
- CPACK_INSTALL_SCRIPTS # Since 3.16
- CPACK_PACKAGING_INSTALL_PREFIX - CPACK_PACKAGING_INSTALL_PREFIX
- CPACK_SET_DESTDIR - CPACK_SET_DESTDIR
- CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION - CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION
@@ -1201,7 +1262,7 @@ variables:
- CPACK_DEBIAN_ENABLE_COMPONENT_DEPENDS - CPACK_DEBIAN_ENABLE_COMPONENT_DEPENDS
- CPACK_DEBIAN_PACKAGE_MAINTAINER - CPACK_DEBIAN_PACKAGE_MAINTAINER
- CPACK_DEBIAN_PACKAGE_DESCRIPTION - CPACK_DEBIAN_PACKAGE_DESCRIPTION
- CPACK_COMPONENT_<COMPONENT>_DESCRIPTION - CPACK_DEBIAN_<COMPONENT>_DESCRIPTION # Since 3.16
- CPACK_DEBIAN_PACKAGE_SECTION - CPACK_DEBIAN_PACKAGE_SECTION
- CPACK_DEBIAN_<COMPONENT>_PACKAGE_SECTION - CPACK_DEBIAN_<COMPONENT>_PACKAGE_SECTION
- CPACK_DEBIAN_ARCHIVE_TYPE - CPACK_DEBIAN_ARCHIVE_TYPE
@@ -1247,6 +1308,7 @@ variables:
- CPACK_DMG_DISABLE_APPLICATIONS_SYMLINK - CPACK_DMG_DISABLE_APPLICATIONS_SYMLINK
- CPACK_DMG_SLA_DIR - CPACK_DMG_SLA_DIR
- CPACK_DMG_SLA_LANGUAGES - CPACK_DMG_SLA_LANGUAGES
- CPACK_DMG_<component>_FILE_NAME # Since 3.17
- CPACK_COMMAND_HDIUTIL - CPACK_COMMAND_HDIUTIL
- CPACK_COMMAND_SETFILE - CPACK_COMMAND_SETFILE
- CPACK_COMMAND_REZ - CPACK_COMMAND_REZ
@@ -1318,6 +1380,12 @@ variables:
- CPACK_NSIS_EXECUTABLES_DIRECTORY - CPACK_NSIS_EXECUTABLES_DIRECTORY
- CPACK_NSIS_MUI_FINISHPAGE_RUN - CPACK_NSIS_MUI_FINISHPAGE_RUN
- CPACK_NSIS_MENU_LINKS - CPACK_NSIS_MENU_LINKS
- CPACK_NSIS_UNINSTALL_NAME # Since 3.17
- CPACK_NSIS_WELCOME_TITLE # Since 3.17
- CPACK_NSIS_WELCOME_TITLE_3LINES # Since 3.17
- CPACK_NSIS_FINISH_TITLE # Since 3.17
- CPACK_NSIS_FINISH_TITLE_3LINES # Since 3.17
- CPACK_NSIS_MUI_HEADERIMAGE # Since 3.17
# - CPackNuGet (since 3.12) # - CPackNuGet (since 3.12)
- CPACK_NUGET_COMPONENT_INSTALL - CPACK_NUGET_COMPONENT_INSTALL
- CPACK_NUGET_PACKAGE_NAME - CPACK_NUGET_PACKAGE_NAME
@@ -1351,8 +1419,7 @@ variables:
- CPACK_NUGET_PACKAGE_DEPENDENCIES_<dependency>_VERSION - CPACK_NUGET_PACKAGE_DEPENDENCIES_<dependency>_VERSION
- CPACK_NUGET_<compName>_PACKAGE_DEPENDENCIES_<dependency>_VERSION - CPACK_NUGET_<compName>_PACKAGE_DEPENDENCIES_<dependency>_VERSION
- CPACK_NUGET_PACKAGE_DEBUG - CPACK_NUGET_PACKAGE_DEBUG
# - CPackPackageMaker # - CPackPackageMaker is deprecated and gonna be removed in next versions of CPack
- CPACK_OSX_PACKAGE_VERSION
# - CPackProductBuild # - CPackProductBuild
- CPACK_COMMAND_PRODUCTBUILD - CPACK_COMMAND_PRODUCTBUILD
- CPACK_PRODUCTBUILD_IDENTITY_NAME - CPACK_PRODUCTBUILD_IDENTITY_NAME
@@ -1360,7 +1427,19 @@ variables:
- CPACK_COMMAND_PKGBUILD - CPACK_COMMAND_PKGBUILD
- CPACK_PKGBUILD_IDENTITY_NAME - CPACK_PKGBUILD_IDENTITY_NAME
- CPACK_PKGBUILD_KEYCHAIN_PATH - CPACK_PKGBUILD_KEYCHAIN_PATH
- CPACK_PREFLIGHT_<COMP>_SCRIPT # Since 3.1?
- CPACK_POSTFLIGHT_<COMP>_SCRIPT # Since 3.1?
- CPACK_PRODUCTBUILD_RESOURCES_DIR - CPACK_PRODUCTBUILD_RESOURCES_DIR
- CPACK_PRODUCTBUILD_BACKGROUND # Since 3.17
- CPACK_PRODUCTBUILD_BACKGROUND_ALIGNMENT # Since 3.17
- CPACK_PRODUCTBUILD_BACKGROUND_SCALING # Since 3.17
- CPACK_PRODUCTBUILD_BACKGROUND_MIME_TYPE # Since 3.17
- CPACK_PRODUCTBUILD_BACKGROUND_UTI # Since 3.17
- CPACK_PRODUCTBUILD_BACKGROUND_DARKAQUA # Since 3.17
- CPACK_PRODUCTBUILD_BACKGROUND_DARKAQUA_ALIGNMENT # Since 3.17
- CPACK_PRODUCTBUILD_BACKGROUND_DARKAQUA_SCALING # Since 3.17
- CPACK_PRODUCTBUILD_BACKGROUND_DARKAQUA_MIME_TYPE # Since 3.17
- CPACK_PRODUCTBUILD_BACKGROUND_DARKAQUA_UTI # Since 3.17
# - CPackRPM # - CPackRPM
- CPACK_RPM_COMPONENT_INSTALL - CPACK_RPM_COMPONENT_INSTALL
- CPACK_RPM_PACKAGE_SUMMARY - CPACK_RPM_PACKAGE_SUMMARY
@@ -1457,8 +1536,6 @@ variables:
# - CPack # - CPack
- CPACK_PACKAGE_NAME - CPACK_PACKAGE_NAME
- CPACK_PACKAGE_VENDOR - CPACK_PACKAGE_VENDOR
# `CPACK_PACKAGE_CONTACT` used by some modules (like Deb and NSIS),
# but not documented yet...
- CPACK_PACKAGE_CONTACT - CPACK_PACKAGE_CONTACT
- CPACK_PACKAGE_DIRECTORY - CPACK_PACKAGE_DIRECTORY
- CPACK_PACKAGE_VERSION_MAJOR - CPACK_PACKAGE_VERSION_MAJOR
@@ -1497,6 +1574,12 @@ variables:
- CPACK_PACKAGE_INSTALL_REGISTRY_KEY - CPACK_PACKAGE_INSTALL_REGISTRY_KEY
- CPACK_CREATE_DESKTOP_LINKS - CPACK_CREATE_DESKTOP_LINKS
- CPACK_BINARY_<GENNAME> - CPACK_BINARY_<GENNAME>
# The following variables used by CPack and some CMake modules,
# but not documented (yet):
# used by some modules like Deb and NSIS
- CPACK_PACKAGE_CONTACT
# - used in CPack.cmake as default value for `CPACK_RPM_PACKAGE_RELOCATABLE`
- CPACK_PACKAGE_RELOCATABLE
# - CPackWIX # - CPackWIX
- CPACK_WIX_UPGRADE_GUID - CPACK_WIX_UPGRADE_GUID
- CPACK_WIX_PRODUCT_GUID - CPACK_WIX_PRODUCT_GUID
@@ -1554,6 +1637,7 @@ variables:
- PKG_CONFIG_EXECUTABLE - PKG_CONFIG_EXECUTABLE
- PKG_CONFIG_VERSION_STRING - PKG_CONFIG_VERSION_STRING
- PKG_CONFIG_USE_CMAKE_PREFIX_PATH - PKG_CONFIG_USE_CMAKE_PREFIX_PATH
- <prefix>_MODULE_NAME # Since 3.16
# - FindThreads # - FindThreads
- CMAKE_THREAD_LIBS_INIT - CMAKE_THREAD_LIBS_INIT
- CMAKE_USE_SPROC_INIT - CMAKE_USE_SPROC_INIT
@@ -1627,10 +1711,12 @@ environment-variables:
# Environment Variables that Control the Build # Environment Variables that Control the Build
- CMAKE_BUILD_PARALLEL_LEVEL - CMAKE_BUILD_PARALLEL_LEVEL
- CMAKE_CONFIG_TYPE - CMAKE_CONFIG_TYPE
- CMAKE_EXPORT_COMPILE_COMMANDS # Since 3.17
- CMAKE_GENERATOR - CMAKE_GENERATOR
- CMAKE_GENERATOR_INSTANCE - CMAKE_GENERATOR_INSTANCE
- CMAKE_GENERATOR_PLATFORM - CMAKE_GENERATOR_PLATFORM
- CMAKE_GENERATOR_TOOLSET - CMAKE_GENERATOR_TOOLSET
- CMAKE_<LANG>_COMPILER_LAUNCHER # Since 3.17
- CMAKE_MSVCIDE_RUN_PATH - CMAKE_MSVCIDE_RUN_PATH
- CMAKE_NO_VERBOSE - CMAKE_NO_VERBOSE
- CMAKE_OSX_ARCHITECTURES - CMAKE_OSX_ARCHITECTURES
@@ -1897,6 +1983,8 @@ scripting-commands:
# New sub-options since 3.14 # New sub-options since 3.14
, READ_SYMLINK , READ_SYMLINK
, SIZE , SIZE
# New sub-options since 3.16
, GET_RUNTIME_DEPENDENCIES
] ]
special-args: [ special-args: [
UTF-8 UTF-8
@@ -1996,12 +2084,25 @@ scripting-commands:
named-args: *find_library named-args: *find_library
- -
name: foreach name: foreach
named-args: [RANGE, IN, LISTS, ITEMS] named-args: [
RANGE
, IN
, LISTS
, ITEMS
, ZIP_LISTS # Since 3.17
]
- -
name: function name: function
- -
name: get_cmake_property name: get_cmake_property
property-args: [global-properties] property-args: [global-properties]
special-args: [
COMMANDS
, COMPONENTS
, MACROS
, VARIABLES
, CACHE_VARIABLES
]
- -
name: get_directory_property name: get_directory_property
named-args: [DIRECTORY, DEFINITION] named-args: [DIRECTORY, DEFINITION]
@@ -2118,6 +2219,10 @@ scripting-commands:
, VERBOSE , VERBOSE
, DEBUG , DEBUG
, TRACE , TRACE
# Since 3.17
, CHECK_START
, CHECK_PASS
, CHECK_FAIL
] ]
- -
name: option name: option
@@ -2270,7 +2375,7 @@ project-commands:
named-args: [EXCLUDE_FROM_ALL] named-args: [EXCLUDE_FROM_ALL]
- -
name: add_test name: add_test
named-args: [NAME, COMMAND, CONFIGURATIONS, WORKING_DIRECTORY] named-args: [NAME, COMMAND, COMMAND_EXPAND_LISTS, CONFIGURATIONS, WORKING_DIRECTORY]
nested-parentheses?: true nested-parentheses?: true
- -
name: aux_source_directory name: aux_source_directory
@@ -2287,7 +2392,22 @@ project-commands:
- -
name: enable_language name: enable_language
named-args: [OPTIONAL] named-args: [OPTIONAL]
special-args: [C, CXX, RC, Fortran] special-args: [
ASM
, ASM-ATT
, ASM_NASM
, ASM_MASM
, C
, CSharp
, CXX
, CUDA
, Java
, OBJC # Since 3.16
, OBJCXX # Since 3.16
, RC
, Fortran
, Swift
]
- -
name: enable_testing name: enable_testing
- -
@@ -2391,7 +2511,23 @@ project-commands:
, HOMEPAGE_URL # Since 3.12 , HOMEPAGE_URL # Since 3.12
, LANGUAGES , LANGUAGES
] ]
special-args: [NONE, C, CXX, RC, CUDA, Fortran, ASM] special-args: [
ASM
, ASM-ATT
, ASM_NASM
, ASM_MASM
, C
, CSharp
, CXX
, CUDA
, Java
, OBJC # Since 3.16
, OBJCXX # Since 3.16
, RC
, Fortran
, Swift
, NONE # This one is different from `enable_language`
]
- -
name: qt_wrap_cpp name: qt_wrap_cpp
- -
@@ -2491,6 +2627,12 @@ project-commands:
, c_restrict , c_restrict
, c_static_assert , c_static_assert
, c_variadic_macros , c_variadic_macros
# CMAKE_CUDA_KNOWN_FEATURES (since 3.17)
, cuda_std_03
, cuda_std_11
, cuda_std_14
, cuda_std_17
, cuda_std_20
] ]
- -
name: target_compile_options name: target_compile_options
@@ -2508,6 +2650,10 @@ project-commands:
- -
name: target_link_options name: target_link_options
named-args: *target_compile_definitions named-args: *target_compile_definitions
-
# Since 3.16
name: target_precompile_headers
named-args: [INTERFACE, PUBLIC, PRIVATE, REUSE_FROM]
- -
name: target_sources name: target_sources
named-args: *target_compile_definitions named-args: *target_compile_definitions
@@ -2623,8 +2769,15 @@ ctest-commands:
, STOP_TIME , STOP_TIME
, RETURN_VALUE , RETURN_VALUE
, CAPTURE_CMAKE_ERROR , CAPTURE_CMAKE_ERROR
, REPEAT # Since 3.17
, QUIET , QUIET
] ]
special-args: [
# Since 3.17
UNTIL_FAIL
, UNTIL_PASS
, AFTER_TIMEOUT
]
- -
name: ctest_update name: ctest_update
named-args: [SOURCE, RETURN_VALUE, QUIET] named-args: [SOURCE, RETURN_VALUE, QUIET]

View File

@@ -48,6 +48,12 @@ def try_transform_placeholder_string_to_regex(name):
if 'CMAKE_ARGV' in m: if 'CMAKE_ARGV' in m:
return '\\bCMAKE_ARGV[0-9]+\\b' return '\\bCMAKE_ARGV[0-9]+\\b'
if 'CMAKE_POLICY_DEFAULT_CMP' in m:
return '\\bCMAKE_POLICY_DEFAULT_CMP[0-9]{4}\\b'
if 'CMAKE_POLICY_WARNING_CMP' in m:
return '\\bCMAKE_POLICY_WARNING_CMP[0-9]{4}\\b'
return '\\b{}\\b'.format('&id_re;'.join(list(m))) if 1 < len(m) else name return '\\b{}\\b'.format('&id_re;'.join(list(m))) if 1 < len(m) else name

View File

@@ -9,7 +9,7 @@
Copyright 2004 Alexander Neundorf (neundorf@kde.org) Copyright 2004 Alexander Neundorf (neundorf@kde.org)
Copyright 2005 Dominik Haumann (dhdev@gmx.de) Copyright 2005 Dominik Haumann (dhdev@gmx.de)
Copyright 2007,2008,2013,2014 Matthew Woehlke (mw_triad@users.sourceforge.net) Copyright 2007,2008,2013,2014 Matthew Woehlke (mw_triad@users.sourceforge.net)
Copyright 2013-2015,2017-2019 Alex Turbov (i.zaufi@gmail.com) Copyright 2013-2015,2017-2020 Alex Turbov (i.zaufi@gmail.com)
********************************************************************** **********************************************************************
* This library is free software; you can redistribute it and/or * * This library is free software; you can redistribute it and/or *
@@ -31,7 +31,7 @@
<language <language
name="CMake" name="CMake"
version="16" version="22"
kateversion="2.4" kateversion="2.4"
section="Other" section="Other"
extensions="CMakeLists.txt;*.cmake;*.cmake.in" extensions="CMakeLists.txt;*.cmake;*.cmake.in"
@@ -133,6 +133,7 @@
<item>target_link_directories</item> <item>target_link_directories</item>
<item>target_link_libraries</item> <item>target_link_libraries</item>
<item>target_link_options</item> <item>target_link_options</item>
<item>target_precompile_headers</item>
<item>target_sources</item> <item>target_sources</item>
<item>try_compile</item> <item>try_compile</item>
<item>try_run</item> <item>try_run</item>
@@ -292,6 +293,7 @@
<item>FOLLOW_SYMLINKS</item> <item>FOLLOW_SYMLINKS</item>
<item>FOLLOW_SYMLINK_CHAIN</item> <item>FOLLOW_SYMLINK_CHAIN</item>
<item>GENERATE</item> <item>GENERATE</item>
<item>GET_RUNTIME_DEPENDENCIES</item>
<item>GLOB</item> <item>GLOB</item>
<item>GLOB_RECURSE</item> <item>GLOB_RECURSE</item>
<item>GUARD</item> <item>GUARD</item>
@@ -479,6 +481,14 @@
<item>ITEMS</item> <item>ITEMS</item>
<item>LISTS</item> <item>LISTS</item>
<item>RANGE</item> <item>RANGE</item>
<item>ZIP_LISTS</item>
</list>
<list name="get_cmake_property_sargs">
<item>CACHE_VARIABLES</item>
<item>COMMANDS</item>
<item>COMPONENTS</item>
<item>MACROS</item>
<item>VARIABLES</item>
</list> </list>
<list name="get_directory_property_nargs"> <list name="get_directory_property_nargs">
<item>DEFINITION</item> <item>DEFINITION</item>
@@ -608,6 +618,9 @@
</list> </list>
<list name="message_nargs"> <list name="message_nargs">
<item>AUTHOR_WARNING</item> <item>AUTHOR_WARNING</item>
<item>CHECK_FAIL</item>
<item>CHECK_PASS</item>
<item>CHECK_START</item>
<item>DEBUG</item> <item>DEBUG</item>
<item>DEPRECATION</item> <item>DEPRECATION</item>
<item>FATAL_ERROR</item> <item>FATAL_ERROR</item>
@@ -800,6 +813,7 @@
</list> </list>
<list name="add_test_nargs"> <list name="add_test_nargs">
<item>COMMAND</item> <item>COMMAND</item>
<item>COMMAND_EXPAND_LISTS</item>
<item>CONFIGURATIONS</item> <item>CONFIGURATIONS</item>
<item>NAME</item> <item>NAME</item>
<item>WORKING_DIRECTORY</item> <item>WORKING_DIRECTORY</item>
@@ -828,10 +842,20 @@
<item>OPTIONAL</item> <item>OPTIONAL</item>
</list> </list>
<list name="enable_language_sargs"> <list name="enable_language_sargs">
<item>ASM</item>
<item>ASM-ATT</item>
<item>ASM_MASM</item>
<item>ASM_NASM</item>
<item>C</item> <item>C</item>
<item>CSharp</item>
<item>CUDA</item>
<item>CXX</item> <item>CXX</item>
<item>Fortran</item> <item>Fortran</item>
<item>Java</item>
<item>OBJC</item>
<item>OBJCXX</item>
<item>RC</item> <item>RC</item>
<item>Swift</item>
</list> </list>
<list name="export_nargs"> <list name="export_nargs">
<item>ANDROID_MK</item> <item>ANDROID_MK</item>
@@ -928,12 +952,20 @@
</list> </list>
<list name="project_sargs"> <list name="project_sargs">
<item>ASM</item> <item>ASM</item>
<item>ASM-ATT</item>
<item>ASM_MASM</item>
<item>ASM_NASM</item>
<item>C</item> <item>C</item>
<item>CSharp</item>
<item>CUDA</item> <item>CUDA</item>
<item>CXX</item> <item>CXX</item>
<item>Fortran</item> <item>Fortran</item>
<item>Java</item>
<item>NONE</item> <item>NONE</item>
<item>OBJC</item>
<item>OBJCXX</item>
<item>RC</item> <item>RC</item>
<item>Swift</item>
</list> </list>
<list name="set_source_files_properties_nargs"> <list name="set_source_files_properties_nargs">
<item>PROPERTIES</item> <item>PROPERTIES</item>
@@ -968,6 +1000,11 @@
<item>c_std_90</item> <item>c_std_90</item>
<item>c_std_99</item> <item>c_std_99</item>
<item>c_variadic_macros</item> <item>c_variadic_macros</item>
<item>cuda_std_03</item>
<item>cuda_std_11</item>
<item>cuda_std_14</item>
<item>cuda_std_17</item>
<item>cuda_std_20</item>
<item>cxx_aggregate_default_initializers</item> <item>cxx_aggregate_default_initializers</item>
<item>cxx_alias_templates</item> <item>cxx_alias_templates</item>
<item>cxx_alignas</item> <item>cxx_alignas</item>
@@ -1060,6 +1097,12 @@
<item>PRIVATE</item> <item>PRIVATE</item>
<item>PUBLIC</item> <item>PUBLIC</item>
</list> </list>
<list name="target_precompile_headers_nargs">
<item>INTERFACE</item>
<item>PRIVATE</item>
<item>PUBLIC</item>
<item>REUSE_FROM</item>
</list>
<list name="target_sources_nargs"> <list name="target_sources_nargs">
<item>INTERFACE</item> <item>INTERFACE</item>
<item>PRIVATE</item> <item>PRIVATE</item>
@@ -1174,6 +1217,7 @@
<item>INCLUDE_LABEL</item> <item>INCLUDE_LABEL</item>
<item>PARALLEL_LEVEL</item> <item>PARALLEL_LEVEL</item>
<item>QUIET</item> <item>QUIET</item>
<item>REPEAT</item>
<item>RETURN_VALUE</item> <item>RETURN_VALUE</item>
<item>SCHEDULE_RANDOM</item> <item>SCHEDULE_RANDOM</item>
<item>START</item> <item>START</item>
@@ -1181,6 +1225,11 @@
<item>STRIDE</item> <item>STRIDE</item>
<item>TEST_LOAD</item> <item>TEST_LOAD</item>
</list> </list>
<list name="ctest_test_sargs">
<item>AFTER_TIMEOUT</item>
<item>UNTIL_FAIL</item>
<item>UNTIL_PASS</item>
</list>
<list name="ctest_update_nargs"> <list name="ctest_update_nargs">
<item>QUIET</item> <item>QUIET</item>
<item>RETURN_VALUE</item> <item>RETURN_VALUE</item>
@@ -1199,6 +1248,7 @@
<item>BUILD_SHARED_LIBS</item> <item>BUILD_SHARED_LIBS</item>
<item>BUILD_TESTING</item> <item>BUILD_TESTING</item>
<item>CMAKE_ABSOLUTE_DESTINATION_FILES</item> <item>CMAKE_ABSOLUTE_DESTINATION_FILES</item>
<item>CMAKE_AIX_EXPORT_ALL_SYMBOLS</item>
<item>CMAKE_ANDROID_ANT_ADDITIONAL_OPTIONS</item> <item>CMAKE_ANDROID_ANT_ADDITIONAL_OPTIONS</item>
<item>CMAKE_ANDROID_API</item> <item>CMAKE_ANDROID_API</item>
<item>CMAKE_ANDROID_API_MIN</item> <item>CMAKE_ANDROID_API_MIN</item>
@@ -1235,6 +1285,7 @@
<item>CMAKE_AUTOMOC</item> <item>CMAKE_AUTOMOC</item>
<item>CMAKE_AUTOMOC_DEPEND_FILTERS</item> <item>CMAKE_AUTOMOC_DEPEND_FILTERS</item>
<item>CMAKE_AUTOMOC_MOC_OPTIONS</item> <item>CMAKE_AUTOMOC_MOC_OPTIONS</item>
<item>CMAKE_AUTOMOC_PATH_PREFIX</item>
<item>CMAKE_AUTOMOC_RELAXED_MODE</item> <item>CMAKE_AUTOMOC_RELAXED_MODE</item>
<item>CMAKE_AUTORCC</item> <item>CMAKE_AUTORCC</item>
<item>CMAKE_AUTORCC_OPTIONS</item> <item>CMAKE_AUTORCC_OPTIONS</item>
@@ -1268,13 +1319,23 @@
<item>CMAKE_CONFIGURATION_TYPES</item> <item>CMAKE_CONFIGURATION_TYPES</item>
<item>CMAKE_CROSSCOMPILING</item> <item>CMAKE_CROSSCOMPILING</item>
<item>CMAKE_CROSSCOMPILING_EMULATOR</item> <item>CMAKE_CROSSCOMPILING_EMULATOR</item>
<item>CMAKE_CROSS_CONFIGS</item>
<item>CMAKE_CTEST_ARGUMENTS</item>
<item>CMAKE_CTEST_COMMAND</item> <item>CMAKE_CTEST_COMMAND</item>
<item>CMAKE_CUDA_COMPILE_FEATURES</item>
<item>CMAKE_CUDA_EXTENSIONS</item> <item>CMAKE_CUDA_EXTENSIONS</item>
<item>CMAKE_CUDA_HOST_COMPILER</item>
<item>CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS</item>
<item>CMAKE_CUDA_RUNTIME_LIBRARY</item>
<item>CMAKE_CUDA_SEPARABLE_COMPILATION</item> <item>CMAKE_CUDA_SEPARABLE_COMPILATION</item>
<item>CMAKE_CUDA_STANDARD</item> <item>CMAKE_CUDA_STANDARD</item>
<item>CMAKE_CUDA_STANDARD_REQUIRED</item> <item>CMAKE_CUDA_STANDARD_REQUIRED</item>
<item>CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES</item> <item>CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES</item>
<item>CMAKE_CURRENT_BINARY_DIR</item> <item>CMAKE_CURRENT_BINARY_DIR</item>
<item>CMAKE_CURRENT_FUNCTION</item>
<item>CMAKE_CURRENT_FUNCTION_LIST_DIR</item>
<item>CMAKE_CURRENT_FUNCTION_LIST_FILE</item>
<item>CMAKE_CURRENT_FUNCTION_LIST_LINE</item>
<item>CMAKE_CURRENT_LIST_DIR</item> <item>CMAKE_CURRENT_LIST_DIR</item>
<item>CMAKE_CURRENT_LIST_FILE</item> <item>CMAKE_CURRENT_LIST_FILE</item>
<item>CMAKE_CURRENT_LIST_LINE</item> <item>CMAKE_CURRENT_LIST_LINE</item>
@@ -1289,13 +1350,18 @@
<item>CMAKE_C_STANDARD_REQUIRED</item> <item>CMAKE_C_STANDARD_REQUIRED</item>
<item>CMAKE_DEBUG_POSTFIX</item> <item>CMAKE_DEBUG_POSTFIX</item>
<item>CMAKE_DEBUG_TARGET_PROPERTIES</item> <item>CMAKE_DEBUG_TARGET_PROPERTIES</item>
<item>CMAKE_DEFAULT_BUILD_TYPE</item>
<item>CMAKE_DEFAULT_CONFIGS</item>
<item>CMAKE_DEPENDS_IN_PROJECT_ONLY</item> <item>CMAKE_DEPENDS_IN_PROJECT_ONLY</item>
<item>CMAKE_DIRECTORY_LABELS</item> <item>CMAKE_DIRECTORY_LABELS</item>
<item>CMAKE_DISABLE_PRECOMPILE_HEADERS</item>
<item>CMAKE_DL_LIBS</item> <item>CMAKE_DL_LIBS</item>
<item>CMAKE_DOTNET_TARGET_FRAMEWORK</item>
<item>CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION</item> <item>CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION</item>
<item>CMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES</item> <item>CMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES</item>
<item>CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT</item> <item>CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT</item>
<item>CMAKE_ECLIPSE_MAKE_ARGUMENTS</item> <item>CMAKE_ECLIPSE_MAKE_ARGUMENTS</item>
<item>CMAKE_ECLIPSE_RESOURCE_ENCODING</item>
<item>CMAKE_ECLIPSE_VERSION</item> <item>CMAKE_ECLIPSE_VERSION</item>
<item>CMAKE_EDIT_COMMAND</item> <item>CMAKE_EDIT_COMMAND</item>
<item>CMAKE_ENABLE_EXPORTS</item> <item>CMAKE_ENABLE_EXPORTS</item>
@@ -1312,6 +1378,7 @@
<item>CMAKE_EXTRA_INCLUDE_FILES</item> <item>CMAKE_EXTRA_INCLUDE_FILES</item>
<item>CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES</item> <item>CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES</item>
<item>CMAKE_FIND_APPBUNDLE</item> <item>CMAKE_FIND_APPBUNDLE</item>
<item>CMAKE_FIND_DEBUG_MODE</item>
<item>CMAKE_FIND_FRAMEWORK</item> <item>CMAKE_FIND_FRAMEWORK</item>
<item>CMAKE_FIND_FRAMEWORK_EXTRA_LOCATIONS</item> <item>CMAKE_FIND_FRAMEWORK_EXTRA_LOCATIONS</item>
<item>CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX</item> <item>CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX</item>
@@ -1331,6 +1398,13 @@
<item>CMAKE_FIND_ROOT_PATH_MODE_LIBRARY</item> <item>CMAKE_FIND_ROOT_PATH_MODE_LIBRARY</item>
<item>CMAKE_FIND_ROOT_PATH_MODE_PACKAGE</item> <item>CMAKE_FIND_ROOT_PATH_MODE_PACKAGE</item>
<item>CMAKE_FIND_ROOT_PATH_MODE_PROGRAM</item> <item>CMAKE_FIND_ROOT_PATH_MODE_PROGRAM</item>
<item>CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH</item>
<item>CMAKE_FIND_USE_CMAKE_PATH</item>
<item>CMAKE_FIND_USE_CMAKE_SYSTEM_PATH</item>
<item>CMAKE_FIND_USE_PACKAGE_REGISTRY</item>
<item>CMAKE_FIND_USE_PACKAGE_ROOT_PATH</item>
<item>CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH</item>
<item>CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY</item>
<item>CMAKE_FOLDER</item> <item>CMAKE_FOLDER</item>
<item>CMAKE_FRAMEWORK</item> <item>CMAKE_FRAMEWORK</item>
<item>CMAKE_FRAMEWORK_PATH</item> <item>CMAKE_FRAMEWORK_PATH</item>
@@ -1341,6 +1415,7 @@
<item>CMAKE_Fortran_MODULE_DIRECTORY</item> <item>CMAKE_Fortran_MODULE_DIRECTORY</item>
<item>CMAKE_GENERATOR</item> <item>CMAKE_GENERATOR</item>
<item>CMAKE_GENERATOR_INSTANCE</item> <item>CMAKE_GENERATOR_INSTANCE</item>
<item>CMAKE_GENERATOR_NO_COMPILER_ENV</item>
<item>CMAKE_GENERATOR_PLATFORM</item> <item>CMAKE_GENERATOR_PLATFORM</item>
<item>CMAKE_GENERATOR_TOOLSET</item> <item>CMAKE_GENERATOR_TOOLSET</item>
<item>CMAKE_GLOBAL_AUTOGEN_TARGET</item> <item>CMAKE_GLOBAL_AUTOGEN_TARGET</item>
@@ -1405,6 +1480,7 @@
<item>CMAKE_INSTALL_OPENMP_LIBRARIES</item> <item>CMAKE_INSTALL_OPENMP_LIBRARIES</item>
<item>CMAKE_INSTALL_PREFIX</item> <item>CMAKE_INSTALL_PREFIX</item>
<item>CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT</item> <item>CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT</item>
<item>CMAKE_INSTALL_REMOVE_ENVIRONMENT_RPATH</item>
<item>CMAKE_INSTALL_RPATH</item> <item>CMAKE_INSTALL_RPATH</item>
<item>CMAKE_INSTALL_RPATH_USE_LINK_PATH</item> <item>CMAKE_INSTALL_RPATH_USE_LINK_PATH</item>
<item>CMAKE_INSTALL_RUNSTATEDIR</item> <item>CMAKE_INSTALL_RUNSTATEDIR</item>
@@ -1444,6 +1520,10 @@
<item>CMAKE_MAKE_PROGRAM</item> <item>CMAKE_MAKE_PROGRAM</item>
<item>CMAKE_MATCH_COUNT</item> <item>CMAKE_MATCH_COUNT</item>
<item>CMAKE_MAXIMUM_RECURSION_DEPTH</item> <item>CMAKE_MAXIMUM_RECURSION_DEPTH</item>
<item>CMAKE_MESSAGE_CONTEXT</item>
<item>CMAKE_MESSAGE_CONTEXT_SHOW</item>
<item>CMAKE_MESSAGE_INDENT</item>
<item>CMAKE_MESSAGE_LOG_LEVEL</item>
<item>CMAKE_MFC_FLAG</item> <item>CMAKE_MFC_FLAG</item>
<item>CMAKE_MINIMUM_REQUIRED_VERSION</item> <item>CMAKE_MINIMUM_REQUIRED_VERSION</item>
<item>CMAKE_MINOR_VERSION</item> <item>CMAKE_MINOR_VERSION</item>
@@ -1540,6 +1620,8 @@
<item>CMAKE_TRY_COMPILE_PLATFORM_VARIABLES</item> <item>CMAKE_TRY_COMPILE_PLATFORM_VARIABLES</item>
<item>CMAKE_TRY_COMPILE_TARGET_TYPE</item> <item>CMAKE_TRY_COMPILE_TARGET_TYPE</item>
<item>CMAKE_TWEAK_VERSION</item> <item>CMAKE_TWEAK_VERSION</item>
<item>CMAKE_UNITY_BUILD</item>
<item>CMAKE_UNITY_BUILD_BATCH_SIZE</item>
<item>CMAKE_USER_MAKE_RULES_OVERRIDE</item> <item>CMAKE_USER_MAKE_RULES_OVERRIDE</item>
<item>CMAKE_USE_PTHREADS_INIT</item> <item>CMAKE_USE_PTHREADS_INIT</item>
<item>CMAKE_USE_RELATIVE_PATHS</item> <item>CMAKE_USE_RELATIVE_PATHS</item>
@@ -1577,9 +1659,11 @@
<item>CMAKE_XCODE_PLATFORM_TOOLSET</item> <item>CMAKE_XCODE_PLATFORM_TOOLSET</item>
<item>CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER</item> <item>CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER</item>
<item>CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN</item> <item>CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN</item>
<item>CMAKE_XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING</item>
<item>CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER</item> <item>CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER</item>
<item>CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS</item> <item>CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS</item>
<item>CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE</item> <item>CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE</item>
<item>CMAKE_XCODE_SCHEME_ENVIRONMENT</item>
<item>CMAKE_XCODE_SCHEME_GUARD_MALLOC</item> <item>CMAKE_XCODE_SCHEME_GUARD_MALLOC</item>
<item>CMAKE_XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP</item> <item>CMAKE_XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP</item>
<item>CMAKE_XCODE_SCHEME_MALLOC_GUARD_EDGES</item> <item>CMAKE_XCODE_SCHEME_MALLOC_GUARD_EDGES</item>
@@ -1589,6 +1673,7 @@
<item>CMAKE_XCODE_SCHEME_THREAD_SANITIZER_STOP</item> <item>CMAKE_XCODE_SCHEME_THREAD_SANITIZER_STOP</item>
<item>CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER</item> <item>CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER</item>
<item>CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP</item> <item>CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP</item>
<item>CMAKE_XCODE_SCHEME_WORKING_DIRECTORY</item>
<item>CMAKE_XCODE_SCHEME_ZOMBIE_OBJECTS</item> <item>CMAKE_XCODE_SCHEME_ZOMBIE_OBJECTS</item>
<item>CPACK_ABSOLUTE_DESTINATION_FILES</item> <item>CPACK_ABSOLUTE_DESTINATION_FILES</item>
<item>CPACK_ARCHIVE_COMPONENT_INSTALL</item> <item>CPACK_ARCHIVE_COMPONENT_INSTALL</item>
@@ -1704,6 +1789,7 @@
<item>CPACK_INSTALL_COMMANDS</item> <item>CPACK_INSTALL_COMMANDS</item>
<item>CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS</item> <item>CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS</item>
<item>CPACK_INSTALL_SCRIPT</item> <item>CPACK_INSTALL_SCRIPT</item>
<item>CPACK_INSTALL_SCRIPTS</item>
<item>CPACK_MONOLITHIC_INSTALL</item> <item>CPACK_MONOLITHIC_INSTALL</item>
<item>CPACK_NSIS_COMPRESSOR</item> <item>CPACK_NSIS_COMPRESSOR</item>
<item>CPACK_NSIS_CONTACT</item> <item>CPACK_NSIS_CONTACT</item>
@@ -1715,6 +1801,8 @@
<item>CPACK_NSIS_EXTRA_INSTALL_COMMANDS</item> <item>CPACK_NSIS_EXTRA_INSTALL_COMMANDS</item>
<item>CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS</item> <item>CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS</item>
<item>CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS</item> <item>CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS</item>
<item>CPACK_NSIS_FINISH_TITLE</item>
<item>CPACK_NSIS_FINISH_TITLE_3LINES</item>
<item>CPACK_NSIS_HELP_LINK</item> <item>CPACK_NSIS_HELP_LINK</item>
<item>CPACK_NSIS_INSTALLED_ICON_NAME</item> <item>CPACK_NSIS_INSTALLED_ICON_NAME</item>
<item>CPACK_NSIS_INSTALLER_MUI_ICON_CODE</item> <item>CPACK_NSIS_INSTALLER_MUI_ICON_CODE</item>
@@ -1722,12 +1810,16 @@
<item>CPACK_NSIS_MENU_LINKS</item> <item>CPACK_NSIS_MENU_LINKS</item>
<item>CPACK_NSIS_MODIFY_PATH</item> <item>CPACK_NSIS_MODIFY_PATH</item>
<item>CPACK_NSIS_MUI_FINISHPAGE_RUN</item> <item>CPACK_NSIS_MUI_FINISHPAGE_RUN</item>
<item>CPACK_NSIS_MUI_HEADERIMAGE</item>
<item>CPACK_NSIS_MUI_ICON</item> <item>CPACK_NSIS_MUI_ICON</item>
<item>CPACK_NSIS_MUI_UNIICON</item> <item>CPACK_NSIS_MUI_UNIICON</item>
<item>CPACK_NSIS_MUI_UNWELCOMEFINISHPAGE_BITMAP</item> <item>CPACK_NSIS_MUI_UNWELCOMEFINISHPAGE_BITMAP</item>
<item>CPACK_NSIS_MUI_WELCOMEFINISHPAGE_BITMAP</item> <item>CPACK_NSIS_MUI_WELCOMEFINISHPAGE_BITMAP</item>
<item>CPACK_NSIS_PACKAGE_NAME</item> <item>CPACK_NSIS_PACKAGE_NAME</item>
<item>CPACK_NSIS_UNINSTALL_NAME</item>
<item>CPACK_NSIS_URL_INFO_ABOUT</item> <item>CPACK_NSIS_URL_INFO_ABOUT</item>
<item>CPACK_NSIS_WELCOME_TITLE</item>
<item>CPACK_NSIS_WELCOME_TITLE_3LINES</item>
<item>CPACK_NUGET_COMPONENT_INSTALL</item> <item>CPACK_NUGET_COMPONENT_INSTALL</item>
<item>CPACK_NUGET_PACKAGE_AUTHORS</item> <item>CPACK_NUGET_PACKAGE_AUTHORS</item>
<item>CPACK_NUGET_PACKAGE_COPYRIGHT</item> <item>CPACK_NUGET_PACKAGE_COPYRIGHT</item>
@@ -1744,7 +1836,6 @@
<item>CPACK_NUGET_PACKAGE_TAGS</item> <item>CPACK_NUGET_PACKAGE_TAGS</item>
<item>CPACK_NUGET_PACKAGE_TITLE</item> <item>CPACK_NUGET_PACKAGE_TITLE</item>
<item>CPACK_NUGET_PACKAGE_VERSION</item> <item>CPACK_NUGET_PACKAGE_VERSION</item>
<item>CPACK_OSX_PACKAGE_VERSION</item>
<item>CPACK_OUTPUT_CONFIG_FILE</item> <item>CPACK_OUTPUT_CONFIG_FILE</item>
<item>CPACK_PACKAGE_CHECKSUM</item> <item>CPACK_PACKAGE_CHECKSUM</item>
<item>CPACK_PACKAGE_CONTACT</item> <item>CPACK_PACKAGE_CONTACT</item>
@@ -1759,6 +1850,7 @@
<item>CPACK_PACKAGE_INSTALL_DIRECTORY</item> <item>CPACK_PACKAGE_INSTALL_DIRECTORY</item>
<item>CPACK_PACKAGE_INSTALL_REGISTRY_KEY</item> <item>CPACK_PACKAGE_INSTALL_REGISTRY_KEY</item>
<item>CPACK_PACKAGE_NAME</item> <item>CPACK_PACKAGE_NAME</item>
<item>CPACK_PACKAGE_RELOCATABLE</item>
<item>CPACK_PACKAGE_VENDOR</item> <item>CPACK_PACKAGE_VENDOR</item>
<item>CPACK_PACKAGE_VERSION</item> <item>CPACK_PACKAGE_VERSION</item>
<item>CPACK_PACKAGE_VERSION_MAJOR</item> <item>CPACK_PACKAGE_VERSION_MAJOR</item>
@@ -1767,6 +1859,16 @@
<item>CPACK_PACKAGING_INSTALL_PREFIX</item> <item>CPACK_PACKAGING_INSTALL_PREFIX</item>
<item>CPACK_PKGBUILD_IDENTITY_NAME</item> <item>CPACK_PKGBUILD_IDENTITY_NAME</item>
<item>CPACK_PKGBUILD_KEYCHAIN_PATH</item> <item>CPACK_PKGBUILD_KEYCHAIN_PATH</item>
<item>CPACK_PRODUCTBUILD_BACKGROUND</item>
<item>CPACK_PRODUCTBUILD_BACKGROUND_ALIGNMENT</item>
<item>CPACK_PRODUCTBUILD_BACKGROUND_DARKAQUA</item>
<item>CPACK_PRODUCTBUILD_BACKGROUND_DARKAQUA_ALIGNMENT</item>
<item>CPACK_PRODUCTBUILD_BACKGROUND_DARKAQUA_MIME_TYPE</item>
<item>CPACK_PRODUCTBUILD_BACKGROUND_DARKAQUA_SCALING</item>
<item>CPACK_PRODUCTBUILD_BACKGROUND_DARKAQUA_UTI</item>
<item>CPACK_PRODUCTBUILD_BACKGROUND_MIME_TYPE</item>
<item>CPACK_PRODUCTBUILD_BACKGROUND_SCALING</item>
<item>CPACK_PRODUCTBUILD_BACKGROUND_UTI</item>
<item>CPACK_PRODUCTBUILD_IDENTITY_NAME</item> <item>CPACK_PRODUCTBUILD_IDENTITY_NAME</item>
<item>CPACK_PRODUCTBUILD_KEYCHAIN_PATH</item> <item>CPACK_PRODUCTBUILD_KEYCHAIN_PATH</item>
<item>CPACK_PRODUCTBUILD_RESOURCES_DIR</item> <item>CPACK_PRODUCTBUILD_RESOURCES_DIR</item>
@@ -2024,6 +2126,7 @@
<item>CMAKE_APPBUNDLE_PATH</item> <item>CMAKE_APPBUNDLE_PATH</item>
<item>CMAKE_BUILD_PARALLEL_LEVEL</item> <item>CMAKE_BUILD_PARALLEL_LEVEL</item>
<item>CMAKE_CONFIG_TYPE</item> <item>CMAKE_CONFIG_TYPE</item>
<item>CMAKE_EXPORT_COMPILE_COMMANDS</item>
<item>CMAKE_FRAMEWORK_PATH</item> <item>CMAKE_FRAMEWORK_PATH</item>
<item>CMAKE_GENERATOR</item> <item>CMAKE_GENERATOR</item>
<item>CMAKE_GENERATOR_INSTANCE</item> <item>CMAKE_GENERATOR_INSTANCE</item>
@@ -2063,6 +2166,7 @@
<item>AUTOMOC_SOURCE_GROUP</item> <item>AUTOMOC_SOURCE_GROUP</item>
<item>AUTOMOC_TARGETS_FOLDER</item> <item>AUTOMOC_TARGETS_FOLDER</item>
<item>AUTORCC_SOURCE_GROUP</item> <item>AUTORCC_SOURCE_GROUP</item>
<item>CMAKE_CUDA_KNOWN_FEATURES</item>
<item>CMAKE_CXX_KNOWN_FEATURES</item> <item>CMAKE_CXX_KNOWN_FEATURES</item>
<item>CMAKE_C_KNOWN_FEATURES</item> <item>CMAKE_C_KNOWN_FEATURES</item>
<item>CMAKE_ROLE</item> <item>CMAKE_ROLE</item>
@@ -2132,6 +2236,7 @@
</list> </list>
<list name="target-properties"> <list name="target-properties">
<item>ADDITIONAL_CLEAN_FILES</item> <item>ADDITIONAL_CLEAN_FILES</item>
<item>AIX_EXPORT_ALL_SYMBOLS</item>
<item>ALIASED_TARGET</item> <item>ALIASED_TARGET</item>
<item>ANDROID_ANT_ADDITIONAL_OPTIONS</item> <item>ANDROID_ANT_ADDITIONAL_OPTIONS</item>
<item>ANDROID_API</item> <item>ANDROID_API</item>
@@ -2161,6 +2266,7 @@
<item>AUTOMOC_EXECUTABLE</item> <item>AUTOMOC_EXECUTABLE</item>
<item>AUTOMOC_MACRO_NAMES</item> <item>AUTOMOC_MACRO_NAMES</item>
<item>AUTOMOC_MOC_OPTIONS</item> <item>AUTOMOC_MOC_OPTIONS</item>
<item>AUTOMOC_PATH_PREFIX</item>
<item>AUTORCC</item> <item>AUTORCC</item>
<item>AUTORCC_EXECUTABLE</item> <item>AUTORCC_EXECUTABLE</item>
<item>AUTORCC_OPTIONS</item> <item>AUTORCC_OPTIONS</item>
@@ -2190,6 +2296,7 @@
<item>CUDA_EXTENSIONS</item> <item>CUDA_EXTENSIONS</item>
<item>CUDA_PTX_COMPILATION</item> <item>CUDA_PTX_COMPILATION</item>
<item>CUDA_RESOLVE_DEVICE_SYMBOLS</item> <item>CUDA_RESOLVE_DEVICE_SYMBOLS</item>
<item>CUDA_RUNTIME_LIBRARY</item>
<item>CUDA_SEPARABLE_COMPILATION</item> <item>CUDA_SEPARABLE_COMPILATION</item>
<item>CUDA_STANDARD</item> <item>CUDA_STANDARD</item>
<item>CUDA_STANDARD_REQUIRED</item> <item>CUDA_STANDARD_REQUIRED</item>
@@ -2202,6 +2309,9 @@
<item>DEFINE_SYMBOL</item> <item>DEFINE_SYMBOL</item>
<item>DEPLOYMENT_ADDITIONAL_FILES</item> <item>DEPLOYMENT_ADDITIONAL_FILES</item>
<item>DEPLOYMENT_REMOTE_DIRECTORY</item> <item>DEPLOYMENT_REMOTE_DIRECTORY</item>
<item>DEPRECATION</item>
<item>DISABLE_PRECOMPILE_HEADERS</item>
<item>DOTNET_TARGET_FRAMEWORK</item>
<item>DOTNET_TARGET_FRAMEWORK_VERSION</item> <item>DOTNET_TARGET_FRAMEWORK_VERSION</item>
<item>ENABLE_EXPORTS</item> <item>ENABLE_EXPORTS</item>
<item>EXCLUDE_FROM_ALL</item> <item>EXCLUDE_FROM_ALL</item>
@@ -2236,6 +2346,7 @@
<item>IMPORT_SUFFIX</item> <item>IMPORT_SUFFIX</item>
<item>INCLUDE_DIRECTORIES</item> <item>INCLUDE_DIRECTORIES</item>
<item>INSTALL_NAME_DIR</item> <item>INSTALL_NAME_DIR</item>
<item>INSTALL_REMOVE_ENVIRONMENT_RPATH</item>
<item>INSTALL_RPATH</item> <item>INSTALL_RPATH</item>
<item>INSTALL_RPATH_USE_LINK_PATH</item> <item>INSTALL_RPATH_USE_LINK_PATH</item>
<item>INTERFACE_AUTOUIC_OPTIONS</item> <item>INTERFACE_AUTOUIC_OPTIONS</item>
@@ -2248,6 +2359,7 @@
<item>INTERFACE_LINK_LIBRARIES</item> <item>INTERFACE_LINK_LIBRARIES</item>
<item>INTERFACE_LINK_OPTIONS</item> <item>INTERFACE_LINK_OPTIONS</item>
<item>INTERFACE_POSITION_INDEPENDENT_CODE</item> <item>INTERFACE_POSITION_INDEPENDENT_CODE</item>
<item>INTERFACE_PRECOMPILE_HEADERS</item>
<item>INTERFACE_SOURCES</item> <item>INTERFACE_SOURCES</item>
<item>INTERFACE_SYSTEM_INCLUDE_DIRECTORIES</item> <item>INTERFACE_SYSTEM_INCLUDE_DIRECTORIES</item>
<item>INTERPROCEDURAL_OPTIMIZATION</item> <item>INTERPROCEDURAL_OPTIMIZATION</item>
@@ -2280,10 +2392,14 @@
<item>NO_SONAME</item> <item>NO_SONAME</item>
<item>NO_SYSTEM_FROM_IMPORTED</item> <item>NO_SYSTEM_FROM_IMPORTED</item>
<item>OSX_ARCHITECTURES</item> <item>OSX_ARCHITECTURES</item>
<item>OSX_COMPATIBILITY_VERSION</item>
<item>OSX_CURRENT_VERSION</item>
<item>OUTPUT_NAME</item> <item>OUTPUT_NAME</item>
<item>PDB_NAME</item> <item>PDB_NAME</item>
<item>PDB_OUTPUT_DIRECTORY</item> <item>PDB_OUTPUT_DIRECTORY</item>
<item>POSITION_INDEPENDENT_CODE</item> <item>POSITION_INDEPENDENT_CODE</item>
<item>PRECOMPILE_HEADERS</item>
<item>PRECOMPILE_HEADERS_REUSE_FROM</item>
<item>PREFIX</item> <item>PREFIX</item>
<item>PRIVATE_HEADER</item> <item>PRIVATE_HEADER</item>
<item>PROJECT_LABEL</item> <item>PROJECT_LABEL</item>
@@ -2305,6 +2421,10 @@
<item>Swift_MODULE_DIRECTORY</item> <item>Swift_MODULE_DIRECTORY</item>
<item>Swift_MODULE_NAME</item> <item>Swift_MODULE_NAME</item>
<item>TYPE</item> <item>TYPE</item>
<item>UNITY_BUILD</item>
<item>UNITY_BUILD_BATCH_SIZE</item>
<item>UNITY_BUILD_CODE_AFTER_INCLUDE</item>
<item>UNITY_BUILD_CODE_BEFORE_INCLUDE</item>
<item>VERSION</item> <item>VERSION</item>
<item>VISIBILITY_INLINES_HIDDEN</item> <item>VISIBILITY_INLINES_HIDDEN</item>
<item>VS_CONFIGURATION_TYPE</item> <item>VS_CONFIGURATION_TYPE</item>
@@ -2313,9 +2433,11 @@
<item>VS_DEBUGGER_ENVIRONMENT</item> <item>VS_DEBUGGER_ENVIRONMENT</item>
<item>VS_DEBUGGER_WORKING_DIRECTORY</item> <item>VS_DEBUGGER_WORKING_DIRECTORY</item>
<item>VS_DESKTOP_EXTENSIONS_VERSION</item> <item>VS_DESKTOP_EXTENSIONS_VERSION</item>
<item>VS_DOTNET_DOCUMENTATION_FILE</item>
<item>VS_DOTNET_REFERENCES</item> <item>VS_DOTNET_REFERENCES</item>
<item>VS_DOTNET_REFERENCES_COPY_LOCAL</item> <item>VS_DOTNET_REFERENCES_COPY_LOCAL</item>
<item>VS_DOTNET_TARGET_FRAMEWORK_VERSION</item> <item>VS_DOTNET_TARGET_FRAMEWORK_VERSION</item>
<item>VS_DPI_AWARE</item>
<item>VS_GLOBAL_KEYWORD</item> <item>VS_GLOBAL_KEYWORD</item>
<item>VS_GLOBAL_PROJECT_TYPES</item> <item>VS_GLOBAL_PROJECT_TYPES</item>
<item>VS_GLOBAL_ROOTNAMESPACE</item> <item>VS_GLOBAL_ROOTNAMESPACE</item>
@@ -2346,6 +2468,7 @@
<item>XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN</item> <item>XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN</item>
<item>XCODE_SCHEME_ARGUMENTS</item> <item>XCODE_SCHEME_ARGUMENTS</item>
<item>XCODE_SCHEME_DEBUG_AS_ROOT</item> <item>XCODE_SCHEME_DEBUG_AS_ROOT</item>
<item>XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING</item>
<item>XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER</item> <item>XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER</item>
<item>XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS</item> <item>XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS</item>
<item>XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE</item> <item>XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE</item>
@@ -2360,6 +2483,7 @@
<item>XCODE_SCHEME_THREAD_SANITIZER_STOP</item> <item>XCODE_SCHEME_THREAD_SANITIZER_STOP</item>
<item>XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER</item> <item>XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER</item>
<item>XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP</item> <item>XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP</item>
<item>XCODE_SCHEME_WORKING_DIRECTORY</item>
<item>XCODE_SCHEME_ZOMBIE_OBJECTS</item> <item>XCODE_SCHEME_ZOMBIE_OBJECTS</item>
<item>XCTEST</item> <item>XCTEST</item>
</list> </list>
@@ -2386,6 +2510,8 @@
<item>SKIP_AUTOMOC</item> <item>SKIP_AUTOMOC</item>
<item>SKIP_AUTORCC</item> <item>SKIP_AUTORCC</item>
<item>SKIP_AUTOUIC</item> <item>SKIP_AUTOUIC</item>
<item>SKIP_PRECOMPILE_HEADERS</item>
<item>SKIP_UNITY_BUILD_INCLUSION</item>
<item>SYMBOLIC</item> <item>SYMBOLIC</item>
<item>Swift_DEPENDENCIES_FILE</item> <item>Swift_DEPENDENCIES_FILE</item>
<item>Swift_DIAGNOSTICS_FILE</item> <item>Swift_DIAGNOSTICS_FILE</item>
@@ -2429,6 +2555,7 @@
<item>REQUIRED_FILES</item> <item>REQUIRED_FILES</item>
<item>RESOURCE_LOCK</item> <item>RESOURCE_LOCK</item>
<item>RUN_SERIAL</item> <item>RUN_SERIAL</item>
<item>SKIP_REGULAR_EXPRESSION</item>
<item>SKIP_RETURN_CODE</item> <item>SKIP_RETURN_CODE</item>
<item>TIMEOUT</item> <item>TIMEOUT</item>
<item>TIMEOUT_AFTER_MATCH</item> <item>TIMEOUT_AFTER_MATCH</item>
@@ -2621,6 +2748,7 @@
<WordDetect String="target_link_directories" insensitive="true" attribute="Command" context="target_link_directories_ctx" /> <WordDetect String="target_link_directories" insensitive="true" attribute="Command" context="target_link_directories_ctx" />
<WordDetect String="target_link_libraries" insensitive="true" attribute="Command" context="target_link_libraries_ctx" /> <WordDetect String="target_link_libraries" insensitive="true" attribute="Command" context="target_link_libraries_ctx" />
<WordDetect String="target_link_options" insensitive="true" attribute="Command" context="target_link_options_ctx" /> <WordDetect String="target_link_options" insensitive="true" attribute="Command" context="target_link_options_ctx" />
<WordDetect String="target_precompile_headers" insensitive="true" attribute="Command" context="target_precompile_headers_ctx" />
<WordDetect String="target_sources" insensitive="true" attribute="Command" context="target_sources_ctx" /> <WordDetect String="target_sources" insensitive="true" attribute="Command" context="target_sources_ctx" />
<WordDetect String="try_compile" insensitive="true" attribute="Command" context="try_compile_ctx" /> <WordDetect String="try_compile" insensitive="true" attribute="Command" context="try_compile_ctx" />
<WordDetect String="try_run" insensitive="true" attribute="Command" context="try_run_ctx" /> <WordDetect String="try_run" insensitive="true" attribute="Command" context="try_run_ctx" />
@@ -2838,6 +2966,7 @@
</context> </context>
<context attribute="Normal Text" lineEndContext="#stay" name="get_cmake_property_ctx_op"> <context attribute="Normal Text" lineEndContext="#stay" name="get_cmake_property_ctx_op">
<IncludeRules context="EndCmdPop2" /> <IncludeRules context="EndCmdPop2" />
<keyword attribute="Special Args" context="#stay" String="get_cmake_property_sargs" />
<keyword attribute="Property" context="#stay" String="global-properties" /> <keyword attribute="Property" context="#stay" String="global-properties" />
<IncludeRules context="Detect More global-properties" /> <IncludeRules context="Detect More global-properties" />
<IncludeRules context="User Function Args" /> <IncludeRules context="User Function Args" />
@@ -3442,6 +3571,14 @@
<keyword attribute="Named Args" context="#stay" String="target_link_options_nargs" /> <keyword attribute="Named Args" context="#stay" String="target_link_options_nargs" />
<IncludeRules context="User Function Args" /> <IncludeRules context="User Function Args" />
</context> </context>
<context attribute="Normal Text" lineEndContext="#stay" name="target_precompile_headers_ctx">
<DetectChar attribute="Normal Text" context="target_precompile_headers_ctx_op" char="(" />
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="target_precompile_headers_ctx_op">
<IncludeRules context="EndCmdPop2" />
<keyword attribute="Named Args" context="#stay" String="target_precompile_headers_nargs" />
<IncludeRules context="User Function Args" />
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="target_sources_ctx"> <context attribute="Normal Text" lineEndContext="#stay" name="target_sources_ctx">
<DetectChar attribute="Normal Text" context="target_sources_ctx_op" char="(" /> <DetectChar attribute="Normal Text" context="target_sources_ctx_op" char="(" />
</context> </context>
@@ -3549,6 +3686,7 @@
<context attribute="Normal Text" lineEndContext="#stay" name="ctest_test_ctx_op"> <context attribute="Normal Text" lineEndContext="#stay" name="ctest_test_ctx_op">
<IncludeRules context="EndCmdPop2" /> <IncludeRules context="EndCmdPop2" />
<keyword attribute="Named Args" context="#stay" String="ctest_test_nargs" /> <keyword attribute="Named Args" context="#stay" String="ctest_test_nargs" />
<keyword attribute="Special Args" context="#stay" String="ctest_test_sargs" />
<IncludeRules context="User Function Args" /> <IncludeRules context="User Function Args" />
</context> </context>
<context attribute="Normal Text" lineEndContext="#stay" name="ctest_update_ctx"> <context attribute="Normal Text" lineEndContext="#stay" name="ctest_update_ctx">
@@ -3645,9 +3783,9 @@
</context> </context>
<context attribute="Normal Text" lineEndContext="#stay" name="Detect Builtin Variables"> <context attribute="Normal Text" lineEndContext="#stay" name="Detect Builtin Variables">
<RegExpr attribute="Internal Name" context="#stay" String="\b_&id_re;\b" />
<keyword attribute="Builtin Variable" context="#stay" String="variables" insensitive="false" /> <keyword attribute="Builtin Variable" context="#stay" String="variables" insensitive="false" />
<IncludeRules context="Detect More Builtin Variables" /> <IncludeRules context="Detect More Builtin Variables" />
<RegExpr attribute="Internal Name" context="#stay" String="\b_&id_re;\b" />
</context> </context>
<context attribute="Normal Text" lineEndContext="#stay" name="Detect More Builtin Variables"> <context attribute="Normal Text" lineEndContext="#stay" name="Detect More Builtin Variables">
@@ -3679,6 +3817,7 @@
<RegExpr attribute="Builtin Variable" context="#stay" String="\b&id_re;_LIBRARY_DIRS\b" /> <RegExpr attribute="Builtin Variable" context="#stay" String="\b&id_re;_LIBRARY_DIRS\b" />
<RegExpr attribute="Builtin Variable" context="#stay" String="\b&id_re;_VERSION_COUNT\b" /> <RegExpr attribute="Builtin Variable" context="#stay" String="\b&id_re;_VERSION_COUNT\b" />
<RegExpr attribute="Builtin Variable" context="#stay" String="\b&id_re;_VERSION_STRING\b" /> <RegExpr attribute="Builtin Variable" context="#stay" String="\b&id_re;_VERSION_STRING\b" />
<RegExpr attribute="Builtin Variable" context="#stay" String="\b&id_re;_MODULE_NAME\b" />
<RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_POSTFIX\b" /> <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_POSTFIX\b" />
<RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_ANDROID_TOOLCHAIN_MACHINE\b" /> <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_ANDROID_TOOLCHAIN_MACHINE\b" />
<RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_ANDROID_TOOLCHAIN_PREFIX\b" /> <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_ANDROID_TOOLCHAIN_PREFIX\b" />
@@ -3751,8 +3890,8 @@
<RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_MODULE_LINKER_FLAGS_&id_re;\b" /> <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_MODULE_LINKER_FLAGS_&id_re;\b" />
<RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_MODULE_LINKER_FLAGS_&id_re;_INIT\b" /> <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_MODULE_LINKER_FLAGS_&id_re;_INIT\b" />
<RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_PDB_OUTPUT_DIRECTORY_&id_re;\b" /> <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_PDB_OUTPUT_DIRECTORY_&id_re;\b" />
<RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_POLICY_DEFAULT_CMP&id_re;\b" /> <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_POLICY_DEFAULT_CMP[0-9]{4}\b" />
<RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_POLICY_WARNING_CMP&id_re;\b" /> <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_POLICY_WARNING_CMP[0-9]{4}\b" />
<RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_PROJECT_&id_re;_INCLUDE\b" /> <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_PROJECT_&id_re;_INCLUDE\b" />
<RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_RUNTIME_OUTPUT_DIRECTORY_&id_re;\b" /> <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_RUNTIME_OUTPUT_DIRECTORY_&id_re;\b" />
<RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_SHARED_LINKER_FLAGS_&id_re;\b" /> <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_SHARED_LINKER_FLAGS_&id_re;\b" />
@@ -3771,7 +3910,7 @@
<RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_COMPONENT_&id_re;_GROUP\b" /> <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_COMPONENT_&id_re;_GROUP\b" />
<RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_COMPONENT_&id_re;_HIDDEN\b" /> <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_COMPONENT_&id_re;_HIDDEN\b" />
<RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_COMPONENT_&id_re;_REQUIRED\b" /> <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_COMPONENT_&id_re;_REQUIRED\b" />
<RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_COMPONENT_&id_re;_DESCRIPTION\b" /> <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_DEBIAN_&id_re;_DESCRIPTION\b" />
<RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_DEBIAN_&id_re;_FILE_NAME\b" /> <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_DEBIAN_&id_re;_FILE_NAME\b" />
<RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_DEBIAN_&id_re;_PACKAGE_ARCHITECTURE\b" /> <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_DEBIAN_&id_re;_PACKAGE_ARCHITECTURE\b" />
<RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_DEBIAN_&id_re;_PACKAGE_BREAKS\b" /> <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_DEBIAN_&id_re;_PACKAGE_BREAKS\b" />
@@ -3791,6 +3930,7 @@
<RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_DEBIAN_&id_re;_PACKAGE_SOURCE\b" /> <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_DEBIAN_&id_re;_PACKAGE_SOURCE\b" />
<RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_DEBIAN_&id_re;_PACKAGE_SUGGESTS\b" /> <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_DEBIAN_&id_re;_PACKAGE_SUGGESTS\b" />
<RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_DEBIAN_&id_re;_DEBUGINFO_PACKAGE\b" /> <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_DEBIAN_&id_re;_DEBUGINFO_PACKAGE\b" />
<RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_DMG_&id_re;_FILE_NAME\b" />
<RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_NSIS_&id_re;_INSTALL_DIRECTORY\b" /> <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_NSIS_&id_re;_INSTALL_DIRECTORY\b" />
<RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_NUGET_&id_re;_PACKAGE_AUTHORS\b" /> <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_NUGET_&id_re;_PACKAGE_AUTHORS\b" />
<RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_NUGET_&id_re;_PACKAGE_COPYRIGHT\b" /> <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_NUGET_&id_re;_PACKAGE_COPYRIGHT\b" />
@@ -3808,6 +3948,8 @@
<RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_NUGET_&id_re;_PACKAGE_TITLE\b" /> <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_NUGET_&id_re;_PACKAGE_TITLE\b" />
<RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_NUGET_&id_re;_PACKAGE_VERSION\b" /> <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_NUGET_&id_re;_PACKAGE_VERSION\b" />
<RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_NUGET_PACKAGE_DEPENDENCIES_&id_re;_VERSION\b" /> <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_NUGET_PACKAGE_DEPENDENCIES_&id_re;_VERSION\b" />
<RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_POSTFLIGHT_&id_re;_SCRIPT\b" />
<RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_PREFLIGHT_&id_re;_SCRIPT\b" />
<RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_RPM_&id_re;_DEFAULT_DIR_PERMISSIONS\b" /> <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_RPM_&id_re;_DEFAULT_DIR_PERMISSIONS\b" />
<RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_RPM_&id_re;_DEFAULT_FILE_PERMISSIONS\b" /> <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_RPM_&id_re;_DEFAULT_FILE_PERMISSIONS\b" />
<RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_RPM_&id_re;_DEFAULT_GROUP\b" /> <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_RPM_&id_re;_DEFAULT_GROUP\b" />
@@ -3866,6 +4008,7 @@
<RegExpr attribute="Standard Environment Variable" context="#stay" String="\b&id_re;_ROOT\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;\b" />
<RegExpr attribute="Standard Environment Variable" context="#stay" String="\bASM&id_re;FLAGS\b" /> <RegExpr attribute="Standard Environment Variable" context="#stay" String="\bASM&id_re;FLAGS\b" />
<RegExpr attribute="Standard Environment Variable" context="#stay" String="\bCMAKE_&id_re;_COMPILER_LAUNCHER\b" />
<DetectIdentifier /> <DetectIdentifier />
<DetectChar attribute="Environment Variable Substitution" context="#pop#pop" char="}" /> <DetectChar attribute="Environment Variable Substitution" context="#pop#pop" char="}" />
</context> </context>

View File

@@ -3,9 +3,9 @@
[ [
<!ENTITY name "[A-Za-z_:][\w.:_-]*"> <!ENTITY name "[A-Za-z_:][\w.:_-]*">
<!ENTITY attributeName "[A-Za-z_:*#\(\[][\)\]\w.:_-]*"> <!ENTITY attributeName "[A-Za-z_:*#\(\[][\)\]\w.:_-]*">
<!ENTITY entref "&amp;(#[0-9]+|#[xX][0-9A-Fa-f]+|&name;);"> <!ENTITY entref "&amp;(?:#[0-9]+|#[xX][0-9A-Fa-f]+|&name;);">
]> ]>
<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"> <language name="HTML" version="11" kateversion="5.53" section="Markup" extensions="*.htm;*.html;*.shtml;*.shtm" mimetype="text/html" author="Wilbert Berendsen (wilbert@kde.nl)" license="LGPL" priority="10">
<highlighting> <highlighting>
<contexts> <contexts>
@@ -33,37 +33,37 @@
</context> </context>
<context name="FindHTMLTags" attribute="Normal Text" lineEndContext="#stay"> <context name="FindHTMLTags" attribute="Normal Text" lineEndContext="#stay">
<RegExpr attribute="Element" context="El Open" String="&lt;pre\b" insensitive="true" beginRegion="pre" /> <WordDetect attribute="Element" context="El Open" String="&lt;pre" insensitive="true" beginRegion="pre" />
<RegExpr attribute="Element" context="El Open" String="&lt;div\b" insensitive="true" beginRegion="div" /> <WordDetect attribute="Element" context="El Open" String="&lt;div" insensitive="true" beginRegion="div" />
<RegExpr attribute="Element" context="El Open" String="&lt;table\b" insensitive="true" beginRegion="table" /> <WordDetect attribute="Element" context="El Open" String="&lt;table" insensitive="true" beginRegion="table" />
<RegExpr attribute="Element" context="El Open" String="&lt;ul\b" insensitive="true" beginRegion="ul" /> <WordDetect attribute="Element" context="El Open" String="&lt;ul" insensitive="true" beginRegion="ul" />
<RegExpr attribute="Element" context="El Open" String="&lt;ol\b" insensitive="true" beginRegion="ol" /> <WordDetect attribute="Element" context="El Open" String="&lt;ol" insensitive="true" beginRegion="ol" />
<RegExpr attribute="Element" context="El Open" String="&lt;dl\b" insensitive="true" beginRegion="dl" /> <WordDetect attribute="Element" context="El Open" String="&lt;dl" insensitive="true" beginRegion="dl" />
<RegExpr attribute="Element" context="El Open" String="&lt;article\b" insensitive="true" beginRegion="article" /> <WordDetect attribute="Element" context="El Open" String="&lt;article" insensitive="true" beginRegion="article" />
<RegExpr attribute="Element" context="El Open" String="&lt;aside\b" insensitive="true" beginRegion="aside" /> <WordDetect attribute="Element" context="El Open" String="&lt;aside" insensitive="true" beginRegion="aside" />
<RegExpr attribute="Element" context="El Open" String="&lt;details\b" insensitive="true" beginRegion="details" /> <WordDetect attribute="Element" context="El Open" String="&lt;details" insensitive="true" beginRegion="details" />
<RegExpr attribute="Element" context="El Open" String="&lt;figure\b" insensitive="true" beginRegion="figure" /> <WordDetect attribute="Element" context="El Open" String="&lt;figure" insensitive="true" beginRegion="figure" />
<RegExpr attribute="Element" context="El Open" String="&lt;footer\b" insensitive="true" beginRegion="footer" /> <WordDetect attribute="Element" context="El Open" String="&lt;footer" insensitive="true" beginRegion="footer" />
<RegExpr attribute="Element" context="El Open" String="&lt;header\b" insensitive="true" beginRegion="header" /> <WordDetect attribute="Element" context="El Open" String="&lt;header" insensitive="true" beginRegion="header" />
<RegExpr attribute="Element" context="El Open" String="&lt;main\b" insensitive="true" beginRegion="main" /> <WordDetect attribute="Element" context="El Open" String="&lt;main" insensitive="true" beginRegion="main" />
<RegExpr attribute="Element" context="El Open" String="&lt;nav\b" insensitive="true" beginRegion="nav" /> <WordDetect attribute="Element" context="El Open" String="&lt;nav" insensitive="true" beginRegion="nav" />
<RegExpr attribute="Element" context="El Open" String="&lt;section\b" insensitive="true" beginRegion="section" /> <WordDetect attribute="Element" context="El Open" String="&lt;section" insensitive="true" beginRegion="section" />
<RegExpr attribute="Element" context="El Open" String="&lt;&name;" /> <RegExpr attribute="Element" context="El Open" String="&lt;&name;" />
<RegExpr attribute="Element" context="El Close" String="&lt;/pre\b" insensitive="true" endRegion="pre" /> <WordDetect attribute="Element" context="El Close" String="&lt;/pre" insensitive="true" endRegion="pre" />
<RegExpr attribute="Element" context="El Close" String="&lt;/div\b" insensitive="true" endRegion="div" /> <WordDetect attribute="Element" context="El Close" String="&lt;/div" insensitive="true" endRegion="div" />
<RegExpr attribute="Element" context="El Close" String="&lt;/table\b" insensitive="true" endRegion="table" /> <WordDetect attribute="Element" context="El Close" String="&lt;/table" insensitive="true" endRegion="table" />
<RegExpr attribute="Element" context="El Close" String="&lt;/ul\b" insensitive="true" endRegion="ul" /> <WordDetect attribute="Element" context="El Close" String="&lt;/ul" insensitive="true" endRegion="ul" />
<RegExpr attribute="Element" context="El Close" String="&lt;/ol\b" insensitive="true" endRegion="ol" /> <WordDetect attribute="Element" context="El Close" String="&lt;/ol" insensitive="true" endRegion="ol" />
<RegExpr attribute="Element" context="El Close" String="&lt;/dl\b" insensitive="true" endRegion="dl" /> <WordDetect attribute="Element" context="El Close" String="&lt;/dl" insensitive="true" endRegion="dl" />
<RegExpr attribute="Element" context="El Close" String="&lt;/article\b" insensitive="true" endRegion="article" /> <WordDetect attribute="Element" context="El Close" String="&lt;/article" insensitive="true" endRegion="article" />
<RegExpr attribute="Element" context="El Close" String="&lt;/aside\b" insensitive="true" endRegion="aside" /> <WordDetect attribute="Element" context="El Close" String="&lt;/aside" insensitive="true" endRegion="aside" />
<RegExpr attribute="Element" context="El Close" String="&lt;/details\b" insensitive="true" endRegion="details" /> <WordDetect attribute="Element" context="El Close" String="&lt;/details" insensitive="true" endRegion="details" />
<RegExpr attribute="Element" context="El Close" String="&lt;/figure\b" insensitive="true" endRegion="figure" /> <WordDetect attribute="Element" context="El Close" String="&lt;/figure" insensitive="true" endRegion="figure" />
<RegExpr attribute="Element" context="El Close" String="&lt;/footer\b" insensitive="true" endRegion="footer" /> <WordDetect attribute="Element" context="El Close" String="&lt;/footer" insensitive="true" endRegion="footer" />
<RegExpr attribute="Element" context="El Close" String="&lt;/header\b" insensitive="true" endRegion="header" /> <WordDetect attribute="Element" context="El Close" String="&lt;/header" insensitive="true" endRegion="header" />
<RegExpr attribute="Element" context="El Close" String="&lt;/main\b" insensitive="true" endRegion="main" /> <WordDetect attribute="Element" context="El Close" String="&lt;/main" insensitive="true" endRegion="main" />
<RegExpr attribute="Element" context="El Close" String="&lt;/nav\b" insensitive="true" endRegion="nav" /> <WordDetect attribute="Element" context="El Close" String="&lt;/nav" insensitive="true" endRegion="nav" />
<RegExpr attribute="Element" context="El Close" String="&lt;/section\b" insensitive="true" endRegion="section" /> <WordDetect attribute="Element" context="El Close" String="&lt;/section" insensitive="true" endRegion="section" />
<RegExpr attribute="Element" context="El Close" String="&lt;/&name;" /> <RegExpr attribute="Element" context="El Close" String="&lt;/&name;" />
</context> </context>
@@ -85,7 +85,7 @@
</context> </context>
<context name="FindDTDRules" attribute="Other Text" lineEndContext="#stay"> <context name="FindDTDRules" attribute="Other Text" lineEndContext="#stay">
<RegExpr attribute="Doctype" context="Doctype Markupdecl" String="&lt;!(ELEMENT|ENTITY|ATTLIST|NOTATION)\b" /> <RegExpr attribute="Doctype" context="Doctype Markupdecl" String="&lt;!(?:ELEMENT|ENTITY|ATTLIST|NOTATION)\b" />
</context> </context>
@@ -94,7 +94,7 @@
<IncludeRules context="##Alerts" /> <IncludeRules context="##Alerts" />
<DetectIdentifier/> <DetectIdentifier/>
<StringDetect attribute="Comment" context="#pop" String="--&gt;" endRegion="comment" /> <StringDetect attribute="Comment" context="#pop" String="--&gt;" endRegion="comment" />
<RegExpr attribute="Error" context="#stay" String="-(-(?!-&gt;))+" /> <RegExpr attribute="Error" context="#stay" String="-(?:-(?!-&gt;))+" />
</context> </context>
<context name="CDATA" attribute="Other Text" lineEndContext="#stay"> <context name="CDATA" attribute="Other Text" lineEndContext="#stay">
@@ -172,7 +172,7 @@
</context> </context>
<context name="JS" attribute="Other Text" lineEndContext="#stay"> <context name="JS" attribute="Other Text" lineEndContext="#stay">
<RegExpr attribute="Attribute" context="Script-Type" String="(\s+|^)type(?=\=|\s|$)" insensitive="true"/> <RegExpr attribute="Attribute" context="Script-Type" String="(?:\s+|^)type(?=\=|\s|$)" insensitive="true"/>
<DetectChar attribute="Element" context="JS content" char="&gt;" /> <DetectChar attribute="Element" context="JS content" char="&gt;" />
<IncludeRules context="DefaultJS" /> <IncludeRules context="DefaultJS" />
</context> </context>
@@ -257,7 +257,7 @@
</context> </context>
<context name="JSX content" attribute="Other Text" lineEndContext="#stay"> <context name="JSX content" attribute="Other Text" lineEndContext="#stay">
<IncludeRules context="Default JS content"/> <IncludeRules context="Default JS content"/>
<IncludeRules context="Normal##JavaScript React" includeAttrib="true"/> <IncludeRules context="Normal##JavaScript React (JSX)" includeAttrib="true"/>
</context> </context>
<context name="TypeScript" attribute="Other Text" lineEndContext="#stay"> <context name="TypeScript" attribute="Other Text" lineEndContext="#stay">
@@ -310,7 +310,7 @@
</highlighting> </highlighting>
<general> <general>
<comments> <comments>
<comment name="multiLine" start="&lt;!--" end="--&gt;" /> <comment name="multiLine" start="&lt;!--" end="--&gt;" region="comment" />
</comments> </comments>
</general> </general>
</language> </language>

View File

@@ -10,7 +10,7 @@
<!-- v4 by Alex Richardson <arichardson.kde@gmail.com> <!-- v4 by Alex Richardson <arichardson.kde@gmail.com>
added bmake support --> added bmake support -->
<language name="Makefile" section="Other" <language name="Makefile" section="Other"
version="7" kateversion="3.4" version="9" kateversion="3.4"
extensions="GNUmakefile;Makefile;makefile;GNUmakefile.*;Makefile.*;makefile.*;*.mk" extensions="GNUmakefile;Makefile;makefile;GNUmakefile.*;Makefile.*;makefile.*;*.mk"
mimetype="text/x-makefile" priority="11" mimetype="text/x-makefile" priority="11"
author="Per Wigren (wigren@home.se)" license=""> author="Per Wigren (wigren@home.se)" license="">
@@ -185,8 +185,8 @@
<keyword attribute="Keyword" context="bmake_for_loop" String="bmake_for_stmt" firstNonSpace="true" beginRegion="for"/> <keyword attribute="Keyword" context="bmake_for_loop" String="bmake_for_stmt" firstNonSpace="true" beginRegion="for"/>
<keyword attribute="Keyword" context="#stay" String="bmake_endfor_stmt" firstNonSpace="true" endRegion="for"/> <keyword attribute="Keyword" context="#stay" String="bmake_endfor_stmt" firstNonSpace="true" endRegion="for"/>
<RegExpr attribute="Section" context="prereq" String="^\.[^.][^:]*:"/> <RegExpr attribute="Section" context="prereq" String="^\.[^.][^:]*:" column="0"/>
<RegExpr attribute="Target" context="prereq" String="^[^:]*:"/> <RegExpr attribute="Target" context="prereq" String="^[^:]*:" column="0"/>
<DetectIdentifier/> <DetectIdentifier/>
<DetectChar attribute="String" context="string&quot;" char="&quot;"/> <DetectChar attribute="String" context="string&quot;" char="&quot;"/>
<DetectChar attribute="String" context="string'" char="'"/> <DetectChar attribute="String" context="string'" char="'"/>
@@ -203,10 +203,16 @@
<DetectChar attribute="Comment" context="Comment" char="#"/> <DetectChar attribute="Comment" context="Comment" char="#"/>
</context> </context>
<context name="gmake_else" attribute="Error" lineEndContext="#pop"> <context name="gmake_else" attribute="Normal" lineEndContext="#pop">
<DetectSpaces attribute="Normal"/> <DetectSpaces attribute="Normal"/>
<keyword attribute="ControlFlow" String="gmake_if_keywords" context="#stay"/> <keyword attribute="ControlFlow" String="gmake_if_keywords" context="#stay"/>
<IncludeRules context="strings_and_vars"/> <IncludeRules context="strings_and_vars"/>
<Detect2Chars attribute="Special" context="#stay" char="\" char1="#"/>
<Detect2Chars attribute="Special" context="#stay" char="\" char1="\"/>
<!-- NOTE: Allow highlighting any variable name (see bug #417379), for example:
else ifdef foo
else ifeq (bar, foo)
-->
</context> </context>
<context name="bmake_include" attribute="Normal" lineEndContext="#pop"> <context name="bmake_include" attribute="Normal" lineEndContext="#pop">
@@ -341,7 +347,8 @@
<DetectChar attribute="Operator" char=")" context="#pop#pop#pop"/> <DetectChar attribute="Operator" char=")" context="#pop#pop#pop"/>
<DetectChar attribute="Operator" context="dollar" char="$"/> <DetectChar attribute="Operator" context="dollar" char="$"/>
<DetectSpaces attribute="Error" context="#stay"/> <DetectSpaces attribute="Error" context="#stay"/>
<AnyChar attribute="Error" context="#stay" String="=#:"/> <DetectChar attribute="RealOperator" context="SubstitutionRefs" char=":"/>
<AnyChar attribute="Error" context="#stay" String="=#"/>
</context> </context>
<context name="callVar{" attribute="Variable" lineEndContext="#stay"> <context name="callVar{" attribute="Variable" lineEndContext="#stay">
@@ -456,6 +463,16 @@
<DetectChar attribute="String" context="string'" char="'"/> <DetectChar attribute="String" context="string'" char="'"/>
</context> </context>
<!-- $(var:pattern=replacement) -->
<context name="SubstitutionRefs" attribute="VarModifier" lineEndContext="#stay">
<DetectChar attribute="RealOperator" context="#pop!SubstitutionRefsReplacement" char="="/>
<IncludeRules context="SubstitutionRefsReplacement"/>
</context>
<context name="SubstitutionRefsReplacement" attribute="VarModifier" lineEndContext="#stay">
<DetectChar attribute="Operator" char=")" context="#pop#pop#pop#pop"/>
<DetectChar attribute="Operator" context="dollar" char="$"/>
</context>
<context attribute="Comment" lineEndContext="#pop" name="Comment"> <context attribute="Comment" lineEndContext="#pop" name="Comment">
<LineContinue attribute="Comment" context="#stay" /> <LineContinue attribute="Comment" context="#stay" />
<IncludeRules context="##Alerts" /> <IncludeRules context="##Alerts" />

View File

@@ -40,10 +40,12 @@
<!-- emphasis text --> <!-- emphasis text -->
<!ENTITY emphasisregex_ast "\*(?:&contentregex_ast;\*|\*{1,4}&contentregex_ast;\*(?!\*))"> <!ENTITY emphasisregex_ast "\*(?:&contentregex_ast;\*|\*{1,4}&contentregex_ast;\*(?!\*))">
<!ENTITY emphasisregex_und "\b_(?:&contentregex_und;_+|_{1,4}&contentregex_und;_)\b"> <!ENTITY emphasisregex_und "\b_(?:&contentregex_und;_+|_{1,4}&contentregex_und;_)\b">
<!-- links --> <!-- links.
Keep in sync with reStructuredText (rest) -->
<!ENTITY startlink "(?:https?|ftp)\://"> <!ENTITY startlink "(?:https?|ftp)\://">
<!ENTITY link "&startlink;[^&quot;&gt;\s]+"> <!ENTITY link "&startlink;[^&quot;&gt;\s]+">
<!-- link in normal text --> <!-- link in normal text.
Keep in sync with reStructuredTexts (rest) StandaloneHyperlink attribute -->
<!ENTITY implicitlink "\b&startlink;[^&quot;&gt;\s`\)]*[^\s!&quot;&apos;`\(\)\*,\.:;&lt;&gt;\?~\]\}\\](?=[[:punct:]]*(?:[\s\)]|$))"> <!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) --> <!-- references: [name], [name][id], [name][id] "title", [name](https://example.com) -->
<!ENTITY refchar "(?:\\.|[^\]\\])"> <!ENTITY refchar "(?:\\.|[^\]\\])">
@@ -88,7 +90,7 @@
<!ENTITY checkbox "\[[ x]\](?=\s)"> <!ENTITY checkbox "\[[ x]\](?=\s)">
]> ]>
<language name="Markdown" version="10" kateversion="5.53" section="Markup" extensions="*.md;*.mmd;*.markdown" priority="15" author="Darrin Yeager, Claes Holmerson" license="GPL,BSD"> <language name="Markdown" version="11" kateversion="5.53" section="Markup" extensions="*.md;*.mmd;*.markdown" priority="15" author="Darrin Yeager, Claes Holmerson" license="GPL,BSD">
<highlighting> <highlighting>
<contexts> <contexts>
<!-- Start of the Markdown document: find metadata or code block --> <!-- Start of the Markdown document: find metadata or code block -->
@@ -392,7 +394,7 @@
</context> </context>
<context attribute="Normal Text" lineEndContext="#stay" name="jsx-code"> <context attribute="Normal Text" lineEndContext="#stay" name="jsx-code">
<IncludeRules context="code"/> <IncludeRules context="code"/>
<IncludeRules context="Normal##JavaScript React" includeAttrib="true"/> <IncludeRules context="Normal##JavaScript React (JSX)" includeAttrib="true"/>
</context> </context>
<context attribute="Normal Text" lineEndContext="#stay" name="json-code"> <context attribute="Normal Text" lineEndContext="#stay" name="json-code">
<IncludeRules context="code"/> <IncludeRules context="code"/>

View File

@@ -8,7 +8,7 @@
Copyright (c) 2012-2014 by Alex Turbov (i.zaufi@gmail.com) Copyright (c) 2012-2014 by Alex Turbov (i.zaufi@gmail.com)
--> -->
<language name="Modelines" <language name="Modelines"
version="4" version="5"
kateversion="5.0" kateversion="5.0"
section="Other" section="Other"
extensions="" extensions=""
@@ -130,10 +130,10 @@
<context name="Normal" attribute="Comment" lineEndContext="#pop"> <context name="Normal" attribute="Comment" lineEndContext="#pop">
<DetectSpaces /> <DetectSpaces />
<keyword String="ModelineStartKeyword" context="Modeline" attribute="Keyword" /> <keyword String="ModelineStartKeyword" context="Modeline" attribute="Keyword" />
<RegExpr String="kate-(mimetype|wildcard)\(.*\):" context="Modeline" attribute="Keyword" /> <RegExpr String="kate-(?:mimetype|wildcard)\(.*\):" context="Modeline" attribute="Keyword" />
</context> </context>
<context name="Modeline" attribute="Comment" lineEndContext="#pop"> <context name="Modeline" attribute="Comment" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
<DetectSpaces /> <DetectSpaces />
<keyword String="Booleans" context="Booleans" attribute="Variable" /> <keyword String="Booleans" context="Booleans" attribute="Variable" />
<keyword String="Integrals" context="Integrals" attribute="Variable" /> <keyword String="Integrals" context="Integrals" attribute="Variable" />
@@ -142,7 +142,7 @@
<LineContinue context="#pop" /> <LineContinue context="#pop" />
</context> </context>
<context name="Booleans" attribute="Comment" lineEndContext="#pop"> <context name="Booleans" attribute="Comment" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
<DetectSpaces /> <DetectSpaces />
<keyword String="True" attribute="Option ON" context="#stay" /> <keyword String="True" attribute="Option ON" context="#stay" />
<keyword String="False" attribute="Option OFF" context="#stay" /> <keyword String="False" attribute="Option OFF" context="#stay" />
@@ -150,7 +150,7 @@
<LineContinue context="#pop" /> <LineContinue context="#pop" />
</context> </context>
<context name="Integrals" attribute="Comment" lineEndContext="#pop"> <context name="Integrals" attribute="Comment" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
<DetectSpaces /> <DetectSpaces />
<Int attribute="Number" context="#stay" /> <Int attribute="Number" context="#stay" />
<DetectChar char="&end;" context="#pop" attribute="Variable" /> <DetectChar char="&end;" context="#pop" attribute="Variable" />
@@ -164,13 +164,13 @@
<LineContinue context="#pop" /> <LineContinue context="#pop" />
</context> </context>
<context name="RemoveSpaces" attribute="Comment" lineEndContext="#pop"> <context name="RemoveSpaces" attribute="Comment" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
<DetectSpaces /> <DetectSpaces />
<keyword String="RemoveSpacesOptions" attribute="Value" context="#pop!RemoveSpacesEnd" /> <keyword String="RemoveSpacesOptions" attribute="Value" context="#pop!RemoveSpacesEnd" />
<DetectChar char="&end;" context="#pop" attribute="Variable" /> <DetectChar char="&end;" context="#pop" attribute="Variable" />
<LineContinue context="#pop" /> <LineContinue context="#pop" />
</context> </context>
<context name="RemoveSpacesEnd" attribute="Comment" lineEndContext="#pop"> <context name="RemoveSpacesEnd" attribute="Comment" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
<DetectChar char="&end;" context="#pop" attribute="Variable" /> <DetectChar char="&end;" context="#pop" attribute="Variable" />
</context> </context>

View File

@@ -39,7 +39,7 @@
Enhance tr/// and y/// support. Enhance tr/// and y/// support.
--> -->
<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"> <language name="Perl" version="10" 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> <highlighting>
<list name="keywords"> <list name="keywords">
<item>if</item> <item>if</item>
@@ -252,6 +252,7 @@
<item>rewinddir</item> <item>rewinddir</item>
<item>rindex</item> <item>rindex</item>
<item>rmdir</item> <item>rmdir</item>
<item>say</item>
<item>scalar</item> <item>scalar</item>
<item>seek</item> <item>seek</item>
<item>seekdir</item> <item>seekdir</item>

View File

@@ -1,7 +1,7 @@
<!DOCTYPE language SYSTEM "language.dtd"> <!DOCTYPE language SYSTEM "language.dtd">
<language <language
name="PowerShell" name="PowerShell"
version="4" version="5"
kateversion="5.0" kateversion="5.0"
extensions="*.ps1;*.ps1m;*.ps1d" extensions="*.ps1;*.ps1m;*.ps1d"
section="Scripts" section="Scripts"
@@ -892,7 +892,12 @@
<RegExpr attribute="Symbol" context="Member" String="[.]{1,1}" /> <RegExpr attribute="Symbol" context="Member" String="[.]{1,1}" />
<AnyChar attribute="Symbol" context="#stay" String=":!%&amp;()+,-/.*&lt;=&gt;?[]|~^&#59;"/> <AnyChar attribute="Symbol" context="#stay" String=":!%&amp;()+,-/.*&lt;=&gt;?[]|~^&#59;"/>
</context> </context>
<context attribute="String Char" lineEndContext="#stay" name="StringEscape">
<RegExpr attribute="String Char" String="`[`&quot;0abefnrtv]" context="#stay"/>
<RegExpr attribute="String Char" String="`u\{[0-9A-Fa-f]+\}" context="#stay"/>
</context>
<context attribute="String" lineEndContext="#pop" name="String"> <context attribute="String" lineEndContext="#pop" name="String">
<IncludeRules context="StringEscape"/>
<LineContinue attribute="String" context="#pop"/> <LineContinue attribute="String" context="#pop"/>
<DetectChar attribute="String" context="#pop" char="&quot;"/> <DetectChar attribute="String" context="#pop" char="&quot;"/>
</context> </context>
@@ -916,6 +921,7 @@
<itemData name="Function" defStyleNum="dsFunction" spellChecking="false"/> <itemData name="Function" defStyleNum="dsFunction" spellChecking="false"/>
<itemData name="Data Type" defStyleNum="dsDataType" spellChecking="false"/> <itemData name="Data Type" defStyleNum="dsDataType" spellChecking="false"/>
<itemData name="String" defStyleNum="dsString"/> <itemData name="String" defStyleNum="dsString"/>
<itemData name="String Char" defStyleNum="dsChar" spellChecking="false"/>
<itemData name="HereString" defStyleNum="dsVerbatimString"/> <itemData name="HereString" defStyleNum="dsVerbatimString"/>
<itemData name="Comment" defStyleNum="dsComment"/> <itemData name="Comment" defStyleNum="dsComment"/>
<itemData name="Cmdlets" defStyleNum="dsBuiltIn" spellChecking="false"/> <itemData name="Cmdlets" defStyleNum="dsBuiltIn" spellChecking="false"/>

View File

@@ -1,5 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language> <!DOCTYPE language SYSTEM "language.dtd"
[
<!ENTITY digitPart "[0-9](?:_?[0-9])*">
<!ENTITY beforeDigit "(?&lt;![\.\w[:^ascii:]])">
<!ENTITY beforePointFloat "(?&lt;![\w[:^ascii:]])">
]>
<!-- Python syntax highlightning v0.9 by Per Wigren --> <!-- Python syntax highlightning v0.9 by Per Wigren -->
<!-- Python syntax highlighting v1.9 by Michael Bueker (improved keyword differentiation) --> <!-- Python syntax highlighting v1.9 by Michael Bueker (improved keyword differentiation) -->
<!-- Python syntax highlighting v1.97 by Paul Giannaros --> <!-- Python syntax highlighting v1.97 by Paul Giannaros -->
@@ -14,7 +19,7 @@
<!-- v2.07 add support for %prog and co, see bug 142832 --> <!-- v2.07 add support for %prog and co, see bug 142832 -->
<!-- v2.08 add missing overloaders, new Python 3 statements, builtins, and keywords --> <!-- v2.08 add missing overloaders, new Python 3 statements, builtins, and keywords -->
<!-- v2.29 recognize escape sequenzes correctly --> <!-- v2.29 recognize escape sequenzes correctly -->
<language name="Python" version="9" style="python" indenter="python" kateversion="5.0" section="Scripts" extensions="*.py;*.pyw;SConstruct;SConscript" mimetype="application/x-python;text/x-python;text/x-python3" casesensitive="1" author="Michael Bueker" license=""> <language name="Python" version="11" style="python" indenter="python" kateversion="5.0" section="Scripts" extensions="*.py;*.pyw;SConstruct;SConscript;*.FCMacro" mimetype="application/x-python;text/x-python;text/x-python3" casesensitive="1" author="Michael Bueker" license="">
<highlighting> <highlighting>
<list name="import"> <list name="import">
<item>import</item> <item>import</item>
@@ -65,6 +70,7 @@
<item>ascii</item> <item>ascii</item>
<item>basestring</item> <item>basestring</item>
<item>bin</item> <item>bin</item>
<item>breakpoint</item>
<item>bool</item> <item>bool</item>
<item>buffer</item> <item>buffer</item>
<item>bytearray</item> <item>bytearray</item>
@@ -342,15 +348,17 @@
<keyword attribute="Overloaders" String="overloaders" context="#stay"/> <keyword attribute="Overloaders" String="overloaders" context="#stay"/>
<RegExpr attribute="Normal Text" String="[a-zA-Z_][a-zA-Z_0-9]{2,}" context="#stay"/> <RegExpr attribute="Normal Text" String="[a-zA-Z_][a-zA-Z_0-9]{2,}" context="#stay"/>
<RegExpr attribute="Complex" String=" ((([0-9]*\.[0-9]+|[0-9]+\.)|([0-9]+|([0-9]*\.[0-9]+|[0-9]+\.))[eE](\+|-)?[0-9]+)|[0-9]+)[jJ]" context="#stay"/> <!-- Complex: 1j ; 1.1j ; 1.j ; .1j ; 1e3j ; 1.1e3j ; 1.e3j ; .1e3j -->
<Float attribute="Float" context="#stay" /> <RegExpr attribute="Complex" String="(?:&beforeDigit;&digitPart;(?:\.(?:&digitPart;)?)?|&beforePointFloat;\.&digitPart;)(?:[eE][\+\-]?&digitPart;)?[jJ]\b" context="#stay"/>
<HlCHex attribute="Hex" context="#stay"/> <!-- Hexadecimal: 0xA1, Binary: 0b01, Octal: 0o71 -->
<HlCOct attribute="Octal" context="#stay"/> <RegExpr attribute="Hex" String="&beforeDigit;0[xX](?:_?[\da-fA-F])+\b" context="#stay"/>
<Int attribute="Int" context="Int Suffixes"/> <RegExpr attribute="Binary" String="&beforeDigit;0[bB](?:_?[01])+\b" context="#stay"/>
<RegExpr attribute="Octal" String="&beforeDigit;0[oO](?:_?[0-7])+\b" context="#stay"/>
<RegExpr attribute="Int" String=" ([0-9]+_)+[0-9]+" context="#stay"/> <!-- Float: 1.1 ; 1. ; .1 ; 1e3 ; 1.1e3 ; 1.e3 ; .1e3 -->
<RegExpr attribute="Float" String=" ([0-9]+_)+[0-9]+\.[0-9]+" context="#stay"/> <RegExpr attribute="Float" String="(?:&beforeDigit;&digitPart;(?:\.(?:&digitPart;)?)?|&beforePointFloat;\.&digitPart;)[eE][\+\-]?&digitPart;\b" context="#stay"/>
<RegExpr attribute="Hex" String=" [0-9]x([A-F0-9]+_)+[A-F0-9]+" context="#stay"/> <RegExpr attribute="Float" String="(?:&beforeDigit;&digitPart;\.(?:&digitPart;\b)?|&beforePointFloat;\.&digitPart;\b)" context="#stay"/>
<!-- Decimal: 123 ; 000 -->
<RegExpr attribute="Int" String="&beforeDigit;(?:[1-9](?:_?\d)*|0(?:_?0)*)[lL]?\b" context="#stay"/>
<DetectChar attribute="Normal Text" char="{" context="Dictionary" beginRegion="Dictionary"/> <DetectChar attribute="Normal Text" char="{" context="Dictionary" beginRegion="Dictionary"/>
<DetectChar attribute="Normal Text" char="[" context="List" beginRegion="List"/> <DetectChar attribute="Normal Text" char="[" context="List" beginRegion="List"/>
@@ -362,14 +370,10 @@
<IncludeRules context="StringVariants" /> <IncludeRules context="StringVariants" />
<RegExpr attribute="Decorator" String="@[_a-zA-Z][\._a-zA-Z0-9]*" firstNonSpace="true"/> <RegExpr attribute="Decorator" String="@[_a-zA-Z[:^ascii:]][\._a-zA-Z0-9[:^ascii:]]*" firstNonSpace="true"/>
<AnyChar attribute="Operator" String="+*/%\|=;\!&lt;&gt;!^&amp;~-@" context="#stay"/> <AnyChar attribute="Operator" String="+*/%\|=;\!&lt;&gt;!^&amp;~-@" context="#stay"/>
</context> </context>
<context name="Int Suffixes" attribute="Int" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
<StringDetect attribute="Int" context="#pop" String="L" insensitive="true"/>
</context>
<context name="#CheckForString" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> <context name="#CheckForString" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
<DetectSpaces/> <DetectSpaces/>
<LineContinue attribute="Normal Text" context="CheckForStringNext"/> <LineContinue attribute="Normal Text" context="CheckForStringNext"/>
@@ -661,6 +665,7 @@
<itemData name="Int" defStyleNum="dsDecVal" spellChecking="false"/> <itemData name="Int" defStyleNum="dsDecVal" spellChecking="false"/>
<itemData name="Hex" defStyleNum="dsBaseN" spellChecking="false"/> <itemData name="Hex" defStyleNum="dsBaseN" spellChecking="false"/>
<itemData name="Octal" defStyleNum="dsBaseN" spellChecking="false"/> <itemData name="Octal" defStyleNum="dsBaseN" spellChecking="false"/>
<itemData name="Binary" defStyleNum="dsBaseN" spellChecking="false"/>
<itemData name="Complex" defStyleNum="dsOthers" spellChecking="false"/> <itemData name="Complex" defStyleNum="dsOthers" spellChecking="false"/>
<itemData name="Comment" defStyleNum="dsComment"/> <itemData name="Comment" defStyleNum="dsComment"/>
<itemData name="String" defStyleNum="dsString"/> <itemData name="String" defStyleNum="dsString"/>

View File

@@ -4,9 +4,9 @@
<!-- names must start with a letter, ideogram or underscore. \w matches any <!-- names must start with a letter, ideogram or underscore. \w matches any
word character *or* a number, hence the lookahead --> word character *or* a number, hence the lookahead -->
<!ENTITY name "(?![0-9])[\w_:][\w.:_-]*"> <!ENTITY name "(?![0-9])[\w_:][\w.:_-]*">
<!ENTITY entref "&amp;(#[0-9]+|#[xX][0-9A-Fa-f]+|&name;);"> <!ENTITY entref "&amp;(?:#[0-9]+|#[xX][0-9A-Fa-f]+|&name;);">
]> ]>
<language name="XML" version="9" kateversion="3.4" section="Markup" extensions="*.docbook;*.xml;*.rc;*.daml;*.rdf;*.rss;*.xspf;*.xsd;*.svg;*.ui;*.kcfg;*.qrc;*.wsdl;*.scxml;*.xbel;*.dae;*.sch;*.brd" mimetype="text/xml;text/book;text/daml;text/rdf;application/rss+xml;application/xspf+xml;image/svg+xml;application/x-designer;application/x-xbel;application/xml;application/scxml+xml" casesensitive="1" indenter="xml" author="Wilbert Berendsen (wilbert@kde.nl)" license="LGPL"> <language name="XML" version="10" kateversion="3.4" section="Markup" extensions="*.docbook;*.xml;*.rc;*.daml;*.rdf;*.rss;*.xspf;*.xsd;*.svg;*.ui;*.kcfg;*.qrc;*.wsdl;*.scxml;*.xbel;*.dae;*.sch;*.brd" mimetype="text/xml;text/book;text/daml;text/rdf;application/rss+xml;application/xspf+xml;image/svg+xml;application/x-designer;application/x-xbel;application/xml;application/scxml+xml" casesensitive="1" indenter="xml" author="Wilbert Berendsen (wilbert@kde.nl)" license="LGPL">
<highlighting> <highlighting>
<contexts> <contexts>
@@ -40,8 +40,9 @@
<context name="Comment" attribute="Comment" lineEndContext="#stay"> <context name="Comment" attribute="Comment" lineEndContext="#stay">
<DetectSpaces /> <DetectSpaces />
<StringDetect attribute="Comment" context="#pop" String="--&gt;" endRegion="comment" /> <StringDetect attribute="Comment" context="#pop" String="--&gt;" endRegion="comment" />
<RegExpr attribute="Error" context="#stay" String="-(-(?!-&gt;))+" /> <RegExpr attribute="Error" context="#stay" String="-(?:\-(?!-&gt;))+" />
<IncludeRules context="##Alerts" /> <IncludeRules context="##Alerts" />
<IncludeRules context="##Modelines" />
<DetectIdentifier /> <DetectIdentifier />
</context> </context>
@@ -63,7 +64,7 @@
<context name="Doctype Internal Subset" attribute="Other Text" lineEndContext="#stay"> <context name="Doctype Internal Subset" attribute="Other Text" lineEndContext="#stay">
<DetectChar attribute="Doctype" context="#pop" char="]" endRegion="int_subset" /> <DetectChar attribute="Doctype" context="#pop" char="]" endRegion="int_subset" />
<RegExpr attribute="Doctype" context="Doctype Markupdecl" String="&lt;!(ELEMENT|ENTITY|ATTLIST|NOTATION)\b" /> <RegExpr attribute="Doctype" context="Doctype Markupdecl" String="&lt;!(?:ELEMENT|ENTITY|ATTLIST|NOTATION)\b" />
<StringDetect attribute="Comment" context="Comment" String="&lt;!--" beginRegion="comment" /> <StringDetect attribute="Comment" context="Comment" String="&lt;!--" beginRegion="comment" />
<RegExpr attribute="Processing Instruction" context="PI" String="&lt;\?[\w:_-]*" beginRegion="pi" /> <RegExpr attribute="Processing Instruction" context="PI" String="&lt;\?[\w:_-]*" beginRegion="pi" />
<IncludeRules context="FindPEntityRefs" /> <IncludeRules context="FindPEntityRefs" />
@@ -88,8 +89,7 @@
<context name="Element" attribute="Other Text" lineEndContext="#stay"> <context name="Element" attribute="Other Text" lineEndContext="#stay">
<Detect2Chars attribute="Element" context="#pop" char="/" char1="&gt;" endRegion="element" /> <Detect2Chars attribute="Element" context="#pop" char="/" char1="&gt;" endRegion="element" />
<DetectChar attribute="Element" context="El Content" char="&gt;" /> <DetectChar attribute="Element" context="El Content" char="&gt;" />
<RegExpr attribute="Attribute" context="Attribute" String="^&name;" /> <RegExpr attribute="Attribute" context="Attribute" String="(?:^|\s+)&name;" />
<RegExpr attribute="Attribute" context="Attribute" String="\s+&name;" />
<RegExpr attribute="Error" context="#stay" String="\S" /> <RegExpr attribute="Error" context="#stay" String="\S" />
</context> </context>
@@ -143,7 +143,7 @@
</highlighting> </highlighting>
<general> <general>
<comments> <comments>
<comment name="multiLine" start="&lt;!--" end="--&gt;" /> <comment name="multiLine" start="&lt;!--" end="--&gt;" region="comment" />
</comments> </comments>
</general> </general>
</language> </language>

View File

@@ -32,7 +32,7 @@ This code is released under the LGPL as part of kdelibs/kate.
======================================================================== ========================================================================
--> -->
<language name="Yacc/Bison" version="5" kateversion="5.0" section="Sources" extensions="*.y;*.yy;*.ypp;*.y++" mimetype="text/x-yacc;text/x-bison" priority="5" author="Jan Villat (jan.villat@net2000.ch)" license="LGPL"> <language name="Yacc/Bison" version="6" kateversion="5.0" section="Sources" extensions="*.y;*.yy;*.ypp;*.y++" mimetype="text/x-yacc;text/x-bison" priority="5" author="Jan Villat (jan.villat@net2000.ch)" license="LGPL">
<highlighting> <highlighting>
<contexts> <contexts>
@@ -74,7 +74,7 @@ This code is released under the LGPL as part of kdelibs/kate.
<IncludeRules context="Comment" /> <IncludeRules context="Comment" />
<DetectSpaces /> <DetectSpaces />
<DetectChar attribute="Normal Text" context="Union In" char="{" beginRegion="union" /> <DetectChar attribute="Normal Text" context="Union In" char="{" beginRegion="union" />
<RegExpr attribute="Normal Text" context="#pop!Union Tag" String="[^\s\{](?=(\s|$|//))" /> <RegExpr attribute="Normal Text" context="#pop!Union Tag" String="[^\s\{](?=\s|$|//)" />
</context> </context>
<context name="Union Tag" attribute="Normal Text" lineEndContext="#stay"> <context name="Union Tag" attribute="Normal Text" lineEndContext="#stay">
<IncludeRules context="Comment" /> <IncludeRules context="Comment" />
@@ -141,7 +141,7 @@ This code is released under the LGPL as part of kdelibs/kate.
<!-- Finish rule without the ';' character (see the 'rhses.1' rule in the 'src/parse-gram.y' file, from the Bison source) --> <!-- Finish rule without the ';' character (see the 'rhses.1' rule in the 'src/parse-gram.y' file, from the Bison source) -->
<RegExpr attribute="Open Rule" context="#pop" String="[\w\-\.](?=[\w\-\.]*:)" column="0" endRegion="rule" /> <RegExpr attribute="Open Rule" context="#pop" String="[\w\-\.](?=[\w\-\.]*:)" column="0" endRegion="rule" />
<Detect2Chars attribute="Content-Type Delimiter" context="#pop" char="%" char1="%" lookAhead="true" firstNonSpace="true" endRegion="rule" /> <Detect2Chars attribute="Content-Type Delimiter" context="#pop" char="%" char1="%" lookAhead="true" firstNonSpace="true" endRegion="rule" />
<RegExpr attribute="Directive" context="#pop" String="%(union|code|destructor|printer|start|(no\-)?default\-prec|nterm|token|type|left|right|nonassoc|precedence)\b" lookAhead="true" column="0" endRegion="rule" /> <RegExpr attribute="Directive" context="#pop" String="%(?:union|code|destructor|printer|start|(?:no\-)?default\-prec|nterm|token|type|left|right|nonassoc|precedence)\b" lookAhead="true" column="0" endRegion="rule" />
</context> </context>
<!-- The Bison parser allows to have ';' followed by '|', without the rule ending. <!-- The Bison parser allows to have ';' followed by '|', without the rule ending.
The problem here is that the ';' char has endRegion="rule" (although it is not very relevant). --> The problem here is that the ';' char has endRegion="rule" (although it is not very relevant). -->
@@ -195,11 +195,11 @@ This code is released under the LGPL as part of kdelibs/kate.
</context> </context>
<context name="Comment" attribute="Comment" lineEndContext="#stay"> <context name="Comment" attribute="Comment" lineEndContext="#stay">
<Detect2Chars attribute="Comment" context="CommentStar" char="/" char1="*" /> <Detect2Chars attribute="Comment" context="CommentStar" char="/" char1="*" beginRegion="comment" />
<Detect2Chars attribute="Comment" context="CommentSlash" char="/" char1="/" /> <Detect2Chars attribute="Comment" context="CommentSlash" char="/" char1="/" />
</context> </context>
<context name="CommentStar" attribute="Comment" lineEndContext="#stay"> <context name="CommentStar" attribute="Comment" lineEndContext="#stay">
<Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" /> <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="comment" />
<IncludeRules context="##Alerts" /> <IncludeRules context="##Alerts" />
<IncludeRules context="##Modelines" /> <IncludeRules context="##Modelines" />
</context> </context>
@@ -229,7 +229,7 @@ This code is released under the LGPL as part of kdelibs/kate.
</context> </context>
<context name="Symbol-Variable" attribute="Normal Text" lineEndContext="#stay"> <context name="Symbol-Variable" attribute="Normal Text" lineEndContext="#stay">
<DetectChar attribute="Directive" context="Dol" char="$" /> <DetectChar attribute="Directive" context="Dol" char="$" />
<RegExpr attribute="Directive" context="#stay" String="@(\$?)(\d+|[A-Za-z_]\w*)?" /> <RegExpr attribute="Directive" context="#stay" String="@\$?(?:\d+|[A-Za-z_]\w*)?" />
</context> </context>
<context name="Dol" attribute="Normal Text" fallthrough="true" fallthroughContext="DolEnd" lineEndContext="#stay"> <context name="Dol" attribute="Normal Text" fallthrough="true" fallthroughContext="DolEnd" lineEndContext="#stay">
<RegExpr attribute="Data Type" context="DolEnd" String="&lt;[^&gt;]+&gt;" /> <RegExpr attribute="Data Type" context="DolEnd" String="&lt;[^&gt;]+&gt;" />
@@ -259,7 +259,7 @@ This code is released under the LGPL as part of kdelibs/kate.
</highlighting> </highlighting>
<general> <general>
<comments> <comments>
<comment name="multiLine" start="/*" end="*/" /> <comment name="multiLine" start="/*" end="*/" region="comment" />
<comment name="singleLine" start="//" /> <comment name="singleLine" start="//" />
</comments> </comments>
</general> </general>

View File

@@ -1,4 +0,0 @@
if(Qt5Widgets_FOUND)
add_executable(codeeditor codeeditor.cpp main.cpp)
target_link_libraries(codeeditor Qt5::Widgets KF5SyntaxHighlighting)
endif()

View File

@@ -1,358 +0,0 @@
/*
Copyright (C) 2016 Volker Krause <vkrause@kde.org>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "codeeditor.h"
#include <definition.h>
#include <foldingregion.h>
#include <syntaxhighlighter.h>
#include <theme.h>
#include <QApplication>
#include <QDebug>
#include <QFile>
#include <QFileDialog>
#include <QFontDatabase>
#include <QMenu>
#include <QPainter>
#include <QPalette>
class CodeEditorSidebar : public QWidget
{
Q_OBJECT
public:
explicit CodeEditorSidebar(CodeEditor *editor);
QSize sizeHint() const Q_DECL_OVERRIDE;
protected:
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
private:
CodeEditor *m_codeEditor;
};
CodeEditorSidebar::CodeEditorSidebar(CodeEditor *editor) :
QWidget(editor),
m_codeEditor(editor)
{
}
QSize CodeEditorSidebar::sizeHint() const
{
return QSize(m_codeEditor->sidebarWidth(), 0);
}
void CodeEditorSidebar::paintEvent(QPaintEvent *event)
{
m_codeEditor->sidebarPaintEvent(event);
}
void CodeEditorSidebar::mouseReleaseEvent(QMouseEvent *event)
{
if (event->x() >= width() - m_codeEditor->fontMetrics().lineSpacing()) {
auto block = m_codeEditor->blockAtPosition(event->y());
if (!block.isValid() || !m_codeEditor->isFoldable(block))
return;
m_codeEditor->toggleFold(block);
}
QWidget::mouseReleaseEvent(event);
}
CodeEditor::CodeEditor(QWidget *parent) :
QPlainTextEdit(parent),
m_highlighter(new KSyntaxHighlighting::SyntaxHighlighter(document())),
m_sideBar(new CodeEditorSidebar(this))
{
setFont(QFontDatabase::systemFont(QFontDatabase::FixedFont));
setTheme((palette().color(QPalette::Base).lightness() < 128)
? m_repository.defaultTheme(KSyntaxHighlighting::Repository::DarkTheme)
: m_repository.defaultTheme(KSyntaxHighlighting::Repository::LightTheme));
connect(this, &QPlainTextEdit::blockCountChanged, this, &CodeEditor::updateSidebarGeometry);
connect(this, &QPlainTextEdit::updateRequest, this, &CodeEditor::updateSidebarArea);
connect(this, &QPlainTextEdit::cursorPositionChanged, this, &CodeEditor::highlightCurrentLine);
updateSidebarGeometry();
highlightCurrentLine();
}
CodeEditor::~CodeEditor()
{
}
void CodeEditor::openFile(const QString& fileName)
{
QFile f(fileName);
if (!f.open(QFile::ReadOnly)) {
qWarning() << "Failed to open" << fileName << ":" << f.errorString();
return;
}
clear();
const auto def = m_repository.definitionForFileName(fileName);
m_highlighter->setDefinition(def);
setWindowTitle(fileName);
setPlainText(QString::fromUtf8(f.readAll()));
}
void CodeEditor::contextMenuEvent(QContextMenuEvent *event)
{
auto menu = createStandardContextMenu(event->pos());
menu->addSeparator();
auto openAction = menu->addAction(QStringLiteral("Open File..."));
connect(openAction, &QAction::triggered, this, [this]() {
const auto fileName = QFileDialog::getOpenFileName(this, QStringLiteral("Open File"));
if (!fileName.isEmpty())
openFile(fileName);
});
// syntax selection
auto hlActionGroup = new QActionGroup(menu);
hlActionGroup->setExclusive(true);
auto hlGroupMenu = menu->addMenu(QStringLiteral("Syntax"));
QMenu *hlSubMenu = hlGroupMenu;
QString currentGroup;
foreach (const auto &def, m_repository.definitions()) {
if (def.isHidden())
continue;
if (currentGroup != def.section()) {
currentGroup = def.section();
hlSubMenu = hlGroupMenu->addMenu(def.translatedSection());
}
Q_ASSERT(hlSubMenu);
auto action = hlSubMenu->addAction(def.translatedName());
action->setCheckable(true);
action->setData(def.name());
hlActionGroup->addAction(action);
if (def.name() == m_highlighter->definition().name())
action->setChecked(true);
}
connect(hlActionGroup, &QActionGroup::triggered, this, [this](QAction *action) {
const auto defName = action->data().toString();
const auto def = m_repository.definitionForName(defName);
m_highlighter->setDefinition(def);
});
// theme selection
auto themeGroup = new QActionGroup(menu);
themeGroup->setExclusive(true);
auto themeMenu = menu->addMenu(QStringLiteral("Theme"));
foreach (const auto &theme, m_repository.themes()) {
auto action = themeMenu->addAction(theme.translatedName());
action->setCheckable(true);
action->setData(theme.name());
themeGroup->addAction(action);
if (theme.name() == m_highlighter->theme().name())
action->setChecked(true);
}
connect(themeGroup, &QActionGroup::triggered, this, [this](QAction *action) {
const auto themeName = action->data().toString();
const auto theme = m_repository.theme(themeName);
setTheme(theme);
});
menu->exec(event->globalPos());
delete menu;
}
void CodeEditor::resizeEvent(QResizeEvent *event)
{
QPlainTextEdit::resizeEvent(event);
updateSidebarGeometry();
}
void CodeEditor::setTheme(const KSyntaxHighlighting::Theme &theme)
{
auto pal = qApp->palette();
if (theme.isValid()) {
pal.setColor(QPalette::Base, theme.editorColor(KSyntaxHighlighting::Theme::BackgroundColor));
pal.setColor(QPalette::Text, theme.textColor(KSyntaxHighlighting::Theme::Normal));
pal.setColor(QPalette::Highlight, theme.editorColor(KSyntaxHighlighting::Theme::TextSelection));
}
setPalette(pal);
m_highlighter->setTheme(theme);
m_highlighter->rehighlight();
highlightCurrentLine();
}
int CodeEditor::sidebarWidth() const
{
int digits = 1;
auto count = blockCount();
while (count >= 10) {
++digits;
count /= 10;
}
return 4 + fontMetrics().width(QLatin1Char('9')) * digits + fontMetrics().lineSpacing();
}
void CodeEditor::sidebarPaintEvent(QPaintEvent *event)
{
QPainter painter(m_sideBar);
painter.fillRect(event->rect(), m_highlighter->theme().editorColor(KSyntaxHighlighting::Theme::IconBorder));
auto block = firstVisibleBlock();
auto blockNumber = block.blockNumber();
int top = blockBoundingGeometry(block).translated(contentOffset()).top();
int bottom = top + blockBoundingRect(block).height();
const int currentBlockNumber = textCursor().blockNumber();
const auto foldingMarkerSize = fontMetrics().lineSpacing();
while (block.isValid() && top <= event->rect().bottom()) {
if (block.isVisible() && bottom >= event->rect().top()) {
const auto number = QString::number(blockNumber + 1);
painter.setPen(m_highlighter->theme().editorColor(
(blockNumber == currentBlockNumber) ? KSyntaxHighlighting::Theme::CurrentLineNumber
: KSyntaxHighlighting::Theme::LineNumbers));
painter.drawText(0, top, m_sideBar->width() - 2 - foldingMarkerSize, fontMetrics().height(), Qt::AlignRight, number);
}
// folding marker
if (block.isVisible() && isFoldable(block)) {
QPolygonF polygon;
if (isFolded(block)) {
polygon << QPointF(foldingMarkerSize * 0.4, foldingMarkerSize * 0.25);
polygon << QPointF(foldingMarkerSize * 0.4, foldingMarkerSize * 0.75);
polygon << QPointF(foldingMarkerSize * 0.8, foldingMarkerSize * 0.5);
} else {
polygon << QPointF(foldingMarkerSize * 0.25, foldingMarkerSize * 0.4);
polygon << QPointF(foldingMarkerSize * 0.75, foldingMarkerSize * 0.4);
polygon << QPointF(foldingMarkerSize * 0.5, foldingMarkerSize * 0.8);
}
painter.save();
painter.setRenderHint(QPainter::Antialiasing);
painter.setPen(Qt::NoPen);
painter.setBrush(QColor(m_highlighter->theme().editorColor(KSyntaxHighlighting::Theme::CodeFolding)));
painter.translate(m_sideBar->width() - foldingMarkerSize, top);
painter.drawPolygon(polygon);
painter.restore();
}
block = block.next();
top = bottom;
bottom = top + blockBoundingRect(block).height();
++blockNumber;
}
}
void CodeEditor::updateSidebarGeometry()
{
setViewportMargins(sidebarWidth(), 0, 0, 0);
const auto r = contentsRect();
m_sideBar->setGeometry(QRect(r.left(), r.top(), sidebarWidth(), r.height()));
}
void CodeEditor::updateSidebarArea(const QRect& rect, int dy)
{
if (dy)
m_sideBar->scroll(0, dy);
else
m_sideBar->update(0, rect.y(), m_sideBar->width(), rect.height());
}
void CodeEditor::highlightCurrentLine()
{
QTextEdit::ExtraSelection selection;
selection.format.setBackground(QColor(m_highlighter->theme().editorColor(KSyntaxHighlighting::Theme::CurrentLine)));
selection.format.setProperty(QTextFormat::FullWidthSelection, true);
selection.cursor = textCursor();
selection.cursor.clearSelection();
QList<QTextEdit::ExtraSelection> extraSelections;
extraSelections.append(selection);
setExtraSelections(extraSelections);
}
QTextBlock CodeEditor::blockAtPosition(int y) const
{
auto block = firstVisibleBlock();
if (!block.isValid())
return QTextBlock();
int top = blockBoundingGeometry(block).translated(contentOffset()).top();
int bottom = top + blockBoundingRect(block).height();
do {
if (top <= y && y <= bottom)
return block;
block = block.next();
top = bottom;
bottom = top + blockBoundingRect(block).height();
} while (block.isValid());
return QTextBlock();
}
bool CodeEditor::isFoldable(const QTextBlock &block) const
{
return m_highlighter->startsFoldingRegion(block);
}
bool CodeEditor::isFolded(const QTextBlock &block) const
{
if (!block.isValid())
return false;
const auto nextBlock = block.next();
if (!nextBlock.isValid())
return false;
return !nextBlock.isVisible();
}
void CodeEditor::toggleFold(const QTextBlock &startBlock)
{
// we also want to fold the last line of the region, therefore the ".next()"
const auto endBlock = m_highlighter->findFoldingRegionEnd(startBlock).next();
if (isFolded(startBlock)) {
// unfold
auto block = startBlock.next();
while (block.isValid() && !block.isVisible()) {
block.setVisible(true);
block.setLineCount(block.layout()->lineCount());
block = block.next();
}
} else {
// fold
auto block = startBlock.next();
while (block.isValid() && block != endBlock) {
block.setVisible(false);
block.setLineCount(0);
block = block.next();
}
}
// redraw document
document()->markContentsDirty(startBlock.position(), endBlock.position() - startBlock.position() + 1);
// update scrollbars
emit document()->documentLayout()->documentSizeChanged(document()->documentLayout()->documentSize());
}
#include "codeeditor.moc"

View File

@@ -1,69 +0,0 @@
/*
Copyright (C) 2016 Volker Krause <vkrause@kde.org>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef CODEEDITOR_H
#define CODEEDITOR_H
#include <repository.h>
#include <QPlainTextEdit>
namespace KSyntaxHighlighting {
class SyntaxHighlighter;
}
class CodeEditorSidebar;
class CodeEditor : public QPlainTextEdit
{
Q_OBJECT
public:
explicit CodeEditor(QWidget *parent = nullptr);
~CodeEditor();
void openFile(const QString &fileName);
protected:
void contextMenuEvent(QContextMenuEvent *event) override;
void resizeEvent(QResizeEvent *event) override;
private:
friend class CodeEditorSidebar;
void setTheme(const KSyntaxHighlighting::Theme &theme);
int sidebarWidth() const;
void sidebarPaintEvent(QPaintEvent *event);
void updateSidebarGeometry();
void updateSidebarArea(const QRect &rect, int dy);
void highlightCurrentLine();
QTextBlock blockAtPosition(int y) const;
bool isFoldable(const QTextBlock &block) const;
bool isFolded(const QTextBlock &block) const;
void toggleFold(const QTextBlock &block);
KSyntaxHighlighting::Repository m_repository;
KSyntaxHighlighting::SyntaxHighlighter *m_highlighter;
CodeEditorSidebar *m_sideBar;
};
#endif // CODEEDITOR_H

View File

@@ -1,46 +0,0 @@
/*
Copyright (C) 2016 Volker Krause <vkrause@kde.org>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "codeeditor.h"
#include <QApplication>
#include <QCommandLineParser>
#include <QFile>
#include <QTextEdit>
int main(int argc, char **argv)
{
QApplication app(argc, argv);
QCommandLineParser parser;
parser.addHelpOption();
parser.addPositionalArgument(QStringLiteral("source"), QStringLiteral("The source file to highlight."));
parser.process(app);
CodeEditor edit;
edit.resize(1024, 1024);
edit.show();
if (parser.positionalArguments().size() == 1)
edit.openFile(parser.positionalArguments().at(0));
return app.exec();
}

View File

@@ -49,23 +49,18 @@ int main(int argc, char **argv)
parser.setApplicationDescription(app.translate("SyntaxHighlightingCLI", "Command line syntax highlighter using Kate syntax definitions.")); parser.setApplicationDescription(app.translate("SyntaxHighlightingCLI", "Command line syntax highlighter using Kate syntax definitions."));
parser.addHelpOption(); parser.addHelpOption();
parser.addVersionOption(); parser.addVersionOption();
parser.addPositionalArgument(app.translate("SyntaxHighlightingCLI", "source"), parser.addPositionalArgument(app.translate("SyntaxHighlightingCLI", "source"), app.translate("SyntaxHighlightingCLI", "The source file to highlight."));
app.translate("SyntaxHighlightingCLI", "The source file to highlight."));
QCommandLineOption listDefs(QStringList() << QStringLiteral("l") << QStringLiteral("list"), QCommandLineOption listDefs(QStringList() << QStringLiteral("l") << QStringLiteral("list"), app.translate("SyntaxHighlightingCLI", "List all available syntax definitions."));
app.translate("SyntaxHighlightingCLI", "List all available syntax definitions."));
parser.addOption(listDefs); parser.addOption(listDefs);
QCommandLineOption listThemes(QStringList() << QStringLiteral("list-themes"), QCommandLineOption listThemes(QStringList() << QStringLiteral("list-themes"), app.translate("SyntaxHighlightingCLI", "List all available themes."));
app.translate("SyntaxHighlightingCLI", "List all available themes."));
parser.addOption(listThemes); parser.addOption(listThemes);
QCommandLineOption updateDefs(QStringList() << QStringLiteral("u") << QStringLiteral("update"), QCommandLineOption updateDefs(QStringList() << QStringLiteral("u") << QStringLiteral("update"), app.translate("SyntaxHighlightingCLI", "Download new/updated syntax definitions."));
app.translate("SyntaxHighlightingCLI", "Download new/updated syntax definitions."));
parser.addOption(updateDefs); parser.addOption(updateDefs);
QCommandLineOption outputName(QStringList() << QStringLiteral("o") << QStringLiteral("output"), QCommandLineOption outputName(
app.translate("SyntaxHighlightingCLI", "File to write HTML output to (default: stdout)."), QStringList() << QStringLiteral("o") << QStringLiteral("output"), app.translate("SyntaxHighlightingCLI", "File to write HTML output to (default: stdout)."), app.translate("SyntaxHighlightingCLI", "output"));
app.translate("SyntaxHighlightingCLI", "output"));
parser.addOption(outputName); parser.addOption(outputName);
QCommandLineOption syntaxName(QStringList() << QStringLiteral("s") << QStringLiteral("syntax"), QCommandLineOption syntaxName(QStringList() << QStringLiteral("s") << QStringLiteral("syntax"),
@@ -73,9 +68,8 @@ int main(int argc, char **argv)
app.translate("SyntaxHighlightingCLI", "syntax")); app.translate("SyntaxHighlightingCLI", "syntax"));
parser.addOption(syntaxName); parser.addOption(syntaxName);
QCommandLineOption themeName(QStringList() << QStringLiteral("t") << QStringLiteral("theme"), QCommandLineOption themeName(
app.translate("SyntaxHighlightingCLI", "Color theme to use for highlighting."), QStringList() << QStringLiteral("t") << QStringLiteral("theme"), app.translate("SyntaxHighlightingCLI", "Color theme to use for highlighting."), app.translate("SyntaxHighlightingCLI", "theme"), QStringLiteral("Default"));
app.translate("SyntaxHighlightingCLI", "theme"), QStringLiteral("Default"));
parser.addOption(themeName); parser.addOption(themeName);
QCommandLineOption titleOption(QStringList() << QStringLiteral("T") << QStringLiteral("title"), QCommandLineOption titleOption(QStringList() << QStringLiteral("T") << QStringLiteral("title"),
@@ -83,8 +77,7 @@ int main(int argc, char **argv)
app.translate("SyntaxHighlightingCLI", "title")); app.translate("SyntaxHighlightingCLI", "title"));
parser.addOption(titleOption); parser.addOption(titleOption);
QCommandLineOption stdinOption(QStringList() << QStringLiteral("stdin"), QCommandLineOption stdinOption(QStringList() << QStringLiteral("stdin"), app.translate("SyntaxHighlightingCLI", "Read file from stdin. The -s option must also be used."));
app.translate("SyntaxHighlightingCLI", "Read file from stdin. The -s option must also be used."));
parser.addOption(stdinOption); parser.addOption(stdinOption);
parser.process(app); parser.process(app);
@@ -105,9 +98,7 @@ int main(int argc, char **argv)
if (parser.isSet(updateDefs)) { if (parser.isSet(updateDefs)) {
DefinitionDownloader downloader(&repo); DefinitionDownloader downloader(&repo);
QObject::connect(&downloader, &DefinitionDownloader::informationMessage, [](const QString &msg) { QObject::connect(&downloader, &DefinitionDownloader::informationMessage, [](const QString &msg) { std::cout << qPrintable(msg) << std::endl; });
std::cout << qPrintable(msg) << std::endl;
});
QObject::connect(&downloader, &DefinitionDownloader::done, &app, &QCoreApplication::quit); QObject::connect(&downloader, &DefinitionDownloader::done, &app, &QCoreApplication::quit);
downloader.start(); downloader.start();
return app.exec(); return app.exec();

View File

@@ -22,21 +22,21 @@
*/ */
#include <QCoreApplication> #include <QCoreApplication>
#include <QDebug>
#include <QFile> #include <QFile>
#include <QFileInfo> #include <QFileInfo>
#include <QVariant>
#include <QXmlStreamReader>
#include <QJsonDocument> #include <QJsonDocument>
#include <QRegularExpression> #include <QRegularExpression>
#include <QDebug> #include <QVariant>
#include <QXmlStreamReader>
#ifdef QT_XMLPATTERNS_LIB #ifdef QT_XMLPATTERNS_LIB
#include <QXmlSchema> #include <QXmlSchema>
#include <QXmlSchemaValidator> #include <QXmlSchemaValidator>
#endif #endif
namespace { namespace
{
QStringList readListing(const QString &fileName) QStringList readListing(const QString &fileName)
{ {
QFile file(fileName); QFile file(fileName);
@@ -56,8 +56,7 @@ QStringList readListing(const QString &fileName)
} }
if (xml.hasError()) { if (xml.hasError()) {
qWarning() << "XML error while reading" << fileName << " - " qWarning() << "XML error while reading" << fileName << " - " << qPrintable(xml.errorString()) << "@ offset" << xml.characterOffset();
<< qPrintable(xml.errorString()) << "@ offset" << xml.characterOffset();
listing.clear(); listing.clear();
} }
@@ -72,7 +71,11 @@ QStringList readListing(const QString &fileName)
bool checkExtensions(const QString &extensions) bool checkExtensions(const QString &extensions)
{ {
// get list of extensions // get list of extensions
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
const QStringList extensionParts = extensions.split(QLatin1Char(';'), QString::SkipEmptyParts); const QStringList extensionParts = extensions.split(QLatin1Char(';'), QString::SkipEmptyParts);
#else
const QStringList extensionParts = extensions.split(QLatin1Char(';'), Qt::SkipEmptyParts);
#endif
// ok if empty // ok if empty
if (extensionParts.isEmpty()) { if (extensionParts.isEmpty()) {
@@ -110,6 +113,7 @@ bool checkExtensions(const QString &extensions)
//! - is not empty //! - is not empty
//! - isValid() //! - isValid()
//! - character ranges such as [A-Z] are valid and not accidentally e.g. [A-z]. //! - character ranges such as [A-Z] are valid and not accidentally e.g. [A-z].
//! - dynamic=true but no place holder used?
bool checkRegularExpression(const QString &hlFilename, QXmlStreamReader &xml) bool checkRegularExpression(const QString &hlFilename, QXmlStreamReader &xml)
{ {
if (xml.name() == QLatin1String("RegExpr") || xml.name() == QLatin1String("emptyLine")) { if (xml.name() == QLatin1String("RegExpr") || xml.name() == QLatin1String("emptyLine")) {
@@ -132,6 +136,15 @@ bool checkRegularExpression(const QString &hlFilename, QXmlStreamReader &xml)
qWarning() << hlFilename << "line" << xml.lineNumber() << "broken regex:" << string << "problem: [a-Z] or [A-z] at offset" << azOffset; qWarning() << hlFilename << "line" << xml.lineNumber() << "broken regex:" << string << "problem: [a-Z] or [A-z] at offset" << azOffset;
return false; return false;
} }
// dynamic == true and no place holder?
if (xml.name() == QLatin1String("RegExpr") && xml.attributes().value(QStringLiteral("dynamic")) == QStringLiteral("true")) {
static const QRegularExpression placeHolder(QStringLiteral("%\\d+"));
if (!string.contains(placeHolder)) {
qWarning() << hlFilename << "line" << xml.lineNumber() << "broken regex:" << string << "problem: dynamic=true but no %\\d+ placeholder";
return false;
}
}
} }
return true; return true;
@@ -208,8 +221,7 @@ public:
keywords.filename = hlFilename; keywords.filename = hlFilename;
auto name = xml.attributes().value(QLatin1String("name")).toString(); auto name = xml.attributes().value(QLatin1String("name")).toString();
m_currentIncludes = &keywords.includes[name]; m_currentIncludes = &keywords.includes[name];
} } else if (xml.name() == QLatin1String("include")) {
else if (xml.name() == QLatin1String("include")) {
if (!m_currentIncludes) { if (!m_currentIncludes) {
qWarning() << hlFilename << "line" << xml.lineNumber() << "<include> tag ouside <list>"; qWarning() << hlFilename << "line" << xml.lineNumber() << "<include> tag ouside <list>";
m_success = false; m_success = false;
@@ -232,8 +244,7 @@ public:
if (idx == -1) { if (idx == -1) {
auto &keywordName = includes.key(); auto &keywordName = includes.key();
containsKeywordName = keywords.includes.contains(keywordName); containsKeywordName = keywords.includes.contains(keywordName);
} } else {
else {
auto defName = include.name.mid(idx + 2); auto defName = include.name.mid(idx + 2);
auto listName = include.name.left(idx); auto listName = include.name.left(idx);
auto it = m_keywordMap.find(defName); auto it = m_keywordMap.find(defName);
@@ -256,11 +267,9 @@ public:
} }
private: private:
struct Keywords struct Keywords {
{
QString filename; QString filename;
struct Include struct Include {
{
qint64 line; qint64 line;
QString name; QString name;
}; };
@@ -279,7 +288,8 @@ class KeywordChecker
public: public:
KeywordChecker(const QString &filename) KeywordChecker(const QString &filename)
: m_filename(filename) : m_filename(filename)
{} {
}
void processElement(QXmlStreamReader &xml) void processElement(QXmlStreamReader &xml)
{ {
@@ -387,8 +397,7 @@ public:
bool success = m_success; bool success = m_success;
// recursive search for the required miximal version // recursive search for the required miximal version
struct GetRequiredVersion struct GetRequiredVersion {
{
QHash<const Language *, Version> versionMap; QHash<const Language *, Version> versionMap;
Version operator()(const QHash<QString, Language> &contextMap, const Language &language) Version operator()(const QHash<QString, Language> &contextMap, const Language &language)
@@ -451,7 +460,11 @@ private:
// handle cross-language context references // handle cross-language context references
if (context.contains(QStringLiteral("##"))) { if (context.contains(QStringLiteral("##"))) {
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
const QStringList list = context.split(QStringLiteral("##"), QString::SkipEmptyParts); const QStringList list = context.split(QStringLiteral("##"), QString::SkipEmptyParts);
#else
const QStringList list = context.split(QStringLiteral("##"), Qt::SkipEmptyParts);
#endif
if (list.size() == 1) { if (list.size() == 1) {
// nothing to do, other language is included: e.g. ##Doxygen // nothing to do, other language is included: e.g. ##Doxygen
} else if (list.size() == 2) { } else if (list.size() == 2) {
@@ -471,15 +484,15 @@ private:
} }
private: private:
struct Version struct Version {
{
int majorRevision; int majorRevision;
int minorRevision; int minorRevision;
Version(int majorRevision = 0, int minorRevision = 0) Version(int majorRevision = 0, int minorRevision = 0)
: majorRevision(majorRevision) : majorRevision(majorRevision)
, minorRevision(minorRevision) , minorRevision(minorRevision)
{} {
}
bool operator<(const Version &version) const bool operator<(const Version &version) const
{ {
@@ -492,7 +505,8 @@ private:
auto &language = m_contextMap[hlName]; auto &language = m_contextMap[hlName];
if (language.version < requiredVersion) { if (language.version < requiredVersion) {
qWarning().nospace() << hlFilename << " " << item << " in line " << xml.lineNumber() << " is only available since version " << requiredVersion.majorRevision << "." << requiredVersion.minorRevision << ". Please, increase kateversion."; 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 // update the version to cancel future warnings
language.version = requiredVersion; language.version = requiredVersion;
m_success = false; m_success = false;
@@ -540,7 +554,8 @@ class AttributeChecker
public: public:
AttributeChecker(const QString &filename) AttributeChecker(const QString &filename)
: m_filename(filename) : m_filename(filename)
{} {
}
void processElement(QXmlStreamReader &xml) void processElement(QXmlStreamReader &xml)
{ {
@@ -620,9 +635,8 @@ int main(int argc, char *argv[])
} }
// text attributes // text attributes
const QStringList textAttributes = QStringList() << QStringLiteral("name") << QStringLiteral("section") << QStringLiteral("mimetype") const QStringList textAttributes = QStringList() << QStringLiteral("name") << QStringLiteral("section") << QStringLiteral("mimetype") << QStringLiteral("extensions") << QStringLiteral("style") << QStringLiteral("author")
<< QStringLiteral("extensions") << QStringLiteral("style") << QStringLiteral("license") << QStringLiteral("indenter");
<< QStringLiteral("author") << QStringLiteral("license") << QStringLiteral("indenter");
// index all given highlightings // index all given highlightings
ContextChecker contextChecker; ContextChecker contextChecker;
@@ -750,7 +764,6 @@ int main(int argc, char *argv[])
if (!keywordIncludeChecker.check()) if (!keywordIncludeChecker.check())
anyError = 7; anyError = 7;
// bail out if any problem was seen // bail out if any problem was seen
if (anyError) if (anyError)
return anyError; return anyError;

View File

@@ -23,6 +23,8 @@ ecm_qt_declare_logging_category(syntax_highlighting_srcs
HEADER ksyntaxhighlighting_logging.h HEADER ksyntaxhighlighting_logging.h
IDENTIFIER KSyntaxHighlighting::Log IDENTIFIER KSyntaxHighlighting::Log
CATEGORY_NAME org.kde.ksyntaxhighlighting CATEGORY_NAME org.kde.ksyntaxhighlighting
DESCRIPTION "Syntax Highlighting"
EXPORT KSYNTAXHIGHLIGHTING
) )
add_library(KF5SyntaxHighlighting ${syntax_highlighting_srcs} $<TARGET_OBJECTS:SyntaxHighlightingData>) add_library(KF5SyntaxHighlighting ${syntax_highlighting_srcs} $<TARGET_OBJECTS:SyntaxHighlightingData>)

View File

@@ -27,11 +27,11 @@
#include "definition_p.h" #include "definition_p.h"
#include "foldingregion.h" #include "foldingregion.h"
#include "format.h" #include "format.h"
#include "ksyntaxhighlighting_logging.h"
#include "repository.h" #include "repository.h"
#include "rule_p.h" #include "rule_p.h"
#include "state.h" #include "state.h"
#include "state_p.h" #include "state_p.h"
#include "ksyntaxhighlighting_logging.h"
#include "theme.h" #include "theme.h"
using namespace KSyntaxHighlighting; using namespace KSyntaxHighlighting;
@@ -60,13 +60,13 @@ void AbstractHighlighterPrivate::ensureDefinitionLoaded()
defData->load(); defData->load();
} }
AbstractHighlighter::AbstractHighlighter() : AbstractHighlighter::AbstractHighlighter()
d_ptr(new AbstractHighlighterPrivate) : d_ptr(new AbstractHighlighterPrivate)
{ {
} }
AbstractHighlighter::AbstractHighlighter(AbstractHighlighterPrivate *dd) : AbstractHighlighter::AbstractHighlighter(AbstractHighlighterPrivate *dd)
d_ptr(dd) : d_ptr(dd)
{ {
} }
@@ -160,8 +160,7 @@ State AbstractHighlighter::highlightLine(const QString& text, const State &state
* line end context switches only when lineEmptyContext is #stay. This avoids * line end context switches only when lineEmptyContext is #stay. This avoids
* skipping empty lines after a line continuation character (see bug 405903) * skipping empty lines after a line continuation character (see bug 405903)
*/ */
} else if (!stateData->topContext()->lineEndContext().isStay() && } else if (!stateData->topContext()->lineEndContext().isStay() && !d->switchContext(stateData, stateData->topContext()->lineEndContext(), QStringList()))
!d->switchContext(stateData, stateData->topContext()->lineEndContext(), QStringList()))
break; break;
// guard against endless loops // guard against endless loops
@@ -178,7 +177,15 @@ State AbstractHighlighter::highlightLine(const QString& text, const State &state
int offset = 0, beginOffset = 0; int offset = 0, beginOffset = 0;
bool lineContinuation = false; bool lineContinuation = false;
/**
* for expensive rules like regexes we do:
* - match them for the complete line, as this is faster than re-trying them at all positions
* - store the result of the first position that matches (or -1 for no match in the full line) in the skipOffsets hash for re-use
* - have capturesForLastDynamicSkipOffset as guard for dynamic regexes to invalidate the cache if they might have changed
*/
QHash<Rule *, int> skipOffsets; QHash<Rule *, int> skipOffsets;
QStringList capturesForLastDynamicSkipOffset;
/** /**
* current active format * current active format
@@ -248,21 +255,31 @@ State AbstractHighlighter::highlightLine(const QString& text, const State &state
* shall we skip application of this rule? two cases: * shall we skip application of this rule? two cases:
* - rule can't match at all => currentSkipOffset < 0 * - rule can't match at all => currentSkipOffset < 0
* - rule will only match for some higher offset => currentSkipOffset > offset * - rule will only match for some higher offset => currentSkipOffset > offset
*
* we need to invalidate this if we are dynamic and have different captures then last time
*/ */
if (rule->isDynamic() && (capturesForLastDynamicSkipOffset != stateData->topCaptures())) {
skipOffsets.clear();
}
const auto currentSkipOffset = skipOffsets.value(rule.get()); const auto currentSkipOffset = skipOffsets.value(rule.get());
if (currentSkipOffset < 0 || currentSkipOffset > offset) if (currentSkipOffset < 0 || currentSkipOffset > offset)
continue; continue;
const auto newResult = rule->doMatch(text, offset, stateData->topCaptures()); const auto newResult = rule->doMatch(text, offset, stateData->topCaptures());
newOffset = newResult.offset(); newOffset = newResult.offset();
/** /**
* update skip offset if new one rules out any later match or is larger than current one * update skip offset if new one rules out any later match or is larger than current one
*/ */
if (newResult.skipOffset() < 0 || newResult.skipOffset() > currentSkipOffset) if (newResult.skipOffset() < 0 || newResult.skipOffset() > currentSkipOffset) {
skipOffsets.insert(rule.get(), newResult.skipOffset()); skipOffsets.insert(rule.get(), newResult.skipOffset());
// remember new captures, if dynamic to enforce proper reset above on change!
if (rule->isDynamic()) {
capturesForLastDynamicSkipOffset = stateData->topCaptures();
}
}
if (newOffset <= offset) if (newOffset <= offset)
continue; continue;

View File

@@ -34,8 +34,8 @@ QT_BEGIN_NAMESPACE
class QString; class QString;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace KSyntaxHighlighting { namespace KSyntaxHighlighting
{
class AbstractHighlighterPrivate; class AbstractHighlighterPrivate;
class Definition; class Definition;
class FoldingRegion; class FoldingRegion;

View File

@@ -31,8 +31,8 @@ QT_BEGIN_NAMESPACE
class QStringList; class QStringList;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace KSyntaxHighlighting { namespace KSyntaxHighlighting
{
class ContextSwitch; class ContextSwitch;
class StateData; class StateData;

View File

@@ -24,9 +24,9 @@
#include "context_p.h" #include "context_p.h"
#include "definition_p.h" #include "definition_p.h"
#include "format.h" #include "format.h"
#include "ksyntaxhighlighting_logging.h"
#include "repository.h" #include "repository.h"
#include "rule_p.h" #include "rule_p.h"
#include "ksyntaxhighlighting_logging.h"
#include "xml_p.h" #include "xml_p.h"
#include <QString> #include <QString>
@@ -68,8 +68,7 @@ void Context::load(QXmlStreamReader& reader)
reader.readNext(); reader.readNext();
while (!reader.atEnd()) { while (!reader.atEnd()) {
switch (reader.tokenType()) { switch (reader.tokenType()) {
case QXmlStreamReader::StartElement: case QXmlStreamReader::StartElement: {
{
auto rule = Rule::create(reader.name()); auto rule = Rule::create(reader.name());
if (rule) { if (rule) {
rule->setDefinition(m_def.definition()); rule->setDefinition(m_def.definition());

View File

@@ -24,11 +24,11 @@
#ifndef KSYNTAXHIGHLIGHTING_CONTEXT_P_H #ifndef KSYNTAXHIGHLIGHTING_CONTEXT_P_H
#define KSYNTAXHIGHLIGHTING_CONTEXT_P_H #define KSYNTAXHIGHLIGHTING_CONTEXT_P_H
#include "rule_p.h"
#include "contextswitch_p.h" #include "contextswitch_p.h"
#include "definition.h" #include "definition.h"
#include "definitionref_p.h" #include "definitionref_p.h"
#include "format.h" #include "format.h"
#include "rule_p.h"
#include <QString> #include <QString>
@@ -38,8 +38,8 @@ QT_BEGIN_NAMESPACE
class QXmlStreamReader; class QXmlStreamReader;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace KSyntaxHighlighting { namespace KSyntaxHighlighting
{
class Context class Context
{ {
public: public:
@@ -98,12 +98,7 @@ public:
private: private:
Q_DISABLE_COPY(Context) Q_DISABLE_COPY(Context)
enum ResolveState { enum ResolveState { Unknown, Unresolved, Resolving, Resolved };
Unknown,
Unresolved,
Resolving,
Resolved
};
ResolveState resolveState(); ResolveState resolveState();
DefinitionRef m_def; DefinitionRef m_def;

View File

@@ -24,9 +24,8 @@
#include "contextswitch_p.h" #include "contextswitch_p.h"
#include "definition.h" #include "definition.h"
#include "definition_p.h" #include "definition_p.h"
#include "repository.h"
#include "ksyntaxhighlighting_logging.h" #include "ksyntaxhighlighting_logging.h"
#include "repository.h"
using namespace KSyntaxHighlighting; using namespace KSyntaxHighlighting;

View File

@@ -26,8 +26,8 @@
#include <QString> #include <QString>
namespace KSyntaxHighlighting { namespace KSyntaxHighlighting
{
class Context; class Context;
class Definition; class Definition;

View File

@@ -23,7 +23,6 @@
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include "definition.h" #include "definition.h"
#include "definition_p.h" #include "definition_p.h"
#include "definitionref_p.h" #include "definitionref_p.h"
@@ -31,11 +30,11 @@
#include "context_p.h" #include "context_p.h"
#include "format.h" #include "format.h"
#include "format_p.h" #include "format_p.h"
#include "ksyntaxhighlighting_logging.h"
#include "ksyntaxhighlighting_version.h"
#include "repository.h" #include "repository.h"
#include "repository_p.h" #include "repository_p.h"
#include "rule_p.h" #include "rule_p.h"
#include "ksyntaxhighlighting_logging.h"
#include "ksyntaxhighlighting_version.h"
#include "xml_p.h" #include "xml_p.h"
#include <QCoreApplication> #include <QCoreApplication>
@@ -66,19 +65,19 @@ DefinitionData* DefinitionData::get(const Definition &def)
return def.d.get(); return def.d.get();
} }
Definition::Definition() : Definition::Definition()
d(new DefinitionData) : d(new DefinitionData)
{ {
} }
Definition::Definition(const Definition &other) : Definition::Definition(const Definition &other)
d(other.d) : d(other.d)
{ {
d->q = *this; d->q = *this;
} }
Definition::Definition(const std::shared_ptr<DefinitionData> &dd) : Definition::Definition(const std::shared_ptr<DefinitionData> &dd)
d(dd) : d(dd)
{ {
} }
@@ -237,12 +236,10 @@ bool Definition::setKeywordList(const QString& name, const QStringList& content)
{ {
d->load(DefinitionData::OnlyKeywords(true)); d->load(DefinitionData::OnlyKeywords(true));
KeywordList *list = d->keywordList(name); KeywordList *list = d->keywordList(name);
if (list) if (list) {
{
list->setKeywordList(content); list->setKeywordList(content);
return true; return true;
} } else
else
return false; return false;
} }
@@ -252,9 +249,7 @@ QVector<Format> Definition::formats() const
// sort formats so that the order matches the order of the itemDatas in the xml files. // sort formats so that the order matches the order of the itemDatas in the xml files.
auto formatList = QVector<Format>::fromList(d->formats.values()); auto formatList = QVector<Format>::fromList(d->formats.values());
std::sort(formatList.begin(), formatList.end(), [](const KSyntaxHighlighting::Format & lhs, const KSyntaxHighlighting::Format & rhs){ std::sort(formatList.begin(), formatList.end(), [](const KSyntaxHighlighting::Format &lhs, const KSyntaxHighlighting::Format &rhs) { return lhs.id() < rhs.id(); });
return lhs.id() < rhs.id();
});
return formatList; return formatList;
} }
@@ -475,10 +470,18 @@ bool DefinitionData::loadMetaData(const QString &file, const QJsonObject &obj)
fileName = file; fileName = file;
const auto exts = obj.value(QLatin1String("extensions")).toString(); const auto exts = obj.value(QLatin1String("extensions")).toString();
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
for (const auto &ext : exts.split(QLatin1Char(';'), QString::SkipEmptyParts)) for (const auto &ext : exts.split(QLatin1Char(';'), QString::SkipEmptyParts))
#else
for (const auto &ext : exts.split(QLatin1Char(';'), Qt::SkipEmptyParts))
#endif
extensions.push_back(ext); extensions.push_back(ext);
const auto mts = obj.value(QLatin1String("mimetype")).toString(); const auto mts = obj.value(QLatin1String("mimetype")).toString();
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
for (const auto &mt : mts.split(QLatin1Char(';'), QString::SkipEmptyParts)) for (const auto &mt : mts.split(QLatin1Char(';'), QString::SkipEmptyParts))
#else
for (const auto &mt : mts.split(QLatin1Char(';'), Qt::SkipEmptyParts))
#endif
mimetypes.push_back(mt); mimetypes.push_back(mt);
return true; return true;
@@ -503,10 +506,18 @@ bool DefinitionData::loadLanguage(QXmlStreamReader &reader)
author = reader.attributes().value(QStringLiteral("author")).toString(); author = reader.attributes().value(QStringLiteral("author")).toString();
license = reader.attributes().value(QStringLiteral("license")).toString(); license = reader.attributes().value(QStringLiteral("license")).toString();
const auto exts = reader.attributes().value(QStringLiteral("extensions")).toString(); const auto exts = reader.attributes().value(QStringLiteral("extensions")).toString();
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
for (const auto &ext : exts.split(QLatin1Char(';'), QString::SkipEmptyParts)) for (const auto &ext : exts.split(QLatin1Char(';'), QString::SkipEmptyParts))
#else
for (const auto &ext : exts.split(QLatin1Char(';'), Qt::SkipEmptyParts))
#endif
extensions.push_back(ext); extensions.push_back(ext);
const auto mts = reader.attributes().value(QStringLiteral("mimetype")).toString(); const auto mts = reader.attributes().value(QStringLiteral("mimetype")).toString();
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
for (const auto &mt : mts.split(QLatin1Char(';'), QString::SkipEmptyParts)) for (const auto &mt : mts.split(QLatin1Char(';'), QString::SkipEmptyParts))
#else
for (const auto &mt : mts.split(QLatin1Char(';'), Qt::SkipEmptyParts))
#endif
mimetypes.push_back(mt); mimetypes.push_back(mt);
if (reader.attributes().hasAttribute(QStringLiteral("casesensitive"))) if (reader.attributes().hasAttribute(QStringLiteral("casesensitive")))
caseSensitive = Xml::attrToBool(reader.attributes().value(QStringLiteral("casesensitive"))) ? Qt::CaseSensitive : Qt::CaseInsensitive; caseSensitive = Xml::attrToBool(reader.attributes().value(QStringLiteral("casesensitive"))) ? Qt::CaseSensitive : Qt::CaseInsensitive;
@@ -529,8 +540,7 @@ void DefinitionData::loadHighlighting(QXmlStreamReader& reader, OnlyKeywords onl
KeywordList keywords; KeywordList keywords;
keywords.load(reader); keywords.load(reader);
keywordLists.insert(keywords.name(), keywords); keywordLists.insert(keywords.name(), keywords);
} } else {
else {
reader.skipCurrentElement(); reader.skipCurrentElement();
reader.readNext(); // Skip </list> reader.readNext(); // Skip </list>
} }
@@ -813,8 +823,8 @@ DefinitionRef::DefinitionRef()
{ {
} }
DefinitionRef::DefinitionRef(const Definition &def) : DefinitionRef::DefinitionRef(const Definition &def)
d(def.d) : d(def.d)
{ {
} }

View File

@@ -37,8 +37,8 @@ class QStringList;
template<typename T> class QVector; template<typename T> class QVector;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace KSyntaxHighlighting { namespace KSyntaxHighlighting
{
class Context; class Context;
class Format; class Format;
class KeywordList; class KeywordList;
@@ -50,8 +50,7 @@ class DefinitionData;
* @since 5.50 * @since 5.50
* @see Definition::singleLineCommentPosition() * @see Definition::singleLineCommentPosition()
*/ */
enum class CommentPosition enum class CommentPosition {
{
//! The comment marker is inserted at the beginning of a line at column 0 //! The comment marker is inserted at the beginning of a line at column 0
StartOfLine = 0, StartOfLine = 0,
//! The comment marker is inserted after leading whitespaces right befire //! The comment marker is inserted after leading whitespaces right befire

View File

@@ -24,8 +24,8 @@
#ifndef KSYNTAXHIGHLIGHTING_DEFINITION_P_H #ifndef KSYNTAXHIGHLIGHTING_DEFINITION_P_H
#define KSYNTAXHIGHLIGHTING_DEFINITION_P_H #define KSYNTAXHIGHLIGHTING_DEFINITION_P_H
#include "definitionref_p.h"
#include "definition.h" #include "definition.h"
#include "definitionref_p.h"
#include <QHash> #include <QHash>
#include <QString> #include <QString>
@@ -36,8 +36,8 @@ class QXmlStreamReader;
class QJsonObject; class QJsonObject;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace KSyntaxHighlighting { namespace KSyntaxHighlighting
{
class Repository; class Repository;
class DefinitionData class DefinitionData

View File

@@ -23,9 +23,9 @@
#include "definitiondownloader.h" #include "definitiondownloader.h"
#include "definition.h" #include "definition.h"
#include "repository.h"
#include "ksyntaxhighlighting_logging.h" #include "ksyntaxhighlighting_logging.h"
#include "ksyntaxhighlighting_version.h" #include "ksyntaxhighlighting_version.h"
#include "repository.h"
#include <QDir> #include <QDir>
#include <QFile> #include <QFile>
@@ -57,8 +57,9 @@ public:
void DefinitionDownloaderPrivate::definitionListDownloadFinished(QNetworkReply *reply) void DefinitionDownloaderPrivate::definitionListDownloadFinished(QNetworkReply *reply)
{ {
if (reply->error() != QNetworkReply::NoError) { const auto networkError = reply->error();
qCWarning(Log) << reply->error(); if (networkError != QNetworkReply::NoError) {
qCWarning(Log) << networkError;
emit q->done(); // TODO return error emit q->done(); // TODO return error
return; return;
} }
@@ -110,9 +111,7 @@ void DefinitionDownloaderPrivate::downloadDefinition(const QUrl& downloadUrl)
QNetworkRequest req(url); QNetworkRequest req(url);
auto reply = nam->get(req); auto reply = nam->get(req);
QObject::connect(reply, &QNetworkReply::finished, q, [this, reply]() { QObject::connect(reply, &QNetworkReply::finished, q, [this, reply]() { downloadDefinitionFinished(reply); });
downloadDefinitionFinished(reply);
});
++pendingDownloads; ++pendingDownloads;
needsReload = true; needsReload = true;
} }
@@ -120,8 +119,10 @@ void DefinitionDownloaderPrivate::downloadDefinition(const QUrl& downloadUrl)
void DefinitionDownloaderPrivate::downloadDefinitionFinished(QNetworkReply *reply) void DefinitionDownloaderPrivate::downloadDefinitionFinished(QNetworkReply *reply)
{ {
--pendingDownloads; --pendingDownloads;
if (reply->error() != QNetworkReply::NoError) {
qCWarning(Log) << "Failed to download definition file" << reply->url() << reply->error(); const auto networkError = reply->error();
if (networkError != QNetworkReply::NoError) {
qCWarning(Log) << "Failed to download definition file" << reply->url() << networkError;
checkDone(); checkDone();
return; return;
} }
@@ -154,7 +155,6 @@ void DefinitionDownloaderPrivate::checkDone()
} }
} }
DefinitionDownloader::DefinitionDownloader(Repository *repo, QObject *parent) DefinitionDownloader::DefinitionDownloader(Repository *repo, QObject *parent)
: QObject(parent) : QObject(parent)
, d(new DefinitionDownloaderPrivate()) , d(new DefinitionDownloaderPrivate())
@@ -178,15 +178,9 @@ DefinitionDownloader::~DefinitionDownloader()
void DefinitionDownloader::start() void DefinitionDownloader::start()
{ {
const QString url = QLatin1String("https://www.kate-editor.org/syntax/update-") const QString url = QLatin1String("https://www.kate-editor.org/syntax/update-") + QString::number(SyntaxHighlighting_VERSION_MAJOR) + QLatin1Char('.') + QString::number(SyntaxHighlighting_VERSION_MINOR) + QLatin1String(".xml");
+ QString::number(SyntaxHighlighting_VERSION_MAJOR)
+ QLatin1Char('.')
+ QString::number(SyntaxHighlighting_VERSION_MINOR)
+ QLatin1String(".xml");
auto req = QNetworkRequest(QUrl(url)); auto req = QNetworkRequest(QUrl(url));
req.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true); req.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
auto reply = d->nam->get(req); auto reply = d->nam->get(req);
QObject::connect(reply, &QNetworkReply::finished, this, [=]() { QObject::connect(reply, &QNetworkReply::finished, this, [=]() { d->definitionListDownloadFinished(reply); });
d->definitionListDownloadFinished(reply);
});
} }

View File

@@ -29,8 +29,8 @@
#include <QObject> #include <QObject>
#include <memory> #include <memory>
namespace KSyntaxHighlighting { namespace KSyntaxHighlighting
{
class DefinitionDownloaderPrivate; class DefinitionDownloaderPrivate;
class Repository; class Repository;

View File

@@ -26,8 +26,8 @@
#include <memory> #include <memory>
namespace KSyntaxHighlighting { namespace KSyntaxHighlighting
{
class Definition; class Definition;
class DefinitionData; class DefinitionData;
class DefinitionPrivate; class DefinitionPrivate;
@@ -71,4 +71,3 @@ private:
} }
#endif #endif

View File

@@ -27,15 +27,15 @@ using namespace KSyntaxHighlighting;
static_assert(sizeof(FoldingRegion) == 2, "FoldingRegion is size-sensitive to frequent use in KTextEditor!"); static_assert(sizeof(FoldingRegion) == 2, "FoldingRegion is size-sensitive to frequent use in KTextEditor!");
FoldingRegion::FoldingRegion() : FoldingRegion::FoldingRegion()
m_type(None), : m_type(None)
m_id(0) , m_id(0)
{ {
} }
FoldingRegion::FoldingRegion(Type type, quint16 id) : FoldingRegion::FoldingRegion(Type type, quint16 id)
m_type(type), : m_type(type)
m_id(id) , m_id(id)
{ {
} }

View File

@@ -28,8 +28,8 @@
#include <QTypeInfo> #include <QTypeInfo>
namespace KSyntaxHighlighting { namespace KSyntaxHighlighting
{
/** Represents a begin or end of a folding region. /** Represents a begin or end of a folding region.
* @since 5.28 */ * @since 5.28 */
class KSYNTAXHIGHLIGHTING_EXPORT FoldingRegion class KSYNTAXHIGHLIGHTING_EXPORT FoldingRegion

View File

@@ -22,9 +22,9 @@
*/ */
#include "format.h" #include "format.h"
#include "format_p.h"
#include "definition.h" #include "definition.h"
#include "definitionref_p.h" #include "definitionref_p.h"
#include "format_p.h"
#include "textstyledata_p.h" #include "textstyledata_p.h"
#include "themedata_p.h" #include "themedata_p.h"
#include "xml_p.h" #include "xml_p.h"
@@ -71,12 +71,13 @@ static QExplicitlySharedDataPointer<FormatPrivate> &sharedDefaultPrivate()
return def; return def;
} }
Format::Format() : d(sharedDefaultPrivate()) Format::Format()
: d(sharedDefaultPrivate())
{ {
} }
Format::Format(const Format &other) : Format::Format(const Format &other)
d(other.d) : d(other.d)
{ {
} }
@@ -112,21 +113,14 @@ Theme::TextStyle Format::textStyle() const
bool Format::isDefaultTextStyle(const Theme &theme) const bool Format::isDefaultTextStyle(const Theme &theme) const
{ {
return (!hasTextColor(theme)) return (!hasTextColor(theme)) && (!hasBackgroundColor(theme)) && (selectedTextColor(theme) == theme.selectedTextColor(Theme::Normal)) && (selectedBackgroundColor(theme) == theme.selectedBackgroundColor(Theme::Normal)) &&
&& (!hasBackgroundColor(theme)) (isBold(theme) == theme.isBold(Theme::Normal)) && (isItalic(theme) == theme.isItalic(Theme::Normal)) && (isUnderline(theme) == theme.isUnderline(Theme::Normal)) && (isStrikeThrough(theme) == theme.isStrikeThrough(Theme::Normal));
&& (selectedTextColor(theme) == theme.selectedTextColor(Theme::Normal))
&& (selectedBackgroundColor(theme) == theme.selectedBackgroundColor(Theme::Normal))
&& (isBold(theme) == theme.isBold(Theme::Normal))
&& (isItalic(theme) == theme.isItalic(Theme::Normal))
&& (isUnderline(theme) == theme.isUnderline(Theme::Normal))
&& (isStrikeThrough(theme) == theme.isStrikeThrough(Theme::Normal));
} }
bool Format::hasTextColor(const Theme &theme) const bool Format::hasTextColor(const Theme &theme) const
{ {
const auto overrideStyle = d->styleOverride(theme); const auto overrideStyle = d->styleOverride(theme);
return textColor(theme) != theme.textColor(Theme::Normal) return textColor(theme) != theme.textColor(Theme::Normal) && (d->style.textColor || theme.textColor(d->defaultStyle) || overrideStyle.textColor);
&& (d->style.textColor || theme.textColor(d->defaultStyle) || overrideStyle.textColor);
} }
QColor Format::textColor(const Theme &theme) const QColor Format::textColor(const Theme &theme) const
@@ -148,8 +142,7 @@ QColor Format::selectedTextColor(const Theme &theme) const
bool Format::hasBackgroundColor(const Theme &theme) const bool Format::hasBackgroundColor(const Theme &theme) const
{ {
const auto overrideStyle = d->styleOverride(theme); const auto overrideStyle = d->styleOverride(theme);
return backgroundColor(theme) != theme.backgroundColor(Theme::Normal) return backgroundColor(theme) != theme.backgroundColor(Theme::Normal) && (d->style.backgroundColor || theme.backgroundColor(d->defaultStyle) || overrideStyle.backgroundColor);
&& (d->style.backgroundColor || theme.backgroundColor(d->defaultStyle) || overrideStyle.backgroundColor);
} }
QColor Format::backgroundColor(const Theme &theme) const QColor Format::backgroundColor(const Theme &theme) const
@@ -165,8 +158,7 @@ QColor Format::selectedBackgroundColor(const Theme &theme) const
const auto overrideStyle = d->styleOverride(theme); const auto overrideStyle = d->styleOverride(theme);
if (overrideStyle.selectedBackgroundColor) if (overrideStyle.selectedBackgroundColor)
return overrideStyle.selectedBackgroundColor; return overrideStyle.selectedBackgroundColor;
return d->style.selectedBackgroundColor ? d->style.selectedBackgroundColor return d->style.selectedBackgroundColor ? d->style.selectedBackgroundColor : theme.selectedBackgroundColor(d->defaultStyle);
: theme.selectedBackgroundColor(d->defaultStyle);
} }
bool Format::isBold(const Theme &theme) const bool Format::isBold(const Theme &theme) const
@@ -246,7 +238,6 @@ bool Format::hasSelectedBackgroundColorOverride() const
return d->style.selectedBackgroundColor; return d->style.selectedBackgroundColor;
} }
void FormatPrivate::load(QXmlStreamReader &reader) void FormatPrivate::load(QXmlStreamReader &reader)
{ {
name = reader.attributes().value(QStringLiteral("name")).toString(); name = reader.attributes().value(QStringLiteral("name")).toString();

View File

@@ -35,8 +35,8 @@ class QString;
class QXmlStreamReader; class QXmlStreamReader;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace KSyntaxHighlighting { namespace KSyntaxHighlighting
{
class DefinitionRef; class DefinitionRef;
class FormatPrivate; class FormatPrivate;

View File

@@ -31,8 +31,8 @@
#include <QSharedData> #include <QSharedData>
#include <QString> #include <QString>
namespace KSyntaxHighlighting { namespace KSyntaxHighlighting
{
class FormatPrivate : public QSharedData class FormatPrivate : public QSharedData
{ {
public: public:

View File

@@ -25,9 +25,9 @@
#include "htmlhighlighter.h" #include "htmlhighlighter.h"
#include "definition.h" #include "definition.h"
#include "format.h" #include "format.h"
#include "ksyntaxhighlighting_logging.h"
#include "state.h" #include "state.h"
#include "theme.h" #include "theme.h"
#include "ksyntaxhighlighting_logging.h"
#include <QFile> #include <QFile>
#include <QFileInfo> #include <QFileInfo>

View File

@@ -24,11 +24,11 @@
#ifndef KSYNTAXHIGHLIGHTING_HTMLHIGHLIGHTER_H #ifndef KSYNTAXHIGHLIGHTING_HTMLHIGHLIGHTER_H
#define KSYNTAXHIGHLIGHTING_HTMLHIGHLIGHTER_H #define KSYNTAXHIGHLIGHTING_HTMLHIGHLIGHTER_H
#include "ksyntaxhighlighting_export.h"
#include "abstracthighlighter.h" #include "abstracthighlighter.h"
#include "ksyntaxhighlighting_export.h"
#include <QString>
#include <QIODevice> #include <QIODevice>
#include <QString>
#include <memory> #include <memory>
@@ -37,8 +37,8 @@ class QFile;
class QTextStream; class QTextStream;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace KSyntaxHighlighting { namespace KSyntaxHighlighting
{
class HtmlHighlighterPrivate; class HtmlHighlighterPrivate;
class KSYNTAXHIGHLIGHTING_EXPORT HtmlHighlighter : public AbstractHighlighter class KSYNTAXHIGHLIGHTING_EXPORT HtmlHighlighter : public AbstractHighlighter

View File

@@ -21,10 +21,10 @@
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include "keywordlist_p.h"
#include "repository.h"
#include "definition_p.h" #include "definition_p.h"
#include "keywordlist_p.h"
#include "ksyntaxhighlighting_logging.h" #include "ksyntaxhighlighting_logging.h"
#include "repository.h"
#include <QXmlStreamReader> #include <QXmlStreamReader>
@@ -59,8 +59,7 @@ void KeywordList::load(QXmlStreamReader& reader)
m_keywords.append(reader.readElementText().trimmed()); m_keywords.append(reader.readElementText().trimmed());
reader.readNextStartElement(); reader.readNextStartElement();
break; break;
} } else if (reader.name() == QLatin1String("include")) {
else if (reader.name() == QLatin1String("include")) {
m_includes.append(reader.readElementText().trimmed()); m_includes.append(reader.readElementText().trimmed());
reader.readNextStartElement(); reader.readNextStartElement();
break; break;
@@ -127,8 +126,7 @@ void KeywordList::resolveIncludeKeywords(DefinitionData &def)
auto defData = DefinitionData::get(includeDef); auto defData = DefinitionData::get(includeDef);
defData->load(DefinitionData::OnlyKeywords(true)); defData->load(DefinitionData::OnlyKeywords(true));
keywords = defData->keywordList(listName); keywords = defData->keywordList(listName);
} } else {
else {
qCWarning(Log) << "Unable to resolve external include keyword for definition" << defName << "in" << def.name; qCWarning(Log) << "Unable to resolve external include keyword for definition" << defName << "in" << def.name;
} }
} else { } else {
@@ -140,8 +138,7 @@ void KeywordList::resolveIncludeKeywords(DefinitionData &def)
keywords->resolveIncludeKeywords(def); keywords->resolveIncludeKeywords(def);
} }
m_keywords += keywords->m_keywords; m_keywords += keywords->m_keywords;
} } else {
else {
qCWarning(Log) << "Unresolved include keyword" << kw_include << "in" << def.name; qCWarning(Log) << "Unresolved include keyword" << kw_include << "in" << def.name;
} }
} }

View File

@@ -33,8 +33,8 @@ QT_BEGIN_NAMESPACE
class QXmlStreamReader; class QXmlStreamReader;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace KSyntaxHighlighting { namespace KSyntaxHighlighting
{
class Repository; class Repository;
class DefinitionData; class DefinitionData;

View File

@@ -26,8 +26,8 @@
#include <QStringList> #include <QStringList>
namespace KSyntaxHighlighting { namespace KSyntaxHighlighting
{
/** /**
* Storage for match result of a Rule. * Storage for match result of a Rule.
* Heavily used internally during highlightLine, therefore completely inline. * Heavily used internally during highlightLine, therefore completely inline.
@@ -73,7 +73,6 @@ public:
return m_offset; return m_offset;
} }
/** /**
* Skip offset of the match * Skip offset of the match
* @return skip offset of the match, no match possible until this offset is reached * @return skip offset of the match, no match possible until this offset is reached

View File

@@ -22,12 +22,12 @@
*/ */
#include "repository.h" #include "repository.h"
#include "repository_p.h"
#include "definition.h" #include "definition.h"
#include "definition_p.h" #include "definition_p.h"
#include "ksyntaxhighlighting_logging.h"
#include "repository_p.h"
#include "theme.h" #include "theme.h"
#include "themedata_p.h" #include "themedata_p.h"
#include "ksyntaxhighlighting_logging.h"
#include "wildcardmatcher_p.h" #include "wildcardmatcher_p.h"
#include <QDirIterator> #include <QDirIterator>
@@ -57,8 +57,8 @@ RepositoryPrivate* RepositoryPrivate::get(Repository *repo)
return repo->d.get(); return repo->d.get();
} }
Repository::Repository() : Repository::Repository()
d(new RepositoryPrivate) : d(new RepositoryPrivate)
{ {
initResource(); initResource();
d->load(this); d->load(this);
@@ -79,9 +79,7 @@ Definition Repository::definitionForName(const QString& defName) const
static void sortDefinitions(QVector<Definition> &definitions) static void sortDefinitions(QVector<Definition> &definitions)
{ {
std::stable_sort(definitions.begin(), definitions.end(), [](const Definition &lhs, const Definition &rhs) { std::stable_sort(definitions.begin(), definitions.end(), [](const Definition &lhs, const Definition &rhs) { return lhs.priority() > rhs.priority(); });
return lhs.priority() > rhs.priority();
});
} }
Definition Repository::definitionForFileName(const QString &fileName) const Definition Repository::definitionForFileName(const QString &fileName) const
@@ -273,9 +271,7 @@ static int themeRevision(const Theme &theme)
void RepositoryPrivate::addTheme(const Theme &theme) void RepositoryPrivate::addTheme(const Theme &theme)
{ {
const auto it = std::lower_bound(m_themes.begin(), m_themes.end(), theme, [](const Theme &lhs, const Theme &rhs) { const auto it = std::lower_bound(m_themes.begin(), m_themes.end(), theme, [](const Theme &lhs, const Theme &rhs) { return lhs.name() < rhs.name(); });
return lhs.name() < rhs.name();
});
if (it == m_themes.end() || (*it).name() != theme.name()) { if (it == m_themes.end() || (*it).name() != theme.name()) {
m_themes.insert(it, theme); m_themes.insert(it, theme);
return; return;

View File

@@ -26,8 +26,8 @@
#include "ksyntaxhighlighting_export.h" #include "ksyntaxhighlighting_export.h"
#include <qglobal.h>
#include <memory> #include <memory>
#include <qglobal.h>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QString; class QString;
@@ -43,8 +43,8 @@ QT_END_NAMESPACE
* *
* @see Repository * @see Repository
*/ */
namespace KSyntaxHighlighting { namespace KSyntaxHighlighting
{
class Definition; class Definition;
class RepositoryPrivate; class RepositoryPrivate;
class Theme; class Theme;

View File

@@ -31,8 +31,8 @@ QT_BEGIN_NAMESPACE
class QString; class QString;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace KSyntaxHighlighting { namespace KSyntaxHighlighting
{
class Definition; class Definition;
class Repository; class Repository;
class Theme; class Theme;

View File

@@ -22,10 +22,10 @@
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include "rule_p.h"
#include "context_p.h" #include "context_p.h"
#include "definition_p.h" #include "definition_p.h"
#include "ksyntaxhighlighting_logging.h" #include "ksyntaxhighlighting_logging.h"
#include "rule_p.h"
#include "xml_p.h" #include "xml_p.h"
#include <QString> #include <QString>
@@ -40,13 +40,8 @@ static bool isOctalChar(QChar c)
static bool isHexChar(QChar c) static bool isHexChar(QChar c)
{ {
return c.isNumber() return c.isNumber() || c == QLatin1Char('a') || c == QLatin1Char('A') || c == QLatin1Char('b') || c == QLatin1Char('B') || c == QLatin1Char('c') || c == QLatin1Char('C') || c == QLatin1Char('d') || c == QLatin1Char('D') ||
|| c == QLatin1Char('a') || c == QLatin1Char('A') c == QLatin1Char('e') || c == QLatin1Char('E') || c == QLatin1Char('f') || c == QLatin1Char('F');
|| c == QLatin1Char('b') || c == QLatin1Char('B')
|| c == QLatin1Char('c') || c == QLatin1Char('C')
|| c == QLatin1Char('d') || c == QLatin1Char('D')
|| c == QLatin1Char('e') || c == QLatin1Char('E')
|| c == QLatin1Char('f') || c == QLatin1Char('F');
} }
static int matchEscapedChar(const QString &text, int offset) static int matchEscapedChar(const QString &text, int offset)
@@ -212,7 +207,6 @@ bool Rule::isWordDelimiter(QChar c) const
return m_wordDelimiter.contains(c); return m_wordDelimiter.contains(c);
} }
bool AnyChar::doLoad(QXmlStreamReader &reader) bool AnyChar::doLoad(QXmlStreamReader &reader)
{ {
m_chars = reader.attributes().value(QStringLiteral("String")).toString(); m_chars = reader.attributes().value(QStringLiteral("String")).toString();
@@ -228,7 +222,6 @@ MatchResult AnyChar::doMatch(const QString& text, int offset, const QStringList&
return offset; return offset;
} }
bool DetectChar::doLoad(QXmlStreamReader &reader) bool DetectChar::doLoad(QXmlStreamReader &reader)
{ {
const auto s = reader.attributes().value(QStringLiteral("char")); const auto s = reader.attributes().value(QStringLiteral("char"));
@@ -257,7 +250,6 @@ MatchResult DetectChar::doMatch(const QString& text, int offset, const QStringLi
return offset; return offset;
} }
bool Detect2Char::doLoad(QXmlStreamReader &reader) bool Detect2Char::doLoad(QXmlStreamReader &reader)
{ {
const auto s1 = reader.attributes().value(QStringLiteral("char")); const auto s1 = reader.attributes().value(QStringLiteral("char"));
@@ -278,7 +270,6 @@ MatchResult Detect2Char::doMatch(const QString& text, int offset, const QStringL
return offset; return offset;
} }
MatchResult DetectIdentifier::doMatch(const QString &text, int offset, const QStringList &) const MatchResult DetectIdentifier::doMatch(const QString &text, int offset, const QStringList &) const
{ {
if (!text.at(offset).isLetter() && text.at(offset) != QLatin1Char('_')) if (!text.at(offset).isLetter() && text.at(offset) != QLatin1Char('_'))
@@ -293,7 +284,6 @@ MatchResult DetectIdentifier::doMatch(const QString& text, int offset, const QSt
return text.size(); return text.size();
} }
MatchResult DetectSpaces::doMatch(const QString &text, int offset, const QStringList &) const MatchResult DetectSpaces::doMatch(const QString &text, int offset, const QStringList &) const
{ {
while (offset < text.size() && text.at(offset).isSpace()) while (offset < text.size() && text.at(offset).isSpace())
@@ -301,7 +291,6 @@ MatchResult DetectSpaces::doMatch(const QString& text, int offset, const QString
return offset; return offset;
} }
MatchResult Float::doMatch(const QString &text, int offset, const QStringList &) const MatchResult Float::doMatch(const QString &text, int offset, const QStringList &) const
{ {
if (offset > 0 && !isWordDelimiter(text.at(offset - 1))) if (offset > 0 && !isWordDelimiter(text.at(offset - 1)))
@@ -339,7 +328,6 @@ MatchResult Float::doMatch(const QString& text, int offset, const QStringList&)
return expOffset; return expOffset;
} }
MatchResult HlCChar::doMatch(const QString &text, int offset, const QStringList &) const MatchResult HlCChar::doMatch(const QString &text, int offset, const QStringList &) const
{ {
if (text.size() < offset + 3) if (text.size() < offset + 3)
@@ -364,7 +352,6 @@ MatchResult HlCChar::doMatch(const QString& text, int offset, const QStringList&
return offset; return offset;
} }
MatchResult HlCHex::doMatch(const QString &text, int offset, const QStringList &) const MatchResult HlCHex::doMatch(const QString &text, int offset, const QStringList &) const
{ {
if (offset > 0 && !isWordDelimiter(text.at(offset - 1))) if (offset > 0 && !isWordDelimiter(text.at(offset - 1)))
@@ -388,7 +375,6 @@ MatchResult HlCHex::doMatch(const QString& text, int offset, const QStringList&)
return offset; return offset;
} }
MatchResult HlCOct::doMatch(const QString &text, int offset, const QStringList &) const MatchResult HlCOct::doMatch(const QString &text, int offset, const QStringList &) const
{ {
if (offset > 0 && !isWordDelimiter(text.at(offset - 1))) if (offset > 0 && !isWordDelimiter(text.at(offset - 1)))
@@ -410,13 +396,11 @@ MatchResult HlCOct::doMatch(const QString& text, int offset, const QStringList&)
return offset; return offset;
} }
MatchResult HlCStringChar::doMatch(const QString &text, int offset, const QStringList &) const MatchResult HlCStringChar::doMatch(const QString &text, int offset, const QStringList &) const
{ {
return matchEscapedChar(text, offset); return matchEscapedChar(text, offset);
} }
QString IncludeRules::contextName() const QString IncludeRules::contextName() const
{ {
return m_contextName; return m_contextName;
@@ -435,7 +419,11 @@ bool IncludeRules::includeAttribute() const
bool IncludeRules::doLoad(QXmlStreamReader &reader) bool IncludeRules::doLoad(QXmlStreamReader &reader)
{ {
const auto s = reader.attributes().value(QLatin1String("context")); const auto s = reader.attributes().value(QLatin1String("context"));
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
const auto split = s.split(QLatin1String("##"), QString::KeepEmptyParts); const auto split = s.split(QLatin1String("##"), QString::KeepEmptyParts);
#else
const auto split = s.split(QLatin1String("##"), Qt::KeepEmptyParts);
#endif
if (split.isEmpty()) if (split.isEmpty())
return false; return false;
m_contextName = split.at(0).toString(); m_contextName = split.at(0).toString();
@@ -453,7 +441,6 @@ MatchResult IncludeRules::doMatch(const QString& text, int offset, const QString
return offset; return offset;
} }
MatchResult Int::doMatch(const QString &text, int offset, const QStringList &) const MatchResult Int::doMatch(const QString &text, int offset, const QStringList &) const
{ {
if (offset > 0 && !isWordDelimiter(text.at(offset - 1))) if (offset > 0 && !isWordDelimiter(text.at(offset - 1)))
@@ -464,7 +451,6 @@ MatchResult Int::doMatch(const QString& text, int offset, const QStringList &) c
return offset; return offset;
} }
bool KeywordListRule::doLoad(QXmlStreamReader &reader) bool KeywordListRule::doLoad(QXmlStreamReader &reader)
{ {
/** /**
@@ -482,8 +468,7 @@ bool KeywordListRule::doLoad(QXmlStreamReader& reader)
*/ */
if (reader.attributes().hasAttribute(QLatin1String("insensitive"))) { if (reader.attributes().hasAttribute(QLatin1String("insensitive"))) {
m_hasCaseSensitivityOverride = true; m_hasCaseSensitivityOverride = true;
m_caseSensitivityOverride = Xml::attrToBool(reader.attributes().value(QLatin1String("insensitive"))) ? m_caseSensitivityOverride = Xml::attrToBool(reader.attributes().value(QLatin1String("insensitive"))) ? Qt::CaseInsensitive : Qt::CaseSensitive;
Qt::CaseInsensitive : Qt::CaseSensitive;
m_keywordList->initLookupForCaseSensitivity(m_caseSensitivityOverride); m_keywordList->initLookupForCaseSensitivity(m_caseSensitivityOverride);
} else { } else {
m_hasCaseSensitivityOverride = false; m_hasCaseSensitivityOverride = false;
@@ -512,7 +497,6 @@ MatchResult KeywordListRule::doMatch(const QString& text, int offset, const QStr
return MatchResult(offset, newOffset); return MatchResult(offset, newOffset);
} }
bool LineContinue::doLoad(QXmlStreamReader &reader) bool LineContinue::doLoad(QXmlStreamReader &reader)
{ {
const auto s = reader.attributes().value(QStringLiteral("char")); const auto s = reader.attributes().value(QStringLiteral("char"));
@@ -530,7 +514,6 @@ MatchResult LineContinue::doMatch(const QString& text, int offset, const QString
return offset; return offset;
} }
bool RangeDetect::doLoad(QXmlStreamReader &reader) bool RangeDetect::doLoad(QXmlStreamReader &reader)
{ {
const auto s1 = reader.attributes().value(QStringLiteral("char")); const auto s1 = reader.attributes().value(QStringLiteral("char"));
@@ -564,9 +547,7 @@ bool RegExpr::doLoad(QXmlStreamReader& reader)
const auto isMinimal = Xml::attrToBool(reader.attributes().value(QStringLiteral("minimal"))); const auto isMinimal = Xml::attrToBool(reader.attributes().value(QStringLiteral("minimal")));
const auto isCaseInsensitive = Xml::attrToBool(reader.attributes().value(QStringLiteral("insensitive"))); const auto isCaseInsensitive = Xml::attrToBool(reader.attributes().value(QStringLiteral("insensitive")));
m_regexp.setPatternOptions( m_regexp.setPatternOptions((isMinimal ? QRegularExpression::InvertedGreedinessOption : QRegularExpression::NoPatternOption) | (isCaseInsensitive ? QRegularExpression::CaseInsensitiveOption : QRegularExpression::NoPatternOption));
(isMinimal ? QRegularExpression::InvertedGreedinessOption : QRegularExpression::NoPatternOption) |
(isCaseInsensitive ? QRegularExpression::CaseInsensitiveOption : QRegularExpression::NoPatternOption));
// optimize the pattern for the non-dynamic case, we use them OFTEN // optimize the pattern for the non-dynamic case, we use them OFTEN
m_dynamic = Xml::attrToBool(reader.attributes().value(QStringLiteral("dynamic"))); m_dynamic = Xml::attrToBool(reader.attributes().value(QStringLiteral("dynamic")));
@@ -612,13 +593,11 @@ MatchResult RegExpr::doMatch(const QString& text, int offset, const QStringList
/** /**
* no match * no match
* the pattern of a dynamic regex depends on the previous contexts * we can always compute the skip offset as the highlighter will invalidate the cache for changed captures for dynamic rules!
* so that skipOffset cannot be computed
*/ */
return MatchResult(offset, m_dynamic ? 0 : result.capturedStart()); return MatchResult(offset, result.capturedStart());
} }
bool StringDetect::doLoad(QXmlStreamReader &reader) bool StringDetect::doLoad(QXmlStreamReader &reader)
{ {
m_string = reader.attributes().value(QStringLiteral("String")).toString(); m_string = reader.attributes().value(QStringLiteral("String")).toString();
@@ -639,7 +618,6 @@ MatchResult StringDetect::doMatch(const QString& text, int offset, const QString
return offset; return offset;
} }
bool WordDetect::doLoad(QXmlStreamReader &reader) bool WordDetect::doLoad(QXmlStreamReader &reader)
{ {
m_word = reader.attributes().value(QStringLiteral("String")).toString(); m_word = reader.attributes().value(QStringLiteral("String")).toString();

View File

@@ -41,8 +41,8 @@ QT_BEGIN_NAMESPACE
class QXmlStreamReader; class QXmlStreamReader;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace KSyntaxHighlighting { namespace KSyntaxHighlighting
{
class Rule class Rule
{ {
public: public:
@@ -69,6 +69,11 @@ public:
return m_lookAhead; return m_lookAhead;
} }
bool isDynamic() const
{
return m_dynamic;
}
bool firstNonSpace() const bool firstNonSpace() const
{ {
return m_firstNonSpace; return m_firstNonSpace;
@@ -117,8 +122,10 @@ private:
// cache for DefinitionData::wordDelimiters, is accessed VERY often // cache for DefinitionData::wordDelimiters, is accessed VERY often
QStringRef m_wordDelimiter; QStringRef m_wordDelimiter;
};
protected:
bool m_dynamic = false;
};
class AnyChar : public Rule class AnyChar : public Rule
{ {
@@ -138,7 +145,6 @@ protected:
private: private:
QChar m_char; QChar m_char;
bool m_dynamic = false;
int m_captureIndex = 0; int m_captureIndex = 0;
}; };
@@ -259,7 +265,6 @@ protected:
private: private:
QRegularExpression m_regexp; QRegularExpression m_regexp;
bool m_dynamic = false;
}; };
class StringDetect : public Rule class StringDetect : public Rule
@@ -271,7 +276,6 @@ protected:
private: private:
QString m_string; QString m_string;
Qt::CaseSensitivity m_caseSensitivity; Qt::CaseSensitivity m_caseSensitivity;
bool m_dynamic = false;
}; };
class WordDetect : public Rule class WordDetect : public Rule

View File

@@ -84,13 +84,13 @@ const QStringList &StateData::topCaptures() const
return m_contextStack.last().second; return m_contextStack.last().second;
} }
State::State() : State::State()
d(new StateData) : d(new StateData)
{ {
} }
State::State(const State &other) : State::State(const State &other)
d(other.d) : d(other.d)
{ {
} }

View File

@@ -28,8 +28,8 @@
#include <QExplicitlySharedDataPointer> #include <QExplicitlySharedDataPointer>
namespace KSyntaxHighlighting { namespace KSyntaxHighlighting
{
class StateData; class StateData;
/** Opaque handle to the state of the highlighting engine. /** Opaque handle to the state of the highlighting engine.

View File

@@ -36,7 +36,6 @@ QT_END_NAMESPACE
namespace KSyntaxHighlighting namespace KSyntaxHighlighting
{ {
class Context; class Context;
class StateData : public QSharedData class StateData : public QSharedData

View File

@@ -29,12 +29,12 @@
#include "state.h" #include "state.h"
#include "theme.h" #include "theme.h"
Q_DECLARE_METATYPE(QTextBlock) Q_DECLARE_METATYPE(QTextBlock)
using namespace KSyntaxHighlighting; using namespace KSyntaxHighlighting;
namespace KSyntaxHighlighting { namespace KSyntaxHighlighting
{
class TextBlockUserData : public QTextBlockUserData class TextBlockUserData : public QTextBlockUserData
{ {
public: public:
@@ -63,16 +63,16 @@ FoldingRegion SyntaxHighlighterPrivate::foldingRegion(const QTextBlock& startBlo
return FoldingRegion(); return FoldingRegion();
} }
SyntaxHighlighter::SyntaxHighlighter(QObject* parent) : SyntaxHighlighter::SyntaxHighlighter(QObject *parent)
QSyntaxHighlighter(parent), : QSyntaxHighlighter(parent)
AbstractHighlighter(new SyntaxHighlighterPrivate) , AbstractHighlighter(new SyntaxHighlighterPrivate)
{ {
qRegisterMetaType<QTextBlock>(); qRegisterMetaType<QTextBlock>();
} }
SyntaxHighlighter::SyntaxHighlighter(QTextDocument *document) : SyntaxHighlighter::SyntaxHighlighter(QTextDocument *document)
QSyntaxHighlighter(document), : QSyntaxHighlighter(document)
AbstractHighlighter(new SyntaxHighlighterPrivate) , AbstractHighlighter(new SyntaxHighlighterPrivate)
{ {
qRegisterMetaType<QTextBlock>(); qRegisterMetaType<QTextBlock>();
} }

View File

@@ -30,8 +30,8 @@
#include <QSyntaxHighlighter> #include <QSyntaxHighlighter>
namespace KSyntaxHighlighting { namespace KSyntaxHighlighting
{
class SyntaxHighlighterPrivate; class SyntaxHighlighterPrivate;
/** A QSyntaxHighlighter implementation for use with QTextDocument. /** A QSyntaxHighlighter implementation for use with QTextDocument.

View File

@@ -24,9 +24,10 @@
#ifndef KSYNTAXHIGHLIGHTING_TEXTSTYLEDATA_P_H #ifndef KSYNTAXHIGHLIGHTING_TEXTSTYLEDATA_P_H
#define KSYNTAXHIGHLIGHTING_TEXTSTYLEDATA_P_H #define KSYNTAXHIGHLIGHTING_TEXTSTYLEDATA_P_H
#include <QColor>
namespace KSyntaxHighlighting { namespace KSyntaxHighlighting
{
class TextStyleData class TextStyleData
{ {
public: public:
@@ -40,7 +41,8 @@ public:
, hasItalic(false) , hasItalic(false)
, hasUnderline(false) , hasUnderline(false)
, hasStrikeThrough(false) , hasStrikeThrough(false)
{} {
}
QRgb textColor = 0x0; QRgb textColor = 0x0;
QRgb backgroundColor = 0x0; QRgb backgroundColor = 0x0;

View File

@@ -64,8 +64,7 @@ QString Theme::name() const
QString Theme::translatedName() const QString Theme::translatedName() const
{ {
return m_data ? QCoreApplication::instance()->translate("Theme", m_data->name().toUtf8().constData()) return m_data ? QCoreApplication::instance()->translate("Theme", m_data->name().toUtf8().constData()) : QString();
: QString();
} }
bool Theme::isReadOnly() const bool Theme::isReadOnly() const

View File

@@ -28,11 +28,11 @@
#include <QColor> #include <QColor>
#include <QExplicitlySharedDataPointer> #include <QExplicitlySharedDataPointer>
#include <qobjectdefs.h>
#include <QTypeInfo> #include <QTypeInfo>
#include <qobjectdefs.h>
namespace KSyntaxHighlighting { namespace KSyntaxHighlighting
{
class ThemeData; class ThemeData;
class RepositoryPrivate; class RepositoryPrivate;
@@ -82,7 +82,6 @@ class KSYNTAXHIGHLIGHTING_EXPORT Theme
{ {
Q_GADGET Q_GADGET
public: public:
// TODO KF6: // TODO KF6:
// - make TextStyle an enum class // - make TextStyle an enum class
// - move out of Theme into KSyntaxHighlighting // - move out of Theme into KSyntaxHighlighting

View File

@@ -22,8 +22,8 @@
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include "themedata_p.h"
#include "ksyntaxhighlighting_logging.h" #include "ksyntaxhighlighting_logging.h"
#include "themedata_p.h"
#include <QFile> #include <QFile>
#include <QFileInfo> #include <QFileInfo>
@@ -32,7 +32,6 @@
#include <QJsonValue> #include <QJsonValue>
#include <QMetaEnum> #include <QMetaEnum>
using namespace KSyntaxHighlighting; using namespace KSyntaxHighlighting;
ThemeData *ThemeData::get(const Theme &theme) ThemeData *ThemeData::get(const Theme &theme)

View File

@@ -25,14 +25,14 @@
#ifndef KSYNTAXHIGHLIGHTING_THEMEDATA_P_H #ifndef KSYNTAXHIGHLIGHTING_THEMEDATA_P_H
#define KSYNTAXHIGHLIGHTING_THEMEDATA_P_H #define KSYNTAXHIGHLIGHTING_THEMEDATA_P_H
#include "theme.h"
#include "textstyledata_p.h" #include "textstyledata_p.h"
#include "theme.h"
#include <QHash> #include <QHash>
#include <QSharedData> #include <QSharedData>
namespace KSyntaxHighlighting { namespace KSyntaxHighlighting
{
/** /**
* Data container for a Theme. * Data container for a Theme.
*/ */

View File

@@ -25,11 +25,10 @@
using namespace KSyntaxHighlighting; using namespace KSyntaxHighlighting;
#include <QString>
#include <QChar> #include <QChar>
#include <QString>
static bool exactMatch(const QString &candidate, const QString &wildcard, int candidatePosFromRight, static bool exactMatch(const QString &candidate, const QString &wildcard, int candidatePosFromRight, int wildcardPosFromRight, bool caseSensitive = true)
int wildcardPosFromRight, bool caseSensitive = true)
{ {
for (; wildcardPosFromRight >= 0; wildcardPosFromRight--) { for (; wildcardPosFromRight >= 0; wildcardPosFromRight--) {
const auto ch = wildcard.at(wildcardPosFromRight).unicode(); const auto ch = wildcard.at(wildcardPosFromRight).unicode();
@@ -76,8 +75,7 @@ static bool exactMatch(const QString &candidate, const QString &wildcard, int ca
return true; return true;
} }
bool WildcardMatcher::exactMatch(const QString &candidate, const QString &wildcard, bool WildcardMatcher::exactMatch(const QString &candidate, const QString &wildcard, bool caseSensitive)
bool caseSensitive)
{ {
return ::exactMatch(candidate, wildcard, candidate.length() - 1, wildcard.length() - 1, caseSensitive); return ::exactMatch(candidate, wildcard, candidate.length() - 1, wildcard.length() - 1, caseSensitive);
} }

View File

@@ -30,8 +30,8 @@ QT_BEGIN_NAMESPACE
class QString; class QString;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace KSyntaxHighlighting { namespace KSyntaxHighlighting
{
namespace WildcardMatcher namespace WildcardMatcher
{ {
/** /**

View File

@@ -26,10 +26,11 @@
#include <QString> #include <QString>
namespace KSyntaxHighlighting { namespace KSyntaxHighlighting
{
/** Utilities for XML parsing. */ /** Utilities for XML parsing. */
namespace Xml { namespace Xml
{
/** Parse a xs:boolean attribute. */ /** Parse a xs:boolean attribute. */
inline bool attrToBool(const QStringRef &str) inline bool attrToBool(const QStringRef &str)
{ {