Merge remote-tracking branch 'origin/10.0'

Change-Id: I8a53e2e8216fab7e45c3a1b8a3d2dc6656dfa7e2
This commit is contained in:
Eike Ziller
2023-02-22 11:28:08 +01:00
244 changed files with 4879 additions and 5162 deletions

View File

@@ -39,7 +39,7 @@ add_qtc_library(KSyntaxHighlighting
src/lib/textstyledata_p.h
src/lib/theme.cpp src/lib/theme.h
src/lib/themedata.cpp src/lib/themedata_p.h
src/lib/wildcardmatcher.cpp src/lib/wildcardmatcher_p.h
src/lib/wildcardmatcher.cpp
src/lib/worddelimiters.cpp src/lib/worddelimiters_p.h
src/lib/xml_p.h
)

View File

@@ -3,10 +3,10 @@
#ifndef SyntaxHighlighting_VERSION_H
#define SyntaxHighlighting_VERSION_H
#define SyntaxHighlighting_VERSION_STRING "5.95.0"
#define SyntaxHighlighting_VERSION_STRING "5.103.0"
#define SyntaxHighlighting_VERSION_MAJOR 5
#define SyntaxHighlighting_VERSION_MINOR 95
#define SyntaxHighlighting_VERSION_MINOR 103
#define SyntaxHighlighting_VERSION_PATCH 0
#define SyntaxHighlighting_VERSION ((5<<16)|(95<<8)|(0))
#define SyntaxHighlighting_VERSION ((5<<16)|(103<<8)|(0))
#endif

View File

@@ -88,7 +88,7 @@
#define KSYNTAXHIGHLIGHTING_BUILD_DEPRECATED_SINCE(major, minor) 1
#ifdef KSYNTAXHIGHLIGHTING_NO_DEPRECATED
# define KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT 0x55f00
# define KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT 0x56700
#endif
#ifdef KSYNTAXHIGHLIGHTING_NO_DEPRECATED_WARNINGS
# define KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE 0
@@ -98,7 +98,7 @@
# ifdef KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT
# define KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT
# else
# define KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE 0x55f00
# define KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE 0x56700
# endif
#endif
@@ -178,7 +178,7 @@
#define KSYNTAXHIGHLIGHTING_BUILD_DEPRECATED_SINCE(major, minor) 1
#ifdef KSYNTAXHIGHLIGHTING_NO_DEPRECATED
# define KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT 0x55f00
# define KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT 0x56700
#endif
#ifdef KSYNTAXHIGHLIGHTING_NO_DEPRECATED_WARNINGS
# define KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE 0
@@ -188,7 +188,7 @@
# ifdef KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT
# define KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT
# else
# define KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE 0x55f00
# define KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE 0x56700
# endif
#endif

View File

@@ -44,24 +44,25 @@ add_library(SyntaxHighlightingData OBJECT)
# theme data resource
target_sources(SyntaxHighlightingData PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/themes/theme-data.qrc)
# do we want syntax files bundled in the library?
if (QRC_SYNTAX)
# generate the resource file
set(qrc_file ${CMAKE_CURRENT_BINARY_DIR}/syntax-data.qrc)
set(qrc_body "")
foreach(def ${defs})
get_filename_component(def_name ${def} NAME)
string(APPEND qrc_body "<file alias=\"${def_name}\">${def}</file>\n")
endforeach()
set(SYNTAX_DATA_QRC_FILES_STRING ${qrc_body})
configure_file(syntax-data.qrc.in ${qrc_file} @ONLY)
# generate the resource file
set(qrc_file ${CMAKE_CURRENT_BINARY_DIR}/syntax-data.qrc)
set(qrc_body "")
foreach(def ${defs})
get_filename_component(def_name ${def} NAME)
string(APPEND qrc_body "<file alias=\"${def_name}\">${def}</file>\n")
endforeach()
set(SYNTAX_DATA_QRC_FILES_STRING ${qrc_body})
configure_file(syntax-data.qrc.in ${qrc_file} @ONLY)
# generate the index file
add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/index.katesyntax"
# generate the index file
add_custom_target(katesyntax DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/index.katesyntax")
add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/index.katesyntax"
COMMAND katehighlightingindexer "${CMAKE_CURRENT_BINARY_DIR}/index.katesyntax" "${CMAKE_CURRENT_SOURCE_DIR}/schema/language.xsd" "${CMAKE_CURRENT_BINARY_DIR}/syntax-data.qrc"
DEPENDS katehighlightingindexer ${defs} ${CMAKE_CURRENT_SOURCE_DIR}/schema/language.xsd ${CMAKE_CURRENT_BINARY_DIR}/syntax-data.qrc
)
)
# do we want syntax files bundled in the library?
if (QRC_SYNTAX)
# generate the qrc file manually, to make dependencies on generated files work...
add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/qrc_syntax-data.cpp"
COMMAND Qt${QT_MAJOR_VERSION}::rcc --name syntax_data -o "${CMAKE_CURRENT_BINARY_DIR}/qrc_syntax-data.cpp" "${CMAKE_CURRENT_BINARY_DIR}/syntax-data.qrc"
@@ -71,8 +72,9 @@ if (QRC_SYNTAX)
target_sources(SyntaxHighlightingData PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/qrc_syntax-data.cpp)
else()
add_dependencies(SyntaxHighlightingData katesyntax)
# install the syntax files as normal files into the prefix
install (FILES ${defs} DESTINATION ${KDE_INSTALL_DATADIR}/org.kde.syntax-highlighting/syntax)
install (FILES "${CMAKE_CURRENT_BINARY_DIR}/index.katesyntax" ${defs} DESTINATION ${KDE_INSTALL_DATADIR}/org.kde.syntax-highlighting/syntax-bundled)
endif()
# set PIC to allow use in static and shared libs

View File

@@ -113,12 +113,31 @@
<!--[- endfor ]-->
</list>
<!-- Source/cmStringAlgorithms.cxx: bool cmIsOff(cm::string_view val) -->
<list name="true_special_arg">
<item>TRUE</item>
<item>ON</item>
<item>YES</item>
<item>Y</item>
<item>0</item>
</list>
<!-- Source/cmStringAlgorithms.cxx: bool cmIsOff(cm::string_view val) -->
<list name="false_special_arg">
<item>FALSE</item>
<item>OFF</item>
<item>NO</item>
<item>IGNORE</item>
<item>N</item>
<item>0</item>
</list>
<contexts>
<context attribute="Normal Text" lineEndContext="#stay" name="Normal Text">
<DetectSpaces/>
<!--[ for command in commands -]-->
<WordDetect String="<!--{command.name}-->" insensitive="true" attribute="Command" context="<!--{command.name}-->_ctx"<!--[ if command.start_region ]--> beginRegion="<!--{command.start_region}-->"<!--[ endif -]--> <!--[- if command.end_region ]--> endRegion="<!--{command.end_region}-->"<!--[ endif ]--> />
<WordDetect String="<!--{command.name}-->" insensitive="true" attribute="<!--{command.attribute}-->" context="<!--{command.name}-->_ctx"<!--[ if command.start_region ]--> beginRegion="<!--{command.start_region}-->"<!--[ endif -]--> <!--[- if command.end_region ]--> endRegion="<!--{command.end_region}-->"<!--[ endif ]--> />
<!--[ endfor -]-->
<!--[ for command in standard_module_commands -]-->
<WordDetect String="<!--{command.name}-->" insensitive="true" attribute="CMake Provided Function/Macro" context="<!--{command.name}-->_ctx" />
@@ -126,7 +145,7 @@
<DetectChar attribute="Comment" context="Match Comments and Docs" char="#" lookAhead="true" />
<DetectIdentifier attribute="User Function/Macro" context="User Function" />
<RegExpr attribute="@Variable Substitution" context="@VarSubst" String="@&var_ref_re;@" lookAhead="true" />
<RegExpr attribute="Error" context="#stay" String=".*" />
<IncludeRules context="LineError" />
</context>
<!--[- macro render_command_parsers(commands) ]-->
<!--[ for command in commands -]-->
@@ -136,16 +155,16 @@
</context>
<!--[- if command.first_arg_is_target ]-->
<context attribute="Normal Text" lineEndContext="#stay" name="<!--{command.name}-->_ctx_op_tgt_first">
<DetectSpaces />
<RegExpr attribute="Aliased Targets" context="<!--{command.name}-->_ctx_op" String="&tgt_name_re;::&tgt_name_re;(?:\:\:&tgt_name_re;)*" />
<RegExpr attribute="Targets" context="<!--{command.name}-->_ctx_op" String="&tgt_name_re;" />
<DetectChar attribute="Normal Text" context="#pop" char=")" lookAhead="true" />
<IncludeRules context="User Function Args" />
<DetectSpaces />
<RegExpr attribute="Error" context="#stay" String=".*" />
<IncludeRules context="User Function Opened" />
<IncludeRules context="LineError" />
</context>
<!--[- endif ]-->
<!--[- if command.first_args_are_targets ]-->
<context attribute="Normal Text" lineEndContext="#stay" name="<!--{command.name}-->_ctx_op_tgts_first">
<DetectSpaces />
<!--[- if command.named_args and command.named_args.kw ]-->
<!-- NOTE Handle the only case in CMake nowadays:
1. `set_target_properties` have a named keyword (`PROPERTIES`) after targets list
@@ -153,15 +172,14 @@
<keyword context="<!--{command.name}-->_ctx_op" String="<!--{command.name}-->_nargs" lookAhead="true" />
<!--[- endif ]-->
<IncludeRules context="Detect Aliased Targets" />
<RegExpr attribute="Targets" context="#stay" String="&tgt_name_re;" />
<DetectChar attribute="Normal Text" context="#pop" char=")" lookAhead="true" />
<IncludeRules context="User Function Args" />
<DetectSpaces />
<RegExpr attribute="Error" context="#stay" String=".*" />
<IncludeRules context="Detect Targets" />
<IncludeRules context="User Function Opened" />
<IncludeRules context="LineError" />
</context>
<!--[- endif ]-->
<!--[- if not command.first_args_are_targets or (command.named_args and command.named_args.kw) ]-->
<context attribute="Normal Text" lineEndContext="#stay" name="<!--{command.name}-->_ctx_op">
<DetectSpaces />
<!--[- if command.nested_parentheses ]-->
<DetectChar attribute="Normal Text" context="<!--{command.name}-->_ctx_op_nested" char="(" />
<!--[- endif ]-->
@@ -204,18 +222,20 @@
<!--[- endif ]-->
<!--[- if command.has_target_names_after_kw ]-->
<context attribute="Normal Text" lineEndContext="#stay" name="<!--{command.name}-->_tgts">
<DetectSpaces />
<DetectChar attribute="Normal Text" context="#pop" char=")" lookAhead="true" />
<keyword attribute="Named Args" context="#pop" String="<!--{command.name}-->_nargs" />
<RegExpr attribute="Aliased Targets" context="#stay" String="&tgt_name_re;::&tgt_name_re;(?:\:\:&tgt_name_re;)*" />
<RegExpr attribute="Targets" context="#stay" String="&tgt_name_re;" />
<IncludeRules context="Detect Aliased Targets" />
<IncludeRules context="Detect Targets" />
<IncludeRules context="User Function Args" />
<DetectSpaces />
<RegExpr attribute="Error" context="#stay" String=".*" />
<IncludeRules context="LineError" />
</context>
<!--[- endif ]-->
<!--[- if command.nested_parentheses ]-->
<context attribute="Normal Text" lineEndContext="#stay" name="<!--{command.name}-->_ctx_op_nested">
<DetectSpaces />
<DetectChar attribute="Normal Text" context="#pop" char=")" />
<DetectChar attribute="Normal Text" context="<!--{command.name}-->_ctx_op_nested" char="(" />
<!--[- if command.named_args and command.named_args.kw ]-->
<keyword attribute="Named Args" context="#stay" String="<!--{command.name}-->_nargs" />
<!--[- endif ]-->
@@ -277,39 +297,45 @@
</context>
<context attribute="Environment Variable Substitution" lineEndContext="#pop" name="EnvVarSubst">
<DetectChar attribute="Environment Variable Substitution" context="#pop" char="}" />
<keyword attribute="Standard Environment Variable" context="#stay" String="environment-variables" insensitive="false" />
<!--[- if environment_variables.re ]-->
<RegExpr attribute="Standard Environment Variable" context="#stay" String="<!--{environment_variables.re}-->" />
<!--[- endif ]-->
<DetectIdentifier />
<IncludeRules context="Detect Variable Substitutions" />
<DetectChar attribute="Environment Variable Substitution" context="#pop" char="}" />
</context>
<context attribute="Variable Substitution" lineEndContext="#pop" name="VarSubst">
<DetectChar attribute="Variable Substitution" context="#pop" char="}" />
<IncludeRules context="Detect Builtin Variables" />
<DetectIdentifier />
<DetectChar attribute="Variable Substitution" context="#pop" char="}" />
<IncludeRules context="Detect Variable Substitutions" />
</context>
<context attribute="@Variable Substitution" lineEndContext="#pop" name="@VarSubst">
<IncludeRules context="Detect Builtin Variables" />
<DetectChar attribute="@Variable Substitution" context="VarSubst@" char="@" />
</context>
<context attribute="@Variable Substitution" lineEndContext="#pop#pop" name="VarSubst@">
<DetectChar attribute="@Variable Substitution" context="#pop#pop" char="@" />
<IncludeRules context="Detect Builtin Variables" />
<DetectIdentifier />
<DetectChar attribute="@Variable Substitution" context="#pop#pop" char="@" />
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="Target Name">
<RegExpr attribute="Aliased Targets" context="#pop" String="&tgt_name_re;::&tgt_name_re;(?:\:\:&tgt_name_re;)*" />
<RegExpr attribute="Targets" context="#pop" String="&tgt_name_re;" />
<DetectChar attribute="Normal Text" context="#pop" char=")" lookAhead="true" />
<IncludeRules context="User Function Args" />
<DetectSpaces />
<RegExpr attribute="Aliased Targets" context="#pop" String="&tgt_name_re;::&tgt_name_re;(?:\:\:&tgt_name_re;)*" />
<IncludeRules context="Detect Targets" />
<IncludeRules context="User Function Opened" />
<IncludeRules context="LineError" />
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="Detect Targets">
<RegExpr attribute="Targets" context="#stay" String="&tgt_name_re;" />
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="LineError">
<RegExpr attribute="Error" context="#stay" String=".*" />
</context>
@@ -328,23 +354,13 @@
<IncludeRules context="Detect Special Values" />
<IncludeRules context="Detect Aliased Targets" />
<IncludeRules context="Detect Generator Expressions" />
<DetectIdentifier />
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="Detect Special Values">
<RegExpr attribute="Version Arg" context="#stay" String="\b[0-9]+(.[0-9]+)+\b" />
<!-- Source/cmStringAlgorithms.cxx: bool cmIsOff(cm::string_view val) -->
<WordDetect attribute="True Special Arg" context="#stay" String="TRUE" insensitive="true" />
<WordDetect attribute="True Special Arg" context="#stay" String="ON" insensitive="true" />
<WordDetect attribute="True Special Arg" context="#stay" String="YES" insensitive="true" />
<WordDetect attribute="True Special Arg" context="#stay" String="Y" insensitive="true" />
<WordDetect attribute="True Special Arg" context="#stay" String="1" />
<!-- Source/cmStringAlgorithms.cxx: bool cmIsOff(cm::string_view val) -->
<WordDetect attribute="False Special Arg" context="#stay" String="FALSE" insensitive="true" />
<WordDetect attribute="False Special Arg" context="#stay" String="OFF" insensitive="true" />
<WordDetect attribute="False Special Arg" context="#stay" String="NO" insensitive="true" />
<WordDetect attribute="False Special Arg" context="#stay" String="N" insensitive="true" />
<WordDetect attribute="False Special Arg" context="#stay" String="IGNORE" insensitive="true" />
<WordDetect attribute="False Special Arg" context="#stay" String="0" />
<RegExpr attribute="Version Arg" context="#stay" String="\b[0-9]++(.[0-9]++)+\b" />
<keyword attribute="True Special Arg" context="#stay" String="true_special_arg" insensitive="true" />
<keyword attribute="False Special Arg" context="#stay" String="false_special_arg" insensitive="true" />
<RegExpr attribute="False Special Arg" context="#stay" String="\b(?:&var_ref_re;-)?NOTFOUND\b" />
<RegExpr attribute="Special Args" context="#stay" String="\bCMP[0-9][0-9][0-9][0-9]\b" />
</context>
@@ -354,8 +370,10 @@
</context>
<context attribute="Comment" lineEndContext="#pop" name="Match Comments">
<DetectSpaces />
<RegExpr attribute="Comment" context="#pop!Bracketed Comment" String="#\[(=*)\[" beginRegion="BracketedComment" />
<DetectChar attribute="Comment" context="#pop!Comment" char="#" />
<DetectIdentifier />
</context>
<context attribute="Comment" lineEndContext="#pop" name="Match Comments and Docs">
@@ -364,9 +382,10 @@
</context>
<context attribute="Comment" lineEndContext="#pop" name="Comment">
<LineContinue attribute="Comment" context="#pop" />
<DetectSpaces />
<LineContinue attribute="Comment" context="#pop" />
<IncludeRules context="##Comments" />
<DetectIdentifier />
</context>
<context attribute="Comment" lineEndContext="#stay" name="RST Documentation" dynamic="true">
@@ -382,6 +401,8 @@
</context>
<context attribute="Strings" lineEndContext="#stay" name="String">
<DetectSpaces />
<DetectIdentifier />
<RegExpr attribute="Strings" context="#pop" String="&quot;(?=[ );]|$)" />
<Detect2Chars attribute="Escapes" context="#stay" char="\" char1="&quot;" />
<Detect2Chars attribute="Escapes" context="#stay" char="\" char1="$" />
@@ -408,6 +429,7 @@
<keyword attribute="Generator Expression Keyword" context="#stay" String="generator-expressions" insensitive="false" />
<IncludeRules context="Detect Aliased Targets" />
<IncludeRules context="Detect Variable Substitutions" />
<DetectIdentifier />
</context>
</contexts>
@@ -416,6 +438,7 @@
<itemData name="Normal Text" defStyleNum="dsNormal" spellChecking="false" />
<itemData name="Comment" defStyleNum="dsComment" spellChecking="true" />
<itemData name="Command" defStyleNum="dsKeyword" spellChecking="false" />
<itemData name="Control Flow" defStyleNum="dsControlFlow" spellChecking="false" />
<itemData name="CMake Provided Function/Macro" defStyleNum="dsFunction" bold="true" spellChecking="false" />
<itemData name="User Function/Macro" defStyleNum="dsFunction" spellChecking="false" />
<itemData name="Property" defStyleNum="dsOthers" spellChecking="false" />

View File

@@ -1,4 +1,4 @@
version: 38
version: 44
global-properties:
- ALLOW_DUPLICATE_CUSTOM_TARGETS
@@ -74,6 +74,7 @@ directory-properties:
- RULE_LAUNCH_LINK
- SOURCE_DIR
- SUBDIRECTORIES
- SYSTEM # Since 3.25
- TESTS # Since 3.12
- TEST_INCLUDE_FILE
- TEST_INCLUDE_FILES # Since 3.10
@@ -135,7 +136,7 @@ target-properties:
- C_EXTENSIONS
- C_STANDARD
- C_STANDARD_REQUIRED
- COMMON_LANGUAGE_RUNTIME # Sine 3.12
- COMMON_LANGUAGE_RUNTIME # Since 3.12
- COMPATIBLE_INTERFACE_BOOL
- COMPATIBLE_INTERFACE_NUMBER_MAX
- COMPATIBLE_INTERFACE_NUMBER_MIN
@@ -148,6 +149,7 @@ target-properties:
- COMPILE_PDB_NAME_<CONFIG>
- COMPILE_PDB_OUTPUT_DIRECTORY
- COMPILE_PDB_OUTPUT_DIRECTORY_<CONFIG>
- COMPILE_WARNING_AS_ERROR # Since 3.24
- <CONFIG>_OUTPUT_NAME
- <CONFIG>_POSTFIX
- CROSSCOMPILING_EMULATOR
@@ -178,6 +180,7 @@ target-properties:
- EXCLUDE_FROM_DEFAULT_BUILD
- EXPORT_COMPILE_COMMANDS # Since 3.20
- EXPORT_NAME
- EXPORT_NO_SYSTEM # Since 3.25
- EXPORT_PROPERTIES # Since 3.12
- FOLDER
- Fortran_FORMAT
@@ -236,10 +239,13 @@ target-properties:
- INTERFACE_COMPILE_FEATURES
- INTERFACE_COMPILE_OPTIONS
- INTERFACE_HEADER_SETS # Since 3.23
- INTERFACE_HEADER_SETS_TO_VERIFY # Since 3.24
- INTERFACE_INCLUDE_DIRECTORIES
- INTERFACE_LINK_DEPENDS # Since 3.13
- INTERFACE_LINK_DIRECTORIES # Since 3.13
- INTERFACE_LINK_LIBRARIES
- INTERFACE_LINK_LIBRARIES_DIRECT # Since 3.24
- INTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE # Since 3.24
- INTERFACE_LINK_OPTIONS # Since 3.13
- INTERFACE_PRECOMPILE_HEADERS # Since 3.16
- INTERFACE_POSITION_INDEPENDENT_CODE
@@ -259,7 +265,7 @@ target-properties:
- <LANG>_CPPCHECK # Since 3.10
- <LANG>_CPPLINT
- <LANG>_INCLUDE_WHAT_YOU_USE
- <LANG>_LINKER_LAUNCHER # Sine 3.21
- <LANG>_LINKER_LAUNCHER # Since 3.21
- <LANG>_VISIBILITY_PRESET
- LIBRARY_OUTPUT_DIRECTORY_<CONFIG>
- LIBRARY_OUTPUT_DIRECTORY
@@ -291,6 +297,7 @@ target-properties:
- MACOSX_RPATH
- MANUALLY_ADDED_DEPENDENCIES
- MAP_IMPORTED_CONFIG_<CONFIG>
- MSVC_DEBUG_INFORMATION_FORMAT # Since 3.25
- MSVC_RUNTIME_LIBRARY # Since 3.15
- NAME
- NO_SONAME
@@ -340,6 +347,7 @@ target-properties:
- Swift_DEPENDENCIES_FILE # Since 3.15
- Swift_MODULE_DIRECTORY # Since 3.15
- Swift_MODULE_NAME # Since 3.15
- SYSTEM # Since 3.25
- TYPE
- UNITY_BUILD # Since 3.16
- UNITY_BUILD_BATCH_SIZE # Since 3.16
@@ -347,6 +355,7 @@ target-properties:
- UNITY_BUILD_CODE_BEFORE_INCLUDE # Since 3.16
- UNITY_BUILD_MODE # Since 3.18
- UNITY_BUILD_UNIQUE_ID # Since 3.20
- VERIFY_INTERFACE_HEADER_SETS # Since 3.24
- VERSION
- VISIBILITY_INLINES_HIDDEN
- VS_CONFIGURATION_TYPE
@@ -359,6 +368,7 @@ target-properties:
- VS_DOTNET_REFERENCEPROP_<refname>_TAG_<tagname> # Since 3.10
- VS_DOTNET_REFERENCES
- VS_DOTNET_REFERENCES_COPY_LOCAL
- VS_DOTNET_STARTUP_OBJECT # Since 3.24
- VS_DOTNET_TARGET_FRAMEWORK_VERSION
- VS_DOTNET_DOCUMENTATION_FILE # Since 3.17
- VS_DPI_AWARE # Since 3.16
@@ -371,6 +381,7 @@ target-properties:
- VS_JUST_MY_CODE_DEBUGGING # Since 3.15
- VS_KEYWORD
- VS_MOBILE_EXTENSIONS_VERSION
- VS_NO_COMPILE_BATCHING
- VS_NO_SOLUTION_DEPLOY # Since 3.15
- VS_PACKAGE_REFERENCES # Since 3.15
- VS_PLATFORM_TOOLSET # Since 3.18
@@ -387,6 +398,7 @@ target-properties:
- VS_WINRT_COMPONENT
- VS_WINRT_EXTENSIONS
- VS_WINRT_REFERENCES
- WATCOM_RUNTIME_LIBRARY # Since 3.24
- WIN32_EXECUTABLE
- WINDOWS_EXPORT_ALL_SYMBOLS
- XCODE_ATTRIBUTE_<an-attribute>
@@ -403,13 +415,17 @@ target-properties:
- XCODE_SCHEME_ARGUMENTS # Since 3.13
- XCODE_SCHEME_DEBUG_AS_ROOT # Since 3.15
- XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING # Since 3.16
- XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE # Since 3.23
- XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER # Since 3.13
- XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE # Since 3.13
- XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS # Since 3.13
- XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE # Since 3.13
- XCODE_SCHEME_ENABLE_GPU_API_VALIDATION # Since 3.25
- XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE # Since 3.23
- XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION # Since 3.25
- XCODE_SCHEME_EXECUTABLE # Since 3.13
- XCODE_SCHEME_ENVIRONMENT # Since 3.13
- XCODE_SCHEME_GUARD_MALLOC # Since 3.13
- XCODE_SCHEME_LAUNCH_CONFIGURATION # Since 3.25
- XCODE_SCHEME_LAUNCH_MODE # Since 3.25
- XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP # Since 3.13
- XCODE_SCHEME_MALLOC_GUARD_EDGES # Since 3.13
- XCODE_SCHEME_MALLOC_SCRIBBLE # Since 3.13
@@ -420,6 +436,7 @@ target-properties:
- XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP # Since 3.13
- XCODE_SCHEME_WORKING_DIRECTORY # Since 3.1?
- XCODE_SCHEME_ZOMBIE_OBJECTS # Since 3.13
- XCODE_XCCONFIG # Since 3.24
- XCTEST
test-properties:
@@ -535,6 +552,13 @@ generator-expressions:
- VERSION_EQUAL
- VERSION_LESS_EQUAL
- VERSION_GREATER_EQUAL
# * Path Comparisons
- PATH_EQUAL # Since 3.24
# * Path Queries
# * Path Decomposition
# * Path Transformations
# TODO Need a bit deeper genex parsing to get sub-commands of `PATH`
- PATH # Since 3.24
# * Variable Queries
- TARGET_EXISTS # Since 3.12
- CONFIG
@@ -555,6 +579,8 @@ generator-expressions:
- LINK_LANGUAGE # Since 3.18
- DEVICE_LINK # Since 3.18
- HOST_LINK # Since 3.18
- LINK_LIBRARY # Since 3.24
- LINK_GROUP # Since 3.24
# String-Valued Generator Expressions
# * Escaped Characters
- ANGLE-R
@@ -593,6 +619,7 @@ generator-expressions:
- TARGET_PDB_FILE_BASE_NAME # Since 3.15
- TARGET_PDB_FILE_NAME
- TARGET_PDB_FILE_DIR
- TARGET_BUNDLE_DIR_NAME # Since 3.24
- TARGET_BUNDLE_DIR
- TARGET_BUNDLE_CONTENT_DIR
- TARGET_PROPERTY
@@ -645,6 +672,7 @@ variables:
- CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES
- CMAKE_FIND_DEBUG_MODE # Since 3.17
- CMAKE_FIND_PACKAGE_NAME
- CMAKE_FIND_PACKAGE_REDIRECTS_DIR # Since 3.24
- CMAKE_FIND_PACKAGE_SORT_DIRECTION
- CMAKE_FIND_PACKAGE_SORT_ORDER
- CMAKE_GENERATOR
@@ -746,6 +774,7 @@ variables:
- CMAKE_CODEBLOCKS_COMPILER_ID # Since 3.11
- CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES # Since 3.10
- CMAKE_CODELITE_USE_TARGETS
- CMAKE_COLOR_DIAGNOSTICS # Since 3.24
- CMAKE_COLOR_MAKEFILE
- CMAKE_CONFIGURATION_TYPES
- CMAKE_DEBUG_TARGET_PROPERTIES
@@ -772,6 +801,7 @@ variables:
- 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_TARGETS_GLOBAL # Since 3.24
- CMAKE_FIND_PACKAGE_WARN_NO_MODULE
- CMAKE_FIND_ROOT_PATH
- CMAKE_FIND_ROOT_PATH_MODE_INCLUDE
@@ -781,6 +811,7 @@ variables:
- 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_INSTALL_PREFIX # Since 3.24
- 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
@@ -809,6 +840,8 @@ variables:
- CMAKE_PROJECT_INCLUDE # Since 3.15
- CMAKE_PROJECT_INCLUDE_BEFORE # Since 3.15
- CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE
- CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE_BEFORE # Since 3.17
- CMAKE_PROJECT_TOP_LEVEL_INCLUDES # Since 3.24
- CMAKE_REQUIRE_FIND_PACKAGE_<PackageName> # Since 3.22
- CMAKE_SKIP_INSTALL_ALL_DEPENDENCY
- CMAKE_STAGING_PREFIX
@@ -836,12 +869,16 @@ variables:
- CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN # Since 3.13
- CMAKE_XCODE_SCHEME_WORKING_DIRECTORY # Since 3.17
- CMAKE_XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING # Since 3.16
- CMAKE_XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE # Since 3.23
- 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_ENABLE_GPU_API_VALIDATION # Since 3.25
- CMAKE_XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE # Since 3.23
- CMAKE_XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION # Since 3.25
- CMAKE_XCODE_SCHEME_ENVIRONMENT # Since 3.17
- CMAKE_XCODE_SCHEME_GUARD_MALLOC # Since 3.13
- CMAKE_XCODE_SCHEME_LAUNCH_CONFIGURATION # Since 3.25
- CMAKE_XCODE_SCHEME_LAUNCH_MODE # Since 3.25
- 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
@@ -851,14 +888,18 @@ variables:
- CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER # Since 3.13
- CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP # Since 3.13
- CMAKE_XCODE_SCHEME_ZOMBIE_OBJECTS # Since 3.13
- CMAKE_XCODE_XCCONFIG # Since 3.24
# Variables that Describe the System
- ANDROID
- APPLE
- BORLAND
- BSD # Since 3.25
- CMAKE_ANDROID_NDK_VERSION # Since 3.20
- CMAKE_CL_64
- CMAKE_COMPILER_2005
- CMAKE_HOST_APPLE
- CMAKE_HOST_BSD # Since 3.25
- CMAKE_HOST_LINUX # Since 3.25
- CMAKE_HOST_SOLARIS
- CMAKE_HOST_SYSTEM
- CMAKE_HOST_SYSTEM_NAME
@@ -876,7 +917,9 @@ variables:
- CYGWIN
# NOTE `ENV` not a variable in fact!
# - ENV
- GHS-MULTI
- GHSMULTI
- IOS # Since 3.14
- LINUX # Since 3.25
- MINGW
- MSVC
- MSVC10
@@ -946,6 +989,7 @@ variables:
- CMAKE_BUILD_WITH_INSTALL_RPATH
- CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY
- CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_<CONFIG>
- CMAKE_COMPILE_WARNING_AS_ERROR # Since 3.24
- CMAKE_<CONFIG>_POSTFIX
- CMAKE_CROSS_CONFIGS # Since 3.17
- CMAKE_CTEST_ARGUMENTS # Since 3.17
@@ -986,9 +1030,13 @@ variables:
- CMAKE_<LANG>_CPPCHECK # Since 3.10
- CMAKE_<LANG>_CPPLINT
- CMAKE_<LANG>_INCLUDE_WHAT_YOU_USE
- CMAKE_<LANG>_LINKER_LAUNCHER # Sine 3.21
- CMAKE_<LANG>_LINK_LIBRARY_FILE_FLAG # Sine 3.16
- CMAKE_<LANG>_LINK_LIBRARY_FLAG # Sine 3.16
- CMAKE_<LANG>_LINK_LIBRARY_USING_<FEATURE> # Since 3.24
- CMAKE_<LANG>_LINK_LIBRARY_USING_<FEATURE>_SUPPORTED # Since 3.24
- CMAKE_<LANG>_LINKER_LAUNCHER # Since 3.21
- CMAKE_<LANG>_LINK_GROUP_USING_<FEATURE> # Since 3.24
- CMAKE_<LANG>_LINK_GROUP_USING_<FEATURE>_SUPPORTED # Since 3.24
- CMAKE_<LANG>_LINK_LIBRARY_FILE_FLAG # Since 3.16
- CMAKE_<LANG>_LINK_LIBRARY_FLAG # Since 3.16
- CMAKE_<LANG>_LINK_WHAT_YOU_USE_FLAG # Since 3.22
- CMAKE_<LANG>_VISIBILITY_PRESET
- CMAKE_LIBRARY_OUTPUT_DIRECTORY
@@ -999,6 +1047,8 @@ variables:
- CMAKE_LINK_INTERFACE_LIBRARIES
- CMAKE_LINK_LIBRARY_FILE_FLAG
- CMAKE_LINK_LIBRARY_FLAG
- CMAKE_LINK_LIBRARY_USING_<FEATURE> # Since 3.24
- CMAKE_LINK_LIBRARY_USING_<FEATURE>_SUPPORTED # Since 3.24
- CMAKE_LINK_WHAT_YOU_USE
- CMAKE_LINK_WHAT_YOU_USE_CHECK # Since 3.22
- CMAKE_MACOSX_BUNDLE
@@ -1008,8 +1058,9 @@ variables:
- CMAKE_MODULE_LINKER_FLAGS_<CONFIG>
- CMAKE_MODULE_LINKER_FLAGS_<CONFIG>_INIT
- CMAKE_MODULE_LINKER_FLAGS_INIT
- CMAKE_MSVCIDE_RUN_PATH # Since 3.15
- CMAKE_MSVC_DEBUG_INFORMATION_FORMAT # Since 3.25
- CMAKE_MSVC_RUNTIME_LIBRARY # Since 3.15
- CMAKE_MSVCIDE_RUN_PATH # Since 3.15
- CMAKE_NINJA_OUTPUT_PATH_PREFIX
- CMAKE_NO_BUILTIN_CHRPATH
- CMAKE_NO_SYSTEM_FROM_IMPORTED
@@ -1034,12 +1085,15 @@ variables:
- CMAKE_STATIC_LINKER_FLAGS_<CONFIG>
- CMAKE_STATIC_LINKER_FLAGS_<CONFIG>_INIT
- CMAKE_STATIC_LINKER_FLAGS_INIT
- CMAKE_TASKING_TOOLSET # Since 3.25
- CMAKE_TRY_COMPILE_CONFIGURATION
- CMAKE_TRY_COMPILE_NO_PLATFORM_VARIABLES # Since 3.24
- CMAKE_TRY_COMPILE_PLATFORM_VARIABLES
- CMAKE_TRY_COMPILE_TARGET_TYPE
- CMAKE_UNITY_BUILD # Since 3.16
- CMAKE_UNITY_BUILD_BATCH_SIZE # Since 3.16
- CMAKE_USE_RELATIVE_PATHS
- CMAKE_VERIFY_INTERFACE_HEADER_SETS # Since 3.24
- CMAKE_VISIBILITY_INLINES_HIDDEN
- CMAKE_VS_GLOBALS # Since 3.13
- CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD
@@ -1052,6 +1106,8 @@ variables:
- CMAKE_VS_SDK_LIBRARY_WINRT_DIRECTORIES # Since 3.12
- CMAKE_VS_SDK_REFERENCE_DIRECTORIES # Since 3.12
- CMAKE_VS_SDK_SOURCE_DIRECTORIES # Since 3.12
- CMAKE_VS_WINRT_BY_DEFAULT # Since 3.13
- CMAKE_WATCOM_RUNTIME_LIBRARY # Since 3.24
- CMAKE_WIN32_EXECUTABLE
- CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS
- CMAKE_XCODE_ATTRIBUTE_<an-attribute>
@@ -1106,6 +1162,8 @@ variables:
- CMAKE_<LANG>_EXTENSIONS
- CMAKE_<LANG>_EXTENSIONS_DEFAULT # Since 3.22
- CMAKE_<LANG>_FLAGS
- CMAKE_<LANG>_FLAGS_<CONFIG>
- CMAKE_<LANG>_FLAGS_<CONFIG>_INIT
- CMAKE_<LANG>_FLAGS_DEBUG
- CMAKE_<LANG>_FLAGS_DEBUG_INIT
- CMAKE_<LANG>_FLAGS_INIT
@@ -1173,6 +1231,7 @@ variables:
- CTEST_CUSTOM_PRE_MEMCHECK
- CTEST_CUSTOM_PRE_TEST
- CTEST_CUSTOM_TEST_IGNORE
- CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION # Since 3.24
- CTEST_CUSTOM_WARNING_EXCEPTION
- CTEST_CUSTOM_WARNING_MATCH
- CTEST_CVS_CHECKOUT
@@ -1377,6 +1436,7 @@ variables:
# - CPackArchive
- CPACK_ARCHIVE_FILE_NAME
- CPACK_ARCHIVE_<COMPONENT>_FILE_NAME
- CPACK_ARCHIVE_FILE_EXTENSION # Since 3.25
- CPACK_ARCHIVE_COMPONENT_INSTALL
- CPACK_ARCHIVE_THREADS # Since 3.18
# - CPackBundle
@@ -1465,6 +1525,7 @@ variables:
- CPACK_DMG_DS_STORE_SETUP_SCRIPT
- CPACK_DMG_BACKGROUND_IMAGE
- CPACK_DMG_DISABLE_APPLICATIONS_SYMLINK
- CPACK_DMG_SLA_USE_RESOURCE_FILE_LICENSE # Since 3.23
- CPACK_DMG_SLA_DIR
- CPACK_DMG_SLA_LANGUAGES
- CPACK_DMG_<component>_FILE_NAME # Since 3.17
@@ -1561,6 +1622,8 @@ variables:
- CPACK_NSIS_BRANDING_TEXT_TRIM_POSITION # Since 3.20
- CPACK_NSIS_EXECUTABLE # Since 3.21
- CPACK_NSIS_IGNORE_LICENSE_PAGE # Since 3.22
- CPACK_NSIS_EXECUTABLE_PRE_ARGUMENTS # Since 3.25
- CPACK_NSIS_EXECUTABLE_POST_ARGUMENTS # Since 3.25
# - CPackNuGet (since 3.12)
- CPACK_NUGET_COMPONENT_INSTALL
- CPACK_NUGET_PACKAGE_NAME
@@ -1603,6 +1666,7 @@ variables:
- CPACK_NUGET_<compName>_PACKAGE_DEPENDENCIES_<dependency>_VERSION
- CPACK_NUGET_PACKAGE_DEBUG
# - CPackPackageMaker is deprecated and gonna be removed in next versions of CPack
# NOTE CPackPackageMaker has been removed in 3.24
# - CPackProductBuild
- CPACK_COMMAND_PRODUCTBUILD
- CPACK_PRODUCTBUILD_IDENTIFIER # Since 3.23
@@ -1765,6 +1829,9 @@ variables:
- CPACK_PACKAGE_INSTALL_REGISTRY_KEY
- CPACK_CREATE_DESKTOP_LINKS
- CPACK_BINARY_<GENNAME>
- CPACK_READELF_EXECUTABLE # Since 3.25
- CPACK_OBJCOPY_EXECUTABLE # Since 3.25
- CPACK_OBJDUMP_EXECUTABLE # Since 3.25
- CPACK_PRE_BUILD_SCRIPTS # Since 3.19
- CPACK_POST_BUILD_SCRIPTS # Since 3.19
- CPACK_PACKAGE_FILES # Since 3.19
@@ -1794,6 +1861,7 @@ variables:
- CPACK_WIX_ROOT
- CPACK_WIX_CUSTOM_XMLNS # Since 3.19
- CPACK_WIX_SKIP_WIX_UI_EXTENSION # Since 3.23
- CPACK_WIX_ARCHITECTURE # Since 3.24
# - CTest
# - Dart
- BUILD_TESTING
@@ -1820,6 +1888,7 @@ variables:
- FETCHCONTENT_QUIET
- FETCHCONTENT_FULLY_DISCONNECTED
- FETCHCONTENT_UPDATES_DISCONNECTED
- FETCHCONTENT_TRY_FIND_PACKAGE_MODE # Since 3.24
- FETCHCONTENT_SOURCE_DIR_<ucName>
- FETCHCONTENT_UPDATES_DISCONNECTED_<ucName>
# - FindXXX module "standard" variables
@@ -2233,6 +2302,12 @@ variables:
- PKG_CONFIG_VERSION_STRING
- PKG_CONFIG_USE_CMAKE_PREFIX_PATH
- <prefix>_MODULE_NAME # Since 3.16
- <XXX>_LINK_LIBRARIES
- <XXX>_STATIC_LINK_LIBRARIES # Since 3.24
- <XXX>_LDFLAGS
- <XXX>_LDFLAGS_OTHER
- <XXX>_CFLAGS
- <XXX>_CFLAGS_OTHER
# - FindPNG
- PNG_DEFINITIONS
- PNG_LIBRARY
@@ -2404,6 +2479,7 @@ variables:
- XercesC_LIBRARY
# - FindXMLRPC
# - FindZLIB
- ZLIB_USE_STATIC_LIBS # Since 3.24
# - FortranCInterface
# The following vars gonna match by regex
# - FortranCInterface_GLOBAL_FOUND
@@ -2507,6 +2583,7 @@ deprecated-or-internal-variables:
# Various undocumented variables (yet)
- CMAKE_SUPPRESS_DEVELOPER_WARNINGS # CMake <= 3.10
- CMAKE_SUPPRESS_DEVELOPER_ERRORS # CMake <= 3.10
- CMAKE_FILES_DIRECTORY
# The following variables used by CPack and some CMake modules,
# but not documented (yet):
# used by some modules like Deb and NSIS
@@ -2525,10 +2602,16 @@ deprecated-or-internal-variables:
# 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 Change Behavior
- CMAKE_PREFIX_PATH
- SSL_CERT_DIR # Since 3.25
- SSL_CERT_FILE # Since 3.25
# Environment Variables that Control the Build
- ADSP_ROOT # Since 3.24
- CMAKE_APPLE_SILICON_PROCESSOR # Since 3.19.2
- CMAKE_BUILD_PARALLEL_LEVEL
- CMAKE_BUILD_TYPE # Since 3.22
- CMAKE_COLOR_DIAGNOSTICS # Since 3.24
- CMAKE_CONFIGURATION_TYPES # Since 3.22
- CMAKE_CONFIG_TYPE
- CMAKE_EXPORT_COMPILE_COMMANDS # Since 3.17
@@ -2538,6 +2621,7 @@ environment-variables:
- CMAKE_GENERATOR_TOOLSET
- CMAKE_INSTALL_MODE # Since 3.22
- CMAKE_<LANG>_COMPILER_LAUNCHER # Since 3.17
- CMAKE_<LANG>_LINKER_LAUNCHER # Since 3.21
- CMAKE_MSVCIDE_RUN_PATH
- CMAKE_NO_VERBOSE
- CMAKE_OSX_ARCHITECTURES
@@ -2561,6 +2645,12 @@ environment-variables:
- CXXFLAGS
- FC
- FFLAGS
- HIPCXX # Since 3.21
- HIPFLAGS # Since 3.21
- ISPC # Since 3.19
- ISPCFLAGS # Since 3.19
- OBJC # Since 3.16.7
- OBJCXX # Since 3.16.7
- RC
- RCFLAGS
- SWIFTC
@@ -2572,23 +2662,46 @@ environment-variables:
- CTEST_PROGRESS_OUTPUT
- CTEST_USE_LAUNCHERS_DEFAULT
- DASHBOARD_TEST_FROM_CTEST
- CCMAKE_COLORS
# Here are the `find_package` specific variables described at the
# https://cmake.org/cmake/help/latest/command/find_package.html
- <PackageName>_DIR
- CMAKE_PREFIX_PATH
- CMAKE_FRAMEWORK_PATH
- CMAKE_APPBUNDLE_PATH
- PATH
# Environment Variables recognized by some standard modules
- QTIFWDIR
- CUDA_PATH # FindCUDAToolkit
scripting-commands:
-
name: block # Since 3.25
named-args: [
SCOPE_FOR
, PROPAGATE
]
special-args: [
POLICIES
, VARIABLES
]
start-region: block
-
name: break
nulary?: true
-
name: cmake_host_system_information
named-args: [RESULT, QUERY]
named-args: [
RESULT
, QUERY
# Since 3.24
, WINDOWS_REGISTRY
, VALUE_NAMES
, SUBKEYS
, VALUE
, VIEW
, SEPARATOR
, ERROR_VARIABLE
]
special-args: [
NUMBER_OF_LOGICAL_CORES
, NUMBER_OF_PHYSICAL_CORES
@@ -2618,9 +2731,17 @@ scripting-commands:
, OS_RELEASE
, OS_VERSION
, OS_PLATFORM
# Since 3.22
# Since 3.22
, DISTRIB_INFO
, DISTRIB_<name>
# Since 3.24
, '64'
, '32'
, '64_32'
, '32_64'
, HOST
, TARGET
, BOTH
]
-
name: cmake_language
@@ -2636,7 +2757,14 @@ scripting-commands:
, GET_CALL_IDS
, GET_CALL
, CANCEL_CALL
# Since 3.24
, SET_DEPENDENCY_PROVIDER
, SUPPORTED_METHODS
# Since 3.25
, GET_MESSAGE_LOG_LEVEL
]
# Since 3.24
special-args: [FIND_PACKAGE, FETCHCONTENT_MAKEAVAILABLE_SERIAL]
-
name: cmake_minimum_required
named-args: [VERSION, FATAL_ERROR]
@@ -2670,6 +2798,9 @@ scripting-commands:
, IS_RELATIVE
, IS_PREFIX
, NORMALIZE
, COMPARE # Since 3.??
, EQUAL # Since 3.??
, NOT_EQUAL # Since 3.??
# Modification
, SET
, APPEND
@@ -2744,12 +2875,17 @@ scripting-commands:
, VERSION_GREATER_EQUAL
, IN_LIST
, DEFINED
, PATH_EQUAL # Since 3.24
]
has-target-name-after-kw: TARGET
nested-parentheses?: true
-
name: else
nulary?: true
-
name: endblock
nulary?: true
end-region: block
-
name: endforeach
nulary?: true
@@ -2860,6 +2996,8 @@ scripting-commands:
, HTTPHEADER
, EXPECTED_HASH
, EXPECTED_MD5
, RANGE_START # Since 3.24
, RANGE_END # Since 3.24
, TLS_VERIFY
, TLS_CAINFO
, TIMESTAMP
@@ -2999,7 +3137,12 @@ scripting-commands:
, CMAKE_FIND_ROOT_PATH_BOTH
, ONLY_CMAKE_FIND_ROOT_PATH
, NO_CMAKE_FIND_ROOT_PATH
, NO_CMAKE_INSTALL_PREFIX # Since 3.24
, REGISTRY_VIEW # Since 3.24
, VALIDATOR # Since 3.25
]
# Since 3.24
special-args: &reg_view_special ['64', '32', '64_32', '32_64', HOST, TARGET, BOTH]
-
name: find_library
named-args: &find_library [
@@ -3020,7 +3163,11 @@ scripting-commands:
, CMAKE_FIND_ROOT_PATH_BOTH
, ONLY_CMAKE_FIND_ROOT_PATH
, NO_CMAKE_FIND_ROOT_PATH
, NO_CMAKE_INSTALL_PREFIX # Since 3.24
, REGISTRY_VIEW # Since 3.24
, VALIDATOR # Since 3.25
]
special-args: *reg_view_special # Since 3.24
-
name: find_package
named-args: [
@@ -3049,13 +3196,20 @@ scripting-commands:
, CMAKE_FIND_ROOT_PATH_BOTH
, ONLY_CMAKE_FIND_ROOT_PATH
, NO_CMAKE_FIND_ROOT_PATH
, NO_CMAKE_INSTALL_PREFIX # Since 3.24
, BYPASS_PROVIDER # Since 3.24
, REGISTRY_VIEW # Since 3.24
, GLOBAL # Since 3.24
]
special-args: *reg_view_special # Since 3.24
-
name: find_path
named-args: *find_file
special-args: *reg_view_special # Since 3.24
-
name: find_program
named-args: *find_library
special-args: *reg_view_special # Since 3.24
-
name: foreach
named-args: [
@@ -3231,7 +3385,7 @@ scripting-commands:
name: option
-
name: return
nulary?: true
named-args: [PROPAGATE] # Since 3.25
-
name: separate_arguments
named-args: [
@@ -3415,7 +3569,10 @@ project-commands:
name: add_link_options
-
name: add_subdirectory
named-args: [EXCLUDE_FROM_ALL]
named-args: [
EXCLUDE_FROM_ALL
, SYSTEM # Since 3.25
]
-
name: add_test
named-args: [NAME, COMMAND, COMMAND_EXPAND_LISTS, CONFIGURATIONS, WORKING_DIRECTORY]
@@ -3656,6 +3813,7 @@ project-commands:
, cxx_std_17
, cxx_std_20 # Since 3.12
, cxx_std_23 # Since 3.20
, cxx_std_26 # Since 3.25
, cxx_aggregate_default_initializers
, cxx_alias_templates
, cxx_alignas
@@ -3781,8 +3939,7 @@ project-commands:
-
name: try_compile
named-args: [
RESULT_VAR
, CMAKE_FLAGS
CMAKE_FLAGS
, OUTPUT_VARIABLE
, SOURCES
, COMPILE_DEFINITIONS
@@ -3793,6 +3950,15 @@ project-commands:
, <LANG>_STANDARD
, <LANG>_STANDARD_REQUIRED
, <LANG>_EXTENSIONS
# Since 3.25
, PROJECT
, SOURCE_DIR
, BINARY_DIR
, TARGET
, NO_CACHE
, SOURCE_FROM_CONTENT
, SOURCE_FROM_VAR
, SOURCE_FROM_FILE
]
-
name: try_run
@@ -3804,10 +3970,23 @@ project-commands:
, LINK_LIBRARIES
, LINK_OPTIONS # Since 3.14
, COMPILE_OUTPUT_VARIABLE
, COPY_FILE
, COPY_FILE_ERROR
, <LANG>_STANDARD
, <LANG>_STANDARD_REQUIRED
, <LANG>_EXTENSIONS
, RUN_OUTPUT_VARIABLE
, OUTPUT_VARIABLE
, WORKING_DIRECTORY # Since 3.20
, ARGS
# Since 3.25
, SOURCES
, SOURCE_FROM_CONTENT
, SOURCE_FROM_VAR
, SOURCE_FROM_FILE
, NO_CACHE
, RUN_OUTPUT_STDOUT_VARIABLE
, RUN_OUTPUT_STDERR_VARIABLE
]
ctest-commands:
@@ -4545,6 +4724,7 @@ standard-module-commands:
- URL_HASH
- URL_MD5
- DOWNLOAD_NAME
- DOWNLOAD_EXTRACT_TIMESTAMP # Since 3.24
- DOWNLOAD_NO_EXTRACT
- DOWNLOAD_NO_PROGRESS
- TIMEOUT
@@ -4721,6 +4901,7 @@ standard-module-commands:
- UPDATE_DISCONNECTED
- PATCH_COMMAND
- SOURCE_SUBDIR
- SYSTEM
-
name: FetchContent_Populate
named-args:
@@ -5047,8 +5228,10 @@ standard-module-commands:
- OUTPUT_NAME
- DOCUMENTATION
- LINK_TO
- R2017b
- R2018a
- EXCLUDE_FROM_ALL
special-args: [R2017b, R2018a]
- NO_IMPLICIT_LINK_TO_MATLAB_LIBRARIES # Since 3.24
# FindPkgConfig
-
name: pkg_check_modules
@@ -5059,6 +5242,7 @@ standard-module-commands:
- NO_CMAKE_ENVIRONMENT_PATH
- IMPORTED_TARGET
- GLOBAL
- STATIC_TARGET # Since 3.24
-
name: pkg_search_module
named-args: *pkgcm

View File

@@ -7,7 +7,7 @@
#
# To install prerequisites:
#
# $ pip install --user click jinja2 yaml
# $ pip install --user click jinja2 pyyaml
#
# To use:
#
@@ -15,11 +15,10 @@
#
import click
import jinja2
import pathlib
import re
import yaml
import pprint
from lxml import etree
_TEMPLATED_NAME = re.compile('<[^>]+>')
@@ -34,6 +33,19 @@ _PROPERTY_KEYS = [
]
_KW_RE_LIST = ['kw', 're']
_VAR_KIND_LIST = ['variables', 'deprecated-or-internal-variables', 'environment-variables']
_CONTROL_FLOW_LIST = set((
'break'
, 'continue'
, 'elseif'
, 'else'
, 'endforeach'
, 'endif'
, 'endwhile'
, 'foreach'
, 'if'
, 'return'
, 'while'
))
def try_transform_placeholder_string_to_regex(name):
@@ -107,7 +119,7 @@ def transform_command(cmd):
assert new_cmd == cmd
can_be_nulary = False
cmd['nested_parentheses'] = cmd['nested-parentheses?'] if 'nested-parentheses?' in cmd else False
cmd['nested_parentheses'] = cmd.get('nested-parentheses?', False)
if 'first-arg-is-target?' in cmd:
cmd['first_arg_is_target'] = cmd['first-arg-is-target?']
@@ -138,9 +150,89 @@ def transform_command(cmd):
if 'end-region' in cmd:
cmd['end_region'] = cmd['end-region']
cmd['attribute'] = 'Control Flow' if cmd['name'] in _CONTROL_FLOW_LIST else 'Command'
return cmd
def remove_duplicate_list_nodes(contexts, highlighting):
remap = {}
items_by_kws = {}
# extract duplicate keyword list
for items in highlighting:
if items.tag != 'list':
break
k = '<'.join(item.text for item in items)
name = items.attrib['name']
rename = items_by_kws.get(k)
if rename:
remap[name] = rename
highlighting.remove(items)
else:
items_by_kws[k] = name
# update keyword list name referenced by each rule
for context in contexts:
for rule in context:
if rule.tag == 'keyword':
name = rule.attrib['String']
rule.attrib['String'] = remap.get(name, name)
def remove_duplicate_context_nodes(contexts):
# 3 levels: ctx, ctx_op and ctx_op_nested
for _ in range(3):
remap = {}
duplicated = {}
# remove duplicate nodes
for context in contexts:
name = context.attrib['name']
context.attrib['name'] = 'dummy'
ref = duplicated.setdefault(etree.tostring(context), [])
if ref:
contexts.remove(context)
else:
context.attrib['name'] = name
ref.append(name)
remap[name] = ref[0]
# update context name referenced by each rule
for context in contexts:
for rule in context:
ref = remap.get(rule.attrib.get('context'))
if ref:
rule.attrib['context'] = ref
def remove_duplicate_nodes(xml_string):
parser = etree.XMLParser(resolve_entities=False, collect_ids=False)
root = etree.fromstring(xml_string.encode(), parser=parser)
highlighting = root[0]
contexts = highlighting.find('contexts')
remove_duplicate_list_nodes(contexts, highlighting)
remove_duplicate_context_nodes(contexts)
# reformat comments
xml = etree.tostring(root)
xml = re.sub(b'(?=[^\n ])<!--', b'\n<!--', xml)
xml = re.sub(b'-->(?=[^ \n])', b'-->\n', xml)
# extract DOCTYPE removed by etree.fromstring and reformat <language>
doctype = xml_string[:xml_string.find('<highlighting')]
# remove unformatted <language>
xml = xml[xml.find(b'<highlighting'):]
# last comment removed by etree.fromstring
last_comment = '\n<!-- kate: replace-tabs on; indent-width 2; tab-width 2; -->'
return f'{doctype}{xml.decode()}{last_comment}'
#BEGIN Jinja filters
def cmd_is_nulary(cmd):
@@ -217,6 +309,8 @@ def cli(input_yaml, template):
tpl = env.from_string(template.read())
result = tpl.render(data)
result = remove_duplicate_nodes(result)
print(result)

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<language version="6" kateversion="3.1" name="Alerts" section="Other" extensions="" mimetype="" author="Dominik Haumann (dhaumann@kde.org)" license="MIT" hidden="true">
<language version="7" kateversion="3.1" name="Alerts" section="Other" extensions="" mimetype="" author="Dominik Haumann (dhaumann@kde.org)" license="MIT" hidden="true">
<highlighting>
<list name="alerts_hi">
<item>ALERT</item>
@@ -48,7 +48,8 @@
</itemDatas>
</highlighting>
<general>
<keywords casesensitive="1"/>
<!-- NO-BREAK SPACE (nbsp) as deliminator -->
<keywords casesensitive="1" additionalDeliminator="&#160;"/>
</general>
</language>
<!-- kate: indent-width 2; -->

View File

@@ -1,45 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd"
[
<!ENTITY tab "&#009;">
<!ENTITY funcname "([^&_fragpathseps;}=#$]|[+!@](?!\())([^&_fragpathseps;}=$]*+([+!@](?!\())?+)*+">
<!ENTITY varname "[A-Za-z_][A-Za-z0-9_]*">
<!ENTITY eos "(?=$|[ &tab;])"> <!-- eol or space following -->
<!ENTITY eoexpr "(?=$|[ &tab;&lt;>|&amp;;)])">
<!ENTITY tab "&#009;">
<!ENTITY funcname "([^&_fragpathseps;}=#$]|[+!@](?!\())([^&_fragpathseps;}=$]*+([+!@](?!\())?+)*+">
<!ENTITY varname "[A-Za-z_][A-Za-z0-9_]*">
<!ENTITY eos "(?=$|[ &tab;])"> <!-- eol or space following -->
<!ENTITY eoexpr "(?=$|[ &tab;&lt;>|&amp;;)])">
<!ENTITY substseps "${'&quot;`\\">
<!ENTITY symbolseps "&lt;>|&amp;;()"> <!-- see man bash -->
<!ENTITY wordseps " &tab;&symbolseps;"> <!-- see man bash -->
<!ENTITY substseps "${'&quot;`\\">
<!ENTITY symbolseps "&lt;>|&amp;;()"> <!-- see man bash -->
<!ENTITY wordseps " &tab;&symbolseps;"> <!-- see man bash -->
<!ENTITY _fragpathseps "*?+!@&wordseps;&substseps;">
<!ENTITY _fragpathnosep "(?:[+!@](?!\()|\\.|&_brace_noexpansion;)?+">
<!ENTITY path "(?:[^&_fragpathseps;]*+&_fragpathnosep;)*+">
<!ENTITY fragpath "(?:[^&_fragpathseps;/]*+&_fragpathnosep;)*+">
<!ENTITY opt "(?:[^&_fragpathseps;=/]*+&_fragpathnosep;)*+">
<!ENTITY pathpart "(?:~|\.\.?|&fragpath;)(?:/&path;|(?=[*?]|[+!@]\(|&fragpath;(?:[/*?]|[+!@]\()))|(?:~|\.\.?)(?=[&wordseps;]|$)">
<!ENTITY bq_string "`[^`]*+`">
<!ENTITY sq_string "'[^']*+'">
<!ENTITY dq_string "&quot;(?:[^&quot;\\`]*+|&bq_string;|\\.)*+&quot;">
<!ENTITY strings "(?:&sq_string;|&dq_string;|&bq_string;)">
<!ENTITY _fragpathseps_alt "*?+!@&substseps;}">
<!ENTITY _fragpathnosep_alt "(?:[+!@](?!\()|\\.)?+">
<!ENTITY path_alt "(?:[^&_fragpathseps_alt;]*+&_fragpathnosep_alt;)*+">
<!ENTITY fragpath_alt "(?:[^&_fragpathseps_alt;/]*+&_fragpathnosep_alt;)*+">
<!ENTITY opt_alt "(?:[^&_fragpathseps_alt;=/]*+&_fragpathnosep_alt;)*+">
<!ENTITY pathpart_alt "(?:~|\.\.?|&fragpath_alt;)(?:/&path_alt;|(?=[*?]|[+!@]\(|&fragpath_alt;(?:[/*?]|[+!@]\()))|(?:~|\.\.?)(?=\}|$)">
<!ENTITY globany "\[(?:[^&wordseps;&quot;'`\\\[\]]+|\\.|&strings;|\[:\w+:\]|\[)*\]">
<!ENTITY _braceexpansion_spe " &tab;&lt;>|&amp;;{}\\`'&quot;$">
<!ENTITY _brace_noexpansion "\{[^&_braceexpansion_spe;,]*+\}">
<!ENTITY _braceexpansion_var "\$(?:\{[^\[\]&_braceexpansion_spe;]*+(?:\[[*@a-zA-Z0-9]\])\})?">
<!ENTITY _braceexpansion_string "'[^']*'|&quot;([^&quot;\`]*+|`[^`]*`)*+&quot;">
<!ENTITY _braceexpansion_elems "\\.|`[^`]*`|&_braceexpansion_string;|&_braceexpansion_var;|&_brace_noexpansion;">
<!ENTITY _braceexpansion_consume "&_braceexpansion_elems;|{(?:[^&_braceexpansion_spe;,]++|&_braceexpansion_elems;)*?}|(?R)?+">
<!ENTITY _braceexpansion "(?:[^&_braceexpansion_spe;,]++|&_braceexpansion_consume;)*?,(?:[^&_braceexpansion_spe;]++|&_braceexpansion_consume;)*?}">
<!ENTITY braceexpansion "{&_braceexpansion;">
<!ENTITY next_is_globany "(?:\^?\]\]|(?:\^?\]?)?(?:\\.|[^'&quot; &tab;&lt;>|&amp;;()\\[\]]+|&strings;|\[:\w+:\])+\])">
<!ENTITY bracket_noglobany "\[(?!&next_is_globany;)">
<!ENTITY heredocq "(?|&quot;([^&quot;]+)&quot;|'([^']+)'|\\(.[^&wordseps;&substseps;]*))">
<!ENTITY _fragpathseps "*?+!@&wordseps;&substseps;">
<!ENTITY _fragpathnosep "(?:[+!@](?!\()|\\.|&_brace_noexpansion;)?+">
<!ENTITY path "(?:[^&_fragpathseps;\[]*+&_fragpathnosep;)*+">
<!ENTITY fragpath "(?:[^&_fragpathseps;\[/]*+&_fragpathnosep;)*+">
<!ENTITY opt "(?:[^&_fragpathseps;\[=/]*+&_fragpathnosep;)*+">
<!ENTITY pathpart "(?:~|\.\.?|&fragpath;)(?:/&path;|(?=[*?]|[+!@]\(|&fragpath;(?:[/*?]|\[&next_is_globany;|[+!@]\()))|(?:~|\.\.?)(?=[&wordseps;]|$)">
<!ENTITY arithmetic_as_subshell "\(((?:[^`'&quot;()$]++|\$\{[^`'&quot;(){}$]+\}|\$(?=[^{`'&quot;()])|`[^`]*+`|\((?1)(?:[)]|(?=['&quot;])))++)(?:[)](?=$|[^)])|[&quot;'])">
<!ENTITY _fragpathseps_alt "*?+!@&substseps;}">
<!ENTITY _fragpathnosep_alt "(?:[+!@](?!\()|\\.)?+">
<!ENTITY path_alt "(?:[^&_fragpathseps_alt;]*+&_fragpathnosep_alt;)*+">
<!ENTITY fragpath_alt "(?:[^&_fragpathseps_alt;/]*+&_fragpathnosep_alt;)*+">
<!ENTITY opt_alt "(?:[^&_fragpathseps_alt;=/]*+&_fragpathnosep_alt;)*+">
<!ENTITY pathpart_alt "(?:~|\.\.?|&fragpath_alt;)(?:/&path_alt;|(?=[*?]|[+!@]\(|&fragpath_alt;(?:[/*?]|[+!@]\()))|(?:~|\.\.?)(?=\}|$)">
<!-- Path only with / -->
<!ENTITY path_with_sep_text "[^?*+!@&wordseps;'&quot;`\\/]">
<!ENTITY path_with_sep_text2 "[^?*+!@()'&quot;`\\/]">
<!ENTITY path_with_sep_expr "\\.|&strings;|&globany;|[?*+](?!\()">
<!ENTITY path_with_sep_spe "(~|\.\.?)($|[/ &tab;&lt;>|&amp;;)])">
<!ENTITY path_with_sep_sub "[?*+!@]\((&path_with_sep_text2;++|&path_with_sep_expr;)*+(\)|(?=/))">
<!ENTITY path_with_sep "/|&path_with_sep_spe;|(&path_with_sep_text;++|&path_with_sep_expr;|&path_with_sep_sub;)*+/">
<!ENTITY _braceexpansion_spe " &tab;&lt;>|&amp;;{}\\`'&quot;$">
<!ENTITY _brace_noexpansion "\{[^&_braceexpansion_spe;,]*+\}">
<!ENTITY _braceexpansion_var "\$(?:\{[^\[\]&_braceexpansion_spe;]*+(?:\[[*@a-zA-Z0-9]\])\})?">
<!ENTITY _braceexpansion_string "'[^']*'|&quot;([^&quot;\`]*+|`[^`]*`)*+&quot;">
<!ENTITY _braceexpansion_elems "\\.|`[^`]*`|&_braceexpansion_string;|&_braceexpansion_var;|&_brace_noexpansion;">
<!ENTITY _braceexpansion_consume "&_braceexpansion_elems;|{(?:[^&_braceexpansion_spe;,]++|&_braceexpansion_elems;)*?}|(?R)?+">
<!ENTITY _braceexpansion "(?:[^&_braceexpansion_spe;,]++|&_braceexpansion_consume;)*?,(?:[^&_braceexpansion_spe;]++|&_braceexpansion_consume;)*?}">
<!ENTITY braceexpansion "{&_braceexpansion;">
<!ENTITY heredocq "(?|&quot;([^&quot;]+)&quot;|'([^']+)'|\\(.[^&wordseps;&substseps;]*))">
<!ENTITY arithmetic_as_subshell "\(((?:[^`'&quot;()$]++|\$\{[^`'&quot;(){}$]+\}|\$(?=[^{`'&quot;()])|`[^`]*+`|\((?1)(?:[)]|(?=['&quot;])))++)(?:[)](?=$|[^)])|[&quot;'])">
<!ENTITY unary_operators "-[abcdefghkprstuwxGLNOSovRnz]&eos;">
<!ENTITY binary_operators "(?:-(?:e[fq]|[nolg]t|[nlg]e)|==?|!=)&eos;">
<!ENTITY dblbracket_close "\]\](?=($|[ &tab;;|&amp;)]))">
<!ENTITY weakDeliminatorSymbols "^&#37;#[]$.{}:-/">
]>
<language name="Bash" version="39" kateversion="5.79" section="Scripts" extensions="*.sh;*.bash;*.ebuild;*.eclass;*.exlib;*.exheres-0;.bashrc;.bash_profile;.bash_login;.profile;PKGBUILD;APKBUILD" mimetype="application/x-shellscript" casesensitive="1" author="Wilbert Berendsen (wilbert@kde.nl)" license="LGPL">
<language
name="Bash"
version="46"
kateversion="5.79"
section="Scripts"
extensions="*.sh;*.bash;*.ebuild;*.eclass;*.exlib;*.exheres-0;.bashrc;.bash_profile;.bash_login;.profile;PKGBUILD;APKBUILD"
mimetype="application/x-shellscript"
casesensitive="1"
author="Wilbert Berendsen (wilbert@kde.nl)"
license="LGPL"
>
<!-- (c) 2004 by Wilbert Berendsen (wilbert@kde.nl)
Changes by Matthew Woehlke (mw_triad@users.sourceforge.net)
@@ -544,6 +579,9 @@
<keyword attribute="Builtin" context="VarName" String="builtins_var" lookAhead="1"/>
<!-- mark function definitions without function keyword -->
<RegExpr attribute="Function" context="#stay" String="&funcname;[ &tab;]*\(\)"/>
<!-- Special case for `: << '#BLOCK-COMMENT' form of "multiline" comments-->
<RegExpr attribute="Normal Text" context="PreHereDocMLComment" String="^:[ &tab;]+&lt;&lt;[ &tab;]*'#([^']+)'$" lookAhead="1" column="0"/>
<WordDetect attribute="Builtin" context="Coproc" String="coproc"/>
<keyword attribute="Builtin" context="CommandArgs" String="builtins"/>
<keyword attribute="Command" context="CommandArgs" String="unixcommands"/>
@@ -592,6 +630,18 @@
<DetectChar context="#pop!Command" char="}" lookAhead="1"/>
</context>
<context attribute="Normal Text" lineEndContext="#pop" name="Coproc" fallthroughContext="#pop">
<DetectSpaces attribute="Normal Text"/>
<LineContinue attribute="Escape" context="#stay"/>
<RegExpr context="CoprocName" String="(\$?&varname;|\$\{&varname;\}|'&varname;'|&quot;(\$?&varname;|\$\{&varname;\}|[a-zA-Z0-9_])+&quot;)+(?=\s+\{($|\s))" lookAhead="1"/>
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="CoprocName">
<DetectChar attribute="Keyword" context="#pop#pop!Group" char="{" beginRegion="group"/>
<DetectSpaces attribute="Normal Text"/>
<DetectIdentifier attribute="Normal Text"/>
<IncludeRules context="FindWord"/>
</context>
<context attribute="Command" lineEndContext="#pop" name="Command" fallthroughContext="#pop">
<DetectSpaces attribute="Normal Text" context="#pop!CommandArgs"/>
<DetectChar context="CommandVariables" char="$" lookAhead="1"/>
@@ -620,7 +670,11 @@
<Detect2Chars attribute="String Transl." context="#pop!StringDQ" char="$" char1="&quot;"/>
</context>
<context attribute="Command" lineEndContext="#pop#pop" name="DispatchVarnameVariables">
<RegExpr attribute="Variable" context="#pop" String="\$(?:&varname;|[*@#?$!0-9-])"/>
<RegExpr attribute="Dollar Prefix" context="#pop!VarNamePrefixedWithDollar" String="\$(?=&varname;|[*@#?$!0-9-])"/>
</context>
<context attribute="Variable" lineEndContext="#pop" name="VarNamePrefixedWithDollar">
<DetectIdentifier attribute="Variable" context="#pop"/>
<AnyChar attribute="Variable" context="#pop" String="*@#?$!0123456789-"/>
</context>
<context attribute="OtherCommand" lineEndContext="#pop#pop" name="CommandName">
<DetectSpaces attribute="Normal Text" context="#pop#pop!CommandArgs"/>
@@ -693,17 +747,24 @@
<IncludeRules context="FindWord"/>
<IncludeRules context="FindGlobAndPop"/>
<DetectChar context="OptionMaybeBraceExpansion" char="{" lookAhead="1"/>
<DetectChar context="LongOptionMaybeGlobAny" char="[" lookAhead="1"/>
<RegExpr attribute="Option" context="#stay" String="&opt;"/>
</context>
<context attribute="Option" lineEndContext="#pop#pop" name="LongOptionMaybeGlobAny" fallthroughContext="#pop">
<IncludeRules context="FindGlobAny"/>
<DetectChar attribute="Option" context="#pop" char="["/>
</context>
<context attribute="Normal Text" lineEndContext="#pop" name="NormalOption" fallthroughContext="#pop">
<AnyChar context="#pop" String="&wordseps;`" lookAhead="1"/>
<IncludeRules context="FindWord"/>
<DetectChar context="NormalMaybeBraceExpansion" char="{" lookAhead="1"/>
<IncludeRules context="FindPathThenPop"/>
<IncludeRules context="FindNormalTextOption"/>
<IncludeRules context="FindNormalText"/>
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="FindNormalTextOption">
<RegExpr attribute="Normal Text" context="#stay" String="[^&wordseps;&substseps;]+"/>
<context attribute="Normal Text" lineEndContext="#stay" name="FindNormalText">
<IncludeRules context="FindGlobAndPop"/>
<RegExpr attribute="Path" context="PathThenPop" String="&pathpart;"/>
<DetectChar context="FindPathThenPopMaybeGlobAny" char="[" lookAhead="1"/>
<RegExpr attribute="Normal Text" context="#stay" String="[^&wordseps;&substseps;\[]+"/>
</context>
<context attribute="Normal Text" lineEndContext="#pop" name="OptionMaybeBraceExpansion">
<IncludeRules context="DispatchBraceExpansion"/>
@@ -735,18 +796,15 @@
<RegExpr attribute="Escape" context="#pop!SequenceExpression" String="{(?=([-+]?[0-9]+\.\.[-+]?[0-9]+|[a-zA-Z]\.\.[a-zA-Z])(\.\.[-+]?[0-9]+)?\})"/>
</context>
<!-- FindPathThenPop consumes path -->
<context attribute="Normal Text" lineEndContext="#pop" name="FindPathThenPop">
<IncludeRules context="FindGlobAndPop"/>
<RegExpr attribute="Path" context="PathThenPop" String="&pathpart;"/>
<!-- FindPathThenPopMaybeGlobAny consumes path -->
<context attribute="Normal Text" lineEndContext="#pop#pop" name="FindPathThenPopMaybeGlobAny" fallthroughContext="#pop!PathThenPop">
<IncludeRules context="FindGlobAny"/>
<DetectChar attribute="Normal Text" context="#pop" char="["/>
</context>
<context attribute="Path" lineEndContext="#pop" name="FindGlobAndPop">
<IncludeRules context="FindExtGlobAndPop"/>
<AnyChar attribute="Glob" context="PathThenPop" String="?*"/>
</context>
<context attribute="Path" lineEndContext="#pop" name="FindExtGlobAndPop">
<Detect2Chars attribute="Glob" context="ExtGlobAndPop" char="?" char1="("/>
<Detect2Chars attribute="Glob" context="ExtGlobAndPop" char="*" char1="("/>
<AnyChar attribute="Glob" context="PathThenPop" String="?*"/>
<Detect2Chars attribute="Glob" context="ExtGlobAndPop" char="+" char1="("/>
<Detect2Chars attribute="Glob" context="ExtGlobAndPop" char="@" char1="("/>
<Detect2Chars attribute="Glob" context="ExtGlobAndPop" char="!" char1="("/>
@@ -768,8 +826,10 @@
<DetectChar attribute="Glob" context="#pop" char=")"/>
<IncludeRules context="FindWord"/>
<IncludeRules context="IncExtGlob"/>
<IncludeRules context="PathThenPopMaybeGlobAny"/>
</context>
<context attribute="Path" lineEndContext="#stay" name="IncExtGlob">
<DetectIdentifier attribute="Path"/>
<IncludeRules context="FindExtGlob"/>
<DetectChar context="PathMaybeBraceExpansion" char="{" lookAhead="1"/>
</context>
@@ -778,13 +838,38 @@
<IncludeRules context="FindWord"/>
<IncludeRules context="FindExtGlob"/>
<DetectChar context="PathMaybeBraceExpansion" char="{" lookAhead="1"/>
<DetectChar context="PathThenPopMaybeGlobAny" char="[" lookAhead="1"/>
<RegExpr attribute="Path" context="#stay" String="&path;"/>
</context>
<context attribute="Path" lineEndContext="#pop#pop" name="PathThenPopMaybeGlobAny" fallthroughContext="#pop">
<IncludeRules context="FindGlobAny"/>
<DetectChar attribute="Path" context="#pop" char="["/>
</context>
<context attribute="Path" lineEndContext="#pop" name="PathMaybeBraceExpansion" fallthroughContext="#pop">
<IncludeRules context="DispatchBraceExpansion"/>
<DetectChar attribute="Path" context="#pop" char="{"/>
</context>
<context attribute="Glob" lineEndContext="#stay" name="FindGlobAny">
<RegExpr attribute="Glob" context="GlobAnyFlag" String="\[(?=&next_is_globany;)"/>
</context>
<context attribute="Pattern" lineEndContext="#pop" name="GlobAnyFlag" fallthroughContext="#pop!GlobAny">
<DetectChar attribute="Glob" context="#pop!GlobAny" char="^"/>
</context>
<context attribute="Pattern" lineEndContext="#pop" name="GlobAny">
<DetectIdentifier attribute="Pattern"/>
<DetectChar context="AssumeEscape" char="\" lookAhead="1"/>
<DetectChar attribute="Glob" context="#stay" char="-"/>
<IncludeRules context="FindStrings"/>
<DetectChar attribute="Glob" context="#pop" char="]"/>
<Detect2Chars attribute="Glob" context="GlobClass" char="[" char1=":"/>
</context>
<context attribute="Glob" lineEndContext="#pop#pop" name="GlobClass">
<DetectIdentifier attribute="Pattern"/>
<Detect2Chars attribute="Glob" context="#pop" char=":" char1="]"/>
<DetectChar attribute="Error" context="#pop" char="]"/>
</context>
<!-- FindPathThenPopInAlternateValue consumes path in ${xx:here}-->
<context attribute="Normal Text" lineEndContext="#pop" name="FindPathThenPopInAlternateValue">
<Detect2Chars context="#pop!PathThenPopInAlternateValue" char="?" char1="(" lookAhead="1"/>
@@ -813,6 +898,7 @@
<IncludeRules context="FindExtGlobInAlternateValue"/>
</context>
<context attribute="Path" lineEndContext="#stay" name="FindExtGlobInAlternateValue">
<DetectIdentifier attribute="Path"/>
<Detect2Chars attribute="Glob" context="RecursiveExtGlobInAlternateValue" char="?" char1="("/>
<Detect2Chars attribute="Glob" context="RecursiveExtGlobInAlternateValue" char="*" char1="("/>
<Detect2Chars attribute="Glob" context="RecursiveExtGlobInAlternateValue" char="+" char1="("/>
@@ -836,6 +922,7 @@
<AnyChar attribute="Glob" context="#stay" String="?*"/>
</context>
<context attribute="Pattern" lineEndContext="#stay" name="ExtPattern">
<DetectIdentifier attribute="Pattern"/>
<DetectChar attribute="Glob" context="#stay" char="|"/>
<IncludeRules context="FindWord"/>
<DetectChar attribute="Glob" context="#pop" char=")"/>
@@ -937,6 +1024,7 @@
<context attribute="Normal Text" lineEndContext="#pop" name="StringRedirection2">
<AnyChar context="#pop" String="&wordseps;`" lookAhead="1"/>
<IncludeRules context="FindWord"/>
<DetectIdentifier attribute="Normal Text"/>
</context>
<context attribute="Normal Text" lineEndContext="#pop" name="CloseFile" fallthroughContext="#pop">
<DetectChar attribute="Keyword" context="#pop" char="-"/>
@@ -944,6 +1032,7 @@
<!-- HereDoc consumes Here-documents. It is called at the beginning of the "<<" construct. -->
<context attribute="Normal Text" lineEndContext="#stay" name="HereDoc">
<RegExpr attribute="Redirection" context="HereDocMLComment" String="^[ &tab;]*&lt;&lt;[ &tab;]*'#([^']+)'$" column="0"/>
<RegExpr attribute="Redirection" context="HereDocIQ" String="&lt;&lt;-[ &tab;]*&heredocq;(?=[ &tab;]*$)"/>
<RegExpr attribute="Redirection" context="HereDocINQ" String="&lt;&lt;-[ &tab;]*([^&wordseps;]+)(?=[ &tab;]*$)"/>
<RegExpr attribute="Redirection" context="HereDocQ" String="&lt;&lt;[ &tab;]*&heredocq;(?=[ &tab;]*$)"/>
@@ -961,6 +1050,24 @@
<IncludeRules context="Start"/>
</context>
<!-- Highlight the builtin `:` (true) and the followed redirection, then fall into `HereDocMLComment` -->
<context attribute="Comment" lineEndContext="#stay" name="PreHereDocMLComment">
<DetectChar attribute="Builtin" context="#stay" char=":" column="0"/>
<RegExpr attribute="Redirection" context="HereDocMLComment" String="&lt;&lt;[ &tab;]*'#([^']+)'$"/>
</context>
<context attribute="Comment" lineEndContext="#stay" name="HereDocMLComment" dynamic="true" fallthroughContext="Comment">
<RegExpr attribute="Redirection" context="#pop#pop" String="^#%1$" column="0" dynamic="true"/>
<RegExpr attribute="Region Marker" context="RST Documentation" String="^#?\[(=*)\[\.rst:" column="0" beginRegion="RSTDocumentation" />
<IncludeRules context="Comment"/>
</context>
<context attribute="Comment" lineEndContext="#stay" name="RST Documentation" dynamic="true">
<RegExpr attribute="Redirection" context="#pop#pop#pop" String="^#BLOCK-COMMENT$" column="0"/>
<RegExpr attribute="Region Marker" context="#pop" String="^#?\]%1\]" dynamic="true" column="0" endRegion="RSTDocumentation" />
<IncludeRules context="##reStructuredText" />
</context>
<context attribute="Here Doc" lineEndContext="#stay" name="HereDocQ" dynamic="true" fallthroughContext="HereDocText">
<RegExpr attribute="Redirection" context="#pop#pop" String="^%1$" dynamic="true" column="0"/>
</context>
@@ -1001,6 +1108,8 @@
</context>
<context attribute="Here Doc" lineEndContext="#pop" name="HereDocSubstitutions">
<DetectSpaces attribute="Here Doc"/>
<DetectIdentifier attribute="Here Doc"/>
<DetectChar context="HereDocVariables" char="$" lookAhead="1"/>
<DetectChar attribute="Backquote" context="CommandBackq" char="`"/>
<DetectChar context="AssumeEscape" char="\" lookAhead="1"/>
@@ -1086,11 +1195,15 @@
<!-- StringSQ consumes anything till ' -->
<context attribute="String SingleQ" lineEndContext="#stay" name="StringSQ">
<DetectSpaces attribute="String SingleQ"/>
<DetectIdentifier attribute="String SingleQ"/>
<DetectChar attribute="String SingleQ" context="#pop" char="'"/>
</context>
<!-- StringDQ consumes anything till ", substitutes vars and expressions -->
<context attribute="String DoubleQ" lineEndContext="#stay" name="StringDQ">
<DetectSpaces attribute="String DoubleQ"/>
<DetectIdentifier attribute="String DoubleQ"/>
<DetectChar attribute="String DoubleQ" context="#pop" char="&quot;"/>
<DetectChar context="StringDQEscape" char="\" lookAhead="1"/>
<DetectChar context="StringDQDispatchVariables" char="$" lookAhead="1"/>
@@ -1119,6 +1232,8 @@
<!-- StringEsc eats till ', but escaping many characters -->
<context attribute="String SingleQ" lineEndContext="#stay" name="StringEsc">
<DetectSpaces attribute="String SingleQ"/>
<DetectIdentifier attribute="String SingleQ"/>
<DetectChar attribute="String SingleQ" context="#pop" char="'"/>
<RegExpr attribute="String Escape" context="#stay" String="\\(?:[abefnrtv\\']|[0-7]{1,3}|x[A-Fa-f0-9]{1,2}|c.)"/>
</context>
@@ -1165,13 +1280,13 @@
<!-- VarBrace is called as soon as ${ or ${# are encoutered -->
<context attribute="Variable" lineEndContext="#stay" name="VarBrace" fallthroughContext="#pop!VarError">
<DetectChar attribute="Variable" context="#pop" char="}"/>
<DetectChar attribute="Parameter Expansion" context="#pop" char="}"/>
<DetectIdentifier attribute="Variable" context="#pop!CheckVarAlt"/>
<AnyChar attribute="Variable" context="#pop!CheckVarAlt" String="*@?$!-"/>
<Int attribute="Variable" context="#pop!CheckVarAlt" additionalDeliminator=":#%^,/@{}"/>
</context>
<context attribute="Error" lineEndContext="#stay" name="VarError">
<DetectChar attribute="Variable" context="#pop" char="}"/>
<DetectChar attribute="Parameter Expansion" context="#pop" char="}"/>
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="CheckVarAlt" fallthroughContext="#pop!VarError">
<DetectChar attribute="Parameter Expansion" context="#pop" char="}"/>
@@ -1195,7 +1310,7 @@
<!-- called as soon as ${xxx: is encoutered -->
<context attribute="Normal Text" lineEndContext="#stay" name="VarSub">
<DetectChar attribute="Variable" context="#pop" char="}"/>
<DetectChar attribute="Parameter Expansion" context="#pop" char="}"/>
<!-- <Int> doesn't match :3 because : is a weakDeliminator -->
<AnyChar attribute="Decimal" String="0123456789"/>
<DetectChar attribute="Parameter Expansion Operator" context="#stay" char=":"/>
@@ -1214,6 +1329,7 @@
<DetectChar attribute="Parameter Expansion" context="#pop" char="}"/>
<IncludeRules context="FindWord"/>
<IncludeRules context="FindPathThenPopInAlternateValue"/>
<DetectIdentifier attribute="Normal Text"/>
</context>
<!-- called as soon as ${xxx^ are ${xxx, are encoutered -->
@@ -1221,6 +1337,7 @@
<DetectChar attribute="Parameter Expansion" context="#pop" char="}"/>
<IncludeRules context="FindWord"/>
<IncludeRules context="FindPattern"/>
<DetectIdentifier attribute="Pattern"/>
</context>
<!-- called as soon as ${xxx/ is encoutered -->
@@ -1250,6 +1367,7 @@
<DetectChar context="BraceExpansionVariables" char="$" lookAhead="1"/>
<IncludeRules context="FindStrings"/>
<IncludeRules context="FindPattern"/>
<DetectIdentifier attribute="Escape"/>
</context>
<context attribute="Escape" lineEndContext="#pop" name="EscapeMaybeBraceExpansion">
<IncludeRules context="DispatchBraceExpansion"/>
@@ -1305,27 +1423,17 @@
</context>
<context attribute="Decimal" lineEndContext="#pop" name="Number">
<Detect2Chars attribute="Hex" context="#pop!Hex" char="0" char1="x"/>
<Detect2Chars attribute="Hex" context="#pop!Hex" char="0" char1="X"/>
<DetectChar context="#pop!Octal" char="0" lookAhead="1"/>
<HlCHex attribute="Hex" context="#pop" additionalDeliminator="&weakDeliminatorSymbols;"/>
<HlCOct attribute="Octal" context="#pop!NumberError" additionalDeliminator="&weakDeliminatorSymbols;"/>
<RegExpr attribute="Base" context="#pop!BaseN" String="[1-9][0-9]*#"/>
<AnyChar attribute="Decimal" context="#pop!Decimal" String="123456789"/>
</context>
<context attribute="Octal" lineEndContext="#pop" name="Octal" fallthroughContext="#pop!Decimal">
<RegExpr attribute="Octal" context="#pop!NumberError" String="0[0-7]+"/>
<DetectChar attribute="Decimal" context="#pop" char="0"/>
</context>
<context attribute="Decimal" lineEndContext="#pop" name="Decimal" fallthroughContext="#pop">
<AnyChar attribute="Decimal" context="#stay" String="0123456789"/>
</context>
<context attribute="Hex" lineEndContext="#pop" name="Hex" fallthroughContext="#pop">
<RegExpr attribute="Hex" context="#pop" String="[0-9a-fA-F]+"/>
<DetectChar attribute="Decimal" context="#pop!NumberError" char="0"/>
<Int attribute="Decimal" context="#pop" additionalDeliminator="&weakDeliminatorSymbols;"/>
</context>
<context attribute="BaseN" lineEndContext="#pop" name="BaseN" fallthroughContext="#pop">
<RegExpr attribute="BaseN" context="#pop" String="[0-9a-zA-Z@_]+"/>
</context>
<context attribute="Error" lineEndContext="#pop" name="NumberError" fallthroughContext="#pop">
<AnyChar attribute="Error" context="#stay" String="8901234567"/>
<Int attribute="Error" context="#pop" additionalDeliminator="0123456789"/>
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="ExprDblParenSubstOrSubstCommand">
@@ -1335,7 +1443,7 @@
<!-- ExprDblParenSubst like ExprDblParen but matches )) as Variable -->
<context attribute="Normal Text" lineEndContext="#stay" name="ExprDblParenSubst">
<DetectSpaces attribute="Normal Text" context="#stay"/>
<Detect2Chars attribute="Variable" context="#pop" char=")" char1=")" endRegion="expression"/>
<Detect2Chars attribute="Parameter Expansion" context="#pop" char=")" char1=")" endRegion="expression"/>
<IncludeRules context="FindExprDblParen"/>
<!-- $((cmd
) # jump to SubstCommand context -->
@@ -1368,8 +1476,7 @@
<AnyChar context="#pop" String=" &tab;" lookAhead="1"/>
<IncludeRules context="FindWord"/>
<DetectChar context="NormalMaybeBraceExpansion" char="{" lookAhead="1"/>
<IncludeRules context="FindPathThenPop"/>
<IncludeRules context="FindNormalTextOption"/>
<IncludeRules context="FindNormalText"/>
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="ExprBracketParam2" fallthroughContext="ExprBracketValue">
@@ -1386,6 +1493,7 @@
<context attribute="Normal Text" lineEndContext="#stay" name="ExprBracketFinal" fallthroughContext="ExprBracketValue">
<DetectSpaces attribute="Normal Text" context="#stay"/>
<IncludeRules context="FindExprBracketEnd"/>
<RegExpr attribute="Expression" context="#pop!ExprBracket" String="-[ao]&eos;"/>
<RegExpr attribute="Error" context="#pop" String="(?:[^] &tab;]++|\][^ &tab;])++" endRegion="expression"/>
</context>
@@ -1395,10 +1503,10 @@
</context>
<context attribute="Normal Text" lineEndContext="#pop" name="TestMaybeUnary" fallthroughContext="#pop!ExprBracketValue">
<RegExpr attribute="Expression" context="#pop" String="-[abcdefghkprstuwxGLNOSovRnz](?=[ &tab;])"/>
<RegExpr attribute="Expression" context="#pop#pop!ExprBracketParam2" String="&unary_operators;"/>
</context>
<context attribute="Normal Text" lineEndContext="#pop" name="TestMaybeBinary" fallthroughContext="#pop!ExprBracketValue">
<RegExpr attribute="Expression" context="#pop" String="(?:-(?:e[fq]|[nolg]t|[nlg]e)|==?|!=)(?=[ &tab;])"/>
<RegExpr attribute="Expression" context="#pop" String="&binary_operators;"/>
</context>
@@ -1417,28 +1525,88 @@
<RegExpr attribute="Expression" context="#pop" String="!(?=$|[ &tab;(])"/>
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="ExprDblBracketParam1" fallthroughContext="ExprDblBracketValue">
<context attribute="Normal Text" lineEndContext="#stay" name="ExprDblBracketParam1" fallthroughContext="ExprDblBracketValueText">
<DetectSpaces attribute="Normal Text" context="#pop!ExprDblBracketParam2"/>
<DetectChar context="TestMaybeUnary2" char="-" lookAhead="1"/>
<AnyChar attribute="Expression" context="#pop!ExprDblBracketParam3Spe" String="&lt;>"/>
<IncludeRules context="FindExprDblBracketEnd"/>
</context>
<context attribute="Normal Text" lineEndContext="#pop" name="TestMaybeUnary2" fallthroughContext="#pop!ExprDblBracketValue">
<IncludeRules context="TestMaybeUnary"/>
<context attribute="Normal Text" lineEndContext="#pop" name="TestMaybeUnary2" fallthroughContext="#pop!ExprDblBracketValueText">
<RegExpr attribute="Expression" context="#pop!ExprDblBracketUnary" String="&unary_operators;(?!\s+(?:=~|&binary_operators;))"/>
</context>
<context attribute="Normal Text" lineEndContext="#pop" name="ExprDblBracketUnary">
<DetectSpaces attribute="Normal Text" context="#pop!ExprDblBracketValueText"/>
</context>
<context attribute="Normal Text" lineEndContext="#pop" name="ExprDblBracketValue">
<context attribute="Normal Text" lineEndContext="#pop" name="ExprDblBracketValueText" fallthroughContext="#pop!ExprDblBracketValueText2">
<Detect2Chars context="#pop!ExprDblBracketValueTextMaybeEnd" char="]" char1="]" lookAhead="1"/>
<DetectChar attribute="Error" context="#pop!Comment" char="#"/>
<IncludeRules context="FindExprDblBracketValueTextPath"/>
</context>
<context attribute="Normal Text" lineEndContext="#pop" name="FindExprDblBracketValueTextPath">
<RegExpr context="#pop!ExprDblBracketValueTextPath" String="&path_with_sep;|" lookAhead="1"/>
</context>
<context attribute="Normal Text" lineEndContext="#pop" name="ExprDblBracketValueTextMaybeEnd">
<RegExpr attribute="Keyword" context="#pop#pop" String="&dblbracket_close;" endRegion="expression"/>
<IncludeRules context="FindExprDblBracketValueTextPath"/>
<Detect2Chars context="#pop!ExprDblBracketValueText2" char="]" char1="]" lookAhead="1"/>
</context>
<context attribute="Normal Text" lineEndContext="#pop" name="ExprDblBracketValueText2">
<DetectIdentifier/>
<AnyChar String="*?+!@~^:%+-/,"/>
<IncludeRules context="ExprDblBracketValueCommon"/>
</context>
<context attribute="Path" lineEndContext="#pop" name="ExprDblBracketValueTextPath">
<IncludeRules context="ExprDblBracketValueText2"/>
</context>
<context attribute="Normal Text" lineEndContext="#pop" name="ExprDblBracketValuePattern" fallthroughContext="#pop!ExprDblBracketValuePattern2">
<RegExpr context="PathThenPop" String="&path_with_sep;|" lookAhead="1"/>
</context>
<context attribute="Normal Text" lineEndContext="#pop" name="ExprDblBracketValuePattern2">
<DetectIdentifier attribute="Normal Text"/>
<IncludeRules context="ExprDblBracketValueCommon"/>
<IncludeRules context="FindExprDblBracketValueExtGlob"/>
<AnyChar attribute="Glob" String="?*"/>
</context>
<context attribute="Glob" lineEndContext="#stay" name="FindExprDblBracketValueExtGlob">
<Detect2Chars attribute="Glob" context="ExprDblBracketValueExtGlob" char="?" char1="("/>
<Detect2Chars attribute="Glob" context="ExprDblBracketValueExtGlob" char="*" char1="("/>
<Detect2Chars attribute="Glob" context="ExprDblBracketValueExtGlob" char="+" char1="("/>
<Detect2Chars attribute="Glob" context="ExprDblBracketValueExtGlob" char="@" char1="("/>
<Detect2Chars attribute="Glob" context="ExprDblBracketValueExtGlob" char="!" char1="("/>
<DetectChar context="ExprDblBracketValueMaybeGlobAny" char="[" lookAhead="1"/>
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="ExprDblBracketValueMaybeGlobAny" fallthroughContext="#pop">
<IncludeRules context="FindGlobAny"/>
<DetectChar attribute="Normal Text" context="#pop" char="["/>
</context>
<context attribute="Normal Text" lineEndContext="#pop#pop" name="ExprDblBracketValueExtGlob">
<DetectIdentifier attribute="Normal Text"/>
<DetectChar attribute="Glob" context="#pop" char=")"/>
<DetectChar attribute="Normal Text" context="ExprDblBracketValueExtGlobNormal" char="("/>
<IncludeRules context="FindExprDblBracketValueExtGlob"/>
<AnyChar attribute="Glob" String="|?*"/>
<IncludeRules context="FindWord"/>
</context>
<context attribute="Normal Text" lineEndContext="#pop#pop" name="ExprDblBracketValueExtGlobNormal">
<DetectIdentifier attribute="Normal Text"/>
<DetectChar attribute="Normal Text" context="#pop" char=")"/>
<DetectChar attribute="Normal Text" context="ExprDblBracketValueExtGlobNormal" char="("/>
<IncludeRules context="FindExprDblBracketValueExtGlob"/>
<AnyChar attribute="Glob" String="?*"/>
<IncludeRules context="FindWord"/>
</context>
<context attribute="Normal Text" lineEndContext="#pop" name="ExprDblBracketValueCommon">
<Detect2Chars context="ExprDblBracketDblParentOrSubValue" char="(" char1="(" lookAhead="1"/>
<DetectChar context="ExprDblBracketSubValue" char="(" lookAhead="1"/>
<DetectChar attribute="Operator" context="#pop#pop" char=")"/>
<Detect2Chars attribute="Control" context="#pop#pop!ExprDblBracket" char="&amp;" char1="&amp;"/>
<Detect2Chars attribute="Control" context="#pop#pop!ExprDblBracket" char="|" char1="|"/>
<AnyChar attribute="Error" context="#stay" String="|&amp;;)"/>
<AnyChar attribute="Error" context="#stay" String="|&amp;;"/>
<AnyChar context="#pop" String=" &tab;&lt;>" lookAhead="1"/>
<IncludeRules context="FindWord"/>
<DetectChar context="NormalMaybeBraceExpansion" char="{" lookAhead="1"/>
<IncludeRules context="FindPathThenPop"/>
<IncludeRules context="FindNormalTextOption"/>
</context>
<context attribute="Normal Text" lineEndContext="#pop" name="ExprDblBracketSubValue" fallthroughContext="#pop">
<DetectChar attribute="Operator" context="ExprDblBracketNot" char="("/>
@@ -1453,35 +1621,38 @@
<Detect2Chars attribute="Keyword" context="#pop" char=")" char1=")" endRegion="expression"/>
<IncludeRules context="FindExprDblParen"/>
<!-- ((cmd
) # jump to ExprDblBracketValue context -->
<DetectChar attribute="Operator" context="ExprDblBracketValue" char=")" endRegion="expression" beginRegion="subshell"/>
) # jump to ExprDblBracketValuePattern context -->
<DetectChar attribute="Operator" context="ExprDblBracketValuePattern" char=")" endRegion="expression" beginRegion="subshell"/>
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="ExprDblBracketParam2" fallthroughContext="ExprDblBracketValue">
<context attribute="Normal Text" lineEndContext="#stay" name="ExprDblBracketParam2" fallthroughContext="ExprDblBracketValuePattern">
<DetectSpaces attribute="Normal Text" context="#pop!ExprDblBracketParam3"/>
<AnyChar context="TestMaybeBinary2" String="-=!" lookAhead="1"/>
<AnyChar attribute="Expression" context="#pop!ExprDblBracketParam3Spe" String="&lt;>"/>
<IncludeRules context="FindExprDblBracketEnd"/>
<DetectChar attribute="Comment" context="Comment" char="#"/>
</context>
<context attribute="Normal Text" lineEndContext="#pop" name="TestMaybeBinary2" fallthroughContext="#pop!ExprDblBracketValue">
<context attribute="Normal Text" lineEndContext="#pop" name="TestMaybeBinary2" fallthroughContext="#pop!ExprDblBracketValuePattern">
<IncludeRules context="TestMaybeBinary"/>
<RegExpr attribute="Expression" context="#pop#pop!ExprDblBracketRegex" String="=~(?=[ &tab;(])"/>
<RegExpr attribute="Expression" context="#pop!ExprDblBracketRegex" String="=~(?=[ &tab;(])"/>
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="ExprDblBracketParam3Spe" fallthroughContext="#pop!ExprDblBracketParam3">
<DetectSpaces attribute="Normal Text" context="#pop!ExprDblBracketParam3"/>
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="ExprDblBracketParam3" fallthroughContext="ExprDblBracketValue">
<context attribute="Normal Text" lineEndContext="#stay" name="ExprDblBracketParam3" fallthroughContext="ExprDblBracketValuePattern">
<DetectSpaces attribute="Normal Text" context="#pop!ExprDblBracketFinal"/>
<IncludeRules context="FindExprDblBracketEnd"/>
<AnyChar attribute="Error" context="#stay" String="&lt;>"/>
<DetectChar attribute="Comment" context="Comment" char="#"/>
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="ExprDblBracketFinal" fallthroughContext="ExprDblBracketValue">
<context attribute="Normal Text" lineEndContext="#stay" name="ExprDblBracketFinal" fallthroughContext="ExprDblBracketValuePattern">
<DetectSpaces attribute="Normal Text" context="#stay"/>
<IncludeRules context="FindExprDblBracketEnd"/>
<DetectChar attribute="Comment" context="Comment" char="#"/>
<DetectChar attribute="Operator" context="#pop" char=")"/>
<RegExpr attribute="Error" context="#pop" String="(?:[^] &tab;]++|\](?:[^]]|\][^ &tab;]))++" endRegion="expression"/>
</context>
@@ -1489,13 +1660,17 @@
<LineContinue attribute="Escape" context="#stay"/>
<Detect2Chars attribute="Control" context="#pop!ExprDblBracket" char="&amp;" char1="&amp;"/>
<Detect2Chars attribute="Control" context="#pop!ExprDblBracket" char="|" char1="|"/>
<RegExpr attribute="Keyword" context="#pop" String="\]\](?=($|[ &tab;;|&amp;)]))" endRegion="expression"/>
<RegExpr attribute="Keyword" context="#pop" String="&dblbracket_close;" endRegion="expression"/>
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="ExprDblBracketRegex">
<DetectSpaces attribute="Normal Text" context="#pop!Regex"/>
<context attribute="Normal Text" lineEndContext="#stay" name="ExprDblBracketRegex" fallthroughContext="#pop!ExprDblBracketRegexCheck">
<DetectSpaces attribute="Normal Text" context="#pop!ExprDblBracketRegexCheck"/>
</context>
<context attribute="Normal Text" lineEndContext="#pop" name="ExprDblBracketRegexCheck" fallthroughContext="#pop#pop!Regex">
<DetectChar attribute="Error" context="Comment" char="#"/>
</context>
<context attribute="Pattern" lineEndContext="#stay" name="Regex">
<DetectIdentifier attribute="Pattern"/>
<DetectSpaces attribute="Normal Text" context="#pop!ExprDblBracketFinal"/>
<DetectChar attribute="Operator" context="#pop" char=")"/>
<Detect2Chars attribute="Operator" context="RegexChar" char="[" char1="^"/>
@@ -1503,6 +1678,7 @@
<IncludeRules context="FindRegex"/>
</context>
<context attribute="Pattern" lineEndContext="#stay" name="ExprDblBracketSubRegex">
<DetectIdentifier attribute="Pattern"/>
<DetectSpaces attribute="Pattern" context="#stay"/>
<DetectChar attribute="Operator" context="#pop" char=")"/>
<Detect2Chars attribute="Operator" context="RegexSubChar" char="[" char1="^"/>
@@ -1529,7 +1705,7 @@
</context>
<context attribute="Normal Text" lineEndContext="#pop" name="RegexDup">
<AnyChar attribute="Decimal" context="#stay" String="0123456789"/>
<Int attribute="Decimal" additionalDeliminator="{"/>
<DetectChar attribute="Parameter Expansion Operator" context="#stay" char=","/>
<DetectChar attribute="Parameter Expansion" context="#pop" char="}"/>
</context>
@@ -1552,6 +1728,7 @@
<DetectChar context="RegexCharClassSelect" char="[" lookAhead="1"/>
<DetectChar attribute="Operator" context="#pop" char="]"/>
<AnyChar context="#pop" String="() &tab;" lookAhead="1"/>
<IncludeRules context="FindStrings"/>
</context>
<context attribute="Operator" lineEndContext="#stay" name="RegexInCharEnd">
<DetectChar attribute="Pattern" context="#stay" char="-"/>
@@ -1565,14 +1742,17 @@
</context>
<context attribute="Parameter Expansion" lineEndContext="#pop#pop#pop" name="RegexCharClass">
<DetectIdentifier attribute="Parameter Expansion"/>
<Detect2Chars attribute="Parameter Expansion Operator" context="#pop" char=":" char1="]"/>
<DetectChar attribute="Error" context="#pop" char="]"/>
</context>
<context attribute="Parameter Expansion" lineEndContext="#pop#pop#pop" name="RegexCollatingSymbols">
<DetectIdentifier attribute="Parameter Expansion"/>
<Detect2Chars attribute="Parameter Expansion Operator" context="#pop" char="." char1="]"/>
<DetectChar attribute="Error" context="#pop" char="]"/>
</context>
<context attribute="Parameter Expansion" lineEndContext="#pop#pop#pop" name="RegexEquivalenceClass">
<DetectIdentifier attribute="Parameter Expansion"/>
<Detect2Chars attribute="Parameter Expansion Operator" context="#pop" char="=" char1="]"/>
<DetectChar attribute="Error" context="#pop" char="]"/>
</context>
@@ -1617,6 +1797,7 @@
<AnyChar attribute="Decimal" context="#stay" String="0123456789"/>
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="Subscript2">
<DetectIdentifier attribute="Normal Text"/>
<DetectChar attribute="Parameter Expansion Operator" context="#pop" char="]"/>
<IncludeRules context="FindWord"/>
<IncludeRules context="FindPattern"/>
@@ -1667,43 +1848,45 @@
<itemDatas>
<itemData name="Normal Text" defStyleNum="dsNormal"/>
<itemData name="Comment" defStyleNum="dsComment"/>
<itemData name="Keyword" defStyleNum="dsKeyword"/>
<itemData name="Control" defStyleNum="dsKeyword"/>
<itemData name="Control Flow" defStyleNum="dsControlFlow"/>
<itemData name="Builtin" defStyleNum="dsBuiltIn"/>
<itemData name="Command" defStyleNum="dsFunction"/>
<itemData name="OtherCommand" defStyleNum="dsExtension"/>
<itemData name="Redirection" defStyleNum="dsOperator"/>
<itemData name="Escape" defStyleNum="dsDataType"/>
<itemData name="Keyword" defStyleNum="dsKeyword" spellChecking="false"/>
<itemData name="Control" defStyleNum="dsKeyword" spellChecking="false"/>
<itemData name="Control Flow" defStyleNum="dsControlFlow" spellChecking="false"/>
<itemData name="Builtin" defStyleNum="dsBuiltIn" spellChecking="false"/>
<itemData name="Command" defStyleNum="dsFunction" spellChecking="false"/>
<itemData name="OtherCommand" defStyleNum="dsExtension" spellChecking="false"/>
<itemData name="Redirection" defStyleNum="dsOperator" spellChecking="false"/>
<itemData name="Escape" defStyleNum="dsDataType" spellChecking="false"/>
<itemData name="String SingleQ" defStyleNum="dsString"/>
<itemData name="String DoubleQ" defStyleNum="dsString"/>
<itemData name="Here Doc" defStyleNum="dsString"/>
<itemData name="Backquote" defStyleNum="dsKeyword"/>
<itemData name="Backquote" defStyleNum="dsKeyword" spellChecking="false"/>
<itemData name="String Transl." defStyleNum="dsString"/>
<itemData name="String Escape" defStyleNum="dsDataType"/>
<itemData name="Variable" defStyleNum="dsVariable"/>
<itemData name="Expression" defStyleNum="dsOthers"/>
<itemData name="Function" defStyleNum="dsFunction"/>
<itemData name="Pattern" defStyleNum="dsSpecialString"/>
<itemData name="Path" defStyleNum="dsNormal"/>
<itemData name="Glob" defStyleNum="dsPreprocessor"/>
<itemData name="Option" defStyleNum="dsAttribute"/>
<itemData name="Hex" defStyleNum="dsBaseN"/>
<itemData name="Octal" defStyleNum="dsBaseN"/>
<itemData name="Decimal" defStyleNum="dsDecVal"/>
<itemData name="Base" defStyleNum="dsDataType"/>
<itemData name="BaseN" defStyleNum="dsBaseN"/>
<itemData name="File Descriptor" defStyleNum="dsDecVal"/>
<itemData name="Parameter Expansion" defStyleNum="dsVariable"/>
<itemData name="Parameter Expansion Operator" defStyleNum="dsOperator"/>
<itemData name="Operator" defStyleNum="dsOperator"/>
<itemData name="Error" defStyleNum="dsError"/>
<itemData name="Variable" defStyleNum="dsVariable" spellChecking="false"/>
<itemData name="Dollar Prefix" defStyleNum="dsVariable" spellChecking="false"/>
<itemData name="Expression" defStyleNum="dsOthers" spellChecking="false"/>
<itemData name="Function" defStyleNum="dsFunction" spellChecking="false"/>
<itemData name="Pattern" defStyleNum="dsSpecialString" spellChecking="false"/>
<itemData name="Path" defStyleNum="dsNormal" spellChecking="false"/>
<itemData name="Glob" defStyleNum="dsPreprocessor" spellChecking="false"/>
<itemData name="Option" defStyleNum="dsAttribute" spellChecking="false"/>
<itemData name="Hex" defStyleNum="dsBaseN" spellChecking="false"/>
<itemData name="Octal" defStyleNum="dsBaseN" spellChecking="false"/>
<itemData name="Decimal" defStyleNum="dsDecVal" spellChecking="false"/>
<itemData name="Base" defStyleNum="dsDataType" spellChecking="false"/>
<itemData name="BaseN" defStyleNum="dsBaseN" spellChecking="false"/>
<itemData name="File Descriptor" defStyleNum="dsDecVal" spellChecking="false"/>
<itemData name="Parameter Expansion" defStyleNum="dsVariable" spellChecking="false"/>
<itemData name="Parameter Expansion Operator" defStyleNum="dsOperator" spellChecking="false"/>
<itemData name="Operator" defStyleNum="dsOperator" spellChecking="false"/>
<itemData name="Error" defStyleNum="dsError" spellChecking="false"/>
<itemData name="Region Marker" defStyleNum="dsRegionMarker" spellChecking="false" />
</itemDatas>
</highlighting>
<general>
<comments>
<comment name="singleLine" start="#"/>
</comments>
<keywords casesensitive="1" weakDeliminator="^%#[]$._{}:-/" additionalDeliminator="`"/>
<keywords casesensitive="1" weakDeliminator="_&weakDeliminatorSymbols;" additionalDeliminator="`"/>
</general>
</language>

File diff suppressed because one or more lines are too long

View File

@@ -38,12 +38,13 @@ Changelog:
-->
<language name="CSS" version="13" kateversion="5.53" section="Markup" extensions="*.css" indenter="cstyle" mimetype="text/css" author="Wilbert Berendsen (wilbert@kde.nl)" license="LGPL" priority="10">
<language name="CSS" version="14" kateversion="5.53" section="Markup" extensions="*.css" indenter="cstyle" mimetype="text/css" author="Wilbert Berendsen (wilbert@kde.nl)" license="LGPL" priority="10">
<!-- https://www.w3.org/Style/CSS/current-work -->
<highlighting>
<list name="properties">
<!-- W3C > Work Draft, from https://www.w3.org/Style/CSS/all-properties -->
<!-- W3C > Work Draft, from https://www.w3.org/Style/CSS/all-properties (exclude FPWD)-->
<item>accent-color</item>
<item>align-content</item>
<item>align-items</item>
<item>alignment-baseline</item>
@@ -59,7 +60,9 @@ Changelog:
<item>animation-play-state</item>
<item>animation-timing-function</item>
<item>appearance</item>
<item>aspect-ratio</item>
<item>azimuth</item>
<item>backdrop-filter</item>
<item>backface-visibility</item>
<item>background</item>
<item>background-attachment</item>
@@ -67,18 +70,16 @@ Changelog:
<item>background-clip</item>
<item>background-color</item>
<item>background-image</item>
<item>background-image-transform</item>
<item>background-origin</item>
<item>background-position</item>
<item>background-position-x</item>
<item>background-position-y</item>
<item>background-repeat</item>
<item>background-size</item>
<item>baseline-shift</item>
<item>baseline-source</item>
<item>block-ellipsis</item>
<item>block-size</item>
<item>block-step</item>
<item>block-step-align</item>
<item>block-step-insert</item>
<item>block-step-round</item>
<item>block-step-size</item>
<item>bookmark-label</item>
<item>bookmark-level</item>
<item>bookmark-state</item>
@@ -104,12 +105,13 @@ Changelog:
<item>border-boundary</item>
<item>border-collapse</item>
<item>border-color</item>
<item>border-end-end-radius</item>
<item>border-end-start-radius</item>
<item>border-image</item>
<item>border-image-outset</item>
<item>border-image-repeat</item>
<item>border-image-slice</item>
<item>border-image-source</item>
<item>border-image-transform</item>
<item>border-image-width</item>
<item>border-inline</item>
<item>border-inline-color</item>
@@ -133,6 +135,8 @@ Changelog:
<item>border-right-style</item>
<item>border-right-width</item>
<item>border-spacing</item>
<item>border-start-end-radius</item>
<item>border-start-start-radius</item>
<item>border-style</item>
<item>border-top</item>
<item>border-top-color</item>
@@ -153,6 +157,7 @@ Changelog:
<item>caret</item>
<item>caret-color</item>
<item>caret-shape</item>
<item>chains</item>
<item>clear</item>
<item>clip</item>
<item>clip-path</item>
@@ -160,6 +165,7 @@ Changelog:
<item>color</item>
<item>color-adjust</item>
<item>color-interpolation-filters</item>
<item>color-scheme</item>
<item>columns</item>
<item>column-count</item>
<item>column-fill</item>
@@ -171,7 +177,16 @@ Changelog:
<item>column-span</item>
<item>column-width</item>
<item>contain</item>
<item>contain-intrinsic-block-size</item>
<item>contain-intrinsic-height</item>
<item>contain-intrinsic-inline-size</item>
<item>contain-intrinsic-size</item>
<item>contain-intrinsic-width</item>
<item>container</item>
<item>container-name</item>
<item>container-type</item>
<item>content</item>
<item>content-visibility</item>
<item>continue</item>
<item>counter-increment</item>
<item>counter-reset</item>
@@ -204,11 +219,9 @@ Changelog:
<item>flex-shrink</item>
<item>flex-wrap</item>
<item>float</item>
<item>float-defer</item>
<item>float-offset</item>
<item>float-reference</item>
<item>flood-color</item>
<item>flood-opacity</item>
<item>flow</item>
<item>flow-from</item>
<item>flow-into</item>
<item>font</item>
@@ -216,8 +229,6 @@ Changelog:
<item>font-feature-settings</item>
<item>font-kerning</item>
<item>font-language-override</item>
<item>font-max-size</item>
<item>font-min-size</item>
<item>font-optical-sizing</item>
<item>font-palette</item>
<item>font-size</item>
@@ -225,6 +236,9 @@ Changelog:
<item>font-stretch</item>
<item>font-style</item>
<item>font-synthesis</item>
<item>font-synthesis-small-caps</item>
<item>font-synthesis-style</item>
<item>font-synthesis-weight</item>
<item>font-variant</item>
<item>font-variant-alternates</item>
<item>font-variant-caps</item>
@@ -237,6 +251,7 @@ Changelog:
<item>font-weight</item>
<item>footnote-display</item>
<item>footnote-policy</item>
<item>forced-color-adjust</item>
<item>gap</item>
<item>glyph-orientation-vertical</item>
<item>grid</item>
@@ -246,12 +261,9 @@ Changelog:
<item>grid-auto-rows</item>
<item>grid-column</item>
<item>grid-column-end</item>
<item>grid-column-gap</item>
<item>grid-column-start</item>
<item>grid-gap</item>
<item>grid-row</item>
<item>grid-row-end</item>
<item>grid-row-gap</item>
<item>grid-row-start</item>
<item>grid-template</item>
<item>grid-template-areas</item>
@@ -272,6 +284,7 @@ Changelog:
<item>initial-letter-align</item>
<item>initial-letter-wrap</item>
<item>inline-size</item>
<item>inline-sizing</item>
<item>inset</item>
<item>inset-block</item>
<item>inset-block-end</item>
@@ -283,13 +296,16 @@ Changelog:
<item>justify-content</item>
<item>justify-items</item>
<item>justify-self</item>
<item>leading-trim</item>
<item>left</item>
<item>letter-spacing</item>
<item>lighting-color</item>
<item>line-break</item>
<item>line-clamp</item>
<item>line-grid</item>
<item>line-height</item>
<item>line-height-step</item>
<item>line-padding</item>
<item>line-snap</item>
<item>list-style</item>
<item>list-style-image</item>
@@ -306,19 +322,11 @@ Changelog:
<item>margin-left</item>
<item>margin-right</item>
<item>margin-top</item>
<item>marker</item>
<item>margin-trim</item>
<item>marker-end</item>
<item>marker-knockout-left</item>
<item>marker-knockout-right</item>
<item>marker-mid</item>
<item>marker-pattern</item>
<item>marker-segment</item>
<item>marker-side</item>
<item>marker-start</item>
<item>marquee-direction</item>
<item>marquee-loop</item>
<item>marquee-speed</item>
<item>marquee-style</item>
<item>mask</item>
<item>mask-border</item>
<item>mask-border-mode</item>
@@ -344,6 +352,7 @@ Changelog:
<item>min-block-size</item>
<item>min-height</item>
<item>min-inline-size</item>
<item>min-intrinsic-sizing</item>
<item>min-width</item>
<item>mix-blend-mode</item>
<item>nav-up</item>
@@ -353,15 +362,11 @@ Changelog:
<item>object-fit</item>
<item>object-position</item>
<item>offset</item>
<item>offset-after</item>
<item>offset-anchor</item>
<item>offset-before</item>
<item>offset-distance</item>
<item>offset-end</item>
<item>offset-path</item>
<item>offset-position</item>
<item>offset-rotate</item>
<item>offset-start</item>
<item>opacity</item>
<item>order</item>
<item>orphans</item>
@@ -371,10 +376,18 @@ Changelog:
<item>outline-style</item>
<item>outline-width</item>
<item>overflow</item>
<item>overflow-style</item>
<item>overflow-anchor</item>
<item>overflow-block</item>
<item>overflow-clip-margin</item>
<item>overflow-inline</item>
<item>overflow-wrap</item>
<item>overflow-x</item>
<item>overflow-y</item>
<item>overscroll-behavior</item>
<item>overscroll-behavior-block</item>
<item>overscroll-behavior-inline</item>
<item>overscroll-behavior-x</item>
<item>overscroll-behavior-y</item>
<item>padding</item>
<item>padding-block</item>
<item>padding-block-end</item>
@@ -390,6 +403,7 @@ Changelog:
<item>page-break-after</item>
<item>page-break-before</item>
<item>page-break-inside</item>
<item>paint-order</item>
<item>pause</item>
<item>pause-after</item>
<item>pause-before</item>
@@ -403,24 +417,61 @@ Changelog:
<item>play-during</item>
<item>pointer-events</item>
<item>position</item>
<item>print-color-adjust</item>
<item>quotes</item>
<item>region-fragment</item>
<item>resize</item>
<item>rest</item>
<item>rest-after</item>
<item>rest-before</item>
<item>richness</item>
<item>right</item>
<item>rotate</item>
<item>rotation</item>
<item>rotation-point</item>
<item>row-gap</item>
<item>ruby-align</item>
<item>ruby-merge</item>
<item>ruby-overhang</item>
<item>ruby-position</item>
<item>running</item>
<item>scale</item>
<item>scroll-behavior</item>
<item>scroll-margin</item>
<item>scroll-margin-block</item>
<item>scroll-margin-block-end</item>
<item>scroll-margin-block-start</item>
<item>scroll-margin-bottom</item>
<item>scroll-margin-inline</item>
<item>scroll-margin-inline-end</item>
<item>scroll-margin-inline-start</item>
<item>scroll-margin-left</item>
<item>scroll-margin-right</item>
<item>scroll-margin-top</item>
<item>scroll-padding</item>
<item>scroll-padding-block</item>
<item>scroll-padding-block-end</item>
<item>scroll-padding-block-start</item>
<item>scroll-padding-bottom</item>
<item>scroll-padding-inline</item>
<item>scroll-padding-inline-end</item>
<item>scroll-padding-inline-start</item>
<item>scroll-padding-left</item>
<item>scroll-padding-right</item>
<item>scroll-padding-top</item>
<item>scroll-snap-align</item>
<item>scroll-snap-stop</item>
<item>scroll-snap-type</item>
<item>scrollbar-color</item>
<item>scrollbar-gutter</item>
<item>scrollbar-width</item>
<item>shape-image-threshold</item>
<item>shape-inside</item>
<item>shape-margin</item>
<item>shape-outside</item>
<item>size</item>
<item>speak-as</item>
<item>spatial-navigation-action</item>
<item>spatial-navigation-contain</item>
<item>spatial-navigation-function</item>
<item>speak</item>
<item>speak-header</item>
<item>speak-numeral</item>
@@ -428,28 +479,35 @@ Changelog:
<item>speech-rate</item>
<item>stress</item>
<item>string-set</item>
<item>table-layout</item>
<item>tab-size</item>
<item>table-layout</item>
<item>text-align-all</item>
<item>text-align</item>
<item>text-align-last</item>
<item>text-combine-upright</item>
<item>text-decoration-color</item>
<item>text-decoration</item>
<item>text-decoration-color</item>
<item>text-decoration-line</item>
<item>text-decoration-skip</item>
<item>text-decoration-skip-box</item>
<item>text-decoration-skip-ink</item>
<item>text-decoration-skip-inset</item>
<item>text-decoration-skip-self</item>
<item>text-decoration-skip-spaces</item>
<item>text-decoration-style</item>
<item>text-decoration-width</item>
<item>text-decoration-thickness</item>
<item>text-edge</item>
<item>text-emphasis</item>
<item>text-emphasis-color</item>
<item>text-emphasis-position</item>
<item>text-emphasis-skip</item>
<item>text-emphasis-style</item>
<item>text-group-align</item>
<item>text-indent</item>
<item>text-justify</item>
<item>text-orientation</item>
<item>text-overflow</item>
<item>text-rendering</item>
<item>text-shadow</item>
<item>text-space-collapse</item>
<item>text-space-trim</item>
@@ -468,16 +526,26 @@ Changelog:
<item>transition-duration</item>
<item>transition-property</item>
<item>transition-timing-function</item>
<item>translate</item>
<item>unicode-bidi</item>
<item>user-select</item>
<item>vertical-align</item>
<item>visibility</item>
<item>voice-balance</item>
<item>voice-duration</item>
<item>voice-family</item>
<item>voice-pitch</item>
<item>voice-range</item>
<item>voice-rate</item>
<item>voice-stress</item>
<item>voice-volume</item>
<item>volume</item>
<item>white-space</item>
<item>widows</item>
<item>width</item>
<item>will-change</item>
<item>word-boundary-detection</item>
<item>word-boundary-expansion</item>
<item>word-break</item>
<item>word-spacing</item>
<item>word-wrap</item>
@@ -656,16 +724,17 @@ Changelog:
</list>
<list name="value keywords">
<item>auto</item>
<item>inherit</item>
<item>unset</item>
<item>auto</item>
<!-- <item>revert</item> -->
</list>
<list name="values">
<item>none</item>
<item>hidden</item>
<item>initial</item>
<item>revert</item>
<item>revert-layer</item>
<item>dotted</item>
<item>dashed</item>
<item>solid</item>
@@ -1076,22 +1145,58 @@ Changelog:
<list name="functions">
<item>attr</item>
<item>cross-fade</item>
<item>env</item>
<item>fit-content</item>
<item>minmax</item>
<item>path</item>
<item>repeat</item>
<item>url</item>
<item>var</item>
<!-- math functions -->
<!-- https://drafts.csswg.org/css-values-4/#calc-syntax -->
<item>abs</item>
<item>acos</item>
<item>asin</item>
<item>atan2</item>
<item>atan</item>
<item>calc</item>
<item>hsl</item>
<item>hsla</item>
<item>clamp</item>
<item>cos</item>
<item>exp</item>
<item>hypot</item>
<item>log</item>
<item>max</item>
<item>min</item>
<item>mod</item>
<item>pow</item>
<item>rem</item>
<item>round</item>
<item>sign</item>
<item>sin</item>
<item>sqrt</item>
<item>tan</item>
<!-- https://developer.mozilla.org/en-US/docs/Web/CSS/gradient#formal_syntax -->
<item>linear-gradient</item>
<item>radial-gradient</item>
<item>repeating-linear-gradient</item>
<item>repeating-radial-gradient</item>
<!-- https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#formal_syntax -->
<item>rgb</item>
<item>rgba</item>
<item>var</item>
<item>url</item>
<item>hsl</item>
<item>hsla</item>
<item>hwb</item>
<item>lab</item>
<item>lch</item>
<item>oklab</item>
<item>oklch</item>
<item>color</item>
<!-- CSS4 -->
<item>min</item>
<item>max</item>
<item>clamp</item>
<item>toggle</item>
<item>hwb</item>
<item>device-cmyk</item>
@@ -1103,6 +1208,8 @@ Changelog:
<!-- counter style -->
<item>symbols</item>
<item>counter</item>
<item>counters</item>
<!-- clip -->
<item>rect</item>
@@ -1128,8 +1235,6 @@ Changelog:
<!-- grid-template-columns and grid-template-rows -->
<item>max-content</item>
<item>min-content</item>
<item>minmax</item>
<item>fix-content</item>
<item>repeat</item>
<!-- transition and animation -->
@@ -1215,19 +1320,22 @@ Changelog:
<!-- prefixed by :: -->
<list name="pseudoelements">
<item>after</item>
<item>backdrop</item>
<item>before</item>
<item>cue</item>
<item>file-selector-button</item>
<item>first-letter</item>
<item>first-line</item>
<item>marker</item>
<item>part</item>
<item>placeholder</item>
<item>selection</item>
<item>slotted</item>
<!-- experimental -->
<item>backdrop</item>
<item>placeholder</item>
<!-- <item>marker</item> -->
<item>slotted</item>
<!-- <item>spelling-error</item> -->
<!-- <item>grammar-error</item> -->
<!-- <item>target-text</item> -->
<!-- UI pseudo-classes -->
<item>value</item>
@@ -1253,8 +1361,14 @@ Changelog:
<!-- prefixed by : -->
<list name="pseudoclasses">
<item>future</item>
<item>local-link</item>
<item>modal</item>
<item>picture-in-picture</item>
<item>active</item>
<item>any-link</item>
<item>autofill</item>
<item>checked</item>
<item>default</item>
<item>defined</item>
@@ -1264,9 +1378,10 @@ Changelog:
<item>enabled</item>
<item>first-child</item>
<item>first-of-type</item>
<item>fullscreen</item>
<item>focus</item>
<item>focus-visible</item>
<item>focus-within</item>
<item>fullscreen</item>
<item>host</item>
<item>hover</item>
<item>in-range</item>
@@ -1305,8 +1420,13 @@ Changelog:
</list>
<list name="pseudoclass-selector">
<item>not</item>
<item>has</item>
<item>host</item>
<item>host-context</item>
<item>is</item>
<item>matches</item>
<item>not</item>
<item>where</item>
</list>
<list name="pseudoclasses-@page">
@@ -1320,19 +1440,26 @@ Changelog:
<list name="at-rules">
<item>@character</item>
<item>@layer</item>
<item>@container</item>
<item>@charset</item>
<item>@import</item>
<item>@namespace</item>
</list>
<list name="nested at-rules">
<item>@font-feature-values</item>
<item>@document</item>
<item>@media</item>
<item>@supports</item>
</list>
<list name="@viewport">
<list name="other at-rules">
<item>@counter-style</item>
<item>@viewport</item>
<item>@page</item>
<item>@font-face</item>
<item>@keyframes</item>
</list>
<list name="within-@viewport">
@@ -1350,20 +1477,12 @@ Changelog:
<item>viewport-fit</item>
</list>
<list name="@page">
<item>@page</item>
</list>
<list name="within-@page">
<item>size</item>
<item>marks</item>
<item>bleed</item>
</list>
<list name="@font-face">
<item>@font-face</item>
</list>
<list name="within-@font-face">
<item>font-display</item>
<item>font-family</item>
@@ -1377,10 +1496,6 @@ Changelog:
<item>unicode-range</item>
</list>
<list name="@keyframes">
<item>@keyframes</item>
</list>
<list name="within-@keyframes">
<item>from</item>
<item>to</item>
@@ -1398,19 +1513,12 @@ Changelog:
<IncludeRules context="FindComments" />
<DetectChar attribute="Normal Text" context="RuleSet" char="{" beginRegion="ruleset" />
<DetectChar attribute="At Rule" context="SelectAtRule" char="@" lookAhead="true" />
<!-- find selectors // .class #id :hover :nth-child(2n+1) [type="search"] -->
<DetectChar attribute="Selector Pseudo" context="SelectorPseudo" char=":" />
<DetectChar attribute="Selector Attribute" context="SelectorAttr" char="[" />
<DetectChar attribute="Separator Symbol" context="#stay" char="," />
<AnyChar attribute="Operator" context="#stay" String="*>+~|" />
<RegExpr attribute="Selector Id" context="#stay" String="#[-]?(&nmstart;)(&nmchar;)*" />
<RegExpr attribute="Selector Class" context="#stay" String="\.([a-zA-Z0-9\-_]|[\x80-\xFF]|\\[0-9A-Fa-f]{1,6})*" />
<RegExpr attribute="Selector Tag" context="#stay" String="[-]?(&nmstart;)(&nmchar;)*" />
<IncludeRules context="FindSelector" />
</context>
<!-- find selectors // .class #id :hover :nth-child(2n+1) [type="search"] -->
<context name="FindSelector" attribute="Normal Text" lineEndContext="#stay">
<IncludeRules context="FindComments" />
<!-- find selectors // .class #id :hover :nth-child(2n+1) [type="search"] -->
<DetectChar attribute="Selector Pseudo" context="SelectorPseudo" char=":" />
<DetectChar attribute="Selector Attribute" context="SelectorAttr" char="[" />
<DetectChar attribute="Separator Symbol" context="#stay" char="," />
<AnyChar attribute="Operator" context="#stay" String="*>+~|" />
@@ -1441,7 +1549,8 @@ Changelog:
<context name="FindUnits" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
<!-- https://drafts.csswg.org/css-values-4/#lengths -->
<RegExpr attribute="Unit" context="#stay" String="(%|(em|ex|cap|ch|ic|rem|lh|rlh|vw|vh|vi|vb|vmin|vmax|cm|mm|Q|in|pc|pt|px|deg|rad|grad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx|x)\b)(?![-+])" />
<!-- https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units -->
<RegExpr attribute="Unit" context="#stay" String="(%|(em|ex|cap|ch|ic|rem|lh|rlh|vw|vh|vi|vb|vmin|vmax|cm|mm|Q|in|pc|pt|px|deg|rad|grad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx|x|fr)\b)(?![-+])" />
</context>
<!-- find strings // "some words" 'some words' -->
@@ -1469,10 +1578,10 @@ Changelog:
<context name="SelectAtRule" attribute="At Rule" lineEndContext="#pop">
<keyword attribute="At Rule" context="#pop!NestedAtRule" String="nested at-rules" />
<keyword attribute="At Rule" context="#pop!AtRule" String="at-rules" />
<keyword attribute="At Rule" context="#pop!@keyframes" String="@keyframes" />
<keyword attribute="At Rule" context="#pop!@viewport" String="@viewport" />
<keyword attribute="At Rule" context="#pop!@font-face" String="@font-face" />
<keyword attribute="At Rule" context="#pop!@page" String="@page" />
<WordDetect attribute="At Rule" context="#pop!@keyframes" String="@keyframes" />
<WordDetect attribute="At Rule" context="#pop!@viewport" String="@viewport" />
<WordDetect attribute="At Rule" context="#pop!@font-face" String="@font-face" />
<WordDetect attribute="At Rule" context="#pop!@page" String="@page" />
<RegExpr attribute="At Rule" context="#pop!UnknownAtRule" String="@[a-zA-Z0-9\-_]+\b" />
</context>
@@ -1614,6 +1723,7 @@ Changelog:
<DetectSpaces />
<DetectChar attribute="Selector Pseudo" context="#pop#pop#pop" char=")" />
<DetectChar attribute="Error" context="#pop#pop#pop!RuleSet" char="{" beginRegion="ruleset" />
<IncludeRules context="FindComments" />
<IncludeRules context="FindSelector" />
</context>
@@ -1639,8 +1749,6 @@ Changelog:
<RegExpr attribute="Property" context="Rule" String="[A-Za-z_-]+(?=\s*:)" lookAhead="true" />
<IncludeRules context="Base" />
<RegExpr attribute="Normal Text" context="#stay" String="[A-Za-z_-]+" />
<!-- auto-completion only, includes by previous rule -->
<keyword attribute="Normal Text" context="#stay" String="properties" />
</context>
<context name="Rule" attribute="Normal Text" lineEndContext="#stay">
@@ -1665,8 +1773,6 @@ Changelog:
<DetectChar attribute="Separator Symbol" context="#pop#pop" char=";" />
<DetectChar attribute="Separator Symbol" context="#stay" char="," />
<DetectChar attribute="Normal Text" context="#pop#pop#pop" char="}" endRegion="ruleset" />
<!-- auto-completion only -->
<keyword attribute="Normal Text" context="#stay" String="functions" />
</context>
<context name="Function" attribute="Normal Text" lineEndContext="#stay">
@@ -1703,8 +1809,6 @@ Changelog:
<IncludeRules context="FindFunctions" />
<IncludeRules context="FindValues" />
<RegExpr attribute="Operator" context="#stay" String="[-](?=$|[ \t(,;])|[+](?=$|[^0-9)])|[/*]" />
<!-- auto-completion only -->
<keyword attribute="Normal Text" context="#stay" String="functions" />
</context>
<context name="FunctionUrl" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="UrlValue">

View File

@@ -5,7 +5,7 @@
<!ENTITY attributeName "[A-Za-z_:*#\(\[][\)\]\w.:_-]*">
<!ENTITY entref "&amp;(?:#[0-9]+|#[xX][0-9A-Fa-f]+|&name;);">
]>
<language name="HTML" version="14" 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="15" kateversion="5.53" section="Markup" extensions="*.htm;*.html;*.shtml;*.shtm;*.aspx" mimetype="text/html" author="Wilbert Berendsen (wilbert@kde.nl)" license="LGPL" priority="10">
<highlighting>
<contexts>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<language name="INI Files" section="Configuration" extensions="*.ini;*.pls;*.kcfgc" mimetype="" version="10" kateversion="5.0" author="Jan Janssen (medhefgo@web.de)" license="LGPL">
<language name="INI Files" section="Configuration" extensions="*.ini;*.pls;*.kcfgc;.gitattributes*;.gitconfig*;.gitmodules*;.editorconfig*" mimetype="" version="12" kateversion="5.0" author="Jan Janssen (medhefgo@web.de)" license="LGPL">
<highlighting>
<list name="keywords">
@@ -65,14 +65,14 @@
<itemDatas>
<itemData name="Normal Text" defStyleNum="dsDataType" />
<itemData name="Section" defStyleNum="dsKeyword" />
<itemData name="Comment" defStyleNum="dsComment" />
<itemData name="Assignment" defStyleNum="dsOthers" />
<itemData name="Value" defStyleNum="dsString" />
<itemData name="Float" defStyleNum="dsFloat" />
<itemData name="Int" defStyleNum="dsDecVal" />
<itemData name="Keyword" defStyleNum="dsKeyword" />
<itemData name="Normal Text" defStyleNum="dsDataType" spellChecking="false"/>
<itemData name="Section" defStyleNum="dsKeyword" spellChecking="false"/>
<itemData name="Comment" defStyleNum="dsComment"/>
<itemData name="Assignment" defStyleNum="dsOthers" spellChecking="false"/>
<itemData name="Value" defStyleNum="dsString" spellChecking="false"/>
<itemData name="Float" defStyleNum="dsFloat" spellChecking="false"/>
<itemData name="Int" defStyleNum="dsDecVal" spellChecking="false"/>
<itemData name="Keyword" defStyleNum="dsKeyword" spellChecking="false"/>
</itemDatas>
</highlighting>

View File

@@ -7,7 +7,7 @@
<!ENTITY float "(\b&int;(\.((&int;&exp;?+|&exp;)[fFdD]?\b|[fFdD]\b)?|&exp;[fFdD]?\b|[fFdD]\b)|\.&int;&exp;?[fFdD]?\b)">
<!ENTITY hexfloat "\b0[xX](&hex;\.?+&hex;?+|\.&hex;?)[pP][-+]?&int;[fFdD]?\b">
]>
<language name="Java" version="10" kateversion="5.62" section="Sources" extensions="*.java" mimetype="text/x-java" license="LGPL" author="Alfredo Luiz Foltran Fialho (alfoltran@ig.com.br)">
<language name="Java" version="11" kateversion="5.62" section="Sources" extensions="*.java" mimetype="text/x-java" license="LGPL" author="Alfredo Luiz Foltran Fialho (alfoltran@ig.com.br)">
<highlighting>
<list name="java15">
<item>ACTIVE</item>
@@ -3909,7 +3909,7 @@
</highlighting>
<general>
<comments>
<comment name="singleLine" start="//"/>
<comment name="singleLine" start="//" position="afterwhitespace"/>
<comment name="multiLine" start="/*" end="*/" region="Comment"/>
</comments>
<keywords casesensitive="1"/>

View File

@@ -10,9 +10,10 @@
**
** The application/json Media Type for JavaScript Object Notation (JSON)
** http://tools.ietf.org/html/rfc4627
** https://www.json.org/json-en.html
***************************************************************************
-->
<language name="JSON" section="Markup" version="6" kateversion="2.4" extensions="*.json;.kateproject;.arcconfig;*.geojson;*.gltf;*.theme" mimetype="application/json" author="Sebastian Pipping (sebastian@pipping.org)" license="GPL">
<language name="JSON" section="Markup" version="7" kateversion="2.4" extensions="*.json;.kateproject;.arcconfig;*.geojson;*.gltf;*.theme" mimetype="application/json" author="Sebastian Pipping (sebastian@pipping.org)" license="GPL">
<highlighting>
<list name="Constants">
<item>null</item>
@@ -39,42 +40,37 @@
<context name="String_Key" lineEndContext="#stay" attribute="Style_String_Key">
<DetectChar char="&quot;" context="#pop" attribute="Style_String_Key" />
<RegExpr String="\\(?:[&quot;\\/bfnrt]|u[0-9a-fA-f]{4})" context="#stay" insensitive="false" minimal="false" attribute="Style_String_Key_Char" />
<RegExpr String="\\(?:[&quot;\\/bfnrt]|u[0-9a-fA-f]{4})" context="#stay" attribute="Style_String_Key_Char" />
</context>
<context name="Value" lineEndContext="#stay" attribute="Style_Error" >
<AnyChar String="}," context="#pop" lookAhead="true" />
<IncludeRules context="JsonValue"/>
</context>
<context name="JsonValue" lineEndContext="#stay" attribute="Style_Error" >
<DetectChar char="&quot;" context="String_Value" attribute="Style_String_Value" />
<DetectChar char="{" context="Pair" beginRegion="Region_Object" attribute="Style_Seperator_Pair" />
<DetectChar char="[" context="Array" beginRegion="Region_Array" attribute="Style_Seperator_Array" />
<AnyChar String="}," context="#pop" lookAhead="true" />
<DetectSpaces context="#stay" attribute="Style_Normal" />
<keyword String="Constants" context="#stay" attribute="Style_Keyword" />
<RegExpr String="-?(?:[0-9]|[1-9][0-9]+)\.[0-9]+(?:[eE][+-]?[0-9]+)?" context="#stay" insensitive="false" minimal="false" attribute="Style_Float" />
<RegExpr String="-?(?:[0-9]|[1-9][0-9]+)(?:[eE][+-]?[0-9]+)?" context="#stay" insensitive="false" minimal="false" attribute="Style_Decimal" />
<RegExpr String="-?[0-9]+\.[0-9]+(?:[eE][+-]?[0-9]+)?" context="#stay" attribute="Style_Float" />
<RegExpr String="-?[0-9]+(?:[eE][+-]?[0-9]+)?" context="#stay" attribute="Style_Decimal" />
</context>
<context name="String_Value" lineEndContext="#stay" attribute="Style_String_Value">
<DetectChar char="&quot;" context="#pop" attribute="Style_String_Value" />
<RegExpr String="\\(?:[&quot;\\/bfnrt]|u[0-9a-fA-f]{4})" context="#stay" insensitive="false" minimal="false" attribute="Style_String_Value_Char" />
<RegExpr String="\\(?:[&quot;\\/bfnrt]|u[0-9a-fA-f]{4})" context="#stay" attribute="Style_String_Value_Char" />
</context>
<context name="Array" lineEndContext="#stay" attribute="Style_Error">
<DetectChar char="," context="#stay" attribute="Style_Seperator_Array" />
<DetectChar char="]" context="#pop" endRegion="Region_Array" attribute="Style_Seperator_Array" />
<DetectChar char="{" context="Pair" beginRegion="Region_Object" attribute="Style_Seperator_Pair" />
<DetectChar char="[" context="Array" beginRegion="Region_Array" attribute="Style_Seperator_Array" />
<DetectChar char="&quot;" context="String_Value" attribute="Style_String_Value" />
<DetectSpaces context="#stay" attribute="Style_Normal" />
<keyword String="Constants" context="#stay" attribute="Style_Keyword" />
<RegExpr String="-?(?:[0-9]|[1-9][0-9]+)\.[0-9]+(?:[eE][+-]?[0-9]+)?" context="#stay" insensitive="false" minimal="false" attribute="Style_Float" />
<RegExpr String="-?(?:[0-9]|[1-9][0-9]+)(?:[eE][+-]?[0-9]+)?" context="#stay" insensitive="false" minimal="false" attribute="Style_Decimal" />
<IncludeRules context="JsonValue"/>
</context>
</contexts>

View File

@@ -90,7 +90,7 @@
<!ENTITY checkbox "\[[ x]\](?=\s)">
]>
<language name="Markdown" version="21" kateversion="5.79" section="Markup" extensions="*.md;*.mmd;*.markdown" priority="15" author="Darrin Yeager, Claes Holmerson" license="GPL,BSD">
<language name="Markdown" version="24" kateversion="5.79" section="Markup" extensions="*.md;*.mmd;*.markdown" priority="15" author="Darrin Yeager, Claes Holmerson" license="GPL,BSD">
<highlighting>
<contexts>
<!-- Start of the Markdown document: find metadata or code block -->
@@ -149,40 +149,39 @@
</context>
<context name="find-header" attribute="Normal Text" lineEndContext="#pop">
<RegExpr attribute="Header H1" context="#pop!close-H2-region" String="^(#\s.*[#]?)$" column="0" endRegion="H1" beginRegion="H1" lookAhead="true"/>
<RegExpr attribute="Header H2" context="#pop!close-H3-region" String="^(##\s.*[#]?)$" column="0" endRegion="H2" beginRegion="H2" lookAhead="true"/>
<RegExpr attribute="Header H3" context="#pop!close-H4-region" String="^(###\s.*[#]?)$" column="0" endRegion="H3" beginRegion="H3" lookAhead="true"/>
<RegExpr attribute="Header H4" context="#pop!close-H5-region" String="^(####\s.*[#]?)$" column="0" endRegion="H4" beginRegion="H4" lookAhead="true"/>
<RegExpr attribute="Header H5" context="#pop!close-H6-region" String="^(#####\s.*[#]?)$" column="0" endRegion="H5" beginRegion="H5" lookAhead="true"/>
<RegExpr attribute="Header H6" context="#pop!close-sentinel-region" String="^(######\s.*[#]?)$" column="0" endRegion="H6" beginRegion="H6" lookAhead="true"/>
<RegExpr attribute="Header H1" context="#pop!close-H2-region" String="^#\s" column="0" endRegion="H1" beginRegion="H1" lookAhead="true"/>
<RegExpr attribute="Header H2" context="#pop!close-H3-region" String="^##\s" column="0" endRegion="H2" beginRegion="H2" lookAhead="true"/>
<RegExpr attribute="Header H3" context="#pop!close-H4-region" String="^###\s" column="0" endRegion="H3" beginRegion="H3" lookAhead="true"/>
<RegExpr attribute="Header H4" context="#pop!close-H5-region" String="^####\s" column="0" endRegion="H4" beginRegion="H4" lookAhead="true"/>
<RegExpr attribute="Header H5" context="#pop!close-H6-region" String="^#####\s" column="0" endRegion="H5" beginRegion="H5" lookAhead="true"/>
<RegExpr attribute="Header H6" context="#pop" String="^######\s.*" column="0" endRegion="H6" beginRegion="H6"/>
<DetectChar attribute="Normal Text" context="#pop" char="#"/>
</context>
<!-- BUG: 441278 sub-headers should be closed when their parent header is closed (e.g. in h1 h2 h3 h1, h1-h3 should all be closed at the 2nd h1) -->
<!-- TODO: Port to a less hacky version (maybe a new attribute for declaring multiple endRegions) -->
<context name="close-H2-region" attribute="Header H2" lineEndContext="#pop!close-H3-region" fallthroughContext="#pop!close-H3-region">
<RegExpr attribute="Header H2" context="#pop!close-H3-region" String="(%1)" dynamic="true" lookAhead="true" endRegion="H2"/>
<DetectChar attribute="Header H2" context="#pop!close-H3-region" char="#" lookAhead="true" endRegion="H2"/>
</context>
<context name="close-H3-region" attribute="Header H3" lineEndContext="#pop!close-H4-region" fallthroughContext="#pop!close-H4-region">
<RegExpr attribute="Header H3" context="#pop!close-H4-region" String="(%1)" dynamic="true" lookAhead="true" endRegion="H3"/>
<DetectChar attribute="Header H3" context="#pop!close-H4-region" char="#" lookAhead="true" endRegion="H3"/>
</context>
<context name="close-H4-region" attribute="Header H4" lineEndContext="#pop!close-H5-region" fallthroughContext="#pop!close-H5-region">
<RegExpr attribute="Header H4" context="#pop!close-H5-region" String="(%1)" dynamic="true" lookAhead="true" endRegion="H4"/>
<DetectChar attribute="Header H4" context="#pop!close-H5-region" char="#" lookAhead="true" endRegion="H4"/>
</context>
<context name="close-H5-region" attribute="Header H5" lineEndContext="#pop!close-H6-region" fallthroughContext="#pop!close-H6-region">
<RegExpr attribute="Header H5" context="#pop!close-H6-region" String="(%1)" dynamic="true" lookAhead="true" endRegion="H5"/>
<DetectChar attribute="Header H5" context="#pop!close-H6-region" char="#" lookAhead="true" endRegion="H5"/>
</context>
<context name="close-H6-region" attribute="Header H6" lineEndContext="#pop" fallthroughContext="#pop">
<RegExpr attribute="Header H6" context="#pop!close-sentinel-region" String="(%1)" dynamic="true" lookAhead="true" endRegion="H6"/>
<DetectChar attribute="Header H6" context="#pop!close-sentinel-region" char="#" lookAhead="true" endRegion="H6"/>
</context>
<!-- This sentinel does not close any actual region, it's just here so that the proper attribute/highlighting is applied and -->
<!--to ensure that H6 headers won't be set as the "primary" region that was closed just because it was closed last -->
<context name="close-sentinel-region" attribute="Normal Text" lineEndContext="#pop" fallthroughContext="#pop">
<RegExpr attribute="Header H1" context="#pop" String="^(?=#\s)%1$" column="0" dynamic="true"/>
<RegExpr attribute="Header H2" context="#pop" String="^(?=##\s)%1$" column="0" dynamic="true"/>
<RegExpr attribute="Header H3" context="#pop" String="^(?=###\s)%1$" column="0" dynamic="true"/>
<RegExpr attribute="Header H4" context="#pop" String="^(?=####\s)%1$" column="0" dynamic="true"/>
<RegExpr attribute="Header H5" context="#pop" String="^(?=#####\s)%1$" column="0" dynamic="true"/>
<RegExpr attribute="Header H6" context="#pop" String="^(?=######\s)%1$" column="0" dynamic="true"/>
<RegExpr attribute="Header H1" context="#pop" String="^#\s.*" column="0"/>
<RegExpr attribute="Header H2" context="#pop" String="^##\s.*" column="0"/>
<RegExpr attribute="Header H3" context="#pop" String="^###\s.*" column="0"/>
<RegExpr attribute="Header H4" context="#pop" String="^####\s.*" column="0"/>
<RegExpr attribute="Header H5" context="#pop" String="^#####\s.*" column="0"/>
</context>
@@ -314,7 +313,8 @@
<context name="find-lang-fenced-code" attribute="Normal Text" lineEndContext="#pop">
<!-- Apply syntax highlighting to fenced code blocks for some languages -->
<RegExpr attribute="Fenced Code" context="#pop!code" String="&fcode;&end;"/>
<RegExpr attribute="Fenced Code" context="#pop!bash-code" String="&fcode;\s*(?:bash(?:rc|_profile|_login|_logout)?|shell|sh|zsh|profile|PKGBUILD|APKBUILD|ebuild|eclass|nix)&end;" insensitive="true"/>
<RegExpr attribute="Fenced Code" context="#pop!bash-code" String="&fcode;\s*(?:bash(?:rc|_profile|_login|_logout)?|shell|sh|profile|PKGBUILD|APKBUILD|ebuild|eclass|nix)&end;" insensitive="true"/>
<RegExpr attribute="Fenced Code" context="#pop!zsh-code" String="&fcode;\s*(?:zsh)&end;" insensitive="true"/>
<RegExpr attribute="Fenced Code" context="#pop!cpp-code" String="&fcode;\s*(?:[ch]pp|[ch]\+\+|[ch]xx|h?cc|hh|cuh?|ino|pde|moc)&end;" insensitive="true"/>
<RegExpr attribute="Fenced Code" context="#pop!csharp-code" String="&fcode;\s*(?:cs|csharp|c\#)&end;" insensitive="true"/>
<RegExpr attribute="Fenced Code" context="#pop!cmake-code" String="&fcode;\s*(?:cmake|CMakeLists(?:\.txt)?)&end;" insensitive="true"/>
@@ -344,6 +344,7 @@
<RegExpr attribute="Fenced Code" context="#pop!ruby-code" String="&fcode;\s*(?:ruby|rbx?|rjs|rake|f?cgi|gemspec|irbrc|ru|prawn|Appraisals|(?:Rake|Cap|Chef|Gem|Guard|Hobo|Vagrant||Rant|Berks|Thor|Puppet)file|rxml|(?:xml|js)\.erb)&end;" insensitive="true"/>
<RegExpr attribute="Fenced Code" context="#pop!rust-code" String="&fcode;\s*(?:rust|rs)&end;" insensitive="true"/>
<RegExpr attribute="Fenced Code" context="#pop!mysql-code" String="&fcode;\s*(?:mysql|sql|ddl)&end;" insensitive="true"/> <!-- Included in the PHP definition -->
<RegExpr attribute="Fenced Code" context="#pop!nim-code" String="&fcode;\s*(?:nims?)&end;" insensitive="true"/>
<RegExpr attribute="Fenced Code" context="#pop!typescript-code" String="&fcode;\s*(?:typescript|ts)&end;" insensitive="true"/>
<RegExpr attribute="Fenced Code" context="#pop!xml-code" String="&fcode;\s*(?:xml|xsd|xspf|tld|jsp|c?pt|dtml|rss|opml|svg|daml|rdf|ui|kcfg|qrc|wsdl|scxml|xbel|dae|sch|brd|docbook)&end;" insensitive="true"/>
<RegExpr attribute="Fenced Code" context="#pop!code" String="&fcode;.*$"/>
@@ -355,6 +356,10 @@
<IncludeRules context="code"/>
<IncludeRules context="##Bash" includeAttrib="true"/>
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="zsh-code" fallthroughContext="Command##Zsh">
<IncludeRules context="code"/>
<IncludeRules context="##Zsh" includeAttrib="true"/>
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="cmake-code">
<IncludeRules context="code"/>
<IncludeRules context="##CMake" includeAttrib="true"/>
@@ -471,6 +476,10 @@
<IncludeRules context="code"/>
<IncludeRules context="##SQL (MySQL)" includeAttrib="true"/>
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="nim-code">
<IncludeRules context="code"/>
<IncludeRules context="##Nim" includeAttrib="true"/>
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="typescript-code">
<IncludeRules context="code"/>
<IncludeRules context="Normal##TypeScript" includeAttrib="true"/>

View File

@@ -39,7 +39,7 @@
Enhance tr/// and y/// support.
-->
<language name="Perl" version="18" kateversion="5.0" 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="19" kateversion="5.0" section="Scripts" extensions="*.pl;*.PL;*.pm" mimetype="application/x-perl;text/x-perl" priority="5" author="Anders Lund (anders@alweb.dk)" license="LGPLv2">
<highlighting>
<list name="keywords">
<item>if</item>
@@ -829,23 +829,23 @@
</contexts>
<itemDatas>
<itemData name="Normal Text" defStyleNum="dsNormal" />
<itemData name="Keyword" defStyleNum="dsKeyword" />
<itemData name="Pragma" defStyleNum="dsKeyword" />
<itemData name="Function" defStyleNum="dsFunction" />
<itemData name="Operator" defStyleNum="dsOthers" bold="1" /> <!-- #008000 -->
<itemData name="Data Type" defStyleNum="dsDataType" />
<itemData name="Keyword" defStyleNum="dsKeyword" spellChecking="false"/>
<itemData name="Pragma" defStyleNum="dsKeyword" spellChecking="false"/>
<itemData name="Function" defStyleNum="dsFunction" spellChecking="false"/>
<itemData name="Operator" defStyleNum="dsOthers" bold="1" spellChecking="false"/> <!-- #008000 -->
<itemData name="Data Type" defStyleNum="dsDataType" spellChecking="false"/>
<itemData name="Special Variable" defStyleNum="dsWarning" bold="0" italic="0" /> <!-- #C00000 -->
<itemData name="Decimal" defStyleNum="dsDecVal" />
<itemData name="Octal" defStyleNum="dsBaseN" />
<itemData name="Hex" defStyleNum="dsBaseN" />
<itemData name="Bin" defStyleNum="dsBaseN" />
<itemData name="Float" defStyleNum="dsFloat" />
<itemData name="Decimal" defStyleNum="dsDecVal" spellChecking="false"/>
<itemData name="Octal" defStyleNum="dsBaseN" spellChecking="false"/>
<itemData name="Hex" defStyleNum="dsBaseN" spellChecking="false"/>
<itemData name="Bin" defStyleNum="dsBaseN" spellChecking="false"/>
<itemData name="Float" defStyleNum="dsFloat" spellChecking="false"/>
<itemData name="String" defStyleNum="dsSpecialString" /> <!-- #FF6C6C -->
<itemData name="String (interpolated)" defStyleNum="dsString" />
<itemData name="String Special Character" defStyleNum="dsChar" />
<itemData name="Pattern" defStyleNum="dsOthers" />
<itemData name="Pattern Internal Operator" defStyleNum="dsChar" />
<itemData name="Pattern Character Class" defStyleNum="dsBaseN" />
<itemData name="Pattern" defStyleNum="dsOthers" spellChecking="false"/>
<itemData name="Pattern Internal Operator" defStyleNum="dsChar" spellChecking="false"/>
<itemData name="Pattern Character Class" defStyleNum="dsBaseN" spellChecking="false"/>
<itemData name="Data" defStyleNum="dsNormal" />
<itemData name="Comment" defStyleNum="dsComment" />
<itemData name="Pod" defStyleNum="dsComment" />

View File

@@ -1,7 +1,7 @@
<!DOCTYPE language SYSTEM "language.dtd">
<language
name="PowerShell"
version="11"
version="13"
kateversion="5.0"
extensions="*.ps1;*.psm1;*.psd1"
section="Scripts"
@@ -879,6 +879,7 @@
<keyword attribute="Data Type" context="#stay" String="types" />
<IncludeRules context="Cmdlet" />
<DetectChar attribute="String" context="String" char="&quot;"/>
<DetectChar attribute="String" context="StringQ" char="'"/>
<Detect2Chars attribute="HereString" context="HereStringer" char="@" char1="&quot;" beginRegion="StringRegion"/>
<DetectChar attribute="Comment" context="Commentar 1" char="#"/>
<Detect2Chars attribute="Comment" context="Commentar 2" char="&lt;" char1="#" beginRegion="CommentRegion"/>
@@ -891,13 +892,24 @@
<AnyChar attribute="Symbol" context="#stay" String=":!%&amp;()+,-/*&lt;=&gt;?[]|~^&#59;"/>
</context>
<context attribute="String Char" lineEndContext="#stay" name="StringEscape">
<RegExpr attribute="String Char" String="`[`&quot;0abefnrtv]|`u\{[0-9A-Fa-f]+\}" context="#stay"/>
<RegExpr attribute="String Char" String="`[`&quot;0abefnrtv\$]|`u\{[0-9A-Fa-f]+\}" context="#stay"/>
</context>
<context attribute="String" lineEndContext="#pop" name="String">
<IncludeRules context="StringEscape"/>
<Detect2Chars attribute="Variable Substitution" context="#stay" char="$" char1="_" />
<Detect2Chars attribute="Variable Substitution" context="VarSubst" char="$" char1="{" />
<LineContinue attribute="String" context="#pop"/>
<DetectChar attribute="String" context="#pop" char="&quot;"/>
</context>
<context attribute="String" lineEndContext="#pop" name="StringQ">
<IncludeRules context="StringEscape"/>
<LineContinue attribute="String" context="#pop"/>
<DetectChar attribute="String" context="#pop" char="'"/>
</context>
<context attribute="Variable Substitution" lineEndContext="#pop" name="VarSubst">
<DetectIdentifier />
<DetectChar attribute="Variable Substitution" context="#pop" char="}" />
</context>
<context attribute="HereString" lineEndContext="#stay" name="HereStringer">
<Detect2Chars attribute="HereString" context="#pop" char="&quot;" char1="@" endRegion="StringRegion"/>
</context>
@@ -913,23 +925,23 @@
<Detect2Chars attribute="Comment" context="#pop" char="#" char1="&gt;" endRegion="CommentRegion"/>
<IncludeRules context="##Comments"/>
</context>
<context attribute="Cmdlets" lineEndContext="#stay" name="Cmdlet">
<context attribute="Normal Text" lineEndContext="#stay" name="Cmdlet">
<keyword attribute="Function" context="#stay" String="cmdlets"/>
</context>
</contexts>
<itemDatas>
<itemData name="Normal Text" defStyleNum="dsNormal" spellChecking="false"/>
<itemData name="Keyword" defStyleNum="dsKeyword" spellChecking="false"/>
<itemData name="Function" defStyleNum="dsFunction" spellChecking="false"/>
<itemData name="Data Type" defStyleNum="dsDataType" spellChecking="false"/>
<itemData name="String" defStyleNum="dsString"/>
<itemData name="String Char" defStyleNum="dsChar" spellChecking="false"/>
<itemData name="HereString" defStyleNum="dsVerbatimString"/>
<itemData name="Comment" defStyleNum="dsComment"/>
<itemData name="Cmdlets" defStyleNum="dsBuiltIn" spellChecking="false"/>
<itemData name="Symbol" defStyleNum="dsOperator" spellChecking="false"/>
<itemData name="Variable" defStyleNum="dsVariable" spellChecking="false"/>
<itemData name="Special Variable" defStyleNum="dsVariable" bold="1" spellChecking="false"/>
<itemData name="Normal Text" defStyleNum="dsNormal" spellChecking="false"/>
<itemData name="Keyword" defStyleNum="dsKeyword" spellChecking="false"/>
<itemData name="Function" defStyleNum="dsFunction" spellChecking="false"/>
<itemData name="Data Type" defStyleNum="dsDataType" spellChecking="false"/>
<itemData name="String" defStyleNum="dsString"/>
<itemData name="String Char" defStyleNum="dsChar" spellChecking="false"/>
<itemData name="HereString" defStyleNum="dsVerbatimString"/>
<itemData name="Comment" defStyleNum="dsComment"/>
<itemData name="Symbol" defStyleNum="dsOperator" spellChecking="false"/>
<itemData name="Variable" defStyleNum="dsVariable" spellChecking="false"/>
<itemData name="Special Variable" defStyleNum="dsVariable" spellChecking="false" bold="1"/>
<itemData name="Variable Substitution" defStyleNum="dsString" spellChecking="false" />
</itemDatas>
</highlighting>
<general>

View File

@@ -52,7 +52,7 @@
<!-- v2.07 add support for %prog and co, see bug 142832 -->
<!-- v2.08 add missing overloaders, new Python 3 statements, builtins, and keywords -->
<!-- v2.29 recognize escape sequenzes correctly -->
<language name="Python" version="23" 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="">
<language name="Python" version="26" style="python" indenter="python" kateversion="5.0" section="Scripts" extensions="*.py;*.pyw;*.pyi;SConstruct;SConscript;*.FCMacro" mimetype="application/x-python;text/x-python;text/x-python3" casesensitive="1" author="Michael Bueker" license="">
<highlighting>
<list name="import">
<item>import</item>
@@ -106,9 +106,12 @@
<item>case</item>
</list>
<list name="builtinfuncs">
<!-- https://docs.python.org/3.11/library/functions.html#built-in-funcs -->
<item>__import__</item>
<item>abs</item>
<item>aiter</item>
<item>all</item>
<item>anext</item>
<item>any</item>
<item>apply</item>
<item>ascii</item>
@@ -201,6 +204,7 @@
<item>__debug__</item>
<item>__file__</item>
<item>__name__</item>
<item>__qualname__</item>
</list>
<list name="bindings">
<item>SIGNAL</item>
@@ -208,6 +212,7 @@
<item>connect</item>
</list>
<list name="overloaders">
<!-- https://docs.python.org/3.10/reference/datamodel.html#special-method-names -->
<item>__new__</item>
<item>__init__</item>
<item>__del__</item>
@@ -222,6 +227,7 @@
<item>__cmp__</item>
<item>__rcmp__</item>
<item>__hash__</item>
<item>__bool__</item>
<item>__nonzero__</item>
<item>__unicode__</item>
<item>__getattr__</item>
@@ -233,9 +239,11 @@
<item>__delete__</item>
<item>__call__</item>
<item>__len__</item>
<item>__length_hint__</item>
<item>__getitem__</item>
<item>__setitem__</item>
<item>__delitem__</item>
<item>__missing__</item>
<item>__iter__</item>
<item>__reversed__</item>
<item>__contains__</item>
@@ -245,6 +253,7 @@
<item>__add__</item>
<item>__sub__</item>
<item>__mul__</item>
<item>__matmul__</item>
<item>__floordiv__</item>
<item>__mod__</item>
<item>__divmod__</item>
@@ -259,6 +268,7 @@
<item>__radd__</item>
<item>__rsub__</item>
<item>__rmul__</item>
<item>__rmatmul__</item>
<item>__rdiv__</item>
<item>__rtruediv__</item>
<item>__rfloordiv__</item>
@@ -273,6 +283,7 @@
<item>__iadd__</item>
<item>__isub__</item>
<item>__imul__</item>
<item>__imatmul__</item>
<item>__idiv__</item>
<item>__itruediv__</item>
<item>__ifloordiv__</item>
@@ -294,9 +305,14 @@
<item>__oct__</item>
<item>__hex__</item>
<item>__index__</item>
<item>__round__</item>
<item>__trunc__</item>
<item>__floor__</item>
<item>__ceil__</item>
<item>__coerce__</item>
<item>__enter__</item>
<item>__exit__</item>
<item>__match_args__</item>
<item>__bytes__</item>
<item>__format__</item>
<item>__next__</item>
@@ -306,12 +322,19 @@
<item>__anext__</item>
<item>__aenter__</item>
<item>__aexit__</item>
<item>__slots__</item>
<item>__init_subclass__</item>
<item>__set_name__</item>
<item>__prepare__</item>
<item>__instancecheck__</item>
<item>__subclasscheck__</item>
<item>__class_getitem__</item>
</list>
<list name="exceptions">
<!--
Exceptions list resources used:
- http://docs.python.org/2.7/library/exceptions.html#exception-hierarchy
- http://docs.python.org/3.4/library/exceptions.html#exception-hierarchy
- http://docs.python.org/3.10/library/exceptions.html#exception-hierarchy
-->
<item>ArithmeticError</item>
<item>AssertionError</item>
@@ -329,6 +352,7 @@
<item>DeprecationWarning</item>
<item>EnvironmentError</item>
<item>EOFError</item>
<item>EncodingWarning</item>
<item>Exception</item>
<item>FileExistsError</item>
<item>FileNotFoundError</item>
@@ -346,6 +370,7 @@
<item>KeyError</item>
<item>LookupError</item>
<item>MemoryError</item>
<item>ModuleNotFoundError</item>
<item>NameError</item>
<item>NotADirectoryError</item>
<item>NotImplementedError</item>
@@ -354,11 +379,13 @@
<item>PendingDeprecationWarning</item>
<item>PermissionError</item>
<item>ProcessLookupError</item>
<item>RecursionError</item>
<item>ReferenceError</item>
<item>ResourceWarning</item>
<item>RuntimeError</item>
<item>RuntimeWarning</item>
<item>StandardError</item>
<item>StopAsyncIteration</item>
<item>StopIteration</item>
<item>SyntaxError</item>
<item>SyntaxWarning</item>
@@ -408,6 +435,7 @@
<DetectIdentifier attribute="Normal Text"/>
<RegExpr attribute="Decorator" String="@[_a-zA-Z[:^ascii:]][\._a-zA-Z0-9[:^ascii:]]*" firstNonSpace="true"/>
<Detect2Chars attribute="Operator" char=":" char1="=" context="#stay"/>
<AnyChar attribute="Operator" String="+*/%|=;&lt;&gt;!^&amp;~-@" context="#stay"/>
<LineContinue attribute="Operator" context="MultiLineExpr"/>
@@ -543,7 +571,8 @@
<context name="UnfinishedStringError" attribute="Error" lineEndContext="#stay" noIndentationBasedFolding="true">
<!-- A single string/comment reached the end of the line without a \ line escape -->
<!-- We set ALL succeeding lines to the "Error" attribute so that this error is easier to spot -->
<!-- We set the following line (or part of it) to the "Error" attribute so that this error is easier to spot -->
<RegExpr attribute="Error" String="^(\s{4,}|[^[\]()&quot;']{4,}([&quot;'].*)?)" context="#pop" column="0"/>
</context>
<!-- Comments -->
@@ -897,4 +926,4 @@
</general>
</language>
<!-- kate: space-indent off; indent-width 4; -->
<!-- kate: space-indent off; indent-width 2; -->

View File

@@ -31,7 +31,7 @@
<!-- Hold the "language" opening tag on a single line, as mentioned in "language.dtd". -->
<language name="Ruby" section="Scripts"
version="16" kateversion="5.0"
version="17" kateversion="5.0"
extensions="*.rb;*.rjs;*.rxml;*.xml.erb;*.js.erb;*.rake;Rakefile;Gemfile;*.gemspec;Vagrantfile"
mimetype="application/x-ruby"
style="ruby" indenter="ruby"
@@ -183,6 +183,8 @@
<item>extend</item>
<item>include</item>
<item>prepend</item>
<item>refine</item>
<item>using</item>
</list>
<contexts>

View File

@@ -6,7 +6,7 @@
<!ENTITY name "(?![0-9])[\w_:][\w.:_-]*">
<!ENTITY entref "&amp;(?:#[0-9]+|#[xX][0-9A-Fa-f]+|&name;);">
]>
<language name="XML" version="14" kateversion="5.0" 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="18" kateversion="5.0" 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;application/vnd.oasis.opendocument.text-flat-xml;application/vnd.oasis.opendocument.graphics-flat-xml;application/vnd.oasis.opendocument.presentation-flat-xml;application/vnd.oasis.opendocument.spreadsheet-flat-xml;application/gpx+xml" casesensitive="1" indenter="xml" author="Wilbert Berendsen (wilbert@kde.nl)" license="LGPL">
<highlighting>
<contexts>
@@ -33,7 +33,7 @@
<context name="FindPEntityRefs" attribute="Other Text" lineEndContext="#stay">
<RegExpr attribute="EntityRef" context="#stay" String="&entref;" />
<RegExpr attribute="PEntityRef" context="#stay" String="%&name;;" />
<AnyChar attribute="Error" context="#stay" String="&amp;%" />
<AnyChar attribute="Error" context="#stay" String="&amp;%&lt;" />
</context>
@@ -86,6 +86,7 @@
</context>
<context name="Doctype Internal Subset" attribute="Other Text" lineEndContext="#stay">
<DetectSpaces />
<DetectChar attribute="Doctype Symbols" context="#pop" char="]" endRegion="int_subset" />
<RegExpr attribute="Doctype Symbols" context="Doctype Markupdecl TagName" String="&lt;!(?=(ELEMENT|ENTITY|ATTLIST|NOTATION)\b)" />
<StringDetect attribute="Comment" context="Comment" String="&lt;!--" beginRegion="comment" />
@@ -94,7 +95,7 @@
</context>
<context name="Doctype Markupdecl TagName" attribute="Other Text" lineEndContext="#pop">
<StringDetect attribute="Doctype" context="#pop!Doctype Markupdecl VariableName" String="%1" dynamic="true" />
<DetectIdentifier attribute="Doctype" context="#pop!Doctype Markupdecl VariableName" />
</context>
<context name="Doctype Markupdecl VariableName" attribute="Other Text" lineEndContext="#pop!Doctype Markupdecl" fallthrough="true" fallthroughContext="#pop!Doctype Markupdecl">
<DetectSpaces />
@@ -164,7 +165,7 @@
<itemDatas>
<itemData name="Normal Text" defStyleNum="dsNormal" />
<itemData name="Other Text" defStyleNum="dsNormal" />
<itemData name="Comment" defStyleNum="dsComment" spellChecking="false" />
<itemData name="Comment" defStyleNum="dsComment" spellChecking="true" />
<itemData name="CDATA" defStyleNum="dsBaseN" bold="1" italic="0" spellChecking="false" />
<itemData name="CDATA Symbols" defStyleNum="dsBaseN" bold="0" italic="0" spellChecking="false" />
<itemData name="Processing Instruction" defStyleNum="dsFunction" bold="1" italic="0" spellChecking="false" />

View File

@@ -32,7 +32,7 @@ This code is released under the LGPL as part of kdelibs/kate.
========================================================================
-->
<language name="Yacc/Bison" version="9" 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="9" kateversion="5.79" 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>
<contexts>
@@ -112,7 +112,7 @@ This code is released under the LGPL as part of kdelibs/kate.
<IncludeRules context="Symbol-Variable" />
<IncludeRules context="##C++" />
</context>
<context name="Code-Symbols End" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop!Percent Command In">
<context name="Code-Symbols End" attribute="Normal Text" lineEndContext="#stay" fallthroughContext="#pop!Percent Command In">
<IncludeRules context="Comment" />
<DetectSpaces />
<DetectChar attribute="Normal Text" context="#pop" char=";" lookAhead="true" />
@@ -145,7 +145,7 @@ This code is released under the LGPL as part of kdelibs/kate.
</context>
<!-- 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). -->
<context name="Rule End" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop#pop">
<context name="Rule End" attribute="Normal Text" lineEndContext="#stay" fallthroughContext="#pop#pop">
<DetectSpaces />
<DetectChar attribute="Normal Text" context="#stay" char=";" />
<DetectChar attribute="Normal Text" context="#pop" char="|" />
@@ -231,10 +231,10 @@ This code is released under the LGPL as part of kdelibs/kate.
<DetectChar attribute="Directive" context="Dol" char="$" />
<RegExpr attribute="Directive" context="#stay" String="@\$?(?:\d+|[A-Za-z_]\w*)?" />
</context>
<context name="Dol" attribute="Normal Text" fallthrough="true" fallthroughContext="DolEnd" lineEndContext="#stay">
<context name="Dol" attribute="Normal Text" fallthroughContext="DolEnd" lineEndContext="#stay">
<RegExpr attribute="Data Type" context="DolEnd" String="&lt;[^&gt;]+&gt;" />
</context>
<context name="DolEnd" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop#pop">
<context name="DolEnd" attribute="Normal Text" lineEndContext="#stay" fallthroughContext="#pop#pop">
<RegExpr attribute="Directive" context="#pop#pop" String="@?\d+" />
<DetectChar attribute="Directive" context="#pop#pop" char="$" />
<DetectIdentifier attribute="Directive" context="#pop#pop" />

View File

@@ -1,5 +1,23 @@
{
"custom-styles": {
"Diff": {
"Added line": {
"selected-text-color": "#98c379",
"text-color": "#98c379"
},
"Changed line (new)": {
"selected-text-color": "#98c379",
"text-color": "#98c379"
},
"Changed line (old)": {
"selected-text-color": "#e06c75",
"text-color": "#e06c75"
},
"Removed line": {
"selected-text-color": "#e06c75",
"text-color": "#e06c75"
}
},
"Go": {
"Predeclared Identifier": {
"selected-text-color": "#d19a66",
@@ -214,7 +232,7 @@
],
"license": "SPDX-License-Identifier: MIT",
"name": "Atom One Dark",
"revision": 2
"revision": 3
},
"text-styles": {
"Alert": {

View File

@@ -1,5 +1,23 @@
{
"custom-styles": {
"Diff": {
"Added line": {
"selected-text-color": "#98c379",
"text-color": "#98c379"
},
"Changed line (new)": {
"selected-text-color": "#98c379",
"text-color": "#98c379"
},
"Changed line (old)": {
"selected-text-color": "#e06c75",
"text-color": "#e06c75"
},
"Removed line": {
"selected-text-color": "#e06c75",
"text-color": "#e06c75"
}
},
"Go": {
"Predeclared Identifier": {
"selected-text-color": "#986801",
@@ -221,7 +239,7 @@
],
"license": "SPDX-License-Identifier: MIT",
"name": "Atom One Light",
"revision": 3
"revision": 4
},
"text-styles": {
"Alert": {

View File

@@ -6,12 +6,12 @@
#include "ksyntaxhighlighting_version.h"
#include <KSyntaxHighlighting/Definition>
#include <KSyntaxHighlighting/DefinitionDownloader>
#include <KSyntaxHighlighting/Repository>
#include <KSyntaxHighlighting/Theme>
#include <ansihighlighter.h>
#include <definition.h>
#include <definitiondownloader.h>
#include <htmlhighlighter.h>
#include <repository.h>
#include <theme.h>
#include <QCommandLineParser>
#include <QCoreApplication>

View File

@@ -32,7 +32,7 @@ else()
add_executable(katehighlightingindexer katehighlightingindexer.cpp ../lib/worddelimiters.cpp)
ecm_mark_nongui_executable(katehighlightingindexer)
if(Qt5XmlPatterns_FOUND AND NOT ECM_ENABLE_SANITIZERS)
target_link_libraries(katehighlightingindexer Qt::XmlPatterns)
target_link_libraries(katehighlightingindexer Qt5::XmlPatterns)
else()
target_link_libraries(katehighlightingindexer Qt${QT_MAJOR_VERSION}::Core)
endif()

View File

@@ -54,9 +54,10 @@ public:
{
if (xml.isStartElement()) {
if (m_currentContext) {
m_currentContext->rules.append(Context::Rule{});
m_currentContext->rules.push_back(Context::Rule{});
auto &rule = m_currentContext->rules.back();
m_success = rule.parseElement(m_currentDefinition->filename, xml) && m_success;
m_currentContext->hasDynamicRule = m_currentContext->hasDynamicRule || rule.dynamic == XmlBool::True;
} else if (m_currentKeywords) {
m_success = m_currentKeywords->items.parseElement(m_currentDefinition->filename, xml) && m_success;
} else if (xml.name() == QStringLiteral("context")) {
@@ -94,9 +95,9 @@ public:
continue;
}
auto markAsUsedContext = [](ContextName &ContextName) {
if (!ContextName.stay && ContextName.context) {
ContextName.context->isOnlyIncluded = false;
auto markAsUsedContext = [](ContextName &contextName) {
if (!contextName.stay && contextName.context) {
contextName.context->isOnlyIncluded = false;
}
};
@@ -115,6 +116,8 @@ public:
resolveContextName(definition, context, rule.context, rule.line);
if (rule.type != Context::Rule::Type::IncludeRules) {
markAsUsedContext(rule.context);
} else if (rule.includeAttrib == XmlBool::True && rule.context.context) {
rule.context.context->referencedWithIncludeAttrib = true;
}
}
}
@@ -151,8 +154,10 @@ public:
QSet<const Keywords *> referencedKeywords;
QSet<ItemDatas::Style> usedAttributeNames;
QSet<ItemDatas::Style> ignoredAttributeNames;
success = checkKeywordsList(definition, referencedKeywords) && success;
success = checkContexts(definition, referencedKeywords, usedAttributeNames, usedContexts, unreachableIncludedRules) && success;
success =
checkContexts(definition, referencedKeywords, usedAttributeNames, ignoredAttributeNames, usedContexts, unreachableIncludedRules) && success;
// search for non-existing itemDatas.
const auto invalidNames = usedAttributeNames - definition.itemDatas.styleNames;
@@ -161,9 +166,18 @@ public:
success = false;
}
// search for existing itemDatas, but unusable.
const auto ignoredNames = ignoredAttributeNames - usedAttributeNames;
for (const auto &styleName : ignoredNames) {
qWarning() << filename << "line" << styleName.line << "attribute" << styleName.name
<< "is never used. All uses are with lookAhead=true or <IncludeRules/>";
success = false;
}
// search for unused itemDatas.
const auto unusedNames = definition.itemDatas.styleNames - usedAttributeNames;
for (const auto &styleName : unusedNames) {
auto unusedNames = definition.itemDatas.styleNames - usedAttributeNames;
unusedNames -= ignoredNames;
for (const auto &styleName : std::as_const(unusedNames)) {
qWarning() << filename << "line" << styleName.line << "unused itemData:" << styleName.name;
success = false;
}
@@ -302,9 +316,9 @@ private:
return false;
}
const auto value = attr.value().toString();
const auto value = attr.value();
if (value.isEmpty() /*|| QColor(value).isValid()*/) {
qWarning() << filename << "line" << xml.lineNumber() << attrName << "should be a color:" << attr.value();
qWarning() << filename << "line" << xml.lineNumber() << attrName << "should be a color:" << value;
success = false;
}
@@ -454,6 +468,9 @@ private:
// Regex
XmlBool minimal{};
// IncludeRule
XmlBool includeAttrib{};
// DetectChar, Detect2Chars, LineContinue, RangeDetect
QChar char0;
// Detect2Chars, RangeDetect
@@ -461,6 +478,8 @@ private:
// AnyChar, DetectChar, StringDetect, RegExpr, WordDetect, keyword
QString string;
// RegExpr without .* as suffix
QString sanitizedString;
// Float, HlCHex, HlCOct, Int, WordDetect, keyword
QString additionalDeliminator;
@@ -516,6 +535,15 @@ private:
// remove parentheses on a copy of string
auto reg = QString(string).replace(removeParentheses, QString());
isDotRegex = reg.contains(isDot);
// Remove .* and .*$ suffix.
static const QRegularExpression allSuffix(QStringLiteral("(?<!\\\\)[.][*][?+]?[$]?$"));
sanitizedString = string;
sanitizedString.replace(allSuffix, QString());
// string is a catch-all, do not sanitize
if (sanitizedString.isEmpty() || sanitizedString == QStringLiteral("^")) {
sanitizedString = string;
}
}
return success;
}
@@ -532,7 +560,6 @@ private:
for (auto &attr : xml.attributes()) {
Parser parser{filename, xml, attr, success};
XmlBool includeAttrib{};
// clang-format off
const bool isExtracted
@@ -646,8 +673,11 @@ private:
};
int line;
// becomes false when a context refers to it
// becomes false when a context (except includeRule) refers to it
bool isOnlyIncluded = true;
// becomes true when an includedRule refers to it with includeAttrib=true
bool referencedWithIncludeAttrib = false;
bool hasDynamicRule = false;
QString name;
QString attribute;
ContextName lineEndContext;
@@ -844,7 +874,8 @@ private:
QMutableMapIterator<QString, Context> contextIt(definition.contexts);
while (contextIt.hasNext()) {
contextIt.next();
for (auto &rule : contextIt.value().rules) {
auto &currentContext = contextIt.value();
for (auto &rule : currentContext.rules) {
if (rule.type != Context::Rule::Type::IncludeRules) {
continue;
}
@@ -873,6 +904,7 @@ private:
contexts.append(rule.context.context);
for (int i = 0; i < contexts.size(); ++i) {
currentContext.hasDynamicRule = contexts[i]->hasDynamicRule;
for (const auto &includedRule : contexts[i]->rules) {
if (includedRule.type != Context::Rule::Type::IncludeRules) {
rule.includedRules.append(&includedRule);
@@ -958,6 +990,7 @@ private:
bool checkContexts(const Definition &definition,
QSet<const Keywords *> &referencedKeywords,
QSet<ItemDatas::Style> &usedAttributeNames,
QSet<ItemDatas::Style> &ignoredAttributeNames,
const QSet<const Context *> &usedContexts,
QMap<const Context::Rule *, IncludedRuleUnreachableBy> &unreachableIncludedRules) const
{
@@ -981,7 +1014,7 @@ private:
success = false;
}
if (!context.attribute.isEmpty()) {
if (!context.attribute.isEmpty() && (!context.isOnlyIncluded || context.referencedWithIncludeAttrib)) {
usedAttributeNames.insert({context.attribute, context.line});
}
@@ -991,7 +1024,11 @@ private:
for (const auto &rule : context.rules) {
if (!rule.attribute.isEmpty()) {
usedAttributeNames.insert({rule.attribute, rule.line});
if (rule.lookAhead != XmlBool::True) {
usedAttributeNames.insert({rule.attribute, rule.line});
} else {
ignoredAttributeNames.insert({rule.attribute, rule.line});
}
}
success = checkLookAhead(rule) && success;
success = checkStringDetect(rule) && success;
@@ -1030,7 +1067,13 @@ private:
}
}
auto reg = rule.string;
auto reg = (rule.lookAhead == XmlBool::True) ? rule.sanitizedString : rule.string;
if (rule.lookAhead == XmlBool::True) {
static const QRegularExpression removeAllSuffix(QStringLiteral(
R"(((?<!\\)\\(?:[DSWdsw]|x[0-9a-fA-F]{2}|x\{[0-9a-fA-F]+\}|0\d\d|o\{[0-7]+\}|u[0-9a-fA-F]{4})|(?<!\\)[^])}\\]|(?=\\)\\\\)[*][?+]?$)"));
reg.replace(removeAllSuffix, QString());
}
reg.replace(QStringLiteral("{1}"), QString());
// is DetectSpaces
@@ -1075,8 +1118,12 @@ private:
#undef REG_ESCAPE_CHAR
// use minimal or lazy operator
static const QRegularExpression isMinimal(QStringLiteral(R"([.][*+][^][?+*()|$]*$)"));
if (rule.lookAhead == XmlBool::True && rule.minimal != XmlBool::True && reg.contains(isMinimal)) {
static const QRegularExpression isMinimal(QStringLiteral("(?![.][*+?][$]?[)]*$)[.][*+?][^?+]"));
static const QRegularExpression hasNotGreedy(QStringLiteral("[*+?][?+]"));
if (rule.lookAhead == XmlBool::True && rule.minimal != XmlBool::True && reg.contains(isMinimal) && !reg.contains(hasNotGreedy)
&& (!rule.context.context || !rule.context.context->hasDynamicRule || regexp.captureCount() == 0)
&& (reg.back() != QLatin1Char('$') || reg.contains(QLatin1Char('|')))) {
qWarning() << filename << "line" << rule.line
<< "RegExpr should be have minimal=\"1\" or use lazy operator (i.g, '.*' -> '.*?'):" << rule.string;
return false;
@@ -2033,8 +2080,25 @@ private:
}
const auto &rule2 = *rulePtr;
if (rule2.type == Context::Rule::Type::RegExpr && isCompatible(rule2) && rule.insensitive == rule2.insensitive
&& rule.dynamic == rule2.dynamic && rule.string.startsWith(rule2.string)) {
updateUnreachable1({&rule2, ruleIterator.currentIncludeRules()});
&& rule.dynamic == rule2.dynamic && rule.sanitizedString.startsWith(rule2.sanitizedString)) {
bool add = (rule.sanitizedString.startsWith(rule2.string) || rule.sanitizedString.size() < rule2.sanitizedString.size() + 2);
if (!add) {
// \s.* (sanitized = \s) is considered hiding \s*\S
// we check the quantifiers to see if this is the case
auto c1 = rule.sanitizedString[rule2.sanitizedString.size()].unicode();
auto c2 = rule.sanitizedString[rule2.sanitizedString.size() + 1].unicode();
auto c3 = rule2.sanitizedString.back().unicode();
if (c3 == '*' || c3 == '?' || c3 == '+') {
add = true;
} else if (c1 == '*' || c1 == '?') {
add = !((c2 == '?' || c2 == '+') || (rule.sanitizedString.size() >= rule2.sanitizedString.size() + 3));
} else {
add = true;
}
}
if (add) {
updateUnreachable1({&rule2, ruleIterator.currentIncludeRules()});
}
}
}
@@ -2350,9 +2414,20 @@ private:
auto &rule2 = it[1];
auto isCommonCompatible = [&] {
return rule1.attribute == rule2.attribute && rule1.beginRegion == rule2.beginRegion && rule1.endRegion == rule2.endRegion
&& rule1.lookAhead == rule2.lookAhead && rule1.firstNonSpace == rule2.firstNonSpace && rule1.context.context == rule2.context.context
if (rule1.lookAhead != rule2.lookAhead) {
return false;
}
// ignore attribute when lookAhead is true
if (rule1.lookAhead != XmlBool::True && rule1.attribute != rule2.attribute) {
return false;
}
// clang-format off
return rule1.beginRegion == rule2.beginRegion
&& rule1.endRegion == rule2.endRegion
&& rule1.firstNonSpace == rule2.firstNonSpace
&& rule1.context.context == rule2.context.context
&& rule1.context.popCount == rule2.context.popCount;
// clang-format on
};
switch (rule1.type) {
@@ -2408,7 +2483,7 @@ private:
//! - "Comment##ISO C++"-> "Comment" in ISO C++
void resolveContextName(Definition &definition, Context &context, ContextName &contextName, int line)
{
QString name = contextName.name;
QStringView name = contextName.name;
if (name.isEmpty()) {
contextName.stay = true;
} else if (name.startsWith(QStringLiteral("#stay"))) {
@@ -2437,15 +2512,15 @@ private:
if (!name.isEmpty()) {
const int idx = name.indexOf(QStringLiteral("##"));
if (idx == -1) {
auto it = definition.contexts.find(name);
auto it = definition.contexts.find(name.toString());
if (it != definition.contexts.end()) {
contextName.context = &*it;
}
} else {
auto defName = name.mid(idx + 2);
auto listName = name.left(idx);
auto it = m_definitions.find(defName);
auto it = m_definitions.find(defName.toString());
if (it != m_definitions.end()) {
auto listName = name.left(idx).toString();
definition.referencedDefinitions.insert(&*it);
auto ctxIt = it->contexts.find(listName.isEmpty() ? it->firstContextName : listName);
if (ctxIt != it->contexts.end()) {
@@ -2487,7 +2562,7 @@ QStringList readListing(const QString &fileName)
xml.readNext();
// add only .xml files, no .json or stuff
if (xml.isCharacters() && xml.text().toString().contains(QLatin1String(".xml"))) {
if (xml.isCharacters() && xml.text().contains(QLatin1String(".xml"))) {
listing.append(xml.text().toString());
}
}
@@ -2505,10 +2580,10 @@ QStringList readListing(const QString &fileName)
* @param extensions extensions string to check
* @return valid?
*/
bool checkExtensions(const QString &extensions)
bool checkExtensions(QStringView extensions)
{
// get list of extensions
const QStringList extensionParts = extensions.split(QLatin1Char(';'), Qt::SkipEmptyParts);
const QList<QStringView> extensionParts = extensions.split(QLatin1Char(';'), Qt::SkipEmptyParts);
// ok if empty
if (extensionParts.isEmpty()) {
@@ -2645,6 +2720,11 @@ int main(int argc, char *argv[])
xml.readNext();
filesChecker.processElement(xml);
}
if (xml.hasError()) {
anyError = 33;
qWarning() << hlFilename << "-" << xml.errorString() << "@ offset" << xml.characterOffset();
}
}
filesChecker.resolveContexts();

View File

@@ -47,8 +47,7 @@ set_target_properties(KF5SyntaxHighlighting PROPERTIES
SOVERSION ${SyntaxHighlighting_SOVERSION}
EXPORT_NAME SyntaxHighlighting
)
target_include_directories(KF5SyntaxHighlighting INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF}/KSyntaxHighlighting>")
target_include_directories(KF5SyntaxHighlighting PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR};${CMAKE_CURRENT_BINARY_DIR};>")
target_link_libraries(KF5SyntaxHighlighting
PUBLIC
Qt${QT_MAJOR_VERSION}::Gui
@@ -72,12 +71,12 @@ set(Forwarding_Header_Names
ecm_generate_headers(CamelCase_HEADERS
HEADER_NAMES ${Forwarding_Header_Names}
REQUIRED_HEADERS SyntaxHighlighting_HEADERS
# Avoid unprefixed headers in build dir (which is part of library's build interface include directories)
# and thus visible to anything linking it in the same build, incl. when used with CMake's FetchContent.
# E.g. there can be look-up clashes on case-insensitive filesystems with C++20's <format> file and
# the library's generated "Format" file.
# See BUG: 453759
OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/camelcaseheaders
OUTPUT_DIR ${CMAKE_BINARY_DIR}/KSyntaxHighlighting/KSyntaxHighlighting
)
target_include_directories(KF5SyntaxHighlighting
INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF}/KSyntaxHighlighting>"
PUBLIC "$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/KSyntaxHighlighting;>"
)
install(TARGETS KF5SyntaxHighlighting EXPORT KF5SyntaxHighlightingTargets ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})

View File

@@ -119,14 +119,14 @@ State AbstractHighlighter::highlightLine(QStringView text, const State &state)
// verify/initialize state
auto newState = state;
auto stateData = StateData::get(newState);
const DefinitionRef currentDefRef(d->m_definition);
if (!stateData->isEmpty() && (stateData->m_defRef != currentDefRef)) {
const auto definitionId = DefinitionData::get(d->m_definition)->id;
if (!stateData->isEmpty() && stateData->m_defId != definitionId) {
qCDebug(Log) << "Got invalid state, resetting.";
stateData->clear();
}
if (stateData->isEmpty()) {
stateData->push(defData->initialContext(), QStringList());
stateData->m_defRef = currentDefRef;
stateData->m_defId = definitionId;
}
// process empty lines
@@ -178,9 +178,29 @@ State AbstractHighlighter::highlightLine(QStringView text, const State &state)
* - 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;
QVarLengthArray<QPair<Rule *, int>, 8> skipOffsets;
QStringList capturesForLastDynamicSkipOffset;
auto getSkipOffsetValue = [&skipOffsets](Rule *r) -> int {
auto i = std::find_if(skipOffsets.begin(), skipOffsets.end(), [r](const auto &v) {
return v.first == r;
});
if (i == skipOffsets.end())
return 0;
return i->second;
};
auto insertSkipOffset = [&skipOffsets](Rule *r, int i) {
auto it = std::find_if(skipOffsets.begin(), skipOffsets.end(), [r](const auto &v) {
return v.first == r;
});
if (it == skipOffsets.end()) {
skipOffsets.push_back({r, i});
} else {
it->second = i;
}
};
/**
* current active format
* stored as pointer to avoid deconstruction/constructions inside the internal loop
@@ -255,7 +275,7 @@ State AbstractHighlighter::highlightLine(QStringView text, const State &state)
if (rule->isDynamic() && (capturesForLastDynamicSkipOffset != stateData->topCaptures())) {
skipOffsets.clear();
}
const auto currentSkipOffset = skipOffsets.value(rule.get());
const auto currentSkipOffset = getSkipOffsetValue(rule.get());
if (currentSkipOffset < 0 || currentSkipOffset > offset) {
continue;
}
@@ -267,7 +287,7 @@ State AbstractHighlighter::highlightLine(QStringView text, const State &state)
* update skip offset if new one rules out any later match or is larger than current one
*/
if (newResult.skipOffset() < 0 || newResult.skipOffset() > currentSkipOffset) {
skipOffsets.insert(rule.get(), newResult.skipOffset());
insertSkipOffset(rule.get(), newResult.skipOffset());
// remember new captures, if dynamic to enforce proper reset above on change!
if (rule->isDynamic()) {

View File

@@ -27,8 +27,8 @@ using namespace KSyntaxHighlighting;
namespace
{
struct CieLab {
double l;
struct Lab {
double L;
double a;
double b;
};
@@ -102,320 +102,363 @@ struct CieLab {
// {0xd0, 0xd0, 0xd0}, {0xda, 0xda, 0xda}, {0xe4, 0xe4, 0xe4}, {0xee, 0xee, 0xee},
// };
// xterm color represented in CIELAB (D65)
// see rgbToLab()
constexpr CieLab xterm240Labs[] {
// xterm color represented in Oklab
// see rgbToOklab()
constexpr Lab xterm240_Oklabs[] {
// ignore the first 16 colors as they are unpredictable (user configurable)
// { 0.000000, 0.000000, 0.000000},
// { 25.535531, 48.045128, 38.057321},
// { 46.227431, -51.698496, 49.896846},
// { 51.868943, -12.929464, 56.674579},
// { 12.971967, 47.502281, -64.702162},
// { 29.784667, 58.927896, -36.487077},
// { 48.254093, -28.846304, -8.476886},
// { 77.704367, -0.000013, 0.000005},
// { 53.585016, -0.000010, 0.000004},
// { 53.240794, 80.092460, 67.203197},
// { 87.734722, -86.182716, 83.179321},
// { 97.139267, -21.553748, 94.477975},
// { 32.297011, 79.187520, -107.860162},
// { 60.324212, 98.234312, -60.824892},
// { 91.113220, -48.087528, -14.131186},
// { 100.000004, -0.000017, 0.000007},
// {0x0p+0, 0x0p+0, 0x0p+0},
// {0x1.2d5e6bee2c4f6p+5, 0x1.af99c042ea40cp+3, 0x1.e2f6ba84d2d25p+2},
// {0x1.9fcc4f3622914p+5, -0x1.c105bf1d2d218p+3, 0x1.586870aec30a4p+3},
// {0x1.d089126c75579p+5, -0x1.12107f2e3119p+2, 0x1.7d020b82d4b9cp+3},
// {0x1.b1ce15c4fcb51p+4, -0x1.f203762eb1242p+0, -0x1.2b150ae3c14bep+4},
// {0x1.50bc446f31833p+5, 0x1.078a1150b431ap+4, -0x1.44d35b3de7eafp+3},
// {0x1.b27d96eb8f471p+5, -0x1.1ee8867b0e065p+3, -0x1.2f2f18261c69ap+1},
// {0x1.431e523cc2f4dp+6, -0x1.ad694c777b8p-11, -0x1.c7c3ea0c32ep-8},
// {0x1.dfe5855ae1528p+5, -0x1.3ee1ad40618p-11, -0x1.5273b9784a3p-8},
// {0x1.f663baac570efp+5, 0x1.67be9f690c994p+4, 0x1.928e76c3750aep+3},
// {0x1.5a92b1ff8af32p+6, -0x1.76441609cfb3ap+4, 0x1.1f1186319beaap+4},
// {0x1.83323c984ee7ap+6, -0x1.c8df58716d4cbp+2, 0x1.3d9335b5d20f9p+4},
// {0x1.69950098864afp+5, -0x1.9f19c42a8c674p+1, -0x1.f293e325bec2ep+4},
// {0x1.18ac5c68852cdp+6, 0x1.b753a9bd5dbeep+4, -0x1.0ebf0dff35bfbp+4},
// {0x1.6a27499e4d3d6p+6, -0x1.de4892c062f8p+3, -0x1.f96a59bc9de4cp+1},
// {0x1.8ffffbb77c76ap+6, -0x1.09cab717214p-10, -0x1.1a1aa7765a7p-7},
// 240 colors mode
{ 0.000000, 0.000000, 0.000000},
{ 7.460661, 38.391030, -52.344094},
{ 14.108800, 49.366227, -67.241015},
{ 20.416780, 59.708756, -81.328423},
{ 26.461219, 69.619186, -94.827275},
{ 32.297011, 79.187520, -107.860162},
{ 34.362921, -41.841471, 40.383330},
{ 36.003172, -23.346362, -6.860652},
{ 37.721074, -8.280292, -28.838129},
{ 40.044712, 8.050351, -49.077929},
{ 42.896244, 24.232072, -67.665859},
{ 46.179103, 39.611555, -84.835619},
{ 48.669178, -53.727096, 51.854752},
{ 49.680825, -41.468213, 12.871276},
{ 50.775364, -29.978206, -8.809511},
{ 52.309747, -16.087685, -29.668380},
{ 54.271652, -0.984531, -49.346593},
{ 56.628677, 14.436593, -67.825764},
{ 62.217771, -64.983255, 62.718643},
{ 62.913963, -56.274791, 30.552786},
{ 63.677487, -47.533738, 9.989760},
{ 64.765216, -36.258826, -10.655158},
{ 66.184274, -23.179986, -30.659176},
{ 67.928678, -9.021871, -49.792238},
{ 75.200318, -75.769144, 73.128652},
{ 75.714081, -69.238116, 46.415771},
{ 76.281325, -62.437099, 27.358874},
{ 77.096125, -53.317791, 7.414754},
{ 78.170587, -42.277048, -12.423696},
{ 79.508487, -29.803889, -31.743841},
{ 87.734722, -86.182716, 83.179321},
{ 88.132543, -81.079314, 60.784276},
{ 88.573418, -75.649889, 43.369240},
{ 89.209664, -68.192330, 24.408752},
{ 90.053903, -58.903863, 5.054882},
{ 91.113220, -48.087528, -14.131186},
{ 17.616214, 38.884668, 27.208161},
{ 21.055194, 47.692487, -29.530317},
{ 24.265489, 55.109279, -50.109929},
{ 28.188460, 63.497258, -68.189398},
{ 32.565034, 72.278448, -84.495140},
{ 37.209055, 81.157734, -99.539334},
{ 38.928802, -10.464285, 45.868796},
{ 40.317682, -0.000008, 0.000003},
{ 41.792415, 9.716881, -22.184768},
{ 43.816568, 21.358548, -42.829511},
{ 46.341283, 33.910621, -61.915173},
{ 49.295490, 46.651030, -79.609352},
{ 51.565360, -31.106941, 55.362293},
{ 52.493892, -22.366057, 17.186391},
{ 53.502318, -13.755714, -4.459620},
{ 54.922246, -2.860324, -25.412901},
{ 56.747662, 9.522785, -45.263794},
{ 58.953975, 22.669708, -63.961919},
{ 64.235031, -48.203292, 65.170137},
{ 64.897084, -41.171043, 33.487406},
{ 65.624132, -33.963343, 13.012989},
{ 66.661569, -24.464553, -7.626328},
{ 68.017831, -13.189300, -27.680081},
{ 69.689139, -0.708182, -46.900093},
{ 76.698001, -62.880681, 74.951857},
{ 77.195429, -57.221495, 48.537298},
{ 77.744943, -51.270878, 29.570908},
{ 78.534816, -43.206116, 9.664419},
{ 79.577356, -33.321295, -10.175418},
{ 80.876952, -22.010117, -29.524777},
{ 88.898351, -75.968373, 84.597226},
{ 89.287443, -71.354717, 62.392493},
{ 89.718758, -66.422134, 45.055576},
{ 90.341414, -59.608536, 26.140485},
{ 91.167986, -51.063898, 6.804468},
{ 92.205709, -41.038767, -12.384583},
{ 27.165347, 49.930374, 40.136706},
{ 29.358410, 55.725044, -15.903001},
{ 31.581214, 61.240172, -37.918796},
{ 34.491549, 68.043425, -57.611837},
{ 37.945003, 75.652936, -75.432962},
{ 41.798486, 83.706896, -91.791834},
{ 43.266004, 9.134592, 50.930049},
{ 44.465039, 16.311047, 6.512751},
{ 45.750668, 23.372978, -15.766712},
{ 47.534439, 32.300943, -36.702982},
{ 49.787278, 42.444465, -56.184495},
{ 52.457917, 53.224022, -74.320646},
{ 54.532058, -13.436804, 58.898437},
{ 55.385516, -6.768114, 21.580884},
{ 56.315467, -0.000010, 0.000004},
{ 57.630008, 8.825705, -21.021347},
{ 59.328134, 19.179536, -41.022229},
{ 61.391858, 30.508200, -59.920728},
{ 66.374922, -33.335627, 67.745825},
{ 67.003415, -27.527170, 36.582861},
{ 67.694487, -21.482419, 16.212526},
{ 68.682127, -13.384693, -4.410654},
{ 69.975892, -3.594073, -24.507224},
{ 71.574010, 7.447858, -43.809975},
{ 78.315904, -50.585277, 76.909139},
{ 78.796543, -45.651434, 50.818542},
{ 79.327805, -40.421790, 31.953767},
{ 80.091978, -33.269832, 12.092110},
{ 81.101528, -24.409844, -7.745063},
{ 82.361425, -14.154994, -27.121909},
{ 90.168532, -65.770182, 86.138290},
{ 90.548420, -61.599052, 64.141611},
{ 90.969646, -57.119911, 46.891522},
{ 91.577948, -50.900805, 28.027875},
{ 92.385840, -43.052445, 8.713289},
{ 93.400696, -33.779293, -10.477090},
{ 36.208754, 60.391097, 50.573778},
{ 37.739975, 64.495259, -2.438323},
{ 39.353431, 68.650313, -25.128730},
{ 41.549773, 74.070366, -45.863018},
{ 44.264011, 80.458448, -64.848646},
{ 47.410429, 87.520359, -82.356598},
{ 48.637025, 27.330267, 57.029239},
{ 49.649655, 32.345900, 14.536338},
{ 50.745209, 37.483199, -7.743369},
{ 52.280931, 44.249599, -28.930913},
{ 54.244425, 52.280310, -48.806029},
{ 56.603189, 61.178271, -67.411894},
{ 58.455996, 5.073270, 63.495100},
{ 59.223239, 10.069966, 27.347971},
{ 60.062286, 15.267320, 5.894811},
{ 61.253487, 22.225763, -15.176012},
{ 62.800706, 30.633519, -35.336720},
{ 64.692889, 40.111206, -54.465103},
{ 69.308960, -16.251898, 71.238024},
{ 69.895406, -11.599340, 40.796840},
{ 70.541246, -6.687200, 20.584981},
{ 71.466005, -0.000013, 0.000005},
{ 72.680407, 8.238495, -20.139565},
{ 74.184959, 17.716313, -39.540668},
{ 80.579920, -35.513903, 79.627400},
{ 81.038448, -31.346986, 53.992269},
{ 81.545637, -26.892900, 35.276028},
{ 82.275842, -20.742163, 15.484099},
{ 83.241675, -13.032556, -4.342368},
{ 84.448794, -3.993322, -23.750841},
{ 91.967824, -52.701251, 88.309654},
{ 92.335220, -49.036719, 66.608006},
{ 92.742744, -45.081868, 49.483561},
{ 93.331530, -39.558175, 30.696050},
{ 94.113989, -32.535991, 11.415203},
{ 95.097663, -24.169464, -7.773705},
{ 44.874337, 70.414781, 59.082945},
{ 46.012582, 73.488282, 10.528988},
{ 47.236695, 76.706186, -12.348562},
{ 48.940884, 81.051413, -33.681818},
{ 51.101856, 86.364529, -53.475339},
{ 53.674597, 92.446330, -71.879038},
{ 54.695304, 43.548940, 63.726908},
{ 55.544895, 47.195327, 23.494868},
{ 56.470786, 51.029166, 1.345906},
{ 57.779848, 56.225393, -20.000213},
{ 59.471313, 62.597129, -40.204567},
{ 61.527524, 69.897355, -59.241373},
{ 63.159654, 22.859865, 68.897396},
{ 63.839588, 26.634208, 34.185583},
{ 64.585756, 30.632858, 12.941230},
{ 65.649581, 36.098152, -8.134153},
{ 67.038832, 42.864229, -28.433915},
{ 68.748596, 50.691293, -47.788927},
{ 72.964214, 1.430076, 75.529188},
{ 73.503895, 5.119471, 45.996429},
{ 74.099224, 9.062101, 26.005435},
{ 74.953413, 14.504783, 5.492273},
{ 76.078172, 21.324042, -14.677149},
{ 77.476211, 29.315742, -34.177868},
{ 83.468499, -18.949380, 83.062075},
{ 83.900955, -15.492587, 58.010021},
{ 84.379703, -11.768724, 39.493278},
{ 85.069678, -6.579078, 19.801555},
{ 85.983569, -0.000015, 0.000006},
{ 87.127728, 7.813055, -19.437771},
{ 94.298345, -37.668200, 91.102418},
{ 94.650453, -34.512373, 69.782914},
{ 95.041192, -31.089517, 52.825519},
{ 95.606040, -26.280220, 34.142079},
{ 96.357251, -20.119939, 14.910613},
{ 97.302528, -12.715984, -4.270744},
{ 53.240794, 80.092460, 67.203197},
{ 54.125781, 82.492192, 22.910970},
{ 55.088767, 85.054618, 0.168144},
{ 56.447798, 88.591017, -21.450672},
{ 58.199846, 93.025112, -41.765998},
{ 60.324212, 98.234312, -60.824892},
{ 61.177753, 58.007184, 70.725237},
{ 61.892577, 60.769076, 32.940064},
{ 62.675958, 63.722867, 11.059157},
{ 63.790979, 67.805180, -10.333124},
{ 65.243976, 72.929281, -30.773134},
{ 67.027700, 78.950491, -50.165199},
{ 68.456202, 39.347025, 74.858462},
{ 69.054426, 42.256401, 41.778310},
{ 69.712953, 45.379691, 20.832601},
{ 70.655381, 49.714784, -0.184657},
{ 71.892132, 55.183573, -20.579895},
{ 73.423104, 61.643523, -40.132156},
{ 77.236080, 18.715563, 80.467683},
{ 77.727829, 21.651859, 52.000981},
{ 78.271171, 24.819797, 32.297655},
{ 79.052359, 29.242703, 11.899654},
{ 80.083760, 34.862654, -8.273975},
{ 81.369962, 41.554730, -27.861347},
{ 86.930570, -1.923749, 87.132036},
{ 87.334594, 0.925621, 62.778902},
{ 87.782260, 4.015632, 44.514668},
{ 88.428154, 8.356443, 24.958589},
{ 89.284922, 13.915222, 5.202570},
{ 90.359536, 20.594187, -14.254942},
{ 97.139267, -21.553748, 94.477975},
{ 97.473993, -18.866927, 73.623332},
{ 97.845623, -15.939407, 56.875584},
{ 98.383182, -11.803189, 38.326889},
{ 99.098697, -6.467219, 19.163906},
{ 100.000004, -0.000017, 0.000007},
{ 2.193399, -0.000001, 0.000000},
{ 5.463889, -0.000002, 0.000001},
{ 10.268185, -0.000004, 0.000002},
{ 15.159721, -0.000004, 0.000002},
{ 19.865535, -0.000005, 0.000002},
{ 24.421321, -0.000006, 0.000002},
{ 28.851904, -0.000006, 0.000003},
{ 33.175474, -0.000007, 0.000003},
{ 37.405892, -0.000008, 0.000003},
{ 41.554045, -0.000008, 0.000003},
{ 45.628691, -0.000009, 0.000004},
{ 49.637017, -0.000009, 0.000004},
{ 53.585016, -0.000010, 0.000004},
{ 57.477759, -0.000011, 0.000004},
{ 61.319585, -0.000011, 0.000004},
{ 65.114248, -0.000012, 0.000005},
{ 68.865021, -0.000012, 0.000005},
{ 72.574786, -0.000013, 0.000005},
{ 76.246094, -0.000013, 0.000005},
{ 79.881220, -0.000014, 0.000006},
{ 83.482203, -0.000014, 0.000006},
{ 87.050883, -0.000015, 0.000006},
{ 90.588923, -0.000015, 0.000006},
{ 94.097838, -0.000016, 0.000006},
{0x0p+0, 0x0p+0, 0x0p+0},
{0x1.5f181b2779cap+4, -0x1.930f78e22f09ap+0, -0x1.e41dbddfca08ap+3},
{0x1.c2d3be821f882p+4, -0x1.02c70dd8af008p+1, -0x1.36d1623919ffp+4},
{0x1.10a39beeb2926p+5, -0x1.38fe38b7dab01p+1, -0x1.77efa95d520b4p+4},
{0x1.3de43fe8d92efp+5, -0x1.6cf188320fff2p+1, -0x1.b655790a27192p+4},
{0x1.69950098864afp+5, -0x1.9f19c42a8c674p+1, -0x1.f293e325bec2ep+4},
{0x1.50853f46a9f9ep+5, -0x1.6b6901a80404fp+3, 0x1.16bdec11e60d8p+3},
{0x1.5fa625f2c3fbcp+5, -0x1.d0691ed5aa7ap+2, -0x1.eac16e8cb9241p+0},
{0x1.6f4222fc3f0dbp+5, -0x1.61b0e7ffa5e8ap+2, -0x1.05e8906ee23d7p+3},
{0x1.83e99e6187f46p+5, -0x1.1a61c98b895p+2, -0x1.c3da094bbcf2fp+3},
{0x1.9ca47689a503dp+5, -0x1.e9259e3439104p+1, -0x1.396812c634de3p+4},
{0x1.b872b55db6144p+5, -0x1.ccd50a2fd6662p+1, -0x1.89dec898ec996p+4},
{0x1.b01d15d276ef1p+5, -0x1.d2a4448f6ccacp+3, 0x1.65ec167dcb488p+3},
{0x1.b9760adf5c444p+5, -0x1.6a3760af4b6c4p+3, 0x1.a26bb322495e2p+1},
{0x1.c38a22a31944p+5, -0x1.2a2a93c4b741p+3, -0x1.3b14a376ffbecp+1},
{0x1.d185a36cfcd6ep+5, -0x1.e760f29e8fcb4p+2, -0x1.0bf936f2a6743p+3},
{0x1.e321d754f2b44p+5, -0x1.95a749a95debp+2, -0x1.c3928e31b9cf8p+3},
{0x1.f7eb8d9ad84b9p+5, -0x1.5e28b7cc193ddp+2, -0x1.38bda7259441ep+4},
{0x1.0552717cdb82p+6, -0x1.1a33f75f67b0fp+4, 0x1.b0e8bd24c3fdep+3},
{0x1.08898a5b7805dp+6, -0x1.e29bd3071d97ap+3, 0x1.e0b5994e0238ep+2},
{0x1.0c10ad1b87866p+6, -0x1.a54f2215371a5p+3, 0x1.45758e5457898p+1},
{0x1.1111e924447e9p+6, -0x1.68a24e1d5efe1p+3, -0x1.7d178a838ea32p+1},
{0x1.178bb94d30a5cp+6, -0x1.335d7d75dd017p+3, -0x1.13f78c003ba13p+3},
{0x1.1f6aa49fcff2p+6, -0x1.0830d167759a4p+3, -0x1.c578e33f21d88p+3},
{0x1.30b236b57ac86p+6, -0x1.490afbe3d8e11p+4, 0x1.f8c35fbb689dap+3},
{0x1.331144aae0ad4p+6, -0x1.289bac3eeb83p+4, 0x1.626ea3a63748p+3},
{0x1.35b09f5c62a7ap+6, -0x1.0d33e3db59803p+4, 0x1.b66836d6f7ff6p+2},
{0x1.3973d5b39baa4p+6, -0x1.de87e61f0c86ap+3, 0x1.de8cf8346969cp+0},
{0x1.3e64dbeab2c38p+6, -0x1.a47dea5d85dbbp+3, -0x1.bc586cdcba45p+1},
{0x1.44815d7f73a41p+6, -0x1.706c35b4850ecp+3, -0x1.1d13e731dfc5bp+3},
{0x1.5a92b1ff8af32p+6, -0x1.76441609cfb3ap+4, 0x1.1f1186319beaap+4},
{0x1.5c6885a0ab4cap+6, -0x1.5c0bf4148d03dp+4, 0x1.c5b4a75d0a01ep+3},
{0x1.5e72281eb918cp+6, -0x1.4422b7d2ad44bp+4, 0x1.5305a49da3492p+3},
{0x1.61631d5752788p+6, -0x1.282b31110d79dp+4, 0x1.8b1a60b561753p+2},
{0x1.65488920f4795p+6, -0x1.0b1a0cfacacfbp+4, 0x1.3d72a3bb176fp+0},
{0x1.6a27499e4d3d6p+6, -0x1.de4892c062f8p+3, -0x1.f96a59bc9de4cp+1},
{0x1.e7d1475ebe201p+4, 0x1.5d4f5ebb6cf8ep+3, 0x1.86e150bac0e61p+2},
{0x1.10883ee613f6bp+5, 0x1.aa957aceb4328p+3, -0x1.06e4a6bcf37ep+3},
{0x1.2a507c82ee1e7p+5, 0x1.880d450b132c9p+3, -0x1.c81b5ba73664ap+3},
{0x1.4902475f20191p+5, 0x1.4f4dfeda4e013p+3, -0x1.38d6c960a7255p+4},
{0x1.6aa42ff68fb65p+5, 0x1.1116140836dp+3, -0x1.84f2dbb4bf7b2p+4},
{0x1.8def7d6adc3d5p+5, 0x1.ab6406f65a5b9p+2, -0x1.caee116cbc66ep+4},
{0x1.77f724f99d0c9p+5, -0x1.bb9ee0e906bf2p+1, 0x1.345d15707c9e4p+3},
{0x1.8465d178eda3bp+5, -0x1.021519c6d64p-11, -0x1.11ebea130b3p-8},
{0x1.917d476fba08dp+5, 0x1.84e9b4b9a4816p+0, -0x1.89910d2df7414p+2},
{0x1.a32d016052029p+5, 0x1.352fbc1045df3p+1, -0x1.847eed4ab1e03p+3},
{0x1.b8cfd7baeb72ap+5, 0x1.5d6575ced028ep+1, -0x1.1bff70d82f589p+4},
{0x1.d1a20bfd91dbap+5, 0x1.4de285fe39a4dp+1, -0x1.6f381fca63bcep+4},
{0x1.c99e943a2d79fp+5, -0x1.219ec15c5de22p+3, 0x1.78f2db7cd8205p+3},
{0x1.d20af5c832c06p+5, -0x1.86c31353f2968p+2, 0x1.15f4d958ffb6ep+2},
{0x1.db2d2b76b7db4p+5, -0x1.107aa185fa178p+2, -0x1.3a545f6bb32fep+0},
{0x1.e7ef429658179p+5, -0x1.58a57459e2113p+1, -0x1.c50012145074dp+2},
{0x1.f821bad822a9ep+5, -0x1.8ea06e2a9e1f6p+0, -0x1.9a5cf82ebb612p+3},
{0x1.05b4f2f9696abp+6, -0x1.b3645fe7f9294p-1, -0x1.24f471b4e8b62p+4},
{0x1.0e4a1f1b1ddcep+6, -0x1.b32bbdf7204c1p+3, 0x1.be3e8e0b04a1fp+3},
{0x1.114fcf04f35b3p+6, -0x1.6696d5115c7e4p+3, 0x1.058704ea2708p+3},
{0x1.14a2558b5b6c7p+6, -0x1.2c7e211429d81p+3, 0x1.a9f809f8ee4dfp+1},
{0x1.195c00cf22a51p+6, -0x1.e58de99c40fb6p+2, -0x1.0e4f6479339a5p+1},
{0x1.1f7e4eea78cb7p+6, -0x1.809e6530a25d5p+2, -0x1.ee2cfac349d5ep+2},
{0x1.26f9f5da0f33bp+6, -0x1.2ffe0404fe1e4p+2, -0x1.a87af760f19c2p+3},
{0x1.37635555b270cp+6, -0x1.17deced6d377ep+4, 0x1.0159387931185p+4},
{0x1.39aa8b444a1c7p+6, -0x1.f1b4258b74e35p+3, 0x1.70a1d9ed49333p+3},
{0x1.3c30003dc4bdap+6, -0x1.bcf061cd62971p+3, 0x1.d845b8f464806p+2},
{0x1.3fcf0a7e4fdb8p+6, -0x1.8316f8fb04f1cp+3, 0x1.3be7d797ab219p+1},
{0x1.4492530767fa4p+6, -0x1.4af657f86bc35p+3, -0x1.69ccecfbead6p+1},
{0x1.4a78e7a0304fbp+6, -0x1.18be182ded159p+3, -0x1.07ac09ccdfff4p+3},
{0x1.5fc9ac083946p+6, -0x1.4f840d59cd9aep+4, 0x1.22ef620ec7775p+4},
{0x1.6192b2ae205fp+6, -0x1.361d4509435d5p+4, 0x1.cfe893676e62ep+3},
{0x1.638e487d443e1p+6, -0x1.1edcf418396fcp+4, 0x1.5f105a3f7b33p+3},
{0x1.666b5164f3799p+6, -0x1.03988ade0159ep+4, 0x1.a6a2e5baac692p+2},
{0x1.6a3706fa48d42p+6, -0x1.ce6b98f424c54p+3, 0x1.b67fa4fafc2e8p+0},
{0x1.6ef6b7860b53fp+6, -0x1.97ce09961f218p+3, -0x1.b926ed0fbe897p+1},
{0x1.3931bb83cb32dp+5, 0x1.c0894426a198dp+3, 0x1.f5ea328bf4058p+2},
{0x1.4b9e77eb58ebfp+5, 0x1.108cfd41d7919p+4, -0x1.0eaf04c8d3b35p+2},
{0x1.5df2d7bacd40ap+5, 0x1.11e15f9b225acp+4, -0x1.51924b9c514f3p+3},
{0x1.756bc7d79519bp+5, 0x1.03a63c750b36bp+4, -0x1.052fc194cf52p+4},
{0x1.90b3e1d276c5dp+5, 0x1.d79fd75fb3811p+3, -0x1.58e6a7a1da1fcp+4},
{0x1.aea5654d2d631p+5, 0x1.9f14550c88c57p+3, -0x1.a57e86563dbcap+4},
{0x1.9b6948efcb1e8p+5, 0x1.dddaa142e7b3ap+0, 0x1.4f83ba256abcfp+3},
{0x1.a5f9bfdb796c8p+5, 0x1.3de3647070a5bp+2, 0x1.b416b1e2a3817p+0},
{0x1.b1407c7a80b46p+5, 0x1.9d8674f672f17p+2, -0x1.112d7835e0443p+2},
{0x1.c0b6552db89b1p+5, 0x1.d8c2a5262b398p+2, -0x1.480f10f6d0b5fp+3},
{0x1.d3edc2b5ca1f7p+5, 0x1.edbf49a0778e4p+2, -0x1.fe5ca96caae15p+3},
{0x1.ea519f7b4bf8cp+5, 0x1.e35c8bfe38bf9p+2, -0x1.5483ed4b7e5ebp+4},
{0x1.e2c36ca30962cp+5, -0x1.1cd1878e91233p+2, 0x1.8bf558e4fbde3p+3},
{0x1.ea67769abd5c1p+5, -0x1.c053e5b6c3b66p+0, 0x1.59302161a2865p+2},
{0x1.f2ba2dd022991p+5, -0x1.4b64e809e68p-11, -0x1.5fbb8b338b8p-8},
{0x1.fe6b844bbf20fp+5, 0x1.8040f07e39554p+0, -0x1.7196ffd7de002p+2},
{0x1.06aeef460087dp+6, 0x1.4afa79e390244p+1, -0x1.705a7c8493135p+3},
{0x1.0fa5554a5c955p+6, 0x1.9dea7336ee828p+1, -0x1.1089bb9ca046ep+4},
{0x1.178e9051b853ep+6, -0x1.3b3b8e6c52f1cp+3, 0x1.cc268b9a4e157p+3},
{0x1.1a65db5c4c0d1p+6, -0x1.e697a167b2b86p+2, 0x1.1b4d0d1ca381dp+3},
{0x1.1d86bd983524p+6, -0x1.77ccb1bcef226p+2, 0x1.08e1384d16e75p+2},
{0x1.21fc7ad985402p+6, -0x1.08e3f099fb00fp+2, -0x1.363e6fbac8902p+0},
{0x1.27cb1d6dd9434p+6, -0x1.4f7ef424b1025p+1, -0x1.b1af4c945ce98p+2},
{0x1.2ee710ec206cfp+6, -0x1.6ac7f2787bda1p+0, -0x1.89e8c18db3849p+3},
{0x1.3e7c86695f695p+6, -0x1.ceac064fd3a97p+3, 0x1.06a67a74ff4cp+4},
{0x1.40ac0504d65f2p+6, -0x1.935bda5136fdbp+3, 0x1.7fa8ea5683dffp+3},
{0x1.4317a9d652f14p+6, -0x1.608608dcc2607p+3, 0x1.fc21edd271f8bp+2},
{0x1.46928cf49114ap+6, -0x1.2883a0410f74bp+3, 0x1.8d4b911a8102bp+1},
{0x1.4b27f53f2d1c8p+6, -0x1.e40f8922e26b2p+2, -0x1.11ca0bf0acee9p+1},
{0x1.50d83b6f7788bp+6, -0x1.82a0417f98419p+2, -0x1.e18432a6676edp+2},
{0x1.6567db05a012cp+6, -0x1.27d55f8b64f16p+4, 0x1.271e9400a42e4p+4},
{0x1.6723b3feab73ap+6, -0x1.0f412c5a09d1ap+4, 0x1.dae43f7f7eb6ep+3},
{0x1.6910cf423acf1p+6, -0x1.f152d3d18c3b3p+3, 0x1.6c04c44876eb2p+3},
{0x1.6bd948eca017fp+6, -0x1.bc29d2c53f57ap+3, 0x1.c44a28d107a62p+2},
{0x1.6f8a69cf10b1p+6, -0x1.84b224c6d040cp+3, 0x1.1c910c629db67p+1},
{0x1.7429ebc4e406dp+6, -0x1.4f4a0b735c531p+3, -0x1.73a39097eadefp+1},
{0x1.7acf7694f8c6p+5, 0x1.0f40ef4bed7e8p+4, 0x1.2f88d81b23f2ep+3},
{0x1.87b52573912c8p+5, 0x1.3e9cadbae2c71p+4, -0x1.21c127942ffc2p-1},
{0x1.95308092c646cp+5, 0x1.4bd8ec93cbe28p+4, -0x1.b1ad2fc6cd5ccp+2},
{0x1.a743d71712a69p+5, 0x1.4b428f09e4704p+4, -0x1.984b766ca527bp+3},
{0x1.bd35da1ada54ap+5, 0x1.3ee7b023f1a36p+4, -0x1.252f399063a3p+4},
{0x1.d638af110e2bfp+5, 0x1.2a6369728426p+4, -0x1.777a4238ecc9cp+4},
{0x1.c5db1e678f93bp+5, 0x1.be23ef0d11b9fp+2, 0x1.706e52e6555aep+3},
{0x1.ceab15b1e5e2cp+5, 0x1.376364145a451p+3, 0x1.d7fd2a954eedcp+1},
{0x1.d8302a174d63dp+5, 0x1.67a05469bf7c1p+3, -0x1.0236bbe6ffddap+1},
{0x1.e56c6a282c6fep+5, 0x1.8915eed9a5994p+3, -0x1.fb2d49a257381p+2},
{0x1.f622a3ef65e7fp+5, 0x1.98638aed6156bp+3, -0x1.b57e66e36241ap+3},
{0x1.04f5c4d9c25cfp+6, 0x1.9710ff57a7b7ap+3, -0x1.32004fe7bd5b5p+4},
{0x1.018127d59826cp+6, 0x1.1e619caaa3a8fp-1, 0x1.a49bd0215a96dp+3},
{0x1.04e57659b4cf6p+6, 0x1.8024718692a3cp+1, 0x1.addd1b874609p+2},
{0x1.089bd543a0e63p+6, 0x1.2a7652607e02cp+2, 0x1.8d85013677bap+0},
{0x1.0ddb424d04fadp+6, 0x1.889c9b8223651p+2, -0x1.05aa1bc86a9d4p+2},
{0x1.149da8fbd8909p+6, 0x1.ce4542c130c31p+2, -0x1.3934aac98d184p+3},
{0x1.1cca409e32c6dp+6, 0x1.f855300b25ba5p+2, -0x1.eac45e49f86bap+3},
{0x1.23f3e081f0e6fp+6, -0x1.587d5d644e818p+2, 0x1.deea03a7e9e2p+3},
{0x1.26935d2d5bb58p+6, -0x1.a6ab45ebb79ddp+1, 0x1.38265c4c6d156p+3},
{0x1.29783d4927cb6p+6, -0x1.aa081e388f0b6p+0, 0x1.4de28afb99798p+2},
{0x1.2d9b5abdd0df6p+6, -0x1.90d2c34c4c8p-11, -0x1.a96c3913736p-8},
{0x1.3303704c60227p+6, 0x1.7842d686da2p+0, -0x1.6001098473213p+2},
{0x1.39a911d79bf6cp+6, 0x1.51ae39272f6fp+1, -0x1.604eff9e13224p+3},
{0x1.483b66bb75f41p+6, -0x1.53e4a65e5bd0ep+3, 0x1.0dfa4f4feec89p+4},
{0x1.4a4cab5bdb777p+6, -0x1.1bf0c7950b46ap+3, 0x1.9433415e2e559p+3},
{0x1.4c9756fc325a6p+6, -0x1.d6e499fe26166p+2, 0x1.1693b52228314p+3},
{0x1.4fe3e8502420ap+6, -0x1.6b29463056a7ep+2, 0x1.fcea504279e1bp+1},
{0x1.543e4f84c51c9p+6, -0x1.01c201c3fcfbep+2, -0x1.311b349896504p+0},
{0x1.59a86b698fe17p+6, -0x1.4697ac30fd276p+1, -0x1.a218614573a54p+2},
{0x1.6d3f94c53849cp+6, -0x1.e750c3b6abf94p+3, 0x1.2cfd8e3a3298cp+4},
{0x1.6ee9ffc7c561bp+6, -0x1.b847cb4caca9ap+3, 0x1.ea32a397a5ea3p+3},
{0x1.70c3ef56a2364p+6, -0x1.8cc812a446223p+3, 0x1.7e0dc7e1aa4eep+3},
{0x1.737125604c02dp+6, -0x1.5959ff3792892p+3, 0x1.ed9e6884d6db8p+2},
{0x1.76fef3ccb11e4p+6, -0x1.2379a952d29eap+3, 0x1.77d044e094287p+1},
{0x1.7b739668b58adp+6, -0x1.def62d62ac5d3p+2, -0x1.1242c0559f9b9p+1},
{0x1.b9af6705b3e1ap+5, 0x1.3c46b4e4aa724p+4, 0x1.61ea416f62116p+3},
{0x1.c34652a386648p+5, 0x1.673d5400dac6ap+4, 0x1.575529f864e4ap+1},
{0x1.cd90a5a7155efp+5, 0x1.7aac661c86347p+4, -0x1.97f5d2781d1d2p+1},
{0x1.dbc2183aadc6dp+5, 0x1.83f34257f81ecp+4, -0x1.24c7f27451716p+3},
{0x1.ed84b050fd5fep+5, 0x1.823e0b9a9286fp+4, -0x1.dc10370a896a1p+3},
{0x1.012d3f7585d8bp+6, 0x1.772916c92c8cp+4, -0x1.444d46ad4a3f5p+4},
{0x1.f498a57d50c8dp+5, 0x1.72c50647a1b01p+3, 0x1.9501b7bc92a26p+3},
{0x1.fbec5add8799fp+5, 0x1.c10937ac1ff0cp+3, 0x1.71506b03a0cfcp+2},
{0x1.01f4d75996fc6p+6, 0x1.f168c838b27a5p+3, 0x1.a2871b4170f08p-2},
{0x1.07934868d42f1p+6, 0x1.0ba82dcee8d5fp+4, -0x1.55f50c12fdb69p+2},
{0x1.0ec4c024626fep+6, 0x1.16b4701bb2cep+4, -0x1.627c9a1b01177p+3},
{0x1.1768d8b0aa031p+6, 0x1.199f4e2e9e65fp+4, -0x1.09c1c4e924702p+4},
{0x1.14522a4a9a7e2p+6, 0x1.6020b0a7ecac7p+2, 0x1.c1a8f99df62d9p+3},
{0x1.174b930ef061ap+6, 0x1.ec83068a9839fp+2, 0x1.06f134f7cc07ep+3},
{0x1.1a90921a38fe7p+6, 0x1.28d89eb448a2cp+3, 0x1.ab5fe99a94265p+1},
{0x1.1f36b9520ad75p+6, 0x1.57ace8397fb96p+3, -0x1.0feb2da7758d4p+1},
{0x1.253f2b741784fp+6, 0x1.7c087d08384b1p+3, -0x1.efdb49212f992p+2},
{0x1.2c9a998952cf1p+6, 0x1.9366b5a4edd8ap+3, -0x1.a9848b6099745p+3},
{0x1.330541ae3e385p+6, -0x1.39e238ea7801p-1, 0x1.f5ec9f058d778p+3},
{0x1.3568ff8940412p+6, 0x1.4b2aea6a2b17bp+0, 0x1.5aadb9534e15p+3},
{0x1.380d495b09ffp+6, 0x1.6b2260c162acep+1, 0x1.a0b3e40fdedfp+2},
{0x1.3bd6db55a86abp+6, 0x1.1c0894632c07ep+2, 0x1.73acfbc73a52cp+0},
{0x1.40ced5740b6ecp+6, 0x1.784d8d5bd59bap+2, -0x1.f87f29ae0432ap+1},
{0x1.46f1d56d6a627p+6, 0x1.c2acec311d85p+2, -0x1.2d078d1d0ec93p+3},
{0x1.54692a261ff77p+6, -0x1.91aafde5841e2p+2, 0x1.1733b7c5acf09p+4},
{0x1.5657fb0185f53p+6, -0x1.292fef1c6094ap+2, 0x1.adacb9827ba1ep+3},
{0x1.587cf8c168362p+6, -0x1.9aa045411de21p+1, 0x1.34f47fa15abacp+3},
{0x1.5b946ca219efdp+6, -0x1.98465c0dc7b2ap+0, 0x1.43ded9d06d2f2p+2},
{0x1.5faadb5249c01p+6, -0x1.d35a0bdd6ap-11, -0x1.f008c176226p-8},
{0x1.64c3b31613c93p+6, 0x1.6ffd305ac700dp+0, -0x1.52580b551209ep+2},
{0x1.773c645e32d2dp+6, -0x1.6c001f7fba478p+3, 0x1.3482f283026fp+4},
{0x1.78d215b19332bp+6, -0x1.3f6c1cce8d703p+3, 0x1.fda06ae8dbf53p+3},
{0x1.7a9531dc8addap+6, -0x1.15dd42d16c7e4p+3, 0x1.94e8098e96fccp+3},
{0x1.7d21e2193d5bcp+6, -0x1.c8c718caa9f8ep+2, 0x1.1105d830d79dp+3},
{0x1.808572bc9578ap+6, -0x1.607bf910c57eep+2, 0x1.ebe2b93545493p+1},
{0x1.84c6a7914070fp+6, -0x1.f6c2ba3dfc25ap+1, -0x1.2beab2de5e36ep+0},
{0x1.f663baac570efp+5, 0x1.67be9f690c994p+4, 0x1.928e76c3750aep+3},
{0x1.fdd78bfa0c16bp+5, 0x1.8da11d29326eap+4, 0x1.63128e5e5d16fp+2},
{0x1.02fa8211ca545p+6, 0x1.a3a4c44447321p+4, 0x1.04d0a318f0ebp-3},
{0x1.08ace6a6b1bbcp+6, 0x1.b32f97fdc6c72p+4, -0x1.69ea7f28a916ap+2},
{0x1.0ff3cb8943e81p+6, 0x1.b9bf03db71bbbp+4, -0x1.6cb54bc7e9c6p+3},
{0x1.18ac5c68852cdp+6, 0x1.b753a9bd5dbeep+4, -0x1.0ebf0dff35bfbp+4},
{0x1.12e57190e4906p+6, 0x1.f7243f8456bc9p+3, 0x1.bbbf019d6f15fp+3},
{0x1.15f567ae01685p+6, 0x1.1e238872ebfe1p+4, 0x1.f5db81101607bp+2},
{0x1.1952176f81196p+6, 0x1.35eb43e1b3454p+4, 0x1.6f044118da651p+1},
{0x1.1e17b3f5be1e9p+6, 0x1.4aa233635e996p+4, -0x1.54536023af51fp+1},
{0x1.244540fde90c8p+6, 0x1.590428a4cd957p+4, -0x1.09fd595c81312p+3},
{0x1.2bc8d270727cdp+6, 0x1.6002d76c0fae1p+4, -0x1.bbbb8dd0769e1p+3},
{0x1.2910051d7f4b8p+6, 0x1.4505f3d8c93bep+3, 0x1.e1f0441f64aep+3},
{0x1.2ba848891bba1p+6, 0x1.83d80a13be75dp+3, 0x1.39f759ee811ebp+3},
{0x1.2e852380cafc2p+6, 0x1.b3d439de20201p+3, 0x1.5018eb1694a48p+2},
{0x1.329c951f395aap+6, 0x1.e28db45c54996p+3, 0x1.689e197414bp-7},
{0x1.37f5013da44b7p+6, 0x1.04846845ce376p+4, -0x1.5f9623aa14c25p+2},
{0x1.3e86c9cea44c3p+6, 0x1.11f59319394fdp+4, -0x1.6049926fe33dap+3},
{0x1.443efb939f1d1p+6, 0x1.0a131d35fab88p+2, 0x1.0838884c6c35ap+4},
{0x1.4667729b66dbap+6, 0x1.793a281884d1p+2, 0x1.8155ad5254ba1p+3},
{0x1.48cb51f255527p+6, 0x1.d609d14c020d1p+2, 0x1.fd82e0735fdcep+2},
{0x1.4c3af36c4bb13p+6, 0x1.1c709781a9fb2p+3, 0x1.8ca66dc4e33fdp+1},
{0x1.50c14ed0ba88bp+6, 0x1.4a1d653379591p+3, -0x1.14ee52d3fd0e1p+1},
{0x1.565e87fd89a8p+6, 0x1.6fe5c4c37980fp+3, -0x1.e3e3e3d81f648p+2},
{0x1.62b687ada6a2dp+6, -0x1.b1a7c98c53b9bp+0, 0x1.221d2fc2be6cp+4},
{0x1.6480f342fedfap+6, -0x1.728e49c5a9ba8p-3, 0x1.cb44060a17de8p+3},
{0x1.667e081a8e931p+6, 0x1.2c204353d8acp+0, 0x1.582d07a1ac706p+3},
{0x1.695d03a4b4ea6p+6, 0x1.5b9dd1e5192c9p+1, 0x1.949cc8da7db3dp+2},
{0x1.6d2ad25b49139p+6, 0x1.10c661536b1e3p+2, 0x1.60b9aee667ea2p+0},
{0x1.71ec510363cccp+6, 0x1.6b2af260ca3f1p+2, -0x1.e8e3d6769ed61p+1},
{0x1.83323c984ee7ap+6, -0x1.c8df58716d4cbp+2, 0x1.3d9335b5d20f9p+4},
{0x1.84b109344c92cp+6, -0x1.750134f94569cp+2, 0x1.0a63166d3ca32p+4},
{0x1.865ae5967696dp+6, -0x1.260f129da839ep+2, 0x1.b00f6d0ac1f93p+3},
{0x1.88c3891dbffdp+6, -0x1.8e7bf5d542ea4p+1, 0x1.30323669c3d67p+3},
{0x1.8bf825267af8ep+6, -0x1.89d8c0f2ba1ffp+0, 0x1.3b2af0c9eed76p+2},
{0x1.8ffffbb77c76ap+6, -0x1.09cab717214p-10, -0x1.1a1aa7765a7p-7},
{0x1.ae1c063cf8075p+3, -0x1.1dcc8d6b21p-13, -0x1.2f56d49352fp-10},
{0x1.23869fde6955fp+4, -0x1.836d13c82dp-13, -0x1.9b340cb2926p-10},
{0x1.6a51d9755cb1ep+4, -0x1.e1821bf6d08p-13, -0x1.ff0f3c5806ap-10},
{0x1.adca073d0c9a1p+4, -0x1.1d961152df8p-12, -0x1.2f1d00745cap-9},
{0x1.eeb26a3638306p+4, -0x1.48b751f0a58p-12, -0x1.5ce3e1a3db8p-9},
{0x1.16c4868a9dbc4p+5, -0x1.7278906708p-12, -0x1.89352628678p-9},
{0x1.3552cb4726ed2p+5, -0x1.9b140ac6fbp-12, -0x1.b44e9f2325p-9},
{0x1.53242132979b2p+5, -0x1.c2b46f9c328p-12, -0x1.de5d99b6f9p-9},
{0x1.7051013cf5a69p+5, -0x1.e97a44c10a8p-12, -0x1.03c24d5b897p-8},
{0x1.8ceca3a0569fdp+5, -0x1.07bf8a7e0fcp-11, -0x1.17ef5f1c441p-8},
{0x1.a9067ed63306p+5, -0x1.1a6bb67a6bp-11, -0x1.2bc0e9df0a8p-8},
{0x1.c4ab42f91535bp+5, -0x1.2cca14a233p-11, -0x1.3f3fe0662d2p-8},
{0x1.dfe5855ae1528p+5, -0x1.3ee1ad40618p-11, -0x1.5273b9784a3p-8},
{0x1.fabe397d15c9dp+5, -0x1.50b872fc158p-11, -0x1.6562c531248p-8},
{0x1.0a9e8459f8d9ap+6, -0x1.62537d1958p-11, -0x1.78126ad030ep-8},
{0x1.17b44990f13f5p+6, -0x1.73b732a42fp-11, -0x1.8a87568ccdp-8},
{0x1.24a350705ddf4p+6, -0x1.84e76b1c308p-11, -0x1.9cc59c424aap-8},
{0x1.316e23ed9d96ap+6, -0x1.95e7879947p-11, -0x1.aed0d2216dp-8},
{0x1.3e1704b29c069p+6, -0x1.a6ba8679e08p-11, -0x1.c0ac258f992p-8},
{0x1.4a9ff4d8984e6p+6, -0x1.b76312f3808p-11, -0x1.d25a6bb27acp-8},
{0x1.570ac151c1615p+6, -0x1.c7e3919c138p-11, -0x1.e3de2eb684p-8},
{0x1.6359098c40c61p+6, -0x1.d83e2a89bbp-11, -0x1.f539b894d66p-8},
{0x1.6f8c45b456692p+6, -0x1.e874d1a7f5p-11, -0x1.03378df3804p-7},
{0x1.7ba5cbe12c3fcp+6, -0x1.f8894d9602p-11, -0x1.0bc01d99c93p-7},
};
// http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
constexpr double sRGB_D65[] {
0.4124564, 0.3575761, 0.1804375,
0.2126729, 0.7151522, 0.0721750,
0.0193339, 0.1191920, 0.9503041,
};
// http://www.brucelindbloom.com/index.html?WorkingSpaceInfo.html
constexpr double illuminant_D65[] {
0.95047, 1.00000, 1.08883,
// Perform the inverse gamma companding for a sRGB color
// http://www.brucelindbloom.com/index.html?Eqn_RGB_to_XYZ.html
// double inverseGammaCompanding(int c) {
// // [0, 255] to [0, 1]
// double v = c / 255.0;
// if (v <= 0.04045) {
// return v / 12.92;
// }
// return std::pow((v + 0.055) / 1.055, 2.4);
// };
constexpr double RGB888_to_sRGB_table[] {
0x0p+0, 0x1.3e45677c176f7p-12, 0x1.3e45677c176f7p-11, 0x1.dd681b3a23272p-11,
0x1.3e45677c176f7p-10, 0x1.8dd6c15b1d4b4p-10, 0x1.dd681b3a23272p-10, 0x1.167cba8c94818p-9,
0x1.3e45677c176f7p-9, 0x1.660e146b9a5d6p-9, 0x1.8dd6c15b1d4b4p-9, 0x1.b6a31b5259c99p-9,
0x1.e1e31d70c99ddp-9, 0x1.07c38bf8583a9p-8, 0x1.1fcc2beed6421p-8, 0x1.390ffaf95e279p-8,
0x1.53936cc7bc928p-8, 0x1.6f5addb50c915p-8, 0x1.8c6a94031b561p-8, 0x1.aac6c0fb97351p-8,
0x1.ca7381f9f602bp-8, 0x1.eb74e160978dp-8, 0x1.06e76bbda92b8p-7, 0x1.18c2a5a8a8044p-7,
0x1.2b4e09b3f0ae3p-7, 0x1.3e8b7b3bde965p-7, 0x1.527cd60af8b85p-7, 0x1.6723eea8d3709p-7,
0x1.7c8292a3db6b3p-7, 0x1.929a88d67b521p-7, 0x1.a96d91a8016bdp-7, 0x1.c0fd67499fab6p-7,
0x1.d94bbdefd740ep-7, 0x1.f25a44089883fp-7, 0x1.061551372c694p-6, 0x1.135f3e4c2cce2p-6,
0x1.210bb8642b172p-6, 0x1.2f1b8c1ae46bdp-6, 0x1.3d8f839b79c0bp-6, 0x1.4c6866b3e9fa4p-6,
0x1.5ba6fae794313p-6, 0x1.6b4c0380d2deep-6, 0x1.7b5841a1bf3acp-6, 0x1.8bcc74542addbp-6,
0x1.9ca95898dc8b5p-6, 0x1.adefa9761c02p-6, 0x1.bfa0200597bd9p-6, 0x1.d1bb7381aec1fp-6,
0x1.e442595227bcap-6, 0x1.f73585185e1b5p-6, 0x1.054ad45d76878p-5, 0x1.0f31ba386ff26p-5,
0x1.194fcb663747bp-5, 0x1.23a55e62a662ap-5, 0x1.2e32c8e148d11p-5, 0x1.38f85fd21eacfp-5,
0x1.43f67766310ffp-5, 0x1.4f2d6313fa8dp-5, 0x1.5a9d759ba5edp-5, 0x1.6647010b254eep-5,
0x1.722a56c2239eep-5, 0x1.7e47c775d2427p-5, 0x1.8a9fa33494b07p-5, 0x1.973239698b9ccp-5,
0x1.a3ffd8e001389p-5, 0x1.b108cfc6b7fbcp-5, 0x1.be4d6bb31d522p-5, 0x1.cbcdf9a4616f2p-5,
0x1.d98ac60675833p-5, 0x1.e7841cb4f16dfp-5, 0x1.f5ba48fde2048p-5, 0x1.0216cad240765p-4,
0x1.096f2671eb815p-4, 0x1.10e65c38a5192p-4, 0x1.187c90bf8bce2p-4, 0x1.2031e85f5d6dap-4,
0x1.28068731a1952p-4, 0x1.2ffa9111cb94bp-4, 0x1.380e299e53f92p-4, 0x1.40417439ca10fp-4,
0x1.4894940bddbfbp-4, 0x1.5107ac0261e59p-4, 0x1.599aded247aacp-4, 0x1.624e4ef892ed4p-4,
0x1.6b221ebb4817ep-4, 0x1.7416702a539d1p-4, 0x1.7d2b65206b527p-4, 0x1.86611f43e9e6ap-4,
0x1.8fb7c007a4a7p-4, 0x1.992f68abbbc89p-4, 0x1.a2c83a3e6566dp-4, 0x1.ac82559cb3644p-4,
0x1.b65ddb7354604p-4, 0x1.c05aec3f4fe5ep-4, 0x1.ca79a84ebe03p-4, 0x1.d4ba2fc17a6a5p-4,
0x1.df1ca289d34b8p-4, 0x1.e9a1206d34003p-4, 0x1.f447c904cbb4ep-4, 0x1.ff10bbbe302c2p-4,
0x1.04fe0bedfe5f1p-3, 0x1.0a84fe3b36d8fp-3, 0x1.101d443dfc06fp-3, 0x1.15c6ed58eefdfp-3,
0x1.1b8208da5fefp-3, 0x1.214ea5fc9514ap-3, 0x1.272cd3e610123p-3, 0x1.2d1ca1a9d1cfbp-3,
0x1.331e1e479cdf5p-3, 0x1.393158ac3674ep-3, 0x1.3f565fb1a5fd5p-3, 0x1.458d421f735dfp-3,
0x1.4bd60eaae3e73p-3, 0x1.5230d3f736034p-3, 0x1.589da095dbaa1p-3, 0x1.5f1c8306b3a3cp-3,
0x1.65ad89b841a2bp-3, 0x1.6c50c307e53bfp-3, 0x1.73063d420fc8p-3, 0x1.79ce06a279303p-3,
0x1.80a82d5453b5dp-3, 0x1.8794bf727eb3fp-3, 0x1.8e93cb07b8679p-3, 0x1.95a55e0ecec0bp-3,
0x1.9cc98672cf47ep-3, 0x1.a400520f3619cp-3, 0x1.ab49ceb01c003p-3, 0x1.b2a60a1263b0ap-3,
0x1.ba1511e3e632dp-3, 0x1.c196f3c39e76fp-3, 0x1.c92bbd41d41fep-3, 0x1.d0d37be045851p-3,
0x1.d88e3d1250f68p-3, 0x1.e05c0e3d1d3ep-3, 0x1.e83cfcb7c16fp-3, 0x1.f03115cb6bfd3p-3,
0x1.f83866b38924dp-3, 0x1.00297e4ef4553p-2, 0x1.044072557177ap-2, 0x1.086115f6beb3ap-2,
0x1.0c8b6fb5c735ep-2, 0x1.10bf860ef039ap-2, 0x1.14fd5f782a5a6p-2, 0x1.1945026102997p-2,
0x1.1d967532b31b1p-2, 0x1.21f1be50339e7p-2, 0x1.2656e41649ae3p-2, 0x1.2ac5ecdb988f8p-2,
0x1.2f3edef0b0ed8p-2, 0x1.33c1c0a020438p-2, 0x1.384e982e800b1p-2, 0x1.3ce56bda84a81p-2,
0x1.418641dd0c1bcp-2, 0x1.463120692c7afp-2, 0x1.4ae60dac4229dp-2, 0x1.4fa50fcdfde15p-2,
0x1.546e2cf0727a9p-2, 0x1.59416b3022858p-2, 0x1.5e1ed0a40daabp-2, 0x1.6306635dbdd7bp-2,
0x1.67f82969543a2p-2, 0x1.6cf428cd96079p-2, 0x1.71fa678bf915dp-2, 0x1.770aeba0b042ap-2,
0x1.7c25bb02b7ac5p-2, 0x1.814adba3e0bd9p-2, 0x1.867a5370de0b1p-2, 0x1.8bb428514f067p-2,
0x1.90f86027cb84ep-2, 0x1.964700d1ef1b1p-2, 0x1.9ba0102864521p-2, 0x1.a10393feefafdp-2,
0x1.a67192247a9bep-2, 0x1.abea10631e195p-2, 0x1.b16d14802d5cap-2, 0x1.b6faa43c403bbp-2,
0x1.bc92c5533d785p-2, 0x1.c2357d7c64e5dp-2, 0x1.c7e2d26a596dep-2, 0x1.cd9ac9cb2aef2p-2,
0x1.d35d69485ffc5p-2, 0x1.d92ab686ff782p-2, 0x1.df02b7279a10dp-2, 0x1.e4e570c6539c5p-2,
0x1.ead2e8faec526p-2, 0x1.f0cb2558c9ea4p-2, 0x1.f6ce2b6f00983p-2, 0x1.fcdc00c85bec2p-2,
0x1.017a5575b3cb2p-1, 0x1.048c17ad3c04bp-1, 0x1.07a349c9d9837p-1, 0x1.0abfee888c05p-1,
0x1.0de208a4444c8p-1, 0x1.11099ad5e83ebp-1, 0x1.1436a7d456eefp-1, 0x1.176932546ca12p-1,
0x1.1aa13d0906bdap-1, 0x1.1ddecaa307b85p-1, 0x1.2121ddd15aecep-1, 0x1.246a7940f86d1p-1,
0x1.27b89f9ce8c4bp-1, 0x1.2b0c538e48b07p-1, 0x1.2e6597bc4ccap-1, 0x1.31c46ecc4528dp-1,
0x1.3528db61a0f73p-1, 0x1.3892e01df1fccp-1, 0x1.3c027fa0f01ebp-1, 0x1.3f77bc887cd3bp-1,
0x1.42f29970a68f8p-1, 0x1.467318f3ac22dp-1, 0x1.49f93daa00113p-1, 0x1.4d850a2a4bde1p-1,
0x1.51168109734e5p-1, 0x1.54ada4da97a1bp-1, 0x1.584a782f1ac23p-1, 0x1.5becfd96a2698p-1,
0x1.5f95379f1b3edp-1, 0x1.634328d4bbe97p-1, 0x1.66f6d3c2081cfp-1, 0x1.6ab03aefd39aap-1,
0x1.6e6f60e5452b1p-1, 0x1.72344827d98f6p-1, 0x1.75fef33b6669bp-1, 0x1.79cf64a21d1e2p-1,
0x1.7da59edc8dabp-1, 0x1.8181a469a9787p-1, 0x1.856377c6c6224p-1, 0x1.894b1b6fa0377p-1,
0x1.8d3891de5df49p-1, 0x1.912bdd8b91f45p-1, 0x1.952500ee3dda5p-1, 0x1.9923fe7bd4f67p-1,
0x1.9d28d8a83edfcp-1, 0x1.a13391e5da09fp-1, 0x1.a5442ca57e52ep-1, 0x1.a95aab567f88fp-1,
0x1.ad771066afec2p-1, 0x1.b1995e4262a69p-1, 0x1.b5c197546e3f8p-1, 0x1.b9efbe062f086p-1,
0x1.be23d4bf8981bp-1, 0x1.c25ddde6ecbbbp-1, 0x1.c69ddbe154af1p-1, 0x1.cae3d1124c90bp-1,
0x1.cf2fbfdbf11f1p-1, 0x1.d381aa9ef2e82p-1, 0x1.d7d993ba988d4p-1, 0x1.dc377d8cc0fd5p-1,
0x1.e09b6a71e5aa6p-1, 0x1.e5055cc51cbb4p-1, 0x1.e97556e01b351p-1, 0x1.edeb5b1b37216p-1,
0x1.f2676bcd69adep-1, 0x1.f6e98b4c51466p-1, 0x1.fb71bbec33ab2p-1, 0x1p+0,
};
// clang-format on
// convert a sRGB (D65) color to CIELAB (D65)
CieLab rgbToLab(QRgb rgb)
// convert a RGB color to Oklab (https://bottosson.github.io/posts/oklab/)
Lab rgbToOklab(QRgb rgb)
{
// Perform the inverse gamma companding for a sRGB color
// http://www.brucelindbloom.com/index.html?Eqn_RGB_to_XYZ.html
auto inverseGammaCompanding = [](int c) {
if (c <= 10) {
return c / (255.0 * 12.92);
} else {
return std::pow((c / 255.0 + 0.055) / 1.055, 2.4);
}
};
const double r = RGB888_to_sRGB_table[qRed(rgb)];
const double g = RGB888_to_sRGB_table[qGreen(rgb)];
const double b = RGB888_to_sRGB_table[qBlue(rgb)];
const double r = inverseGammaCompanding(qRed(rgb));
const double g = inverseGammaCompanding(qGreen(rgb));
const double b = inverseGammaCompanding(qBlue(rgb));
const double l = std::cbrt(0.4122214708 * r + 0.5363325363 * g + 0.0514459929 * b);
const double m = std::cbrt(0.2119034982 * r + 0.6806995451 * g + 0.1073969566 * b);
const double s = std::cbrt(0.0883024619 * r + 0.2817188376 * g + 0.6299787005 * b);
const double x = (r * sRGB_D65[0] + g * sRGB_D65[1] + b * sRGB_D65[2]);
const double y = (r * sRGB_D65[3] + g * sRGB_D65[4] + b * sRGB_D65[5]);
const double z = (r * sRGB_D65[6] + g * sRGB_D65[7] + b * sRGB_D65[8]);
// http://www.brucelindbloom.com/index.html?Eqn_XYZ_to_Lab.html
auto f = [](double t) {
if (t > 216.0 / 24389.0) {
return std::cbrt(t);
} else {
return t * (24389.0 / (27.0 * 116.0)) + 4.0 / 29.0;
}
};
const double f_x = f(x / illuminant_D65[0]);
const double f_y = f(y / illuminant_D65[1]);
const double f_z = f(z / illuminant_D65[2]);
return CieLab{
116.0 * f_y - 16.0,
500.0 * (f_x - f_y),
200.0 * (f_y - f_z),
// M2 * 100 * {l', m', s'}
return Lab{
(021.04542553 * l + 079.36177850 * m - 000.40720468 * s),
(197.79984951 * l - 242.85922050 * m + 045.05937099 * s),
(002.59040371 * l + 078.27717662 * m - 080.86757660 * s),
};
}
@@ -485,12 +528,12 @@ inline double computeHPrimeBar(double C1_prime, double C2_prime, double h1_prime
/// Calculate the perceptual color difference based on CIEDE2000.
/// https://en.wikipedia.org/wiki/Color_difference#CIEDE2000
/// \return The color difference of the two colors.
double calculate_CIEDE2000(const CieLab &color1, const CieLab &color2)
double calculate_CIEDE2000(const Lab &color1, const Lab &color2)
{
const double L1 = color1.l;
const double L1 = color1.L;
const double a1 = color1.a;
const double b1 = color1.b;
const double L2 = color2.l;
const double L2 = color2.L;
const double a2 = color2.a;
const double b2 = color2.b;
@@ -585,17 +628,17 @@ struct AnsiBuffer {
}
// clang-format off
constexpr char const* tb2digits =
"00" "01" "02" "03" "04" "05" "06" "07" "08" "09"
"10" "11" "12" "13" "14" "15" "16" "17" "18" "19"
"20" "21" "22" "23" "24" "25" "26" "27" "28" "29"
"30" "31" "32" "33" "34" "35" "36" "37" "38" "39"
"40" "41" "42" "43" "44" "45" "46" "47" "48" "49"
"50" "51" "52" "53" "54" "55" "56" "57" "58" "59"
"60" "61" "62" "63" "64" "65" "66" "67" "68" "69"
"70" "71" "72" "73" "74" "75" "76" "77" "78" "79"
"80" "81" "82" "83" "84" "85" "86" "87" "88" "89"
"90" "91" "92" "93" "94" "95" "96" "97" "98" "99";
constexpr char const* tb2digits =
"00" "01" "02" "03" "04" "05" "06" "07" "08" "09"
"10" "11" "12" "13" "14" "15" "16" "17" "18" "19"
"20" "21" "22" "23" "24" "25" "26" "27" "28" "29"
"30" "31" "32" "33" "34" "35" "36" "37" "38" "39"
"40" "41" "42" "43" "44" "45" "46" "47" "48" "49"
"50" "51" "52" "53" "54" "55" "56" "57" "58" "59"
"60" "61" "62" "63" "64" "65" "66" "67" "68" "69"
"70" "71" "72" "73" "74" "75" "76" "77" "78" "79"
"80" "81" "82" "83" "84" "85" "86" "87" "88" "89"
"90" "91" "92" "93" "94" "95" "96" "97" "98" "99";
// clang-format on
auto *p = tb2digits + x * 2;
@@ -608,13 +651,13 @@ struct AnsiBuffer {
int idx = 0;
auto it = colorCache.find(rgb);
if (it == colorCache.end()) {
const auto lab = rgbToLab(rgb);
const auto lab = rgbToOklab(rgb);
// find the nearest xterm color
for (CieLab const &xtermLab : xterm240Labs) {
for (Lab const &xtermLab : xterm240_Oklabs) {
auto dist2 = calculate_CIEDE2000(lab, xtermLab);
if (dist2 < dist) {
dist = dist2;
idx = &xtermLab - xterm240Labs;
idx = &xtermLab - xterm240_Oklabs;
}
}
// add 16 to convert 240 colors mode to 256 colors mode
@@ -666,7 +709,7 @@ private:
}
};
void fillString(QString &s, int n, const QString &fill)
void fillString(QString &s, int n, QStringView fill)
{
if (n > 0) {
for (; n > fill.size(); n -= fill.size()) {
@@ -684,22 +727,22 @@ struct GraphLine {
int nextLabelOffset = 0;
template<class String>
void pushLabel(int offset, String const &s, int charCounter)
void pushLabel(int offset, String const &s, int numberDisplayableChar)
{
Q_ASSERT(offset >= labelLineLength);
const int n = offset - labelLineLength;
labelLineLength += charCounter + n;
labelLineLength += numberDisplayableChar + n;
fillLine(labelLine, n);
labelLine += s;
nextLabelOffset = labelLineLength;
}
template<class String>
void pushGraph(int offset, String const &s, int charCounter)
void pushGraph(int offset, String const &s, int numberDisplayableChar)
{
Q_ASSERT(offset >= graphLineLength);
const int n = offset - graphLineLength;
graphLineLength += charCounter + n;
graphLineLength += numberDisplayableChar + n;
fillLine(graphLine, n);
const int ps1 = graphLine.size();
graphLine += s;
@@ -787,8 +830,8 @@ public:
bool firstLine = true;
State state;
while (!in.atEnd()) {
const QString currentLine = in.readLine();
QString currentLine;
while (in.readLineInto(&currentLine)) {
auto oldState = state;
state = highlightLine(currentLine, state);
@@ -896,7 +939,7 @@ private:
/**
* Append the context name in front of the format name.
*/
void appendContextNames(State &state, const QString &currentLine)
void appendContextNames(State &state, QStringView currentLine)
{
auto newState = state;
for (auto &fragment : m_highlightedFragments) {
@@ -1152,7 +1195,7 @@ class KSyntaxHighlighting::AnsiHighlighterPrivate
public:
QTextStream out;
QFile file;
QString currentLine;
QStringView currentLine;
// pairs of startColor / resetColor
std::vector<QPair<QString, QString>> ansiStyles;
};
@@ -1234,14 +1277,21 @@ void AnsiHighlighter::highlightData(QIODevice *dev, AnsiFormat format, bool useE
backgroundDefaultColor = backgroundColorBuffer.latin1().mid(2);
}
// ansiStyles must not be empty for applyFormat to work even with a definition without any context
if (d->ansiStyles.empty()) {
d->ansiStyles.resize(32);
} else {
d->ansiStyles[0].first.clear();
d->ansiStyles[0].second.clear();
}
// initialize ansiStyles
for (auto &&definition : std::as_const(definitions)) {
const auto formats = definition.formats();
for (auto &&format : formats) {
for (auto &&format : std::as_const(DefinitionData::get(definition)->formats)) {
const auto id = format.id();
if (id >= d->ansiStyles.size()) {
// better than id + 1 to avoid successive allocations
d->ansiStyles.resize(std::max(std::size_t(id * 2), std::size_t(32)));
d->ansiStyles.resize(id * 2);
}
AnsiBuffer buffer;
@@ -1326,8 +1376,9 @@ void AnsiHighlighter::highlightData(QIODevice *dev, AnsiFormat format, bool useE
if (!traceOptions) {
State state;
while (!in.atEnd()) {
d->currentLine = in.readLine();
QString currentLine;
while (in.readLineInto(&currentLine)) {
d->currentLine = currentLine;
state = highlightLine(d->currentLine, state);
if (useEditorBackground) {
@@ -1358,5 +1409,5 @@ void AnsiHighlighter::highlightData(QIODevice *dev, AnsiFormat format, bool useE
void AnsiHighlighter::applyFormat(int offset, int length, const Format &format)
{
auto const &ansiStyle = d->ansiStyles[format.id()];
d->out << ansiStyle.first << QStringView(d->currentLine).mid(offset, length) << ansiStyle.second;
d->out << ansiStyle.first << d->currentLine.mid(offset, length) << ansiStyle.second;
}

View File

@@ -20,6 +20,7 @@ namespace KSyntaxHighlighting
{
class AnsiHighlighterPrivate;
// Exported for a bundled helper program
class KSYNTAXHIGHLIGHTING_EXPORT AnsiHighlighter final : public AbstractHighlighter
{
public:

View File

@@ -91,7 +91,7 @@ void Context::resolveIncludes(DefinitionData &def)
if (idx == 0) {
context = defData->initialContext();
} else {
context = defData->contextByName(contextName.left(idx));
context = defData->contextByName(QStringView(contextName).left(idx));
}
}

View File

@@ -28,7 +28,7 @@ void ContextSwitch::resolve(DefinitionData &def, QStringView contextInstr)
}
if (defName.isEmpty()) {
m_context = def.contextByName(contextName.toString());
m_context = def.contextByName(contextName);
} else {
auto d = def.repo->definitionForName(defName.toString());
if (d.isValid()) {
@@ -38,7 +38,7 @@ void ContextSwitch::resolve(DefinitionData &def, QStringView contextInstr)
if (contextName.isEmpty()) {
m_context = data->initialContext();
} else {
m_context = data->contextByName(contextName.toString());
m_context = data->contextByName(contextName);
}
}
}

View File

@@ -31,6 +31,7 @@
#include <QXmlStreamReader>
#include <algorithm>
#include <atomic>
using namespace KSyntaxHighlighting;
@@ -240,7 +241,7 @@ QVector<Definition> Definition::includedDefinitions() const
while (!queue.empty()) {
const auto *def = queue.back();
queue.pop_back();
for (const auto &defRef : def->immediateIncludedDefinitions) {
for (const auto &defRef : std::as_const(def->immediateIncludedDefinitions)) {
const auto definition = defRef.definition();
if (!definitions.contains(definition)) {
definitions.push_back(definition);
@@ -286,7 +287,7 @@ Context *DefinitionData::initialContext()
return &contexts.front();
}
Context *DefinitionData::contextByName(const QString &wantedName)
Context *DefinitionData::contextByName(QStringView wantedName)
{
for (auto &context : contexts) {
if (context.name() == wantedName) {
@@ -317,6 +318,11 @@ bool DefinitionData::isLoaded() const
return !contexts.empty();
}
namespace
{
std::atomic<uint64_t> definitionId{1};
}
bool DefinitionData::load(OnlyKeywords onlyKeywords)
{
if (fileName.isEmpty()) {
@@ -361,12 +367,15 @@ bool DefinitionData::load(OnlyKeywords onlyKeywords)
resolveContexts();
id = definitionId.fetch_add(1, std::memory_order_relaxed);
return true;
}
void DefinitionData::clear()
{
// keep only name and repo, so we can re-lookup to make references persist over repo reloads
id = 0;
keywordLists.clear();
contexts.clear();
formats.clear();
@@ -465,13 +474,13 @@ bool DefinitionData::loadLanguage(QXmlStreamReader &reader)
indenter = reader.attributes().value(QLatin1String("indenter")).toString();
author = reader.attributes().value(QLatin1String("author")).toString();
license = reader.attributes().value(QLatin1String("license")).toString();
const auto exts = reader.attributes().value(QLatin1String("extensions")).toString();
const auto exts = reader.attributes().value(QLatin1String("extensions"));
for (const auto &ext : exts.split(QLatin1Char(';'), Qt::SkipEmptyParts)) {
extensions.push_back(ext);
extensions.push_back(ext.toString());
}
const auto mts = reader.attributes().value(QLatin1String("mimetype")).toString();
const auto mts = reader.attributes().value(QLatin1String("mimetype"));
for (const auto &mt : mts.split(QLatin1Char(';'), Qt::SkipEmptyParts)) {
mimetypes.push_back(mt);
mimetypes.push_back(mt.toString());
}
if (reader.attributes().hasAttribute(QLatin1String("casesensitive"))) {
caseSensitive = Xml::attrToBool(reader.attributes().value(QLatin1String("casesensitive"))) ? Qt::CaseSensitive : Qt::CaseInsensitive;
@@ -592,15 +601,6 @@ void DefinitionData::resolveContexts()
for (auto &context : contexts) {
context.resolveIncludes(*this);
}
/**
* Post-processing on rules.
*/
for (const auto &context : contexts) {
for (auto &rule : context.rules()) {
rule->resolvePostProcessing();
}
}
}
void DefinitionData::loadItemData(QXmlStreamReader &reader)
@@ -614,7 +614,7 @@ void DefinitionData::loadItemData(QXmlStreamReader &reader)
if (reader.name() == QLatin1String("itemData")) {
Format f;
auto formatData = FormatPrivate::detachAndGet(f);
formatData->definition = q;
formatData->definitionName = name;
formatData->load(reader);
formatData->id = RepositoryPrivate::get(repo)->nextFormatId();
formats.insert(f.name(), f);
@@ -707,7 +707,7 @@ void DefinitionData::loadComments(QXmlStreamReader &reader)
const bool isSingleLine = reader.attributes().value(QLatin1String("name")) == QLatin1String("singleLine");
if (isSingleLine) {
singleLineCommentMarker = reader.attributes().value(QLatin1String("start")).toString();
const bool afterWhiteSpace = reader.attributes().value(QLatin1String("position")).toString() == QLatin1String("afterwhitespace");
const bool afterWhiteSpace = reader.attributes().value(QLatin1String("position")) == QLatin1String("afterwhitespace");
singleLineCommentPosition = afterWhiteSpace ? CommentPosition::AfterWhitespace : CommentPosition::StartOfLine;
} else {
multiLineCommentStartMarker = reader.attributes().value(QLatin1String("start")).toString();
@@ -778,8 +778,8 @@ void DefinitionData::loadSpellchecking(QXmlStreamReader &reader)
if (reader.name() == QLatin1String("encoding")) {
const auto charRef = reader.attributes().value(QLatin1String("char"));
if (!charRef.isEmpty()) {
const auto str = reader.attributes().value(QLatin1String("string")).toString();
characterEncodings.push_back({charRef[0], str});
const auto str = reader.attributes().value(QLatin1String("string"));
characterEncodings.push_back({charRef[0], str.toString()});
}
}
reader.readNext();
@@ -868,3 +868,8 @@ bool DefinitionRef::operator==(const DefinitionRef &other) const
{
return !d.owner_before(other.d) && !other.d.owner_before(d);
}
bool DefinitionRef::operator==(const Definition &other) const
{
return !d.owner_before(other.d) && !other.d.owner_before(d);
}

View File

@@ -64,7 +64,7 @@ public:
KeywordList *keywordList(const QString &name);
Context *initialContext();
Context *contextByName(const QString &name);
Context *contextByName(QStringView name);
Format formatByName(const QString &name) const;
@@ -73,6 +73,7 @@ public:
void addImmediateIncludedDefinition(const Definition &def);
DefinitionRef q;
uint64_t id = 0;
Repository *repo = nullptr;
QHash<QString, KeywordList> keywordLists;

View File

@@ -75,14 +75,14 @@ void DefinitionDownloaderPrivate::updateDefinition(QXmlStreamReader &parser)
auto localDef = repo->definitionForName(name.toString());
if (!localDef.isValid()) {
Q_EMIT q->informationMessage(QObject::tr("Downloading new syntax definition for '%1'...").arg(name.toString()));
Q_EMIT q->informationMessage(QObject::tr("Downloading new syntax definition for '%1'...").arg(name));
downloadDefinition(QUrl(parser.attributes().value(QLatin1String("url")).toString()));
return;
}
const auto version = parser.attributes().value(QLatin1String("version"));
if (localDef.version() < version.toFloat()) {
Q_EMIT q->informationMessage(QObject::tr("Updating syntax definition for '%1' to version %2...").arg(name.toString(), version.toString()));
Q_EMIT q->informationMessage(QObject::tr("Updating syntax definition for '%1' to version %2...").arg(name, version));
downloadDefinition(QUrl(parser.attributes().value(QLatin1String("url")).toString()));
}
}

View File

@@ -50,6 +50,19 @@ public:
return !(*this == other);
}
/**
* Checks two definition for equality.
*/
bool operator==(const Definition &other) const;
/**
* Checks two definition for inequality.
*/
bool operator!=(const Definition &other) const
{
return !(*this == other);
}
private:
friend class DefinitionData;
std::weak_ptr<DefinitionData> d;

View File

@@ -25,9 +25,7 @@ static Theme::TextStyle stringToDefaultFormat(QStringView str)
return Theme::Normal;
}
static const auto idx = Theme::staticMetaObject.indexOfEnumerator("TextStyle");
Q_ASSERT(idx >= 0);
const auto metaEnum = Theme::staticMetaObject.enumerator(idx);
const auto metaEnum = QMetaEnum::fromType<Theme::TextStyle>();
bool ok = false;
const auto value = metaEnum.keyToValue(str.mid(2).toLatin1().constData(), &ok);
@@ -45,11 +43,23 @@ FormatPrivate *FormatPrivate::detachAndGet(Format &format)
TextStyleData FormatPrivate::styleOverride(const Theme &theme) const
{
const auto themeData = ThemeData::get(theme);
if (themeData) {
return themeData->textStyleOverride(definition.definition().name(), name);
return ThemeData::get(theme)->textStyleOverride(definitionName, name);
}
QColor FormatPrivate::color(const Theme &theme, StyleColor styleColor, ThemeColor themeColor) const
{
const auto overrideStyle = styleOverride(theme);
if (overrideStyle.*styleColor) {
return QColor::fromRgb(overrideStyle.*styleColor);
}
return TextStyleData();
// use QColor::fromRgba for QRgb => QColor conversion to avoid unset colors == black!
return QColor::fromRgba(style.*styleColor ? style.*styleColor : (theme.*themeColor)(defaultStyle));
}
bool FormatPrivate::hasColor(const Theme &theme, StyleColor styleColor, ThemeColor themeColor) const
{
// use QColor::fromRgba for background QRgb => QColor conversion to avoid unset colors == black!
return color(theme, styleColor, themeColor) != QColor::fromRgba((theme.*themeColor)(Theme::Normal)) && (style.*styleColor || (theme.*themeColor)(defaultStyle) || styleOverride(theme).*styleColor);
}
static QExplicitlySharedDataPointer<FormatPrivate> &sharedDefaultPrivate()
@@ -109,56 +119,32 @@ bool Format::isDefaultTextStyle(const Theme &theme) const
bool Format::hasTextColor(const Theme &theme) const
{
return textColor(theme) != QColor::fromRgba(theme.textColor(Theme::Normal))
&& (d->style.textColor || theme.textColor(d->defaultStyle) || d->styleOverride(theme).textColor);
return d->hasColor(theme, &TextStyleData::textColor, &Theme::textColor);
}
QColor Format::textColor(const Theme &theme) const
{
const auto overrideStyle = d->styleOverride(theme);
if (overrideStyle.textColor) {
return overrideStyle.textColor;
}
return d->style.textColor ? QColor::fromRgba(d->style.textColor) : QColor::fromRgba(theme.textColor(d->defaultStyle));
return d->color(theme, &TextStyleData::textColor, &Theme::textColor);
}
QColor Format::selectedTextColor(const Theme &theme) const
{
const auto overrideStyle = d->styleOverride(theme);
if (overrideStyle.selectedTextColor) {
return overrideStyle.selectedTextColor;
}
return d->style.selectedTextColor ? QColor::fromRgba(d->style.selectedTextColor) : QColor::fromRgba(theme.selectedTextColor(d->defaultStyle));
return d->color(theme, &TextStyleData::selectedTextColor, &Theme::selectedTextColor);
}
bool Format::hasBackgroundColor(const Theme &theme) const
{
// use QColor::fromRgba for background QRgb => QColor conversion to avoid unset colors == black!
return backgroundColor(theme) != QColor::fromRgba(theme.backgroundColor(Theme::Normal))
&& (d->style.backgroundColor || theme.backgroundColor(d->defaultStyle) || d->styleOverride(theme).backgroundColor);
return d->hasColor(theme, &TextStyleData::backgroundColor, &Theme::backgroundColor);
}
QColor Format::backgroundColor(const Theme &theme) const
{
const auto overrideStyle = d->styleOverride(theme);
if (overrideStyle.backgroundColor) {
return overrideStyle.backgroundColor;
}
// use QColor::fromRgba for background QRgb => QColor conversion to avoid unset colors == black!
return d->style.backgroundColor ? QColor::fromRgba(d->style.backgroundColor) : QColor::fromRgba(theme.backgroundColor(d->defaultStyle));
return d->color(theme, &TextStyleData::backgroundColor, &Theme::backgroundColor);
}
QColor Format::selectedBackgroundColor(const Theme &theme) const
{
const auto overrideStyle = d->styleOverride(theme);
if (overrideStyle.selectedBackgroundColor) {
return overrideStyle.selectedBackgroundColor;
}
// use QColor::fromRgba for background QRgb => QColor conversion to avoid unset colors == black!
return d->style.selectedBackgroundColor ? QColor::fromRgba(d->style.selectedBackgroundColor)
: QColor::fromRgba(theme.selectedBackgroundColor(d->defaultStyle));
return d->color(theme, &TextStyleData::selectedBackgroundColor, &Theme::selectedBackgroundColor);
}
bool Format::isBold(const Theme &theme) const
@@ -249,22 +235,22 @@ void FormatPrivate::load(QXmlStreamReader &reader)
QStringView attribute = reader.attributes().value(QLatin1String("color"));
if (!attribute.isEmpty()) {
style.textColor = QColor(attribute.toString()).rgba();
style.textColor = QColor(attribute).rgba();
}
attribute = reader.attributes().value(QLatin1String("selColor"));
if (!attribute.isEmpty()) {
style.selectedTextColor = QColor(attribute.toString()).rgba();
style.selectedTextColor = QColor(attribute).rgba();
}
attribute = reader.attributes().value(QLatin1String("backgroundColor"));
if (!attribute.isEmpty()) {
style.backgroundColor = QColor(attribute.toString()).rgba();
style.backgroundColor = QColor(attribute).rgba();
}
attribute = reader.attributes().value(QLatin1String("selBackgroundColor"));
if (!attribute.isEmpty()) {
style.selectedBackgroundColor = QColor(attribute.toString()).rgba();
style.selectedBackgroundColor = QColor(attribute).rgba();
}
attribute = reader.attributes().value(QLatin1String("italic"));

View File

@@ -7,7 +7,6 @@
#ifndef KSYNTAXHIGHLIGHTING_FORMAT_P_H
#define KSYNTAXHIGHLIGHTING_FORMAT_P_H
#include "definitionref_p.h"
#include "textstyledata_p.h"
#include "theme.h"
@@ -25,7 +24,12 @@ public:
TextStyleData styleOverride(const Theme &theme) const;
void load(QXmlStreamReader &reader);
DefinitionRef definition;
using StyleColor = QRgb(TextStyleData::*);
using ThemeColor = QRgb (Theme::*)(Theme::TextStyle) const;
bool hasColor(const Theme &theme, StyleColor styleColor, ThemeColor themeColor) const;
QColor color(const Theme &theme, StyleColor styleColor, ThemeColor themeColor) const;
QString definitionName;
QString name;
TextStyleData style;
Theme::TextStyle defaultStyle = Theme::Normal;

View File

@@ -221,9 +221,12 @@ static bool loadRule(const QString &defName, HighlightingContextData::Rule &rule
rule.common.contextName = attrs.value(QLatin1String("context")).toString();
rule.common.beginRegionName = attrs.value(QLatin1String("beginRegion")).toString();
rule.common.endRegionName = attrs.value(QLatin1String("endRegion")).toString();
rule.common.attributeName = attrs.value(QLatin1String("attribute")).toString();
rule.common.firstNonSpace = Xml::attrToBool(attrs.value(QLatin1String("firstNonSpace")));
rule.common.lookAhead = Xml::attrToBool(attrs.value(QLatin1String("lookAhead")));
// attribute is only used when lookAhead is false
if (!rule.common.lookAhead) {
rule.common.attributeName = attrs.value(QLatin1String("attribute")).toString();
}
bool colOk = false;
rule.common.column = attrs.value(QLatin1String("column")).toInt(&colOk);
if (!colOk) {

View File

@@ -137,8 +137,7 @@ void HtmlHighlighter::highlightData(QIODevice *dev, const QString &title)
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
in.setCodec("UTF-8");
#endif
while (!in.atEnd()) {
d->currentLine = in.readLine();
while (in.readLineInto(&d->currentLine)) {
state = highlightLine(d->currentLine, state);
*d->out << "\n";
}

View File

@@ -124,10 +124,10 @@ void KeywordList::resolveIncludeKeywords(DefinitionData &def)
KeywordList *keywords = nullptr;
if (idx >= 0) {
auto listName = kw_include.left(idx);
auto defName = kw_include.mid(idx + 2);
auto includeDef = def.repo->definitionForName(defName);
if (includeDef.isValid()) {
auto listName = kw_include.left(idx);
auto defData = DefinitionData::get(includeDef);
defData->load(DefinitionData::OnlyKeywords(true));
keywords = defData->keywordList(listName);

View File

@@ -152,23 +152,29 @@ QVector<Theme> Repository::themes() const
return d->m_themes;
}
static auto lowerBoundTheme(const QVector<KSyntaxHighlighting::Theme> &themes, QStringView themeName)
{
return std::lower_bound(themes.begin(), themes.end(), themeName, [](const Theme &lhs, QStringView rhs) {
return lhs.name() < rhs;
});
}
Theme Repository::theme(const QString &themeName) const
{
for (const auto &theme : std::as_const(d->m_themes)) {
if (theme.name() == themeName) {
return theme;
}
const auto &themes = d->m_themes;
const auto it = lowerBoundTheme(themes, themeName);
if (it != themes.end() && (*it).name() == themeName) {
return *it;
}
return Theme();
}
Theme Repository::defaultTheme(Repository::DefaultTheme t) const
{
if (t == DarkTheme) {
return theme(QLatin1String("Breeze Dark"));
return theme(QStringLiteral("Breeze Dark"));
}
return theme(QLatin1String("Breeze Light"));
return theme(QStringLiteral("Breeze Light"));
}
Theme Repository::defaultTheme(Repository::DefaultTheme t)
@@ -179,26 +185,25 @@ Theme Repository::defaultTheme(Repository::DefaultTheme t)
Theme Repository::themeForPalette(const QPalette &palette) const
{
const auto base = palette.color(QPalette::Base);
const auto themes = d->m_themes;
// find themes with matching background colors
QVector<KSyntaxHighlighting::Theme> matchingThemes;
for (const auto &theme : themes) {
QVector<const KSyntaxHighlighting::Theme *> matchingThemes;
for (const auto &theme : std::as_const(d->m_themes)) {
const auto background = theme.editorColor(KSyntaxHighlighting::Theme::EditorColorRole::BackgroundColor);
if (background == base.rgb()) {
matchingThemes.append(theme);
matchingThemes.append(&theme);
}
}
if (!matchingThemes.empty()) {
// if there's multiple, search for one with a matching highlight color
const auto highlight = palette.color(QPalette::Highlight);
for (const auto &theme : std::as_const(matchingThemes)) {
auto selection = theme.editorColor(KSyntaxHighlighting::Theme::EditorColorRole::TextSelection);
for (const auto *theme : std::as_const(matchingThemes)) {
auto selection = theme->editorColor(KSyntaxHighlighting::Theme::EditorColorRole::TextSelection);
if (selection == highlight.rgb()) {
return theme;
return *theme;
}
}
return matchingThemes.first();
return *matchingThemes.first();
}
// fallback to just use the default light or dark theme
@@ -217,6 +222,17 @@ void RepositoryPrivate::load(Repository *repo)
// do lookup in standard paths, if not disabled
#ifndef NO_STANDARD_PATHS
// do lookup in installed path when has no syntax resource
#ifndef HAS_SYNTAX_RESOURCE
for (const auto &dir : QStandardPaths::locateAll(QStandardPaths::GenericDataLocation,
QStringLiteral("org.kde.syntax-highlighting/syntax-bundled"),
QStandardPaths::LocateDirectory)) {
if (!loadSyntaxFolderFromIndex(repo, dir)) {
loadSyntaxFolder(repo, dir);
}
}
#endif
for (const auto &dir : QStandardPaths::locateAll(QStandardPaths::GenericDataLocation,
QStringLiteral("org.kde.syntax-highlighting/syntax"),
QStandardPaths::LocateDirectory)) {
@@ -289,11 +305,11 @@ void RepositoryPrivate::loadSyntaxFolder(Repository *repo, const QString &path)
}
}
void RepositoryPrivate::loadSyntaxFolderFromIndex(Repository *repo, const QString &path)
bool RepositoryPrivate::loadSyntaxFolderFromIndex(Repository *repo, const QString &path)
{
QFile indexFile(path + QLatin1String("/index.katesyntax"));
if (!indexFile.open(QFile::ReadOnly)) {
return;
return false;
}
const auto indexDoc(QCborValue::fromCbor(indexFile.readAll()));
@@ -311,6 +327,8 @@ void RepositoryPrivate::loadSyntaxFolderFromIndex(Repository *repo, const QStrin
addDefinition(def);
}
}
return true;
}
void RepositoryPrivate::addDefinition(const Definition &def)
@@ -346,15 +364,16 @@ static int themeRevision(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) {
return lhs.name() < rhs.name();
});
if (it == m_themes.end() || (*it).name() != theme.name()) {
m_themes.insert(it, theme);
const auto &constThemes = m_themes;
const auto themeName = theme.name();
const auto constIt = lowerBoundTheme(constThemes, themeName);
const auto index = constIt - constThemes.begin();
if (constIt == constThemes.end() || (*constIt).name() != themeName) {
m_themes.insert(index, theme);
return;
}
if (themeRevision(*it) < themeRevision(theme)) {
*it = theme;
if (themeRevision(*constIt) < themeRevision(theme)) {
m_themes[index] = theme;
}
}

View File

@@ -10,8 +10,9 @@
#include "ksyntaxhighlighting_export.h"
#include <QVector>
#include <QtGlobal>
#include <memory>
#include <qglobal.h>
QT_BEGIN_NAMESPACE
class QString;

View File

@@ -29,7 +29,7 @@ public:
void load(Repository *repo);
void loadSyntaxFolder(Repository *repo, const QString &path);
void loadSyntaxFolderFromIndex(Repository *repo, const QString &path);
bool loadSyntaxFolderFromIndex(Repository *repo, const QString &path);
void addDefinition(const Definition &def);

View File

@@ -186,7 +186,11 @@ static Rule::Ptr createRule(DefinitionData &def, const HighlightingContextData::
case Type::RangeDetect:
return std::make_shared<RangeDetect>(ruleData.data.rangeDetect);
case Type::RegExpr:
return std::make_shared<RegExpr>(ruleData.data.regExpr);
if (!ruleData.data.regExpr.dynamic) {
return std::make_shared<RegExpr>(ruleData.data.regExpr);
} else {
return std::make_shared<DynamicRegExpr>(ruleData.data.regExpr);
}
case Type::StringDetect:
if (ruleData.data.stringDetect.dynamic) {
return std::make_shared<DynamicStringDetect>(ruleData.data.stringDetect);
@@ -575,65 +579,42 @@ MatchResult RangeDetect::doMatch(QStringView text, int offset, const QStringList
return offset;
}
RegExpr::RegExpr(const HighlightingContextData::Rule::RegExpr &data)
static QRegularExpression::PatternOptions makePattenOptions(const HighlightingContextData::Rule::RegExpr &data)
{
m_regexp.setPattern(data.pattern);
m_regexp.setPatternOptions((data.isMinimal ? QRegularExpression::InvertedGreedinessOption : QRegularExpression::NoPatternOption)
| (data.caseSensitivity == Qt::CaseInsensitive ? QRegularExpression::CaseInsensitiveOption : QRegularExpression::NoPatternOption)
// DontCaptureOption is removed by resolvePostProcessing() when necessary
| QRegularExpression::DontCaptureOption
// ensure Unicode support is enabled
| QRegularExpression::UseUnicodePropertiesOption);
m_dynamic = data.dynamic;
return (data.isMinimal ? QRegularExpression::InvertedGreedinessOption : QRegularExpression::NoPatternOption)
| (data.caseSensitivity == Qt::CaseInsensitive ? QRegularExpression::CaseInsensitiveOption : QRegularExpression::NoPatternOption)
// DontCaptureOption is removed by resolve() when necessary
| QRegularExpression::DontCaptureOption
// ensure Unicode support is enabled
| QRegularExpression::UseUnicodePropertiesOption;
}
void RegExpr::resolvePostProcessing()
static void resolveRegex(QRegularExpression &regexp, Context *context)
{
if (m_isResolved) {
if (!regexp.isValid()) {
// DontCaptureOption with back reference capture is an error, remove this option then try again
regexp.setPatternOptions(regexp.patternOptions() & ~QRegularExpression::DontCaptureOption);
if (!regexp.isValid()) {
qCDebug(Log) << "Invalid regexp:" << regexp.pattern();
}
return;
}
m_isResolved = true;
bool hasCapture = false;
// disable DontCaptureOption when reference a context with dynamic rule
if (auto *ctx = context().context()) {
for (const Rule::Ptr &rule : ctx->rules()) {
if (context) {
for (const Rule::Ptr &rule : context->rules()) {
if (rule->isDynamic()) {
hasCapture = true;
m_regexp.setPatternOptions(m_regexp.patternOptions() & ~QRegularExpression::DontCaptureOption);
regexp.setPatternOptions(regexp.patternOptions() & ~QRegularExpression::DontCaptureOption);
break;
}
}
}
// optimize the pattern for the non-dynamic case, we use them OFTEN
if (!m_dynamic) {
m_regexp.optimize();
}
bool isValid = m_regexp.isValid();
if (!isValid) {
// DontCaptureOption with back reference capture is an error, remove this option then try again
if (!hasCapture) {
m_regexp.setPatternOptions(m_regexp.patternOptions() & ~QRegularExpression::DontCaptureOption);
isValid = m_regexp.isValid();
}
if (!isValid) {
qCDebug(Log) << "Invalid regexp:" << m_regexp.pattern();
}
}
}
MatchResult RegExpr::doMatch(QStringView text, int offset, const QStringList &captures) const
static MatchResult regexMatch(const QRegularExpression &regexp, QStringView text, int offset)
{
/**
* for dynamic case: create new pattern with right instantiation
*/
const auto &regexp = m_dynamic ? QRegularExpression(replaceCaptures(m_regexp.pattern(), captures, true), m_regexp.patternOptions()) : m_regexp;
/**
* match the pattern
*/
@@ -661,6 +642,65 @@ MatchResult RegExpr::doMatch(QStringView text, int offset, const QStringList &ca
return MatchResult(offset, result.capturedStart());
}
RegExpr::RegExpr(const HighlightingContextData::Rule::RegExpr &data)
: m_regexp(data.pattern, makePattenOptions(data))
{
}
void RegExpr::resolve()
{
if (m_isResolved) {
return;
}
m_isResolved = true;
resolveRegex(m_regexp, context().context());
}
MatchResult RegExpr::doMatch(QStringView text, int offset, const QStringList &) const
{
if (Q_UNLIKELY(!m_isResolved)) {
const_cast<RegExpr *>(this)->resolve();
}
return regexMatch(m_regexp, text, offset);
}
DynamicRegExpr::DynamicRegExpr(const HighlightingContextData::Rule::RegExpr &data)
: m_pattern(data.pattern)
, m_patternOptions(makePattenOptions(data))
{
m_dynamic = true;
}
void DynamicRegExpr::resolve()
{
if (m_isResolved) {
return;
}
m_isResolved = true;
QRegularExpression regexp(m_pattern, m_patternOptions);
resolveRegex(regexp, context().context());
m_patternOptions = regexp.patternOptions();
}
MatchResult DynamicRegExpr::doMatch(QStringView text, int offset, const QStringList &captures) const
{
if (Q_UNLIKELY(!m_isResolved)) {
const_cast<DynamicRegExpr *>(this)->resolve();
}
/**
* create new pattern with right instantiation
*/
const QRegularExpression regexp(replaceCaptures(m_pattern, captures, true), m_patternOptions);
return regexMatch(regexp, text, offset);
}
StringDetect::StringDetect(const HighlightingContextData::Rule::StringDetect &data)
: m_string(data.string)
, m_caseSensitivity(data.caseSensitivity)

View File

@@ -83,10 +83,6 @@ public:
return m_type == Type::LineContinue;
}
virtual void resolvePostProcessing()
{
}
virtual MatchResult doMatch(QStringView text, int offset, const QStringList &captures) const = 0;
static Rule::Ptr create(DefinitionData &def, const HighlightingContextData::Rule &ruleData, QStringView lookupContextName);
@@ -296,13 +292,28 @@ public:
protected:
MatchResult doMatch(QStringView text, int offset, const QStringList &) const override;
void resolvePostProcessing() override;
private:
void resolve();
QRegularExpression m_regexp;
bool m_isResolved = false;
};
class DynamicRegExpr final : public Rule
{
public:
DynamicRegExpr(const HighlightingContextData::Rule::RegExpr &data);
protected:
MatchResult doMatch(QStringView text, int offset, const QStringList &) const override;
private:
void resolve();
QString m_pattern;
QRegularExpression::PatternOptions m_patternOptions;
bool m_isResolved = false;
};
class StringDetect final : public Rule
{
public:

View File

@@ -94,7 +94,7 @@ State &State::operator=(const State &other)
bool State::operator==(const State &other) const
{
// use pointer equal as shortcut for shared states
return (d == other.d) || (d && other.d && d->m_contextStack == other.d->m_contextStack && d->m_defRef == other.d->m_defRef);
return (d == other.d) || (d && other.d && d->m_contextStack == other.d->m_contextStack && d->m_defId == other.d->m_defId);
}
bool State::operator!=(const State &other) const

View File

@@ -44,9 +44,9 @@ public:
private:
/**
* weak reference to the used definition to filter out invalid states
* definition id to filter out invalid states
*/
DefinitionRef m_defRef;
uint64_t m_defId = 0;
/**
* the context stack combines the active context + valid captures

View File

@@ -15,7 +15,7 @@ class TextStyleData
{
public:
// Constructor initializing all data.
TextStyleData()
TextStyleData() noexcept
: bold(false)
, italic(false)
, underline(false)

View File

@@ -1,5 +1,6 @@
/*
SPDX-FileCopyrightText: 2016 Volker Krause <vkrause@kde.org>
SPDX-FileCopyrightText: 2022 Jonathan Poelen <jonathan.poelen@gmail.com>
SPDX-License-Identifier: MIT
*/
@@ -11,96 +12,94 @@
using namespace KSyntaxHighlighting;
static QExplicitlySharedDataPointer<ThemeData> &sharedDefaultThemeData()
{
static QExplicitlySharedDataPointer<ThemeData> data(new ThemeData);
return data;
}
Theme::Theme()
: m_data(sharedDefaultThemeData())
{
}
Theme::Theme(const Theme &copy)
{
m_data = copy.m_data;
}
Theme::Theme(const Theme &copy) = default;
Theme::Theme(ThemeData *data)
: m_data(data)
{
}
Theme::~Theme()
{
}
Theme::~Theme() = default;
Theme &Theme::operator=(const Theme &other)
{
m_data = other.m_data;
return *this;
}
Theme &Theme::operator=(const Theme &other) = default;
bool Theme::isValid() const
{
return m_data.data();
return m_data.data() != sharedDefaultThemeData().data();
}
QString Theme::name() const
{
return m_data ? m_data->name() : QString();
return m_data->name();
}
QString Theme::translatedName() const
{
return m_data ? QCoreApplication::instance()->translate("Theme", m_data->name().toUtf8().constData()) : QString();
return isValid() ? QCoreApplication::instance()->translate("Theme", m_data->name().toUtf8().constData()) : QString();
}
bool Theme::isReadOnly() const
{
return m_data ? m_data->isReadOnly() : false;
return m_data->isReadOnly();
}
QString Theme::filePath() const
{
return m_data ? m_data->filePath() : QString();
return m_data->filePath();
}
QRgb Theme::textColor(TextStyle style) const
{
return m_data ? m_data->textColor(style) : 0;
return m_data->textColor(style);
}
QRgb Theme::selectedTextColor(TextStyle style) const
{
return m_data ? m_data->selectedTextColor(style) : 0;
return m_data->selectedTextColor(style);
}
QRgb Theme::backgroundColor(TextStyle style) const
{
return m_data ? m_data->backgroundColor(style) : 0;
return m_data->backgroundColor(style);
}
QRgb Theme::selectedBackgroundColor(TextStyle style) const
{
return m_data ? m_data->selectedBackgroundColor(style) : 0;
return m_data->selectedBackgroundColor(style);
}
bool Theme::isBold(TextStyle style) const
{
return m_data ? m_data->isBold(style) : false;
return m_data->isBold(style);
}
bool Theme::isItalic(TextStyle style) const
{
return m_data ? m_data->isItalic(style) : false;
return m_data->isItalic(style);
}
bool Theme::isUnderline(TextStyle style) const
{
return m_data ? m_data->isUnderline(style) : false;
return m_data->isUnderline(style);
}
bool Theme::isStrikeThrough(TextStyle style) const
{
return m_data ? m_data->isStrikeThrough(style) : false;
return m_data->isStrikeThrough(style);
}
QRgb Theme::editorColor(EditorColorRole role) const
{
return m_data ? m_data->editorColor(role) : 0;
return m_data->editorColor(role);
}

View File

@@ -26,6 +26,7 @@ ThemeData *ThemeData::get(const Theme &theme)
ThemeData::ThemeData()
{
memset(m_editorColors, 0, sizeof(m_editorColors));
m_textStyles.resize(QMetaEnum::fromType<Theme::TextStyle>().keyCount());
}
/**
@@ -104,9 +105,7 @@ bool ThemeData::load(const QString &filePath)
m_revision = metadata.value(QLatin1String("revision")).toInt();
// read text styles
static const auto styleIdx = Theme::staticMetaObject.indexOfEnumerator("TextStyle");
Q_ASSERT(styleIdx >= 0);
const auto metaEnumStyle = Theme::staticMetaObject.enumerator(styleIdx);
const auto metaEnumStyle = QMetaEnum::fromType<Theme::TextStyle>();
const QJsonObject textStyles = obj.value(QLatin1String("text-styles")).toObject();
for (int i = 0; i < metaEnumStyle.keyCount(); ++i) {
Q_ASSERT(i == metaEnumStyle.value(i));
@@ -114,9 +113,7 @@ bool ThemeData::load(const QString &filePath)
}
// read editor colors
static const auto colorIdx = Theme::staticMetaObject.indexOfEnumerator("EditorColorRole");
Q_ASSERT(colorIdx >= 0);
const auto metaEnumColor = Theme::staticMetaObject.enumerator(colorIdx);
const auto metaEnumColor = QMetaEnum::fromType<Theme::EditorColorRole>();
const QJsonObject editorColors = obj.value(QLatin1String("editor-colors")).toObject();
for (int i = 0; i < metaEnumColor.keyCount(); ++i) {
Q_ASSERT(i == metaEnumColor.value(i));
@@ -188,52 +185,49 @@ QString ThemeData::filePath() const
return m_filePath;
}
TextStyleData ThemeData::textStyle(Theme::TextStyle style) const
{
return m_textStyles[style];
}
QRgb ThemeData::textColor(Theme::TextStyle style) const
{
Q_ASSERT(static_cast<int>(style) >= 0 && static_cast<int>(style) <= static_cast<int>(Theme::Others));
return m_textStyles[style].textColor;
return textStyle(style).textColor;
}
QRgb ThemeData::selectedTextColor(Theme::TextStyle style) const
{
Q_ASSERT(static_cast<int>(style) >= 0 && static_cast<int>(style) <= static_cast<int>(Theme::Others));
return m_textStyles[style].selectedTextColor;
return textStyle(style).selectedTextColor;
}
QRgb ThemeData::backgroundColor(Theme::TextStyle style) const
{
Q_ASSERT(static_cast<int>(style) >= 0 && static_cast<int>(style) <= static_cast<int>(Theme::Others));
return m_textStyles[style].backgroundColor;
return textStyle(style).backgroundColor;
}
QRgb ThemeData::selectedBackgroundColor(Theme::TextStyle style) const
{
Q_ASSERT(static_cast<int>(style) >= 0 && static_cast<int>(style) <= static_cast<int>(Theme::Others));
return m_textStyles[style].selectedBackgroundColor;
return textStyle(style).selectedBackgroundColor;
}
bool ThemeData::isBold(Theme::TextStyle style) const
{
Q_ASSERT(static_cast<int>(style) >= 0 && static_cast<int>(style) <= static_cast<int>(Theme::Others));
return m_textStyles[style].bold;
return textStyle(style).bold;
}
bool ThemeData::isItalic(Theme::TextStyle style) const
{
Q_ASSERT(static_cast<int>(style) >= 0 && static_cast<int>(style) <= static_cast<int>(Theme::Others));
return m_textStyles[style].italic;
return textStyle(style).italic;
}
bool ThemeData::isUnderline(Theme::TextStyle style) const
{
Q_ASSERT(static_cast<int>(style) >= 0 && static_cast<int>(style) <= static_cast<int>(Theme::Others));
return m_textStyles[style].underline;
return textStyle(style).underline;
}
bool ThemeData::isStrikeThrough(Theme::TextStyle style) const
{
Q_ASSERT(static_cast<int>(style) >= 0 && static_cast<int>(style) <= static_cast<int>(Theme::Others));
return m_textStyles[style].strikeThrough;
return textStyle(style).strikeThrough;
}
QRgb ThemeData::editorColor(Theme::EditorColorRole role) const
@@ -244,5 +238,9 @@ QRgb ThemeData::editorColor(Theme::EditorColorRole role) const
TextStyleData ThemeData::textStyleOverride(const QString &definitionName, const QString &attributeName) const
{
return m_textStyleOverrides.value(definitionName).value(attributeName);
auto it = m_textStyleOverrides.find(definitionName);
if (it != m_textStyleOverrides.end()) {
return it->value(attributeName);
}
return TextStyleData();
}

View File

@@ -14,6 +14,8 @@
#include <QHash>
#include <QSharedData>
#include <vector>
namespace KSyntaxHighlighting
{
/**
@@ -124,6 +126,11 @@ public:
*/
TextStyleData textStyleOverride(const QString &definitionName, const QString &attributeName) const;
/**
* Returns the TextStyle data for the given @p style.
*/
TextStyleData textStyle(Theme::TextStyle style) const;
private:
int m_revision = 0;
QString m_name;
@@ -134,7 +141,7 @@ private:
QString m_filePath;
//! TextStyles
TextStyleData m_textStyles[Theme::Others + 1];
std::vector<TextStyleData> m_textStyles;
//! style overrides for individual itemData entries
//! definition name -> attribute name -> style

View File

@@ -1,34 +0,0 @@
/*
SPDX-FileCopyrightText: 2007 Sebastian Pipping <webmaster@hartwork.org>
SPDX-License-Identifier: MIT
*/
#ifndef KSYNTAXHIGHLIGHTING_WILDCARDMATCHER_P_H
#define KSYNTAXHIGHLIGHTING_WILDCARDMATCHER_P_H
#include <QtGlobal>
QT_BEGIN_NAMESPACE
class QString;
QT_END_NAMESPACE
namespace KSyntaxHighlighting
{
namespace WildcardMatcher
{
/**
* Matches a string against a given wildcard.
* The wildcard supports '*' (".*" in regex) and '?' ("." in regex), not more.
*
* @param candidate Text to match
* @param wildcard Wildcard to use
* @param caseSensitive Case-sensitivity flag
* @return True for an exact match, false otherwise
*/
bool exactMatch(const QString &candidate, const QString &wildcard, bool caseSensitive = true);
}
}
#endif // KSYNTAXHIGHLIGHTING_WILDCARDMATCHER_P_H

View File

@@ -2,7 +2,8 @@
# SPDX-FileCopyrightText: 2021 Volker Krause <vkrause@kde.org>
# SPDX-License-Identifier: BSD-3-Clause
add_library(kquicksyntaxhighlightingplugin)
ecm_add_qml_module(kquicksyntaxhighlightingplugin URI "org.kde.syntaxhighlighting")
target_sources(kquicksyntaxhighlightingplugin PRIVATE
kquicksyntaxhighlightingplugin.cpp
kquicksyntaxhighlighter.cpp
@@ -13,5 +14,4 @@ target_link_libraries(kquicksyntaxhighlightingplugin PRIVATE
Qt${QT_MAJOR_VERSION}::Quick
)
install(TARGETS kquicksyntaxhighlightingplugin DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/syntaxhighlighting)
install(FILES qmldir DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/syntaxhighlighting)
ecm_finalize_qml_module(kquicksyntaxhighlightingplugin DESTINATION ${KDE_INSTALL_QMLDIR})

View File

@@ -7,8 +7,8 @@
#include "kquicksyntaxhighlighter.h"
#include <repository.h>
#include <syntaxhighlighter.h>
#include <KSyntaxHighlighting/Repository>
#include <KSyntaxHighlighting/SyntaxHighlighter>
#include <QGuiApplication>
#include <QPalette>

View File

@@ -10,8 +10,8 @@
#include "repositorywrapper.h"
#include <definition.h>
#include <theme.h>
#include <KSyntaxHighlighting/Definition>
#include <KSyntaxHighlighting/Theme>
#include <QObject>
#include <QVariant>

View File

@@ -9,10 +9,9 @@
#include "kquicksyntaxhighlighter.h"
#include "repositorywrapper.h"
#include <definition.h>
#include <repository.h>
#include <theme.h>
#include <KSyntaxHighlighting/Definition>
#include <KSyntaxHighlighting/Repository>
#include <KSyntaxHighlighting/Theme>
#include <memory>

View File

@@ -1,2 +0,0 @@
module org.kde.syntaxhighlighting
plugin kquicksyntaxhighlightingplugin

View File

@@ -1,2 +0,0 @@
SPDX-FileCopyrightText: 2018 Eike Hein <hein@kde.org>
SPDX-License-Identifier: CC0-1.0

View File

@@ -6,9 +6,9 @@
#include "repositorywrapper.h"
#include <definition.h>
#include <repository.h>
#include <theme.h>
#include <KSyntaxHighlighting/Definition>
#include <KSyntaxHighlighting/Repository>
#include <KSyntaxHighlighting/Theme>
using namespace KSyntaxHighlighting;

View File

@@ -86,7 +86,7 @@ Project {
"themedata.cpp",
"themedata_p.h",
"wildcardmatcher.cpp",
"wildcardmatcher_p.h",
"wildcardmatcher.h",
"worddelimiters.cpp",
"worddelimiters_p.h",
"xml_p.h",

View File

@@ -164,7 +164,7 @@ namespace Internal {
class IPluginPrivate
{
public:
QList<std::function<QObject *()>> testCreators;
QList<TestCreator> testCreators;
};
} // Internal

View File

@@ -13,6 +13,8 @@ namespace ExtensionSystem {
namespace Internal { class IPluginPrivate; }
using TestCreator = std::function<QObject *()>;
class EXTENSIONSYSTEM_EXPORT IPlugin : public QObject
{
Q_OBJECT
@@ -41,7 +43,6 @@ public:
protected:
virtual void initialize() {}
using TestCreator = std::function<QObject *()>;
template <typename Test, typename ...Args>
void addTest(Args && ...args) { addTestCreator([args...] { return new Test(args...); }); }
void addTestCreator(const TestCreator &creator);

View File

@@ -78,7 +78,7 @@ public:
PluginSpec::PluginArgumentDescriptions argumentDescriptions;
IPlugin *plugin = nullptr;
QList<std::function<QObject *()>> registeredPluginTests;
QList<TestCreator> registeredPluginTests;
PluginSpec::State state = PluginSpec::Invalid;
bool hasError = false;

View File

@@ -378,7 +378,7 @@ QDockWidget *FancyMainWindow::addDockForWidget(QWidget *widget, bool immutable)
dockWidget->setProperty(dockWidgetActiveState, visible);
});
connect(dockWidget->toggleViewAction(), &QAction::triggered, this, [dockWidget] {
connect(dockWidget->toggleViewAction(), &QAction::triggered, dockWidget, [dockWidget] {
if (dockWidget->isVisible())
dockWidget->raise();
}, Qt::QueuedConnection);

View File

@@ -981,7 +981,7 @@ void FilePath::setFromString(QStringView fileNameView)
setParts({}, {}, fileNameView);
}
expected_str<DeviceFileAccess *> getFileAccess(const FilePath &filePath)
static expected_str<DeviceFileAccess *> getFileAccess(const FilePath &filePath)
{
if (!filePath.needsDevice())
return DesktopDeviceFileAccess::instance();

View File

@@ -43,7 +43,7 @@ public:
return chopIfEndsWith(m_filePath.toString(), '/');
break;
case QAbstractFileEngine::BaseName:
return m_filePath.baseName();
return m_filePath.fileName();
break;
case QAbstractFileEngine::PathName:
case QAbstractFileEngine::AbsolutePathName:

View File

@@ -238,7 +238,7 @@ QString FSEngineImpl::fileName(FileName file) const
return m_filePath.toFSPathString();
break;
case QAbstractFileEngine::BaseName:
return m_filePath.baseName();
return m_filePath.fileName();
break;
case QAbstractFileEngine::PathName:
case QAbstractFileEngine::AbsolutePathName:

View File

@@ -17,7 +17,7 @@ namespace Utils {
\c {filepath.txt+19+12}, and \c {filepath.txt(19)}.
*/
Link Link::fromString(const QString &filePathWithNumbers, bool canContainLineNumber, QString *postfix)
Link Link::fromString(const QString &filePathWithNumbers, bool canContainLineNumber)
{
Link link;
if (!canContainLineNumber) {
@@ -25,8 +25,6 @@ Link Link::fromString(const QString &filePathWithNumbers, bool canContainLineNum
} else {
int postfixPos = -1;
const LineColumn lineColumn = LineColumn::extractFromFileName(filePathWithNumbers, postfixPos);
if (postfix && postfixPos >= 0)
*postfix = filePathWithNumbers.mid(postfixPos);
link.targetFilePath = FilePath::fromUserInput(filePathWithNumbers.left(postfixPos));
link.targetLine = lineColumn.line;
link.targetColumn = lineColumn.column;

View File

@@ -23,9 +23,7 @@ public:
, targetColumn(column)
{}
static Link fromString(const QString &filePathWithNumbers,
bool canContainLineNumber = false,
QString *postfix = nullptr);
static Link fromString(const QString &filePathWithNumbers, bool canContainLineNumber = false);
bool hasValidTarget() const
{ return !targetFilePath.isEmpty(); }

View File

@@ -58,5 +58,6 @@ add_qtc_plugin(Android
extend_qtc_plugin(Android
CONDITION WITH_TESTS
SOURCES
androidsdkmanager_test.cpp androidsdkmanager_test.h
android_tst.qrc
)

View File

@@ -121,6 +121,8 @@ Project {
condition: qtc.testsEnabled
files: [
"android_tst.qrc",
"androidsdkmanager_test.cpp",
"androidsdkmanager_test.h",
]
}
}

View File

@@ -17,9 +17,11 @@
#include "androidqtversion.h"
#include "androidrunconfiguration.h"
#include "androidruncontrol.h"
#include "androidsdkmanager_test.h"
#include "androidsettingswidget.h"
#include "androidtoolchain.h"
#include "androidtr.h"
#include "javaeditor.h"
#include "javalanguageserver.h"
@@ -33,9 +35,9 @@
#include <languageclient/languageclientsettings.h>
#include <projectexplorer/devicesupport/devicemanager.h>
#include <projectexplorer/buildconfiguration.h>
#include <projectexplorer/deployconfiguration.h>
#include <projectexplorer/devicesupport/devicemanager.h>
#include <projectexplorer/kitinformation.h>
#include <projectexplorer/kitmanager.h>
#include <projectexplorer/project.h>
@@ -113,6 +115,10 @@ void AndroidPlugin::initialize()
{Android::Constants::JLS_SETTINGS_ID,
Tr::tr("Java Language Server"),
[] { return new JLSSettings; }});
#ifdef WITH_TESTS
addTest<AndroidSdkManagerTest>();
#endif
}
void AndroidPlugin::kitsRestored()

View File

@@ -23,8 +23,6 @@ class AndroidPlugin final : public ExtensionSystem::IPlugin
#ifdef WITH_TESTS
private slots:
void testAndroidSdkManagerProgressParser_data();
void testAndroidSdkManagerProgressParser();
void testAndroidConfigAvailableNdkPlatforms_data();
void testAndroidConfigAvailableNdkPlatforms();
void testAndroidQtVersionParseBuiltWith_data();

View File

@@ -20,18 +20,13 @@
#include <QSettings>
#include <QTextCodec>
#ifdef WITH_TESTS
# include <QTest>
# include "androidplugin.h"
#endif // WITH_TESTS
using namespace Utils;
namespace {
Q_LOGGING_CATEGORY(sdkManagerLog, "qtc.android.sdkManager", QtWarningMsg)
const char commonArgsKey[] = "Common Arguments:";
}
using namespace Utils;
namespace Android {
namespace Internal {
@@ -652,54 +647,5 @@ void AndroidSdkManagerPrivate::clearPackages()
m_allPackages.clear();
}
#ifdef WITH_TESTS
void AndroidPlugin::testAndroidSdkManagerProgressParser_data()
{
QTest::addColumn<QString>("output");
QTest::addColumn<int>("progress");
QTest::addColumn<bool>("foundAssertion");
// Output of "sdkmanager --licenses", Android SDK Tools version 4.0
QTest::newRow("Loading local repository")
<< "Loading local repository... \r"
<< -1
<< false;
QTest::newRow("Fetch progress (single line)")
<< "[============= ] 34% Fetch remote repository... \r"
<< 34
<< false;
QTest::newRow("Fetch progress (multi line)")
<< "[============================= ] 73% Fetch remote repository... \r"
"[============================= ] 75% Fetch remote repository... \r"
<< 75
<< false;
QTest::newRow("Some SDK package licenses not accepted")
<< "7 of 7 SDK package licenses not accepted.\n"
<< -1
<< false;
QTest::newRow("Unaccepted licenses assertion")
<< "\nReview licenses that have not been accepted (y/N)? "
<< -1
<< true;
}
void AndroidPlugin::testAndroidSdkManagerProgressParser()
{
QFETCH(QString, output);
QFETCH(int, progress);
QFETCH(bool, foundAssertion);
bool actualFoundAssertion = false;
const int actualProgress = parseProgress(output, actualFoundAssertion);
QCOMPARE(progress, actualProgress);
QCOMPARE(foundAssertion, actualFoundAssertion);
}
#endif // WITH_TESTS
} // namespace Internal
} // namespace Android

View File

@@ -81,5 +81,7 @@ private:
std::unique_ptr<AndroidSdkManagerPrivate> m_d;
};
int parseProgress(const QString &out, bool &foundAssertion);
} // namespace Internal
} // namespace Android

View File

@@ -0,0 +1,66 @@
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "androidsdkmanager_test.h"
#include "androidsdkmanager.h"
#include <QTest>
namespace Android::Internal {
AndroidSdkManagerTest::AndroidSdkManagerTest(QObject *parent)
: QObject(parent)
{}
AndroidSdkManagerTest::~AndroidSdkManagerTest() = default;
void AndroidSdkManagerTest::testAndroidSdkManagerProgressParser_data()
{
QTest::addColumn<QString>("output");
QTest::addColumn<int>("progress");
QTest::addColumn<bool>("foundAssertion");
// Output of "sdkmanager --licenses", Android SDK Tools version 4.0
QTest::newRow("Loading local repository")
<< "Loading local repository... \r"
<< -1
<< false;
QTest::newRow("Fetch progress (single line)")
<< "[============= ] 34% Fetch remote repository... \r"
<< 34
<< false;
QTest::newRow("Fetch progress (multi line)")
<< "[============================= ] 73% Fetch remote repository... \r"
"[============================= ] 75% Fetch remote repository... \r"
<< 75
<< false;
QTest::newRow("Some SDK package licenses not accepted")
<< "7 of 7 SDK package licenses not accepted.\n"
<< -1
<< false;
QTest::newRow("Unaccepted licenses assertion")
<< "\nReview licenses that have not been accepted (y/N)? "
<< -1
<< true;
}
void AndroidSdkManagerTest::testAndroidSdkManagerProgressParser()
{
QFETCH(QString, output);
QFETCH(int, progress);
QFETCH(bool, foundAssertion);
bool actualFoundAssertion = false;
const int actualProgress = parseProgress(output, actualFoundAssertion);
QCOMPARE(progress, actualProgress);
QCOMPARE(foundAssertion, actualFoundAssertion);
}
}

View File

@@ -0,0 +1,27 @@
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#pragma once
#include <QObject>
QT_BEGIN_NAMESPACE
class QString;
QT_END_NAMESPACE
namespace Android {
namespace Internal {
class AndroidSdkManagerTest : public QObject
{
Q_OBJECT
public:
AndroidSdkManagerTest(QObject *parent = nullptr);
~AndroidSdkManagerTest();
private slots:
void testAndroidSdkManagerProgressParser_data();
void testAndroidSdkManagerProgressParser();
};
} // namespace Internal
} // namespace Android

View File

@@ -5,6 +5,7 @@
#include "javaindenter.h"
#include "androidconstants.h"
#include <coreplugin/coreplugintr.h>
#include <coreplugin/editormanager/ieditorfactory.h>
#include <texteditor/codeassist/keywordscompletionassist.h>
@@ -42,7 +43,7 @@ JavaEditorFactory::JavaEditorFactory()
"transient", "try", "void", "volatile", "while"
};
setId(Constants::JAVA_EDITOR_ID);
setDisplayName(QCoreApplication::translate("OpenWith::Editors", "Java Editor"));
setDisplayName(::Core::Tr::tr("Java Editor"));
addMimeType(Constants::JAVA_MIMETYPE);
setDocumentCreator(createJavaDocument);

View File

@@ -8,6 +8,7 @@
#include "bineditortr.h"
#include "bineditorwidget.h"
#include <coreplugin/coreplugintr.h>
#include <coreplugin/editormanager/ieditorfactory.h>
#include <coreplugin/icore.h>
@@ -444,7 +445,7 @@ static BinEditorPluginPrivate *dd = nullptr;
BinEditorFactory::BinEditorFactory()
{
setId(Core::Constants::K_DEFAULT_BINARY_EDITOR_ID);
setDisplayName(QCoreApplication::translate("OpenWith::Editors", "Binary Editor"));
setDisplayName(::Core::Tr::tr("Binary Editor"));
addMimeType(Constants::C_BINEDITOR_MIMETYPE);
setEditorCreator([] {

View File

@@ -151,7 +151,8 @@ public:
Path.assign(asString.begin(), asString.end());
return {};
}
const FilePath filePath = FilePath::fromString(QString::fromStdString(Path.data()));
const FilePath filePath = FilePath::fromString(QString::fromStdString(
std::string(Path.data(), Path.size())));
if (filePath.isRelativePath()) {
const std::string asString
= m_workingDirectory.resolvePath(filePath).toFSPathString().toStdString();

View File

@@ -53,7 +53,7 @@ SettingsPageWidget::SettingsPageWidget()
resize(512, 589);
commandPathChooser = new PathChooser;
commandPathChooser->setPromptDialogTitle(Tr::Tr::tr("ClearCase Command"));
commandPathChooser->setPromptDialogTitle(Tr::tr("ClearCase Command"));
commandPathChooser->setExpectedKind(PathChooser::ExistingCommand);
commandPathChooser->setHistoryCompleter("ClearCase.Command.History");

View File

@@ -65,6 +65,8 @@ BuildDirParameters::BuildDirParameters(CMakeBuildSystem *buildSystem)
if (Utils::HostOsInfo::isAnyUnixHost())
environment.set("ICECC", "no");
environment.set("QTC_RUN", "1");
cmakeToolId = CMakeKitAspect::cmakeToolId(k);
}

View File

@@ -10,6 +10,7 @@
#include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/coreplugintr.h>
#include <texteditor/textdocument.h>
#include <texteditor/texteditoractionhandler.h>
@@ -219,7 +220,7 @@ static TextDocument *createCMakeDocument()
CMakeEditorFactory::CMakeEditorFactory()
{
setId(Constants::CMAKE_EDITOR_ID);
setDisplayName(QCoreApplication::translate("OpenWith::Editors", "CMake Editor"));
setDisplayName(::Core::Tr::tr("CMake Editor"));
addMimeType(Constants::CMAKE_MIMETYPE);
addMimeType(Constants::CMAKE_PROJECT_MIMETYPE);

View File

@@ -545,7 +545,7 @@ ToolChain *findExternalToolchain(const QString &presetArchitecture, const QStrin
};
Abi::OSFlavor toolsetAbi = Abi::UnknownFlavor;
for (auto abiPair : abiTable) {
for (const auto &abiPair : abiTable) {
if (presetToolset.contains(abiPair.first)) {
toolsetAbi = abiPair.second;
break;
@@ -554,7 +554,7 @@ ToolChain *findExternalToolchain(const QString &presetArchitecture, const QStrin
// User didn't specify any flavor, so pick the highest toolchain available
if (toolsetAbi == Abi::UnknownFlavor) {
for (auto abiPair : abiTable) {
for (const auto &abiPair : abiTable) {
if (msvcFlavors.contains(abiPair.second)) {
toolsetAbi = abiPair.second;
break;

View File

@@ -651,7 +651,7 @@ void CMakeToolConfigWidget::currentCMakeToolChanged(const QModelIndex &newCurren
CMakeSettingsPage::CMakeSettingsPage()
{
setId(Constants::Settings::TOOLS_ID);
setDisplayName(Tr::Tr::tr("Tools"));
setDisplayName(Tr::tr("Tools"));
setDisplayCategory("CMake");
setCategory(Constants::Settings::CATEGORY);
setWidgetCreator([] { return new CMakeToolConfigWidget; });

View File

@@ -6,6 +6,7 @@
#include "compilationdatabaseconstants.h"
#include "compilationdbparser.h"
#include <coreplugin/coreplugintr.h>
#include <coreplugin/icontext.h>
#include <cppeditor/cppprojectupdater.h>
#include <cppeditor/projectinfo.h>
@@ -482,7 +483,7 @@ static TextEditor::TextDocument *createCompilationDatabaseDocument()
CompilationDatabaseEditorFactory::CompilationDatabaseEditorFactory()
{
setId(Constants::COMPILATIONDATABASEPROJECT_ID);
setDisplayName(QCoreApplication::translate("OpenWith::Editors", "Compilation Database"));
setDisplayName(::Core::Tr::tr("Compilation Database"));
addMimeType(Constants::COMPILATIONDATABASEMIMETYPE);
setEditorCreator([]() { return new TextEditor::BaseTextEditor; });

View File

@@ -48,7 +48,7 @@ const char C_PROBLEM_PANE[] = "Core.ProblemPane";
const char C_GENERAL_OUTPUT_PANE[] = "Core.GeneralOutputPane";
// Default editor kind
const char K_DEFAULT_TEXT_EDITOR_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("OpenWith::Editors", "Plain Text Editor");
const char K_DEFAULT_TEXT_EDITOR_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("QtC::Core", "Plain Text Editor");
const char K_DEFAULT_TEXT_EDITOR_ID[] = "Core.PlainTextEditor";
const char K_DEFAULT_BINARY_EDITOR_ID[] = "Core.BinaryEditor";

View File

@@ -107,7 +107,6 @@ DocumentModel::Entry *DocumentModelPrivate::addEntry(DocumentModel::Entry *entry
int row = positions.second + 1/*<no document>*/;
beginInsertRows(QModelIndex(), row, row);
m_entries.insert(positions.second, entry);
disambiguateDisplayNames(entry);
FilePath fixedPath = DocumentManager::filePathKey(filePath, DocumentManager::ResolveLinks);
if (!fixedPath.isEmpty())
m_entryByFixedPath[fixedPath] = entry;
@@ -115,6 +114,7 @@ DocumentModel::Entry *DocumentModelPrivate::addEntry(DocumentModel::Entry *entry
itemChanged(document);
});
endInsertRows();
disambiguateDisplayNames(entry);
return entry;
}

View File

@@ -193,6 +193,8 @@ SearchResultWidget::SearchResultWidget(QWidget *parent) :
this, &SearchResultWidget::replaceTextChanged);
connect(m_replaceButton, &QAbstractButton::clicked,
this, &SearchResultWidget::handleReplaceButton);
topFindWidget->setMinimumHeight(m_cancelButton->sizeHint().height());
}
SearchResultWidget::~SearchResultWidget()

View File

@@ -117,8 +117,7 @@ QList<LocatorFilterEntry> BaseFileFilter::matchesFor(QFutureInterface<LocatorFil
QList<LocatorFilterEntry> entries[int(MatchLevel::Count)];
// If search string contains spaces, treat them as wildcard '*' and search in full path
const QString entry = QDir::fromNativeSeparators(origEntry).replace(' ', '*');
QString postfix;
Link link = Link::fromString(entry, true, &postfix);
const Link link = Link::fromString(entry, true);
const QRegularExpression regexp = createRegExp(link.targetFilePath.toString());
if (!regexp.isValid()) {
@@ -156,10 +155,10 @@ QList<LocatorFilterEntry> BaseFileFilter::matchesFor(QFutureInterface<LocatorFil
QRegularExpressionMatch match = regexp.match(matchText);
if (match.hasMatch()) {
LocatorFilterEntry filterEntry(this, path.fileName(), QString(path.toString() + postfix));
LocatorFilterEntry filterEntry(this, path.fileName());
filterEntry.filePath = path;
filterEntry.extraInfo = path.shortNativePath();
filterEntry.linkForEditor = Link(path, link.targetLine, link.targetColumn);
const MatchLevel matchLevel = matchLevelFor(match, matchText);
if (hasPathSeparator) {
match = regexp.match(filterEntry.extraInfo);
@@ -187,7 +186,7 @@ QList<LocatorFilterEntry> BaseFileFilter::matchesFor(QFutureInterface<LocatorFil
for (auto &entry : entries) {
if (entry.size() < 1000)
Utils::sort(entry, Core::LocatorFilterEntry::compareLexigraphically);
Utils::sort(entry, LocatorFilterEntry::compareLexigraphically);
}
return std::accumulate(std::begin(entries), std::end(entries), QList<LocatorFilterEntry>());
@@ -205,21 +204,13 @@ void BaseFileFilter::accept(const LocatorFilterEntry &selection,
openEditorAt(selection);
}
void BaseFileFilter::openEditorAt(const LocatorFilterEntry& selection)
void BaseFileFilter::openEditorAt(const LocatorFilterEntry &entry)
{
const FilePath locatorText = FilePath::fromVariant(selection.internalData);
const int postfixLength = locatorText.fileName().length() - selection.filePath.fileName().length();
if (postfixLength > 0) {
const QString postfix = selection.internalData.toString().right(postfixLength);
int postfixPos = -1;
const LineColumn lineColumn = LineColumn::extractFromFileName(postfix, postfixPos);
if (postfixPos >= 0) {
const Link link(selection.filePath, lineColumn.line, lineColumn.column);
EditorManager::openEditorAt(link, {}, Core::EditorManager::AllowExternalEditor);
return;
}
if (entry.linkForEditor) {
EditorManager::openEditorAt(*entry.linkForEditor, {}, EditorManager::AllowExternalEditor);
return;
}
EditorManager::openEditor(selection.filePath, {}, Core::EditorManager::AllowExternalEditor);
EditorManager::openEditor(entry.filePath, {}, EditorManager::AllowExternalEditor);
}
/*!

View File

@@ -48,7 +48,7 @@ public:
const QString &entry) override;
void accept(const LocatorFilterEntry &selection,
QString *newText, int *selectionStart, int *selectionLength) const override;
static void openEditorAt(const LocatorFilterEntry &selection);
static void openEditorAt(const LocatorFilterEntry &entry);
protected:
void setFileIterator(Iterator *iterator);

View File

@@ -44,7 +44,7 @@ QList<LocatorFilterEntry> ExecuteFilter::matchesFor(QFutureInterface<LocatorFilt
{
QList<LocatorFilterEntry> value;
if (!entry.isEmpty()) // avoid empty entry
value.append(LocatorFilterEntry(this, entry, QVariant()));
value.append(LocatorFilterEntry(this, entry));
QList<LocatorFilterEntry> others;
const Qt::CaseSensitivity entryCaseSensitivity = caseSensitivity(entry);
for (const QString &cmd : std::as_const(m_commandHistory)) {
@@ -52,7 +52,7 @@ QList<LocatorFilterEntry> ExecuteFilter::matchesFor(QFutureInterface<LocatorFilt
break;
if (cmd == entry) // avoid repeated entry
continue;
LocatorFilterEntry filterEntry(this, cmd, QVariant());
LocatorFilterEntry filterEntry(this, cmd);
const int index = cmd.indexOf(entry, 0, entryCaseSensitivity);
if (index >= 0) {
filterEntry.highlightInfo = {index, int(entry.length())};

View File

@@ -109,7 +109,7 @@ QList<LocatorFilterEntry> FileSystemFilter::matchesFor(QFutureInterface<LocatorF
if (match.hasMatch()) {
const MatchLevel level = matchLevelFor(match, dir);
const QString fullPath = dirInfo.filePath(dir);
LocatorFilterEntry filterEntry(this, dir, QVariant());
LocatorFilterEntry filterEntry(this, dir);
filterEntry.filePath = FilePath::fromString(fullPath);
filterEntry.highlightInfo = highlightInfo(match);
@@ -117,8 +117,7 @@ QList<LocatorFilterEntry> FileSystemFilter::matchesFor(QFutureInterface<LocatorF
}
}
// file names can match with +linenumber or :linenumber
QString postfix;
Link link = Link::fromString(entryFileName, true, &postfix);
const Link link = Link::fromString(entryFileName, true);
regExp = createRegExp(link.targetFilePath.toString(), caseSensitivity_);
if (!regExp.isValid())
return {};
@@ -130,10 +129,11 @@ QList<LocatorFilterEntry> FileSystemFilter::matchesFor(QFutureInterface<LocatorF
if (match.hasMatch()) {
const MatchLevel level = matchLevelFor(match, file);
const QString fullPath = dirInfo.filePath(file);
LocatorFilterEntry filterEntry(this, file, QString(fullPath + postfix));
LocatorFilterEntry filterEntry(this, file);
filterEntry.filePath = FilePath::fromString(fullPath);
filterEntry.highlightInfo = highlightInfo(match);
filterEntry.linkForEditor = Link(filterEntry.filePath, link.targetLine,
link.targetColumn);
entries[int(level)].append(filterEntry);
}
}
@@ -142,9 +142,7 @@ QList<LocatorFilterEntry> FileSystemFilter::matchesFor(QFutureInterface<LocatorF
const QString fullFilePath = dirInfo.filePath(entryFileName);
const bool containsWildcard = expandedEntry.contains('?') || expandedEntry.contains('*');
if (!containsWildcard && !QFileInfo::exists(fullFilePath) && dirInfo.exists()) {
LocatorFilterEntry createAndOpen(this,
Tr::tr("Create and Open \"%1\"").arg(expandedEntry),
fullFilePath);
LocatorFilterEntry createAndOpen(this, Tr::tr("Create and Open \"%1\"").arg(expandedEntry));
createAndOpen.filePath = FilePath::fromString(fullFilePath);
createAndOpen.extraInfo = FilePath::fromString(dirInfo.absolutePath()).shortNativePath();
entries[int(MatchLevel::Normal)].append(createAndOpen);
@@ -170,13 +168,12 @@ void FileSystemFilter::accept(const LocatorFilterEntry &selection,
} else {
// Don't block locator filter execution with dialog
QMetaObject::invokeMethod(EditorManager::instance(), [selection] {
const FilePath targetFile = FilePath::fromVariant(selection.internalData);
if (!selection.filePath.exists()) {
if (CheckableMessageBox::shouldAskAgain(ICore::settings(), kAlwaysCreate)) {
CheckableMessageBox messageBox(ICore::dialogParent());
messageBox.setWindowTitle(Tr::tr("Create File"));
messageBox.setIcon(QMessageBox::Question);
messageBox.setText(Tr::tr("Create \"%1\"?").arg(targetFile.shortNativePath()));
messageBox.setText(Tr::tr("Create \"%1\"?").arg(selection.filePath.shortNativePath()));
messageBox.setCheckBoxVisible(true);
messageBox.setCheckBoxText(Tr::tr("Always create"));
messageBox.setChecked(false);
@@ -190,10 +187,10 @@ void FileSystemFilter::accept(const LocatorFilterEntry &selection,
if (messageBox.isChecked())
CheckableMessageBox::doNotAskAgain(ICore::settings(), kAlwaysCreate);
}
QFile file(targetFile.toString());
QFile file(selection.filePath.toString());
file.open(QFile::WriteOnly);
file.close();
VcsManager::promptToAdd(targetFile.absolutePath(), {targetFile});
VcsManager::promptToAdd(selection.filePath.absolutePath(), {selection.filePath});
}
BaseFileFilter::openEditorAt(selection);
}, Qt::QueuedConnection);

View File

@@ -7,6 +7,7 @@
#include <utils/filepath.h>
#include <utils/id.h>
#include <utils/link.h>
#include <QFutureInterface>
#include <QIcon>
@@ -67,7 +68,7 @@ struct LocatorFilterEntry
LocatorFilterEntry(ILocatorFilter *fromFilter,
const QString &name,
const QVariant &data,
const QVariant &data = {},
std::optional<QIcon> icon = std::nullopt)
: filter(fromFilter)
, displayName(name)
@@ -93,7 +94,8 @@ struct LocatorFilterEntry
Utils::FilePath filePath;
/* highlighting support */
HighlightInfo highlightInfo;
// Should be used only when accept() calls BaseFileFilter::openEditorAt()
std::optional<Utils::Link> linkForEditor;
static bool compareLexigraphically(const Core::LocatorFilterEntry &lhs,
const Core::LocatorFilterEntry &rhs)
{

View File

@@ -60,7 +60,7 @@ QList<LocatorFilterEntry> JavaScriptFilter::matchesFor(
entries.append({this, message, QVariant::fromValue(EngineAction::Abort)});
} else {
const QString expression = entry + " = " + result;
entries.append({this, expression, QVariant()});
entries.append({this, expression});
entries.append({this, Tr::tr("Copy to clipboard: %1").arg(result), result});
entries.append({this, Tr::tr("Copy to clipboard: %1").arg(expression), expression});
}

View File

@@ -3,34 +3,33 @@
#include "locatorsearchutils.h"
#include <QSet>
#include <QString>
#include <QVariant>
#include <utils/link.h>
#include <unordered_set>
void Core::Internal::runSearch(QFutureInterface<Core::LocatorFilterEntry> &future,
const QList<ILocatorFilter *> &filters, const QString &searchText)
{
QSet<QString> alreadyAdded;
std::unordered_set<Utils::FilePath> addedCache;
const bool checkDuplicates = (filters.size() > 1);
const auto duplicatesRemoved = [&](const QList<LocatorFilterEntry> &entries) {
if (!checkDuplicates)
return entries;
QList<LocatorFilterEntry> results;
results.reserve(entries.size());
for (const LocatorFilterEntry &entry : entries) {
const auto &link = entry.linkForEditor;
if (!link || addedCache.emplace(link->targetFilePath).second)
results.append(entry);
}
return results;
};
for (ILocatorFilter *filter : filters) {
if (future.isCanceled())
break;
const QList<LocatorFilterEntry> filterResults = filter->matchesFor(future, searchText);
QVector<LocatorFilterEntry> uniqueFilterResults;
uniqueFilterResults.reserve(filterResults.size());
for (const LocatorFilterEntry &entry : filterResults) {
if (checkDuplicates) {
const QString stringData = entry.internalData.toString();
if (!stringData.isEmpty()) {
if (alreadyAdded.contains(stringData))
continue;
alreadyAdded.insert(stringData);
}
}
uniqueFilterResults.append(entry);
}
if (!uniqueFilterResults.isEmpty())
future.reportResults(uniqueFilterResults);
const auto results = duplicatesRemoved(filter->matchesFor(future, searchText));
if (!results.isEmpty())
future.reportResults(results);
}
}

View File

@@ -9,8 +9,8 @@ namespace Core {
namespace Internal {
void CORE_EXPORT runSearch(QFutureInterface<LocatorFilterEntry> &future,
const QList<ILocatorFilter *> &filters,
const QString &searchText);
const QList<ILocatorFilter *> &filters,
const QString &searchText);
} // namespace Internal
} // namespace Core

Some files were not shown because too many files have changed in this diff Show More