From 5634f112bd31cd2f9ccc521072097a22fb6f09c7 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Tue, 5 Nov 2019 08:59:26 +0100 Subject: [PATCH] SyntaxHighlighting: update KSyntaxHighlighting engine to v5.63.0 Task-number: QTCREATORBUG-22558 Change-Id: I0902d5d866fc83fca2d508cab24dea8d7176240c Reviewed-by: Christian Stenger --- .../data/generators/cmake.xml.tpl | 32 +- .../data/generators/cmake.yaml | 301 ++- .../data/generators/generate-cmake-syntax.py | 45 +- .../data/generators/generate-php.pl | 12 +- .../data/schema/language.xsd | 24 +- .../syntax-highlighting/data/syntax/cmake.xml | 250 ++- .../syntax-highlighting/data/syntax/css.xml | 15 +- .../syntax-highlighting/data/syntax/html.xml | 17 +- .../syntax-highlighting/data/syntax/json.xml | 2 +- .../data/syntax/markdown.xml | 699 +++++-- .../syntax-highlighting/data/syntax/perl.xml | 2 +- .../syntax-highlighting/data/syntax/perl6.xml | 1785 +++++++++++++++++ .../src/cli/kate-syntax-highlighter.cpp | 1 - .../src/indexer/katehighlightingindexer.cpp | 107 +- .../src/lib/CMakeLists.txt | 2 + .../syntax-highlighting/src/lib/context.cpp | 4 +- .../src/lib/definition.cpp | 14 +- .../syntax-highlighting/src/lib/definition.h | 23 +- .../src/lib/definition_p.h | 2 +- .../src/lib/definitiondownloader.cpp | 1 - .../syntax-highlighting/src/lib/format.cpp | 41 +- .../syntax-highlighting/src/lib/format.h | 65 +- .../src/lib/htmlhighlighter.cpp | 1 - .../src/lib/keywordlist.cpp | 1 - .../src/lib/keywordlist_p.h | 11 +- .../src/lib/repository.cpp | 1 - .../syntax-highlighting/src/lib/rule.cpp | 18 +- .../syntax-highlighting/src/lib/rule_p.h | 1 - .../syntax-highlighting/src/lib/state.h | 1 - .../src/lib/syntaxhighlighter.cpp | 1 - .../src/lib/textstyledata_p.h | 1 - .../syntax-highlighting/src/lib/themedata.cpp | 1 - 32 files changed, 3169 insertions(+), 312 deletions(-) create mode 100644 src/libs/3rdparty/syntax-highlighting/data/syntax/perl6.xml diff --git a/src/libs/3rdparty/syntax-highlighting/data/generators/cmake.xml.tpl b/src/libs/3rdparty/syntax-highlighting/data/generators/cmake.xml.tpl index 33cc7511aa8..f7b7570cf43 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/generators/cmake.xml.tpl +++ b/src/libs/3rdparty/syntax-highlighting/data/generators/cmake.xml.tpl @@ -9,7 +9,7 @@ Copyright 2004 Alexander Neundorf (neundorf@kde.org) Copyright 2005 Dominik Haumann (dhdev@gmx.de) Copyright 2007,2008,2013,2014 Matthew Woehlke (mw_triad@users.sourceforge.net) - Copyright 2013-2015,2017-2018 Alex Turbov (i.zaufi@gmail.com) + Copyright 2013-2015,2017-2019 Alex Turbov (i.zaufi@gmail.com) ********************************************************************** * This library is free software; you can redistribute it and/or * @@ -31,7 +31,7 @@ + + {%- for var in environment_variables.kw %} + {{var}} + {%- endfor %} + + {%- for kind in properties.kinds %} {%- for prop in properties[kind].kw %} @@ -197,11 +203,27 @@ - + + + + + + + + + + + {%- for var in environment_variables.re %} + + {%- endfor %} + + + + @@ -300,10 +322,12 @@ + - + + diff --git a/src/libs/3rdparty/syntax-highlighting/data/generators/cmake.yaml b/src/libs/3rdparty/syntax-highlighting/data/generators/cmake.yaml index 1174c35215d..f3fa77756f0 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/generators/cmake.yaml +++ b/src/libs/3rdparty/syntax-highlighting/data/generators/cmake.yaml @@ -7,6 +7,7 @@ global-properties: - AUTORCC_SOURCE_GROUP - CMAKE_C_KNOWN_FEATURES - CMAKE_CXX_KNOWN_FEATURES + - CMAKE_ROLE # Since 3.14 - DEBUG_CONFIGURATIONS - DISABLED_FEATURES - ENABLED_FEATURES @@ -42,6 +43,7 @@ global-properties: - FeatureSummary__DESCRIPTION directory-properties: + - ADDITIONAL_CLEAN_FILES # Since 3.15 - ADDITIONAL_MAKE_CLEAN_FILES - BINARY_DIR - BUILDSYSTEM_TARGETS @@ -78,6 +80,7 @@ directory-properties: # NOTE Copy-n-pasting this list from official docs may contain a redudant item `Example`! Check it! target-properties: + - ADDITIONAL_CLEAN_FILES # Since 3.15 - ALIASED_TARGET - ANDROID_ANT_ADDITIONAL_OPTIONS - ANDROID_API @@ -101,17 +104,24 @@ target-properties: - ARCHIVE_OUTPUT_NAME_ - ARCHIVE_OUTPUT_NAME - AUTOGEN_BUILD_DIR + - AUTOGEN_ORIGIN_DEPENDS # Since 3.14 - AUTOGEN_TARGET_DEPENDS + - AUTOMOC_COMPILER_PREDEFINES # Since ??? - AUTOMOC_DEPEND_FILTERS - - AUTOMOC_MOC_OPTIONS + - AUTOMOC_EXECUTABLE # Since 3.14 + - AUTOMOC_MACRO_NAMES + - AUTOMOC_MOC_OPTIONS # Since ??? - AUTOMOC - AUTOUIC + - AUTOUIC_EXECUTABLE # Since 3.14 - AUTOUIC_OPTIONS - AUTOUIC_SEARCH_PATHS - AUTORCC + - AUTORCC_EXECUTABLE # Since 3.14 - AUTORCC_OPTIONS - BINARY_DIR - BUILD_RPATH + - BUILD_RPATH_USE_ORIGIN # Since 3.14 - BUILD_WITH_INSTALL_NAME_DIR - BUILD_WITH_INSTALL_RPATH - BUNDLE_EXTENSION @@ -246,6 +256,7 @@ target-properties: - MACOSX_RPATH - MANUALLY_ADDED_DEPENDENCIES - MAP_IMPORTED_CONFIG_ + - MSVC_RUNTIME_LIBRARY # Since 3.15 - NAME - NO_SONAME - NO_SYSTEM_FROM_IMPORTED @@ -278,6 +289,9 @@ target-properties: - STATIC_LIBRARY_FLAGS - STATIC_LIBRARY_OPTIONS # Since 3.13 - SUFFIX + - Swift_DEPENDENCIES_FILE # Since 3.15 + - Swift_MODULE_DIRECTORY # Since 3.15 + - Swift_MODULE_NAME # Since 3.15 - TYPE - VERSION - VISIBILITY_INLINES_HIDDEN @@ -298,8 +312,13 @@ target-properties: - VS_GLOBAL_ - VS_IOT_EXTENSIONS_VERSION - VS_IOT_STARTUP_TASK + - VS_JUST_MY_CODE_DEBUGGING # Since 3.15 - VS_KEYWORD - VS_MOBILE_EXTENSIONS_VERSION + - VS_NO_SOLUTION_DEPLOY # Since 3.15 + - VS_PACKAGE_REFERENCES # Since 3.15 + - VS_PROJECT_IMPORT # Since 3.15 + - VS_PACKAGE_REFERENCES - VS_SCC_AUXPATH - VS_SCC_LOCALPATH - VS_SCC_PROJECTNAME @@ -314,9 +333,12 @@ target-properties: - WINDOWS_EXPORT_ALL_SYMBOLS - XCODE_ATTRIBUTE_ - XCODE_EXPLICIT_FILE_TYPE + - XCODE_GENERATE_SCHEME # Since 3.15 - XCODE_PRODUCT_TYPE - XCODE_SCHEME_ADDRESS_SANITIZER # Since 3.13 - XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN # Since 3.13 + - XCODE_SCHEME_ARGUMENTS # Since 3.13 + - XCODE_SCHEME_DEBUG_AS_ROOT # Since 3.15 - XCODE_SCHEME_THREAD_SANITIZER # Since 3.13 - XCODE_SCHEME_THREAD_SANITIZER_STOP # Since 3.13 - XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER # Since 3.13 @@ -331,7 +353,6 @@ target-properties: - XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE # Since 3.13 - XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS # Since 3.13 - XCODE_SCHEME_EXECUTABLE # Since 3.13 - - XCODE_SCHEME_ARGUMENTS # Since 3.13 - XCODE_SCHEME_ENVIRONMENT # Since 3.13 - XCTEST @@ -383,6 +404,8 @@ source-properties: - SKIP_AUTOMOC - SKIP_AUTORCC - SKIP_AUTOUIC + - Swift_DEPENDENCIES_FILE # Since 3.15 + - Swift_DIAGNOSTICS_FILE # Since 3.15 - SYMBOLIC - VS_COPY_TO_OUT_DIR - VS_CSHARP_ @@ -423,69 +446,95 @@ install-properties: - CPACK_WIX_ACL generator-expressions: + # Boolean Generator Expressions + # * Logical Operators - 0 - 1 - - AND - - ANGLE-R - BOOL - - BUILD_INTERFACE - - COMMA - - COMPILE_FEATURES - - COMPILE_LANGUAGE - - CONFIG - - CXX_COMPILER_ID - - CXX_COMPILER_VERSION - - C_COMPILER_ID - - C_COMPILER_VERSION - - EQUAL - - GENEX_EVAL # Since 3.12 - - IF - - INSTALL_INTERFACE - - INSTALL_PREFIX - - IN_LIST # Since 3.12 - - JOIN - - LINK_ONLY - - LOWER_CASE - - MAKE_C_IDENTIFIER - - NOT + - AND - OR - - PLATFORM_ID - - SEMICOLON - - SHELL_PATH + - NOT + # * String Comparisons - STREQUAL - - TARGET_BUNDLE_CONTENT_DIR - - TARGET_BUNDLE_DIR - - TARGET_EXISTS # Since 3.12 - - TARGET_FILE - - TARGET_FILE_DIR - - TARGET_FILE_NAME - - TARGET_GENEX_EVAL # Since 3.12 - - TARGET_LINKER_FILE - - TARGET_LINKER_FILE_DIR - - TARGET_LINKER_FILE_NAME - - TARGET_NAME - - TARGET_NAME_IF_EXISTS # Since 3.12 - - TARGET_OBJECTS - - TARGET_PDB_FILE - - TARGET_PDB_FILE_DIR - - TARGET_PDB_FILE_NAME - - TARGET_POLICY - - TARGET_PROPERTY - - TARGET_SONAME_FILE - - TARGET_SONAME_FILE_DIR - - TARGET_SONAME_FILE_NAME - - UPPER_CASE - - VERSION_EQUAL - - VERSION_GREATER - - VERSION_GREATER_EQUAL + - EQUAL + - IN_LIST # Since 3.12 - VERSION_LESS + - VERSION_GREATER + - VERSION_EQUAL - VERSION_LESS_EQUAL + - VERSION_GREATER_EQUAL + # * Variable Queries + - TARGET_EXISTS # Since 3.12 + - CONFIG + - PLATFORM_ID + - C_COMPILER_ID + - CXX_COMPILER_ID + - CUDA_COMPILER_ID # Since 3.15 + - Fortran_COMPILER_ID + - C_COMPILER_VERSION + - CXX_COMPILER_VERSION + - CUDA_COMPILER_VERSION # Since 3.15 + - Fortran_COMPILER_VERSION + - TARGET_POLICY + - COMPILE_FEATURES + - COMPILE_LANG_AND_ID # Since 3.15 + - COMPILE_LANGUAGE + # String-Valued Generator Expressions + # * Escaped Characters + - ANGLE-R + - COMMA + - SEMICOLON + # * Conditional Expressions + - IF + # * String Transformations + - JOIN + - REMOVE_DUPLICATES # Since 3.15 + - FILTER # Since 3.15 + - LOWER_CASE + - UPPER_CASE + - GENEX_EVAL # Since 3.12 + - TARGET_GENEX_EVAL # Since 3.12 + # * Variable Queries (NOTE Already included above) + # * Target-Dependent Queries + - TARGET_NAME_IF_EXISTS # Since 3.12 + - TARGET_FILE + - TARGET_FILE_BASE_NAME # Since 3.15 + - TARGET_FILE_PREFIX # Since 3.15 + - TARGET_FILE_SUFFIX # Since 3.15 + - TARGET_FILE_NAME + - TARGET_FILE_DIR + - TARGET_LINKER_FILE + - TARGET_LINKER_FILE_BASE_NAME # Since 3.15 + - TARGET_LINKER_FILE_PREFIX # Since 3.15 + - TARGET_LINKER_FILE_SUFFIX # Since 3.15 + - TARGET_LINKER_FILE_NAME + - TARGET_LINKER_FILE_DIR + - TARGET_SONAME_FILE + - TARGET_SONAME_FILE + - TARGET_SONAME_FILE_NAME + - TARGET_SONAME_FILE_DIR + - TARGET_PDB_FILE + - TARGET_PDB_FILE_BASE_NAME # Since 3.15 + - TARGET_PDB_FILE_NAME + - TARGET_PDB_FILE_DIR + - TARGET_BUNDLE_DIR + - TARGET_BUNDLE_CONTENT_DIR + - TARGET_PROPERTY + - INSTALL_PREFIX + # Output-Related Expressions + - TARGET_NAME + - LINK_ONLY + - INSTALL_INTERFACE + - BUILD_INTERFACE + - MAKE_C_IDENTIFIER + - TARGET_OBJECTS + - SHELL_PATH variables: # Variables that Provide Information - CMAKE_AR - CMAKE_ARGC - - CMAKE_ARGV0 + - CMAKE_ARGV - CMAKE_BINARY_DIR - CMAKE_BUILD_TOOL - CMAKE_CACHEFILE_DIR @@ -558,6 +607,7 @@ variables: - CMAKE_SOURCE_DIR - CMAKE_STATIC_LIBRARY_PREFIX - CMAKE_STATIC_LIBRARY_SUFFIX + - CMAKE_Swift_MODULE_DIRECTORY # Since 3.15 - CMAKE_TOOLCHAIN_FILE - CMAKE_TWEAK_VERSION - CMAKE_VERBOSE_MAKEFILE @@ -611,7 +661,9 @@ variables: - CMAKE_ECLIPSE_VERSION - CMAKE_ERROR_DEPRECATED - CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION + - CMAKE_EXECUTE_PROCESS_COMMAND_ECHO # Since 3.15 - CMAKE_EXPORT_COMPILE_COMMANDS + - CMAKE_EXPORT_PACKAGE_REGISTRY # Since 3.15 - CMAKE_EXPORT_NO_PACKAGE_REGISTRY - CMAKE_FIND_APPBUNDLE - CMAKE_FIND_FRAMEWORK @@ -621,6 +673,8 @@ variables: - CMAKE_FIND_NO_INSTALL_PREFIX - CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY - CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY + - CMAKE_FIND_PACKAGE_PREFER_CONFIG # Since 3.15 + - CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS # Since 3.14 - CMAKE_FIND_PACKAGE_WARN_NO_MODULE - CMAKE_FIND_ROOT_PATH - CMAKE_FIND_ROOT_PATH_MODE_INCLUDE @@ -639,6 +693,7 @@ variables: - CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT - CMAKE_LIBRARY_PATH - CMAKE_LINK_DIRECTORIES_BEFORE # Since 3.13 + - CMAKE_MAXIMUM_RECURSION_DEPTH # Since 3.14 - CMAKE_MFC_FLAG - CMAKE_MODULE_PATH - CMAKE_NOT_USING_CONFIG_FLAGS @@ -646,6 +701,8 @@ variables: - CMAKE_POLICY_WARNING_CMP - CMAKE_PREFIX_PATH - CMAKE_PROGRAM_PATH + - CMAKE_PROJECT_INCLUDE # Since 3.15 + - CMAKE_PROJECT_INCLUDE_BEFORE # Since 3.15 - CMAKE_PROJECT__INCLUDE - CMAKE_SKIP_INSTALL_ALL_DEPENDENCY - CMAKE_STAGING_PREFIX @@ -757,6 +814,7 @@ variables: - CMAKE_ANDROID_STL_TYPE - CMAKE_ARCHIVE_OUTPUT_DIRECTORY - CMAKE_ARCHIVE_OUTPUT_DIRECTORY_ + - CMAKE_AUTOGEN_ORIGIN_DEPENDS # Since 3.14 - CMAKE_AUTOGEN_PARALLEL - CMAKE_AUTOGEN_VERBOSE # Since 3.13 - CMAKE_AUTOMOC @@ -768,6 +826,7 @@ variables: - CMAKE_AUTOUIC_OPTIONS - CMAKE_AUTOUIC_SEARCH_PATHS - CMAKE_BUILD_RPATH + - CMAKE_BUILD_RPATH_USE_ORIGIN # Since 3.14 - CMAKE_BUILD_WITH_INSTALL_NAME_DIR - CMAKE_BUILD_WITH_INSTALL_RPATH - CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY @@ -781,8 +840,13 @@ variables: - CMAKE_EXE_LINKER_FLAGS__INIT - CMAKE_EXE_LINKER_FLAGS_INIT - CMAKE_FOLDER # Since 3.12 + - CMAKE_FRAMEWORK # Since 3.15 - CMAKE_Fortran_FORMAT - CMAKE_Fortran_MODULE_DIRECTORY + - CMAKE_GLOBAL_AUTOGEN_TARGET # Since 3.14 + - CMAKE_GLOBAL_AUTOGEN_TARGET_NAME # Since 3.14 + - CMAKE_GLOBAL_AUTORCC_TARGET # Since 3.14 + - CMAKE_GLOBAL_AUTORCC_TARGET_NAME # Since 3.14 - CMAKE_GNUtoMS - CMAKE_INCLUDE_CURRENT_DIR - CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE @@ -814,6 +878,8 @@ variables: - CMAKE_MODULE_LINKER_FLAGS_ - CMAKE_MODULE_LINKER_FLAGS__INIT - CMAKE_MODULE_LINKER_FLAGS_INIT + - CMAKE_MSVCIDE_RUN_PATH # Since 3.15 + - CMAKE_MSVC_RUNTIME_LIBRARY # Since 3.15 - CMAKE_NINJA_OUTPUT_PATH_PREFIX - CMAKE_NO_BUILTIN_CHRPATH - CMAKE_NO_SYSTEM_FROM_IMPORTED @@ -843,6 +909,7 @@ variables: - CMAKE_VS_GLOBALS # Since 3.13 - CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD - CMAKE_VS_INCLUDE_PACKAGE_TO_DEFAULT_BUILD + - CMAKE_VS_JUST_MY_CODE_DEBUGGING # Since 3.15 - CMAKE_VS_SDK_EXCLUDE_DIRECTORIES # Since 3.12 - CMAKE_VS_SDK_EXECUTABLE_DIRECTORIES # Since 3.12 - CMAKE_VS_SDK_INCLUDE_DIRECTORIES # Since 3.12 @@ -986,6 +1053,7 @@ variables: - CTEST_P4_UPDATE_OPTIONS - CTEST_SCP_COMMAND - CTEST_SITE + - CTEST_SUBMIT_URL # Since 3.14 - CTEST_SOURCE_DIRECTORY - CTEST_SVN_COMMAND - CTEST_SVN_OPTIONS @@ -996,6 +1064,7 @@ variables: - CTEST_UPDATE_COMMAND - CTEST_UPDATE_OPTIONS - CTEST_UPDATE_VERSION_ONLY + - CTEST_UPDATE_VERSION_OVERRIDE # Since 3.15 - CTEST_USE_LAUNCHERS # Variables for CPack - CPACK_ABSOLUTE_DESTINATION_FILES @@ -1064,6 +1133,7 @@ variables: - CMAKE_REQUIRED_DEFINITIONS - CMAKE_REQUIRED_FLAGS - CMAKE_REQUIRED_INCLUDES + - CMAKE_REQUIRED_LINK_OPTIONS # Since 3.14 - CMAKE_REQUIRED_LIBRARIES - CMAKE_REQUIRED_QUIET # - CheckTypeSize @@ -1198,6 +1268,7 @@ variables: - CPACK_IFW_PACKAGE_BANNER - CPACK_IFW_PACKAGE_BACKGROUND - CPACK_IFW_PACKAGE_WIZARD_STYLE + - CPACK_IFW_PACKAGE_STYLE_SHEET # Since 3.15 - CPACK_IFW_PACKAGE_WIZARD_DEFAULT_WIDTH - CPACK_IFW_PACKAGE_WIZARD_DEFAULT_HEIGHT - CPACK_IFW_PACKAGE_TITLE_COLOR @@ -1546,7 +1617,59 @@ variables: # - UseSWIG - CMAKE_SWIG_FLAGS - CMAKE_SWIG_OUTDIR + - SWIG_OUTFILE_DIR - SWIG_MODULE__EXTRA_DEPS + - SWIG_SOURCE_FILE_EXTENSIONS # Since 3.14 + +# https://cmake.org/cmake/help/latest/manual/cmake-env-variables.7.html +# NOTE Added to syntax file version 14 at 3.15.0 version of CMake +environment-variables: + # Environment Variables that Control the Build + - CMAKE_BUILD_PARALLEL_LEVEL + - CMAKE_CONFIG_TYPE + - CMAKE_GENERATOR + - CMAKE_GENERATOR_INSTANCE + - CMAKE_GENERATOR_PLATFORM + - CMAKE_GENERATOR_TOOLSET + - CMAKE_MSVCIDE_RUN_PATH + - CMAKE_NO_VERBOSE + - CMAKE_OSX_ARCHITECTURES + - DESTDIR + - LDFLAGS + - MACOSX_DEPLOYMENT_TARGET + - _ROOT + - VERBOSE + # Environment Variables for Languages + - ASM + - ASMFLAGS + - CC + - CFLAGS + - CSFLAGS + - CUDACXX + - CUDAFLAGS + - CUDAHOSTCXX + - CXX + - CXXFLAGS + - FC + - FFLAGS + - RC + - RCFLAGS + - SWIFTC + # Environment Variables for CTest + - CMAKE_CONFIG_TYPE + - CTEST_INTERACTIVE_DEBUG_MODE + - CTEST_OUTPUT_ON_FAILURE + - CTEST_PARALLEL_LEVEL + - CTEST_PROGRESS_OUTPUT + - CTEST_USE_LAUNCHERS_DEFAULT + - DASHBOARD_TEST_FROM_CTEST + # Here are the `find_package` specific variables described at the + # https://cmake.org/cmake/help/latest/command/find_package.html + - _DIR + - CMAKE_PREFIX_PATH + - CMAKE_FRAMEWORK_PATH + - CMAKE_APPBUNDLE_PATH + - PATH scripting-commands: - @@ -1670,11 +1793,21 @@ scripting-commands: , ERROR_FILE , OUTPUT_QUIET , ERROR_QUIET + , COMMAND_ECHO # Since 3.15 , OUTPUT_STRIP_TRAILING_WHITESPACE , ERROR_STRIP_TRAILING_WHITESPACE , ENCODING ] - special-args: [NONE, AUTO, ANSI, OEM, UTF8] + special-args: [ + NONE + , AUTO + , ANSI + , OEM + , UTF8 + , STDERR # Since 3.15: the value for `COMMAND_ECHO` + , STDOUT # Since 3.15: the value for `COMMAND_ECHO` + ] + nested-parentheses?: true - name: file named-args: [ @@ -1746,6 +1879,7 @@ scripting-commands: , DIRECTORY_PERMISSIONS , NO_SOURCE_PERMISSIONS , USE_SOURCE_PERMISSIONS + , FOLLOW_SYMLINK_CHAIN # Since 3.15 , FILES_MATCHING , PATTERN , REGEX @@ -1760,6 +1894,9 @@ scripting-commands: # Sub-options of UPLOAD/DOWNLOAD since 3.11 , NETRC , NETRC_FILE + # New sub-options since 3.14 + , READ_SYMLINK + , SIZE ] special-args: [ UTF-8 @@ -1871,7 +2008,21 @@ scripting-commands: property-args: &get_directory_property [directory-properties] - name: get_filename_component - named-args: [DIRECTORY, NAME, EXT, NAME_WE, PATH, CACHE, BASE_DIR, ABSOLUTE, REALPATH, PROGRAM, PROGRAM_ARGS] + named-args: [ + DIRECTORY + , NAME + , EXT + , NAME_WE + , PATH + , CACHE + , BASE_DIR + , ABSOLUTE + , REALPATH + , PROGRAM + , PROGRAM_ARGS + , LAST_EXT # Since 3.14 + , NAME_WLE # Since 3.14 + ] - name: get_property named-args: [GLOBAL, DIRECTORY, TARGET, SOURCE, INSTALL, TEST, CACHE, VARIABLE, PROPERTY, SET, DEFINED, BRIEF_DOCS, FULL_DOCS] @@ -1933,6 +2084,10 @@ scripting-commands: , FOR # NOTE Another `REGEX` named arg has already added , OUTPUT_VARIABLE + # Since 3.15 + # NOTE Another `PREPEND` named arg has already added + , POP_FRONT + , POP_BACK ] # Since 3.13 special-args: [STRING, FILE_BASENAME, SENSITIVE, INSENSITIVE, ASCENDING, DESCENDING] @@ -1951,7 +2106,19 @@ scripting-commands: special-args: [DECIMAL, HEXADECIMAL] - name: message - named-args: [STATUS, WARNING, AUTHOR_WARNING, SEND_ERROR, FATAL_ERROR, DEPRECATION] + named-args: [ + STATUS + , WARNING + , AUTHOR_WARNING + , SEND_ERROR + , FATAL_ERROR + , DEPRECATION + # Since 3.15 + , NOTICE + , VERBOSE + , DEBUG + , TRACE + ] - name: option - @@ -1993,6 +2160,7 @@ scripting-commands: , SUBSTRING , STRIP , GENEX_STRIP + , REPEAT # Since 3.15 , COMPARE , LESS , GREATER @@ -2055,6 +2223,7 @@ project-commands: , WORKING_DIRECTORY , COMMENT , DEPFILE + , JOB_POOL # Since 3.15 , VERBATIM , APPEND , USES_TERMINAL @@ -2064,6 +2233,7 @@ project-commands: , PRE_LINK , POST_BUILD ] + nested-parentheses?: true - name: add_custom_target named-args: [ @@ -2075,12 +2245,14 @@ project-commands: , WORKING_DIRECTORY , COMMENT , DEPFILE + , JOB_POOL # Since 3.15 , VERBATIM , APPEND , USES_TERMINAL , COMMAND_EXPAND_LISTS , SOURCES ] + nested-parentheses?: true - name: add_definitions - @@ -2099,6 +2271,7 @@ project-commands: - name: add_test named-args: [NAME, COMMAND, CONFIGURATIONS, WORKING_DIRECTORY] + nested-parentheses?: true - name: aux_source_directory - @@ -2347,6 +2520,7 @@ project-commands: , SOURCES , COMPILE_DEFINITIONS , LINK_LIBRARIES + , LINK_OPTIONS # Since 3.14 , COPY_FILE , COPY_FILE_ERROR , _STANDARD @@ -2361,6 +2535,7 @@ project-commands: , CMAKE_FLAGS , COMPILE_DEFINITIONS , LINK_LIBRARIES + , LINK_OPTIONS # Since 3.14 , COMPILE_OUTPUT_VARIABLE , RUN_OUTPUT_VARIABLE , OUTPUT_VARIABLE @@ -2414,7 +2589,19 @@ ctest-commands: named-args: [TRACK, APPEND, QUIET] - name: ctest_submit - named-args: [PARTS, FILES, HTTPHEADER, RETRY_COUNT, RETRY_DELAY, RETURN_VALUE, QUIET, CDASH_UPLOAD, CDASH_UPLOAD_TYPE] + named-args: [ + PARTS + , FILES + , BUILD_ID # Since 3.15 + , SUBMIT_URL # Since 3.14 + , HTTPHEADER + , RETRY_COUNT + , RETRY_DELAY + , RETURN_VALUE + , QUIET + , CDASH_UPLOAD + , CDASH_UPLOAD_TYPE + ] - name: ctest_test named-args: [ diff --git a/src/libs/3rdparty/syntax-highlighting/data/generators/generate-cmake-syntax.py b/src/libs/3rdparty/syntax-highlighting/data/generators/generate-cmake-syntax.py index 61f60a682d6..ff94189b811 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/generators/generate-cmake-syntax.py +++ b/src/libs/3rdparty/syntax-highlighting/data/generators/generate-cmake-syntax.py @@ -3,7 +3,7 @@ # # Generate Kate syntax file for CMake # -# Copyright (c) 2017, Alex Turbov +# Copyright (c) 2017-2019 Alex Turbov # # To install prerequisites: # @@ -33,6 +33,7 @@ _PROPERTY_KEYS = [ , 'install-properties' ] _KW_RE_LIST = ['kw', 're'] +_VAR_KIND_LIST = ['variables', 'environment-variables'] def try_transform_placeholder_string_to_regex(name): @@ -44,6 +45,9 @@ def try_transform_placeholder_string_to_regex(name): if 'CMAKE_MATCH_' in m: return '\\bCMAKE_MATCH_[0-9]+\\b' + if 'CMAKE_ARGV' in m: + return '\\bCMAKE_ARGV[0-9]+\\b' + return '\\b{}\\b'.format('&id_re;'.join(list(m))) if 1 < len(m) else name @@ -109,11 +113,20 @@ def cmd_is_nulary(cmd): def cli(input_yaml, template): data = yaml.load(input_yaml) - # Partition `variables` list into "pure" words and regexes to match - data['variables'] = { - k: sorted(set(v)) for k, v in zip(_KW_RE_LIST, [*partition_iterable(lambda x: _TEMPLATED_NAME.search(x) is None, data['variables'])]) - } - data['variables']['re'] = [*map(lambda x: try_transform_placeholder_string_to_regex(x), data['variables']['re'])] + # Partition `variables` and `environment-variables` lists into "pure" (key)words and regexes to match + for var_key in _VAR_KIND_LIST: + data[var_key] = { + k: sorted(set(v)) for k, v in zip( + _KW_RE_LIST + , [*partition_iterable(lambda x: _TEMPLATED_NAME.search(x) is None, data[var_key])] + ) + } + data[var_key]['re'] = [ + *map( + lambda x: try_transform_placeholder_string_to_regex(x) + , data[var_key]['re'] + ) + ] # Transform properties and make all-properties list data['properties'] = {} @@ -122,17 +135,27 @@ def cli(input_yaml, template): props, props_re = partition_iterable(lambda x: _TEMPLATED_NAME.search(x) is None, data[prop]) del data[prop] - data['properties'][python_prop_list_name] = {k: sorted(set(v)) for k, v in zip(_KW_RE_LIST, [props, props_re])} - data['properties'][python_prop_list_name]['re'] = [*map(lambda x: try_transform_placeholder_string_to_regex(x), props_re)] - + data['properties'][python_prop_list_name] = { + k: sorted(set(v)) for k, v in zip(_KW_RE_LIST, [props, props_re]) + } + data['properties'][python_prop_list_name]['re'] = [ + *map(lambda x: try_transform_placeholder_string_to_regex(x), props_re) + ] data['properties']['kinds'] = [*map(lambda name: name.replace('-', '_'), _PROPERTY_KEYS)] # Make all commands list - data['commands'] = [*map(lambda cmd: transform_command(cmd), data['scripting-commands'] + data['project-commands'] + data['ctest-commands'])] + data['commands'] = [ + *map( + lambda cmd: transform_command(cmd) + , data['scripting-commands'] + data['project-commands'] + data['ctest-commands']) + ] + # Fix node names to be accessible from Jinja template data['generator_expressions'] = data['generator-expressions'] - + data['environment_variables'] = data['environment-variables'] + del data['generator-expressions'] + del data['environment-variables'] env = jinja2.Environment( keep_trailing_newline=True diff --git a/src/libs/3rdparty/syntax-highlighting/data/generators/generate-php.pl b/src/libs/3rdparty/syntax-highlighting/data/generators/generate-php.pl index c8274aab582..f034bcada72 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/generators/generate-php.pl +++ b/src/libs/3rdparty/syntax-highlighting/data/generators/generate-php.pl @@ -42,7 +42,14 @@ if ($root == 1) } else { - $file =~ s/]+)name="([^"]*)"/\n"; $file =~ s/]*)context="([^"#]*)##(?!Alerts|Doxygen|Modelines)([^"]+)"/]*>)/$1\n/g; +$file =~ s/(]*[^>\/]>)/$1\n/g; +$file =~ s/(]*[^>\/])\s*\/>/$1>\n\n<\/context>/g; $file =~ s/(?=<\/contexts\s*>)/$findphp/; print $file; diff --git a/src/libs/3rdparty/syntax-highlighting/data/schema/language.xsd b/src/libs/3rdparty/syntax-highlighting/data/schema/language.xsd index 6f05aad7b51..9a03ef2b780 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/schema/language.xsd +++ b/src/libs/3rdparty/syntax-highlighting/data/schema/language.xsd @@ -279,9 +279,10 @@ --> - - - + + + + @@ -290,6 +291,11 @@ contains string used in --> + + @@ -305,6 +311,7 @@ lineEndContext: Next context if end of line is encountered lineEmptyContext: Next context if an empty line is encountered [optional] fallthrough: Use a fallthrough context [optional] + deprecated since 5.62 but preserved to maintain compatibility in older versions of KF5 fallthroughContext: Fall through to this context [optional] dynamic: Dynamic context [boolean, optional] noIndentationBasedFolding: Python uses indentation based folding. However, Python has parts where @@ -314,7 +321,6 @@ TODO: - Explain fallthrough. - - Do we need fallthrough at all? It could be true, if fallthroughContext is set, false otherwise. - Make lineEndContext optional, defaults to '#stay'. Reasonable? --> @@ -344,7 +350,15 @@ - + + + + + + + + + diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/cmake.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/cmake.xml index 6d170e4eaaa..def91cc4ddd 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/syntax/cmake.xml +++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/cmake.xml @@ -9,7 +9,7 @@ Copyright 2004 Alexander Neundorf (neundorf@kde.org) Copyright 2005 Dominik Haumann (dhdev@gmx.de) Copyright 2007,2008,2013,2014 Matthew Woehlke (mw_triad@users.sourceforge.net) - Copyright 2013-2015,2017-2018 Alex Turbov (i.zaufi@gmail.com) + Copyright 2013-2015,2017-2019 Alex Turbov (i.zaufi@gmail.com) ********************************************************************** * This library is free software; you can redistribute it and/or * @@ -31,7 +31,7 @@ COMMAND + COMMAND_ECHO ENCODING ERROR_FILE ERROR_QUIET @@ -268,6 +269,8 @@ AUTO NONE OEM + STDERR + STDOUT UTF8 @@ -287,6 +290,7 @@ FILES_MATCHING FILE_PERMISSIONS FOLLOW_SYMLINKS + FOLLOW_SYMLINK_CHAIN GENERATE GLOB GLOB_RECURSE @@ -567,6 +571,8 @@ LENGTH ORDER OUTPUT_VARIABLE + POP_BACK + POP_FRONT PREPEND REGEX REMOVE_AT @@ -602,10 +608,14 @@ AUTHOR_WARNING + DEBUG DEPRECATION FATAL_ERROR + NOTICE SEND_ERROR STATUS + TRACE + VERBOSE WARNING @@ -671,6 +681,7 @@ RANDOM RANDOM_SEED REGEX + REPEAT REPLACE REVERSE SHA1 @@ -737,6 +748,7 @@ DEPENDS DEPFILE IMPLICIT_DEPENDS + JOB_POOL MAIN_DEPENDENCY OUTPUT POST_BUILD @@ -757,6 +769,7 @@ DEPENDS DEPFILE IMPLICIT_DEPENDS + JOB_POOL SOURCES USES_TERMINAL VERBATIM @@ -1135,6 +1148,7 @@ TRACK + BUILD_ID CDASH_UPLOAD CDASH_UPLOAD_TYPE FILES @@ -1144,6 +1158,7 @@ RETRY_COUNT RETRY_DELAY RETURN_VALUE + SUBMIT_URL APPEND @@ -1214,7 +1229,6 @@ CMAKE_AR CMAKE_ARCHIVE_OUTPUT_DIRECTORY CMAKE_ARGC - CMAKE_ARGV0 CMAKE_AUTOGEN_ORIGIN_DEPENDS CMAKE_AUTOGEN_PARALLEL CMAKE_AUTOGEN_VERBOSE @@ -1288,10 +1302,12 @@ CMAKE_ERROR_DEPRECATED CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION CMAKE_EXECUTABLE_SUFFIX + CMAKE_EXECUTE_PROCESS_COMMAND_ECHO CMAKE_EXE_LINKER_FLAGS CMAKE_EXE_LINKER_FLAGS_INIT CMAKE_EXPORT_COMPILE_COMMANDS CMAKE_EXPORT_NO_PACKAGE_REGISTRY + CMAKE_EXPORT_PACKAGE_REGISTRY CMAKE_EXTRA_GENERATOR CMAKE_EXTRA_INCLUDE_FILES CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES @@ -1305,6 +1321,7 @@ CMAKE_FIND_PACKAGE_NAME CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY + CMAKE_FIND_PACKAGE_PREFER_CONFIG CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS CMAKE_FIND_PACKAGE_SORT_DIRECTION CMAKE_FIND_PACKAGE_SORT_ORDER @@ -1315,6 +1332,7 @@ CMAKE_FIND_ROOT_PATH_MODE_PACKAGE CMAKE_FIND_ROOT_PATH_MODE_PROGRAM CMAKE_FOLDER + CMAKE_FRAMEWORK CMAKE_FRAMEWORK_PATH CMAKE_Fortran_FORMAT CMAKE_Fortran_MODDIR_DEFAULT @@ -1432,6 +1450,8 @@ CMAKE_MODULE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS_INIT CMAKE_MODULE_PATH + CMAKE_MSVCIDE_RUN_PATH + CMAKE_MSVC_RUNTIME_LIBRARY CMAKE_NETRC CMAKE_NETRC_FILE CMAKE_NINJA_OUTPUT_PATH_PREFIX @@ -1454,6 +1474,8 @@ CMAKE_PROGRAM_PATH CMAKE_PROJECT_DESCRIPTION CMAKE_PROJECT_HOMEPAGE_URL + CMAKE_PROJECT_INCLUDE + CMAKE_PROJECT_INCLUDE_BEFORE CMAKE_PROJECT_NAME CMAKE_PROJECT_VERSION CMAKE_PROJECT_VERSION_MAJOR @@ -1465,6 +1487,7 @@ CMAKE_REQUIRED_FLAGS CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES + CMAKE_REQUIRED_LINK_OPTIONS CMAKE_REQUIRED_QUIET CMAKE_ROOT CMAKE_RUNTIME_OUTPUT_DIRECTORY @@ -1509,6 +1532,7 @@ CMAKE_SYSTEM_PROGRAM_PATH CMAKE_SYSTEM_VERSION CMAKE_Swift_LANGUAGE_VERSION + CMAKE_Swift_MODULE_DIRECTORY CMAKE_THREAD_LIBS_INIT CMAKE_THREAD_PREFER_PTHREAD CMAKE_TOOLCHAIN_FILE @@ -1529,6 +1553,7 @@ CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD CMAKE_VS_INCLUDE_PACKAGE_TO_DEFAULT_BUILD CMAKE_VS_INTEL_Fortran_PROJECT_VERSION + CMAKE_VS_JUST_MY_CODE_DEBUGGING CMAKE_VS_MSBUILD_COMMAND CMAKE_VS_NsightTegra_VERSION CMAKE_VS_PLATFORM_NAME @@ -1658,6 +1683,7 @@ CPACK_IFW_PACKAGE_REMOVE_TARGET_DIR CPACK_IFW_PACKAGE_RESOURCES CPACK_IFW_PACKAGE_START_MENU_DIRECTORY + CPACK_IFW_PACKAGE_STYLE_SHEET CPACK_IFW_PACKAGE_TITLE CPACK_IFW_PACKAGE_TITLE_COLOR CPACK_IFW_PACKAGE_WATERMARK @@ -1908,6 +1934,7 @@ CTEST_UPDATE_COMMAND CTEST_UPDATE_OPTIONS CTEST_UPDATE_VERSION_ONLY + CTEST_UPDATE_VERSION_OVERRIDE CTEST_USE_LAUNCHERS CYGWIN EXECUTABLE_OUTPUT_PATH @@ -1990,6 +2017,45 @@ XCODE XCODE_VERSION + + + CC + CFLAGS + CMAKE_APPBUNDLE_PATH + CMAKE_BUILD_PARALLEL_LEVEL + CMAKE_CONFIG_TYPE + CMAKE_FRAMEWORK_PATH + CMAKE_GENERATOR + CMAKE_GENERATOR_INSTANCE + CMAKE_GENERATOR_PLATFORM + CMAKE_GENERATOR_TOOLSET + CMAKE_MSVCIDE_RUN_PATH + CMAKE_NO_VERBOSE + CMAKE_OSX_ARCHITECTURES + CMAKE_PREFIX_PATH + CSFLAGS + CTEST_INTERACTIVE_DEBUG_MODE + CTEST_OUTPUT_ON_FAILURE + CTEST_PARALLEL_LEVEL + CTEST_PROGRESS_OUTPUT + CTEST_USE_LAUNCHERS_DEFAULT + CUDACXX + CUDAFLAGS + CUDAHOSTCXX + CXX + CXXFLAGS + DASHBOARD_TEST_FROM_CTEST + DESTDIR + FC + FFLAGS + LDFLAGS + MACOSX_DEPLOYMENT_TARGET + PATH + RC + RCFLAGS + SWIFTC + VERBOSE + ALLOW_DUPLICATE_CUSTOM_TARGETS AUTOGEN_SOURCE_GROUP @@ -2032,6 +2098,7 @@ XCODE_EMIT_EFFECTIVE_PLATFORM_NAME + ADDITIONAL_CLEAN_FILES ADDITIONAL_MAKE_CLEAN_FILES BINARY_DIR BUILDSYSTEM_TARGETS @@ -2064,6 +2131,7 @@ VS_STARTUP_PROJECT + ADDITIONAL_CLEAN_FILES ALIASED_TARGET ANDROID_ANT_ADDITIONAL_OPTIONS ANDROID_API @@ -2207,6 +2275,7 @@ MACOSX_FRAMEWORK_INFO_PLIST MACOSX_RPATH MANUALLY_ADDED_DEPENDENCIES + MSVC_RUNTIME_LIBRARY NAME NO_SONAME NO_SYSTEM_FROM_IMPORTED @@ -2232,6 +2301,9 @@ STATIC_LIBRARY_FLAGS STATIC_LIBRARY_OPTIONS SUFFIX + Swift_DEPENDENCIES_FILE + Swift_MODULE_DIRECTORY + Swift_MODULE_NAME TYPE VERSION VISIBILITY_INLINES_HIDDEN @@ -2249,8 +2321,12 @@ VS_GLOBAL_ROOTNAMESPACE VS_IOT_EXTENSIONS_VERSION VS_IOT_STARTUP_TASK + VS_JUST_MY_CODE_DEBUGGING VS_KEYWORD VS_MOBILE_EXTENSIONS_VERSION + VS_NO_SOLUTION_DEPLOY + VS_PACKAGE_REFERENCES + VS_PROJECT_IMPORT VS_SCC_AUXPATH VS_SCC_LOCALPATH VS_SCC_PROJECTNAME @@ -2264,10 +2340,12 @@ WIN32_EXECUTABLE WINDOWS_EXPORT_ALL_SYMBOLS XCODE_EXPLICIT_FILE_TYPE + XCODE_GENERATE_SCHEME XCODE_PRODUCT_TYPE XCODE_SCHEME_ADDRESS_SANITIZER XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN XCODE_SCHEME_ARGUMENTS + XCODE_SCHEME_DEBUG_AS_ROOT XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE @@ -2309,6 +2387,8 @@ SKIP_AUTORCC SKIP_AUTOUIC SYMBOLIC + Swift_DEPENDENCIES_FILE + Swift_DIAGNOSTICS_FILE VS_COPY_TO_OUT_DIR VS_DEPLOYMENT_CONTENT VS_DEPLOYMENT_LOCATION @@ -2375,61 +2455,76 @@ 0 1 - AND - ANGLE-R BOOL - BUILD_INTERFACE - COMMA - COMPILE_FEATURES - COMPILE_LANGUAGE - CONFIG - CXX_COMPILER_ID - CXX_COMPILER_VERSION - C_COMPILER_ID - C_COMPILER_VERSION - EQUAL - GENEX_EVAL - IF - INSTALL_INTERFACE - INSTALL_PREFIX - IN_LIST - JOIN - LINK_ONLY - LOWER_CASE - MAKE_C_IDENTIFIER - NOT + AND OR - PLATFORM_ID - SEMICOLON - SHELL_PATH + NOT STREQUAL - TARGET_BUNDLE_CONTENT_DIR - TARGET_BUNDLE_DIR - TARGET_EXISTS - TARGET_FILE - TARGET_FILE_DIR - TARGET_FILE_NAME - TARGET_GENEX_EVAL - TARGET_LINKER_FILE - TARGET_LINKER_FILE_DIR - TARGET_LINKER_FILE_NAME - TARGET_NAME - TARGET_NAME_IF_EXISTS - TARGET_OBJECTS - TARGET_PDB_FILE - TARGET_PDB_FILE_DIR - TARGET_PDB_FILE_NAME - TARGET_POLICY - TARGET_PROPERTY - TARGET_SONAME_FILE - TARGET_SONAME_FILE_DIR - TARGET_SONAME_FILE_NAME - UPPER_CASE - VERSION_EQUAL - VERSION_GREATER - VERSION_GREATER_EQUAL + EQUAL + IN_LIST VERSION_LESS + VERSION_GREATER + VERSION_EQUAL VERSION_LESS_EQUAL + VERSION_GREATER_EQUAL + TARGET_EXISTS + CONFIG + PLATFORM_ID + C_COMPILER_ID + CXX_COMPILER_ID + CUDA_COMPILER_ID + Fortran_COMPILER_ID + C_COMPILER_VERSION + CXX_COMPILER_VERSION + CUDA_COMPILER_VERSION + Fortran_COMPILER_VERSION + TARGET_POLICY + COMPILE_FEATURES + COMPILE_LANG_AND_ID + COMPILE_LANGUAGE + ANGLE-R + COMMA + SEMICOLON + IF + JOIN + REMOVE_DUPLICATES + FILTER + LOWER_CASE + UPPER_CASE + GENEX_EVAL + TARGET_GENEX_EVAL + TARGET_NAME_IF_EXISTS + TARGET_FILE + TARGET_FILE_BASE_NAME + TARGET_FILE_PREFIX + TARGET_FILE_SUFFIX + TARGET_FILE_NAME + TARGET_FILE_DIR + TARGET_LINKER_FILE + TARGET_LINKER_FILE_BASE_NAME + TARGET_LINKER_FILE_PREFIX + TARGET_LINKER_FILE_SUFFIX + TARGET_LINKER_FILE_NAME + TARGET_LINKER_FILE_DIR + TARGET_SONAME_FILE + TARGET_SONAME_FILE + TARGET_SONAME_FILE_NAME + TARGET_SONAME_FILE_DIR + TARGET_PDB_FILE + TARGET_PDB_FILE_BASE_NAME + TARGET_PDB_FILE_NAME + TARGET_PDB_FILE_DIR + TARGET_BUNDLE_DIR + TARGET_BUNDLE_CONTENT_DIR + TARGET_PROPERTY + INSTALL_PREFIX + TARGET_NAME + LINK_ONLY + INSTALL_INTERFACE + BUILD_INTERFACE + MAKE_C_IDENTIFIER + TARGET_OBJECTS + SHELL_PATH @@ -2662,11 +2757,18 @@ + + + + + + + @@ -2978,18 +3080,30 @@ + + + + + + + + + + + + @@ -3039,10 +3153,16 @@ + + + + + + @@ -3619,6 +3739,7 @@ + @@ -3727,11 +3848,28 @@ - + + + + + + + + + + + + + + + + + + @@ -3830,10 +3968,12 @@ + - + + diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/css.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/css.xml index 25a614e826f..228bb45b854 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/syntax/css.xml +++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/css.xml @@ -38,7 +38,8 @@ Changelog: --> - + + @@ -1258,8 +1259,9 @@ Changelog: selection - + not + matches @@ -1383,8 +1385,8 @@ Changelog: - - + + @@ -1393,7 +1395,8 @@ Changelog: - + + @@ -1548,7 +1551,7 @@ Changelog: - + diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/html.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/html.xml index 107e1067da8..7f0d52b353c 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/syntax/html.xml +++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/html.xml @@ -5,7 +5,7 @@ ]> - + @@ -20,8 +20,19 @@ + + + + + + + + + + + @@ -54,8 +65,6 @@ - - @@ -230,7 +239,7 @@ - + diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/json.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/json.xml index 28ad8e8a33d..e9f80a534ea 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/syntax/json.xml +++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/json.xml @@ -12,7 +12,7 @@ ** http://tools.ietf.org/html/rfc4627 *************************************************************************** --> - + null diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/markdown.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/markdown.xml index f88848729fb..7d11b34e6b6 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/syntax/markdown.xml +++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/markdown.xml @@ -6,6 +6,7 @@ Dual-Licensed under both GPL and BSD licenses. Extended 2009 Claes Holmerson. http://github.com/claes/kate-markdown/ + Extended 2019 Nibaldo González S. (changes under MIT license). --> - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + ]> - + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + - - + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + + + + + - - + + + + + + - - + + + + + + - - + + + + + + + + + + - - + + - - + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + + + + + + + + + + + + + - - + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/perl.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/perl.xml index 0d1931649c5..c2d366d1f30 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/syntax/perl.xml +++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/perl.xml @@ -39,7 +39,7 @@ Enhance tr/// and y/// support. --> - + if diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/perl6.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/perl6.xml new file mode 100644 index 00000000000..71ea0a80e81 --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/perl6.xml @@ -0,0 +1,1785 @@ + + + + + + + + + + + + + + + + + ]+|[&podfmt;](<(?:<*(?=<))|(?![<«])))+"> + + ]+|[&podfmt;](?![<«])|>(?!>)|<(?!<))+"> + + + 」\]}a-zA-Z0-9]|$))"> + + + + + + + + + «»"> + + + + ][+=]|[-&+.<>|^]|cont|elem)\))"> + ]+|&bracehyperoperator;)[«»]"> + + + + + + + ]|&extrasymboloperators;)[&symboloperators;]*|\(&innerbraceoperator;\)|\[&innerbraceoperator;\]|<[&safesymboloperators;'"]+>)"> + + + +]> + + + + + begin + end + finish + for + podtypename + + + + pod + podtypename + + + + True + False + + + + head1 + head2 + head3 + head4 + head5 + head6 + item + item1 + item2 + item3 + item4 + item5 + item6 + para + code + defn + comment + table + input + output + + + + exec + words + quotewords + scalar + array + hash + function + closure + backslash + heredoc + val + + + + macro + sub + submethod + method + multi + proto + only + category + + + + rule + token + regex + + + + podvalue + self + + + + let + my + our + state + temp + has + constant + + + + + if + else + elsif + unless + + for + loop + repeat + while + until + gather + given + + take + do + when + next + last + redo + return + contend + maybe + defer + default + exit + make + continue + break + goto + leave + async + lift + + die + fail + try + warn + + + + + no + use + require + + is + as + but + trusts + of + returns + handles + where + augment + supersede + + module + class + role + package + enum + grammar + slang + subset + + BEGIN + CHECK + INIT + START + FIRST + ENTER + LEAVE + KEEP + UNDO + NEXT + LAST + PRE + POST + END + CATCH + CONTROL + TEMP + + + + prec + irs + ofs + ors + export + deep + binary + unary + reparsed + rw + parsed + cached + readonly + defequiv + will + ref + copy + inline + tighter + looser + equiv + assoc + required + + + + property + signature + context + also + shape + + + + NaN + Inf + + + + Object + Any + Junction + Whatever + Capture + Match + Signature + Proxy + Matcher + Package + Module + Class + Grammar + Scalar + Array + Hash + KeyHash + KeySet + KeyBag + Pair + List + Seq + Range + Set + Bag + Mapping + Void + Undef + Failure + Exception + Code + Block + Routine + Sub + Macro + Method + Submethod + Regex + Str + Blob + Char + Byte + Codepoint + Grapheme + StrPos + StrLen + Version + Num + Complex + num + complex + Bit + bit + bool + True + False + Increasing + Decreasing + Ordered + Callable + AnyChar + Positional + Associative + Ordering + KeyExtractor + Comparator + OrderingPair + IO + KitchenSink + Role + Int + int + int1 + int2 + int4 + int8 + int16 + int32 + int64 + Rat + rat + rat1 + rat2 + rat4 + rat8 + rat16 + rat32 + rat64 + Buf + buf + buf1 + buf2 + buf4 + buf8 + buf16 + buf32 + buf64 + UInt + uint + uint1 + uint2 + uint4 + uint8 + uint16 + uint32 + uint64 + Abstraction + utf8 + utf16 + utf32 + + + + X + gcd + ge + gt + lcm + le + leg + let + lt + map + max + min + minmax + mod + ne + not + notandthen + o + or + orelse + print + push + say + so + substr + temp + unicmp + x + xor + xx + Xeqv + Z + and + andthen + any + but + cmp + coll + die + div + does + eq + eqv + ff + fff + + + + L Letter + LC Cased_Letter + Lu Uppercase_Letter + Ll Lowercase_Letter + Lt Titlecase_Letter + Lm Modifier_Letter + Lo Other_Letter + M Mark + Mn Nonspacing_Mark + Mc Spacing_Mark + Me Enclosing_Mark + N Number + Nd Decimal_Number digit + Nl Letter_Number + No Other_Number + P Punctuation punct + Pc Connector_Punctuation + Pd Dash_Punctuation + Ps Open_Punctuation + Pe Close_Punctuation + Pi Initial_Punctuation + Pf Final_Punctuation + Po Other_Punctuation + S Symbol + Sm Math_Symbol + Sc Currency_Symbol + Sk Modifier_Symbol + So Other_Symbol + Z Separator + Zs Space_Separator + Zl Line_Separator + Zp Paragraph_Separator + C Other + Cc Control cntrl + Cf Format + Cs Surrogate + Co Private_Use + Cn Unassigned + + + + before + after + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/libs/3rdparty/syntax-highlighting/src/cli/kate-syntax-highlighter.cpp b/src/libs/3rdparty/syntax-highlighting/src/cli/kate-syntax-highlighter.cpp index 8334dd32e9d..92df89dc46e 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/cli/kate-syntax-highlighter.cpp +++ b/src/libs/3rdparty/syntax-highlighting/src/cli/kate-syntax-highlighter.cpp @@ -32,7 +32,6 @@ #include #include #include -#include #include diff --git a/src/libs/3rdparty/syntax-highlighting/src/indexer/katehighlightingindexer.cpp b/src/libs/3rdparty/syntax-highlighting/src/indexer/katehighlightingindexer.cpp index 3534cfde904..2a2ea0081ec 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/indexer/katehighlightingindexer.cpp +++ b/src/libs/3rdparty/syntax-highlighting/src/indexer/katehighlightingindexer.cpp @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -59,6 +58,7 @@ QStringList readListing(const QString &fileName) if (xml.hasError()) { qWarning() << "XML error while reading" << fileName << " - " << qPrintable(xml.errorString()) << "@ offset" << xml.characterOffset(); + listing.clear(); } return listing; @@ -69,7 +69,7 @@ QStringList readListing(const QString &fileName) * @param extensions extensions string to check * @return valid? */ -bool checkExtensions(QString extensions) +bool checkExtensions(const QString &extensions) { // get list of extensions const QStringList extensionParts = extensions.split(QLatin1Char(';'), QString::SkipEmptyParts); @@ -163,6 +163,7 @@ bool checkSingleChars(const QString &hlFilename, QXmlStreamReader &xml) const QString c = xml.attributes().value(QLatin1String("char")).toString(); if (c.size() != 1) { qWarning() << hlFilename << "line" << xml.lineNumber() << "'char' must contain exactly one char:" << c; + return false; } } @@ -170,6 +171,7 @@ bool checkSingleChars(const QString &hlFilename, QXmlStreamReader &xml) const QString c = xml.attributes().value(QLatin1String("char1")).toString(); if (c.size() != 1) { qWarning() << hlFilename << "line" << xml.lineNumber() << "'char1' must contain exactly one char:" << c; + return false; } } @@ -285,6 +287,7 @@ public: const QString name = xml.attributes().value(QLatin1String("name")).toString(); if (m_existingNames.contains(name)) { qWarning() << m_filename << "list duplicate:" << name; + m_success = false; } m_existingNames.insert(name); } else if (xml.name() == QLatin1String("keyword")) { @@ -296,7 +299,7 @@ public: bool check() const { - bool success = true; + bool success = m_success; const auto invalidNames = m_usedNames - m_existingNames; if (!invalidNames.isEmpty()) { qWarning() << m_filename << "Reference of non-existing keyword list:" << invalidNames; @@ -306,6 +309,7 @@ public: const auto unusedNames = m_existingNames - m_usedNames; if (!unusedNames.isEmpty()) { qWarning() << m_filename << "Unused keyword lists:" << unusedNames; + success = false; } return success; @@ -315,14 +319,27 @@ private: QString m_filename; QSet m_usedNames; QSet m_existingNames; + bool m_success = true; }; /** - * Helper class to search for non-existing contexts + * Helper class to search for non-existing contexts and invalid version */ class ContextChecker { public: + void setKateVersion(const QStringRef &verStr, const QString &hlFilename, const QString &hlName) + { + const auto idx = verStr.indexOf(QLatin1Char('.')); + if (idx <= 0) { + qWarning() << hlFilename << "invalid kateversion" << verStr; + m_success = false; + } else { + auto &language = m_contextMap[hlName]; + language.version = {verStr.left(idx).toInt(), verStr.mid(idx + 1).toInt()}; + } + } + void processElement(const QString &hlFilename, const QString &hlName, QXmlStreamReader &xml) { if (xml.name() == QLatin1String("context")) { @@ -336,22 +353,28 @@ public: if (language.existingContextNames.contains(name)) { qWarning() << hlFilename << "Duplicate context:" << name; + m_success = false; } else { language.existingContextNames.insert(name); } if (xml.attributes().value(QLatin1String("fallthroughContext")).toString() == QLatin1String("#stay")) { qWarning() << hlFilename << "possible infinite loop due to fallthroughContext=\"#stay\" in context " << name; + m_success = false; } processContext(hlName, xml.attributes().value(QLatin1String("lineEndContext")).toString()); processContext(hlName, xml.attributes().value(QLatin1String("lineEmptyContext")).toString()); processContext(hlName, xml.attributes().value(QLatin1String("fallthroughContext")).toString()); + } else if (xml.name() == QLatin1String("include")) { + // tag inside + processVersion(hlFilename, hlName, xml, {5, 53}, QLatin1String("")); } else { if (xml.attributes().hasAttribute(QLatin1String("context"))) { const QString context = xml.attributes().value(QLatin1String("context")).toString(); if (context.isEmpty()) { qWarning() << hlFilename << "Missing context name in line" << xml.lineNumber(); + m_success = false; } else { processContext(hlName, context); } @@ -361,7 +384,30 @@ public: bool check() const { - bool success = true; + bool success = m_success; + + // recursive search for the required miximal version + struct GetRequiredVersion + { + QHash versionMap; + + Version operator()(const QHash &contextMap, const Language &language) + { + auto& version = versionMap[&language]; + if (version < language.version) { + version = language.version; + for (auto &languageName : language.usedLanguageName) { + auto it = contextMap.find(languageName); + if (it != contextMap.end()) { + version = std::max(operator()(contextMap, *it), version); + } + } + } + return version; + }; + }; + GetRequiredVersion getRequiredVersion; + for (auto &language : m_contextMap) { const auto invalidContextNames = language.usedContextNames - language.existingContextNames; if (!invalidContextNames.isEmpty()) { @@ -374,6 +420,12 @@ public: qWarning() << language.hlFilename << "Unused contexts:" << unusedNames; success = false; } + + auto requiredVersion = getRequiredVersion(m_contextMap, language); + if (language.version < requiredVersion) { + qWarning().nospace() << language.hlFilename << " depends on a language in version " << requiredVersion.majorRevision << "." << requiredVersion.minorRevision << ". Please, increase kateversion."; + success = false; + } } return success; @@ -405,6 +457,7 @@ private: } else if (list.size() == 2) { // specific context of other language, e.g. Comment##ISO C++ m_contextMap[list[1]].usedContextNames.insert(list[0]); + m_contextMap[language].usedLanguageName.insert(list[1]); } return; } @@ -418,6 +471,34 @@ private: } private: + struct Version + { + int majorRevision; + int minorRevision; + + Version(int majorRevision = 0, int minorRevision = 0) + : majorRevision(majorRevision) + , minorRevision(minorRevision) + {} + + bool operator<(const Version &version) const + { + return majorRevision < version.majorRevision || (majorRevision == version.majorRevision && minorRevision < version.minorRevision); + } + }; + + void processVersion(const QString &hlFilename, const QString &hlName, QXmlStreamReader &xml, Version const& requiredVersion, QLatin1String item) + { + auto &language = m_contextMap[hlName]; + + if (language.version < requiredVersion) { + qWarning().nospace() << hlFilename << " " << item << " in line " << xml.lineNumber() << " is only available since version " << requiredVersion.majorRevision << "." << requiredVersion.minorRevision << ". Please, increase kateversion."; + // update the version to cancel future warnings + language.version = requiredVersion; + m_success = false; + } + } + class Language { public: @@ -435,6 +516,12 @@ private: // holds all existing context names QSet existingContextNames; + + // holds all existing language names + QSet usedLanguageName; + + // kateversion language attribute + Version version; }; /** @@ -442,6 +529,7 @@ private: * Example key: "Doxygen" */ QHash m_contextMap; + bool m_success = true; }; /** @@ -461,6 +549,7 @@ public: if (!name.isEmpty()) { if (m_existingAttributeNames.contains(name)) { qWarning() << m_filename << "itemData duplicate:" << name; + m_success = false; } else { m_existingAttributeNames.insert(name); } @@ -469,6 +558,7 @@ public: const QString name = xml.attributes().value(QLatin1String("attribute")).toString(); if (name.isEmpty()) { qWarning() << m_filename << "specified attribute is empty:" << xml.name(); + m_success = false; } else { m_usedAttributeNames.insert(name); } @@ -477,7 +567,7 @@ public: bool check() const { - bool success = true; + bool success = m_success; const auto invalidNames = m_usedAttributeNames - m_existingAttributeNames; if (!invalidNames.isEmpty()) { qWarning() << m_filename << "Reference of non-existing itemData attributes:" << invalidNames; @@ -487,6 +577,7 @@ public: auto unusedNames = m_existingAttributeNames - m_usedAttributeNames; if (!unusedNames.isEmpty()) { qWarning() << m_filename << "Unused itemData:" << unusedNames; + success = false; } return success; @@ -496,6 +587,7 @@ private: QString m_filename; QSet m_usedAttributeNames; QSet m_existingAttributeNames; + bool m_success = true; }; } @@ -594,8 +686,11 @@ int main(int argc, char *argv[]) AttributeChecker attributeChecker(hlFilename); KeywordChecker keywordChecker(hlFilename); + const QString hlName = hl[QStringLiteral("name")].toString(); + contextChecker.setKateVersion(xml.attributes().value(QStringLiteral("kateversion")), hlFilename, hlName); + // scan for broken regex or keywords with spaces while (!xml.atEnd()) { xml.readNext(); diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/CMakeLists.txt b/src/libs/3rdparty/syntax-highlighting/src/lib/CMakeLists.txt index 95bf4c349e5..9e95772f6e3 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/CMakeLists.txt +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/CMakeLists.txt @@ -69,6 +69,8 @@ if(BUILD_QCH) LINK_QCHS Qt5Core_QCH Qt5Gui_QCH + INCLUDE_DIRS + ${CMAKE_CURRENT_BINARY_DIR} BLANK_MACROS KSYNTAXHIGHLIGHTING_EXPORT KSYNTAXHIGHLIGHTING_DEPRECATED diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/context.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/context.cpp index 9887b959d0c..9d5597e7d28 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/context.cpp +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/context.cpp @@ -61,10 +61,8 @@ void Context::load(QXmlStreamReader& reader) m_attribute = reader.attributes().value(QStringLiteral("attribute")).toString(); m_lineEndContext.parse(reader.attributes().value(QStringLiteral("lineEndContext"))); m_lineEmptyContext.parse(reader.attributes().value(QStringLiteral("lineEmptyContext"))); - m_fallthrough = Xml::attrToBool(reader.attributes().value(QStringLiteral("fallthrough"))); m_fallthroughContext.parse(reader.attributes().value(QStringLiteral("fallthroughContext"))); - if (m_fallthroughContext.isStay()) - m_fallthrough = false; + m_fallthrough = !m_fallthroughContext.isStay(); m_noIndentationBasedFolding = Xml::attrToBool(reader.attributes().value(QStringLiteral("noIndentationBasedFolding"))); reader.readNext(); diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/definition.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/definition.cpp index ae95a6b235f..6a204dc3ac0 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/definition.cpp +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/definition.cpp @@ -39,7 +39,6 @@ #include "xml_p.h" #include -#include #include #include #include @@ -234,6 +233,19 @@ QStringList Definition::keywordList(const QString& name) const return list ? list->keywords() : QStringList(); } +bool Definition::setKeywordList(const QString& name, const QStringList& content) +{ + d->load(DefinitionData::OnlyKeywords(true)); + KeywordList* list = d->keywordList(name); + if (list) + { + list->setKeywordList(content); + return true; + } + else + return false; +} + QVector Definition::formats() const { d->load(); diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/definition.h b/src/libs/3rdparty/syntax-highlighting/src/lib/definition.h index 6f0dba9a454..3ba5be9a7a2 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/definition.h +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/definition.h @@ -26,9 +26,8 @@ #include "ksyntaxhighlighting_export.h" -#include #include - +#include #include QT_BEGIN_NAMESPACE @@ -329,10 +328,28 @@ public: /** * Returns the list of keywords for the keyword list @p name. * @since 5.49 - * @see keywordLists() + * @see keywordLists(), setKeywordList() */ QStringList keywordList(const QString& name) const; + /** + * Set the contents of the keyword list @p name to @p content. + * Only existing keywordLists() can be changed. For non-existent keyword lists, + * false is returned. + * + * Whenever you change a keyword list, make sure to trigger a rehighlight of + * your documents. In case you are using QSyntaxHighlighter via SyntaxHighlighter, + * this can be done by calling SyntaxHighlighter::rehighlight(). + * + * @note In general, changing keyword lists via setKeywordList() is discouraged, + * since if a keyword list name in the syntax highlighting definition + * file changes, the call setKeywordList() may suddenly fail. + * + * @see keywordList(), keywordLists() + * @since 5.62 + */ + bool setKeywordList(const QString& name, const QStringList& content); + /** * Returns a list of all Format items used by this definition. * The order of the Format items equals the order of the itemDatas in the xml file. diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/definition_p.h b/src/libs/3rdparty/syntax-highlighting/src/lib/definition_p.h index 9bbf59691c1..c73ca86eb95 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/definition_p.h +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/definition_p.h @@ -101,7 +101,7 @@ public: QVector> characterEncodings; QString fileName; - QString name = QStringLiteral(QT_TRANSLATE_NOOP("Syntax highlighting", "None")); + QString name = QStringLiteral(QT_TRANSLATE_NOOP("Language", "None")); QString section; QString style; QString indenter; diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/definitiondownloader.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/definitiondownloader.cpp index 4c3e5f5f1e4..89a5952a3e4 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/definitiondownloader.cpp +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/definitiondownloader.cpp @@ -27,7 +27,6 @@ #include "ksyntaxhighlighting_logging.h" #include "ksyntaxhighlighting_version.h" -#include #include #include #include diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/format.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/format.cpp index d1808cafefc..3407fee9f3e 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/format.cpp +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/format.cpp @@ -30,7 +30,6 @@ #include "xml_p.h" #include -#include #include #include @@ -207,6 +206,46 @@ bool Format::spellCheck() const return d->spellCheck; } +bool Format::hasBoldOverride() const +{ + return d->style.hasBold; +} + +bool Format::hasItalicOverride() const +{ + return d->style.hasItalic; +} + +bool Format::hasUnderlineOverride() const +{ + return d->style.hasUnderline; +} + +bool Format::hasStrikeThroughOverride() const +{ + return d->style.hasStrikeThrough; +} + +bool Format::hasTextColorOverride() const +{ + return d->style.textColor; +} + +bool Format::hasBackgroundColorOverride() const +{ + return d->style.backgroundColor; +} + +bool Format::hasSelectedTextColorOverride() const +{ + return d->style.selectedTextColor; +} + +bool Format::hasSelectedBackgroundColorOverride() const +{ + return d->style.selectedBackgroundColor; +} + void FormatPrivate::load(QXmlStreamReader& reader) { diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/format.h b/src/libs/3rdparty/syntax-highlighting/src/lib/format.h index 24c58e73f65..7c1b9602bab 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/format.h +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/format.h @@ -28,7 +28,6 @@ #include "theme.h" #include -#include QT_BEGIN_NAMESPACE class QColor; @@ -139,6 +138,70 @@ public: */ bool spellCheck() const; + /** Returns @c true if the syntax definition file sets a value for the bold text + * attribute and, therefore, overrides the theme and the default formatting + * style. If the return is @p true, this value is obtained by isBold(). + * @see isBold() + * @since 5.62 + */ + bool hasBoldOverride() const; + + /** Returns @c true if the syntax definition file sets a value for the italic text + * attribute and, therefore, overrides the theme and the default formatting style. + * If the return is @p true, this value is obtained by isItalic(). + * @see isItalic() + * @since 5.62 + */ + bool hasItalicOverride() const; + + /** Returns @c true if the syntax definition file sets a value for the underlined + * text attribute and, therefore, overrides the theme and the default formatting + * style. If the return is @p true, this value is obtained by isUnderline(). + * @see isUnderline() + * @since 5.62 + */ + bool hasUnderlineOverride() const; + + /** Returns @c true if the syntax definition file specifies a value for the + * struck through text attribute. If the return is @p true, this value + * is obtained by isStrikeThrough(). + * @see isStrikeThrough() + * @since 5.62 + */ + bool hasStrikeThroughOverride() const; + + /** Returns @c true if the syntax definition file sets a value for the foreground + * text color attribute and, therefore, overrides the theme and the default formatting + * style. If the return is @p true, this value is obtained by textColor(). + * @see textColor(), hasTextColor() + * @since 5.62 + */ + bool hasTextColorOverride() const; + + /** Returns @c true if the syntax definition file sets a value for the background + * color attribute and, therefore, overrides the theme and the default formatting + * style. If the return is @p true, this value is obtained by backgroundColor(). + * @see backgroundColor(), hasBackgroundColor() + * @since 5.62 + */ + bool hasBackgroundColorOverride() const; + + /** Returns @c true if the syntax definition file specifies a value for the + * selected text color attribute. If the return is @p true, this value is + * obtained by selectedTextColor(). + * @see selectedTextColor() + * @since 5.62 + */ + bool hasSelectedTextColorOverride() const; + + /** Returns @c true if the syntax definition file specifies a value for the + * selected background color attribute. If the return is @p true, this + * value is obtained by selectedBackgroundColor(). + * @see selectedBackgroundColor() + * @since 5.62 + */ + bool hasSelectedBackgroundColorOverride() const; + private: friend class FormatPrivate; QExplicitlySharedDataPointer d; diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/htmlhighlighter.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/htmlhighlighter.cpp index 4ebd465b779..224fb72c34d 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/htmlhighlighter.cpp +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/htmlhighlighter.cpp @@ -29,7 +29,6 @@ #include "theme.h" #include "ksyntaxhighlighting_logging.h" -#include #include #include #include diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/keywordlist.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/keywordlist.cpp index f042baac27d..144ced2c00c 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/keywordlist.cpp +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/keywordlist.cpp @@ -26,7 +26,6 @@ #include "definition_p.h" #include "ksyntaxhighlighting_logging.h" -#include #include #include diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/keywordlist_p.h b/src/libs/3rdparty/syntax-highlighting/src/lib/keywordlist_p.h index 25d0022dbef..f99a027823e 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/keywordlist_p.h +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/keywordlist_p.h @@ -24,9 +24,8 @@ #ifndef KSYNTAXHIGHLIGHTING_KEYWORDLIST_P_H #define KSYNTAXHIGHLIGHTING_KEYWORDLIST_P_H -#include #include -#include +#include #include @@ -60,6 +59,14 @@ public: return m_keywords; } + void setKeywordList(const QStringList& keywords) + { + m_keywords = keywords; + m_keywordsSortedCaseSensitive.clear(); + m_keywordsSortedCaseInsensitive.clear(); + initLookupForCaseSensitivity(m_caseSensitive); + } + /** Checks if @p str is a keyword in this list. */ bool contains(const QStringRef &str) const { diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/repository.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/repository.cpp index aaba9616dcf..c4e4889fa29 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/repository.cpp +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/repository.cpp @@ -30,7 +30,6 @@ #include "ksyntaxhighlighting_logging.h" #include "wildcardmatcher_p.h" -#include #include #include #include diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/rule.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/rule.cpp index d9cf5eb2116..79b110d70a3 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/rule.cpp +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/rule.cpp @@ -101,9 +101,6 @@ Definition Rule::definition() const void Rule::setDefinition(const Definition &def) { m_def = def; - - // cache for DefinitionData::wordDelimiters, is accessed VERY often - m_wordDelimiter = &DefinitionData::get(m_def.definition())->wordDelimiters; } bool Rule::load(QXmlStreamReader &reader) @@ -140,6 +137,9 @@ bool Rule::load(QXmlStreamReader &reader) void Rule::resolveContext() { m_context.resolve(m_def.definition()); + + // cache for DefinitionData::wordDelimiters, is accessed VERY often + m_wordDelimiter = &DefinitionData::get(m_def.definition())->wordDelimiters; } void Rule::resolveAttributeFormat(Context *lookupContext) @@ -612,8 +612,10 @@ MatchResult RegExpr::doMatch(const QString& text, int offset, const QStringList /** * no match + * the pattern of a dynamic regex depends on the previous contexts + * so that skipOffset cannot be computed */ - return MatchResult(offset, result.capturedStart()); + return MatchResult(offset, m_dynamic ? 0 : result.capturedStart()); } @@ -650,13 +652,17 @@ MatchResult WordDetect::doMatch(const QString& text, int offset, const QStringLi if (text.size() - offset < m_word.size()) return offset; - if (offset > 0 && !isWordDelimiter(text.at(offset - 1))) + /** + * detect delimiter characters on the inner and outer boundaries of the string + * NOTE: m_word isn't empty + */ + if (offset > 0 && !isWordDelimiter(text.at(offset - 1)) && !isWordDelimiter(text.at(offset))) return offset; if (text.midRef(offset, m_word.size()).compare(m_word, m_caseSensitivity) != 0) return offset; - if (text.size() == offset + m_word.size() || isWordDelimiter(text.at(offset + m_word.size()))) + if (text.size() == offset + m_word.size() || isWordDelimiter(text.at(offset + m_word.size())) || isWordDelimiter(text.at(offset + m_word.size() - 1))) return offset + m_word.size(); return offset; diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/rule_p.h b/src/libs/3rdparty/syntax-highlighting/src/lib/rule_p.h index 538fdeda8a9..4ddee3cbfd9 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/rule_p.h +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/rule_p.h @@ -34,7 +34,6 @@ #include #include -#include #include diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/state.h b/src/libs/3rdparty/syntax-highlighting/src/lib/state.h index fce4bc71e8c..865589f28e6 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/state.h +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/state.h @@ -27,7 +27,6 @@ #include "ksyntaxhighlighting_export.h" #include -#include namespace KSyntaxHighlighting { diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/syntaxhighlighter.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/syntaxhighlighter.cpp index 4987dc95f08..89663d8af31 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/syntaxhighlighter.cpp +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/syntaxhighlighter.cpp @@ -29,7 +29,6 @@ #include "state.h" #include "theme.h" -#include Q_DECLARE_METATYPE(QTextBlock) diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/textstyledata_p.h b/src/libs/3rdparty/syntax-highlighting/src/lib/textstyledata_p.h index 40c5ef679ed..50980e0aa02 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/textstyledata_p.h +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/textstyledata_p.h @@ -24,7 +24,6 @@ #ifndef KSYNTAXHIGHLIGHTING_TEXTSTYLEDATA_P_H #define KSYNTAXHIGHLIGHTING_TEXTSTYLEDATA_P_H -#include namespace KSyntaxHighlighting { diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/themedata.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/themedata.cpp index eac9a92264a..9e9f7b913c0 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/themedata.cpp +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/themedata.cpp @@ -32,7 +32,6 @@ #include #include -#include using namespace KSyntaxHighlighting;