aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Schulz <david.schulz@qt.io>2021-03-16 17:57:55 +0100
committerDavid Schulz <david.schulz@qt.io>2021-03-17 10:35:36 +0000
commitd4c4f8c00753abaa37517f6d5c36dcbc008bb658 (patch)
tree99f3cc965a67f61b357728defaea2f19ebb80617
parentd187022892bad0591dd8d8e2a2d44bcddac1995d (diff)
Highlighting: update KSyntaxHighlighting to v5.80.0
Task-number: QTCREATORBUG-22558 Change-Id: I57d782397f88842edbd08b1008b2d88706c6ab52 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
-rw-r--r--src/libs/3rdparty/syntax-highlighting/.gitignore1
-rw-r--r--src/libs/3rdparty/syntax-highlighting/README.md64
-rw-r--r--src/libs/3rdparty/syntax-highlighting/autogenerated/ksyntaxhighlighting_version.h6
-rw-r--r--src/libs/3rdparty/syntax-highlighting/data/CMakeLists.txt43
-rw-r--r--src/libs/3rdparty/syntax-highlighting/data/generators/cmake.xml.tpl232
-rw-r--r--src/libs/3rdparty/syntax-highlighting/data/generators/cmake.yaml97
-rw-r--r--src/libs/3rdparty/syntax-highlighting/data/generators/generate-cmake-syntax.py51
-rw-r--r--src/libs/3rdparty/syntax-highlighting/data/generators/generate-php.pl21
-rw-r--r--src/libs/3rdparty/syntax-highlighting/data/schema/language.xsd32
-rw-r--r--src/libs/3rdparty/syntax-highlighting/data/syntax/alert.xml3
-rw-r--r--src/libs/3rdparty/syntax-highlighting/data/syntax/bash.xml1507
-rw-r--r--src/libs/3rdparty/syntax-highlighting/data/syntax/cmake.xml363
-rw-r--r--src/libs/3rdparty/syntax-highlighting/data/syntax/css.xml6
-rw-r--r--src/libs/3rdparty/syntax-highlighting/data/syntax/doxygen.xml23
-rw-r--r--src/libs/3rdparty/syntax-highlighting/data/syntax/dtd.xml7
-rw-r--r--src/libs/3rdparty/syntax-highlighting/data/syntax/html.xml13
-rw-r--r--src/libs/3rdparty/syntax-highlighting/data/syntax/ini.xml8
-rw-r--r--src/libs/3rdparty/syntax-highlighting/data/syntax/java.xml176
-rw-r--r--src/libs/3rdparty/syntax-highlighting/data/syntax/javadoc.xml102
-rw-r--r--src/libs/3rdparty/syntax-highlighting/data/syntax/json.xml5
-rw-r--r--src/libs/3rdparty/syntax-highlighting/data/syntax/makefile.xml12
-rw-r--r--src/libs/3rdparty/syntax-highlighting/data/syntax/markdown.xml131
-rw-r--r--src/libs/3rdparty/syntax-highlighting/data/syntax/perl.xml81
-rw-r--r--src/libs/3rdparty/syntax-highlighting/data/syntax/powershell.xml18
-rw-r--r--src/libs/3rdparty/syntax-highlighting/data/syntax/python.xml139
-rw-r--r--src/libs/3rdparty/syntax-highlighting/data/syntax/qdocconf.xml5
-rw-r--r--src/libs/3rdparty/syntax-highlighting/data/syntax/ruby.xml76
-rw-r--r--src/libs/3rdparty/syntax-highlighting/data/syntax/valgrind-suppression.xml7
-rw-r--r--src/libs/3rdparty/syntax-highlighting/data/syntax/xml.xml109
-rw-r--r--src/libs/3rdparty/syntax-highlighting/data/syntax/yacc.xml12
-rw-r--r--src/libs/3rdparty/syntax-highlighting/data/themes/atom-one-dark.theme352
-rw-r--r--src/libs/3rdparty/syntax-highlighting/data/themes/atom-one-light.theme359
-rw-r--r--src/libs/3rdparty/syntax-highlighting/data/themes/ayu-dark.theme29
-rw-r--r--src/libs/3rdparty/syntax-highlighting/data/themes/ayu-mirage.theme29
-rw-r--r--src/libs/3rdparty/syntax-highlighting/data/themes/breeze-dark.theme10
-rw-r--r--src/libs/3rdparty/syntax-highlighting/data/themes/breeze-light.theme8
-rw-r--r--src/libs/3rdparty/syntax-highlighting/data/themes/dracula.theme590
-rw-r--r--src/libs/3rdparty/syntax-highlighting/data/themes/github-dark.theme216
-rw-r--r--src/libs/3rdparty/syntax-highlighting/data/themes/github-light.theme216
-rw-r--r--src/libs/3rdparty/syntax-highlighting/data/themes/monokai.theme394
-rw-r--r--src/libs/3rdparty/syntax-highlighting/data/themes/oblivion.theme179
-rw-r--r--src/libs/3rdparty/syntax-highlighting/data/themes/solarized-dark.theme42
-rw-r--r--src/libs/3rdparty/syntax-highlighting/data/themes/solarized-light.theme16
-rw-r--r--src/libs/3rdparty/syntax-highlighting/data/themes/theme-data.qrc6
-rw-r--r--src/libs/3rdparty/syntax-highlighting/src/cli/CMakeLists.txt2
-rw-r--r--src/libs/3rdparty/syntax-highlighting/src/cli/kate-syntax-highlighter.cpp62
-rw-r--r--src/libs/3rdparty/syntax-highlighting/src/indexer/CMakeLists.txt2
-rw-r--r--src/libs/3rdparty/syntax-highlighting/src/indexer/katehighlightingindexer.cpp2701
-rw-r--r--src/libs/3rdparty/syntax-highlighting/src/lib/CMakeLists.txt4
-rw-r--r--src/libs/3rdparty/syntax-highlighting/src/lib/abstracthighlighter.cpp6
-rw-r--r--src/libs/3rdparty/syntax-highlighting/src/lib/abstracthighlighter_p.h4
-rw-r--r--src/libs/3rdparty/syntax-highlighting/src/lib/ansihighlighter.cpp1265
-rw-r--r--src/libs/3rdparty/syntax-highlighting/src/lib/ansihighlighter.h21
-rw-r--r--src/libs/3rdparty/syntax-highlighting/src/lib/context.cpp6
-rw-r--r--src/libs/3rdparty/syntax-highlighting/src/lib/contextswitch.cpp2
-rw-r--r--src/libs/3rdparty/syntax-highlighting/src/lib/contextswitch_p.h2
-rw-r--r--src/libs/3rdparty/syntax-highlighting/src/lib/definition.cpp54
-rw-r--r--src/libs/3rdparty/syntax-highlighting/src/lib/definition.h2
-rw-r--r--src/libs/3rdparty/syntax-highlighting/src/lib/definition_p.h2
-rw-r--r--src/libs/3rdparty/syntax-highlighting/src/lib/definitiondownloader.cpp24
-rw-r--r--src/libs/3rdparty/syntax-highlighting/src/lib/format.cpp25
-rw-r--r--src/libs/3rdparty/syntax-highlighting/src/lib/htmlhighlighter.cpp50
-rw-r--r--src/libs/3rdparty/syntax-highlighting/src/lib/keywordlist.cpp10
-rw-r--r--src/libs/3rdparty/syntax-highlighting/src/lib/keywordlist_p.h9
-rw-r--r--src/libs/3rdparty/syntax-highlighting/src/lib/repository.cpp56
-rw-r--r--src/libs/3rdparty/syntax-highlighting/src/lib/repository.h26
-rw-r--r--src/libs/3rdparty/syntax-highlighting/src/lib/rule.cpp139
-rw-r--r--src/libs/3rdparty/syntax-highlighting/src/lib/rule_p.h20
-rw-r--r--src/libs/3rdparty/syntax-highlighting/src/lib/state.cpp2
-rw-r--r--src/libs/3rdparty/syntax-highlighting/src/lib/state_p.h4
-rw-r--r--src/libs/3rdparty/syntax-highlighting/src/lib/theme.cpp2
-rw-r--r--src/libs/3rdparty/syntax-highlighting/src/lib/themedata.cpp4
-rw-r--r--src/libs/3rdparty/syntax-highlighting/src/lib/worddelimiters.cpp26
-rw-r--r--src/libs/3rdparty/syntax-highlighting/src/lib/worddelimiters_p.h8
-rw-r--r--src/libs/3rdparty/syntax-highlighting/src/lib/xml_p.h4
75 files changed, 7601 insertions, 2739 deletions
diff --git a/src/libs/3rdparty/syntax-highlighting/.gitignore b/src/libs/3rdparty/syntax-highlighting/.gitignore
index 7df2675d19..4d50e82c2d 100644
--- a/src/libs/3rdparty/syntax-highlighting/.gitignore
+++ b/src/libs/3rdparty/syntax-highlighting/.gitignore
@@ -11,3 +11,4 @@ heaptrack.*
*.unc-backup*
.clang-format
.cmake/
+*.code-workspace \ No newline at end of file
diff --git a/src/libs/3rdparty/syntax-highlighting/README.md b/src/libs/3rdparty/syntax-highlighting/README.md
index c090d06163..2acff73b18 100644
--- a/src/libs/3rdparty/syntax-highlighting/README.md
+++ b/src/libs/3rdparty/syntax-highlighting/README.md
@@ -6,12 +6,15 @@ Syntax highlighting engine for Kate syntax definitions
1. [Introduction](#introduction)
2. [Out of scope](#out-of-scope)
-3. [Syntax Definition Files](#syntax-definition-files)
-4. [Build it](#build-it)
-5. [How to contribute](#how-to-contribute)
-6. [Adding unit tests for a syntax definition](#adding-unit-tests-for-a-syntax-definition)
+3. [Syntax definition files](#syntax-definition-files)
+4. [Color theme files](#color-theme-files)
+5. [Build it](#build-it)
+6. [How to contribute](#how-to-contribute)
+ * [Licensing](#licensing)
+ * [Tips for contributing to syntax definition files](#tips-for-contributing-to-syntax-definition-files)
+ * [Adding unit tests for a syntax definition](#adding-unit-tests-for-a-syntax-definition)
7. [Report bug or help to fix them](#report-bug-or-help-to-fix-them)
-8. [Updating the kate-editor.org/syntax website](#updating-the-kate-editororgsyntax-website)
+8. [Updating the syntax & themes pages of the kate-editor.org website](#updating-the-kate-editororgsyntax-website)
## Introduction
@@ -33,7 +36,7 @@ out of scope:
If you need any of this, check out [KTextEditor](https://api.kde.org/frameworks/ktexteditor/html/).
-## Syntax Definition Files
+## Syntax definition files
This library uses Kate syntax definition files for the actual highlighting,
the file format is documented [here](https://docs.kde.org/?application=katepart&branch=trunk5&path=highlight.html).
@@ -62,7 +65,7 @@ Usually it is:
</tr>
<tr>
<td>On Windows®</td>
- <td>%USERPROFILE%\AppData\Local\org.kde.syntax-highlighting\syntax\ </td>
+ <td>&#37;USERPROFILE&#37;&#92;AppData&#92;Local&#92;org.kde.syntax-highlighting&#92;syntax&#92;</td>
</tr>
</table>
@@ -71,6 +74,30 @@ For more details, see ["The Highlight Definition XML Format" (Working with Synta
Also, in **data/schema/** there is a script to validate the syntax definiton XML
files. Use the command `validatehl.sh mySyntax.xml`.
+## Color theme files
+
+This library includes the color themes, the theme files use the **JSON**
+format and are located in **data/themes/** with the **.theme** extension.
+
+Additional ones are also picked up from the file system if present,
+in the **org.kde.syntax-highlighting/themes/** folder of your user directory,
+allowing you to easily add custom color theme files.
+The location of **org.kde.syntax-highlighting/themes/** is the same
+as shown in the table of the [previous section](#syntax-definition-files),
+replacing the **syntax** folder with **themes**.
+
+The [KTextEditor](https://api.kde.org/frameworks/ktexteditor/html/) library
+(used by Kate, Kile and KDevelop, for example) provides
+a user interface for editing and creating KSyntaxHighlighting color themes, including
+a tool for exporting and importing the JSON theme files.
+The tool **utils/schema-converter/** and the script **utils/kateschema_to_theme_converter.py**
+convert the old Kate schemas to KSyntaxHighlighting themes.
+
+For more information, see:
+
+* [Kate - Color Themes with Frameworks 5.75 (Kate Editor Website)](https://kate-editor.org/post/2020/2020-09-13-kate-color-themes-5.75/)
+* [Submit a KSyntaxHighlighting Color Theme (Kate Editor Website)](https://kate-editor.org/post/2020/2020-09-18-submit-a-ksyntaxhighlighting-color-theme/)
+
## Build it
1. Create and change into a build directory. Usually, a folder called **build**
@@ -88,6 +115,16 @@ files. Use the command `validatehl.sh mySyntax.xml`.
make
```
+ For example:
+
+ ```bash
+ git clone git@invent.kde.org:frameworks/syntax-highlighting.git
+ mkdir ./syntax-highlighting/build
+ cd ./syntax-highlighting/build
+ cmake ../
+ make
+ ```
+
For more details see ["Building Kate from Sources on Linux" (Kate Editor Website)](https://kate-editor.org/build-it/).
**NOTE:** If running *cmake* shows an error related to your version of KDE
@@ -126,7 +163,7 @@ All files shall contain a proper "SPDX-License-Identifier: MIT" identifier insid
*/
```
-### What you should know before working with syntax definition files and sending a patch
+### Tips for contributing to syntax definition files
* If you are modifying an existing syntax definition XML file, you must increase
the version number of the language.
@@ -139,15 +176,15 @@ All files shall contain a proper "SPDX-License-Identifier: MIT" identifier insid
* [Available Default Styles (Working with Syntax Highlighting, KDE Documentation)](https://docs.kde.org/?application=katepart&branch=trunk5&path=highlight.html#kate-highlight-default-styles)
* [Kate Part (KF5): New Default Styles for better Color Schemes (Kate Editor Website)](https://kate-editor.org/2014/03/07/kate-part-kf5-new-default-styles-for-better-color-schemes/)
-* Important: add test files, these are found in **autotests/input/**.
+* Add test files, these are found in **autotests/input/**.
If you are going to add a new syntax XML file, create a new test file; if you
are going to modify a XML file, adds examples to existing test files.
Then, it is necessary to generate and update the files in **autotests/folding/**,
**autotests/html/** and **autotests/reference/**, which must be included in the
- patches. The instructions are in the [next section](#adding-unit-tests-for-a-syntax-definition).
+ patches. Instructions are [below](#adding-unit-tests-for-a-syntax-definition).
-## Adding unit tests for a syntax definition
+### Adding unit tests for a syntax definition
1. Add an input file into the **autotests/input/** folder, lets call it
**test.&lt;language-extension&gt;**.
@@ -184,9 +221,10 @@ However, some users often report bugs related to syntax highlighting in
[kate/syntax](https://bugs.kde.org/buglist.cgi?component=syntax&product=kate&resolution=---)
and [kile/editor](https://bugs.kde.org/buglist.cgi?component=editor&product=kile&resolution=---).
-## Updating the kate-editor.org/syntax website
+## Updating the syntax & themes pages of the kate-editor.org website
-To update the [kate-editor.org/syntax](https://kate-editor.org/syntax/) website
+To update the [kate-editor.org/syntax](https://kate-editor.org/syntax/) and
+[kate-editor.org/themes](https://kate-editor.org/themes/) websites
including the update site & all linked examples/files,
please run after successful **build** & **test** the following make target:
diff --git a/src/libs/3rdparty/syntax-highlighting/autogenerated/ksyntaxhighlighting_version.h b/src/libs/3rdparty/syntax-highlighting/autogenerated/ksyntaxhighlighting_version.h
index df0317ed7c..32e5aa62a7 100644
--- a/src/libs/3rdparty/syntax-highlighting/autogenerated/ksyntaxhighlighting_version.h
+++ b/src/libs/3rdparty/syntax-highlighting/autogenerated/ksyntaxhighlighting_version.h
@@ -3,10 +3,10 @@
#ifndef SyntaxHighlighting_VERSION_H
#define SyntaxHighlighting_VERSION_H
-#define SyntaxHighlighting_VERSION_STRING "5.75.0"
+#define SyntaxHighlighting_VERSION_STRING "5.80.0"
#define SyntaxHighlighting_VERSION_MAJOR 5
-#define SyntaxHighlighting_VERSION_MINOR 75
+#define SyntaxHighlighting_VERSION_MINOR 80
#define SyntaxHighlighting_VERSION_PATCH 0
-#define SyntaxHighlighting_VERSION ((5<<16)|(75<<8)|(0))
+#define SyntaxHighlighting_VERSION ((5<<16)|(80<<8)|(0))
#endif
diff --git a/src/libs/3rdparty/syntax-highlighting/data/CMakeLists.txt b/src/libs/3rdparty/syntax-highlighting/data/CMakeLists.txt
index cab8c885dc..8b923c4795 100644
--- a/src/libs/3rdparty/syntax-highlighting/data/CMakeLists.txt
+++ b/src/libs/3rdparty/syntax-highlighting/data/CMakeLists.txt
@@ -1,9 +1,27 @@
+# create a directory for generated definitions
+execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/generated/syntax)
+
+macro(generate_syntax_definition generator targetFile srcFile)
+ add_custom_target(
+ ${targetFile} ALL
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/generated/syntax/${targetFile}
+ )
+ add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/generated/syntax/${targetFile}
+ COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/generators/${generator}
+ ${CMAKE_CURRENT_SOURCE_DIR}/syntax/${srcFile}
+ ${CMAKE_CURRENT_BINARY_DIR}/generated/syntax/${targetFile}
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/generators/${generator}
+ ${CMAKE_CURRENT_SOURCE_DIR}/syntax/${srcFile}
+ ${ARGN}
+ VERBATIM
+ )
+ set(gen_defs ${gen_defs} ${CMAKE_CURRENT_BINARY_DIR}/generated/syntax/${targetFile})
+endmacro()
+
# generate PHP definitions
macro(generate_php_syntax_definition targetFile srcFile)
- execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/generated/syntax)
- execute_process(COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/generators/generate-php.pl
- INPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/syntax/${srcFile}
- OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/generated/syntax/${targetFile})
+ generate_syntax_definition(generate-php.pl ${targetFile} ${srcFile} ${CMAKE_CURRENT_SOURCE_DIR}/syntax/php.xml)
endmacro()
generate_php_syntax_definition(javascript-php.xml javascript.xml)
@@ -13,17 +31,12 @@ generate_php_syntax_definition(javascript-react-php.xml javascript-react.xml)
generate_php_syntax_definition(typescript-php.xml typescript.xml)
generate_php_syntax_definition(mustache-php.xml mustache.xml)
+# generate DoxygenLua definition
+generate_syntax_definition(generate-doxygenlua.pl doxygenlua.xml doxygen.xml)
+
# find all definitions
file(GLOB src_defs "${CMAKE_CURRENT_SOURCE_DIR}/syntax/*.xml")
-set(defs
- ${src_defs}
- ${CMAKE_CURRENT_BINARY_DIR}/generated/syntax/html-php.xml
- ${CMAKE_CURRENT_BINARY_DIR}/generated/syntax/css-php.xml
- ${CMAKE_CURRENT_BINARY_DIR}/generated/syntax/javascript-php.xml
- ${CMAKE_CURRENT_BINARY_DIR}/generated/syntax/javascript-react-php.xml
- ${CMAKE_CURRENT_BINARY_DIR}/generated/syntax/typescript-php.xml
- ${CMAKE_CURRENT_BINARY_DIR}/generated/syntax/mustache-php.xml
-)
+set(defs ${src_defs} ${gen_defs})
# theme data resource
qt5_add_resources(themes_QRC ${CMAKE_CURRENT_SOURCE_DIR}/themes/theme-data.qrc)
@@ -43,7 +56,7 @@ if (QRC_SYNTAX)
# generate the index file
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 ${defs} ${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
)
# generate the qrc file manually, to make dependencies on generated files work...
@@ -57,7 +70,7 @@ if (QRC_SYNTAX)
add_library(SyntaxHighlightingData OBJECT ${themes_QRC} ${CMAKE_CURRENT_BINARY_DIR}/qrc_syntax-data.cpp)
else()
# install the syntax files as normal files into the prefix
- install (FILES ${defs} DESTINATION share/org.kde.syntax-highlighting/syntax)
+ install (FILES ${defs} DESTINATION ${KDE_INSTALL_DATADIR}/org.kde.syntax-highlighting/syntax)
# object library to make cross-folder dependencies work, only themes
add_library(SyntaxHighlightingData OBJECT ${themes_QRC})
diff --git a/src/libs/3rdparty/syntax-highlighting/data/generators/cmake.xml.tpl b/src/libs/3rdparty/syntax-highlighting/data/generators/cmake.xml.tpl
index be60d19959..8e8d37d266 100644
--- a/src/libs/3rdparty/syntax-highlighting/data/generators/cmake.xml.tpl
+++ b/src/libs/3rdparty/syntax-highlighting/data/generators/cmake.xml.tpl
@@ -14,9 +14,15 @@
SPDX-License-Identifier: LGPL-2.0-or-later
-->
+<!-- ***** THIS FILE WAS GENERATED BY A SCRIPT - DO NOT EDIT *****
+ cd data/generators
+ # increase version of cmake.xml.tpl then
+ ./generate-cmake-syntax.py cmake.yaml > ../syntax/cmake.xml
+-->
+
<language
name="CMake"
- version="25"
+ version="31"
kateversion="5.0"
section="Other"
extensions="CMakeLists.txt;*.cmake;*.cmake.in"
@@ -28,66 +34,66 @@
<highlighting>
<list name="commands">
- {%- for command in commands %}
- <item>{{command.name}}</item>
- {%- endfor %}
+ <!--[- for command in commands ]-->
+ <item><!--{command.name}--></item>
+ <!--[- endfor ]-->
</list>
- {% for command in commands -%}
- {%- if command.named_args and command.named_args.kw %}
- <list name="{{command.name}}_nargs">
- {%- for arg in command.named_args.kw %}
- <item>{{arg}}</item>
- {%- endfor %}
+ <!--[ for command in commands -]-->
+ <!--[- if command.named_args and command.named_args.kw ]-->
+ <list name="<!--{command.name}-->_nargs">
+ <!--[- for arg in command.named_args.kw ]-->
+ <item><!--{arg}--></item>
+ <!--[- endfor ]-->
</list>
- {%- endif %}
- {%- if command.special_args and command.special_args.kw %}
- <list name="{{command.name}}_sargs">
- {%- for arg in command.special_args.kw %}
- <item>{{arg}}</item>
- {%- endfor %}
+ <!--[- endif ]-->
+ <!--[- if command.special_args and command.special_args.kw ]-->
+ <list name="<!--{command.name}-->_sargs">
+ <!--[- for arg in command.special_args.kw ]-->
+ <item><!--{arg}--></item>
+ <!--[- endfor ]-->
</list>
- {%- endif %}
- {%- endfor %}
+ <!--[- endif ]-->
+ <!--[- endfor ]-->
<list name="variables">
- {%- for var in variables.kw %}
- <item>{{var}}</item>
- {%- endfor %}
+ <!--[- for var in variables.kw ]-->
+ <item><!--{var}--></item>
+ <!--[- endfor ]-->
</list>
<list name="deprecated-or-internal-variables">
- {%- for var in deprecated_or_internal_variables.kw %}
- <item>{{var}}</item>
- {%- endfor %}
+ <!--[- for var in deprecated_or_internal_variables.kw ]-->
+ <item><!--{var}--></item>
+ <!--[- endfor ]-->
</list>
<list name="environment-variables">
- {%- for var in environment_variables.kw %}
- <item>{{var}}</item>
- {%- endfor %}
+ <!--[- for var in environment_variables.kw ]-->
+ <item><!--{var}--></item>
+ <!--[- endfor ]-->
</list>
- {%- for kind in properties.kinds %}
- <list name="{{ kind|replace('_', '-') }}">
- {%- for prop in properties[kind].kw %}
- <item>{{prop}}</item>
- {%- endfor %}
+ <!--[- for kind in properties.kinds ]-->
+ <list name="<!--{ kind|replace('_', '-') }-->">
+ <!--[- for prop in properties[kind].kw ]-->
+ <item><!--{prop}--></item>
+ <!--[- endfor ]-->
</list>
- {%- endfor %}
+ <!--[- endfor ]-->
<list name="generator-expressions">
- {%- for expr in generator_expressions %}
- <item>{{ expr }}</item>
- {%- endfor %}
+ <!--[- for expr in generator_expressions ]-->
+ <item><!--{ expr }--></item>
+ <!--[- endfor ]-->
</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 %} />
- {% endfor -%}
+ <!--[ 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 ]--> />
+ <!--[ endfor -]-->
<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="@&id_re;@" lookAhead="true" />
@@ -95,71 +101,64 @@
<keyword attribute="Command" context="#stay" String="commands" />
</context>
- {% for command in commands -%}
- {#
- <!--
- {{ command|pprint }}
- -->
- -#}
- <context attribute="Normal Text" lineEndContext="#stay" name="{{command.name}}_ctx">
- <DetectChar attribute="Normal Text" context="{{command.name}}_ctx_op" char="(" />
+ <!--[ for command in commands -]-->
+ <context attribute="Normal Text" lineEndContext="#stay" name="<!--{command.name}-->_ctx">
+ <DetectChar attribute="Normal Text" context="<!--{command.name}-->_ctx_op" char="(" />
</context>
- <context attribute="Normal Text" lineEndContext="#stay" name="{{command.name}}_ctx_op">
- {%- if command.nested_parentheses %}
- <DetectChar attribute="Normal Text" context="{{command.name}}_ctx_op_nested" char="(" />
- {%- endif %}
+ <context attribute="Normal Text" lineEndContext="#stay" name="<!--{command.name}-->_ctx_op">
+ <!--[- if command.nested_parentheses ]-->
+ <DetectChar attribute="Normal Text" context="<!--{command.name}-->_ctx_op_nested" char="(" />
+ <!--[- endif ]-->
<IncludeRules context="EndCmdPop2" />
- {%- if command.named_args and command.named_args.kw %}
- <keyword attribute="Named Args" context="#stay" String="{{command.name}}_nargs" />
- {%- endif %}
- {%- if command.special_args and command.special_args.kw %}
- <keyword attribute="Special Args" context="#stay" String="{{command.name}}_sargs" />
- {%- endif %}
- {%- if command.property_args and command.property_args.kw %}
- {%- for kind in command.property_args.kw %}
- <keyword attribute="Property" context="#stay" String="{{kind}}" />
- {%- if properties[kind|replace('-', '_')].re %}
- <IncludeRules context="Detect More {{kind}}" />
- {%- endif %}
- {%- endfor %}
- {%- endif %}
- {%- if command is not nulary %}
+ <!--[- if command.named_args and command.named_args.kw ]-->
+ <keyword attribute="Named Args" context="#stay" String="<!--{command.name}-->_nargs" />
+ <!--[- endif ]-->
+ <!--[- if command.special_args and command.special_args.kw ]-->
+ <keyword attribute="Special Args" context="#stay" String="<!--{command.name}-->_sargs" />
+ <!--[- endif ]-->
+ <!--[- if command.property_args and command.property_args.kw ]-->
+ <!--[- for kind in command.property_args.kw ]-->
+ <keyword attribute="Property" context="#stay" String="<!--{kind}-->" />
+ <!--[- if properties[kind|replace('-', '_')].re ]-->
+ <IncludeRules context="Detect More <!--{kind}-->" />
+ <!--[- endif ]-->
+ <!--[- endfor ]-->
+ <!--[- endif ]-->
+ <!--[- if command is not nulary ]-->
<IncludeRules context="User Function Args" />
- {%- if command.name == 'cmake_policy' %}
+ <!--[- if command.name == 'cmake_policy' ]-->
<!-- NOTE Handle CMP<NNN> as a special arg of `cmake_policy` command -->
<RegExpr attribute="Special Args" context="#stay" String="\bCMP[0-9]+\b" />
- {%- endif %}
- {%- endif %}
+ <!--[- endif ]-->
+ <!--[- endif ]-->
</context>
- {%- if command.nested_parentheses %}
- <context attribute="Normal Text" lineEndContext="#stay" name="{{command.name}}_ctx_op_nested">
+ <!--[- if command.nested_parentheses ]-->
+ <context attribute="Normal Text" lineEndContext="#stay" name="<!--{command.name}-->_ctx_op_nested">
<IncludeRules context="EndCmdPop" />
- {%- if command.named_args and command.named_args.kw %}
- <keyword attribute="Named Args" context="#stay" String="{{command.name}}_nargs" />
- {%- endif %}
- {%- if command.special_args and command.special_args.kw %}
- <keyword attribute="Special Args" context="#stay" String="{{command.name}}_sargs" />
- {%- endif %}
- {%- if command.property_args and command.property_args.kw %}
- {%- for kind in command.property_args.kw %}
- <keyword attribute="Property" context="#stay" String="{{kind}}" />
- {%- if properties[kind|replace('-', '_')].re %}
- <IncludeRules context="Detect More {{kind}}" />
- {%- endif %}
- {%- endfor %}
- {%- endif %}
+ <!--[- if command.named_args and command.named_args.kw ]-->
+ <keyword attribute="Named Args" context="#stay" String="<!--{command.name}-->_nargs" />
+ <!--[- endif ]-->
+ <!--[- if command.special_args and command.special_args.kw ]-->
+ <keyword attribute="Special Args" context="#stay" String="<!--{command.name}-->_sargs" />
+ <!--[- endif ]-->
+ <!--[- if command.property_args and command.property_args.kw ]-->
+ <!--[- for kind in command.property_args.kw ]-->
+ <keyword attribute="Property" context="#stay" String="<!--{kind}-->" />
+ <!--[- if properties[kind|replace('-', '_')].re ]-->
+ <IncludeRules context="Detect More <!--{kind}-->" />
+ <!--[- endif ]-->
+ <!--[- endfor ]-->
+ <!--[- endif ]-->
<IncludeRules context="User Function Args" />
</context>
- {%- endif %}
- {% endfor -%}
+ <!--[- endif ]-->
+ <!--[ endfor -]-->
- {% for kind in properties.kinds if properties[kind].re -%}
- <context attribute="Normal Text" lineEndContext="#stay" name="Detect More {{ kind|replace('_', '-') }}">
- {%- for prop in properties[kind].re %}
- <RegExpr attribute="Property" context="#stay" String="{{prop}}" />
- {%- endfor %}
- </context>{{ '\n' }}
- {% endfor -%}
+ <!--[ for kind in properties.kinds if properties[kind].re -]-->
+ <context attribute="Normal Text" lineEndContext="#stay" name="Detect More <!--{ kind|replace('_', '-') }-->">
+ <RegExpr attribute="Property" context="#stay" String="<!--{properties[kind].re}-->" />
+ </context><!--{ '\n' }-->
+ <!--[ endfor -]-->
<context attribute="Normal Text" lineEndContext="#stay" name="EndCmdPop">
<DetectChar attribute="Normal Text" context="#pop" char=")" />
@@ -187,12 +186,12 @@
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="Detect More Builtin Variables">
- {%- for var in deprecated_or_internal_variables.re %}
- <RegExpr attribute="CMake Internal Variable" context="#stay" String="{{var}}" />
- {%- endfor %}
- {%- for var in variables.re %}
- <RegExpr attribute="Builtin Variable" context="#stay" String="{{var}}" />
- {%- endfor %}
+ <!--[- if deprecated_or_internal_variables.re ]-->
+ <RegExpr attribute="CMake Internal Variable" context="#stay" String="<!--{deprecated_or_internal_variables.re}-->" />
+ <!--[- endif ]-->
+ <!--[- if variables.re ]-->
+ <RegExpr attribute="Builtin Variable" context="#stay" String="<!--{variables.re}-->" />
+ <!--[- endif ]-->
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="Detect Variable Substitutions">
@@ -204,9 +203,9 @@
<context attribute="Environment Variable Substitution" lineEndContext="#pop" name="EnvVarSubst">
<keyword attribute="Standard Environment Variable" context="#stay" String="environment-variables" insensitive="false" />
- {%- for var in environment_variables.re %}
- <RegExpr attribute="Standard Environment Variable" context="#stay" String="{{var}}" />
- {%- endfor %}
+ <!--[- 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="}" />
@@ -248,10 +247,20 @@
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="Detect Special Values">
- <WordDetect attribute="True Special Arg" context="#stay" String="TRUE" />
- <WordDetect attribute="True Special Arg" context="#stay" String="ON" />
- <WordDetect attribute="False Special Arg" context="#stay" String="FALSE" />
- <WordDetect attribute="False Special Arg" context="#stay" String="OFF" />
+ <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="False Special Arg" context="#stay" String="\b(?:&id_re;-)?NOTFOUND\b" />
<RegExpr attribute="Special Args" context="#stay" String="\bCMP[0-9][0-9][0-9]\b" />
</context>
@@ -273,8 +282,7 @@
<context attribute="Comment" lineEndContext="#pop" name="Comment">
<LineContinue attribute="Comment" context="#pop" />
<DetectSpaces />
- <IncludeRules context="##Alerts" />
- <IncludeRules context="##Modelines" />
+ <IncludeRules context="##Comments" />
</context>
<context attribute="Comment" lineEndContext="#stay" name="RST Documentation" dynamic="true">
@@ -286,8 +294,7 @@
<LineContinue attribute="Comment" context="#stay" />
<DetectSpaces />
<StringDetect attribute="Comment" context="#pop" String="]%1]" dynamic="true" endRegion="BracketedComment" />
- <IncludeRules context="##Alerts" />
- <IncludeRules context="##Modelines" />
+ <IncludeRules context="##Comments" />
</context>
<context attribute="Strings" lineEndContext="#stay" name="String">
@@ -331,6 +338,7 @@
<itemData name="Special Args" defStyleNum="dsOthers" spellChecking="false" />
<itemData name="True Special Arg" defStyleNum="dsOthers" color="#30a030" selColor="#30a030" spellChecking="false" />
<itemData name="False Special Arg" defStyleNum="dsOthers" color="#e05050" selColor="#e05050" spellChecking="false" />
+ <itemData name="Version Arg" defStyleNum="dsDataType" spellChecking="false" />
<itemData name="Strings" defStyleNum="dsString" spellChecking="true" />
<itemData name="Escapes" defStyleNum="dsSpecialChar" spellChecking="false" />
<itemData name="Builtin Variable" defStyleNum="dsDecVal" color="#c09050" selColor="#c09050" spellChecking="false" />
@@ -354,7 +362,7 @@
<comment name="singleLine" start="#" position="afterwhitespace" />
<comment name="multiLine" start="#[[" end="]]" region="BracketedComment"/>
</comments>
- <keywords casesensitive="1" />
+ <keywords casesensitive="1" weakDeliminator="." />
</general>
</language>
diff --git a/src/libs/3rdparty/syntax-highlighting/data/generators/cmake.yaml b/src/libs/3rdparty/syntax-highlighting/data/generators/cmake.yaml
index e776c2508f..7d4f113cba 100644
--- a/src/libs/3rdparty/syntax-highlighting/data/generators/cmake.yaml
+++ b/src/libs/3rdparty/syntax-highlighting/data/generators/cmake.yaml
@@ -232,6 +232,9 @@ target-properties:
- INTERPROCEDURAL_OPTIMIZATION_<CONFIG>
- INTERPROCEDURAL_OPTIMIZATION
- IOS_INSTALL_COMBINED
+ - ISPC_HEADER_DIRECTORY # Since 3.19
+ - ISPC_HEADER_SUFFIX # Since 3.19.2
+ - ISPC_INSTRUCTION_SETS # Since 3.19
- JOB_POOL_COMPILE
- JOB_POOL_LINK
- LABELS
@@ -274,6 +277,14 @@ target-properties:
- NAME
- NO_SONAME
- NO_SYSTEM_FROM_IMPORTED
+ - OBJC_EXTENSIONS # Since 3.16
+ - OBJC_STANDARD # Since 3.16
+ - OBJC_STANDARD_REQUIRED # Since 3.16
+ - OBJCXX_EXTENSIONS # Since 3.16
+ - OBJCXX_STANDARD # Since 3.16
+ - OBJCXX_STANDARD_REQUIRED # Since 3.16
+ - OPTIMIZE_DEPENDENCIES # Since 3.19
+ - OBJC_STANDARD
- OSX_ARCHITECTURES_<CONFIG>
- OSX_ARCHITECTURES
- OSX_CURRENT_VERSION # Since 3.17
@@ -281,6 +292,7 @@ target-properties:
- OUTPUT_NAME_<CONFIG>
- OUTPUT_NAME
- PCH_WARN_INVALID # Since 3.18
+ - PCH_INSTANTIATE_TEMPLATES # Since 3.19
- PDB_NAME_<CONFIG>
- PDB_NAME
- PDB_OUTPUT_DIRECTORY_<CONFIG>
@@ -362,6 +374,7 @@ target-properties:
- XCODE_ATTRIBUTE_<an-attribute>
- XCODE_EXPLICIT_FILE_TYPE
- XCODE_GENERATE_SCHEME # Since 3.15
+ - XCODE_LINK_BUILD_PHASE_MODE # Since 3.19
- XCODE_PRODUCT_TYPE
- XCODE_SCHEME_ADDRESS_SANITIZER # Since 3.13
- XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN # Since 3.13
@@ -669,9 +682,12 @@ variables:
- CMAKE_VS_PLATFORM_TOOLSET_CUDA
- CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE
- CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION
- - CMAKE_XCODE_GENERATE_SCHEME
+ - CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM # Since 3.19
+ - CMAKE_XCODE_BUILD_SYSTEM # Since 3.19
- CMAKE_XCODE_PLATFORM_TOOLSET
- <PROJECT-NAME>_BINARY_DIR
+ - <PROJECT-NAME>_DESCRIPTION # Since 3.12
+ - <PROJECT-NAME>_HOMEPAGE_URL # Since 3.12
- <PROJECT-NAME>_SOURCE_DIR
- <PROJECT-NAME>_VERSION
- <PROJECT-NAME>_VERSION_MAJOR
@@ -679,7 +695,7 @@ variables:
- <PROJECT-NAME>_VERSION_PATCH
- <PROJECT-NAME>_VERSION_TWEAK
- PROJECT_BINARY_DIR
- - PROJECT_DESCRIPTION
+ - PROJECT_DESCRIPTION # Since 3.9
- PROJECT_HOMEPAGE_URL # Since 3.12
- PROJECT_NAME
- PROJECT_SOURCE_DIR
@@ -695,6 +711,7 @@ variables:
- CMAKE_AUTOMOC_RELAXED_MODE
- CMAKE_BACKWARDS_COMPATIBILITY
- CMAKE_BUILD_TYPE
+ - CMAKE_CLANG_VFS_OVERLAY # Since 3.19
- CMAKE_CODEBLOCKS_COMPILER_ID # Since 3.11
- CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES # Since 3.10
- CMAKE_CODELITE_USE_TARGETS
@@ -777,7 +794,9 @@ variables:
- CMAKE_USER_MAKE_RULES_OVERRIDE
- CMAKE_WARN_DEPRECATED
- CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION
+ - CMAKE_XCODE_GENERATE_SCHEME
- CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY # Since 3.13
+ - CMAKE_XCODE_LINK_BUILD_PHASE_MODE # Since 3.19
- CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER # Since 3.13
- CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN # Since 3.13
- CMAKE_XCODE_SCHEME_WORKING_DIRECTORY # Since 3.17
@@ -869,6 +888,7 @@ variables:
- CMAKE_ANDROID_SKIP_ANT_STEP
- CMAKE_ANDROID_STANDALONE_TOOLCHAIN
- CMAKE_ANDROID_STL_TYPE
+ - CMAKE_APPLE_SILICON_PROCESSOR # Since 3.19.2
- CMAKE_ARCHIVE_OUTPUT_DIRECTORY
- CMAKE_ARCHIVE_OUTPUT_DIRECTORY_<CONFIG>
- CMAKE_AUTOGEN_ORIGIN_DEPENDS # Since 3.14
@@ -951,10 +971,12 @@ variables:
- CMAKE_NINJA_OUTPUT_PATH_PREFIX
- CMAKE_NO_BUILTIN_CHRPATH
- CMAKE_NO_SYSTEM_FROM_IMPORTED
+ - CMAKE_OPTIMIZE_DEPENDENCIES # Since 3.19
- CMAKE_OSX_ARCHITECTURES
- CMAKE_OSX_DEPLOYMENT_TARGET
- CMAKE_OSX_SYSROOT
- CMAKE_PCH_WARN_INVALID # Since 3.18
+ - CMAKE_PCH_INSTANTIATE_TEMPLATES # Since 3.19
- CMAKE_PDB_OUTPUT_DIRECTORY
- CMAKE_PDB_OUTPUT_DIRECTORY_<CONFIG>
- CMAKE_POSITION_INDEPENDENT_CODE
@@ -1015,6 +1037,9 @@ variables:
- CMAKE_Fortran_MODDIR_DEFAULT
- CMAKE_Fortran_MODDIR_FLAG
- CMAKE_Fortran_MODOUT_FLAG
+ - CMAKE_ISPC_HEADER_DIRECTORY # Since 3.19
+ - CMAKE_ISPC_HEADER_SUFFIX # Since 3.19.2
+ - CMAKE_ISPC_INSTRUCTION_SETS # Since 3.19
- CMAKE_<LANG>_ANDROID_TOOLCHAIN_MACHINE
- CMAKE_<LANG>_ANDROID_TOOLCHAIN_PREFIX
- CMAKE_<LANG>_ANDROID_TOOLCHAIN_SUFFIX
@@ -1063,6 +1088,12 @@ variables:
- CMAKE_<LANG>_SOURCE_FILE_EXTENSIONS
- CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES
- CMAKE_<LANG>_STANDARD_LIBRARIES
+ - CMAKE_OBJC_EXTENSIONS # Since 3.16
+ - CMAKE_OBJC_STANDARD # Since 3.16
+ - CMAKE_OBJC_STANDARD_REQUIRED # Since 3.16
+ - CMAKE_OBJCXX_EXTENSIONS # Since 3.16
+ - CMAKE_OBJCXX_STANDARD # Since 3.16
+ - CMAKE_OBJCXX_STANDARD_REQUIRED # Since 3.16
- CMAKE_Swift_LANGUAGE_VERSION
- CMAKE_USER_MAKE_RULES_OVERRIDE_<LANG>
# Variables for CTest
@@ -1190,8 +1221,11 @@ variables:
- <pfx>_UNPARSED_ARGUMENTS
- <pfx>_KEYWORDS_MISSING_VALUES
# Well known CMake's official module's variables
+ # - CheckCompilerFlag
# - CheckCCompilerFlag
+ # - CheckSourceCompiles
# - CheckCSourceCompiles
+ # - CheckSourceRuns
# - CheckCSourceRuns
# - CheckCxxCompilerFlag
# - CheckCxxSourceCompiles
@@ -1337,6 +1371,7 @@ variables:
- CPACK_EXTERNAL_REQUESTED_VERSIONS
- CPACK_EXTERNAL_ENABLE_STAGING
- CPACK_EXTERNAL_PACKAGE_SCRIPT
+ - CPACK_EXTERNAL_BUILT_PACKAGES # Since 3.19
# - CPackIFW
- CPACK_IFW_ROOT
- QTIFWDIR
@@ -1597,6 +1632,9 @@ variables:
- CPACK_PACKAGE_INSTALL_REGISTRY_KEY
- CPACK_CREATE_DESKTOP_LINKS
- CPACK_BINARY_<GENNAME>
+ - CPACK_PRE_BUILD_SCRIPTS # Since 3.19
+ - CPACK_POST_BUILD_SCRIPTS # Since 3.19
+ - CPACK_PACKAGE_FILES # Since 3.19
# - CPackWIX
- CPACK_WIX_UPGRADE_GUID
- CPACK_WIX_PRODUCT_GUID
@@ -1621,6 +1659,7 @@ variables:
- CPACK_WIX_SKIP_PROGRAM_FOLDER
- CPACK_WIX_ROOT_FOLDER_ID
- CPACK_WIX_ROOT
+ - CPACK_WIX_CUSTOM_XMLNS # Since 3.19
# - CTest
# - Dart
- BUILD_TESTING
@@ -1750,6 +1789,7 @@ deprecated-or-internal-variables:
# NOTE Added to syntax file version 14 at 3.15.0 version of CMake
environment-variables:
# Environment Variables that Control the Build
+ - CMAKE_APPLE_SILICON_PROCESSOR # Since 3.19.2
- CMAKE_BUILD_PARALLEL_LEVEL
- CMAKE_CONFIG_TYPE
- CMAKE_EXPORT_COMPILE_COMMANDS # Since 3.17
@@ -1837,7 +1877,19 @@ scripting-commands:
]
-
name: cmake_language
- named-args: [CALL, EVAL, CODE]
+ named-args: [
+ CALL
+ , EVAL
+ , CODE
+ # Since 3.19
+ , DEFER
+ , DIRECTORY
+ , ID
+ , ID_VAR
+ , GET_CALL_IDS
+ , GET_CALL
+ , CANCEL_CALL
+ ]
-
name: cmake_minimum_required
named-args: [VERSION, FATAL_ERROR]
@@ -1850,7 +1902,13 @@ scripting-commands:
special-args: [OLD, NEW]
-
name: configure_file
- named-args: [COPYONLY, ESCAPE_QUOTES, "@ONLY", NEWLINE_STYLE]
+ named-args: [
+ COPYONLY
+ , ESCAPE_QUOTES
+ , NO_SOURCE_PERMISSIONS # Since 3.19
+ , "@ONLY"
+ , NEWLINE_STYLE
+ ]
special-args: [UNIX, DOS, WIN32, LF, CRLF]
-
name: continue
@@ -1934,6 +1992,7 @@ scripting-commands:
, ENCODING
, ECHO_OUTPUT_VARIABLE # Since 3.18
, ECHO_ERROR_VARIABLE # Since 3.18
+ , COMMAND_ERROR_IS_FATAL # Since 3.19
]
special-args: [
NONE
@@ -1943,6 +2002,8 @@ scripting-commands:
, UTF8
, STDERR # Since 3.15: the value for `COMMAND_ECHO`
, STDOUT # Since 3.15: the value for `COMMAND_ECHO`
+ , ANY # Since 3.19: the value for `COMMAND_ERROR_IS_FATAL`
+ , LAST # Since 3.19: the value for `COMMAND_ERROR_IS_FATAL`
]
nested-parentheses?: true
-
@@ -2009,6 +2070,7 @@ scripting-commands:
, INPUT
, CONTENT
, CONDITION
+ , TARGET # Since 3.19
, COPY
, INSTALL
, DESTINATION
@@ -2040,7 +2102,8 @@ scripting-commands:
, ARCHIVE_CREATE
, FILES
, FORMAT
- , TYPE
+ , COMPRESSION
+ , COMPRESSION_LEVEL # Since 3.19
, MTIME
, VERBOSE
, ARCHIVE_EXTRACT
@@ -2049,6 +2112,10 @@ scripting-commands:
, ESCAPE_QUOTES
, "@ONLY"
, NEWLINE_STYLE
+ , CHMOD # Since 3.19
+ , CHMOD_RECURSE # Since 3.19
+ , REAL_PATH # Since 3.19
+ , BASE_DIRECTORY # Since 3.19
]
special-args: [
UTF-8
@@ -2345,7 +2412,13 @@ scripting-commands:
nulary?: true
-
name: separate_arguments
- named-args: [NATIVE_COMMAND, UNIX_COMMAND, WINDOWS_COMMAND]
+ named-args: [
+ NATIVE_COMMAND
+ , UNIX_COMMAND
+ , WINDOWS_COMMAND
+ , PROGRAM # Since 3.19
+ , SEPARATE_ARGS # Since 3.19
+ ]
-
name: set_directory_properties
named-args: [PROPERTIES]
@@ -2429,6 +2502,16 @@ scripting-commands:
, NAME
, TYPE
, UPPER
+ # Since 3.19
+ , JSON
+ , ERROR_VARIABLE
+ , GET
+ , TYPE
+ , MEMBER
+ , LENGTH
+ , REMOVE
+ , SET
+ , EQUAL
]
-
name: unset
@@ -2532,6 +2615,7 @@ project-commands:
, CSharp
, CXX
, CUDA
+ , ISPC # Since 3.19
, Java
, OBJC # Since 3.16
, OBJCXX # Since 3.16
@@ -2656,6 +2740,7 @@ project-commands:
, CSharp
, CXX
, CUDA
+ , ISPC # Since 3.19
, Java
, OBJC # Since 3.16
, OBJCXX # Since 3.16
diff --git a/src/libs/3rdparty/syntax-highlighting/data/generators/generate-cmake-syntax.py b/src/libs/3rdparty/syntax-highlighting/data/generators/generate-cmake-syntax.py
index 0dd04a44be..24b1eb0d7c 100644
--- a/src/libs/3rdparty/syntax-highlighting/data/generators/generate-cmake-syntax.py
+++ b/src/libs/3rdparty/syntax-highlighting/data/generators/generate-cmake-syntax.py
@@ -3,7 +3,7 @@
#
# Generate Kate syntax file for CMake
#
-# SPDX-FileCopyrightText: 2017-2019 Alex Turbov <i.zaufi@gmail.com>
+# SPDX-FileCopyrightText: 2017-2020 Alex Turbov <i.zaufi@gmail.com>
#
# To install prerequisites:
#
@@ -43,21 +43,29 @@ def try_transform_placeholder_string_to_regex(name):
'''
m = _TEMPLATED_NAME.split(name)
if 'CMAKE_MATCH_' in m:
- return '\\bCMAKE_MATCH_[0-9]+\\b'
+ return 'CMAKE_MATCH_[0-9]+'
if 'CMAKE_ARGV' in m:
- return '\\bCMAKE_ARGV[0-9]+\\b'
+ return 'CMAKE_ARGV[0-9]+'
if 'CMAKE_POLICY_DEFAULT_CMP' in m:
- return '\\bCMAKE_POLICY_DEFAULT_CMP[0-9]{4}\\b'
+ return 'CMAKE_POLICY_DEFAULT_CMP[0-9]{4}'
if 'CMAKE_POLICY_WARNING_CMP' in m:
- return '\\bCMAKE_POLICY_WARNING_CMP[0-9]{4}\\b'
+ return 'CMAKE_POLICY_WARNING_CMP[0-9]{4}'
if 'ARGV' in m:
- return '\\bARGV[0-9]+\\b'
+ return 'ARGV[0-9]+'
- return '\\b{}\\b'.format('&id_re;'.join(list(m))) if 1 < len(m) else name
+ return '&id_re;'.join(m) if 1 < len(m) else name
+
+
+def try_placeholders_to_regex(names):
+ if not names:
+ return None
+ l = map(try_transform_placeholder_string_to_regex, names)
+ l = sorted(l, reverse=True)
+ return '\\b(?:' + '|'.join(l) + ')\\b'
def partition_iterable(fn, iterable):
@@ -73,7 +81,7 @@ def _transform_command_set(cmd, list_name):
list_name = list_name.replace('-', '_')
cmd[list_name] = {k: sorted(set(v)) for k, v in zip(_KW_RE_LIST, [args, args_re])}
- cmd[list_name]['re'] = [*map(lambda x: try_transform_placeholder_string_to_regex(x), args_re)]
+ cmd[list_name]['re'] = try_placeholders_to_regex(args_re)
return cmd
@@ -136,12 +144,7 @@ def cli(input_yaml, template):
, [*partition_iterable(lambda x: _TEMPLATED_NAME.search(x) is None, data[var_key])]
)
}
- data[var_key]['re'] = [
- *map(
- lambda x: try_transform_placeholder_string_to_regex(x)
- , data[var_key]['re']
- )
- ]
+ data[var_key]['re'] = try_placeholders_to_regex(data[var_key]['re'])
# Transform properties and make all-properties list
data['properties'] = {}
@@ -153,18 +156,16 @@ def cli(input_yaml, template):
data['properties'][python_prop_list_name] = {
k: sorted(set(v)) for k, v in zip(_KW_RE_LIST, [props, props_re])
}
- data['properties'][python_prop_list_name]['re'] = [
- *map(lambda x: try_transform_placeholder_string_to_regex(x), props_re)
- ]
+ data['properties'][python_prop_list_name]['re'] = try_placeholders_to_regex(props_re)
- data['properties']['kinds'] = [*map(lambda name: name.replace('-', '_'), _PROPERTY_KEYS)]
+ data['properties']['kinds'] = list(map(lambda name: name.replace('-', '_'), _PROPERTY_KEYS))
# Make all commands list
- data['commands'] = [
- *map(
- lambda cmd: transform_command(cmd)
+ data['commands'] = list(
+ map(
+ transform_command
, data['scripting-commands'] + data['project-commands'] + data['ctest-commands'])
- ]
+ )
# Fix node names to be accessible from Jinja template
data['generator_expressions'] = data['generator-expressions']
@@ -177,6 +178,12 @@ def cli(input_yaml, template):
env = jinja2.Environment(
keep_trailing_newline=True
)
+ env.block_start_string = '<!--['
+ env.block_end_string = ']-->'
+ env.variable_start_string = '<!--{'
+ env.variable_end_string = '}-->'
+ env.comment_start_string = '<!--#'
+ env.comment_end_string = '#-->'
# Register convenience filters
env.tests['nulary'] = cmd_is_nulary
diff --git a/src/libs/3rdparty/syntax-highlighting/data/generators/generate-php.pl b/src/libs/3rdparty/syntax-highlighting/data/generators/generate-php.pl
index 04c9fcdb36..a3b20fb554 100644
--- a/src/libs/3rdparty/syntax-highlighting/data/generators/generate-php.pl
+++ b/src/libs/3rdparty/syntax-highlighting/data/generators/generate-php.pl
@@ -19,7 +19,13 @@
my $file = "";
-while (<>)
+open(my $input, '<:encoding(UTF-8)', $ARGV[0])
+ or die "Could not open file '$ARGV[0]': $!";
+
+open(my $output, '>:encoding(UTF-8)', $ARGV[1])
+ or die "Could not open file '$ARGV[1]': $!";
+
+while (<$input>)
{
$file .= $_;
}
@@ -55,12 +61,17 @@ else
$file =~ s/<language([^>]+)mimetype="[^"]*"/<language$1mimetype=""/s;
}
-$findphp = "<context name=\"FindPHP\" attribute=\"Normal Text\" lineEndContext=\"#stay\">\n<RegExpr context=\"##PHP/PHP\" String=\"&lt;\\?(?:=|php)?\" lookAhead=\"true\" />\n</context>\n";
+if ($root == 1 || $ARGV[0] =~ /mustache.xml$/)
+{
+ $file =~ s/<(?:RegExpr (attribute="Processing Instruction" context="PI"|context="PI" attribute="Processing Instruction")|itemData name="Processing Instruction")[^\/]+\/>|<context name="PI".*?<\/context>//gs;
+}
+
+$findphp = "<context name=\"FindPHP\" attribute=\"Normal Text\" lineEndContext=\"#stay\">\n<Detect2Chars context=\"##PHP/PHP\" char=\"&lt;\" char1=\"?\" lookAhead=\"true\" />\n</context>\n";
-$file =~ s/<IncludeRules\s([^>]*)context="([^"#]*)##(?!Alerts|Doxygen|Modelines)([^"]+)"/<IncludeRules $1context="$2##$3\/PHP"/g;
+$file =~ s/<IncludeRules\s([^>]*)context="([^"#]*)##(?!Alerts|Comments|Doxygen|Modelines)([^"]+)"/<IncludeRules $1context="$2##$3\/PHP"/g;
$file =~ s/(<context\s[^>]*[^>\/]>)/$1\n<IncludeRules context="FindPHP" \/>/g;
$file =~ s/(<context\s[^>]*[^>\/])\s*\/>/$1>\n<IncludeRules context="FindPHP" \/>\n<\/context>/g;
$file =~ s/(?=<\/contexts\s*>)/$findphp/;
-print $file;
-print $warning;
+print $output $file;
+print $output $warning;
diff --git a/src/libs/3rdparty/syntax-highlighting/data/schema/language.xsd b/src/libs/3rdparty/syntax-highlighting/data/schema/language.xsd
index 5fdbbb07df..fa510e0d14 100644
--- a/src/libs/3rdparty/syntax-highlighting/data/schema/language.xsd
+++ b/src/libs/3rdparty/syntax-highlighting/data/schema/language.xsd
@@ -395,49 +395,61 @@
commonAttributes: Common attributes
insensitive: Is this list case-insensitive? [boolean, optional, see note]
String: Name of the list
- weakDelimiter: Use weak deliminator
+ weakDeliminator: Add weak deliminators [optional, see note]
+ additionalDeliminator: Add deliminators [optional, see note]
By default, case sensitivity is determined from <keywords casesensitive> in
<general> (default=true), but can be overridden per-list with 'insensitive'.
- TODO:
- - Should be weakDeliminator
- - Explain deliminator
- - Doesn't seem to be supported in highligh.cpp
+ weakDeliminator and additionalDeliminator are accumulated to those defined in
+ <keywords weakDeliminator additionalDeliminator> in <general>.
-->
<xs:element name="keyword">
<xs:complexType>
<xs:attributeGroup ref="commonAttributes"/>
<xs:attribute name="insensitive" type="xs:boolean"/>
<xs:attribute name="String" use="required"/>
- <xs:attribute name="weakDelimiter"/>
+ <xs:attribute name="weakDeliminator"/>
+ <xs:attribute name="additionalDeliminator"/>
</xs:complexType>
</xs:element>
<!--
Detect a floating point number
commonAttributes: Common attributes
+ weakDeliminator: Add weak deliminators [optional]
+ additionalDeliminator: Add deliminators [optional]
-->
<xs:element name="Float">
<xs:complexType>
<xs:attributeGroup ref="commonAttributes"/>
+ <xs:attribute name="weakDeliminator"/>
+ <xs:attribute name="additionalDeliminator"/>
</xs:complexType>
</xs:element>
<!--
Detect an octal number
commonAttributes: Common attributes
+ weakDeliminator: Add weak deliminators [optional]
+ additionalDeliminator: Add deliminators [optional]
-->
<xs:element name="HlCOct">
<xs:complexType>
<xs:attributeGroup ref="commonAttributes"/>
+ <xs:attribute name="weakDeliminator"/>
+ <xs:attribute name="additionalDeliminator"/>
</xs:complexType>
</xs:element>
<!--
Detect a hexadecimal number
commonAttributes: Common attributes
+ weakDeliminator: Add weak deliminators [optional]
+ additionalDeliminator: Add deliminators [optional]
-->
<xs:element name="HlCHex">
<xs:complexType>
<xs:attributeGroup ref="commonAttributes"/>
+ <xs:attribute name="weakDeliminator"/>
+ <xs:attribute name="additionalDeliminator"/>
</xs:complexType>
</xs:element>
<!--
@@ -455,10 +467,14 @@
<!--
Detect an integer number
commonAttributes: Common attributes
+ weakDeliminator: Add weak deliminators [optional]
+ additionalDeliminator: Add deliminators [optional]
-->
<xs:element name="Int">
<xs:complexType>
<xs:attributeGroup ref="commonAttributes"/>
+ <xs:attribute name="weakDeliminator"/>
+ <xs:attribute name="additionalDeliminator"/>
</xs:complexType>
</xs:element>
<!--
@@ -524,6 +540,8 @@
commonAttributes: Common attributes
String: The string to look for
insensitive: Whether the string is matched case INsensitive. [boolean, optional, default=false]
+ weakDeliminator: Add weak deliminators [optional]
+ additionalDeliminator: Add deliminators [optional]
TODO
- What's default of insensitive? I'm not sure...
@@ -533,6 +551,8 @@
<xs:attributeGroup ref="commonAttributes"/>
<xs:attribute name="String" use="required"/>
<xs:attribute name="insensitive" type="xs:boolean"/>
+ <xs:attribute name="weakDeliminator"/>
+ <xs:attribute name="additionalDeliminator"/>
</xs:complexType>
</xs:element>
<!--
diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/alert.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/alert.xml
index ec881f1503..b71b065e9b 100644
--- a/src/libs/3rdparty/syntax-highlighting/data/syntax/alert.xml
+++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/alert.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
-<language version="5" kateversion="3.1" name="Alerts" section="Other" extensions="" mimetype="" author="Dominik Haumann (dhaumann@kde.org)" license="MIT" hidden="true">
+<language version="6" 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>
@@ -19,6 +19,7 @@
<item>WARNING</item>
<item>CAUTION</item>
<item>NOLINT</item>
+ <item>NOQA</item>
</list>
<list name="alerts_lo">
<item>###</item>
diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/bash.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/bash.xml
index 240e98b436..d7e4ed3d70 100644
--- a/src/libs/3rdparty/syntax-highlighting/data/syntax/bash.xml
+++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/bash.xml
@@ -1,15 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd"
[
- <!ENTITY funcname "[A-Za-z_:][A-Za-z0-9_:#&#37;@-]*">
+ <!ENTITY tab "&#009;">
+ <!ENTITY funcname "([^&_fragpathseps;}=#$]|[+!@](?!\())([^&_fragpathseps;}=$]*+([+!@](?!\())?+)*+">
<!ENTITY varname "[A-Za-z_][A-Za-z0-9_]*">
- <!ENTITY word "[^|&amp;;()&lt;&gt;\s]+"> <!-- see man bash -->
- <!ENTITY eos "(?=($|\s))"> <!-- eol or space following -->
- <!ENTITY noword "(?![\w$+-])"> <!-- no word, $, + or - following -->
- <!ENTITY pathpart "([\w_@.&#37;*?+-]|\\ )"> <!-- valid character in a file name -->
- <!ENTITY charbeforecomment "[\s;]"> <!-- character before a comment # -->
+ <!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 _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 _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;]*))">
]>
-<language name="Bash" version="11" kateversion="5.0" section="Scripts" extensions="*.sh;*.bash;*.ebuild;*.eclass;*.nix;.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="27" kateversion="5.79" section="Scripts" extensions="*.sh;*.bash;*.ebuild;*.eclass;*.nix;.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)
@@ -19,19 +40,27 @@
<highlighting>
<list name="keywords">
+ <item>case</item>
+ <item>continue</item>
+ <item>do</item>
+ <item>done</item>
+ <item>elif</item>
<item>else</item>
+ <item>esac</item>
+ <item>fi</item>
<item>for</item>
<item>function</item>
+ <item>if</item>
<item>in</item>
+ <item>return</item>
<item>select</item>
+ <item>then</item>
<item>until</item>
<item>while</item>
- <item>elif</item>
- <item>then</item>
- <item>set</item>
</list>
<list name="builtins">
+ <item>.</item>
<item>:</item>
<item>source</item>
<item>alias</item>
@@ -44,7 +73,7 @@
<item>command</item>
<item>compgen</item>
<item>complete</item>
- <item>continue</item>
+ <item>coproc</item>
<item>dirs</item>
<item>disown</item>
<item>echo</item>
@@ -54,19 +83,16 @@
<item>exit</item>
<item>fc</item>
<item>fg</item>
- <item>getopts</item>
<item>hash</item>
<item>help</item>
<item>history</item>
<item>jobs</item>
<item>kill</item>
- <item>let</item>
<item>logout</item>
<item>popd</item>
<item>printf</item>
<item>pushd</item>
<item>pwd</item>
- <item>return</item>
<item>set</item>
<item>shift</item>
<item>shopt</item>
@@ -84,12 +110,14 @@
<list name="builtins_var">
<item>export</item>
- <item>unset</item>
<item>declare</item>
- <item>typeset</item>
+ <item>getopts</item>
+ <item>let</item>
<item>local</item>
<item>read</item>
<item>readonly</item>
+ <item>typeset</item>
+ <item>unset</item>
</list>
<list name="unixcommands">
@@ -126,7 +154,6 @@
<item>domainname</item>
<item>du</item>
<item>dumpkeys</item>
- <item>echo</item>
<item>ed</item>
<item>egrep</item>
<item>false</item>
@@ -166,7 +193,6 @@
<item>lzfgrep</item>
<item>lzgrep</item>
<item>lzless</item>
- <item>lzcat</item>
<item>lzma</item>
<item>lzmainfo</item>
<item>lzmore</item>
@@ -189,7 +215,6 @@
<item>ping</item>
<item>ps</item>
<item>pstree</item>
- <item>pwd</item>
<item>rbash</item>
<item>readlink</item>
<item>red</item>
@@ -218,6 +243,7 @@
<item>touch</item>
<item>troff</item>
<item>true</item>
+ <item>truncate</item>
<item>umount</item>
<item>uname</item>
<item>unicode_start</item>
@@ -259,13 +285,11 @@
<item>autoconf</item>
<item>autoheader</item>
<item>automake</item>
- <item>awk</item>
<item>basename</item>
<item>bc</item>
<item>bison</item>
<item>c++</item>
<item>cal</item>
- <item>cat</item>
<item>cc</item>
<item>cdda2wav</item>
<item>cdparanoia</item>
@@ -273,9 +297,6 @@
<item>cd-read</item>
<item>cdrecord</item>
<item>chfn</item>
- <item>chgrp</item>
- <item>chmod</item>
- <item>chown</item>
<item>chroot</item>
<item>chsh</item>
<item>clear</item>
@@ -283,20 +304,14 @@
<item>co</item>
<item>col</item>
<item>comm</item>
- <item>cp</item>
<item>cpio</item>
<item>cpp</item>
<item>cut</item>
<item>dc</item>
- <item>dd</item>
- <item>df</item>
<item>diff</item>
<item>diff3</item>
- <item>dir</item>
- <item>dircolors</item>
<item>directomatic</item>
<item>dirname</item>
- <item>du</item>
<item>env</item>
<item>expr</item>
<item>fbset</item>
@@ -308,9 +323,7 @@
<item>free</item>
<item>ftp</item>
<item>funzip</item>
- <item>fuser</item>
<item>g++</item>
- <item>gawk</item>
<item>gc</item>
<item>gcc</item>
<item>clang</item>
@@ -334,30 +347,22 @@
<item>head</item>
<item>hexdump</item>
<item>id</item>
- <item>install</item>
<item>join</item>
- <item>kill</item>
- <item>killall</item>
<item>ld</item>
<item>ld86</item>
<item>ldd</item>
<item>less</item>
<item>lex</item>
- <item>ln</item>
<item>locate</item>
<item>lockfile</item>
<item>logname</item>
<item>lp</item>
<item>lpr</item>
- <item>ls</item>
<item>lynx</item>
<item>m4</item>
<item>make</item>
<item>man</item>
- <item>mkdir</item>
- <item>mknod</item>
<item>msgfmt</item>
- <item>mv</item>
<item>namei</item>
<item>nasm</item>
<item>nawk</item>
@@ -375,9 +380,7 @@
<item>pcretest</item>
<item>perl</item>
<item>perror</item>
- <item>pidof</item>
<item>pr</item>
- <item>printf</item>
<item>procmail</item>
<item>prune</item>
<item>ps2ascii</item>
@@ -393,12 +396,9 @@
<item>pstops</item>
<item>rcs</item>
<item>rev</item>
- <item>rm</item>
<item>scp</item>
- <item>sed</item>
<item>seq</item>
<item>setterm</item>
- <item>shred</item>
<item>size</item>
<item>size86</item>
<item>skill</item>
@@ -412,7 +412,6 @@
<item>ssh-agent</item>
<item>ssh-keygen</item>
<item>ssh-keyscan</item>
- <item>stat</item>
<item>strings</item>
<item>strip</item>
<item>sudo</item>
@@ -421,10 +420,9 @@
<item>tac</item>
<item>tail</item>
<item>tee</item>
- <item>test</item>
<item>tr</item>
+ <item>tsort</item>
<item>uniq</item>
- <item>unlink</item>
<item>unzip</item>
<item>updatedb</item>
<item>updmap</item>
@@ -432,7 +430,6 @@
<item>users</item>
<item>vmstat</item>
<item>w</item>
- <item>wc</item>
<item>wget</item>
<item>whatis</item>
<item>whereis</item>
@@ -457,544 +454,1114 @@
<contexts>
- <context attribute="Normal Text" lineEndContext="#stay" name="Start">
- <IncludeRules context="FindAll" />
+ <context attribute="Normal Text" lineEndContext="#stay" name="Start" fallthroughContext="Command">
+ <DetectSpaces attribute="Normal Text" context="#stay"/>
+ <DetectChar attribute="Comment" context="Comment" char="#"/>
+ <!-- start expression in double parentheses -->
+ <Detect2Chars attribute="Keyword" context="ExprDblParen" char="(" char1="(" beginRegion="expression"/>
+ <!-- start a subshell -->
+ <DetectChar attribute="Keyword" context="SubShell" char="(" beginRegion="subshell"/>
+ <!-- start expression in single/double brackets -->
+ <DetectChar context="MaybeBracketExpression" char="[" lookAhead="1"/>
+ <!-- start a group command or BraceExpansion with { -->
+ <DetectChar context="MaybeGroup" char="{" lookAhead="1"/>
+
+ <!-- handle ` -->
+ <DetectChar attribute="Backquote" context="CommandBackq" char="`"/>
+
+ <!-- &> and &>> redirection -->
+ <StringDetect attribute="Redirection" context="WordRedirection" String="&amp;>>"/>
+ <Detect2Chars attribute="Redirection" context="FdRedirection" char="&amp;" char1=">"/>
+
+ <!-- handle branche conditions -->
+ <Detect2Chars attribute="Control" context="#stay" char="&amp;" char1="&amp;"/>
+ <Detect2Chars attribute="Control" context="#stay" char="|" char1="|"/>
+
+ <!-- handle &, |, ; -->
+ <AnyChar attribute="Control" context="#stay" String="&amp;|;"/>
+
+ <!-- handle variable assignments -->
+ <RegExpr attribute="Variable" context="VarAssign" String="&varname;(?=\+?=|\[(?:$|[^]]))"/>
+ <!-- handle keywords -->
+ <keyword context="DispatchKeyword" String="keywords" lookAhead="1"/>
+ <!-- handle commands that have variable names as argument -->
+ <keyword attribute="Builtin" context="VarName" String="builtins_var" lookAhead="1"/>
+ <!-- mark function definitions without function keyword -->
+ <RegExpr attribute="Function" context="#stay" String="&funcname;[ &tab;]*\(\)"/>
+ <keyword attribute="Builtin" context="CommandArgs" String="builtins"/>
+ <keyword attribute="Command" context="CommandArgs" String="unixcommands"/>
+
+ <!-- handle redirection -->
+ <AnyChar context="CommandMaybeRedirection" String="&lt;&gt;0123456789" lookAhead="1"/>
+
+ <AnyChar attribute="Error" context="#stay" String=")}"/>
+
+ <LineContinue attribute="Escape" context="#stay"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="MaybeBracketExpression" fallthroughContext="#pop!Command">
+ <!-- start expression in double brackets -->
+ <RegExpr attribute="Keyword" context="#pop!ExprDblBracket" String="\[\[(?=$|[ &tab;(])" beginRegion="expression"/>
+ <!-- start expression in single brackets -->
+ <RegExpr attribute="Builtin" context="#pop!ExprBracket" String="\[&eos;" beginRegion="expression"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="MaybeGroup">
+ <!-- start a group command with { -->
+ <RegExpr attribute="Keyword" context="#pop!Group" String="\{&eos;" beginRegion="group"/>
+ <DetectChar context="#pop!Command" char="{" lookAhead="1"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="CommandMaybeRedirection" fallthroughContext="#pop!Command">
+ <IncludeRules context="FindRedirection"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="Return" fallthroughContext="#pop">
+ <DetectSpaces attribute="Normal Text" context="#stay"/>
+ <Int attribute="Decimal" context="#stay"/>
+ </context>
+ <!-- Comment consumes shell comments till EOL -->
+ <context attribute="Comment" lineEndContext="#pop" name="Comment">
+ <DetectSpaces attribute="Comment"/>
+ <IncludeRules context="##Comments"/>
+ <DetectIdentifier attribute="Comment" context="#stay"/>
</context>
-<!-- ====== The following rulessets are meant to be included ======== -->
- <!-- FindAll tries to interpret everything -->
- <context attribute="Normal Text" lineEndContext="#stay" name="FindAll">
- <IncludeRules context="FindComments" />
- <IncludeRules context="FindCommands" />
- <IncludeRules context="FindStrings" />
- <IncludeRules context="FindSubstitutions" />
- <IncludeRules context="FindOthers" />
+ <!-- Group is called after a { is encountered -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="Group" fallthroughContext="Command">
+ <DetectChar context="MaybeGroupEnd" char="}" lookAhead="1"/>
+ <IncludeRules context="Start"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="MaybeGroupEnd">
+ <!-- stop a group command with } -->
+ <RegExpr attribute="Keyword" context="#pop#pop" String="\}&eoexpr;" endRegion="group"/>
+ <DetectChar context="#pop!Command" char="}" lookAhead="1"/>
+ </context>
+
+ <context attribute="Command" lineEndContext="#pop" name="Command" fallthroughContext="#pop">
+ <DetectSpaces attribute="Normal Text" context="#pop!CommandArgs"/>
+ <DetectChar context="CommandVariables" char="$" lookAhead="1"/>
+ <IncludeRules context="FindStrings"/>
+ <DetectChar context="#pop" char="`" lookAhead="1"/>
+ <RegExpr attribute="OtherCommand" context="CommandName" String="(?:[^&wordseps;&substseps;]++|\\.)+"/>
+ <LineContinue attribute="Escape" context="#stay"/>
+ <DetectChar context="CommandMaybeBraceExpansion" char="{" lookAhead="1"/>
+ </context>
+ <context attribute="Command" lineEndContext="#pop#pop" name="CommandVariables">
+ <IncludeRules context="DispatchVariables"/>
+ <DetectChar attribute="OtherCommand" context="#pop" char="$"/>
+ </context>
+ <context attribute="Command" lineEndContext="#pop#pop" name="DispatchVariables">
+ <IncludeRules context="DispatchSubstVariables"/>
+ <IncludeRules context="DispatchStringVariables"/>
+ <IncludeRules context="DispatchVarnameVariables"/>
+ </context>
+ <context attribute="Command" lineEndContext="#pop#pop" name="DispatchSubstVariables">
+ <Detect2Chars attribute="Parameter Expansion" context="#pop!VarBraceStart" char="$" char1="{"/>
+ <StringDetect attribute="Parameter Expansion" context="#pop!ExprDblParenSubst" String="$((" beginRegion="expression"/>
+ <Detect2Chars attribute="Parameter Expansion" context="#pop!SubstCommand" char="$" char1="("/>
+ </context>
+ <context attribute="Command" lineEndContext="#pop#pop" name="DispatchStringVariables">
+ <Detect2Chars attribute="String SingleQ" context="#pop!StringEsc" char="$" char1="'"/>
+ <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-])"/>
+ </context>
+ <context attribute="OtherCommand" lineEndContext="#pop#pop" name="CommandName">
+ <DetectSpaces attribute="Normal Text" context="#pop#pop!CommandArgs"/>
+ <DetectIdentifier attribute="OtherCommand" context="#stay"/>
+ <DetectChar context="CommandVariables" char="$" lookAhead="1"/>
+ <IncludeRules context="FindStrings"/>
+ <Detect2Chars attribute="Control" context="#pop#pop" char="&amp;" char1="&amp;"/>
+ <Detect2Chars attribute="Control" context="#pop#pop" char="|" char1="|"/>
+ <DetectChar attribute="Control" context="#pop#pop" char="|"/>
+ <AnyChar context="#pop#pop" String=";)`" lookAhead="1"/>
+ <AnyChar context="#pop#pop!CommandArgs" String="&amp;&lt;>" lookAhead="1"/>
+ <!-- start expression in double parentheses -->
+ <Detect2Chars attribute="Error" context="#pop#pop!ExprDblParen" char="(" char1="(" beginRegion="expression"/>
+ <!-- start a subshell -->
+ <DetectChar attribute="Error" context="#pop#pop!SubShell" char="(" beginRegion="subshell"/>
+ <LineContinue attribute="Escape" context="#stay"/>
+ <DetectChar context="#pop!CommandMaybeBraceExpansion" char="{" lookAhead="1"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="CommandMaybeBraceExpansion">
+ <IncludeRules context="DispatchBraceExpansion"/>
+ <DetectChar attribute="OtherCommand" context="#pop" char="{"/>
</context>
- <!-- FindMost tries to interpret anything except commands -->
- <context attribute="Normal Text" lineEndContext="#stay" name="FindMost">
- <IncludeRules context="FindComments" />
- <IncludeRules context="FindMostWithoutComments" />
+ <context attribute="Normal Text" lineEndContext="#stay" name="CommandBackq" fallthroughContext="Command">
+ <DetectChar attribute="Backquote" context="#pop!CommandArgs" char="`"/>
+ <DetectChar attribute="Comment" context="CommentBackq" char="#"/>
+ <IncludeRules context="Start"/>
</context>
- <context attribute="Normal Text" lineEndContext="#stay" name="FindMostWithoutComments">
- <IncludeRules context="FindStrings" />
- <IncludeRules context="FindSubstitutions" />
- <IncludeRules context="FindOthers" />
+ <!-- CommentBackq consumes shell comments till EOL or a backquote -->
+ <context attribute="Comment" lineEndContext="#pop" name="CommentBackq">
+ <DetectChar context="#pop" char="`" lookAhead="1"/>
+ <IncludeRules context="Comment"/>
</context>
+ <!-- CommandArgs matches the items after a command -->
+ <context attribute="Normal Text" lineEndContext="#pop" name="CommandArgs" fallthroughContext="CommandArg">
+ <DetectSpaces attribute="Normal Text" context="#stay"/>
+
+ <!-- &> and &>> redirection -->
+ <StringDetect attribute="Redirection" context="WordRedirection" String="&amp;>>"/>
+ <Detect2Chars attribute="Redirection" context="FdRedirection" char="&amp;" char1=">"/>
+
+ <!-- handle &, |, ;, ` -->
+ <AnyChar context="#pop" String="&amp;|;`" lookAhead="1"/>
+
+ <!-- handle redirection -->
+ <AnyChar context="CommandArgMaybeRedirection" String="&lt;&gt;0123456789" lookAhead="1"/>
- <!-- FindComments consumes shell comments till EOL -->
- <context attribute="Normal Text" lineEndContext="#pop" name="FindComments">
- <DetectChar attribute="Comment" context="Comment" char="#" firstNonSpace="true"/>
- <RegExpr attribute="Comment" context="Comment" String="(?&lt;=&charbeforecomment;)#" />
+ <DetectChar context="#pop" char=")" lookAhead="1"/>
+ <DetectChar attribute="Error" context="#pop!SubShell" char="("/>
</context>
- <context attribute="Normal Text" lineEndContext="#pop" name="FindCommentsInCommand">
- <DetectChar attribute="Comment" context="Comment" char="#" firstNonSpace="true"/>
- <!-- NOTE: If a rule already matches a character of &charbeforecomment;
- (for example, in an escaped character), the comment will not be highlighted. -->
- <RegExpr attribute="Normal Text" context="Comment" String="&charbeforecomment;(?=#)" />
+ <context attribute="Normal Text" lineEndContext="#pop#pop" name="CommandArg" fallthroughContext="#pop!NormalOption">
+ <!-- In command arguments, do not allow comments after escaped characters.
+ This avoids highlighting comments within paths or other text. Ex: pathtext\ #no\ comment -->
+ <DetectChar context="#pop#pop" char="#" lookAhead="1"/>
+ <Detect2Chars attribute="Option" context="#pop!LongOption" char="-" char1="-"/>
+ <DetectChar attribute="Option" context="#pop!ShortOption" char="-"/>
</context>
- <context attribute="Comment" lineEndContext="#pop" name="Comment">
- <IncludeRules context="##Alerts" />
- <IncludeRules context="##Modelines" />
+ <context attribute="Normal Text" lineEndContext="#pop" name="CommandArgMaybeRedirection" fallthroughContext="#pop!NormalOption">
+ <IncludeRules context="FindRedirection"/>
</context>
- <!-- FindCommentsParen consumes shell comments till EOL or a closing parenthese -->
- <context attribute="Normal Text" lineEndContext="#pop" name="FindCommentsParen">
- <DetectChar attribute="Comment" context="CommentParen" char="#" firstNonSpace="true"/>
- <RegExpr attribute="Normal Text" context="CommentParen" String="&charbeforecomment;(?=#)" />
+ <context attribute="Option" lineEndContext="#pop" name="ShortOption" fallthroughContext="#pop">
+ <DetectChar attribute="Path" context="PathThenPop" char="/"/>
+ <IncludeRules context="LongOption"/>
+ </context>
+ <context attribute="Option" lineEndContext="#pop" name="LongOption" fallthroughContext="#pop">
+ <AnyChar context="#pop" String="&wordseps;`" lookAhead="1"/>
+ <DetectChar attribute="Operator" context="#pop!NormalOption" char="="/>
+ <IncludeRules context="FindWord"/>
+ <IncludeRules context="FindGlobAndPop"/>
+ <DetectChar context="OptionMaybeBraceExpansion" char="{" lookAhead="1"/>
+ <RegExpr attribute="Option" context="#stay" String="&opt;"/>
+ </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"/>
</context>
- <context attribute="Comment" lineEndContext="#pop" name="CommentParen">
- <RegExpr attribute="Comment" context="#pop" String="[^)](?=\))" />
- <IncludeRules context="##Alerts" />
+ <context attribute="Normal Text" lineEndContext="#stay" name="FindNormalTextOption">
+ <RegExpr attribute="Normal Text" context="#stay" String="[^&wordseps;&substseps;]+"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="OptionMaybeBraceExpansion">
+ <IncludeRules context="DispatchBraceExpansion"/>
+ <DetectChar attribute="Option" context="#pop" char="{"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="NormalMaybeBraceExpansion">
+ <IncludeRules context="DispatchBraceExpansion"/>
+ <DetectChar attribute="Normal Text" context="#pop" char="{"/>
</context>
- <!-- FindCommentsBackq consumes shell comments till EOL or a backquote -->
- <context attribute="Normal Text" lineEndContext="#pop" name="FindCommentsBackq">
- <DetectChar attribute="Comment" context="CommentBackq" char="#" firstNonSpace="true"/>
- <RegExpr attribute="Normal Text" context="CommentBackq" String="&charbeforecomment;(?=#)" />
+ <context attribute="Normal Text" lineEndContext="#pop" name="AssumeEscape">
+ <LineContinue attribute="Escape" context="#pop"/>
+ <RegExpr attribute="Escape" context="#pop" String="\\."/>
</context>
- <context attribute="Comment" lineEndContext="#pop" name="CommentBackq">
- <RegExpr attribute="Comment" context="#pop" String="[^`](?=`)" />
- <IncludeRules context="##Alerts" />
+
+<!-- ====== The following rulessets are meant to be included ======== -->
+
+ <!-- FindRedirection consumes shell redirection -->
+ <context attribute="Normal Text" lineEndContext="#pop" name="FindRedirection">
+ <RegExpr attribute="File Descriptor" context="#pop!AssumeRedirection" String="[0-9]++(?=[&lt;>])"/>
+ <IncludeRules context="AssumeRedirection"/>
</context>
+ <!-- DispatchBraceExpansion consumes brace expansions -->
+ <context attribute="Normal Text" lineEndContext="#pop" name="DispatchBraceExpansion">
+ <!-- Only highlighting closed braces. The "BraceExpansion" context corrects
+ the closure of braces and allows recursive braces (bug #387915). -->
+ <RegExpr context="#pop!BraceExpansion" String="&braceexpansion;" lookAhead="1"/>
+ <RegExpr attribute="Escape" context="#pop!SequenceExpression" String="{(?=([-+]?[0-9]+\.\.[-+]?[0-9]+|[a-zA-Z]\.\.[a-zA-Z])(\.\.[-+]?[0-9]+)?\})"/>
+ </context>
- <!-- FindCommands matches many items that can be expected outside strings, substitutions etc. -->
- <context attribute="Normal Text" lineEndContext="#stay" name="FindCommands">
- <IncludeRules context="FindSpecialCommands" />
- <IncludeRules context="FindNormalCommands" />
+ <!-- FindPathThenPop consumes path -->
+ <context attribute="Normal Text" lineEndContext="#pop" name="FindPathThenPop">
+ <IncludeRules context="FindGlobAndPop"/>
+ <RegExpr attribute="Path" context="PathThenPop" String="&pathpart;"/>
</context>
- <context attribute="Normal Text" lineEndContext="#stay" name="FindSpecialCommands">
- <!-- start expression in double parentheses -->
- <Detect2Chars attribute="Keyword" context="ExprDblParen" char="(" char1="(" beginRegion="expression" />
- <!-- start expression in double brackets -->
- <RegExpr attribute="Keyword" context="ExprDblBracket" String="\[\[&eos;" beginRegion="expression" column="0"/>
- <RegExpr attribute="Keyword" context="ExprDblBracket" String="\s\[\[&eos;" beginRegion="expression" />
- <!-- start expression in single brackets -->
- <RegExpr attribute="Builtin" context="ExprBracket" String="\[&eos;" beginRegion="expression" column="0"/>
- <RegExpr attribute="Builtin" context="ExprBracket" String="\s\[&eos;" beginRegion="expression" />
- <!-- start a group command with { -->
- <RegExpr attribute="Keyword" context="Group" String="\{&eos;" beginRegion="group" />
- <!-- start a subshell -->
- <DetectChar attribute="Keyword" context="SubShell" char="(" beginRegion="subshell" />
+ <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="("/>
+ <Detect2Chars attribute="Glob" context="ExtGlobAndPop" char="+" char1="("/>
+ <Detect2Chars attribute="Glob" context="ExtGlobAndPop" char="@" char1="("/>
+ <Detect2Chars attribute="Glob" context="ExtGlobAndPop" char="!" char1="("/>
+ </context>
+ <context attribute="Path" lineEndContext="#stay" name="ExtGlobAndPop">
+ <DetectChar attribute="Glob" context="#pop!PathThenPop" char=")"/>
+ <IncludeRules context="IncExtGlob"/>
+ </context>
+ <context attribute="Path" lineEndContext="#stay" name="RecursiveExtGlob">
+ <DetectChar attribute="Glob" context="#pop" char=")"/>
+ <IncludeRules context="IncExtGlob"/>
+ </context>
+ <context attribute="Path" lineEndContext="#stay" name="IncExtGlob">
+ <Detect2Chars attribute="Glob" context="RecursiveExtGlob" char="?" char1="("/>
+ <Detect2Chars attribute="Glob" context="RecursiveExtGlob" char="*" char1="("/>
+ <Detect2Chars attribute="Glob" context="RecursiveExtGlob" char="+" char1="("/>
+ <Detect2Chars attribute="Glob" context="RecursiveExtGlob" char="@" char1="("/>
+ <Detect2Chars attribute="Glob" context="RecursiveExtGlob" char="!" char1="("/>
+ <AnyChar attribute="Glob" context="#stay" String="|?*"/>
+ <IncludeRules context="FindWord"/>
+ <DetectChar context="PathMaybeBraceExpansion" char="{" lookAhead="1"/>
+ </context>
+ <context attribute="Path" lineEndContext="#pop#pop" name="PathThenPop">
+ <AnyChar context="#pop#pop" String="&wordseps;`" lookAhead="1"/>
+ <IncludeRules context="FindWord"/>
+ <IncludeRules context="FindExtGlobAndPop"/>
+ <AnyChar attribute="Glob" context="#stay" String="?*"/>
+ <DetectChar context="PathMaybeBraceExpansion" char="{" lookAhead="1"/>
+ <RegExpr attribute="Path" context="#stay" String="&path;"/>
+ </context>
+ <context attribute="Path" lineEndContext="#pop" name="PathMaybeBraceExpansion" fallthroughContext="#pop">
+ <IncludeRules context="DispatchBraceExpansion"/>
+ <DetectChar attribute="Path" context="#pop" char="{"/>
+ </context>
+
+ <context attribute="Pattern" lineEndContext="#stay" name="FindPattern">
+ <Detect2Chars attribute="Glob" context="ExtPattern" char="?" char1="("/>
+ <Detect2Chars attribute="Glob" context="ExtPattern" char="*" char1="("/>
+ <Detect2Chars attribute="Glob" context="ExtPattern" char="+" char1="("/>
+ <Detect2Chars attribute="Glob" context="ExtPattern" char="@" char1="("/>
+ <Detect2Chars attribute="Glob" context="ExtPattern" char="!" char1="("/>
+ <AnyChar attribute="Glob" context="#stay" String="?*"/>
+ </context>
+ <context attribute="Pattern" lineEndContext="#stay" name="ExtPattern">
+ <DetectChar attribute="Glob" context="#stay" char="|"/>
+ <IncludeRules context="FindWord"/>
+ <DetectChar attribute="Glob" context="#pop" char=")"/>
+ <IncludeRules context="FindPattern"/>
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#pop" name="VarAssign" fallthroughContext="#pop">
+ <DetectChar attribute="Parameter Expansion Operator" context="Subscript" char="["/>
+ <DetectChar attribute="Operator" context="#pop!Assign" char="="/>
+ <Detect2Chars attribute="Operator" context="#pop!Assign" char="+" char1="="/>
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#pop" name="DispatchKeyword">
<!-- match do and if blocks -->
- <RegExpr attribute="Keyword" context="#stay" String="\bdo&noword;" beginRegion="do" />
- <RegExpr attribute="Keyword" context="#stay" String="\bdone&noword;" endRegion="do" />
- <RegExpr attribute="Keyword" context="#stay" String="\bif&eos;" beginRegion="if" />
- <RegExpr attribute="Keyword" context="#stay" String="\bfi&noword;" endRegion="if" />
+ <Detect2Chars attribute="Control Flow" context="#pop!NotCond" char="i" char1="f" beginRegion="if"/>
+ <Detect2Chars attribute="Control Flow" context="#pop" char="f" char1="i" endRegion="if"/>
+ <StringDetect attribute="Control Flow" context="#pop" String="done" endRegion="do"/>
+ <Detect2Chars attribute="Control Flow" context="#pop" char="d" char1="o" beginRegion="do"/>
+ <!-- handle while/until as a special case -->
+ <StringDetect attribute="Control Flow" context="#pop!NotCond" String="while"/>
+ <StringDetect attribute="Control Flow" context="#pop!NotCond" String="until"/>
+ <!-- handle for as a special case -->
+ <StringDetect attribute="Control Flow" context="#pop!For" String="for"/>
+ <!-- handle select as a special case -->
+ <StringDetect attribute="Control Flow" context="#pop!For" String="select"/>
<!-- handle case as a special case -->
- <RegExpr attribute="Keyword" context="Case" String="\bcase&noword;" beginRegion="case" />
- <!-- handle variable assignments -->
- <RegExpr attribute="Variable" context="Assign" String="\b&varname;\+?=" />
- <RegExpr attribute="Variable" context="AssignSubscr" String="\b&varname;(?=\[.+\]\+?=)" />
+ <StringDetect attribute="Control Flow" context="#pop!Case" String="case" beginRegion="case"/>
<!-- handle functions with function keyword before keywords -->
- <StringDetect attribute="Function" context="#stay" String=":()" />
- <WordDetect attribute="Keyword" context="FunctionDef" String="function" />
- <!-- mark function definitions without function keyword -->
- <RegExpr attribute="Function" context="#stay" String="&funcname;\s*\(\)" />
+ <StringDetect attribute="Keyword" context="#pop!FunctionDef" String="function"/>
+ <StringDetect attribute="Control Flow" context="#pop!Return" String="return"/>
+ <!-- not a keyword in this context -->
+ <Detect2Chars attribute="Error" context="#pop" char="i" char1="n"/>
+ <StringDetect attribute="Error" context="#pop" String="esac"/>
<!-- handle keywords -->
- <keyword attribute="Keyword" context="#stay" String="keywords" />
- <RegExpr attribute="Builtin" context="#stay" String="\.(?=\s)" />
- <!-- handle commands that have variable names as argument -->
- <keyword attribute="Builtin" context="VarName" String="builtins_var" />
- <!-- handle here-string -->
- <RegExpr attribute="Redirection" context="#stay" String="\d*&lt;&lt;&lt;" />
- <!-- handle here document -->
- <Detect2Chars attribute="Redirection" context="HereDoc" char="&lt;" char1="&lt;" lookAhead="true" />
- <!-- handle process subst -->
- <Detect2Chars attribute="Redirection" context="ProcessSubst" char="&lt;" char1="(" />
- <Detect2Chars attribute="Redirection" context="ProcessSubst" char="&gt;" char1="(" />
- <!-- handle redirection -->
- <RegExpr attribute="Redirection" context="#stay" String="([0-9]*(&gt;{1,2}|&lt;)(&amp;[0-9]+-?)?|&amp;&gt;|&gt;&amp;|[0-9]*&lt;&gt;)" />
- <!-- handle &, &&, | and || -->
- <RegExpr attribute="Control" context="#stay" String="([|&amp;])\1?" />
+ <DetectIdentifier attribute="Control Flow" context="#pop"/>
+ </context>
+
+ <!-- if ! ..., while ! ... and until ! ... -->
+ <context attribute="Normal Text" lineEndContext="#pop" name="NotCond" fallthroughContext="#pop">
+ <DetectSpaces attribute="Normal Text" context="#pop!NotCond2"/>
</context>
- <context attribute="Normal Text" lineEndContext="#stay" name="FindNormalCommands">
- <keyword attribute="Builtin" context="CommandArgs" String="builtins" />
- <keyword attribute="Command" context="CommandArgs" String="unixcommands" />
- <RegExpr attribute="OtherCommand" context="#stay" String="&pathpart;*(?=/)" />
- <RegExpr attribute="OtherCommand" context="#stay" String="~\w*" />
- <RegExpr attribute="OtherCommand" context="#stay" String="/&pathpart;*(?=([/);$`'&quot;]|$))" />
- <RegExpr attribute="OtherCommand" context="CommandArgs" String="/&pathpart;*(?=([\s);$`'&quot;]|$))" />
- <!-- This list is not complete. ie, ":" is missing but as it is in bash completition. -->
- <RegExpr attribute="OtherCommand" context="CommandArgsNormal" String="&pathpart;*" />
+ <context attribute="Normal Text" lineEndContext="#pop" name="NotCond2" fallthroughContext="#pop">
+ <Detect2Chars attribute="Expression" context="#pop" char="!" char1="&tab;"/>
+ <Detect2Chars attribute="Expression" context="#pop" char="!" char1=" "/>
+ <LineContinue attribute="Expression" context="#pop" char="!"/>
</context>
- <!-- CommandArgs matches the items after a command -->
- <context attribute="Normal Text" lineEndContext="#pop" name="CommandArgs">
- <!-- In command arguments, do not allow comments after escaped characters.
- This avoids highlighting comments within paths or other text. Ex: pathtext\ #no\ comment -->
- <!-- FindComments -->
- <RegExpr attribute="Control" context="#pop!Comment" String=";;?(?=#)" />
- <IncludeRules context="FindCommentsInCommand" />
- <IncludeRules context="FindMostWithoutComments" />
- <IncludeRules context="DefaultCommandArgs" />
+ <context attribute="Normal Text" lineEndContext="#pop" name="For" fallthroughContext="#pop">
+ <LineContinue attribute="Escape" context="#stay"/>
+ <DetectSpaces attribute="Normal Text" context="#stay"/>
+ <DetectIdentifier attribute="Normal Text" context="#pop!ForIn"/>
+ <Detect2Chars attribute="Keyword" context="#pop!ForArithmeticExpr" char="(" char1="("/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="ForIn" fallthroughContext="#pop">
+ <DetectSpaces attribute="Normal Text" context="#stay"/>
+ <DetectChar attribute="Control" context="#pop" char=";"/>
+ <WordDetect attribute="Keyword" context="#pop!CommandArgs" String="in"/>
</context>
- <!-- CommandArgs but with normal comments -->
- <context attribute="Normal Text" lineEndContext="#pop" name="CommandArgsNormal">
- <IncludeRules context="FindMost" />
- <IncludeRules context="DefaultCommandArgs" />
+ <context attribute="Normal Text" lineEndContext="#pop" name="ForArithmeticExpr">
+ <DetectSpaces attribute="Normal Text" context="#stay"/>
+ <DetectChar attribute="Control" context="#stay" char=";"/>
+ <Detect2Chars attribute="Keyword" context="#pop" char=")" char1=")"/>
+ <IncludeRules context="FindExprDblParen"/>
</context>
- <context attribute="Normal Text" lineEndContext="#pop" name="DefaultCommandArgs">
- <LineContinue />
- <RegExpr attribute="Keyword" context="#stay" String="\\$" />
- <!-- handle keywords -->
- <RegExpr attribute="Option" context="#stay" String="\.(?=\s)" />
- <!-- handle here-string -->
- <RegExpr attribute="Redirection" context="#stay" String="\d*&lt;&lt;&lt;" />
+ <context attribute="Normal Text" lineEndContext="#pop" name="AssumeRedirection">
+ <!-- handle output redirection -->
+ <Detect2Chars attribute="Redirection" context="#pop!WordRedirection" char=">" char1=">"/>
+ <Detect2Chars attribute="Redirection" context="#pop!WordRedirection" char=">" char1="|"/>
+ <Detect2Chars attribute="Redirection" context="#pop!FdRedirection" char=">" char1="&amp;"/>
+ <Detect2Chars attribute="Redirection" context="#pop!ProcessSubst" char=">" char1="("/>
+ <DetectChar attribute="Redirection" context="#pop!WordRedirection" char=">"/>
+ <StringDetect attribute="Redirection" context="#pop!StringRedirection" String="&lt;&lt;&lt;"/>
<!-- handle here document -->
- <Detect2Chars attribute="Redirection" context="HereDoc" char="&lt;" char1="&lt;" lookAhead="true" />
- <!-- handle process subst -->
- <Detect2Chars attribute="Redirection" context="ProcessSubst" char="&lt;" char1="(" />
- <Detect2Chars attribute="Redirection" context="ProcessSubst" char="&gt;" char1="(" />
- <!-- handle redirection -->
- <RegExpr attribute="Redirection" context="#stay" String="([0-9]*(&gt;{1,2}|&lt;)(&amp;[0-9]+-?)?|&amp;&gt;|&gt;&amp;|[0-9]*&lt;&gt;)" />
- <!-- handle &, &&, |, ||, ; and ;; -->
- <RegExpr attribute="Control" context="#pop" String="([|&amp;;])\1?" />
- <RegExpr attribute="Normal Text" context="#stay" String="[a-zA-Z_]+-[A-Za-z0-9_-]*" />
- <RegExpr attribute="Option" context="#stay" String="-?-[a-zA-Z_][A-Za-z0-9_-]*" />
- <keyword attribute="Option" context="#stay" String="keywords" />
- <AnyChar String=")}" context="#pop" lookAhead="true"/>
- </context>
-
- <!-- FindCommands matches many items that can be expected outside strings, substitutions etc, when inside a Backquote -->
- <context attribute="Normal Text" lineEndContext="#stay" name="FindCommandsBackq">
- <IncludeRules context="FindSpecialCommands" />
- <IncludeRules context="FindNormalCommandsBackq" />
- </context>
- <context attribute="Normal Text" lineEndContext="#stay" name="FindNormalCommandsBackq">
- <keyword attribute="Builtin" context="CommandArgsBackq" String="builtins" />
- <keyword attribute="Command" context="CommandArgsBackq" String="unixcommands" />
- <RegExpr attribute="OtherCommand" context="#stay" String="&pathpart;*(?=/)" />
- <RegExpr attribute="OtherCommand" context="#stay" String="~\w*" />
- <RegExpr attribute="OtherCommand" context="#stay" String="/&pathpart;*(?=([/);$`'&quot;]|$))" />
- <RegExpr attribute="OtherCommand" context="CommandArgsBackq" String="/&pathpart;*(?=([\s);$`'&quot;]|$))" />
- <RegExpr attribute="OtherCommand" context="CommandArgsBackq" String="&pathpart;*" />
- </context>
- <context attribute="Normal Text" lineEndContext="#pop" name="CommandArgsBackq">
- <LineContinue />
- <DetectChar attribute="Keyword" context="#pop" char="`" lookAhead="true"/>
- <IncludeRules context="CommandArgs" />
- </context>
-
- <!-- FindOthers contains various rules to mark different shell input -->
- <context attribute="Normal Text" lineEndContext="#stay" name="FindOthers">
- <IncludeRules context="Escapes" />
- <RegExpr attribute="Keyword" context="#stay" String="\\$" />
- <!-- Only highlighting closed braces. The "BraceExpansion" context corrects
- the closure of braces and allows recursive braces (bug #387915). -->
- <RegExpr attribute="Escape" context="BraceExpansion" String="\{(?=(\\[ \{\}]|[^\s\{\}]|\{(\\[ ]|\S)*\})+\})" />
- <RegExpr attribute="Path" context="#stay" String="&pathpart;*(?=/)" />
- <RegExpr attribute="Path" context="#stay" String="~\w*" />
- <RegExpr attribute="Path" context="#stay" String="/&pathpart;*(?=([\s/):;$`'&quot;]|$))" />
- <!-- TODO: shell globs beside * and ? (in Path's) -->
+ <Detect2Chars context="#pop!HereDoc" char="&lt;" char1="&lt;" lookAhead="1"/>
+ <!-- handle input redirection -->
+ <Detect2Chars attribute="Redirection" context="#pop!FdRedirection" char="&lt;" char1="&amp;"/>
+ <Detect2Chars attribute="Redirection" context="#pop!WordRedirection" char="&lt;" char1=">"/>
+ <Detect2Chars attribute="Redirection" context="#pop!ProcessSubst" char="&lt;" char1="("/>
+ <DetectChar attribute="Redirection" context="#pop!WordRedirection" char="&lt;"/>
</context>
- <context attribute="Normal Text" lineEndContext="#stay" name="Escapes">
- <RegExpr attribute="Escape" context="#stay" String="\\[][;\\$`{}()|&amp;&lt;&gt;* ]" />
+ <context attribute="Normal Text" lineEndContext="#pop" name="FdRedirection" fallthroughContext="#pop!FdRedirection2">
+ <DetectSpaces attribute="Normal Text" context="#pop!FdRedirection2"/>
</context>
- <context attribute="Escape" lineEndContext="#pop" name="BraceExpansion">
- <DetectSpaces context="#pop" lookAhead="true" />
- <DetectChar attribute="Escape" context="#pop" char="}" />
- <DetectChar attribute="Escape" context="BraceExpansion" char="{" />
- <RegExpr attribute="Error" context="#stay" String="[^\s\{\}\\](?=\s|$)" />
- <IncludeRules context="Escapes" />
- <IncludeRules context="FindSubstitutions" />
- </context>
-
- <!-- FindStrings looks for single and double quoted strings, also with $-prefix -->
- <context attribute="Normal Text" lineEndContext="#stay" name="FindStrings">
- <Detect2Chars attribute="Escape" context="#stay" char="\" char1="'" />
- <Detect2Chars attribute="Escape" context="#stay" char="\" char1="&quot;" />
- <DetectChar attribute="String SingleQ" context="StringSQ" char="'" />
- <DetectChar attribute="String DoubleQ" context="StringDQ" char="&quot;" />
- <Detect2Chars attribute="String SingleQ" context="StringEsc" char="$" char1="'" />
- <Detect2Chars attribute="String Transl." context="StringDQ" char="$" char1="&quot;" />
- </context>
-
- <!-- FindSubstitutions goes after anything starting with $ and ` and their escapes -->
- <context attribute="Normal Text" lineEndContext="#stay" name="FindSubstitutions">
- <RegExpr attribute="Variable" context="Subscript" String="\$&varname;\[" />
- <RegExpr attribute="Variable" context="#stay" String="\$&varname;" />
- <RegExpr attribute="Variable" context="#stay" String="\$[*@#?$!_0-9-]" />
- <RegExpr attribute="Variable" context="#stay" String="\$\{[*@#?$!_0-9-]\}" />
- <RegExpr attribute="Variable" context="#stay" String="\$\{#&varname;(\[[*@]\])?\}" />
- <RegExpr attribute="Variable" context="#stay" String="\$\{!&varname;(\[[*@]\]|[*@])?\}" />
- <RegExpr attribute="Variable" context="#stay" String="\$\{#[0-9]+\}" />
- <RegExpr attribute="Variable" context="VarBrace" String="\$\{&varname;" />
- <RegExpr attribute="Variable" context="VarBrace" String="\$\{[*@#?$!_0-9-](?=[:#%/=?+-])" />
- <StringDetect attribute="Variable" context="ExprDblParenSubst" String="$((" beginRegion="expression" />
- <StringDetect attribute="Redirection" context="SubstFile" String="$(&lt;" />
- <Detect2Chars attribute="Variable" context="SubstCommand" char="$" char1="(" />
- <DetectChar attribute="Backquote" context="SubstBackq" char="`" />
- <RegExpr attribute="Escape" context="#stay" String="\\[`$\\]" />
- </context>
-
- <!-- FindTests finds operators valid in tests -->
- <context attribute="Normal Text" lineEndContext="#stay" name="FindTests">
- <RegExpr attribute="Expression" context="#stay" String="-[abcdefghkprstuwxOGLSNozn](?=\s)"/>
- <RegExpr attribute="Expression" context="#stay" String="-([no]t|ef)(?=\s)"/>
- <RegExpr attribute="Expression" context="#stay" String="([!=]=?|[&gt;&lt;])(?=\s)"/>
- <RegExpr attribute="Expression" context="#stay" String="-(eq|ne|[gl][te])(?=\s)"/>
+ <context attribute="Normal Text" lineEndContext="#pop" name="FdRedirection2" fallthroughContext="#pop!WordRedirection2">
+ <RegExpr attribute="File Descriptor" context="#pop!CloseFile" String="[0-9]+(?=-?&eoexpr;)"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="WordRedirection" fallthroughContext="#pop!WordRedirection2">
+ <DetectSpaces attribute="Normal Text" context="#pop!WordRedirection2"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="WordRedirection2" fallthroughContext="#pop">
+ <AnyChar context="#pop" String="&wordseps;`" lookAhead="1"/>
+ <IncludeRules context="FindWord"/>
+ <RegExpr attribute="Path" context="PathThenPop" String="&path;"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="StringRedirection" fallthroughContext="#pop!StringRedirection2">
+ <DetectSpaces attribute="Normal Text" context="#pop!StringRedirection2"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="StringRedirection2">
+ <AnyChar context="#pop" String="&wordseps;`" lookAhead="1"/>
+ <IncludeRules context="FindWord"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="CloseFile" fallthroughContext="#pop">
+ <DetectChar attribute="Keyword" context="#pop" char="-"/>
</context>
+ <!-- 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="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;]*$)"/>
+ <RegExpr attribute="Redirection" context="HereDocNQ" String="&lt;&lt;[ &tab;]*([^&wordseps;]+)(?=[ &tab;]*$)"/>
-<!-- ====== These are the contexts that can be branched to ======= -->
+ <RegExpr context="HereDocIQCmd" String="(&lt;&lt;-[ &tab;]*&heredocq;)" lookAhead="1"/>
+ <RegExpr context="HereDocINQCmd" String="(&lt;&lt;-[ &tab;]*([^&wordseps;]+))" lookAhead="1"/>
+ <RegExpr context="HereDocQCmd" String="(&lt;&lt;[ &tab;]*&heredocq;)" lookAhead="1"/>
+ <RegExpr context="HereDocNQCmd" String="(&lt;&lt;[ &tab;]*([^&wordseps;]+))" lookAhead="1"/>
- <!-- ExprDblParen consumes an expression started in command mode till )) -->
- <context attribute="Normal Text" lineEndContext="#stay" name="ExprDblParen">
- <Detect2Chars attribute="Keyword" context="#pop" char=")" char1=")" endRegion="expression" />
- <DetectChar attribute="Normal Text" context="ExprSubParen" char="(" />
- <IncludeRules context="FindMost" />
+ <Detect2Chars attribute="Redirection" context="#pop" char="&lt;" char1="&lt;"/><!-- always met -->
</context>
- <!-- ExprDblParenSubst like ExprDblParen but matches )) as Variable -->
- <context attribute="Normal Text" lineEndContext="#stay" name="ExprDblParenSubst">
- <Detect2Chars attribute="Variable" context="#pop" char=")" char1=")" endRegion="expression" />
- <DetectChar attribute="Normal Text" context="ExprSubParen" char="(" />
- <IncludeRules context="FindMost" />
+ <context attribute="Normal Text" lineEndContext="#pop" name="HereDocRemainder" fallthroughContext="Command">
+ <IncludeRules context="Start"/>
</context>
- <!-- ExprSubParen consumes an expression till ) -->
- <context attribute="Normal Text" lineEndContext="#stay" name="ExprSubParen">
- <DetectChar attribute="Normal Text" context="#pop" char=")" />
- <DetectChar attribute="Normal Text" context="ExprSubParen" char="(" />
- <IncludeRules context="FindMost" />
+ <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>
- <!-- ExprBracket consumes an expression till ] -->
- <context attribute="Normal Text" lineEndContext="#stay" name="ExprBracket">
- <RegExpr attribute="Builtin" context="#pop" String="\s\](?=($|[\s;|&amp;]))" endRegion="expression" />
- <RegExpr attribute="Builtin" context="#pop" String="\](?=($|[\s;|&amp;]))" endRegion="expression" column="0"/>
- <DetectChar attribute="Normal Text" context="ExprSubParen" char="(" />
- <IncludeRules context="FindTests" />
- <IncludeRules context="FindMost" />
+ <context attribute="Here Doc" lineEndContext="#stay" name="HereDocNQ" dynamic="true" fallthroughContext="HereDocSubstitutions">
+ <RegExpr attribute="Redirection" context="#pop#pop" String="^%1$" dynamic="true" column="0"/>
</context>
- <!-- ExprDblBracket consumes an expression till ]] -->
- <context attribute="Normal Text" lineEndContext="#stay" name="ExprDblBracket">
- <RegExpr attribute="Keyword" context="#pop" String="\s\]\](?=($|[\s;|&amp;]))" endRegion="expression" />
- <RegExpr attribute="Keyword" context="#pop" String="\]\](?=($|[\s;|&amp;]))" endRegion="expression" column="0"/>
- <DetectChar attribute="Normal Text" context="ExprSubParen" char="(" />
- <IncludeRules context="FindTests" />
- <IncludeRules context="FindMost" />
+ <context attribute="Here Doc" lineEndContext="#stay" name="HereDocIQ" dynamic="true" fallthroughContext="HereDocText">
+ <RegExpr attribute="Redirection" context="#pop#pop" String="^\t*%1$" dynamic="true" column="0"/>
</context>
- <!-- Group consumes shell input till } -->
- <context attribute="Normal Text" lineEndContext="#stay" name="Group">
- <DetectChar attribute="Keyword" context="#pop" char="}" endRegion="group" />
- <IncludeRules context="FindAll" />
+ <context attribute="Here Doc" lineEndContext="#stay" name="HereDocINQ" dynamic="true" fallthroughContext="HereDocSubstitutions">
+ <RegExpr attribute="Redirection" context="#pop#pop" String="^\t*%1$" dynamic="true" column="0"/>
</context>
- <!-- SubShell consumes shell input till ) -->
- <context attribute="Normal Text" lineEndContext="#stay" name="SubShell">
- <DetectChar attribute="Keyword" context="#pop" char=")" endRegion="subshell" />
- <IncludeRules context="FindAll" />
+ <context attribute="Here Doc" lineEndContext="#stay" name="HereDocQCmd" dynamic="true" fallthroughContext="HereDocText">
+ <StringDetect attribute="Redirection" context="HereDocRemainder" String="%1" dynamic="true"/>
+ <RegExpr attribute="Redirection" context="#pop#pop" String="^%2$" dynamic="true" column="0"/>
</context>
- <!-- Assign consumes an expression till EOL or whitespace -->
- <context attribute="Normal Text" lineEndContext="#pop" name="Assign" fallthrough="true" fallthroughContext="#pop">
- <DetectChar attribute="Variable" context="AssignArray" char="(" />
- <IncludeRules context="FindStrings" />
- <IncludeRules context="FindSubstitutions" />
- <IncludeRules context="FindOthers" />
- <RegExpr attribute="Normal Text" context="#stay" String="[\w:,+_./-]" />
+ <context attribute="Here Doc" lineEndContext="#stay" name="HereDocNQCmd" dynamic="true" fallthroughContext="HereDocSubstitutions">
+ <StringDetect attribute="Redirection" context="HereDocRemainder" String="%1" dynamic="true"/>
+ <RegExpr attribute="Redirection" context="#pop#pop" String="^%2$" dynamic="true" column="0"/>
</context>
- <!-- AssignArray consumes everything till ), marking assignments -->
- <context attribute="Normal Text" lineEndContext="#pop" name="AssignArray">
- <DetectChar attribute="Variable" context="#pop" char=")" />
- <DetectChar attribute="Variable" context="Subscript" char="[" />
- <DetectChar attribute="Variable" context="Assign" char="=" />
- <IncludeRules context="FindMost" />
+ <context attribute="Here Doc" lineEndContext="#stay" name="HereDocIQCmd" dynamic="true" fallthroughContext="HereDocText">
+ <StringDetect attribute="Redirection" context="HereDocRemainder" String="%1" dynamic="true"/>
+ <RegExpr attribute="Redirection" context="#pop#pop" String="^\t*%2$" dynamic="true" column="0"/>
</context>
- <!-- AssignSubscr first expects a [ then parses subscript and continues with '=value' -->
- <context attribute="Normal Text" lineEndContext="#pop" name="AssignSubscr" fallthrough="true" fallthroughContext="#pop">
- <DetectChar attribute="Variable" context="Subscript" char="[" />
- <Detect2Chars attribute="Variable" context="Assign" char="+" char1="=" />
- <DetectChar attribute="Variable" context="Assign" char="=" />
- <IncludeRules context="FindStrings" />
- <IncludeRules context="FindSubstitutions" />
- <IncludeRules context="FindOthers" />
+ <context attribute="Here Doc" lineEndContext="#stay" name="HereDocINQCmd" dynamic="true" fallthroughContext="HereDocSubstitutions">
+ <StringDetect attribute="Redirection" context="HereDocRemainder" String="%1" dynamic="true"/>
+ <RegExpr attribute="Redirection" context="#pop#pop" String="^\t*%2$" dynamic="true" column="0"/>
</context>
- <!-- Subscript consumes anything till ], marks as Variable -->
- <context attribute="Variable" lineEndContext="#stay" name="Subscript">
- <DetectChar attribute="Variable" context="#pop" char="]" />
- <IncludeRules context="FindStrings" />
- <IncludeRules context="FindSubstitutions" />
- <IncludeRules context="FindOthers" />
+ <context attribute="Here Doc" lineEndContext="#pop" name="HereDocText">
</context>
- <!-- FunctionDef consumes a name, possibly with (), marks as Function -->
- <context attribute="Function" lineEndContext="#pop" name="FunctionDef" fallthrough="true" fallthroughContext="#pop">
- <RegExpr attribute="Function" context="#pop" String="\s+&funcname;(\s*\(\))?" />
+ <context attribute="Here Doc" lineEndContext="#pop" name="HereDocSubstitutions">
+ <DetectChar context="HereDocVariables" char="$" lookAhead="1"/>
+ <DetectChar attribute="Backquote" context="CommandBackq" char="`"/>
+ <DetectChar context="AssumeEscape" char="\" lookAhead="1"/>
+ </context>
+ <context attribute="Here Doc" lineEndContext="#pop" name="HereDocVariables">
+ <IncludeRules context="DispatchSubstVariables"/>
+ <IncludeRules context="DispatchVarnameVariables"/>
+ <DetectChar attribute="Here Doc" context="#pop" char="$"/>
</context>
<!-- VarName consumes spare variable names and assignments -->
- <context attribute="Normal Text" lineEndContext="#pop" name="VarName" fallthrough="true" fallthroughContext="#pop">
- <!-- handle command line options -->
- <RegExpr attribute="Option" context="#stay" String="-[A-Za-z0-9]+" />
- <RegExpr attribute="Option" context="#stay" String="--[a-z][A-Za-z0-9_-]*" />
- <RegExpr attribute="Variable" context="#stay" String="\b&varname;" />
- <DetectChar attribute="Variable" context="Subscript" char="[" />
- <DetectChar attribute="Variable" context="Assign" char="=" />
- <IncludeRules context="FindMost" />
- <!-- stay here in spaces and other safe characters -->
- <RegExpr attribute="Normal Text" context="#stay" String="[^]})|;`&amp;&gt;&lt;]" />
+ <context attribute="Normal Text" lineEndContext="#pop" name="VarName">
+ <StringDetect attribute="Builtin" context="#pop!BuiltinGetopts" String="getopts"/>
+ <StringDetect attribute="Builtin" context="#pop!BuiltinLet" String="let"/>
+ <DetectIdentifier attribute="Builtin" context="#pop!VarNameArgs"/>
+ <AnyChar attribute="Builtin" context="#pop!VarNameArgs" String=".:"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="VarNameArgs" fallthroughContext="#pop!CommandArgs">
+ <DetectSpaces attribute="Normal Text" context="VarNameArg"/>
+ <LineContinue attribute="Escape" context="#stay"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop#pop" name="VarNameArg" fallthroughContext="#pop!VarNameArg2">
+ <!-- In command arguments, do not allow comments after escaped characters.
+ This avoids highlighting comments within paths or other text. Ex: pathtext\ #no\ comment -->
+ <DetectChar context="#pop#pop" char="#" lookAhead="1"/>
+ <DetectChar attribute="Option" context="#pop!ShortOption" char="-"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="VarNameArg2" fallthroughContext="#pop!NormalOption">
+ <DetectChar attribute="Variable" context="Subscript" char="["/>
+ <DetectChar attribute="Operator" context="Assign" char="="/>
+ <DetectChar attribute="Variable" context="AssignArray" char="("/>
+ <DetectIdentifier attribute="Variable" context="#stay"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="BuiltinGetopts" fallthroughContext="#pop!CommandArgs">
+ <DetectSpaces attribute="Normal Text" context="#pop!BuiltinGetoptsOpt"/>
+ <LineContinue attribute="Escape" context="#stay"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop#pop" name="BuiltinGetoptsOpt" fallthroughContext="#pop!BuiltinGetoptsOpt2">
+ <DetectChar context="#pop#pop" char="#" lookAhead="1"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="BuiltinGetoptsOpt2" fallthroughContext="#pop!NormalOption">
+ <DetectChar attribute="Operator" context="#stay" char=":"/>
+ <DetectIdentifier attribute="Normal Text" context="#stay" />
+ <DetectSpaces attribute="Normal Text" context="#pop!BuiltinGetoptsVar"/>
+ <AnyChar context="#pop" String="&wordseps;`" lookAhead="1"/>
+ <IncludeRules context="FindWord"/>
+ <DetectChar context="NormalMaybeBraceExpansion" char="{" lookAhead="1"/>
+ <AnyChar attribute="Normal Text" context="#stay" String="/%.0123456789"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="BuiltinGetoptsVar" fallthroughContext="#pop!CommandArgs">
+ <DetectIdentifier attribute="Variable" context="#pop!CommandArgs"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="BuiltinLet" fallthroughContext="#pop!CommandArgs">
+ <DetectSpaces attribute="Normal Text" context="#pop!BuiltinLetArgs"/>
+ <LineContinue attribute="Escape" context="#stay"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="BuiltinLetArgs" fallthroughContext="BuiltinLetArg">
+ <AnyChar context="BuiltinLetArgsNumber" String="0123456789" lookAhead="1"/>
+ <IncludeRules context="CommandArgs"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="BuiltinLetArgsNumber" fallthroughContext="#pop!BuiltinLetArg">
+ <IncludeRules context="FindRedirection"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop#pop" name="BuiltinLetArg" fallthroughContext="#pop!BuiltinLetExpr">
+ <DetectChar context="#pop#pop" char="#" lookAhead="1"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="BuiltinLetExpr" fallthroughContext="#pop!NormalOption">
+ <DetectIdentifier attribute="Variable" context="#stay" />
+ <AnyChar context="#pop" String="&wordseps;`" lookAhead="1"/>
+ <AnyChar attribute="Operator" context="#stay" String="+-/%=^:"/>
+ <AnyChar context="Number" String="0123456789" lookAhead="1"/>
+ <DetectChar attribute="Parameter Expansion Operator" context="Subscript" char="["/>
+ <IncludeRules context="FindWord"/>
+ <DetectChar attribute="Error" context="#stay" char="#"/>
+ <DetectChar context="NormalMaybeBraceExpansion" char="{" lookAhead="1"/>
</context>
<!-- ProcessSubst handles <(command) and >(command) -->
- <context attribute="Normal Text" lineEndContext="#stay" name="ProcessSubst">
- <DetectChar attribute="Redirection" context="#pop" char=")" />
- <IncludeRules context="FindCommentsParen" />
- <IncludeRules context="FindCommands" />
- <IncludeRules context="FindStrings" />
- <IncludeRules context="FindSubstitutions" />
- <IncludeRules context="FindOthers" />
+ <context attribute="Normal Text" lineEndContext="#stay" name="ProcessSubst" fallthroughContext="Command">
+ <DetectChar attribute="Redirection" context="#pop" char=")"/>
+ <IncludeRules context="Start"/>
</context>
<!-- StringSQ consumes anything till ' -->
<context attribute="String SingleQ" lineEndContext="#stay" name="StringSQ">
- <DetectChar attribute="String SingleQ" context="#pop" char="'" />
+ <DetectChar attribute="String SingleQ" context="#pop" char="'"/>
</context>
<!-- StringDQ consumes anything till ", substitutes vars and expressions -->
<context attribute="String DoubleQ" lineEndContext="#stay" name="StringDQ">
- <DetectChar attribute="String DoubleQ" context="#pop" char="&quot;" />
- <RegExpr attribute="String Escape" context="#stay" String="\\[`&quot;\\$\n]" />
- <IncludeRules context="FindSubstitutions" />
+ <DetectChar attribute="String DoubleQ" context="#pop" char="&quot;"/>
+ <DetectChar context="StringDQEscape" char="\" lookAhead="1"/>
+ <DetectChar context="StringDQDispatchVariables" char="$" lookAhead="1"/>
+ <DetectChar attribute="Backquote" context="RegularBackq" char="`"/>
+ </context>
+ <context attribute="String DoubleQ" lineEndContext="#stay" name="StringDQDispatchVariables">
+ <IncludeRules context="DispatchSubstVariables"/>
+ <IncludeRules context="DispatchVarnameVariables"/>
+ <DetectChar attribute="String DoubleQ" context="#pop" char="$"/>
+ </context>
+ <context attribute="String DoubleQ" lineEndContext="#pop" name="StringDQEscape">
+ <Detect2Chars attribute="String Escape" context="#pop" char="\" char1="&quot;"/>
+ <Detect2Chars attribute="String Escape" context="#pop" char="\" char1="\"/>
+ <Detect2Chars attribute="String Escape" context="#pop" char="\" char1="`"/>
+ <Detect2Chars attribute="String Escape" context="#pop" char="\" char1="$"/>
+ <LineContinue attribute="String Escape" context="#pop"/>
+ <DetectChar attribute="String DoubleQ" context="#pop" char="\"/>
+ </context>
+
+ <!-- RegularBackq consumes anything till ` -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="RegularBackq" fallthroughContext="Command">
+ <DetectChar attribute="Backquote" context="#pop" char="`"/>
+ <DetectChar attribute="Comment" context="CommentBackq" char="#"/>
+ <IncludeRules context="Start"/>
</context>
<!-- StringEsc eats till ', but escaping many characters -->
<context attribute="String SingleQ" lineEndContext="#stay" name="StringEsc">
- <DetectChar attribute="String SingleQ" context="#pop" char="'" />
- <RegExpr attribute="String Escape" context="#stay" String="\\[abefnrtv\\']" />
- <RegExpr attribute="String Escape" context="#stay" String="\\([0-7]{1,3}|x[A-Fa-f0-9]{1,2}|c.)" />
+ <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>
- <!-- VarBrace is called as soon as ${xxx is encoutered -->
- <context attribute="Error" lineEndContext="#stay" name="VarBrace">
- <DetectChar attribute="Variable" context="#pop" char="}" />
- <DetectChar attribute="Variable" context="Subscript" char="[" />
- <RegExpr attribute="Variable" context="VarAlt" String="(:?[-=?+@]|##?|%%?|\^\^?|,,?)" />
- <RegExpr attribute="Variable" context="VarSubst" String="//?" />
- <DetectChar attribute="Variable" context="VarSub" char=":" />
+ <context attribute="Normal Text" lineEndContext="#stay" name="FindWord">
+ <IncludeRules context="FindStrings"/>
+ <DetectChar context="RegularVariable" char="$" lookAhead="1"/>
+ <DetectChar attribute="Backquote" context="RegularBackq" char="`"/>
+ <DetectChar context="AssumeEscape" char="\" lookAhead="1"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="RegularVariable">
+ <IncludeRules context="DispatchVariables"/>
+ <DetectChar attribute="Normal Text" context="#pop" char="$"/>
</context>
- <!-- VarAlt is to handle default/alternate/etc values of variables -->
- <context attribute="Normal Text" lineEndContext="#stay" name="VarAlt">
- <DetectChar attribute="Variable" context="#pop#pop" char="}" />
- <IncludeRules context="FindStrings" />
- <IncludeRules context="FindSubstitutions" />
+ <context attribute="Normal Text" lineEndContext="#pop" name="FindStrings">
+ <DetectChar attribute="String SingleQ" context="StringSQ" char="'"/>
+ <DetectChar attribute="String DoubleQ" context="StringDQ" char="&quot;"/>
</context>
- <!-- VarSubst is to handle substitutions on variables -->
- <context attribute="Normal Text" lineEndContext="#stay" name="VarSubst">
- <DetectChar attribute="Variable" context="#pop#pop" char="}" />
- <DetectChar attribute="Variable" context="VarSubst2" char="/" />
- <IncludeRules context="FindStrings" />
- <IncludeRules context="FindSubstitutions" />
+ <!-- SubstCommand is called after a $( is encountered -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="SubstCommand" fallthroughContext="Command">
+ <DetectChar attribute="Parameter Expansion" context="#pop" char=")"/>
+ <IncludeRules context="Start"/>
</context>
- <context attribute="Normal Text" lineEndContext="#stay" name="VarSubst2">
- <DetectChar attribute="Variable" context="#pop#pop#pop" char="}" />
- <IncludeRules context="FindStrings" />
- <IncludeRules context="FindSubstitutions" />
+
+ <!-- VarBraceStart is called as soon as ${ is encoutered -->
+ <context attribute="Variable" lineEndContext="#pop!VarBrace" name="VarBraceStart" fallthroughContext="#pop!VarBrace">
+ <DetectChar attribute="Parameter Expansion Operator" context="#pop!VarBracePrefix" char="!"/>
+ <DetectChar attribute="Parameter Expansion Operator" context="#pop!VarBrace" char="#"/>
</context>
- <!-- VarSub is to substrings of variables -->
- <context attribute="Error" lineEndContext="#stay" name="VarSub">
- <DetectSpaces attribute="Variable" context="#stay" />
- <DetectChar attribute="Variable" context="VarSub2" char=":" />
- <DetectChar attribute="Variable" context="#pop#pop" char="}" />
- <RegExpr attribute="Variable" context="#stay" String="&varname;" />
- <RegExpr attribute="Variable" context="#stay" String="([\-\+]\s*)?[0-9]+\s*(?=[:}])" />
- <IncludeRules context="FindSubstitutions" />
+ <!-- VarBracePrefix called as soon as ${! is encoutered -->
+ <context attribute="Variable" lineEndContext="#pop" name="VarBracePrefix">
+ <DetectIdentifier attribute="Variable" context="#pop!VarBracePrefixSuffix"/>
</context>
- <context attribute="Error" lineEndContext="#stay" name="VarSub2">
- <DetectSpaces attribute="Variable" context="#stay" />
- <DetectChar attribute="Variable" context="#pop#pop#pop" char="}" />
- <RegExpr attribute="Variable" context="#stay" String="&varname;" />
- <RegExpr attribute="Variable" context="#stay" String="([\-\+]\s*)?[0-9]+\s*(?=[:}])" />
- <IncludeRules context="FindSubstitutions" />
+ <context attribute="Variable" lineEndContext="#pop" name="VarBracePrefixSuffix" fallthroughContext="#pop!VarError">
+ <DetectChar attribute="Parameter Expansion" context="#pop" char="}"/>
+ <AnyChar attribute="Parameter Expansion Operator" context="#stay" String="@*"/>
+ <StringDetect attribute="Parameter Expansion Operator" context="#stay" String="[@]"/>
+ <StringDetect attribute="Parameter Expansion Operator" context="#stay" String="[*]"/>
</context>
+ <!-- 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="}"/>
+ <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="}"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#stay" name="CheckVarAlt" fallthroughContext="#pop!VarError">
+ <DetectChar attribute="Parameter Expansion" context="#pop" char="}"/>
+ <StringDetect attribute="Parameter Expansion Operator" context="#stay" String="[@]"/>
+ <StringDetect attribute="Parameter Expansion Operator" context="#stay" String="[*]"/>
+ <DetectChar attribute="Parameter Expansion Operator" context="Subscript" char="["/>
+ <Detect2Chars attribute="Parameter Expansion Operator" context="#pop!AlternateValue" char=":" char1="-"/>
+ <Detect2Chars attribute="Parameter Expansion Operator" context="#pop!AlternateValue" char=":" char1="="/>
+ <Detect2Chars attribute="Parameter Expansion Operator" context="#pop!AlternateValue" char=":" char1="?"/>
+ <Detect2Chars attribute="Parameter Expansion Operator" context="#pop!AlternateValue" char=":" char1="+"/>
+ <Detect2Chars attribute="Parameter Expansion Operator" context="#pop!AlternateValue" char="#" char1="#"/>
+ <Detect2Chars attribute="Parameter Expansion Operator" context="#pop!AlternateValue" char="%" char1="%"/>
+ <Detect2Chars attribute="Parameter Expansion Operator" context="#pop!AlternatePatternValue" char="^" char1="^"/>
+ <Detect2Chars attribute="Parameter Expansion Operator" context="#pop!AlternatePatternValue" char="," char1=","/>
+ <DetectChar attribute="Parameter Expansion Operator" context="#pop!VarSub" char=":"/>
+ <DetectChar attribute="Parameter Expansion Operator" context="#pop!VarSubst" char="/"/>
+ <AnyChar attribute="Parameter Expansion Operator" context="#pop!AlternateValue" String="%#"/>
+ <AnyChar attribute="Parameter Expansion Operator" context="#pop!AlternatePatternValue" String="^,"/>
+ <DetectChar attribute="Parameter Expansion Operator" context="#pop!VarTransformation" char="@"/>
+ </context>
- <!-- SubstFile is called after a <( or >( is encoutered -->
- <context attribute="Normal Text" lineEndContext="#stay" name="SubstFile">
- <DetectChar attribute="Redirection" context="#pop" char=")" />
- <IncludeRules context="FindCommentsParen" />
- <IncludeRules context="FindStrings" />
- <IncludeRules context="FindSubstitutions" />
- <IncludeRules context="FindOthers" />
+ <!-- called as soon as ${xxx: is encoutered -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="VarSub">
+ <DetectChar attribute="Variable" 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=":"/>
+ <DetectChar context="VarVariables" char="$" lookAhead="1"/>
+ <IncludeRules context="FindStrings"/>
+ <DetectChar attribute="Backquote" context="RegularBackq" char="`"/>
+ <DetectChar context="AssumeEscape" char="\" lookAhead="1"/>
+ </context>
+ <context attribute="Command" lineEndContext="#pop" name="VarVariables">
+ <IncludeRules context="DispatchVariables"/>
+ <DetectChar attribute="Error" context="#pop" char="$"/>
</context>
- <!-- SubstCommand is called after a $( is encountered -->
- <context attribute="Normal Text" lineEndContext="#stay" name="SubstCommand">
- <DetectChar attribute="Variable" context="#pop" char=")" />
- <IncludeRules context="FindCommentsParen" />
- <IncludeRules context="FindCommands" />
- <IncludeRules context="FindStrings" />
- <IncludeRules context="FindSubstitutions" />
- <IncludeRules context="FindOthers" />
+ <!-- called as soon as ${xxx:- ${xxx:= ${xxx:? ${xxx:+ ${xxx# ${xxx% and ${xxx are encoutered -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="AlternateValue">
+ <DetectChar attribute="Parameter Expansion" context="#pop" char="}"/>
+ <IncludeRules context="FindWord"/>
+ <IncludeRules context="FindPattern"/>
</context>
- <!-- SubstBackq is called when a backquote is encountered -->
- <context attribute="Normal Text" lineEndContext="#stay" name="SubstBackq">
- <DetectChar attribute="Backquote" context="#pop" char="`" />
- <IncludeRules context="FindCommentsBackq" />
- <IncludeRules context="FindCommandsBackq" />
- <IncludeRules context="FindStrings" />
- <IncludeRules context="FindSubstitutions" />
- <IncludeRules context="FindOthers" />
+ <!-- called as soon as ${xxx^ are ${xxx, are encoutered -->
+ <context attribute="Pattern" lineEndContext="#stay" name="AlternatePatternValue">
+ <DetectChar attribute="Parameter Expansion" context="#pop" char="}"/>
+ <IncludeRules context="FindWord"/>
+ <IncludeRules context="FindPattern"/>
</context>
- <!-- Case is called after the case keyword is encoutered. We handle this because of
- the lonely closing parentheses that would otherwise disturb the expr matching -->
- <context attribute="Normal Text" lineEndContext="#stay" name="Case">
- <RegExpr attribute="Keyword" context="CaseIn" String="\sin\b" />
- <IncludeRules context="FindMost" />
+ <!-- called as soon as ${xxx/ is encoutered -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="VarSubst" fallthroughContext="#pop!VarSubstPat">
+ <AnyChar attribute="Parameter Expansion Operator" context="#pop!VarSubstPat" String="/#%"/>
+ </context>
+ <context attribute="Pattern" lineEndContext="#stay" name="VarSubstPat">
+ <DetectChar attribute="Parameter Expansion Operator" context="#pop!AlternateValue" char="/"/>
+ <IncludeRules context="AlternateValue"/>
</context>
- <!-- CaseIn is called when the construct 'case ... in' has been found. -->
- <context attribute="Normal Text" lineEndContext="#stay" name="CaseIn">
- <RegExpr attribute="Keyword" context="#pop#pop" String="\besac(?=$|[\s;)])" endRegion="case" />
- <DetectChar attribute="Keyword" context="CaseExpr" char=")" beginRegion="caseexpr" />
- <AnyChar attribute="Keyword" context="#stay" String="(|" />
- <IncludeRules context="FindMost" />
+ <!-- called as soon as ${xxx@ is encoutered -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="VarTransformation" fallthroughContext="#pop!VarError">
+ <DetectChar attribute="Parameter Expansion" context="#pop" char="}"/>
+ <AnyChar attribute="Parameter Expansion" context="#stay" String="QEPAa"/>
</context>
- <!-- CaseExpr eats shell input till ;; -->
- <context attribute="Normal Text" lineEndContext="#stay" name="CaseExpr">
- <Detect2Chars attribute="Keyword" context="#pop" char=";" char1=";" endRegion="caseexpr" />
- <RegExpr attribute="Keyword" context="#pop" String="esac(?=$|[\s;)])" lookAhead="true" firstNonSpace="true" endRegion="caseexpr"/>
- <IncludeRules context="FindAll" />
+ <context attribute="Escape" lineEndContext="#pop" name="BraceExpansion">
+ <DetectChar attribute="Escape" context="#pop!BraceExpansion2" char="{"/>
+ </context>
+ <context attribute="Escape" lineEndContext="#pop" name="BraceExpansion2">
+ <DetectChar attribute="Operator" context="#stay" char=","/>
+ <DetectChar attribute="Escape" context="#pop" char="}"/>
+ <DetectChar context="EscapeMaybeBraceExpansion" char="{" lookAhead="1"/>
+ <DetectChar context="AssumeEscape" char="\" lookAhead="1"/>
+ <DetectChar attribute="Backquote" context="CommandBackq" char="`"/>
+ <DetectChar context="BraceExpansionVariables" char="$" lookAhead="1"/>
+ <IncludeRules context="FindStrings"/>
+ <IncludeRules context="FindPattern"/>
+ </context>
+ <context attribute="Escape" lineEndContext="#pop" name="EscapeMaybeBraceExpansion">
+ <IncludeRules context="DispatchBraceExpansion"/>
+ <DetectChar attribute="Escape" context="#pop!BraceExpansion2" char="{"/>
+ </context>
+ <context attribute="Escape" lineEndContext="#pop" name="BraceExpansionVariables">
+ <IncludeRules context="DispatchVariables"/>
+ <DetectChar attribute="Escape" context="#pop" char="$"/>
</context>
- <!-- 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="HereDocIQ" String="(&lt;&lt;-\s*&quot;(&word;)&quot;)" lookAhead="true" />
- <RegExpr attribute="Redirection" context="HereDocIQ" String="(&lt;&lt;-\s*'(&word;)')" lookAhead="true" />
- <RegExpr attribute="Redirection" context="HereDocIQ" String="(&lt;&lt;-\s*\\(&word;))" lookAhead="true" />
- <RegExpr attribute="Redirection" context="HereDocINQ" String="(&lt;&lt;-\s*(&word;))" lookAhead="true" />
- <RegExpr attribute="Redirection" context="HereDocQ" String="(&lt;&lt;\s*&quot;(&word;)&quot;)" lookAhead="true" />
- <RegExpr attribute="Redirection" context="HereDocQ" String="(&lt;&lt;\s*'(&word;)')" lookAhead="true" />
- <RegExpr attribute="Redirection" context="HereDocQ" String="(&lt;&lt;\s*\\(&word;))" lookAhead="true" />
- <RegExpr attribute="Redirection" context="HereDocNQ" String="(&lt;&lt;\s*(&word;))" lookAhead="true" />
- <Detect2Chars attribute="Redirection" context="#pop" char="&lt;" char1="&lt;" /><!-- always met -->
+ <context attribute="Normal Text" lineEndContext="#pop" name="SequenceExpression">
+ <AnyChar attribute="Decimal" context="#stay" String="0123456789-+"/>
+ <Detect2Chars attribute="Escape" context="#stay" char="." char1="."/>
+ <DetectChar attribute="Escape" context="#pop" char="}"/>
+ </context>
+
+<!-- ====== These are the contexts that can be branched to ======= -->
+
+ <!-- ExprDblParen consumes an expression started in command mode till )) -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="ExprDblParen">
+ <DetectSpaces attribute="Normal Text" context="#stay"/>
+ <Detect2Chars attribute="Keyword" context="#pop" char=")" char1=")" endRegion="expression"/>
+ <IncludeRules context="FindExprDblParen"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#stay" name="FindExprDblParen">
+ <Detect2Chars attribute="Control" context="#stay" char="&amp;" char1="&amp;"/>
+ <Detect2Chars attribute="Control" context="#stay" char="|" char1="|"/>
+ <AnyChar attribute="Operator" context="#stay" String="+-!~*/%&lt;>=&amp;^|?:"/>
+ <DetectChar attribute="Control" context="#stay" char=","/>
+ <DetectChar attribute="Normal Text" context="ExprSubDblParen" char="("/>
+ <AnyChar context="Number" String="0123456789" lookAhead="1"/>
+ <DetectChar attribute="Parameter Expansion Operator" context="Subscript" char="["/>
+ <IncludeRules context="FindWord"/>
+ <DetectChar attribute="Error" context="#stay" char="#"/>
+ <DetectChar context="MaybeArithmeticBrace" char="{" lookAhead="1"/>
+ <DetectIdentifier attribute="Variable" context="#stay"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#stay" name="ExprSubDblParen">
+ <DetectChar attribute="Normal Text" context="#pop" char=")"/>
+ <IncludeRules context="ExprDblParen"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="MaybeArithmeticBrace">
+ <IncludeRules context="DispatchBraceExpansion"/>
+ <DetectChar attribute="Error" context="#pop" char="{"/>
+ </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"/>
+ <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]+"/>
+ </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"/>
+ </context>
+
+ <!-- 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"/>
+ <IncludeRules context="FindExprDblParen"/>
+ </context>
+
+ <!-- ExprBracket consumes an expression till ] -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="ExprBracket" fallthroughContext="#pop!ExprBracketNot">
+ <DetectSpaces attribute="Normal Text" context="#stay"/>
+ <IncludeRules context="FindExprBracketEnd"/>
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="ExprBracketNot" fallthroughContext="#pop!ExprBracketParam1">
+ <DetectSpaces attribute="Normal Text" context="#pop!ExprBracketParam1"/>
+ <Detect2Chars attribute="Expression" context="ExprBracketTestMaybeNot" char="!" char1=" " lookAhead="1"/>
+ <Detect2Chars attribute="Expression" context="ExprBracketTestMaybeNot" char="!" char1="&tab;" lookAhead="1"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="ExprBracketTestMaybeNot">
+ <DetectChar attribute="Expression" context="#pop" char="!"/>
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="ExprBracketParam1" fallthroughContext="ExprBracketValue">
+ <DetectSpaces attribute="Normal Text" context="#pop!ExprBracketParam2"/>
+ <DetectChar context="TestMaybeUnary" char="-" lookAhead="1"/>
+ <IncludeRules context="FindExprBracketEnd"/>
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#pop" name="ExprBracketValue">
+ <AnyChar attribute="Error" context="#stay" String="&symbolseps;"/>
+ <AnyChar context="#pop" String=" &tab;" 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="HereDocRemainder">
- <IncludeRules context="FindAll" />
+ <context attribute="Normal Text" lineEndContext="#stay" name="ExprBracketParam2" fallthroughContext="ExprBracketValue">
+ <DetectSpaces attribute="Normal Text" context="#pop!ExprBracketParam3"/>
+ <AnyChar context="TestMaybeBinary" String="-=!" lookAhead="1"/>
+ <IncludeRules context="FindExprBracketEnd"/>
</context>
- <context attribute="Normal Text" lineEndContext="#stay" name="HereDocQ" dynamic="true">
- <RegExpr attribute="Redirection" context="HereDocRemainder" String="%1" dynamic="true" />
- <RegExpr attribute="Redirection" context="#pop#pop" String="^%2\b" dynamic="true" column="0"/>
+ <context attribute="Normal Text" lineEndContext="ExprBracketFinal" name="ExprBracketParam3" fallthroughContext="ExprBracketValue">
+ <DetectSpaces attribute="Normal Text" context="#pop!ExprBracketFinal"/>
+ <IncludeRules context="FindExprBracketEnd"/>
</context>
- <context attribute="Normal Text" lineEndContext="#stay" name="HereDocNQ" dynamic="true">
- <RegExpr attribute="Redirection" context="HereDocRemainder" String="%1" dynamic="true" />
- <RegExpr attribute="Redirection" context="#pop#pop" String="^%2\b" dynamic="true" column="0"/>
- <IncludeRules context="FindSubstitutions" />
+ <context attribute="Normal Text" lineEndContext="#stay" name="ExprBracketFinal" fallthroughContext="ExprBracketValue">
+ <DetectSpaces attribute="Normal Text" context="#stay"/>
+ <IncludeRules context="FindExprBracketEnd"/>
+ <RegExpr attribute="Error" context="#pop" String="(?:[^] &tab;]++|\][^ &tab;])++" endRegion="expression"/>
</context>
- <context attribute="Normal Text" lineEndContext="#stay" name="HereDocIQ" dynamic="true">
- <RegExpr attribute="Redirection" context="HereDocRemainder" String="%1" dynamic="true" />
- <RegExpr attribute="Redirection" context="#pop#pop" String="^\t*%2\b" dynamic="true" column="0"/>
+ <context attribute="Normal Text" lineEndContext="#stay" name="FindExprBracketEnd">
+ <LineContinue attribute="Escape" context="#stay"/>
+ <RegExpr attribute="Builtin" context="#pop" String="\](?=($|[ &tab;;|&amp;&lt;>)]))" endRegion="expression"/>
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#pop" name="TestMaybeUnary" fallthroughContext="#pop!ExprBracketValue">
+ <RegExpr attribute="Expression" context="#pop" String="-[abcdefghkprstuwxGLNOSovRnz](?=[ &tab;])"/>
+ </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;])"/>
+ </context>
+
+
+ <!-- ExprDblBracket consumes an expression till ]] -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="ExprDblBracket" fallthroughContext="#pop!ExprDblBracketNot">
+ <DetectSpaces attribute="Normal Text" context="#stay"/>
+ <IncludeRules context="FindExprDblBracketEnd"/>
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="ExprDblBracketNot" fallthroughContext="#pop!ExprDblBracketParam1">
+ <DetectSpaces attribute="Normal Text" context="#pop!ExprDblBracketParam1"/>
+ <DetectChar context="ExprDblBracketTestMaybeNot" char="!" lookAhead="1"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="ExprDblBracketTestMaybeNot" fallthroughContext="#pop#pop!ExprDblBracketParam1">
+ <RegExpr attribute="Expression" context="#pop" String="!(?=$|[ &tab;(])"/>
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="ExprDblBracketParam1" fallthroughContext="ExprDblBracketValue">
+ <DetectSpaces attribute="Normal Text" context="#pop!ExprDblBracketParam2"/>
+ <DetectChar context="TestMaybeUnary" char="-" lookAhead="1"/>
+ <AnyChar attribute="Expression" context="#pop!ExprDblBracketParam3Spe" String="&lt;>"/>
+ <IncludeRules context="FindExprDblBracketEnd"/>
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#pop" name="ExprDblBracketValue">
+ <Detect2Chars attribute="Keyword" context="ExprDblParen" char="(" char1="(" beginRegion="expression"/>
+ <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 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="("/>
+ <Detect2Chars context="#pop#pop" char="]" char1="]" lookAhead="1"/>
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="ExprDblBracketParam2" fallthroughContext="ExprDblBracketValue">
+ <DetectSpaces attribute="Normal Text" context="#pop!ExprDblBracketParam3"/>
+ <AnyChar context="TestMaybeBinary2" String="-=!" lookAhead="1"/>
+ <AnyChar attribute="Expression" context="#pop!ExprDblBracketParam3Spe" String="&lt;>"/>
+ <IncludeRules context="FindExprDblBracketEnd"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="TestMaybeBinary2" fallthroughContext="#pop!ExprDblBracketValue">
+ <IncludeRules context="TestMaybeBinary"/>
+ <RegExpr attribute="Expression" context="#pop#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="ExprDblBracketFinal" name="ExprDblBracketParam3" fallthroughContext="ExprDblBracketValue">
+ <DetectSpaces attribute="Normal Text" context="#pop!ExprDblBracketFinal"/>
+ <IncludeRules context="FindExprDblBracketEnd"/>
+ <AnyChar attribute="Error" context="#stay" String="&lt;>"/>
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="ExprDblBracketFinal" fallthroughContext="ExprDblBracketValue">
+ <DetectSpaces attribute="Normal Text" context="#stay"/>
+ <IncludeRules context="FindExprDblBracketEnd"/>
+ <RegExpr attribute="Error" context="#pop" String="(?:[^] &tab;]++|\](?:[^]]|\][^ &tab;]))++" endRegion="expression"/>
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="FindExprDblBracketEnd">
+ <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"/>
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="ExprDblBracketRegex">
+ <DetectSpaces attribute="Normal Text" context="#pop!Regex"/>
+ </context>
+ <context attribute="Pattern" lineEndContext="#stay" name="Regex">
+ <DetectSpaces attribute="Normal Text" context="#pop!ExprDblBracketFinal"/>
+ <DetectChar attribute="Error" context="#stay" char=")"/>
+ <Detect2Chars attribute="Operator" context="RegexChar" char="[" char1="^"/>
+ <DetectChar attribute="Operator" context="RegexChar" char="["/>
+ <IncludeRules context="FindRegex"/>
+ </context>
+ <context attribute="Pattern" lineEndContext="#stay" name="ExprDblBracketSubRegex">
+ <DetectSpaces attribute="Pattern" context="#stay"/>
+ <DetectChar attribute="Operator" context="#pop" char=")"/>
+ <Detect2Chars attribute="Operator" context="RegexSubChar" char="[" char1="^"/>
+ <DetectChar attribute="Operator" context="RegexSubChar" char="["/>
+ <IncludeRules context="FindRegex"/>
+ </context>
+
+ <context attribute="Pattern" lineEndContext="#stay" name="FindRegex">
+ <DetectChar attribute="Operator" context="ExprDblBracketSubRegex" char="("/>
+ <DetectChar attribute="Escape" context="RegexEscape" char="\"/>
+ <DetectChar attribute="Parameter Expansion" context="RegexDup" char="{"/>
+ <AnyChar attribute="Glob" context="#stay" String="^?+*.|"/>
+ <IncludeRules context="FindStrings"/>
+ <DetectChar context="RegexDispatchVariables" char="$" lookAhead="1"/>
+ <DetectChar attribute="Backquote" context="RegularBackq" char="`"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#stay" name="RegexDispatchVariables">
+ <IncludeRules context="DispatchVariables"/>
+ <DetectChar attribute="Operator" context="#pop" char="$"/>
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#pop" name="RegexEscape">
+ <RegExpr attribute="Escape" context="#pop" String="x[0-9a-fA-F]{1,2}|[0-7]{1,3}|."/>
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#pop" name="RegexDup">
+ <AnyChar attribute="Decimal" context="#stay" String="0123456789"/>
+ <DetectChar attribute="Parameter Expansion Operator" context="#stay" char=","/>
+ <DetectChar attribute="Parameter Expansion" context="#pop" char="}"/>
+ </context>
+
+ <context attribute="Pattern" lineEndContext="#pop" name="RegexSubChar" fallthroughContext="#pop!RegexSubInChar">
+ <AnyChar attribute="Pattern" context="#pop!RegexSubInChar" String="-]"/>
+ </context>
+ <context attribute="Pattern" lineEndContext="#pop" name="RegexSubInChar">
+ <DetectSpaces attribute="Pattern" context="#stay"/>
+ <IncludeRules context="RegexInChar"/>
+ </context>
+
+ <context attribute="Pattern" lineEndContext="#pop" name="RegexChar" fallthroughContext="#pop!RegexInChar">
+ <AnyChar attribute="Pattern" context="#pop!RegexInChar" String="-]"/>
+ </context>
+ <context attribute="Pattern" lineEndContext="#pop" name="RegexInChar">
+ <Detect2Chars context="RegexInCharEnd" char="-" char1="]" lookAhead="1"/>
+ <DetectChar attribute="Operator" context="#stay" char="-"/>
+ <DetectChar attribute="Escape" context="RegexEscape" char="\"/>
+ <DetectChar context="RegexCharClassSelect" char="[" lookAhead="1"/>
+ <DetectChar attribute="Operator" context="#pop" char="]"/>
+ <AnyChar context="#pop" String="() &tab;" lookAhead="1"/>
+ </context>
+ <context attribute="Operator" lineEndContext="#stay" name="RegexInCharEnd">
+ <DetectChar attribute="Pattern" context="#stay" char="-"/>
+ <DetectChar attribute="Operator" context="#pop#pop" char="]"/>
+ </context>
+ <context attribute="Parameter Expansion" lineEndContext="#pop#pop#pop" name="RegexCharClassSelect">
+ <Detect2Chars attribute="Parameter Expansion Operator" context="#pop!RegexCharClass" char="[" char1=":"/>
+ <Detect2Chars attribute="Parameter Expansion Operator" context="#pop!RegexCollatingSymbols" char="[" char1="."/>
+ <Detect2Chars attribute="Parameter Expansion Operator" context="#pop!RegexEquivalenceClass" char="[" char1="="/>
+ <DetectChar attribute="Pattern" context="#pop" char="["/>
+ </context>
+
+ <context attribute="Parameter Expansion" lineEndContext="#pop#pop#pop" name="RegexCharClass">
+ <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">
+ <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">
+ <Detect2Chars attribute="Parameter Expansion Operator" context="#pop" char="=" char1="]"/>
+ <DetectChar attribute="Error" context="#pop" char="]"/>
+ </context>
+
+ <!-- SubShell consumes shell input till ) -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="SubShell" fallthroughContext="Command">
+ <DetectChar attribute="Keyword" context="#pop" char=")" endRegion="subshell"/>
+ <IncludeRules context="Start"/>
+ </context>
+
+ <!-- Assign consumes an expression till EOL or whitespace -->
+ <context attribute="Normal Text" lineEndContext="#pop" name="Assign" fallthroughContext="#pop!Assign2">
+ <DetectChar attribute="Variable" context="#pop!AssignArray" char="("/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="Assign2" fallthroughContext="#pop">
+ <DetectChar attribute="Backquote" context="RegularBackq" char="`"/>
+ <IncludeRules context="NormalOption"/>
+ </context>
+
+ <!-- AssignArray consumes everything till ), marking assignments -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="AssignArray" fallthroughContext="NormalOption">
+ <DetectSpaces attribute="Normal Text" context="#stay"/>
+ <DetectChar attribute="Comment" context="Comment" char="#"/>
+ <DetectChar attribute="Variable" context="#pop!Assign2" char=")"/>
+ <DetectChar context="AssignArrayKey" char="[" lookAhead="1"/>
+ <DetectChar attribute="Backquote" context="AssignArrayBackq" char="`"/>
+ <AnyChar attribute="Error" context="#stay" String="&symbolseps;"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#pop" name="AssignArrayKey" fallthroughContext="#pop">
+ <DetectChar attribute="Parameter Expansion Operator" context="Subscript" char="["/>
+ <DetectChar attribute="Variable" context="#pop" char="="/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#stay" name="AssignArrayBackq" fallthroughContext="Command">
+ <DetectChar attribute="Backquote" context="#pop!NormalOption" char="`"/>
+ <DetectChar attribute="Comment" context="CommentBackq" char="#"/>
+ <IncludeRules context="Start"/>
+ </context>
+
+ <!-- Subscript consumes anything till ], marks as Variable -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="Subscript" fallthroughContext="#pop!Subscript2">
+ <DetectChar attribute="Parameter Expansion Operator" context="#pop" char="]"/>
+ <AnyChar attribute="Decimal" context="#stay" String="0123456789"/>
+ </context>
+ <context attribute="Normal Text" lineEndContext="#stay" name="Subscript2">
+ <DetectChar attribute="Parameter Expansion Operator" context="#pop" char="]"/>
+ <IncludeRules context="FindWord"/>
+ <IncludeRules context="FindPattern"/>
+ </context>
+
+ <!-- FunctionDef consumes a name, possibly with (), marks as Function -->
+ <context attribute="Function" lineEndContext="#pop" name="FunctionDef" fallthroughContext="#pop">
+ <RegExpr attribute="Function" context="#pop" String="[ &tab;]+&funcname;(?:[ &tab;]*\(\))?"/>
+ </context>
+
+ <!-- Case is called after the case keyword is encoutered. We handle this because of
+ the lonely closing parentheses that would otherwise disturb the expr matching -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="Case">
+ <DetectSpaces attribute="Normal Text" context="#stay"/>
+ <WordDetect attribute="Keyword" context="#pop!CaseIn" String="in"/>
+ <IncludeRules context="FindWord"/>
+ <DetectIdentifier attribute="Normal Text" context="#stay"/>
+ </context>
+
+ <!-- CaseIn is called when the construct 'case ... in' has been found. -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="CaseIn" fallthroughContext="CasePattern">
+ <DetectSpaces attribute="Normal Text" context="#stay"/>
+ <DetectChar attribute="Keyword" context="CasePattern" char="("/>
+ <DetectChar attribute="Comment" context="Comment" char="#"/>
+ </context>
+ <context attribute="Pattern" lineEndContext="#stay" name="CasePattern">
+ <DetectSpaces attribute="Normal Text" context="#stay"/>
+ <DetectChar attribute="Keyword" context="#pop!CaseExpr" char=")" beginRegion="caseexpr"/>
+ <DetectChar context="AssumeEscape" char="\" lookAhead="1"/>
+ <DetectChar attribute="Keyword" context="#stay" char="|"/>
+ <IncludeRules context="FindWord"/>
+ <IncludeRules context="FindPattern"/>
+ <WordDetect attribute="Control Flow" context="#pop#pop" String="esac" endRegion="case"/>
+ <DetectIdentifier attribute="Pattern" context="#stay"/>
</context>
- <context attribute="Normal Text" lineEndContext="#stay" name="HereDocINQ" dynamic="true">
- <RegExpr attribute="Redirection" context="HereDocRemainder" String="%1" dynamic="true" />
- <RegExpr attribute="Redirection" context="#pop#pop" String="^\t*%2\b" dynamic="true" column="0"/>
- <IncludeRules context="FindSubstitutions" />
+ <!-- CaseExpr eats shell input till ;; / ;& / ;;& -->
+ <context attribute="Normal Text" lineEndContext="#stay" name="CaseExpr" fallthroughContext="Command">
+ <StringDetect attribute="Control Flow" context="#pop" String=";;&amp;" endRegion="caseexpr"/>
+ <Detect2Chars attribute="Control Flow" context="#pop" char=";" char1=";" endRegion="caseexpr"/>
+ <Detect2Chars attribute="Control Flow" context="#pop" char=";" char1="&amp;" endRegion="caseexpr"/>
+ <WordDetect context="#pop" String="esac" endRegion="caseexpr" lookAhead="1"/>
+ <IncludeRules context="Start"/>
</context>
</contexts>
<itemDatas>
- <itemData name="Normal Text" defStyleNum="dsNormal" />
- <itemData name="Comment" defStyleNum="dsComment" />
- <itemData name="Keyword" defStyleNum="dsKeyword" />
- <itemData name="Control" defStyleNum="dsKeyword" />
- <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="String SingleQ" defStyleNum="dsString" />
- <itemData name="String DoubleQ" defStyleNum="dsString" />
- <itemData name="Backquote" defStyleNum="dsKeyword" />
- <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="Path" defStyleNum="dsNormal" />
- <itemData name="Option" defStyleNum="dsNormal" />
- <itemData name="Error" defStyleNum="dsError" />
+ <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="String SingleQ" defStyleNum="dsString"/>
+ <itemData name="String DoubleQ" defStyleNum="dsString"/>
+ <itemData name="Here Doc" defStyleNum="dsString"/>
+ <itemData name="Backquote" defStyleNum="dsKeyword"/>
+ <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"/>
</itemDatas>
</highlighting>
<general>
diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/cmake.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/cmake.xml
index 6f3b3dc862..7f3920bfb6 100644
--- a/src/libs/3rdparty/syntax-highlighting/data/syntax/cmake.xml
+++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/cmake.xml
@@ -14,9 +14,15 @@
SPDX-License-Identifier: LGPL-2.0-or-later
-->
+<!-- ***** THIS FILE WAS GENERATED BY A SCRIPT - DO NOT EDIT *****
+ cd data/generators
+ # increase version of cmake.xml.tpl then
+ ./generate-cmake-syntax.py cmake.yaml > ../syntax/cmake.xml
+-->
+
<language
name="CMake"
- version="25"
+ version="31"
kateversion="5.0"
section="Other"
extensions="CMakeLists.txt;*.cmake;*.cmake.in"
@@ -173,8 +179,15 @@
</list>
<list name="cmake_language_nargs">
<item>CALL</item>
+ <item>CANCEL_CALL</item>
<item>CODE</item>
+ <item>DEFER</item>
+ <item>DIRECTORY</item>
<item>EVAL</item>
+ <item>GET_CALL</item>
+ <item>GET_CALL_IDS</item>
+ <item>ID</item>
+ <item>ID_VAR</item>
</list>
<list name="cmake_minimum_required_nargs">
<item>FATAL_ERROR</item>
@@ -199,6 +212,7 @@
<item>COPYONLY</item>
<item>ESCAPE_QUOTES</item>
<item>NEWLINE_STYLE</item>
+ <item>NO_SOURCE_PERMISSIONS</item>
</list>
<list name="configure_file_sargs">
<item>CRLF</item>
@@ -242,6 +256,7 @@
<list name="execute_process_nargs">
<item>COMMAND</item>
<item>COMMAND_ECHO</item>
+ <item>COMMAND_ERROR_IS_FATAL</item>
<item>ECHO_ERROR_VARIABLE</item>
<item>ECHO_OUTPUT_VARIABLE</item>
<item>ENCODING</item>
@@ -261,7 +276,9 @@
</list>
<list name="execute_process_sargs">
<item>ANSI</item>
+ <item>ANY</item>
<item>AUTO</item>
+ <item>LAST</item>
<item>NONE</item>
<item>OEM</item>
<item>STDERR</item>
@@ -273,6 +290,11 @@
<item>APPEND</item>
<item>ARCHIVE_CREATE</item>
<item>ARCHIVE_EXTRACT</item>
+ <item>BASE_DIRECTORY</item>
+ <item>CHMOD</item>
+ <item>CHMOD_RECURSE</item>
+ <item>COMPRESSION</item>
+ <item>COMPRESSION_LEVEL</item>
<item>CONDITION</item>
<item>CONFIGURE</item>
<item>CONFIGURE_DEPENDS</item>
@@ -328,6 +350,7 @@
<item>PERMISSIONS</item>
<item>READ</item>
<item>READ_SYMLINK</item>
+ <item>REAL_PATH</item>
<item>REGEX</item>
<item>RELATIVE</item>
<item>RELATIVE_PATH</item>
@@ -349,6 +372,7 @@
<item>SIZE</item>
<item>STATUS</item>
<item>STRINGS</item>
+ <item>TARGET</item>
<item>TIMEOUT</item>
<item>TIMESTAMP</item>
<item>TLS_CAINFO</item>
@@ -357,7 +381,6 @@
<item>TOUCH_NOCREATE</item>
<item>TO_CMAKE_PATH</item>
<item>TO_NATIVE_PATH</item>
- <item>TYPE</item>
<item>UPLOAD</item>
<item>USERPWD</item>
<item>USE_SOURCE_PERMISSIONS</item>
@@ -662,6 +685,8 @@
</list>
<list name="separate_arguments_nargs">
<item>NATIVE_COMMAND</item>
+ <item>PROGRAM</item>
+ <item>SEPARATE_ARGS</item>
<item>UNIX_COMMAND</item>
<item>WINDOWS_COMMAND</item>
</list>
@@ -704,13 +729,16 @@
<item>CONCAT</item>
<item>CONFIGURE</item>
<item>EQUAL</item>
+ <item>ERROR_VARIABLE</item>
<item>ESCAPE_QUOTES</item>
<item>FIND</item>
<item>GENEX_STRIP</item>
+ <item>GET</item>
<item>GREATER</item>
<item>GREATER_EQUAL</item>
<item>HEX</item>
<item>JOIN</item>
+ <item>JSON</item>
<item>LENGTH</item>
<item>LESS</item>
<item>LESS_EQUAL</item>
@@ -718,6 +746,7 @@
<item>MATCH</item>
<item>MATCHALL</item>
<item>MD5</item>
+ <item>MEMBER</item>
<item>NAME</item>
<item>NAMESPACE</item>
<item>NOTEQUAL</item>
@@ -725,9 +754,11 @@
<item>RANDOM</item>
<item>RANDOM_SEED</item>
<item>REGEX</item>
+ <item>REMOVE</item>
<item>REPEAT</item>
<item>REPLACE</item>
<item>REVERSE</item>
+ <item>SET</item>
<item>SHA1</item>
<item>SHA224</item>
<item>SHA256</item>
@@ -883,6 +914,7 @@
<item>CUDA</item>
<item>CXX</item>
<item>Fortran</item>
+ <item>ISPC</item>
<item>Java</item>
<item>OBJC</item>
<item>OBJCXX</item>
@@ -996,6 +1028,7 @@
<item>CUDA</item>
<item>CXX</item>
<item>Fortran</item>
+ <item>ISPC</item>
<item>Java</item>
<item>NONE</item>
<item>OBJC</item>
@@ -1318,6 +1351,7 @@
<item>CMAKE_ANDROID_STL_TYPE</item>
<item>CMAKE_ANSI_CXXFLAGS</item>
<item>CMAKE_APPBUNDLE_PATH</item>
+ <item>CMAKE_APPLE_SILICON_PROCESSOR</item>
<item>CMAKE_AR</item>
<item>CMAKE_ARCHIVE_OUTPUT_DIRECTORY</item>
<item>CMAKE_ARGC</item>
@@ -1347,6 +1381,7 @@
<item>CMAKE_CACHE_MINOR_VERSION</item>
<item>CMAKE_CACHE_PATCH_VERSION</item>
<item>CMAKE_CFG_INTDIR</item>
+ <item>CMAKE_CLANG_VFS_OVERLAY</item>
<item>CMAKE_CL_64</item>
<item>CMAKE_CODEBLOCKS_COMPILER_ID</item>
<item>CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES</item>
@@ -1538,6 +1573,9 @@
<item>CMAKE_INSTALL_UCRT_LIBRARIES</item>
<item>CMAKE_INTERPROCEDURAL_OPTIMIZATION</item>
<item>CMAKE_IOS_INSTALL_COMBINED</item>
+ <item>CMAKE_ISPC_HEADER_DIRECTORY</item>
+ <item>CMAKE_ISPC_HEADER_SUFFIX</item>
+ <item>CMAKE_ISPC_INSTRUCTION_SETS</item>
<item>CMAKE_JOB_POOLS</item>
<item>CMAKE_JOB_POOL_COMPILE</item>
<item>CMAKE_JOB_POOL_LINK</item>
@@ -1583,12 +1621,20 @@
<item>CMAKE_NO_BUILTIN_CHRPATH</item>
<item>CMAKE_NO_STD_NAMESPACE</item>
<item>CMAKE_NO_SYSTEM_FROM_IMPORTED</item>
+ <item>CMAKE_OBJCXX_EXTENSIONS</item>
+ <item>CMAKE_OBJCXX_STANDARD</item>
+ <item>CMAKE_OBJCXX_STANDARD_REQUIRED</item>
+ <item>CMAKE_OBJC_EXTENSIONS</item>
+ <item>CMAKE_OBJC_STANDARD</item>
+ <item>CMAKE_OBJC_STANDARD_REQUIRED</item>
<item>CMAKE_OBJECT_PATH_MAX</item>
+ <item>CMAKE_OPTIMIZE_DEPENDENCIES</item>
<item>CMAKE_OSX_ARCHITECTURES</item>
<item>CMAKE_OSX_DEPLOYMENT_TARGET</item>
<item>CMAKE_OSX_SYSROOT</item>
<item>CMAKE_PARENT_LIST_FILE</item>
<item>CMAKE_PATCH_VERSION</item>
+ <item>CMAKE_PCH_INSTANTIATE_TEMPLATES</item>
<item>CMAKE_PCH_WARN_INVALID</item>
<item>CMAKE_PDB_OUTPUT_DIRECTORY</item>
<item>CMAKE_POSITION_INDEPENDENT_CODE</item>
@@ -1689,12 +1735,15 @@
<item>CMAKE_VS_SDK_REFERENCE_DIRECTORIES</item>
<item>CMAKE_VS_SDK_SOURCE_DIRECTORIES</item>
<item>CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION</item>
+ <item>CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM</item>
<item>CMAKE_WARN_DEPRECATED</item>
<item>CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION</item>
<item>CMAKE_WIN32_EXECUTABLE</item>
<item>CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS</item>
+ <item>CMAKE_XCODE_BUILD_SYSTEM</item>
<item>CMAKE_XCODE_GENERATE_SCHEME</item>
<item>CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY</item>
+ <item>CMAKE_XCODE_LINK_BUILD_PHASE_MODE</item>
<item>CMAKE_XCODE_PLATFORM_TOOLSET</item>
<item>CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER</item>
<item>CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN</item>
@@ -1782,6 +1831,7 @@
<item>CPACK_DMG_SLA_LANGUAGES</item>
<item>CPACK_DMG_VOLUME_NAME</item>
<item>CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION</item>
+ <item>CPACK_EXTERNAL_BUILT_PACKAGES</item>
<item>CPACK_EXTERNAL_ENABLE_STAGING</item>
<item>CPACK_EXTERNAL_PACKAGE_SCRIPT</item>
<item>CPACK_EXTERNAL_REQUESTED_VERSIONS</item>
@@ -1883,6 +1933,7 @@
<item>CPACK_PACKAGE_DESCRIPTION_SUMMARY</item>
<item>CPACK_PACKAGE_DIRECTORY</item>
<item>CPACK_PACKAGE_EXECUTABLES</item>
+ <item>CPACK_PACKAGE_FILES</item>
<item>CPACK_PACKAGE_FILE_NAME</item>
<item>CPACK_PACKAGE_HOMEPAGE_URL</item>
<item>CPACK_PACKAGE_ICON</item>
@@ -1897,6 +1948,8 @@
<item>CPACK_PACKAGING_INSTALL_PREFIX</item>
<item>CPACK_PKGBUILD_IDENTITY_NAME</item>
<item>CPACK_PKGBUILD_KEYCHAIN_PATH</item>
+ <item>CPACK_POST_BUILD_SCRIPTS</item>
+ <item>CPACK_PRE_BUILD_SCRIPTS</item>
<item>CPACK_PRODUCTBUILD_BACKGROUND</item>
<item>CPACK_PRODUCTBUILD_BACKGROUND_ALIGNMENT</item>
<item>CPACK_PRODUCTBUILD_BACKGROUND_DARKAQUA</item>
@@ -1989,6 +2042,7 @@
<item>CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION</item>
<item>CPACK_WIX_CMAKE_PACKAGE_REGISTRY</item>
<item>CPACK_WIX_CULTURES</item>
+ <item>CPACK_WIX_CUSTOM_XMLNS</item>
<item>CPACK_WIX_EXTENSIONS</item>
<item>CPACK_WIX_EXTRA_OBJECTS</item>
<item>CPACK_WIX_EXTRA_SOURCES</item>
@@ -2181,6 +2235,7 @@
<item>CC</item>
<item>CFLAGS</item>
<item>CMAKE_APPBUNDLE_PATH</item>
+ <item>CMAKE_APPLE_SILICON_PROCESSOR</item>
<item>CMAKE_BUILD_PARALLEL_LEVEL</item>
<item>CMAKE_CONFIG_TYPE</item>
<item>CMAKE_EXPORT_COMPILE_COMMANDS</item>
@@ -2423,6 +2478,9 @@
<item>INTERFACE_SYSTEM_INCLUDE_DIRECTORIES</item>
<item>INTERPROCEDURAL_OPTIMIZATION</item>
<item>IOS_INSTALL_COMBINED</item>
+ <item>ISPC_HEADER_DIRECTORY</item>
+ <item>ISPC_HEADER_SUFFIX</item>
+ <item>ISPC_INSTRUCTION_SETS</item>
<item>JOB_POOL_COMPILE</item>
<item>JOB_POOL_LINK</item>
<item>LABELS</item>
@@ -2452,10 +2510,18 @@
<item>NAME</item>
<item>NO_SONAME</item>
<item>NO_SYSTEM_FROM_IMPORTED</item>
+ <item>OBJCXX_EXTENSIONS</item>
+ <item>OBJCXX_STANDARD</item>
+ <item>OBJCXX_STANDARD_REQUIRED</item>
+ <item>OBJC_EXTENSIONS</item>
+ <item>OBJC_STANDARD</item>
+ <item>OBJC_STANDARD_REQUIRED</item>
+ <item>OPTIMIZE_DEPENDENCIES</item>
<item>OSX_ARCHITECTURES</item>
<item>OSX_COMPATIBILITY_VERSION</item>
<item>OSX_CURRENT_VERSION</item>
<item>OUTPUT_NAME</item>
+ <item>PCH_INSTANTIATE_TEMPLATES</item>
<item>PCH_WARN_INVALID</item>
<item>PDB_NAME</item>
<item>PDB_OUTPUT_DIRECTORY</item>
@@ -2528,6 +2594,7 @@
<item>WINDOWS_EXPORT_ALL_SYMBOLS</item>
<item>XCODE_EXPLICIT_FILE_TYPE</item>
<item>XCODE_GENERATE_SCHEME</item>
+ <item>XCODE_LINK_BUILD_PHASE_MODE</item>
<item>XCODE_PRODUCT_TYPE</item>
<item>XCODE_SCHEME_ADDRESS_SANITIZER</item>
<item>XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN</item>
@@ -3785,64 +3852,19 @@
<IncludeRules context="User Function Args" />
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="Detect More global-properties">
- <RegExpr attribute="Property" context="#stay" String="\bFeatureSummary_&id_re;_DESCRIPTION\b" />
+ <RegExpr attribute="Property" context="#stay" String="\b(?:FeatureSummary_&id_re;_DESCRIPTION)\b" />
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="Detect More directory-properties">
- <RegExpr attribute="Property" context="#stay" String="\bINTERPROCEDURAL_OPTIMIZATION_&id_re;\b" />
- <RegExpr attribute="Property" context="#stay" String="\bVS_GLOBAL_SECTION_POST_&id_re;\b" />
- <RegExpr attribute="Property" context="#stay" String="\bVS_GLOBAL_SECTION_PRE_&id_re;\b" />
+ <RegExpr attribute="Property" context="#stay" String="\b(?:VS_GLOBAL_SECTION_PRE_&id_re;|VS_GLOBAL_SECTION_POST_&id_re;|INTERPROCEDURAL_OPTIMIZATION_&id_re;)\b" />
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="Detect More target-properties">
- <RegExpr attribute="Property" context="#stay" String="\bARCHIVE_OUTPUT_DIRECTORY_&id_re;\b" />
- <RegExpr attribute="Property" context="#stay" String="\bARCHIVE_OUTPUT_NAME_&id_re;\b" />
- <RegExpr attribute="Property" context="#stay" String="\bCOMPILE_PDB_NAME_&id_re;\b" />
- <RegExpr attribute="Property" context="#stay" String="\bCOMPILE_PDB_OUTPUT_DIRECTORY_&id_re;\b" />
- <RegExpr attribute="Property" context="#stay" String="\b&id_re;_OUTPUT_NAME\b" />
- <RegExpr attribute="Property" context="#stay" String="\b&id_re;_POSTFIX\b" />
- <RegExpr attribute="Property" context="#stay" String="\bEXCLUDE_FROM_DEFAULT_BUILD_&id_re;\b" />
- <RegExpr attribute="Property" context="#stay" String="\bFRAMEWORK_MULTI_CONFIG_POSTFIX_&id_re;\b" />
- <RegExpr attribute="Property" context="#stay" String="\bIMPORTED_IMPLIB_&id_re;\b" />
- <RegExpr attribute="Property" context="#stay" String="\bIMPORTED_LIBNAME_&id_re;\b" />
- <RegExpr attribute="Property" context="#stay" String="\bIMPORTED_LINK_DEPENDENT_LIBRARIES_&id_re;\b" />
- <RegExpr attribute="Property" context="#stay" String="\bIMPORTED_LINK_INTERFACE_LANGUAGES_&id_re;\b" />
- <RegExpr attribute="Property" context="#stay" String="\bIMPORTED_LINK_INTERFACE_LIBRARIES_&id_re;\b" />
- <RegExpr attribute="Property" context="#stay" String="\bIMPORTED_LINK_INTERFACE_MULTIPLICITY_&id_re;\b" />
- <RegExpr attribute="Property" context="#stay" String="\bIMPORTED_LOCATION_&id_re;\b" />
- <RegExpr attribute="Property" context="#stay" String="\bIMPORTED_NO_SONAME_&id_re;\b" />
- <RegExpr attribute="Property" context="#stay" String="\bIMPORTED_OBJECTS_&id_re;\b" />
- <RegExpr attribute="Property" context="#stay" String="\bIMPORTED_SONAME_&id_re;\b" />
- <RegExpr attribute="Property" context="#stay" String="\bINTERPROCEDURAL_OPTIMIZATION_&id_re;\b" />
- <RegExpr attribute="Property" context="#stay" String="\b&id_re;_CLANG_TIDY\b" />
- <RegExpr attribute="Property" context="#stay" String="\b&id_re;_COMPILER_LAUNCHER\b" />
- <RegExpr attribute="Property" context="#stay" String="\b&id_re;_CPPCHECK\b" />
- <RegExpr attribute="Property" context="#stay" String="\b&id_re;_CPPLINT\b" />
- <RegExpr attribute="Property" context="#stay" String="\b&id_re;_INCLUDE_WHAT_YOU_USE\b" />
- <RegExpr attribute="Property" context="#stay" String="\b&id_re;_VISIBILITY_PRESET\b" />
- <RegExpr attribute="Property" context="#stay" String="\bLIBRARY_OUTPUT_DIRECTORY_&id_re;\b" />
- <RegExpr attribute="Property" context="#stay" String="\bLIBRARY_OUTPUT_NAME_&id_re;\b" />
- <RegExpr attribute="Property" context="#stay" String="\bLINK_FLAGS_&id_re;\b" />
- <RegExpr attribute="Property" context="#stay" String="\bLINK_INTERFACE_LIBRARIES_&id_re;\b" />
- <RegExpr attribute="Property" context="#stay" String="\bLINK_INTERFACE_MULTIPLICITY_&id_re;\b" />
- <RegExpr attribute="Property" context="#stay" String="\bLOCATION_&id_re;\b" />
- <RegExpr attribute="Property" context="#stay" String="\bMAP_IMPORTED_CONFIG_&id_re;\b" />
- <RegExpr attribute="Property" context="#stay" String="\bOSX_ARCHITECTURES_&id_re;\b" />
- <RegExpr attribute="Property" context="#stay" String="\bOUTPUT_NAME_&id_re;\b" />
- <RegExpr attribute="Property" context="#stay" String="\bPDB_NAME_&id_re;\b" />
- <RegExpr attribute="Property" context="#stay" String="\bPDB_OUTPUT_DIRECTORY_&id_re;\b" />
- <RegExpr attribute="Property" context="#stay" String="\bRUNTIME_OUTPUT_DIRECTORY_&id_re;\b" />
- <RegExpr attribute="Property" context="#stay" String="\bRUNTIME_OUTPUT_NAME_&id_re;\b" />
- <RegExpr attribute="Property" context="#stay" String="\bSTATIC_LIBRARY_FLAGS_&id_re;\b" />
- <RegExpr attribute="Property" context="#stay" String="\bVS_DOTNET_REFERENCE_&id_re;\b" />
- <RegExpr attribute="Property" context="#stay" String="\bVS_DOTNET_REFERENCEPROP_&id_re;_TAG_&id_re;\b" />
- <RegExpr attribute="Property" context="#stay" String="\bVS_GLOBAL_&id_re;\b" />
- <RegExpr attribute="Property" context="#stay" String="\bVS_SOURCE_SETTINGS_&id_re;\b" />
- <RegExpr attribute="Property" context="#stay" String="\bXCODE_ATTRIBUTE_&id_re;\b" />
+ <RegExpr attribute="Property" context="#stay" String="\b(?:XCODE_ATTRIBUTE_&id_re;|VS_SOURCE_SETTINGS_&id_re;|VS_GLOBAL_&id_re;|VS_DOTNET_REFERENCE_&id_re;|VS_DOTNET_REFERENCEPROP_&id_re;_TAG_&id_re;|STATIC_LIBRARY_FLAGS_&id_re;|RUNTIME_OUTPUT_NAME_&id_re;|RUNTIME_OUTPUT_DIRECTORY_&id_re;|PDB_OUTPUT_DIRECTORY_&id_re;|PDB_NAME_&id_re;|OUTPUT_NAME_&id_re;|OSX_ARCHITECTURES_&id_re;|MAP_IMPORTED_CONFIG_&id_re;|LOCATION_&id_re;|LINK_INTERFACE_MULTIPLICITY_&id_re;|LINK_INTERFACE_LIBRARIES_&id_re;|LINK_FLAGS_&id_re;|LIBRARY_OUTPUT_NAME_&id_re;|LIBRARY_OUTPUT_DIRECTORY_&id_re;|INTERPROCEDURAL_OPTIMIZATION_&id_re;|IMPORTED_SONAME_&id_re;|IMPORTED_OBJECTS_&id_re;|IMPORTED_NO_SONAME_&id_re;|IMPORTED_LOCATION_&id_re;|IMPORTED_LINK_INTERFACE_MULTIPLICITY_&id_re;|IMPORTED_LINK_INTERFACE_LIBRARIES_&id_re;|IMPORTED_LINK_INTERFACE_LANGUAGES_&id_re;|IMPORTED_LINK_DEPENDENT_LIBRARIES_&id_re;|IMPORTED_LIBNAME_&id_re;|IMPORTED_IMPLIB_&id_re;|FRAMEWORK_MULTI_CONFIG_POSTFIX_&id_re;|EXCLUDE_FROM_DEFAULT_BUILD_&id_re;|COMPILE_PDB_OUTPUT_DIRECTORY_&id_re;|COMPILE_PDB_NAME_&id_re;|ARCHIVE_OUTPUT_NAME_&id_re;|ARCHIVE_OUTPUT_DIRECTORY_&id_re;|&id_re;_VISIBILITY_PRESET|&id_re;_POSTFIX|&id_re;_OUTPUT_NAME|&id_re;_INCLUDE_WHAT_YOU_USE|&id_re;_CPPLINT|&id_re;_CPPCHECK|&id_re;_COMPILER_LAUNCHER|&id_re;_CLANG_TIDY)\b" />
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="Detect More source-properties">
- <RegExpr attribute="Property" context="#stay" String="\bVS_CSHARP_&id_re;\b" />
+ <RegExpr attribute="Property" context="#stay" String="\b(?:VS_CSHARP_&id_re;)\b" />
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="EndCmdPop">
@@ -3871,210 +3893,8 @@
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="Detect More Builtin Variables">
- <RegExpr attribute="CMake Internal Variable" context="#stay" String="\bCMAKE_&id_re;_COMPILER_ABI\b" />
- <RegExpr attribute="CMake Internal Variable" context="#stay" String="\bCMAKE_&id_re;_COMPILER_ARCHITECTURE_ID\b" />
- <RegExpr attribute="CMake Internal Variable" context="#stay" String="\bCMAKE_&id_re;_COMPILER_VERSION_INTERNAL\b" />
- <RegExpr attribute="CMake Internal Variable" context="#stay" String="\bCMAKE_&id_re;_PLATFORM_ID\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\b&id_re;_BINARY_DIR\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\b&id_re;_SOURCE_DIR\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\b&id_re;_VERSION\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\b&id_re;_VERSION_MAJOR\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\b&id_re;_VERSION_MINOR\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\b&id_re;_VERSION_PATCH\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\b&id_re;_VERSION_TWEAK\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\b&id_re;_ROOT\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\b&id_re;__TRYRUN_OUTPUT\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\b&id_re;_CONSIDERED_CONFIGS\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\b&id_re;_CONSIDERED_VERSIONS\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\b&id_re;_FIND_COMPONENTS\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\b&id_re;_FIND_QUIETLY\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\b&id_re;_FIND_REQUIRED\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\b&id_re;_FIND_REQUIRED_&id_re;\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\b&id_re;_FIND_VERSION\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\b&id_re;_FIND_VERSION_COUNT\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\b&id_re;_FIND_VERSION_EXACT\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\b&id_re;_FIND_VERSION_MAJOR\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\b&id_re;_FIND_VERSION_MINOR\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\b&id_re;_FIND_VERSION_PATCH\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\b&id_re;_FIND_VERSION_TWEAK\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\b&id_re;_FOUND\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\b&id_re;_INCLUDE_DIRS\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\b&id_re;_LIBRARIES\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\b&id_re;_LIBRARY_DIRS\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\b&id_re;_VERSION_COUNT\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\b&id_re;_VERSION_STRING\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\b&id_re;_KEYWORDS_MISSING_VALUES\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\b&id_re;_UNPARSED_ARGUMENTS\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\b&id_re;_MODULE_NAME\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bARGV[0-9]+\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_POSTFIX\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_ANDROID_TOOLCHAIN_MACHINE\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_ANDROID_TOOLCHAIN_PREFIX\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_ANDROID_TOOLCHAIN_SUFFIX\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_ARCHIVE_APPEND\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_ARCHIVE_CREATE\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_ARCHIVE_FINISH\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_CLANG_TIDY\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_COMPILER\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_COMPILER_AR\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_COMPILER_EXTERNAL_TOOLCHAIN\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_COMPILER_ID\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_COMPILER_LAUNCHER\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_COMPILER_LOADED\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_COMPILER_RANLIB\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_COMPILER_TARGET\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_COMPILER_VERSION\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_COMPILE_OBJECT\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_CPPCHECK\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_CPPLINT\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_CREATE_SHARED_LIBRARY\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_CREATE_SHARED_MODULE\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_CREATE_STATIC_LIBRARY\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_FLAGS\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_FLAGS_DEBUG\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_FLAGS_DEBUG_INIT\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_FLAGS_INIT\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_FLAGS_MINSIZEREL\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_FLAGS_MINSIZEREL_INIT\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_FLAGS_RELEASE\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_FLAGS_RELEASE_INIT\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_FLAGS_RELWITHDEBINFO\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_FLAGS_RELWITHDEBINFO_INIT\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_GHS_KERNEL_FLAGS_DEBUG\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_GHS_KERNEL_FLAGS_MINSIZEREL\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_GHS_KERNEL_FLAGS_RELEASE\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_GHS_KERNEL_FLAGS_RELWITHDEBINFO\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_IGNORE_EXTENSIONS\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_IMPLICIT_INCLUDE_DIRECTORIES\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_IMPLICIT_LINK_DIRECTORIES\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_IMPLICIT_LINK_LIBRARIES\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_INCLUDE_WHAT_YOU_USE\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_LIBRARY_ARCHITECTURE\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_LINKER_PREFERENCE\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_LINKER_PREFERENCE_PROPAGATES\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_LINKER_WRAPPER_FLAG\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_LINKER_WRAPPER_FLAG_SEP\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_LINK_EXECUTABLE\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_OUTPUT_EXTENSION\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_SIMULATE_ID\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_SIMULATE_VERSION\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_SIZEOF_DATA_PTR\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_SOURCE_FILE_EXTENSIONS\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_STANDARD_INCLUDE_DIRECTORIES\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_STANDARD_LIBRARIES\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_&id_re;_VISIBILITY_PRESET\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_ARCHIVE_OUTPUT_DIRECTORY_&id_re;\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_ARGV[0-9]+\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_&id_re;\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_DISABLE_FIND_PACKAGE_&id_re;\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_EXE_LINKER_FLAGS_&id_re;\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_EXE_LINKER_FLAGS_&id_re;_INIT\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_FRAMEWORK_MULTI_CONFIG_POSTFIX_&id_re;\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_INTERPROCEDURAL_OPTIMIZATION_&id_re;\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_LIBRARY_OUTPUT_DIRECTORY_&id_re;\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_MAP_IMPORTED_CONFIG_&id_re;\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_MATCH_[0-9]+\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_MODULE_LINKER_FLAGS_&id_re;\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_MODULE_LINKER_FLAGS_&id_re;_INIT\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_PDB_OUTPUT_DIRECTORY_&id_re;\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_POLICY_DEFAULT_CMP[0-9]{4}\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_POLICY_WARNING_CMP[0-9]{4}\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_PROJECT_&id_re;_INCLUDE\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_RUNTIME_OUTPUT_DIRECTORY_&id_re;\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_SHARED_LINKER_FLAGS_&id_re;\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_SHARED_LINKER_FLAGS_&id_re;_INIT\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_STATIC_LINKER_FLAGS_&id_re;\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_STATIC_LINKER_FLAGS_&id_re;_INIT\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_USER_MAKE_RULES_OVERRIDE_&id_re;\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCMAKE_XCODE_ATTRIBUTE_&id_re;\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_&id_re;_COMPONENT_INSTALL\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_ARCHIVE_&id_re;_FILE_NAME\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_BINARY_&id_re;\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_COMPONENT_&id_re;_DEPENDS\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_COMPONENT_&id_re;_DESCRIPTION\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_COMPONENT_&id_re;_DISABLED\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_COMPONENT_&id_re;_DISPLAY_NAME\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_COMPONENT_&id_re;_GROUP\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_COMPONENT_&id_re;_HIDDEN\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_COMPONENT_&id_re;_REQUIRED\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_DEBIAN_&id_re;_DESCRIPTION\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_DEBIAN_&id_re;_FILE_NAME\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_DEBIAN_&id_re;_PACKAGE_ARCHITECTURE\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_DEBIAN_&id_re;_PACKAGE_BREAKS\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_DEBIAN_&id_re;_PACKAGE_CONFLICTS\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_DEBIAN_&id_re;_PACKAGE_CONTROL_EXTRA\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_DEBIAN_&id_re;_PACKAGE_CONTROL_STRICT_PERMISSION\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_DEBIAN_&id_re;_PACKAGE_DEPENDS\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_DEBIAN_&id_re;_PACKAGE_ENHANCES\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_DEBIAN_&id_re;_PACKAGE_NAME\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_DEBIAN_&id_re;_PACKAGE_PREDEPENDS\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_DEBIAN_&id_re;_PACKAGE_PRIORITY\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_DEBIAN_&id_re;_PACKAGE_PROVIDES\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_DEBIAN_&id_re;_PACKAGE_RECOMMENDS\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_DEBIAN_&id_re;_PACKAGE_REPLACES\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_DEBIAN_&id_re;_PACKAGE_SECTION\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_DEBIAN_&id_re;_PACKAGE_SHLIBDEPS\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_DEBIAN_&id_re;_PACKAGE_SOURCE\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_DEBIAN_&id_re;_PACKAGE_SUGGESTS\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_DEBIAN_&id_re;_DEBUGINFO_PACKAGE\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_DMG_&id_re;_FILE_NAME\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_NSIS_&id_re;_INSTALL_DIRECTORY\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_NUGET_&id_re;_PACKAGE_AUTHORS\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_NUGET_&id_re;_PACKAGE_COPYRIGHT\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_NUGET_&id_re;_PACKAGE_DEPENDENCIES\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_NUGET_&id_re;_PACKAGE_DEPENDENCIES_&id_re;_VERSION\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_NUGET_&id_re;_PACKAGE_DESCRIPTION\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_NUGET_&id_re;_PACKAGE_DESCRIPTION_SUMMARY\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_NUGET_&id_re;_PACKAGE_HOMEPAGE_URL\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_NUGET_&id_re;_PACKAGE_ICONURL\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_NUGET_&id_re;_PACKAGE_LICENSEURL\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_NUGET_&id_re;_PACKAGE_NAME\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_NUGET_&id_re;_PACKAGE_OWNERS\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_NUGET_&id_re;_PACKAGE_RELEASE_NOTES\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_NUGET_&id_re;_PACKAGE_TAGS\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_NUGET_&id_re;_PACKAGE_TITLE\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_NUGET_&id_re;_PACKAGE_VERSION\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_NUGET_PACKAGE_DEPENDENCIES_&id_re;_VERSION\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_POSTFLIGHT_&id_re;_SCRIPT\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_PREFLIGHT_&id_re;_SCRIPT\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_RPM_&id_re;_DEFAULT_DIR_PERMISSIONS\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_RPM_&id_re;_DEFAULT_FILE_PERMISSIONS\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_RPM_&id_re;_DEFAULT_GROUP\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_RPM_&id_re;_DEFAULT_USER\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_RPM_&id_re;_BUILD_SOURCE_DIRS_PREFIX\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_RPM_&id_re;_DEBUGINFO_FILE_NAME\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_RPM_&id_re;_DEBUGINFO_PACKAGE\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_RPM_&id_re;_FILE_NAME\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_RPM_&id_re;_PACKAGE_ARCHITECTURE\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_RPM_&id_re;_PACKAGE_AUTOPROV\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_RPM_&id_re;_PACKAGE_AUTOREQ\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_RPM_&id_re;_PACKAGE_AUTOREQPROV\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_RPM_&id_re;_PACKAGE_CONFLICTS\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_RPM_&id_re;_PACKAGE_DESCRIPTION\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_RPM_&id_re;_PACKAGE_GROUP\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_RPM_&id_re;_PACKAGE_NAME\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_RPM_&id_re;_PACKAGE_OBSOLETES\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_RPM_&id_re;_PACKAGE_PREFIX\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_RPM_&id_re;_PACKAGE_PROVIDES\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_RPM_&id_re;_PACKAGE_REQUIRES\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_RPM_&id_re;_PACKAGE_REQUIRES_POST\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_RPM_&id_re;_PACKAGE_REQUIRES_POSTUN\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_RPM_&id_re;_PACKAGE_REQUIRES_PRE\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_RPM_&id_re;_PACKAGE_REQUIRES_PREUN\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_RPM_&id_re;_PACKAGE_SUGGESTS\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_RPM_&id_re;_PACKAGE_SUMMARY\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_RPM_&id_re;_PACKAGE_URL\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_RPM_&id_re;_USER_FILELIST\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_RPM_&id_re;_USER_BINARY_SPECFILE\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_RPM_NO_&id_re;_INSTALL_PREFIX_RELOCATION\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_WIX_&id_re;_EXTENSIONS\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_WIX_&id_re;_EXTRA_FLAGS\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bCPACK_WIX_PROPERTY_&id_re;\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bDOXYGEN_&id_re;\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bExternalData_CUSTOM_SCRIPT_&id_re;\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bExternalData_URL_ALGO_&id_re;_&id_re;\b" />
- <RegExpr attribute="Builtin Variable" context="#stay" String="\bSWIG_MODULE_&id_re;_EXTRA_DEPS\b" />
+ <RegExpr attribute="CMake Internal Variable" context="#stay" String="\b(?:CMAKE_&id_re;_PLATFORM_ID|CMAKE_&id_re;_COMPILER_VERSION_INTERNAL|CMAKE_&id_re;_COMPILER_ARCHITECTURE_ID|CMAKE_&id_re;_COMPILER_ABI)\b" />
+ <RegExpr attribute="Builtin Variable" context="#stay" String="\b(?:SWIG_MODULE_&id_re;_EXTRA_DEPS|ExternalData_URL_ALGO_&id_re;_&id_re;|ExternalData_CUSTOM_SCRIPT_&id_re;|DOXYGEN_&id_re;|CPACK_WIX_PROPERTY_&id_re;|CPACK_WIX_&id_re;_EXTRA_FLAGS|CPACK_WIX_&id_re;_EXTENSIONS|CPACK_RPM_NO_&id_re;_INSTALL_PREFIX_RELOCATION|CPACK_RPM_&id_re;_USER_FILELIST|CPACK_RPM_&id_re;_USER_BINARY_SPECFILE|CPACK_RPM_&id_re;_PACKAGE_URL|CPACK_RPM_&id_re;_PACKAGE_SUMMARY|CPACK_RPM_&id_re;_PACKAGE_SUGGESTS|CPACK_RPM_&id_re;_PACKAGE_REQUIRES_PREUN|CPACK_RPM_&id_re;_PACKAGE_REQUIRES_PRE|CPACK_RPM_&id_re;_PACKAGE_REQUIRES_POSTUN|CPACK_RPM_&id_re;_PACKAGE_REQUIRES_POST|CPACK_RPM_&id_re;_PACKAGE_REQUIRES|CPACK_RPM_&id_re;_PACKAGE_PROVIDES|CPACK_RPM_&id_re;_PACKAGE_PREFIX|CPACK_RPM_&id_re;_PACKAGE_OBSOLETES|CPACK_RPM_&id_re;_PACKAGE_NAME|CPACK_RPM_&id_re;_PACKAGE_GROUP|CPACK_RPM_&id_re;_PACKAGE_DESCRIPTION|CPACK_RPM_&id_re;_PACKAGE_CONFLICTS|CPACK_RPM_&id_re;_PACKAGE_AUTOREQPROV|CPACK_RPM_&id_re;_PACKAGE_AUTOREQ|CPACK_RPM_&id_re;_PACKAGE_AUTOPROV|CPACK_RPM_&id_re;_PACKAGE_ARCHITECTURE|CPACK_RPM_&id_re;_FILE_NAME|CPACK_RPM_&id_re;_DEFAULT_USER|CPACK_RPM_&id_re;_DEFAULT_GROUP|CPACK_RPM_&id_re;_DEFAULT_FILE_PERMISSIONS|CPACK_RPM_&id_re;_DEFAULT_DIR_PERMISSIONS|CPACK_RPM_&id_re;_DEBUGINFO_PACKAGE|CPACK_RPM_&id_re;_DEBUGINFO_FILE_NAME|CPACK_RPM_&id_re;_BUILD_SOURCE_DIRS_PREFIX|CPACK_PREFLIGHT_&id_re;_SCRIPT|CPACK_POSTFLIGHT_&id_re;_SCRIPT|CPACK_NUGET_PACKAGE_DEPENDENCIES_&id_re;_VERSION|CPACK_NUGET_&id_re;_PACKAGE_VERSION|CPACK_NUGET_&id_re;_PACKAGE_TITLE|CPACK_NUGET_&id_re;_PACKAGE_TAGS|CPACK_NUGET_&id_re;_PACKAGE_RELEASE_NOTES|CPACK_NUGET_&id_re;_PACKAGE_OWNERS|CPACK_NUGET_&id_re;_PACKAGE_NAME|CPACK_NUGET_&id_re;_PACKAGE_LICENSEURL|CPACK_NUGET_&id_re;_PACKAGE_ICONURL|CPACK_NUGET_&id_re;_PACKAGE_HOMEPAGE_URL|CPACK_NUGET_&id_re;_PACKAGE_DESCRIPTION_SUMMARY|CPACK_NUGET_&id_re;_PACKAGE_DESCRIPTION|CPACK_NUGET_&id_re;_PACKAGE_DEPENDENCIES_&id_re;_VERSION|CPACK_NUGET_&id_re;_PACKAGE_DEPENDENCIES|CPACK_NUGET_&id_re;_PACKAGE_COPYRIGHT|CPACK_NUGET_&id_re;_PACKAGE_AUTHORS|CPACK_NSIS_&id_re;_INSTALL_DIRECTORY|CPACK_DMG_&id_re;_FILE_NAME|CPACK_DEBIAN_&id_re;_PACKAGE_SUGGESTS|CPACK_DEBIAN_&id_re;_PACKAGE_SOURCE|CPACK_DEBIAN_&id_re;_PACKAGE_SHLIBDEPS|CPACK_DEBIAN_&id_re;_PACKAGE_SECTION|CPACK_DEBIAN_&id_re;_PACKAGE_REPLACES|CPACK_DEBIAN_&id_re;_PACKAGE_RECOMMENDS|CPACK_DEBIAN_&id_re;_PACKAGE_PROVIDES|CPACK_DEBIAN_&id_re;_PACKAGE_PRIORITY|CPACK_DEBIAN_&id_re;_PACKAGE_PREDEPENDS|CPACK_DEBIAN_&id_re;_PACKAGE_NAME|CPACK_DEBIAN_&id_re;_PACKAGE_ENHANCES|CPACK_DEBIAN_&id_re;_PACKAGE_DEPENDS|CPACK_DEBIAN_&id_re;_PACKAGE_CONTROL_STRICT_PERMISSION|CPACK_DEBIAN_&id_re;_PACKAGE_CONTROL_EXTRA|CPACK_DEBIAN_&id_re;_PACKAGE_CONFLICTS|CPACK_DEBIAN_&id_re;_PACKAGE_BREAKS|CPACK_DEBIAN_&id_re;_PACKAGE_ARCHITECTURE|CPACK_DEBIAN_&id_re;_FILE_NAME|CPACK_DEBIAN_&id_re;_DESCRIPTION|CPACK_DEBIAN_&id_re;_DEBUGINFO_PACKAGE|CPACK_COMPONENT_&id_re;_REQUIRED|CPACK_COMPONENT_&id_re;_HIDDEN|CPACK_COMPONENT_&id_re;_GROUP|CPACK_COMPONENT_&id_re;_DISPLAY_NAME|CPACK_COMPONENT_&id_re;_DISABLED|CPACK_COMPONENT_&id_re;_DESCRIPTION|CPACK_COMPONENT_&id_re;_DEPENDS|CPACK_BINARY_&id_re;|CPACK_ARCHIVE_&id_re;_FILE_NAME|CPACK_&id_re;_COMPONENT_INSTALL|CMAKE_XCODE_ATTRIBUTE_&id_re;|CMAKE_USER_MAKE_RULES_OVERRIDE_&id_re;|CMAKE_STATIC_LINKER_FLAGS_&id_re;_INIT|CMAKE_STATIC_LINKER_FLAGS_&id_re;|CMAKE_SHARED_LINKER_FLAGS_&id_re;_INIT|CMAKE_SHARED_LINKER_FLAGS_&id_re;|CMAKE_RUNTIME_OUTPUT_DIRECTORY_&id_re;|CMAKE_PROJECT_&id_re;_INCLUDE|CMAKE_POLICY_WARNING_CMP[0-9]{4}|CMAKE_POLICY_DEFAULT_CMP[0-9]{4}|CMAKE_PDB_OUTPUT_DIRECTORY_&id_re;|CMAKE_MODULE_LINKER_FLAGS_&id_re;_INIT|CMAKE_MODULE_LINKER_FLAGS_&id_re;|CMAKE_MATCH_[0-9]+|CMAKE_MAP_IMPORTED_CONFIG_&id_re;|CMAKE_LIBRARY_OUTPUT_DIRECTORY_&id_re;|CMAKE_INTERPROCEDURAL_OPTIMIZATION_&id_re;|CMAKE_FRAMEWORK_MULTI_CONFIG_POSTFIX_&id_re;|CMAKE_EXE_LINKER_FLAGS_&id_re;_INIT|CMAKE_EXE_LINKER_FLAGS_&id_re;|CMAKE_DISABLE_FIND_PACKAGE_&id_re;|CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_&id_re;|CMAKE_ARGV[0-9]+|CMAKE_ARCHIVE_OUTPUT_DIRECTORY_&id_re;|CMAKE_&id_re;_VISIBILITY_PRESET|CMAKE_&id_re;_STANDARD_LIBRARIES|CMAKE_&id_re;_STANDARD_INCLUDE_DIRECTORIES|CMAKE_&id_re;_SOURCE_FILE_EXTENSIONS|CMAKE_&id_re;_SIZEOF_DATA_PTR|CMAKE_&id_re;_SIMULATE_VERSION|CMAKE_&id_re;_SIMULATE_ID|CMAKE_&id_re;_POSTFIX|CMAKE_&id_re;_OUTPUT_EXTENSION|CMAKE_&id_re;_LINK_EXECUTABLE|CMAKE_&id_re;_LINKER_WRAPPER_FLAG_SEP|CMAKE_&id_re;_LINKER_WRAPPER_FLAG|CMAKE_&id_re;_LINKER_PREFERENCE_PROPAGATES|CMAKE_&id_re;_LINKER_PREFERENCE|CMAKE_&id_re;_LIBRARY_ARCHITECTURE|CMAKE_&id_re;_INCLUDE_WHAT_YOU_USE|CMAKE_&id_re;_IMPLICIT_LINK_LIBRARIES|CMAKE_&id_re;_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES|CMAKE_&id_re;_IMPLICIT_LINK_DIRECTORIES|CMAKE_&id_re;_IMPLICIT_INCLUDE_DIRECTORIES|CMAKE_&id_re;_IGNORE_EXTENSIONS|CMAKE_&id_re;_GHS_KERNEL_FLAGS_RELWITHDEBINFO|CMAKE_&id_re;_GHS_KERNEL_FLAGS_RELEASE|CMAKE_&id_re;_GHS_KERNEL_FLAGS_MINSIZEREL|CMAKE_&id_re;_GHS_KERNEL_FLAGS_DEBUG|CMAKE_&id_re;_FLAGS_RELWITHDEBINFO_INIT|CMAKE_&id_re;_FLAGS_RELWITHDEBINFO|CMAKE_&id_re;_FLAGS_RELEASE_INIT|CMAKE_&id_re;_FLAGS_RELEASE|CMAKE_&id_re;_FLAGS_MINSIZEREL_INIT|CMAKE_&id_re;_FLAGS_MINSIZEREL|CMAKE_&id_re;_FLAGS_INIT|CMAKE_&id_re;_FLAGS_DEBUG_INIT|CMAKE_&id_re;_FLAGS_DEBUG|CMAKE_&id_re;_FLAGS|CMAKE_&id_re;_CREATE_STATIC_LIBRARY|CMAKE_&id_re;_CREATE_SHARED_MODULE|CMAKE_&id_re;_CREATE_SHARED_LIBRARY|CMAKE_&id_re;_CPPLINT|CMAKE_&id_re;_CPPCHECK|CMAKE_&id_re;_COMPILE_OBJECT|CMAKE_&id_re;_COMPILER_VERSION|CMAKE_&id_re;_COMPILER_TARGET|CMAKE_&id_re;_COMPILER_RANLIB|CMAKE_&id_re;_COMPILER_LOADED|CMAKE_&id_re;_COMPILER_LAUNCHER|CMAKE_&id_re;_COMPILER_ID|CMAKE_&id_re;_COMPILER_EXTERNAL_TOOLCHAIN|CMAKE_&id_re;_COMPILER_AR|CMAKE_&id_re;_COMPILER|CMAKE_&id_re;_CLANG_TIDY|CMAKE_&id_re;_ARCHIVE_FINISH|CMAKE_&id_re;_ARCHIVE_CREATE|CMAKE_&id_re;_ARCHIVE_APPEND|CMAKE_&id_re;_ANDROID_TOOLCHAIN_SUFFIX|CMAKE_&id_re;_ANDROID_TOOLCHAIN_PREFIX|CMAKE_&id_re;_ANDROID_TOOLCHAIN_MACHINE|ARGV[0-9]+|&id_re;__TRYRUN_OUTPUT|&id_re;_VERSION_TWEAK|&id_re;_VERSION_STRING|&id_re;_VERSION_PATCH|&id_re;_VERSION_MINOR|&id_re;_VERSION_MAJOR|&id_re;_VERSION_COUNT|&id_re;_VERSION|&id_re;_UNPARSED_ARGUMENTS|&id_re;_SOURCE_DIR|&id_re;_ROOT|&id_re;_MODULE_NAME|&id_re;_LIBRARY_DIRS|&id_re;_LIBRARIES|&id_re;_KEYWORDS_MISSING_VALUES|&id_re;_INCLUDE_DIRS|&id_re;_HOMEPAGE_URL|&id_re;_FOUND|&id_re;_FIND_VERSION_TWEAK|&id_re;_FIND_VERSION_PATCH|&id_re;_FIND_VERSION_MINOR|&id_re;_FIND_VERSION_MAJOR|&id_re;_FIND_VERSION_EXACT|&id_re;_FIND_VERSION_COUNT|&id_re;_FIND_VERSION|&id_re;_FIND_REQUIRED_&id_re;|&id_re;_FIND_REQUIRED|&id_re;_FIND_QUIETLY|&id_re;_FIND_COMPONENTS|&id_re;_DESCRIPTION|&id_re;_CONSIDERED_VERSIONS|&id_re;_CONSIDERED_CONFIGS|&id_re;_BINARY_DIR)\b" />
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="Detect Variable Substitutions">
@@ -4086,11 +3906,7 @@
<context attribute="Environment Variable Substitution" lineEndContext="#pop" name="EnvVarSubst">
<keyword attribute="Standard Environment Variable" context="#stay" String="environment-variables" insensitive="false" />
- <RegExpr attribute="Standard Environment Variable" context="#stay" String="\b&id_re;_DIR\b" />
- <RegExpr attribute="Standard Environment Variable" context="#stay" String="\b&id_re;_ROOT\b" />
- <RegExpr attribute="Standard Environment Variable" context="#stay" String="\bASM&id_re;\b" />
- <RegExpr attribute="Standard Environment Variable" context="#stay" String="\bASM&id_re;FLAGS\b" />
- <RegExpr attribute="Standard Environment Variable" context="#stay" String="\bCMAKE_&id_re;_COMPILER_LAUNCHER\b" />
+ <RegExpr attribute="Standard Environment Variable" context="#stay" String="\b(?:CMAKE_&id_re;_COMPILER_LAUNCHER|ASM&id_re;FLAGS|ASM&id_re;|&id_re;_ROOT|&id_re;_DIR)\b" />
<DetectIdentifier />
<IncludeRules context="Detect Variable Substitutions" />
<DetectChar attribute="Environment Variable Substitution" context="#pop" char="}" />
@@ -4132,10 +3948,20 @@
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="Detect Special Values">
- <WordDetect attribute="True Special Arg" context="#stay" String="TRUE" />
- <WordDetect attribute="True Special Arg" context="#stay" String="ON" />
- <WordDetect attribute="False Special Arg" context="#stay" String="FALSE" />
- <WordDetect attribute="False Special Arg" context="#stay" String="OFF" />
+ <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="False Special Arg" context="#stay" String="\b(?:&id_re;-)?NOTFOUND\b" />
<RegExpr attribute="Special Args" context="#stay" String="\bCMP[0-9][0-9][0-9]\b" />
</context>
@@ -4157,8 +3983,7 @@
<context attribute="Comment" lineEndContext="#pop" name="Comment">
<LineContinue attribute="Comment" context="#pop" />
<DetectSpaces />
- <IncludeRules context="##Alerts" />
- <IncludeRules context="##Modelines" />
+ <IncludeRules context="##Comments" />
</context>
<context attribute="Comment" lineEndContext="#stay" name="RST Documentation" dynamic="true">
@@ -4170,8 +3995,7 @@
<LineContinue attribute="Comment" context="#stay" />
<DetectSpaces />
<StringDetect attribute="Comment" context="#pop" String="]%1]" dynamic="true" endRegion="BracketedComment" />
- <IncludeRules context="##Alerts" />
- <IncludeRules context="##Modelines" />
+ <IncludeRules context="##Comments" />
</context>
<context attribute="Strings" lineEndContext="#stay" name="String">
@@ -4215,6 +4039,7 @@
<itemData name="Special Args" defStyleNum="dsOthers" spellChecking="false" />
<itemData name="True Special Arg" defStyleNum="dsOthers" color="#30a030" selColor="#30a030" spellChecking="false" />
<itemData name="False Special Arg" defStyleNum="dsOthers" color="#e05050" selColor="#e05050" spellChecking="false" />
+ <itemData name="Version Arg" defStyleNum="dsDataType" spellChecking="false" />
<itemData name="Strings" defStyleNum="dsString" spellChecking="true" />
<itemData name="Escapes" defStyleNum="dsSpecialChar" spellChecking="false" />
<itemData name="Builtin Variable" defStyleNum="dsDecVal" color="#c09050" selColor="#c09050" spellChecking="false" />
@@ -4238,7 +4063,7 @@
<comment name="singleLine" start="#" position="afterwhitespace" />
<comment name="multiLine" start="#[[" end="]]" region="BracketedComment"/>
</comments>
- <keywords casesensitive="1" />
+ <keywords casesensitive="1" weakDeliminator="." />
</general>
</language>
diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/css.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/css.xml
index 3a2aa3dc91..37da5ea374 100644
--- a/src/libs/3rdparty/syntax-highlighting/data/syntax/css.xml
+++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/css.xml
@@ -38,7 +38,7 @@ Changelog:
-->
-<language name="CSS" version="10" kateversion="5.0" section="Markup" extensions="*.css" indenter="cstyle" mimetype="text/css" author="Wilbert Berendsen (wilbert@kde.nl)" license="LGPL" priority="10">
+<language name="CSS" version="12" 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>
@@ -822,6 +822,7 @@ Changelog:
<item>static</item>
<item>static-position</item>
<item>status-bar</item>
+ <item>sticky</item>
<item>thick</item>
<item>thin</item>
<item>ultra-condensed</item>
@@ -1584,8 +1585,7 @@ Changelog:
<context name="Comment" attribute="Comment" lineEndContext="#stay">
<DetectSpaces />
<Detect2Chars attribute="Comment" context="#pop#pop" char="*" char1="/" endRegion="comment" />
- <IncludeRules context="##Alerts" />
- <IncludeRules context="##Modelines" />
+ <IncludeRules context="##Comments" />
<DetectIdentifier />
</context>
diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/doxygen.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/doxygen.xml
index 6f3172570c..d7a53a167c 100644
--- a/src/libs/3rdparty/syntax-highlighting/data/syntax/doxygen.xml
+++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/doxygen.xml
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd"
[
- <!ENTITY wordsep "([][,?;()]|\.$|\.?\s)"> <!-- things that end a TagWord -->
+ <!ENTITY wordsep "(?:[][,?;()]|\.$|\.?\s)"> <!-- things that end a TagWord -->
<!ENTITY sl_word ".*?(?=&wordsep;)">
<!ENTITY ml_word ".*?(?=&wordsep;|\*/)">
]>
<language name="Doxygen"
- version="9"
+ version="13"
kateversion="5.0"
section="Markup"
extensions="*.dox;*.doxygen"
@@ -230,19 +230,17 @@
<context attribute="Comment" lineEndContext="#pop" name="LineComment">
<LineContinue attribute="Comment" context="#stay" />
<DetectSpaces />
- <IncludeRules context="##Alerts" />
+ <IncludeRules context="##Comments" />
<DetectIdentifier />
- <DetectChar attribute="Comment" context="SL_StartTag" char="\" lookAhead="true" />
- <DetectChar attribute="Comment" context="SL_StartTag" char="@" lookAhead="true" />
+ <AnyChar attribute="Comment" context="SL_StartTag" String="\@" lookAhead="true" />
<DetectChar attribute="Comment" context="SL_StartHTMLTag" char="&lt;" lookAhead="true" />
<DetectChar attribute="Comment" context="Entities" char="&amp;" lookAhead="true" />
</context>
<context attribute="Comment" lineEndContext="#stay" name="BlockComment">
<DetectSpaces />
- <IncludeRules context="##Alerts" />
+ <IncludeRules context="##Comments" />
<DetectIdentifier />
- <DetectChar attribute="Comment" context="ML_StartTag" char="\" lookAhead="true" />
- <DetectChar attribute="Comment" context="ML_StartTag" char="@" lookAhead="true" />
+ <AnyChar attribute="Comment" context="ML_StartTag" String="\@" lookAhead="true" />
<Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="BlockComment" />
<DetectChar attribute="Comment" context="ML_StartHTMLTag" char="&lt;" lookAhead="true" />
<DetectChar attribute="Comment" context="Entities" char="&amp;" lookAhead="true" />
@@ -335,7 +333,7 @@
<context name="ML_htmlcomment" attribute="HTML Comment" lineEndContext="#stay">
<DetectSpaces />
<Detect2Chars attribute="Comment" context="#pop#pop" char="*" char1="/" endRegion="BlockComment" />
- <IncludeRules context="##Alerts" />
+ <IncludeRules context="##Comments" />
<DetectIdentifier />
<StringDetect attribute="HTML Comment" context="#pop" String="--&gt;" />
</context>
@@ -354,7 +352,7 @@
<DetectChar attribute="Types" context="#pop#pop" char="&quot;" />
</context>
- <context name="ML_FindNextLine" attribute="Comment" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
+ <context name="ML_FindNextLine" attribute="Comment" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop">
<DetectSpaces />
<Detect2Chars attribute="Comment" context="#pop!ML_End_BlockComment" char="*" char1="/" endRegion="VerbatimBlock" lookAhead="1"/>
<Detect2Chars attribute="Comment" context="ML_VerbatimPrefix" char="*" char1="*" lookAhead="true" />
@@ -498,7 +496,7 @@
</context>
<context name="SL_htmlcomment" attribute="HTML Comment" lineEndContext="#pop">
<DetectSpaces />
- <IncludeRules context="##Alerts" />
+ <IncludeRules context="##Comments" />
<DetectIdentifier />
<StringDetect attribute="HTML Comment" context="#pop" String="--&gt;" />
</context>
@@ -590,8 +588,7 @@
<RegExpr attribute="Error" context="#pop" String="[@\\]f[]}]" />
<RegExpr attribute="Tags" context="#pop" String="[@\\](?:[#$%&amp;&lt;&gt;&quot;@\\.]|::|---?)(?=&wordsep;)" />
<RegExpr attribute="Custom Tags" context="#pop" String="[@\\](?:[^@\\ \t\*]|\*(?!/))+" />
- <DetectChar attribute="Comment" context="#pop" char="\" />
- <DetectChar attribute="Comment" context="#pop" char="@" />
+ <AnyChar attribute="Comment" context="#pop" String="\@" />
</context>
<context name="LanguageId" attribute="Word" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/dtd.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/dtd.xml
index be6bed734e..8093b1c4e8 100644
--- a/src/libs/3rdparty/syntax-highlighting/data/syntax/dtd.xml
+++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/dtd.xml
@@ -3,7 +3,7 @@
<!ENTITY nmtoken "[\-\w\d\.:_]+">
<!ENTITY entref "(#[0-9]+|#[xX][0-9A-Fa-f]+|&nmtoken;);">
]>
-<language name="DTD" version="3" kateversion="3.4" section="Markup" extensions="*.dtd" mimetype="application/xml-dtd" author="Andriy Lesyuk (s-andy@in.if.ua)" license="LGPL">
+<language name="DTD" version="4" kateversion="5.0" section="Markup" extensions="*.dtd" mimetype="application/xml-dtd" author="Andriy Lesyuk (s-andy@in.if.ua)" license="LGPL">
<highlighting>
<list name="Category">
@@ -45,8 +45,7 @@
<context name="Comment" attribute="Comment" lineEndContext="#stay">
<DetectSpaces />
<StringDetect attribute="Comment" context="#pop" String="--&gt;" endRegion="comment" />
- <IncludeRules context="##Alerts" />
- <IncludeRules context="##Modelines" />
+ <IncludeRules context="##Comments" />
<DetectIdentifier />
</context>
@@ -78,7 +77,7 @@
<context name="InlineComment" attribute="Comment" lineEndContext="#pop">
<DetectSpaces />
<Detect2Chars attribute="Comment" context="#pop" char="-" char1="-" />
- <IncludeRules context="##Alerts" />
+ <IncludeRules context="##Comments" />
<DetectIdentifier />
</context>
diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/html.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/html.xml
index 2a9a3bc4f4..312c91c5aa 100644
--- a/src/libs/3rdparty/syntax-highlighting/data/syntax/html.xml
+++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/html.xml
@@ -5,7 +5,7 @@
<!ENTITY attributeName "[A-Za-z_:*#\(\[][\)\]\w.:_-]*">
<!ENTITY entref "&amp;(?:#[0-9]+|#[xX][0-9A-Fa-f]+|&name;);">
]>
-<language name="HTML" version="12" 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="14" kateversion="5.53" section="Markup" extensions="*.htm;*.html;*.shtml;*.shtm" mimetype="text/html" author="Wilbert Berendsen (wilbert@kde.nl)" license="LGPL" priority="10">
<highlighting>
<contexts>
@@ -79,8 +79,7 @@
</context>
<context name="FindAttributes" attribute="Other Text" lineEndContext="#stay">
- <RegExpr attribute="Attribute" context="#stay" String="&attributeName;" column="0"/>
- <RegExpr attribute="Attribute" context="#stay" String="\s+&attributeName;" />
+ <RegExpr attribute="Attribute" context="#stay" String="^&attributeName;|\s+&attributeName;" />
<DetectChar attribute="Attribute" context="Value" char="=" />
</context>
@@ -92,8 +91,7 @@
<context name="Comment" attribute="Comment" lineEndContext="#stay">
<DetectSpaces/>
<StringDetect attribute="Comment" context="#pop" String="--&gt;" endRegion="comment" />
- <IncludeRules context="##Alerts" />
- <IncludeRules context="##Modelines" />
+ <IncludeRules context="##Comments" />
<DetectIdentifier/>
<RegExpr attribute="Error" context="#stay" String="-(?:-(?!-&gt;))+" />
</context>
@@ -195,7 +193,7 @@
<context name="JS comment close" attribute="Comment" lineEndContext="#pop">
<RegExpr attribute="Element" context="El Close 3" String="&lt;/script\b" insensitive="true" endRegion="script" />
<DetectSpaces />
- <IncludeRules context="##Alerts" />
+ <IncludeRules context="##Comments" />
</context>
<context name="Value" attribute="Other Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="Value NQ">
@@ -206,8 +204,7 @@
<context name="Value NQ" attribute="Other Text" lineEndContext="#pop#pop" fallthrough="true" fallthroughContext="#pop#pop">
<IncludeRules context="FindEntityRefs" />
- <RegExpr attribute="Value" context="#stay" String="/(?!&gt;)" />
- <RegExpr attribute="Value" context="#stay" String="[^/&gt;&lt;&quot;&apos;\s]" />
+ <RegExpr attribute="Value" context="#stay" String="/(?!&gt;)|[^/&gt;&lt;&quot;&apos;\s]" />
</context>
<context name="Value DQ" attribute="Value" lineEndContext="#stay">
diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/ini.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/ini.xml
index 0a6730977f..8b36a56290 100644
--- a/src/libs/3rdparty/syntax-highlighting/data/syntax/ini.xml
+++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/ini.xml
@@ -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="6" kateversion="2.4" author="Jan Janssen (medhefgo@web.de)" license="LGPL">
+<language name="INI Files" section="Configuration" extensions="*.ini;*.pls;*.kcfgc" mimetype="" version="8" kateversion="5.0" author="Jan Janssen (medhefgo@web.de)" license="LGPL">
<highlighting>
<list name="keywords">
@@ -36,8 +36,7 @@
<context name="ini" attribute="Normal Text" lineEndContext="#stay">
<RangeDetect attribute="Section" context="#stay" char="[" char1="]" beginRegion="Section" endRegion="Section" />
<DetectChar attribute="Assignment" context="Value" char="=" />
- <DetectChar char=";" attribute="Comment" context="Comment" firstNonSpace="true" />
- <DetectChar char="#" attribute="Comment" context="Comment" firstNonSpace="true" />
+ <AnyChar String=";#" attribute="Comment" context="Comment" firstNonSpace="true" />
</context>
<context name="Value" attribute="Value" lineEndContext="#pop" >
@@ -48,8 +47,7 @@
<context name="Comment" attribute="Comment" lineEndContext="#pop">
<DetectSpaces />
- <IncludeRules context="##Alerts" />
- <IncludeRules context="##Modelines" />
+ <IncludeRules context="##Comments" />
<DetectIdentifier />
</context>
</contexts>
diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/java.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/java.xml
index 273e899f73..6091cd4ee2 100644
--- a/src/libs/3rdparty/syntax-highlighting/data/syntax/java.xml
+++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/java.xml
@@ -1,10 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd"
[
- <!ENTITY int "[0-9]([0-9_]*[0-9])?">
- <!ENTITY hex "[0-9a-fA-F]([0-9a-fA-F_]*[0-9a-fA-F])?">
+ <!ENTITY int "(?:[0-9]++(_++[0-9]++)*+)">
+ <!ENTITY hex "(?:[0-9a-fA-F]++(_++[0-9a-fA-F]++)*+)">
+ <!ENTITY exp "(?:[eE][-+]?&int;)">
+ <!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="7" kateversion="5.0" section="Sources" extensions="*.java" mimetype="text/x-java" license="LGPL" author="Alfredo Luiz Foltran Fialho (alfoltran@ig.com.br)">
+<language name="Java" version="9" 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>
@@ -3704,21 +3707,11 @@
</list>
<list name="keywords">
<item>abstract</item>
- <item>break</item>
- <item>case</item>
- <item>catch</item>
<item>class</item>
- <item>continue</item>
<item>default</item>
- <item>do</item>
- <item>else</item>
<item>enum</item>
<item>extends</item>
<item>false</item>
- <item>finally</item>
- <item>for</item>
- <item>goto</item>
- <item>if</item>
<item>implements</item>
<item>instanceof</item>
<item>@interface</item>
@@ -3729,18 +3722,30 @@
<item>private</item>
<item>protected</item>
<item>public</item>
- <item>return</item>
<item>super</item>
<item>strictfp</item>
- <item>switch</item>
<item>synchronized</item>
<item>this</item>
<item>throws</item>
- <item>throw</item>
<item>transient</item>
<item>true</item>
- <item>try</item>
<item>volatile</item>
+ </list>
+ <list name="control flow">
+ <item>break</item>
+ <item>case</item>
+ <item>catch</item>
+ <item>continue</item>
+ <item>do</item>
+ <item>else</item>
+ <item>finally</item>
+ <item>for</item>
+ <item>goto</item>
+ <item>if</item>
+ <item>return</item>
+ <item>switch</item>
+ <item>throw</item>
+ <item>try</item>
<item>while</item>
</list>
<list name="types">
@@ -3759,87 +3764,127 @@
</list>
<contexts>
<context attribute="Normal Text" lineEndContext="#stay" name="Normal">
+ <DetectSpaces context="#stay"/>
+
+ <DetectChar attribute="Symbol" context="Dot" char="." lookAhead="1"/>
+ <DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="Brace1"/>
+ <DetectChar attribute="Symbol" context="#stay" char="}" endRegion="Brace1"/>
+ <DetectChar attribute="Annotation" context="Annotation" char="@" />
+ <DetectChar attribute="Symbol" context="InFunctionCall" char="("/>
+
<!-- Comment next line if you don't use Javadoc tool -->
<IncludeRules context="##Javadoc"/>
+ <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
+ <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>
+
+ <AnyChar attribute="Symbol" context="#stay" String="[]&amp;|+,-/*&lt;=&gt;;!%?:~^"/>
+
+ <AnyChar context="Number" String="0123456789" lookAhead="1"/>
+
+ <DetectChar attribute="String" context="String" char="&quot;"/>
+ <DetectChar context="Char" char="'" lookAhead="1"/>
+
<keyword attribute="Keyword" context="#stay" String="keywords"/>
+ <keyword attribute="Control Flow" context="#stay" String="control flow"/>
<keyword attribute="Data Type" context="#stay" String="types"/>
<keyword attribute="Java15" context="#stay" String="java15"/>
- <RegExpr attribute="Float" context="#stay" String="(\b&int;\.?|(\b&int;)?\.&int;)([eE][\-\+]?&int;[fFdD]?|[fFdD])\b"/>
- <RegExpr attribute="Float" context="#stay" String="(\b&int;\.|(\b&int;)?\.&int;\b)"/>
- <RegExpr attribute="Float" context="#stay" String="\b0[xX](&hex;\.?|(&hex;)?\.&hex;)[pP][\-\+]?&int;[fFdD]?\b"/>
- <RegExpr attribute="Hex" context="#stay" String="\b0[xX]&hex;[lL]?\b"/>
- <RegExpr attribute="Binary" context="#stay" String="\b0[bB][01]([01_]*[01])?[lL]?\b"/>
- <RegExpr attribute="Octal" context="#stay" String="\b0[0-7]([0-7_]*[0-7])?[lL]?\b"/>
- <RegExpr attribute="Decimal" context="#stay" String="\b(0|[1-9]([0-9_]*[0-9])?)[lL]?\b"/>
- <HlCChar attribute="Char" context="#stay"/>
- <RegExpr attribute="Char" context="#stay" String="'\\u[0-9a-fA-F]{4}'"/>
- <RegExpr attribute="Decimal" context="#stay" String="//\s*BEGIN.*$" beginRegion="Region1"/>
- <RegExpr attribute="Decimal" context="#stay" String="//\s*END.*$" endRegion="Region1"/>
- <DetectChar attribute="String" context="String" char="&quot;"/>
- <RegExpr attribute="Function" context="EnterPrintf" String="\.(format|printf)\b"/>
- <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
- <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>
- <DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="Brace1"/>
- <DetectChar attribute="Symbol" context="#stay" char="}" endRegion="Brace1"/>
- <RegExpr attribute="Keyword" context="#stay" String="\.{3,3}\s+" />
- <RegExpr attribute="Keyword" context="StaticImports" String="\b(import\s+static)\b" />
- <RegExpr attribute="Keyword" context="Imports" String="\b(package|import)\b" />
- <RegExpr attribute="Function" context="#stay" String="\b[_\w][_\w\d]*(?=[\s]*(/\*\s*\d+\s*\*/\s*)?[(])" />
- <RegExpr attribute="Annotation" context="#stay" String="@[_\w][_\w\d]*" />
- <DetectChar attribute="Symbol" context="Member" char="." />
- <DetectChar attribute="Symbol" context="InFunctionCall" char="("/>
- <AnyChar attribute="Symbol" context="#stay" String=":!%&amp;+,-/*&lt;=&gt;?[]|~^&#59;"/>
+
+ <WordDetect attribute="Keyword" context="Imports" String="package" />
+ <WordDetect attribute="Keyword" context="ImportsOrStaticImports" String="import" />
+
+ <RegExpr attribute="Function" context="#stay" String="\b[_a-zA-Z]\w*(?=[\s]*(/\*\s*\d+\s*\*/\s*)?[(])" />
+ <DetectIdentifier attribute="Normal Text"/>
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="Number">
+ <IncludeRules context="FindFloat"/>
+ <RegExpr attribute="Hex" context="#pop" String="\b0[xX]&hex;[lL]?\b"/>
+ <RegExpr attribute="Binary" context="#pop" String="\b0[bB][01]++(_++[01]++)*+[lL]?\b"/>
+ <RegExpr attribute="Octal" context="#pop" String="\b0_*+[0-7]++(_++[0-7_]++)*+[lL]?\b"/>
+ <RegExpr attribute="Decimal" context="#pop" String="\b(0|[1-9][0-9]*+(_++[0-9_]++)*+)[lL]?\b"/>
+ <AnyChar attribute="Error" context="#pop" String="0123456789"/>
</context>
+ <context attribute="Normal Text" lineEndContext="#stay" name="FindFloat">
+ <RegExpr attribute="Float" context="#pop" String="&float;|&hexfloat;"/>
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="Char">
+ <HlCChar attribute="Char" context="#pop"/>
+ <RegExpr attribute="Char" context="#pop" String="'\\u+[0-9a-fA-F]{4}'"/>
+ <RegExpr attribute="Error" context="#pop" String="'(\\(u+[0-9a-fA-F]*|.))?'?"/>
+ </context>
+
<context attribute="Normal Text" lineEndContext="#stay" name="InFunctionCall">
<IncludeRules context="Normal"/>
<DetectChar attribute="Symbol" context="#pop" char=")"/>
</context>
+
<context attribute="String" lineEndContext="#pop" name="String">
- <LineContinue attribute="String" context="#stay"/>
- <HlCStringChar attribute="String Char" context="#stay"/>
- <RegExpr attribute="String Char" context="#stay" String="\\u[0-9a-fA-F]{4}"/>
+ <DetectChar context="StringEscapedChar" char="\" lookAhead="1"/>
<DetectChar attribute="String" context="#pop" char="&quot;"/>
</context>
- <context attribute="Normal Text" lineEndContext="#stay" name="EnterPrintf" fallthrough="true" fallthroughContext="#pop">
- <DetectChar attribute="Symbol" context="Printf" char="("/>
+ <context attribute="String" lineEndContext="#pop" name="StringEscapedChar">
+ <HlCStringChar attribute="String Char" context="#pop"/>
+ <RegExpr attribute="String Char" context="#pop" String="\\u+[0-9a-fA-F]{4}"/>
+ <RegExpr attribute="Error" context="#pop" String="\\(u+[0-9a-fA-F]*|.)?"/>
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="Printf" fallthroughContext="#pop">
+ <DetectChar attribute="Symbol" context="#pop!InPrintf" char="("/>
<DetectSpaces attribute="Normal Text" context="#stay"/>
</context>
- <context attribute="Normal Text" lineEndContext="#stay" name="Printf">
+ <context attribute="Normal Text" lineEndContext="#stay" name="InPrintf">
<DetectChar attribute="String" context="PrintfString" char="&quot;"/>
<IncludeRules context="InFunctionCall"/>
</context>
<context attribute="PrintfString" lineEndContext="#pop" name="PrintfString">
- <LineContinue attribute="String" context="#stay"/>
- <HlCStringChar attribute="String Char" context="#stay"/>
- <DetectChar attribute="String" context="#pop" char="&quot;"/>
- <RegExpr attribute="String Char" context="#stay" String="%(\d+\$)?(-|#|\+|\ |0|,|\()*\d*(\.\d+)?[a-hosxA-CEGHSX]" />
- <RegExpr attribute="String Char" context="#stay" String="%(\d+\$)?(-|#|\+|\ |0|,|\()*\d*(t|T)(a|A|b|B|c|C|d|D|e|F|h|H|I|j|k|l|L|m|M|N|p|P|Q|r|R|s|S|T|y|Y|z|Z)" />
- <RegExpr attribute="String Char" context="#stay" String="%(%|n)" />
+ <IncludeRules context="String"/>
+ <RegExpr attribute="String Char" context="#stay" String="%((\d+\$)?[-#+ 0,(]*\d*((\.\d+)?[a-hosxA-CEGHSX]|[tT][aAbBcCdDeFhHIjklLmMNpPQrRsSTyYzZ])|[%n])" />
</context>
- <context attribute="Normal Text" lineEndContext="#pop" name="Member" fallthrough="true" fallthroughContext="#pop">
- <RegExpr attribute="Function" context="#pop" String="\b[_a-zA-Z]\w*(?=[\s]*)" />
+
+ <context attribute="Normal Text" lineEndContext="#stay" name="Dot">
+ <StringDetect attribute="Keyword" context="#pop" String="..." />
+ <IncludeRules context="FindFloat"/>
+ <DetectChar attribute="Symbol" context="#pop!Member" char="." />
</context>
- <context attribute="Normal Text" lineEndContext="#pop" name="StaticImports">
- <RegExpr attribute="StaticImports" context="#pop" String="\s*.*;" />
+ <context attribute="Normal Text" lineEndContext="#stay" name="Member" fallthroughContext="#pop">
+ <DetectSpaces attribute="Normal Text" context="#stay"/>
+ <WordDetect attribute="Function" context="#pop!Printf" String="printf"/>
+ <WordDetect attribute="Function" context="#pop!Printf" String="format"/>
+ <DetectIdentifier attribute="Function" context="#pop"/>
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#pop" name="Annotation" fallthroughContext="#pop">
+ <DetectIdentifier attribute="Annotation" context="#pop"/>
+ </context>
+
+ <context attribute="Normal Text" lineEndContext="#pop" name="ImportsOrStaticImports" fallthroughContext="#pop!Imports">
+ <DetectSpaces attribute="Normal Text"/>
+ <WordDetect attribute="Keyword" context="#pop!StaticImports" String="static"/>
+ </context>
+ <context attribute="StaticImports" lineEndContext="#pop" name="StaticImports">
+ <IncludeRules context="Imports"/>
</context>
- <context attribute="Normal Text" lineEndContext="#pop" name="Imports">
- <RegExpr attribute="Imports" context="#pop" String="\s*.*;" />
+ <context attribute="Imports" lineEndContext="#pop" name="Imports">
+ <AnyChar attribute="Symbol" context="#stay" String=".*"/>
+ <DetectChar attribute="Symbol" context="#pop" char=";"/>
</context>
+
<context attribute="Comment" lineEndContext="#pop" name="Commentar 1">
<DetectSpaces />
- <IncludeRules context="##Alerts"/>
- <IncludeRules context="##Modelines"/>
+ <IncludeRules context="##Comments"/>
</context>
<context attribute="Comment" lineEndContext="#stay" name="Commentar 2">
<Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/>
<DetectSpaces />
- <IncludeRules context="##Alerts"/>
- <IncludeRules context="##Modelines"/>
+ <IncludeRules context="##Comments"/>
</context>
+
</contexts>
<itemDatas>
<itemData name="Normal Text" defStyleNum="dsNormal" spellChecking="false"/>
<itemData name="Keyword" defStyleNum="dsKeyword" spellChecking="false"/>
+ <itemData name="Control Flow" defStyleNum="dsControlFlow" spellChecking="false"/>
<itemData name="Annotation" defStyleNum="dsAttribute" spellChecking="false"/>
<itemData name="Function" defStyleNum="dsFunction" spellChecking="false"/>
<itemData name="StaticImports" defStyleNum="dsImport" spellChecking="false"/>
@@ -3855,8 +3900,9 @@
<itemData name="String Char" defStyleNum="dsSpecialChar" spellChecking="false"/>
<itemData name="PrintfString" defStyleNum="dsString"/>
<itemData name="Comment" defStyleNum="dsComment"/>
- <itemData name="Symbol" defStyleNum="dsNormal" spellChecking="false"/>
+ <itemData name="Symbol" defStyleNum="dsOperator" spellChecking="false"/>
<itemData name="Java15" defStyleNum="dsBuiltIn" spellChecking="false"/>
+ <itemData name="Error" defStyleNum="dsError" spellChecking="false"/>
</itemDatas>
</highlighting>
<general>
diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/javadoc.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/javadoc.xml
index e72488b221..336fedd53c 100644
--- a/src/libs/3rdparty/syntax-highlighting/data/syntax/javadoc.xml
+++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/javadoc.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
-<language name="Javadoc" version="3" kateversion="5.0" section="Markup" extensions="" license="LGPL" author="Alfredo Luiz Foltran Fialho (alfoltran@ig.com.br)">
+<language name="Javadoc" version="6" kateversion="5.62" section="Markup" extensions="" license="LGPL" author="Alfredo Luiz Foltran Fialho (alfoltran@ig.com.br)">
<highlighting>
<contexts>
<context name="Start" attribute="Normal Text" lineEndContext="#stay">
@@ -12,74 +12,52 @@
</context>
<context attribute="JavadocFS" lineEndContext="#stay" name="JavadocFSar">
<Detect2Chars attribute="JavadocFS" context="#pop" char="*" char1="/" endRegion="Javadoc"/>
- <RegExpr attribute="JavadocFS" context="Javadocar" String="(!|\?)" />
- <RegExpr attribute="JavadocFS" context="Javadocar" String="(\.\s*$)" />
- <RegExpr attribute="JavadocFS" context="Javadocar" String="(\.\s)(?![\da-z])" />
- <RegExpr attribute="JavadocFS" context="Javadocar" String="\**\s*(?=@(author|deprecated|exception|param|return|see|serial|serialData|serialField|since|throws|version)(\s|$))" firstNonSpace="true"/>
- <StringDetect attribute="InlineTag" context="LiteralTagar" String="{@code " />
- <StringDetect attribute="InlineTag" context="LiteralTagar" String="{@code&#009;" />
- <StringDetect attribute="InlineTag" context="#stay" String="{@docRoot}" />
- <StringDetect attribute="InlineTag" context="#stay" String="{@inheritDoc}" />
- <StringDetect attribute="InlineTag" context="InlineTagar" String="{@link " />
- <StringDetect attribute="InlineTag" context="InlineTagar" String="{@link&#009;" />
- <StringDetect attribute="InlineTag" context="InlineTagar" String="{@linkplain " />
- <StringDetect attribute="InlineTag" context="InlineTagar" String="{@linkplain&#009;" />
- <StringDetect attribute="InlineTag" context="LiteralTagar" String="{@literal " />
- <StringDetect attribute="InlineTag" context="LiteralTagar" String="{@literal&#009;" />
- <StringDetect attribute="InlineTag" context="#stay" String="{@value}" />
- <StringDetect attribute="InlineTag" context="InlineTagar" String="{@value " />
- <StringDetect attribute="InlineTag" context="InlineTagar" String="{@value&#009;" />
- <IncludeRules context="##Alerts"/>
+ <RegExpr attribute="JavadocFS" context="Javadocar" String="[!?.](\s*$|\s(?![\da-z]))|^\s*\**\s*(?=@(author|deprecated|exception|param|return|see|serial|serialData|serialField|since|throws|version)(\s|$))"/>
+ <IncludeRules context="FindInlineTag"/>
+ <IncludeRules context="##Comments"/>
<IncludeRules context="##HTML"/>
</context>
+ <context attribute="Javadoc" lineEndContext="#stay" name="FindInlineTag">
+ <WordDetect attribute="InlineTag" context="LiteralTagar" String="{@code"/>
+ <StringDetect attribute="InlineTag" context="#stay" String="{@docRoot}"/>
+ <StringDetect attribute="InlineTag" context="#stay" String="{@inheritDoc}"/>
+ <WordDetect attribute="InlineTag" context="InlineTagar" String="{@link"/>
+ <WordDetect attribute="InlineTag" context="InlineTagar" String="{@linkplain"/>
+ <WordDetect attribute="InlineTag" context="LiteralTagar" String="{@literal"/>
+ <StringDetect attribute="InlineTag" context="#stay" String="{@value}"/>
+ <WordDetect attribute="InlineTag" context="InlineTagar" String="{@value"/>
+ <WordDetect attribute="InlineTag" context="LiteralTagar" String="{@summary"/>
+ <WordDetect attribute="InlineTag" context="LiteralTagar" String="{@systemProperty"/>
+ </context>
<context attribute="Javadoc" lineEndContext="#stay" name="Javadocar">
<Detect2Chars attribute="JavadocFS" context="#pop#pop" char="*" char1="/" endRegion="Javadoc"/>
- <RegExpr attribute="JavadocFS" context="#stay" String="\*+(?!/)" firstNonSpace="true"/>
- <StringDetect attribute="BlockTag" context="#stay" String="@author " />
- <StringDetect attribute="BlockTag" context="#stay" String="@deprecated " />
- <StringDetect attribute="BlockTag" context="JavadocParam" String="@exception " />
- <StringDetect attribute="BlockTag" context="JavadocParam" String="@param " />
- <StringDetect attribute="BlockTag" context="#stay" String="@return " />
- <StringDetect attribute="BlockTag" context="SeeTag" String="@see "/>
- <StringDetect attribute="BlockTag" context="#stay" String="@serial " />
- <StringDetect attribute="BlockTag" context="#stay" String="@serialData " />
- <StringDetect attribute="BlockTag" context="#stay" String="@serialField " />
- <StringDetect attribute="BlockTag" context="#stay" String="@since " />
- <StringDetect attribute="BlockTag" context="JavadocParam" String="@throws " />
- <StringDetect attribute="BlockTag" context="#stay" String="@version " />
- <StringDetect attribute="BlockTag" context="#stay" String="@author&#009;" />
- <StringDetect attribute="BlockTag" context="#stay" String="@deprecated&#009;" />
- <StringDetect attribute="BlockTag" context="JavadocParam" String="@exception&#009;" />
- <StringDetect attribute="BlockTag" context="JavadocParam" String="@param&#009;" />
- <StringDetect attribute="BlockTag" context="#stay" String="@return&#009;" />
- <StringDetect attribute="BlockTag" context="SeeTag" String="@see&#009;" />
- <StringDetect attribute="BlockTag" context="#stay" String="@serial&#009;" />
- <StringDetect attribute="BlockTag" context="#stay" String="@serialData&#009;" />
- <StringDetect attribute="BlockTag" context="#stay" String="@serialField&#009;" />
- <StringDetect attribute="BlockTag" context="#stay" String="@since&#009;" />
- <StringDetect attribute="BlockTag" context="JavadocParam" String="@throws&#009;" />
- <StringDetect attribute="BlockTag" context="#stay" String="@version&#009;" />
- <StringDetect attribute="InlineTag" context="LiteralTagar" String="{@code " />
- <StringDetect attribute="InlineTag" context="LiteralTagar" String="{@code&#009;" />
- <StringDetect attribute="InlineTag" context="#stay" String="{@docRoot}" />
- <StringDetect attribute="InlineTag" context="#stay" String="{@inheritDoc}" />
- <StringDetect attribute="InlineTag" context="InlineTagar" String="{@link " />
- <StringDetect attribute="InlineTag" context="InlineTagar" String="{@link&#009;" />
- <StringDetect attribute="InlineTag" context="InlineTagar" String="{@linkplain " />
- <StringDetect attribute="InlineTag" context="InlineTagar" String="{@linkplain&#009;" />
- <StringDetect attribute="InlineTag" context="LiteralTagar" String="{@literal " />
- <StringDetect attribute="InlineTag" context="LiteralTagar" String="{@literal&#009;" />
- <StringDetect attribute="InlineTag" context="#stay" String="{@value}" />
- <StringDetect attribute="InlineTag" context="InlineTagar" String="{@value " />
- <StringDetect attribute="InlineTag" context="InlineTagar" String="{@value&#009;" />
+ <DetectChar attribute="JavadocFS" context="JavadocFSStarPrefix" char="*" firstNonSpace="true"/>
+ <WordDetect attribute="BlockTag" context="#stay" String="@author"/>
+ <WordDetect attribute="BlockTag" context="#stay" String="@deprecated"/>
+ <WordDetect attribute="BlockTag" context="JavadocParam" String="@exception"/>
+ <WordDetect attribute="BlockTag" context="JavadocParam" String="@param"/>
+ <WordDetect attribute="BlockTag" context="#stay" String="@return"/>
+ <WordDetect attribute="BlockTag" context="SeeTag" String="@see"/>
+ <WordDetect attribute="BlockTag" context="#stay" String="@serial"/>
+ <WordDetect attribute="BlockTag" context="#stay" String="@serialData"/>
+ <WordDetect attribute="BlockTag" context="#stay" String="@serialField"/>
+ <WordDetect attribute="BlockTag" context="#stay" String="@since"/>
+ <WordDetect attribute="BlockTag" context="JavadocParam" String="@throws"/>
+ <WordDetect attribute="BlockTag" context="#stay" String="@version"/>
+ <IncludeRules context="FindInlineTag"/>
<IncludeRules context="##Alerts"/>
<IncludeRules context="##HTML"/>
</context>
- <context attribute="Javadoc" lineEndContext="#pop" name="JavadocParam">
- <DetectSpaces />
- <RegExpr attribute="JavadocParam" context="#pop#pop" String="\S*(?=\*/)" />
- <RegExpr attribute="JavadocParam" context="#pop" String="\S*(\s|$)" />
- <IncludeRules context="##Alerts"/>
+ <context attribute="Javadoc" lineEndContext="#pop" name="JavadocFSStarPrefix" fallthroughContext="#pop">
+ <Detect2Chars attribute="JavadocFS" context="#pop#pop#pop" char="*" char1="/" endRegion="Javadoc"/>
+ <DetectChar attribute="JavadocFS" context="#stay" char="*"/>
+ </context>
+ <context attribute="Javadoc" lineEndContext="#pop" name="JavadocParam" fallthroughContext="JavadocParamIdent">
+ <DetectSpaces context="JavadocParamIdent"/>
+ </context>
+ <context attribute="JavadocParam" lineEndContext="#pop#pop" name="JavadocParamIdent">
+ <DetectSpaces attribute="Javadoc" context="#pop#pop"/>
+ <Detect2Chars attribute="JavadocFS" context="#pop#pop#pop#pop" char="*" char1="/" endRegion="Javadoc"/>
</context>
<context attribute="InlineTag" name="InlineTagar" lineEndContext="#stay">
<DetectChar attribute="InlineTag" context="#pop" char="}" />
diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/json.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/json.xml
index a7ab85e0bb..686a1758c6 100644
--- a/src/libs/3rdparty/syntax-highlighting/data/syntax/json.xml
+++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/json.xml
@@ -12,7 +12,7 @@
** http://tools.ietf.org/html/rfc4627
***************************************************************************
-->
-<language name="JSON" section="Markup" version="5" 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="6" 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>
@@ -46,8 +46,7 @@
<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" />
- <DetectChar char="}" context="#pop" lookAhead="true" />
- <DetectChar char="," context="#pop" lookAhead="true" />
+ <AnyChar String="}," context="#pop" lookAhead="true" />
<DetectSpaces context="#stay" attribute="Style_Normal" />
diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/makefile.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/makefile.xml
index 7df18db5df..257aac5741 100644
--- a/src/libs/3rdparty/syntax-highlighting/data/syntax/makefile.xml
+++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/makefile.xml
@@ -12,7 +12,7 @@
<!-- v10 by Peter J. Mello <admin@petermello.net>
Add recognition of POSIX 2013 '::=' operator for variable assignment -->
<language name="Makefile" section="Other"
- version="10" kateversion="3.4"
+ version="13" kateversion="5.0"
extensions="GNUmakefile;Makefile;makefile;GNUmakefile.*;Makefile.*;makefile.*;*.mk"
mimetype="text/x-makefile" priority="11"
author="Per Wigren (wigren@home.se)" license="">
@@ -384,6 +384,8 @@
TODO :[range]
-->
<!-- Modifiers without arguments:-->
+ <!-- :Ox Randomize words in variable. -->
+ <Detect2Chars attribute="Builtin" context="#pop!expect}" char="O" char1="x"/>
<!--
:E Replaces each word in the variable with its suffix.
:H Replaces each word in the variable with everything but the last component.
@@ -398,8 +400,6 @@
<AnyChar attribute="Builtin" context="#pop!expect}" String="EHOQRTuLP"/>
<!-- :sh If the variable is non-empty it is run as a command and the output becomes the new value. -->
<Detect2Chars attribute="Builtin" context="#pop!expect}" char="s" char1="h"/>
- <!-- :Ox Randomize words in variable. -->
- <Detect2Chars attribute="Builtin" context="#pop!expect}" char="O" char1="x"/>
<!-- :tA Attempt to convert variable to an absolute path using realpath(3),-->
<Detect2Chars attribute="Builtin" context="#pop!expect}" char="t" char1="A"/>
<!-- :tl Converts variable to lower-case letters.-->
@@ -417,12 +417,11 @@
:Dnewval If the variable is defined newval is the value.
:Unewval If the variable is undefined newval is the value.
-->
- <AnyChar attribute="Builtin" context="#pop!bmake_var_modifier_arg" String="MNDU"/>
<!-- TODO: add new context to highligh old_string and new_string differently
:S/old_string/new_string/[1gW]
:C/pattern/replacement/[1gW]
-->
- <AnyChar attribute="Builtin" context="#pop!bmake_var_modifier_arg" String="SC"/>
+ <AnyChar attribute="Builtin" context="#pop!bmake_var_modifier_arg" String="MNDUSC"/>
<!-- ::=str The variable is assigned the value str after substitution. -->
<Detect2Chars attribute="Builtin" context="#pop!bmake_var_modifier_arg" char=":" char1="="/>
<!-- ::?=str As for ::= but only if the variable does not already have a value. -->
@@ -477,8 +476,7 @@
<context attribute="Comment" lineEndContext="#pop" name="Comment">
<LineContinue attribute="Comment" context="#stay" />
- <IncludeRules context="##Alerts" />
- <IncludeRules context="##Modelines" />
+ <IncludeRules context="##Comments" />
</context>
</contexts>
diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/markdown.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/markdown.xml
index d836d1c3f4..b35397af9c 100644
--- a/src/libs/3rdparty/syntax-highlighting/data/syntax/markdown.xml
+++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/markdown.xml
@@ -90,14 +90,14 @@
<!ENTITY checkbox "\[[ x]\](?=\s)">
]>
-<language name="Markdown" version="13" kateversion="5.53" section="Markup" extensions="*.md;*.mmd;*.markdown" priority="15" author="Darrin Yeager, Claes Holmerson" license="GPL,BSD">
+<language name="Markdown" version="17" 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 -->
- <context name="Start Document" attribute="Normal Text" lineEndContext="Normal Text" lineEmptyContext="Normal Text" fallthrough="true" fallthroughContext="Normal Text">
+ <context name="Start Document" attribute="Normal Text" lineEndContext="Normal Text" lineEmptyContext="Normal Text" fallthroughContext="Normal Text">
<!-- Some titles: (Title|Author|Date|Copyright|Revision|CSS|LaTeX\ XSLT|Categories|Tags|BaseName|Excerpt) -->
<!-- Metadata: Markdown format -->
- <RegExpr attribute="Metadata" context="metadata" String="\-{3}&end;" column="0" beginRegion="metadata"/>
+ <RegExpr attribute="Metadata" context="metadata" String="^\-{3}&end;" column="0" beginRegion="metadata"/>
<!-- Metadata: MultiMarkdown format -->
<RegExpr attribute="Metadata Title" context="metadata-mm-value" String="^&metadatakey;(?=\s|$)" column="0"/>
<!-- Code Block -->
@@ -109,12 +109,12 @@
<RegExpr attribute="Metadata Title" String="^&metadatakey;(?=\s|$)" column="0"/>
</context>
<context name="metadata-mm-value" attribute="Metadata" lineEndContext="#pop!metadata-mm"/>
- <context name="metadata-mm" attribute="Metadata" lineEndContext="#stay" lineEmptyContext="#pop!Normal Text" fallthrough="true" fallthroughContext="#pop!Normal Text">
+ <context name="metadata-mm" attribute="Metadata" lineEndContext="#stay" lineEmptyContext="#pop!Normal Text" fallthroughContext="#pop!Normal Text">
<!-- Find Metadata key or value -->
<RegExpr attribute="Metadata Title" context="#pop!metadata-mm-value" String="^&metadatakey;(?=\s|$)" column="0"/>
<RegExpr attribute="Metadata" context="#pop!metadata-mm-value" String="^(?:\s{4}|\t)" column="0"/>
</context>
- <context name="find-code-block-start" attribute="Normal Text" lineEndContext="#stay" lineEmptyContext="#stay" fallthrough="true" fallthroughContext="#pop!Normal Text">
+ <context name="find-code-block-start" attribute="Normal Text" lineEndContext="#stay" lineEmptyContext="#stay" fallthroughContext="#pop!Normal Text">
<IncludeRules context="find-code-block"/>
</context>
@@ -130,9 +130,9 @@
NOTE: The indentation of the lists is captured. -->
<RegExpr attribute="Horizontal Rule" context="find-code-block" String="^&rulerregex;" column="0"/>
<DetectChar attribute="Blockquote" context="blockquote" char="&gt;" firstNonSpace="true"/>
- <RegExpr attribute="List" context="list" String="(\s*)&listbullet;(\s+)" column="0"/>
- <RegExpr attribute="Number List" context="numlist" String="(\s*)\d\.(\s+)" column="0"/>
- <RegExpr attribute="Number List" context="numlist2" String="(\s*)\d\d+\.(\s+)" column="0"/>
+ <RegExpr attribute="List" context="list" String="^(\s*)&listbullet;(\s+)" column="0"/>
+ <RegExpr attribute="Number List" context="numlist" String="^(\s*)\d\.(\s+)" column="0"/>
+ <RegExpr attribute="Number List" context="numlist2" String="^(\s*)\d\d+\.(\s+)" column="0"/>
<!-- Find Strong, Emphasis and Strikethrough Text -->
<DetectChar context="find-strong-normal" char="*" lookAhead="true"/>
<DetectChar context="find-emphasis-normal" char="_" lookAhead="true"/>
@@ -142,33 +142,30 @@
<RegExpr attribute="Normal Text: Link" String="&implicitlink;"/>
</context>
<!-- Find indented code blocks. These are only allowed after an empty line or on the first line -->
- <context name="find-code-block" attribute="Normal Text" lineEndContext="#stay" lineEmptyContext="#stay" fallthrough="true" fallthroughContext="#pop">
+ <context name="find-code-block" attribute="Normal Text" lineEndContext="#stay" lineEmptyContext="#stay" fallthroughContext="#pop">
<RegExpr attribute="Code" String="^&indentedcodeblock;" column="0"/>
<RegExpr attribute="Normal Text" String="&end;" />
- <RegExpr attribute="Comment" context="comment" String="\s*&startcomment;" column="0" beginRegion="comment"/>
- <RegExpr attribute="Comment" context="comment" String="\s*&startcomment;(?=.*&endcomment;)" beginRegion="comment"/>
+ <RegExpr attribute="Comment" context="comment" String="^\s*&startcomment;|\s*&startcomment;(?=.*&endcomment;)" beginRegion="comment"/>
</context>
<context name="find-header" attribute="Normal Text" lineEndContext="#pop">
- <RegExpr attribute="Header H1" context="#pop" String="^#\s.*[#]?$"/>
- <RegExpr attribute="Header H2" context="#pop" String="^##\s.*[#]?$"/>
- <RegExpr attribute="Header H3" context="#pop" String="^###\s.*[#]?$"/>
- <RegExpr attribute="Header H4" context="#pop" String="^####\s.*[#]?$"/>
- <RegExpr attribute="Header H5" context="#pop" String="^#####\s.*[#]?$"/>
- <RegExpr attribute="Header H6" context="#pop" String="^######\s.*[#]?$"/>
+ <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"/>
+ <RegExpr attribute="Header H6" context="#pop" String="^######\s.*[#]?$" column="0"/>
<DetectChar attribute="Normal Text" context="#pop" char="#"/>
</context>
<context name="find-strong-normal" attribute="Normal Text" lineEndContext="#pop">
- <RegExpr attribute="Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast_und;"/>
- <RegExpr attribute="Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast_und2;"/>
+ <RegExpr attribute="Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast_und;|&strongemphasisregex_ast_und2;"/>
<RegExpr attribute="Strong Text" context="#pop" minimal="true" String="&strongregex_ast;"/>
<RegExpr attribute="Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast;"/>
<RegExpr attribute="Emphasis Text" context="#pop" minimal="true" String="&emphasisregex_ast;"/>
<DetectChar attribute="Normal Text" context="#pop" char="*"/>
</context>
<context name="find-emphasis-normal" attribute="Normal Text" lineEndContext="#pop">
- <RegExpr attribute="Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_und_ast;"/>
- <RegExpr attribute="Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_und_ast2;"/>
+ <RegExpr attribute="Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_und_ast;|&strongemphasisregex_und_ast2;"/>
<RegExpr attribute="Strong Text" context="#pop" minimal="true" String="&strongregex_und;"/>
<RegExpr attribute="Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_und;"/>
<RegExpr attribute="Emphasis Text" context="#pop" minimal="true" String="&emphasisregex_und;"/>
@@ -195,7 +192,7 @@
<context name="default-blockquote-1" attribute="Blockquote: Normal Text" lineEndContext="#stay">
<DetectChar attribute="Blockquote" char="&gt;" firstNonSpace="true"/>
<!-- End with header, horizontal rule or list/numlist -->
- <RegExpr context="#pop" String="(?:\s*(?:&listbullet;|[\d]+\.)\s|#{1,6}\s|&rulerregex;)" column="0" lookAhead="true"/>
+ <RegExpr context="#pop" String="^(?:\s*(?:&listbullet;|[\d]+\.)\s|#{1,6}\s|&rulerregex;)" column="0" lookAhead="true"/>
</context>
<context name="default-blockquote-2" attribute="Blockquote: Normal Text" lineEndContext="#stay">
<!-- Strong, emphasis, strong-emphasis and strikethrough text -->
@@ -206,16 +203,10 @@
<RegExpr attribute="Blockquote: Link" String="&implicitlink;"/>
</context>
<context name="find-strong-emphasis-blockquote" attribute="Blockquote: Normal Text" lineEndContext="#pop">
- <RegExpr attribute="Blockquote: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast_und;"/>
- <RegExpr attribute="Blockquote: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_und_ast;"/>
- <RegExpr attribute="Blockquote: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast_und2;"/>
- <RegExpr attribute="Blockquote: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_und_ast2;"/>
- <RegExpr attribute="Blockquote: Strong Text" context="#pop" minimal="true" String="&strongregex_ast;"/>
- <RegExpr attribute="Blockquote: Strong Text" context="#pop" minimal="true" String="&strongregex_und;"/>
- <RegExpr attribute="Blockquote: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast;"/>
- <RegExpr attribute="Blockquote: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_und;"/>
- <RegExpr attribute="Blockquote: Emphasis Text" context="#pop" minimal="true" String="&emphasisregex_ast;" />
- <RegExpr attribute="Blockquote: Emphasis Text" context="#pop" minimal="true" String="&emphasisregex_und;"/>
+ <RegExpr attribute="Blockquote: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast_und;|&strongemphasisregex_und_ast;|&strongemphasisregex_ast_und2;|&strongemphasisregex_und_ast2;"/>
+ <RegExpr attribute="Blockquote: Strong Text" context="#pop" minimal="true" String="&strongregex_ast;|&strongregex_und;"/>
+ <RegExpr attribute="Blockquote: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast;|&strongemphasisregex_und;"/>
+ <RegExpr attribute="Blockquote: Emphasis Text" context="#pop" minimal="true" String="&emphasisregex_ast;|&emphasisregex_und;"/>
<AnyChar attribute="Blockquote: Normal Text" context="#pop" String="*_"/>
</context>
@@ -223,40 +214,40 @@
<!-- NOTE: The indentation of the lists is captured. New paragraphs, code blocks, blockquotes or
horizontal rules must have an indentation equal to or greater than the list, to be part of it. -->
<!-- * list -->
- <context name="list" attribute="List: Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="content-list">
+ <context name="list" attribute="List: Normal Text" lineEndContext="#stay" fallthroughContext="content-list">
<!-- Find indented code blocks, blockquotes and horizontal rules -->
- <RegExpr attribute="Code" String="%1%2\s&indentedcodeblock;" column="0" dynamic="true"/>
- <RegExpr attribute="Blockquote" context="blockquote-list" String="%1%2\s+&gt;" column="0" dynamic="true"/>
- <RegExpr attribute="Horizontal Rule" String="%1%2\s+&rulerregex;" column="0" dynamic="true"/>
+ <RegExpr attribute="Code" String="^%1%2\s&indentedcodeblock;" column="0" dynamic="true"/>
+ <RegExpr attribute="Blockquote" context="blockquote-list" String="^%1%2\s+&gt;" column="0" dynamic="true"/>
+ <RegExpr attribute="Horizontal Rule" String="^%1%2\s+&rulerregex;" column="0" dynamic="true"/>
<RegExpr String="&emptyline;" column="0"/>
<!-- Text with the same indentation captured corresponds to the item list -->
- <RegExpr context="content-list" String="%1%2\s" column="0" lookAhead="true" dynamic="true"/>
+ <RegExpr context="content-list" String="^%1%2\s" column="0" lookAhead="true" dynamic="true"/>
<!-- Finish when the text has a lower indentation than the list -->
<RegExpr context="#pop" String="^\s*\S" column="0" lookAhead="true"/>
<!-- Highlight checkbox at the start of the item (task list) -->
<RegExpr attribute="List: Checkbox" context="content-list" String="\s*&checkbox;"/>
</context>
<!-- 1. numlist (one digit) -->
- <context name="numlist" attribute="List: Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="content-list">
+ <context name="numlist" attribute="List: Normal Text" lineEndContext="#stay" fallthroughContext="content-list">
<!-- Find indented code blocks, blockquotes and horizontal rules -->
- <RegExpr attribute="Code" String="%1%2\s{2}&indentedcodeblock;" column="0" dynamic="true"/>
- <RegExpr attribute="Blockquote" context="blockquote-list" String="%1%2\s{2,}&gt;" column="0" dynamic="true"/>
- <RegExpr attribute="Horizontal Rule" String="%1%2\s{2,}&rulerregex;" column="0" dynamic="true"/>
+ <RegExpr attribute="Code" String="^%1%2\s{2}&indentedcodeblock;" column="0" dynamic="true"/>
+ <RegExpr attribute="Blockquote" context="blockquote-list" String="^%1%2\s{2,}&gt;" column="0" dynamic="true"/>
+ <RegExpr attribute="Horizontal Rule" String="^%1%2\s{2,}&rulerregex;" column="0" dynamic="true"/>
<RegExpr String="&emptyline;" column="0"/>
<!-- Text with the same indentation captured -->
- <RegExpr context="content-list" String="%1%2\s{2}" column="0" lookAhead="true" dynamic="true"/>
+ <RegExpr context="content-list" String="^%1%2\s{2}" column="0" lookAhead="true" dynamic="true"/>
<!-- Finish when the text has a lower indentation than the list -->
<RegExpr context="#pop" String="^\s*\S" column="0" lookAhead="true"/>
</context>
<!-- 10. numlist (two or more digits) -->
- <context name="numlist2" attribute="List: Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="content-list">
+ <context name="numlist2" attribute="List: Normal Text" lineEndContext="#stay" fallthroughContext="content-list">
<!-- Find indented code blocks, blockquotes and horizontal rules -->
- <RegExpr attribute="Code" String="%1%2\s{3}&indentedcodeblock;" column="0" dynamic="true"/>
- <RegExpr attribute="Blockquote" context="blockquote-list" String="%1%2\s{3,}&gt;" column="0" dynamic="true"/>
- <RegExpr attribute="Horizontal Rule" String="%1%2\s{3,}&rulerregex;" column="0" dynamic="true"/>
+ <RegExpr attribute="Code" String="^%1%2\s{3}&indentedcodeblock;" column="0" dynamic="true"/>
+ <RegExpr attribute="Blockquote" context="blockquote-list" String="^%1%2\s{3,}&gt;" column="0" dynamic="true"/>
+ <RegExpr attribute="Horizontal Rule" String="^%1%2\s{3,}&rulerregex;" column="0" dynamic="true"/>
<RegExpr String="&emptyline;" column="0"/>
<!-- Text with the same indentation captured -->
- <RegExpr context="content-list" String="%1%2\s{3}" column="0" lookAhead="true" dynamic="true"/>
+ <RegExpr context="content-list" String="^%1%2\s{3}" column="0" lookAhead="true" dynamic="true"/>
<!-- Finish when the text has a lower indentation than the list -->
<RegExpr context="#pop" String="^\s*\S" column="0" lookAhead="true"/>
</context>
@@ -268,7 +259,7 @@
<!-- Blockquote and horzontal rule (check indentation) -->
<RegExpr context="#pop" String="^\s*(?:&gt;|&rulerregex;)" column="0" lookAhead="true"/>
<!-- End with header or new list/numlist -->
- <RegExpr context="#pop#pop" String="(?:\s*(?:&listbullet;|[\d]+\.)\s|#{1,6}\s)" column="0" lookAhead="true"/>
+ <RegExpr context="#pop#pop" String="^(?:\s*(?:&listbullet;|[\d]+\.)\s|#{1,6}\s)" column="0" lookAhead="true"/>
<!-- Strong, emphasis, strong-emphasis and strikethrough text -->
<AnyChar context="find-strong-emphasis-list" String="*_" lookAhead="true"/>
<RegExpr attribute="List: Strikethrough Text" minimal="true" String="&strikeoutregex;"/>
@@ -277,24 +268,17 @@
<RegExpr attribute="List: Link" String="&implicitlink;"/>
</context>
<context name="find-strong-emphasis-list" attribute="List: Normal Text" lineEndContext="#pop">
- <RegExpr attribute="List: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast_und;"/>
- <RegExpr attribute="List: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_und_ast;"/>
- <RegExpr attribute="List: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast_und2;"/>
- <RegExpr attribute="List: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_und_ast2;"/>
- <RegExpr attribute="List: Strong Text" context="#pop" minimal="true" String="&strongregex_ast;"/>
- <RegExpr attribute="List: Strong Text" context="#pop" minimal="true" String="&strongregex_und;"/>
- <RegExpr attribute="List: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast;"/>
- <RegExpr attribute="List: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_und;"/>
- <RegExpr attribute="List: Emphasis Text" context="#pop" minimal="true" String="&emphasisregex_ast;" />
- <RegExpr attribute="List: Emphasis Text" context="#pop" minimal="true" String="&emphasisregex_und;"/>
+ <RegExpr attribute="List: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast_und;|&strongemphasisregex_und_ast;|&strongemphasisregex_ast_und2;|&strongemphasisregex_und_ast2;"/>
+ <RegExpr attribute="List: Strong Text" context="#pop" minimal="true" String="&strongregex_ast;|&strongregex_und;"/>
+ <RegExpr attribute="List: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast;|&strongemphasisregex_und;"/>
+ <RegExpr attribute="List: Emphasis Text" context="#pop" minimal="true" String="&emphasisregex_ast;|&emphasisregex_und;"/>
<AnyChar attribute="List: Normal Text" context="#pop" String="*_"/>
</context>
<!-- Comments -->
<context name="comment" attribute="Comment" lineEndContext="#stay">
<StringDetect attribute="Comment" context="#pop" String="&endcomment;" endRegion="comment"/>
- <IncludeRules context="##Alerts"/>
- <IncludeRules context="##Modelines"/>
+ <IncludeRules context="##Comments"/>
</context>
<!-- Fenced Code Blocks -->
@@ -337,7 +321,7 @@
<context name="code" attribute="Code" lineEndContext="#stay"> <!-- Unknown language -->
<RegExpr attribute="Fenced Code" context="#pop" String="%1[~`]*(?=&end;)" firstNonSpace="true" dynamic="true" endRegion="code-block"/>
</context>
- <context attribute="Normal Text" lineEndContext="#stay" name="bash-code">
+ <context attribute="Normal Text" lineEndContext="#stay" name="bash-code" fallthroughContext="Command##Bash">
<IncludeRules context="code"/>
<IncludeRules context="##Bash" includeAttrib="true"/>
</context>
@@ -465,14 +449,9 @@
<!-- Common -->
<context name="inc" attribute="Normal Text" lineEndContext="#stay">
<!-- Code -->
- <RegExpr attribute="Code" String="`[^`]+`(?!`)"/>
- <RegExpr attribute="Code" minimal="true" String="`{2}[^`](?:.*[^`])?`{2}(?!`)"/>
- <RegExpr attribute="Code" minimal="true" String="`{3}[^`](?:.*[^`])?`{3}(?!`)"/>
- <RegExpr attribute="Code" minimal="true" String="`{4}[^`](?:.*[^`])?`{4}(?!`)"/>
- <RegExpr attribute="Code" minimal="true" String="`{5,}[^`](?:.*[^`])?`{5,}"/>
+ <RegExpr attribute="Code" String="`[^`]+`(?!`)|`{2}[^`](?:.*?[^`])?`{2}(?!`)|`{3}[^`](?:.*?[^`])?`{3}(?!`)|`{4}[^`](?:.*?[^`])?`{4}(?!`)|`{5,}[^`](?:.*?[^`])?`{5,}"/>
<!-- Find Fenced Code Block -->
- <RegExpr attribute="Fenced Code" context="find-lang-fenced-code" String="`{3,}(?=[^`]*$)" firstNonSpace="true" lookAhead="true" beginRegion="code-block"/>
- <RegExpr attribute="Fenced Code" context="find-lang-fenced-code" String="~{3,}(?=[^~]*$)" firstNonSpace="true" lookAhead="true" beginRegion="code-block"/>
+ <RegExpr attribute="Fenced Code" context="find-lang-fenced-code" String="`{3,}(?=[^`]*$)|~{3,}(?=[^~]*$)" firstNonSpace="true" lookAhead="true" beginRegion="code-block"/>
<!-- Comment -->
<StringDetect attribute="Comment" context="comment" String="&startcomment;" beginRegion="comment"/>
<!-- Links and References -->
@@ -508,13 +487,13 @@
<RegExpr attribute="EntityRef" String="&amp;(?:#[0-9]+|#[xX][0-9A-Fa-f]+|&htmlname;);"/>
<RegExpr context="find-html-block" String="&lt;/?&htmlname;(?:[\s&gt;]|/&gt;|$)" lookAhead="true"/>
</context>
- <context name="find-html-block" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
+ <context name="find-html-block" attribute="Normal Text" lineEndContext="#pop" fallthroughContext="#pop">
<IncludeRules context="FindSpecialHTMLTags##HTML"/>
<IncludeRules context="FindHTMLTags##HTML"/>
</context>
<!-- Links and email: <https://example.com>, <example@kde.org> -->
- <context name="autolink" attribute="Auto-Link" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
+ <context name="autolink" attribute="Auto-Link" lineEndContext="#pop" fallthroughContext="#pop">
<DetectChar attribute="Auto-Link" char="&lt;"/>
<DetectChar attribute="Auto-Link" context="#pop" char="&gt;"/>
<RegExpr attribute="Link" String="&startlink;[^&quot;&gt;\s]+"/>
@@ -552,25 +531,23 @@
<RegExpr attribute="Reference-Link: Link" String="\b&startlink;(?:\\.|[^&quot;&gt;\s\]\\])+"/>
</context>
<!-- [an example][id] "title" -->
- <context name="reflink-title" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
+ <context name="reflink-title" attribute="Normal Text" lineEndContext="#pop" fallthroughContext="#pop">
<RegExpr attribute="Reference-Link" context="#pop" String="\s+&quot;(?:\\.|[^&quot;\\])*&quot;"/>
</context>
<!-- Target Ref.: [foo]: http://example.com/ "Optional Title Here" -->
- <context name="reflinktarget" attribute="Reference-Link Target" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
+ <context name="reflinktarget" attribute="Reference-Link Target" lineEndContext="#pop" fallthroughContext="#pop">
<RegExpr attribute="Reference-Link Target: Link" context="#pop!reflinktarget-title" String="\s*&link;(?=\s|$)"/>
<RegExpr attribute="Reference-Link Target" context="#pop!reflinktarget-link" String="\s*&lt;(?=&link;&gt;(?:\s|$))"/>
<RegExpr attribute="Reference-Link Target" context="#pop!reflinktarget-title" String="\s*#[\w\.\:\-]+\b"/>
</context>
- <context name="reflinktarget-link" attribute="Reference-Link Target" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
+ <context name="reflinktarget-link" attribute="Reference-Link Target" lineEndContext="#pop" fallthroughContext="#pop">
<DetectChar attribute="Reference-Link Target" context="#pop!reflinktarget-title" char="&gt;"/>
<RegExpr attribute="Reference-Link Target: Link" String="&link;"/>
</context>
- <context name="reflinktarget-title" attribute="Reference-Link Target" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
+ <context name="reflinktarget-title" attribute="Reference-Link Target" lineEndContext="#pop" fallthroughContext="#pop">
<DetectSpaces attribute="Reference-Link Target"/>
- <RegExpr attribute="Reference-Link Target" context="#pop" String="&quot;(?:\\.|[^&quot;\\])*&quot;"/>
- <RegExpr attribute="Reference-Link Target" context="#pop" String="&apos;(?:\\.|[^&apos;\\])*&apos;"/>
- <RegExpr attribute="Reference-Link Target" context="#pop" String="\((?:\\.|[^\)\\])*\)"/>
+ <RegExpr attribute="Reference-Link Target" context="#pop" String="&quot;(?:\\.|[^&quot;\\])*&quot;|&apos;(?:\\.|[^&apos;\\])*&apos;|\((?:\\.|[^\)\\])*\)"/>
</context>
<!-- Image -->
diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/perl.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/perl.xml
index 1b5ca943be..fdf2266558 100644
--- a/src/libs/3rdparty/syntax-highlighting/data/syntax/perl.xml
+++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/perl.xml
@@ -39,7 +39,7 @@
Enhance tr/// and y/// support.
-->
-<language name="Perl" version="13" 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="17" 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>
@@ -339,7 +339,7 @@
</list>
<contexts>
<context name="normal" attribute="Normal Text" lineEndContext="#stay">
- <RegExpr attribute="Keyword" context="#stay" String="^#!\/.*" />
+ <RegExpr attribute="Keyword" context="#stay" String="^#!\/.*" column="0" />
<StringDetect attribute="Keyword" context="data_handle" String="__DATA__" firstNonSpace="true" />
<StringDetect attribute="Keyword" context="#stay" String="__END__" firstNonSpace="true"/>
<RegExpr attribute="Keyword" context="sub_name_def" String="\bsub\s+" />
@@ -347,7 +347,7 @@
<keyword attribute="Operator" context="#stay" String="operators" />
<keyword attribute="Function" context="#stay" String="functions" />
<keyword attribute="Pragma" context="#stay" String="pragmas" />
- <RegExpr attribute="Pod" context="pod" String="\=\w+(\s|$)" column="0" beginRegion="POD"/>
+ <RegExpr attribute="Pod" context="pod" String="^\=\w+(\s|$)" column="0" beginRegion="POD"/>
<DetectSpaces />
<DetectChar attribute="Comment" context="comment" char="#" />
@@ -384,8 +384,7 @@
<RegExpr attribute="Operator" context="find_pattern" String="\b(?:m|qr)(?=\s*[^\w\s\]})])" />
- <RegExpr attribute="Normal Text" context="#stay" String="[\w_]+\s*//?\=?" />
- <RegExpr attribute="Normal Text" context="#stay" String="[&lt;&gt;&quot;':]//?\=?" />
+ <RegExpr attribute="Normal Text" context="#stay" String="[\w_]+\s*//?\=?|[&lt;&gt;&quot;':]//?\=?" />
<!-- Avoid conflicts between operators / and // -->
<StringDetect attribute="Normal Text" context="#stay" String="//=" />
<Detect2Chars attribute="Normal Text" context="#stay" char="/" char1="/" />
@@ -428,15 +427,7 @@
<!-- ====== Contexts for strings ===== -->
<context name="ipstring_internal" attribute="String (interpolated)" lineEndContext="#stay">
<DetectIdentifier />
- <RegExpr attribute="String Special Character" context="#stay" String="\\c[^\s\\]" />
- <RegExpr attribute="String Special Character" context="#stay" String="\\g(\{(\w+|\-\d+)\}|\d+)" />
- <RegExpr attribute="String Special Character" context="#stay" String="\\k(\{\w+\}|&lt;\w+&gt;|'\w+')" />
- <RegExpr attribute="String Special Character" context="#stay" String="\\N\{[^\{\}]*\}" />
- <RegExpr attribute="String Special Character" context="#stay" String="\\o\{[0-7]+\}" />
- <RegExpr attribute="String Special Character" context="#stay" String="\\[pP](\{\w+\}|P)" />
- <RegExpr attribute="String Special Character" context="#stay" String="\\x([0-9a-fA-F]{2}|\{[0-9a-fA-F]+\})" />
- <RegExpr attribute="String Special Character" context="#stay" String="\\[0-7]{3}" />
- <RegExpr attribute="String Special Character" context="#stay" String="\\[1aAbBdDeEfFGhHKlLnNQrRsStuUvVwWXzZ]" />
+ <RegExpr attribute="String Special Character" context="#stay" String="\\c[^\s\\]|\\g(\{(\w+|\-\d+)\}|\d+)|\\k(\{\w+\}|&lt;\w+&gt;|'\w+')|\\N\{[^\{\}]*\}|\\o\{[0-7]+\}|\\[pP](\{\w+\}|P)|\\x([0-9a-fA-F]{2}|\{[0-9a-fA-F]+\})|\\[0-7]{3}|\\[1aAbBdDeEfFGhHKlLnNQrRsStuUvVwWXzZ]" />
<RegExpr attribute="String (interpolated)" context="#stay" String="\\." />
<RegExpr attribute="Normal Text" context="find_variable_unsafe" String="(?:[\$@]\S|%([\w\{\-\+!]|\^H))" lookAhead="true" />
</context>
@@ -465,7 +456,7 @@
<IncludeRules context="ipstring_internal" />
</context>
<context name="ip_string_6" attribute="String (interpolated)" lineEndContext="#stay" dynamic="true">
- <RegExpr attribute="String (interpolated)" context="#stay" String="\%1" dynamic="true" />
+ <StringDetect attribute="String (interpolated)" context="#stay" String="\%1" dynamic="true" />
<DetectChar attribute="Operator" context="#pop#pop#pop" char="1" dynamic="true" endRegion="String"/>
<IncludeRules context="ipstring_internal" />
</context>
@@ -508,7 +499,7 @@
<context name="string_6" attribute="String" lineEndContext="#stay" dynamic="true">
<DetectIdentifier />
<Detect2Chars attribute="String Special Character" context="#stay" char="\" char1="\" />
- <RegExpr attribute="String Special Character" context="#stay" String="\%1" dynamic="true"/>
+ <StringDetect attribute="String Special Character" context="#stay" String="\%1" dynamic="true"/>
<DetectChar attribute="Operator" context="#pop#pop" char="1" dynamic="true" endRegion="String" />
</context>
@@ -605,10 +596,7 @@
</context>
<context name="tr" attribute="Pattern" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop" >
- <RegExpr attribute="Pattern" context="#pop" String="\([^)]*\)\s*\(?:[^)]*\)" />
- <RegExpr attribute="Pattern" context="#pop" String="\{[^}]*\}\s*\{[^}]*\}" />
- <RegExpr attribute="Pattern" context="#pop" String="\[[^]]*\]\s*\[[^\]]*\]" />
- <RegExpr attribute="Pattern" context="#pop" String="([^a-zA-Z0-9_\s[\]{}()]).*\1.*\1" minimal="true"/>
+ <RegExpr attribute="Pattern" context="#pop" String="\([^)]*\)\s*\(?:[^)]*\)|\{[^}]*\}\s*\{[^}]*\}|\[[^]]*\]\s*\[[^\]]*\]|([^a-zA-Z0-9_\s[\]{}()]).*?\1.*?\1"/>
</context>
<!-- ====== PATTERNs ====== -->
@@ -629,7 +617,6 @@
<RegExpr attribute="Pattern Internal Operator" context="#stay" String="\$(?=%1)" dynamic="true" />
<RegExpr attribute="Operator" context="#pop#pop" String="%1[cgimosx]*" dynamic="true" endRegion="Pattern" />
<IncludeRules context="regex_pattern_internal_ip" />
- <RegExpr attribute="Pattern Internal Operator" context="#stay" String="\$(?=\%1)" dynamic="true" />
</context>
<context name="pattern_brace" attribute="Pattern" lineEndContext="#stay">
<RegExpr attribute="Operator" context="#pop#pop" String="\}[cgimosx]*" endRegion="Pattern" />
@@ -663,13 +650,7 @@
<!-- rules internal stuff wrt regex patterns -->
<context name="regex_pattern_internal_rules_1" attribute="Pattern" lineEndContext="#stay">
<DetectChar attribute="Comment" context="comment" char="#" firstNonSpace="true" />
- <RegExpr attribute="Special Variable" context="#stay" String="\\c[^\s\\]" />
- <RegExpr attribute="Special Variable" context="#stay" String="\\g(\{(\w+|\-\d+)\}|\d+)" />
- <RegExpr attribute="Special Variable" context="#stay" String="\\k(\{\w+\}|&lt;\w+&gt;|'\w+')" />
- <RegExpr attribute="Special Variable" context="#stay" String="\\N\{[^\{\}]*\}" />
- <RegExpr attribute="Special Variable" context="#stay" String="\\o\{[0-7]+\}" />
- <RegExpr attribute="Special Variable" context="#stay" String="\\[pP](\{\w+\}|P)" />
- <RegExpr attribute="Special Variable" context="#stay" String="\\x([0-9a-fA-F]{2}|\{[0-9a-fA-F]+\})" />
+ <RegExpr attribute="Special Variable" context="#stay" String="\\c[^\s\\]|\\g(\{(\w+|\-\d+)\}|\d+)|\\k(\{\w+\}|&lt;\w+&gt;|'\w+')|\\N\{[^\{\}]*\}|\\o\{[0-7]+\}|\\[pP](\{\w+\}|P)|\\x([0-9a-fA-F]{2}|\{[0-9a-fA-F]+\})" />
<RegExpr attribute="Pattern Character Class" context="#stay" String="\\[anDdSsWw]" />
<RegExpr attribute="Pattern Internal Operator" context="#stay" String="\\[ABbEGLlNUuQdQZz]" /> <!-- Also?: efFhHKrRtvVX -->
<RegExpr attribute="Special Variable" context="#stay" String="\\[\d]+" />
@@ -713,17 +694,10 @@
<!-- ====== Variables ====== -->
<context name="find_variable" attribute="Data Type" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop" >
<RegExpr attribute="Data Type" context="var_detect" String="\$[#_][\w_]" />
- <RegExpr attribute="Special Variable" context="var_detect" String="\$[0-9]+" />
- <RegExpr attribute="Special Variable" context="var_detect" String="[@\$](?:[\+\-_]\B|ARGV\b|INC\b)" />
- <RegExpr attribute="Special Variable" context="var_detect" String="[%\$](?:INC\b|ENV\b|SIG\b)" />
- <RegExpr attribute="Special Variable" context="var_detect" String="\$\^[A-Z_\]\[\^\?\\]" />
- <RegExpr attribute="Special Variable" context="var_detect" String="%([\-\+!]|\^H)" />
- <RegExpr attribute="Data Type" context="var_detect" String="\$\$[\$\w_]" />
- <RegExpr attribute="Data Type" context="var_detect" String="\$+::" />
+ <RegExpr attribute="Special Variable" context="var_detect" String="\$[0-9]+|[@\$](?:[\+\-_]\B|ARGV\b|INC\b)|[%\$](?:INC\b|ENV\b|SIG\b)|\$\^[A-Z_\]\[\^\?\\]|%([\-\+!]|\^H)" />
+ <RegExpr attribute="Data Type" context="var_detect" String="\$\$[\$\w_]|\$+::" />
<RegExpr attribute="Special Variable" context="var_detect" String="\$[^a-zA-Z0-9\s{][A-Z]?" />
- <RegExpr attribute="Data Type" context="var_detect" String="[\$@%]\{\^?[\w_]+\}" />
- <AnyChar attribute="Data Type" context="var_detect" String="$@%" />
- <RegExpr attribute="Data Type" context="var_detect" String="\*[a-zA-Z_]+" />
+ <RegExpr attribute="Data Type" context="var_detect" String="[\$@%]\{\^?[\w_]+\}|[$@%]|\*[a-zA-Z_]+" />
<!-- Do not highlight brackets after *, Ex: (... @*) (see bug #391577) -->
<RegExpr attribute="Special Variable" context="#stay" String="\*[^a-zA-Z0-9\s\{\(\)\[\]\}][A-Z]?" />
<!-- this should be a rare case! -->
@@ -732,17 +706,11 @@
<!-- This does not check fo a trailing slash, for usage in strings. -->
<context name="find_variable_unsafe" attribute="Data Type" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop" >
<RegExpr attribute="Data Type" context="var_detect_unsafe" String="\$[#_][\w_]" />
- <RegExpr attribute="Special Variable" context="var_detect_unsafe" String="\$[0-9]+" />
- <RegExpr attribute="Special Variable" context="var_detect_unsafe" String="[@\$](?:[\+\-_]\B|ARGV\b|INC\b)" />
- <RegExpr attribute="Special Variable" context="var_detect_unsafe" String="[%\$](?:INC\b|ENV\b|SIG\b)" />
- <RegExpr attribute="Special Variable" context="var_detect" String="\$\^[A-Z_\]\[\^\?\\]" />
- <RegExpr attribute="Special Variable" context="var_detect" String="%([\-\+!]|\^H)" />
- <RegExpr attribute="Data Type" context="var_detect_unsafe" String="\$\$[\$\w_]" />
- <RegExpr attribute="Data Type" context="var_detect_unsafe" String="\$+::" />
+ <RegExpr attribute="Special Variable" context="var_detect_unsafe" String="\$[0-9]+|[@\$](?:[\+\-_]\B|ARGV\b|INC\b)|[%\$](?:INC\b|ENV\b|SIG\b)" />
+ <RegExpr attribute="Special Variable" context="var_detect" String="\$\^[A-Z_\]\[\^\?\\]|%([\-\+!]|\^H)" />
+ <RegExpr attribute="Data Type" context="var_detect_unsafe" String="\$\$[\$\w_]|\$+::" />
<RegExpr attribute="Special Variable" context="#stay" String="\$[^a-zA-Z0-9\s{][A-Z]?" />
- <RegExpr attribute="Data Type" context="var_detect_unsafe" String="[\$@%]\{\^?[\w_]+\}" />
- <AnyChar attribute="Data Type" context="var_detect_unsafe" String="$@%" />
- <RegExpr attribute="Data Type" context="var_detect_unsafe" String="\*\w+" />
+ <RegExpr attribute="Data Type" context="var_detect_unsafe" String="[\$@%]\{\^?[\w_]+\}|[$@%]|\*\w+" />
<AnyChar attribute="Operator" context="#pop" String="$@%*" />
</context>
<context name="var_detect" attribute="Data Type" lineEndContext="#pop#pop" fallthrough="true" fallthroughContext="#pop#pop">
@@ -767,7 +735,7 @@
<context name="quote_word" attribute="Normal Text" lineEndContext="#stay" dynamic="true">
<DetectSpaces />
<DetectIdentifier />
- <RegExpr attribute="Normal Text" context="#stay" String="\\%1" dynamic="true" />
+ <StringDetect attribute="Normal Text" context="#stay" String="\%1" dynamic="true" />
<DetectChar attribute="Operator" context="#pop#pop#pop" char="1" dynamic="true" endRegion="Wordlist" />
</context>
<context name="quote_word_paren" attribute="Normal Text" lineEndContext="#stay">
@@ -791,26 +759,24 @@
<!-- ====== Here Documents ====== -->
<context name="find_here_document" attribute="Normal Text" lineEndContext="#pop" >
- <RegExpr attribute="Keyword" context="here_document" String="(\w+)\s*;?" />
- <RegExpr attribute="Keyword" context="here_document" String="\s*&quot;([^&quot;]+)&quot;\s*;?" />
- <RegExpr attribute="Keyword" context="here_document" String="\s*`([^`]+)`\s*;?" />
+ <RegExpr attribute="Keyword" context="here_document" String="(?|(\w+)\s*;?|\s*&quot;([^&quot;]+)&quot;\s*;?|\s*`([^`]+)`\s*;?)" />
<RegExpr attribute="Keyword" context="here_document_dumb" String="\s*'([^']+)'\s*;?" />
</context>
<context name="here_document" attribute="String (interpolated)" lineEndContext="#stay" dynamic="true">
- <RegExpr attribute="Keyword" context="#pop#pop" String="%1\b" column="0" dynamic="true" endRegion="HereDocument"/>
+ <RegExpr attribute="Keyword" context="#pop#pop" String="^%1\b" column="0" dynamic="true" endRegion="HereDocument"/>
<RegExpr attribute="Keyword" context="here_document" String="\=\s*&lt;&lt;\s*[&quot;']?([A-Z0-9_\-]+)[&quot;']?" beginRegion="HEREDoc" />
<IncludeRules context="ipstring_internal" />
<DetectSpaces />
</context>
<context name="here_document_dumb" attribute="Normal Text" lineEndContext="#stay" dynamic="true">
- <RegExpr attribute="Keyword" context="#pop#pop" String="%1" column="0" dynamic="true" endRegion="HereDocument"/>
+ <StringDetect attribute="Keyword" context="#pop#pop" String="%1" column="0" dynamic="true" endRegion="HereDocument"/>
<DetectSpaces />
<DetectIdentifier />
</context>
<!-- ====== Misc ====== -->
<context name="data_handle" attribute="Data" lineEndContext="#stay">
- <RegExpr attribute="Pod" context="pod" String="\=(?:head[1-6]|over|back|item|for|begin|end|pod)\s+.*" column="0" beginRegion="POD"/>
+ <RegExpr attribute="Pod" context="pod" String="^\=(?:head[1-6]|over|back|item|for|begin|end|pod)\s+.*" column="0" beginRegion="POD"/>
<StringDetect attribute="Keyword" context="normal" String="__END__" firstNonSpace="true" />
</context>
@@ -841,14 +807,13 @@
<context name="pod" attribute="Pod" lineEndContext="#stay">
<DetectSpaces />
<DetectIdentifier />
- <RegExpr attribute="Pod" context="#stay" String="\=(?:head[1-6]|over|back|item|for|begin|end|pod)\s*.*" column="0" beginRegion="POD" endRegion="POD"/>
+ <RegExpr attribute="Pod" context="#stay" String="^\=(?:head[1-6]|over|back|item|for|begin|end|pod)\s*.*" column="0" beginRegion="POD" endRegion="POD"/>
<StringDetect attribute="Pod" context="Pod" String="=cut" column="0" endRegion="POD"/>
</context>
<context name="comment" attribute="Comment" lineEndContext="#pop">
<DetectSpaces />
- <IncludeRules context="##Alerts" />
- <IncludeRules context="##Modelines" />
+ <IncludeRules context="##Comments" />
<DetectIdentifier />
</context>
diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/powershell.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/powershell.xml
index 29ec21e286..7754c6cf34 100644
--- a/src/libs/3rdparty/syntax-highlighting/data/syntax/powershell.xml
+++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/powershell.xml
@@ -1,9 +1,9 @@
<!DOCTYPE language SYSTEM "language.dtd">
<language
name="PowerShell"
- version="7"
+ version="11"
kateversion="5.0"
- extensions="*.ps1;*.ps1m;*.ps1d"
+ extensions="*.ps1;*.psm1;*.psd1"
section="Scripts"
author="Motoki Kashihara (motoki8791@gmail.com); Michael Lombardi (Michael.T.Lombardi@outlook.com)"
casesensitive="0"
@@ -884,16 +884,14 @@
<Detect2Chars attribute="Comment" context="Commentar 2" char="&lt;" char1="#" beginRegion="CommentRegion"/>
<DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="block1"/>
<DetectChar attribute="Symbol" context="#stay" char="}" endRegion="block1"/>
- <RegExpr attribute="Keyword" context="#stay" String="\b\$global(?=\s+(:))"/>
- <RegExpr attribute="Keyword" context="#stay" String="\b\$script(?=\s+(:))"/>
+ <RegExpr attribute="Keyword" context="#stay" String="\b\$(global|script)(?=\s+(:))"/>
<RegExpr attribute="Variable" context="#stay" String="\$+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*" />
<keyword attribute="Special Variable" context="#stay" String="special-variables"/>
<DetectChar attribute="Symbol" context="Member" char="." />
<AnyChar attribute="Symbol" context="#stay" String=":!%&amp;()+,-/*&lt;=&gt;?[]|~^&#59;"/>
</context>
<context attribute="String Char" lineEndContext="#stay" name="StringEscape">
- <RegExpr attribute="String Char" String="`[`&quot;0abefnrtv]" context="#stay"/>
- <RegExpr attribute="String Char" String="`u\{[0-9A-Fa-f]+\}" context="#stay"/>
+ <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"/>
@@ -908,14 +906,12 @@
</context>
<context attribute="Comment" lineEndContext="#pop" name="Commentar 1">
<DetectSpaces />
- <IncludeRules context="##Alerts"/>
- <IncludeRules context="##Modelines"/>
+ <IncludeRules context="##Comments"/>
</context>
<context attribute="Comment" lineEndContext="#stay" name="Commentar 2">
<DetectSpaces />
<Detect2Chars attribute="Comment" context="#pop" char="#" char1="&gt;" endRegion="CommentRegion"/>
- <IncludeRules context="##Alerts"/>
- <IncludeRules context="##Modelines"/>
+ <IncludeRules context="##Comments"/>
</context>
<context attribute="Cmdlets" lineEndContext="#stay" name="Cmdlet">
<keyword attribute="Function" context="#stay" String="cmdlets"/>
@@ -931,7 +927,7 @@
<itemData name="HereString" defStyleNum="dsVerbatimString"/>
<itemData name="Comment" defStyleNum="dsComment"/>
<itemData name="Cmdlets" defStyleNum="dsBuiltIn" spellChecking="false"/>
- <itemData name="Symbol" defStyleNum="dsNormal" 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"/>
</itemDatas>
diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/python.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/python.xml
index 2cdde881c9..f1c89a54e4 100644
--- a/src/libs/3rdparty/syntax-highlighting/data/syntax/python.xml
+++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/python.xml
@@ -4,6 +4,35 @@
<!ENTITY digitPart "[0-9](?:_?[0-9])*">
<!ENTITY beforeDigit "(?&lt;![\.\w[:^ascii:]])">
<!ENTITY beforePointFloat "(?&lt;![\w[:^ascii:]])">
+
+ <!-- Python 2 style. Syntax:
+ 1. start character '%'
+ 2. [optional] Mapping key, e.g. '(foo)'
+ 3. [optional] Conversion flags, one of '#0- +'
+ 4. [optional] Minimum width, integer or '*'
+ 5. [optional] Precision, '.' followed by integer or '*'
+ 6. [optional] Length modifier, one of 'hlL'
+ 7. conversion type, one of 'crsdiouxXeEfFgG%'
+ [Special cases: %prog and %default - see http://docs.python.org/library/optparse.html]
+ -->
+ <!ENTITY strsubstitution_py2 "&#37;(?:(?:\([a-zA-Z0-9_]+\))?[#0\- +]?(?:[1-9][0-9]*|\*)?(?:\.(?:[1-9][0-9]*|\*))?[hlL]?[crsdiouxXeEfFgG&#37;]|prog|default)">
+ <!-- http://docs.python.org/2/library/string.html#format-string-syntax:
+ replacement_field ::= "{" [field_name] ["!" conversion] [":" format_spec] "}"
+ field_name ::= arg_name ("." attribute_name | "[" element_index "]")*
+ arg_name ::= [identifier | integer]
+ attribute_name ::= identifier
+ element_index ::= integer | index_string
+ index_string ::= <any source character except "]"> +
+ conversion ::= "r" | "s"
+ format_spec ::= [[fill]align][sign][#][0][width][,][.precision][type]
+ fill ::= <any character>
+ align ::= "<" | ">" | "=" | "^"
+ sign ::= "+" | "-" | " "
+ width ::= integer
+ precision ::= integer
+ type ::= "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "s" | "x" | "X" | "%"
+ -->
+ <!ENTITY strsubstitution_py3 "\{(?:(?:[a-zA-Z0-9_]+|[0-9]+)(?:\.[a-zA-Z0-9_]+|\[[^ \]]+\])*)?(?:![rs])?(?::(?:[^}]?[&lt;&gt;=^])?[ +-]?#?0?[0-9]*(?:\.[0-9]+)?[bcdeEfFgGnosxX&#37;]?)?\}">
]>
<!-- Python syntax highlightning v0.9 by Per Wigren -->
<!-- Python syntax highlighting v1.9 by Michael Bueker (improved keyword differentiation) -->
@@ -19,7 +48,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="12" 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="14" style="python" indenter="python" kateversion="5.0" section="Scripts" extensions="*.py;*.pyw;SConstruct;SConscript;*.FCMacro" mimetype="application/x-python;text/x-python;text/x-python3" casesensitive="1" author="Michael Bueker" license="">
<highlighting>
<list name="import">
<item>import</item>
@@ -355,8 +384,7 @@
<RegExpr attribute="Binary" String="&beforeDigit;0[bB](?:_?[01])+\b" context="#stay"/>
<RegExpr attribute="Octal" String="&beforeDigit;0[oO](?:_?[0-7])+\b" context="#stay"/>
<!-- Float: 1.1 ; 1. ; .1 ; 1e3 ; 1.1e3 ; 1.e3 ; .1e3 -->
- <RegExpr attribute="Float" String="(?:&beforeDigit;&digitPart;(?:\.(?:&digitPart;)?)?|&beforePointFloat;\.&digitPart;)[eE][\+\-]?&digitPart;\b" context="#stay"/>
- <RegExpr attribute="Float" String="(?:&beforeDigit;&digitPart;\.(?:&digitPart;\b)?|&beforePointFloat;\.&digitPart;\b)" context="#stay"/>
+ <RegExpr attribute="Float" String="(?:&beforeDigit;&digitPart;(?:\.(?:&digitPart;)?)?|&beforePointFloat;\.&digitPart;)[eE][\+\-]?&digitPart;\b|(?:&beforeDigit;&digitPart;\.(?:&digitPart;\b)?|&beforePointFloat;\.&digitPart;\b)" context="#stay"/>
<!-- Decimal: 123 ; 000 -->
<RegExpr attribute="Int" String="&beforeDigit;(?:[1-9](?:_?\d)*|0(?:_?0)*)[lL]?\b" context="#stay"/>
@@ -393,20 +421,20 @@
<RegExpr attribute="String" String="u?'" insensitive="true" context="Single A-string"/>
<RegExpr attribute="String" String="u?&quot;" insensitive="true" context="Single Q-string"/>
- <RegExpr attribute="Raw String" String="(u?r|ru)'''" insensitive="true" context="Raw Triple A-string" beginRegion="Triple A-region"/>
- <RegExpr attribute="Raw String" String="(u?r|ru)&quot;&quot;&quot;" insensitive="true" context="Raw Triple Q-string" beginRegion="Triple Q-region"/>
- <RegExpr attribute="Raw String" String="(u?r|ru)'" insensitive="true" context="Raw A-string"/>
- <RegExpr attribute="Raw String" String="(u?r|ru)&quot;" insensitive="true" context="Raw Q-string"/>
+ <RegExpr attribute="Raw String" String="(?:u?r|ru)'''" insensitive="true" context="Raw Triple A-string" beginRegion="Triple A-region"/>
+ <RegExpr attribute="Raw String" String="(?:u?r|ru)&quot;&quot;&quot;" insensitive="true" context="Raw Triple Q-string" beginRegion="Triple Q-region"/>
+ <RegExpr attribute="Raw String" String="(?:u?r|ru)'" insensitive="true" context="Raw A-string"/>
+ <RegExpr attribute="Raw String" String="(?:u?r|ru)&quot;" insensitive="true" context="Raw Q-string"/>
<StringDetect attribute="F-String" String="f'''" insensitive="true" context="Triple A-F-String" beginRegion="Triple A-region"/>
<StringDetect attribute="F-String" String="f&quot;&quot;&quot;" insensitive="true" context="Triple Q-F-String" beginRegion="Triple Q-region"/>
<StringDetect attribute="F-String" String="f'" insensitive="true" context="Single A-F-String"/>
<StringDetect attribute="F-String" String="f&quot;" insensitive="true" context="Single Q-F-String"/>
- <RegExpr attribute="Raw F-String" String="(fr|rf)'''" insensitive="true" context="Raw Triple A-F-String" beginRegion="Triple A-region"/>
- <RegExpr attribute="Raw F-String" String="(fr|rf)&quot;&quot;&quot;" insensitive="true" context="Raw Triple Q-F-String" beginRegion="Triple Q-region"/>
- <RegExpr attribute="Raw F-String" String="(fr|rf)'" insensitive="true" context="Raw A-F-String"/>
- <RegExpr attribute="Raw F-String" String="(fr|rf)&quot;" insensitive="true" context="Raw Q-F-String"/>
+ <RegExpr attribute="Raw F-String" String="(?:fr|rf)'''" insensitive="true" context="Raw Triple A-F-String" beginRegion="Triple A-region"/>
+ <RegExpr attribute="Raw F-String" String="(?:fr|rf)&quot;&quot;&quot;" insensitive="true" context="Raw Triple Q-F-String" beginRegion="Triple Q-region"/>
+ <RegExpr attribute="Raw F-String" String="(?:fr|rf)'" insensitive="true" context="Raw A-F-String"/>
+ <RegExpr attribute="Raw F-String" String="(?:fr|rf)&quot;" insensitive="true" context="Raw Q-F-String"/>
</context>
<context name="CommentVariants" attribute="Normal Text" lineEndContext="#stay">
@@ -417,10 +445,10 @@
<RegExpr attribute="Comment" String="u?'" insensitive="true" firstNonSpace="true" context="Single A-comment"/>
<RegExpr attribute="Comment" String="u?&quot;" insensitive="true" firstNonSpace="true" context="Single Q-comment"/>
- <RegExpr attribute="Comment" String="(u?r|ru)'''" insensitive="true" firstNonSpace="true" context="Triple A-comment" beginRegion="Triple A-region"/>
- <RegExpr attribute="Comment" String="(u?r|ru)&quot;&quot;&quot;" insensitive="true" firstNonSpace="true" context="Triple Q-comment" beginRegion="Triple Q-region"/>
- <RegExpr attribute="Comment" String="(u?r|ru)'" insensitive="true" firstNonSpace="true" context="Single A-comment"/>
- <RegExpr attribute="Comment" String="(u?r|ru)&quot;" insensitive="true" firstNonSpace="true" context="Single Q-comment"/>
+ <RegExpr attribute="Comment" String="(?:u?r|ru)'''" insensitive="true" firstNonSpace="true" context="Triple A-comment" beginRegion="Triple A-region"/>
+ <RegExpr attribute="Comment" String="(?:u?r|ru)&quot;&quot;&quot;" insensitive="true" firstNonSpace="true" context="Triple Q-comment" beginRegion="Triple Q-region"/>
+ <RegExpr attribute="Comment" String="(?:u?r|ru)'" insensitive="true" firstNonSpace="true" context="Single A-comment"/>
+ <RegExpr attribute="Comment" String="(?:u?r|ru)&quot;" insensitive="true" firstNonSpace="true" context="Single Q-comment"/>
</context>
<context name="Dictionary" attribute="Normal Text" lineEndContext="#stay" noIndentationBasedFolding="true">
@@ -448,66 +476,38 @@
<context name="Hash comment" attribute="Comment" lineEndContext="#pop">
<DetectSpaces />
- <IncludeRules context="##Alerts" />
- <IncludeRules context="##Modelines" />
+ <IncludeRules context="##Comments" />
</context>
<context name="Triple A-comment" attribute="Comment" lineEndContext="#stay" noIndentationBasedFolding="true">
<IncludeRules context="stringescape"/>
<StringDetect attribute="Comment" String="'''" context="#pop" endRegion="Triple A-region"/>
- <IncludeRules context="##Alerts" />
+ <IncludeRules context="##Comments" />
</context>
<context name="Triple Q-comment" attribute="Comment" lineEndContext="#stay" noIndentationBasedFolding="true">
<IncludeRules context="stringescape"/>
<StringDetect attribute="Comment" String="&quot;&quot;&quot;" context="#pop" endRegion="Triple Q-region"/>
- <IncludeRules context="##Alerts" />
+ <IncludeRules context="##Comments" />
</context>
<context name="Single A-comment" attribute="Comment" lineEndContext="#stay">
<IncludeRules context="stringescape"/>
<DetectChar attribute="Comment" char="'" context="#pop"/>
- <IncludeRules context="##Alerts" />
+ <IncludeRules context="##Comments" />
</context>
<context name="Single Q-comment" attribute="Comment" lineEndContext="#stay">
<IncludeRules context="stringescape"/>
<DetectChar attribute="Comment" char="&quot;" context="#pop"/>
- <IncludeRules context="##Alerts" />
+ <IncludeRules context="##Comments" />
</context>
<!-- Strings -->
<!-- format characters -->
<context name="stringformat" attribute="String Substitution" lineEndContext="#stay">
- <!-- Python 2 style. Syntax:
- 1. start character '%'
- 2. [optional] Mapping key, e.g. '(foo)'
- 3. [optional] Conversion flags, one of '#0- +'
- 4. [optional] Minimum width, integer or '*'
- 5. [optional] Precision, '.' followed by integer or '*'
- 6. [optional] Length modifier, one of 'hlL'
- 7. conversion type, one of 'crsdiouxXeEfFgG%'
- [Special cases: %prog and %default - see http://docs.python.org/library/optparse.html]
- -->
- <RegExpr attribute="String Substitution" String="%((\([a-zA-Z0-9_]+\))?[#0\- +]?([1-9][0-9]*|\*)?(\.([1-9][0-9]*|\*))?[hlL]?[crsdiouxXeEfFgG%]|prog|default)" context="#stay"/>
- <!-- http://docs.python.org/2/library/string.html#format-string-syntax:
- replacement_field ::= "{" [field_name] ["!" conversion] [":" format_spec] "}"
- field_name ::= arg_name ("." attribute_name | "[" element_index "]")*
- arg_name ::= [identifier | integer]
- attribute_name ::= identifier
- element_index ::= integer | index_string
- index_string ::= <any source character except "]"> +
- conversion ::= "r" | "s"
- format_spec ::= [[fill]align][sign][#][0][width][,][.precision][type]
- fill ::= <any character>
- align ::= "<" | ">" | "=" | "^"
- sign ::= "+" | "-" | " "
- width ::= integer
- precision ::= integer
- type ::= "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "s" | "x" | "X" | "%"
- -->
- <RegExpr attribute="String Substitution" String="\{(([a-zA-Z0-9_]+|[0-9]+)(\.[a-zA-Z0-9_]+|\[[^ \]]+\])*)?(![rs])?(:([^}]?[&lt;&gt;=^])?[ +-]?#?0?[0-9]*(\.[0-9]+)?[bcdeEfFgGnosxX%]?)?\}" context="#stay"/>
+ <RegExpr attribute="String Substitution" String="&strsubstitution_py2;|&strsubstitution_py3;" context="#stay"/>
<Detect2Chars attribute="String Substitution" char="{" char1="{" context="#stay" />
<Detect2Chars attribute="String Substitution" char="}" char1="}" context="#stay" />
</context>
@@ -517,12 +517,7 @@
<!-- As this highlighting style is for both, Python 2 and 3,
we do not know if a normal string is “unicode” or not. So we
-->
- <RegExpr attribute="String Char" String="\\[\\'&quot;abfnrtv]" context="#stay"/>
- <RegExpr attribute="String Char" String="\\[0-7]{1,3}" context="#stay"/>
- <RegExpr attribute="String Char" String="\\x[0-9A-Fa-f]{2}" context="#stay"/>
- <RegExpr attribute="String Char" String="\\u[0-9A-Fa-f]{4}" context="#stay"/>
- <RegExpr attribute="String Char" String="\\U[0-9A-Fa-f]{8}" context="#stay"/>
- <RegExpr attribute="String Char" String="\\N\{[a-zA-Z0-9\- ]+\}" context="#stay"/>
+ <RegExpr attribute="String Char" String="\\[\\'&quot;abfnrtv]|\\[0-7]{1,3}|\\x[0-9A-Fa-f]{2}|\\u[0-9A-Fa-f]{4}|\\U[0-9A-Fa-f]{8}|\\N\{[a-zA-Z0-9\- ]+\}" context="#stay"/>
</context>
<!-- f-literals -->
@@ -532,7 +527,7 @@
</context>
<context name="String Interpolation" attribute="String Substitution" lineEndContext="#stay">
<DetectChar attribute="Error" char="\" context="#pop"/>
- <RegExpr attribute="String Substitution" String="(![rs])?(:([^}]?[&lt;&gt;=^])?[ +-]?#?0?[0-9]*(\.[0-9]+)?[bcdeEfFgGnosxX%]?)?\}" context="#pop"/>
+ <RegExpr attribute="String Substitution" String="(?:![rs])?(?::(?:[^}]?[&lt;&gt;=^])?[ +-]?#?0?[0-9]*(?:\.[0-9]+)?[bcdeEfFgGnosxX%]?)?\}" context="#pop"/>
<IncludeRules context="Normal"/> <!-- TODO: create expression context instead -->
</context>
@@ -552,50 +547,50 @@
<context name="Triple A-string" attribute="String" lineEndContext="#stay" noIndentationBasedFolding="true">
<IncludeRules context="stringescape"/>
<IncludeRules context="stringformat"/>
- <StringDetect attribute="String" String="'''" context="#pop#CheckForString" endRegion="Triple A-region"/>
+ <StringDetect attribute="String" String="'''" context="#pop!#CheckForString" endRegion="Triple A-region"/>
</context>
<context name="Raw Triple A-string" attribute="Raw String" lineEndContext="#stay" noIndentationBasedFolding="true">
<HlCStringChar attribute="Raw String" context="#stay"/>
<IncludeRules context="stringformat"/>
- <StringDetect attribute="Raw String" String="'''" context="#pop#CheckForString" endRegion="Triple A-region"/>
+ <StringDetect attribute="Raw String" String="'''" context="#pop!#CheckForString" endRegion="Triple A-region"/>
</context>
<context name="Triple A-F-String" attribute="F-String" lineEndContext="#stay" noIndentationBasedFolding="true">
<IncludeRules context="stringescape"/>
<IncludeRules context="stringinterpolation"/>
- <StringDetect attribute="F-String" String="'''" context="#pop#CheckForString" endRegion="Triple A-region"/>
+ <StringDetect attribute="F-String" String="'''" context="#pop!#CheckForString" endRegion="Triple A-region"/>
</context>
<context name="Raw Triple A-F-String" attribute="Raw F-String" lineEndContext="#stay" noIndentationBasedFolding="true">
<HlCStringChar attribute="Raw F-String" context="#stay"/>
<IncludeRules context="stringinterpolation"/>
- <StringDetect attribute="Raw F-String" String="'''" context="#pop#CheckForString" endRegion="Triple A-region"/>
+ <StringDetect attribute="Raw F-String" String="'''" context="#pop!#CheckForString" endRegion="Triple A-region"/>
</context>
<!-- Triple-quoted Q-strings -->
<context name="Triple Q-string" attribute="String" lineEndContext="#stay" noIndentationBasedFolding="true">
<IncludeRules context="stringescape"/>
<IncludeRules context="stringformat"/>
- <StringDetect attribute="String" String="&quot;&quot;&quot;" context="#pop#CheckForString" endRegion="Triple Q-region"/>
+ <StringDetect attribute="String" String="&quot;&quot;&quot;" context="#pop!#CheckForString" endRegion="Triple Q-region"/>
</context>
<context name="Raw Triple Q-string" attribute="Raw String" lineEndContext="#stay" noIndentationBasedFolding="true">
<HlCStringChar attribute="Raw String" context="#stay"/>
<IncludeRules context="stringformat"/>
- <StringDetect attribute="Raw String" String="&quot;&quot;&quot;" context="#pop#CheckForString" endRegion="Triple Q-region"/>
+ <StringDetect attribute="Raw String" String="&quot;&quot;&quot;" context="#pop!#CheckForString" endRegion="Triple Q-region"/>
</context>
<context name="Triple Q-F-String" attribute="F-String" lineEndContext="#stay" noIndentationBasedFolding="true">
<IncludeRules context="stringescape"/>
<IncludeRules context="stringinterpolation"/>
- <StringDetect attribute="F-String" String="&quot;&quot;&quot;" context="#pop#CheckForString" endRegion="Triple Q-region"/>
+ <StringDetect attribute="F-String" String="&quot;&quot;&quot;" context="#pop!#CheckForString" endRegion="Triple Q-region"/>
</context>
<context name="Raw Triple Q-F-String" attribute="Raw F-String" lineEndContext="#stay" noIndentationBasedFolding="true">
<HlCStringChar attribute="Raw F-String" context="#stay"/>
<IncludeRules context="stringinterpolation"/>
- <StringDetect attribute="Raw F-String" String="&quot;&quot;&quot;" context="#pop#CheckForString" endRegion="Triple Q-region"/>
+ <StringDetect attribute="Raw F-String" String="&quot;&quot;&quot;" context="#pop!#CheckForString" endRegion="Triple Q-region"/>
</context>
@@ -603,50 +598,50 @@
<context name="Single A-string" attribute="String" lineEndContext="#stay">
<IncludeRules context="stringescape"/>
<IncludeRules context="stringformat"/>
- <DetectChar attribute="String" char="'" context="#pop#CheckForString"/>
+ <DetectChar attribute="String" char="'" context="#pop!#CheckForString"/>
</context>
<context name="Raw A-string" attribute="Raw String" lineEndContext="#stay">
<HlCStringChar attribute="Raw String" context="#stay"/>
<IncludeRules context="stringformat"/>
- <DetectChar attribute="Raw String" char="'" context="#pop#CheckForString"/>
+ <DetectChar attribute="Raw String" char="'" context="#pop!#CheckForString"/>
</context>
<context name="Single A-F-String" attribute="F-String" lineEndContext="#stay">
<IncludeRules context="stringescape"/>
<IncludeRules context="stringinterpolation"/>
- <DetectChar attribute="F-String" char="'" context="#pop#CheckForString"/>
+ <DetectChar attribute="F-String" char="'" context="#pop!#CheckForString"/>
</context>
<context name="Raw A-F-String" attribute="Raw F-String" lineEndContext="#stay">
<HlCStringChar attribute="Raw F-String" context="#stay"/>
<IncludeRules context="stringinterpolation"/>
- <DetectChar attribute="Raw F-String" char="'" context="#pop#CheckForString"/>
+ <DetectChar attribute="Raw F-String" char="'" context="#pop!#CheckForString"/>
</context>
<!-- Single-quoted Q-strings -->
<context name="Single Q-string" attribute="String" lineEndContext="#stay">
<IncludeRules context="stringescape"/>
<IncludeRules context="stringformat"/>
- <DetectChar attribute="String" char="&quot;" context="#pop#CheckForString"/>
+ <DetectChar attribute="String" char="&quot;" context="#pop!#CheckForString"/>
</context>
<context name="Raw Q-string" attribute="Raw String" lineEndContext="#stay">
<HlCStringChar attribute="Raw String" context="#stay"/>
<IncludeRules context="stringformat"/>
- <DetectChar attribute="Raw String" char="&quot;" context="#pop#CheckForString"/>
+ <DetectChar attribute="Raw String" char="&quot;" context="#pop!#CheckForString"/>
</context>
<context name="Single Q-F-String" attribute="F-String" lineEndContext="#stay">
<IncludeRules context="stringescape"/>
<IncludeRules context="stringinterpolation"/>
- <DetectChar attribute="F-String" char="&quot;" context="#pop#CheckForString"/>
+ <DetectChar attribute="F-String" char="&quot;" context="#pop!#CheckForString"/>
</context>
<context name="Raw Q-F-String" attribute="Raw F-String" lineEndContext="#stay">
<HlCStringChar attribute="Raw F-String" context="#stay"/>
<IncludeRules context="stringinterpolation"/>
- <DetectChar attribute="Raw F-String" char="&quot;" context="#pop#CheckForString"/>
+ <DetectChar attribute="Raw F-String" char="&quot;" context="#pop!#CheckForString"/>
</context>
</contexts>
diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/qdocconf.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/qdocconf.xml
index 4504016d0a..b735ca9f4a 100644
--- a/src/libs/3rdparty/syntax-highlighting/data/syntax/qdocconf.xml
+++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/qdocconf.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<language name="QDoc Configuration"
- version="2"
+ version="3"
kateversion="5.0"
section="Configuration"
extensions="*.qdocconf"
@@ -113,8 +113,7 @@
<context name="comment-context" attribute="Comment" lineEndContext="#pop">
<DetectSpaces />
- <IncludeRules context="##Alerts"/>
- <IncludeRules context="##Modelines"/>
+ <IncludeRules context="##Comments"/>
</context>
</contexts>
diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/ruby.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/ruby.xml
index a6d44b4246..dc6444e747 100644
--- a/src/libs/3rdparty/syntax-highlighting/data/syntax/ruby.xml
+++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/ruby.xml
@@ -31,7 +31,7 @@
<!-- Hold the "language" opening tag on a single line, as mentioned in "language.dtd". -->
<language name="Ruby" section="Scripts"
- version="12" kateversion="3.3"
+ version="16" kateversion="5.0"
extensions="*.rb;*.rjs;*.rxml;*.xml.erb;*.js.erb;*.rake;Rakefile;Gemfile;*.gemspec;Vagrantfile"
mimetype="application/x-ruby"
style="ruby" indenter="ruby"
@@ -191,19 +191,17 @@
<LineContinue attribute="Normal Text" context="Line Continue"/>
<!-- __END__ token on own line. -->
- <RegExpr attribute="Keyword" String="__END__$" context="DATA" column="0"/>
+ <RegExpr attribute="Keyword" String="^__END__$" context="DATA" column="0"/>
<!-- "shebang" line -->
- <RegExpr attribute="Keyword" String="#!\/.*" context="#stay" column="0"/>
+ <RegExpr attribute="Keyword" String="^#!\/.*" context="#stay" column="0"/>
<!-- "def" - "end" blocks -->
<!-- check for statement modifiers with regexes -->
<DetectChar attribute="Operator" char="{" context="Find closing block brace" beginRegion="def block"/>
- <RegExpr attribute="Keyword" String="(\=|\(|\[|\{)\s*(if|unless|while|until)\b" context="#stay" beginRegion="def block"/>
- <RegExpr attribute="Keyword" String="(while|until)\b(?!.*\bdo\b)" context="#stay" beginRegion="def block" />
- <RegExpr attribute="Keyword" String="\;\s*(while|until)\b(?!.*\bdo\b)" context="#stay" beginRegion="def block"/>
+ <DetectChar attribute="Delimiter" char="}" context="check_div_1" endRegion="def block"/>
+ <RegExpr attribute="Keyword" String="[=([]\s*(if|unless|while|until)\b|(while|until)\b(?!.*\bdo\b)|\;\s*(while|until)\b(?!.*\bdo\b)|\;\s*(if|unless)\b" context="#stay" beginRegion="def block"/>
<RegExpr attribute="Keyword" String="(if|unless)\b" context="#stay" beginRegion="def block" firstNonSpace="true"/>
- <RegExpr attribute="Keyword" String="\;\s*(if|unless)\b" context="#stay" beginRegion="def block"/>
<WordDetect attribute="Keyword" String="class" context="no_heredoc" beginRegion="def block"/>
<WordDetect attribute="Keyword" String="module" context="#stay" beginRegion="def block"/>
<WordDetect attribute="Keyword" String="begin" context="#stay" beginRegion="def block"/>
@@ -236,8 +234,7 @@
<!-- (global) vars starting with $
Match them before $_.
-->
- <RegExpr attribute="Global Variable" String="\$[a-zA-Z_0-9]+" context="check_div_1"/>
- <RegExpr attribute="Global Variable" String="\$\-[a-zA-Z_]\b" context="check_div_1"/>
+ <RegExpr attribute="Global Variable" String="\$[a-zA-Z_0-9]+|\$\-[a-zA-Z_]\b" context="check_div_1"/>
<!-- special-character globals -->
<RegExpr attribute="Default globals" String="\$[\d_*`+@;,.~=\!\$:?'/\\\-\&amp;&quot;&gt;&lt;]" context="check_div_1"/>
<RegExpr attribute="Global Constant" String="\b[_A-Z]+[A-Z_0-9]+\b" context="check_div_2"/>
@@ -269,21 +266,16 @@
<DetectChar attribute="Operator" char="." context="#stay"/>
<Detect2Chars attribute="Operator" char="&amp;" char1="&amp;" context="#stay"/>
<Detect2Chars attribute="Operator" char="|" char1="|" context="#stay"/>
- <RegExpr attribute="Operator" String="\s[\?\:\%]\s" context="#stay"/>
- <RegExpr attribute="Operator" String="[|&amp;&lt;&gt;\^\+*~\-=]+" context="#stay"/>
- <!-- regexp hack -->
- <RegExpr attribute="Operator" String="\s!" context="#stay"/>
- <RegExpr attribute="Operator" String="/=\s" context="#stay" insensitive="0"/>
+ <!-- \s! is regexp hack -->
+ <RegExpr attribute="Operator" String="\s[\?\:\%]\s|[|&amp;&lt;&gt;\^\+*~\-=]+|\s!|/=\s" context="#stay"/>
<Detect2Chars attribute="Operator" char="%" char1="=" context="#stay"/>
<Detect2Chars attribute="Operator" char=":" char1=":" context="Member Access"/>
- <RegExpr attribute="Symbol" String=":(@{1,2}|\$)?[a-zA-Z_][a-zA-Z0-9_]*[=?!]?" context="check_div_1"/>
- <RegExpr attribute="Symbol" String=":\[\]=?" context="check_div_1"/>
+ <RegExpr attribute="Symbol" String=":(@{1,2}|\$)?[a-zA-Z_][a-zA-Z0-9_]*[=?!]?|:\[\]=?" context="check_div_1"/>
<!-- Do not send to "check_div_1" context!:
after detecting these rules (": ") there can be a regular expression (see bug: #361875) -->
- <RegExpr attribute="Symbol" String="(@{1,2}|\$)?[a-zA-Z_][a-zA-Z0-9_]*[=?!]?: " context="#stay"/>
- <RegExpr attribute="Symbol" String="\[\]=?: " context="#stay"/>
+ <RegExpr attribute="Symbol" String="(@{1,2}|\$)?[a-zA-Z_][a-zA-Z0-9_]*[=?!]?: |\[\]=?: " context="#stay"/>
<DetectChar attribute="String" char="&quot;" context="Quoted String"/>
<DetectChar attribute="Raw String" char="'" context="Apostrophed String"/>
@@ -291,14 +283,12 @@
<Detect2Chars attribute="Normal Text" char="?" char1="#" context="#stay"/>
- <RegExpr attribute="Comment" String="#\s*BEGIN.*$" context="#stay" beginRegion="marker" column="0"/>
- <RegExpr attribute="Comment" String="#\s*END.*$" context="#stay" endRegion="marker" column="0"/>
+ <RegExpr attribute="Comment" String="^#\s*BEGIN.*$" context="#stay" beginRegion="marker" column="0"/>
+ <RegExpr attribute="Comment" String="^#\s*END.*$" context="#stay" endRegion="marker" column="0"/>
<DetectChar attribute="Comment" char="#" context="General Comment"/>
<DetectChar attribute="Delimiter" char="[" context="#stay"/>
<DetectChar attribute="Delimiter" char="]" context="check_div_1"/>
- <DetectChar attribute="Delimiter" char="{" context="#stay" beginRegion="def block"/>
- <DetectChar attribute="Delimiter" char="}" context="check_div_1" endRegion="def block"/>
<RegExpr attribute="Instance Variable" String="@[a-zA-Z_0-9]+" context="check_div_1"/>
<RegExpr attribute="Class Variable" String="@@[a-zA-Z_0-9]+" context="check_div_1"/>
@@ -320,20 +310,20 @@
<!-- A slash is always a division operator, even if preceeded by whitespace -->
<context name="check_div_1" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop" lineEndContext="#pop">
- <RegExpr attribute="Normal Text" String="\s*" context="#stay"/>
+ <DetectSpaces attribute="Normal Text" context="#stay"/>
<AnyChar attribute="Operator" String="/%" context="#pop"/>
</context>
<!-- Same as check_div_1, but with double pop to exit the surrounding context -->
<context name="check_div_1_pop" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop#pop" lineEndContext="#pop#pop">
- <RegExpr attribute="Normal Text" String="\s*" context="#stay"/>
+ <DetectSpaces attribute="Normal Text" context="#stay"/>
<AnyChar attribute="Operator" String="/%" context="#pop#pop"/>
</context>
<!-- A slash is division operator if it's the first character, or if preceeded and followed by whitespace -->
<context name="check_div_2" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop" lineEndContext="#pop">
<AnyChar attribute="Operator" String="/%" context="#pop"/>
- <RegExpr attribute="Normal Text" String="\s+" context="check_div_2_internal"/>
+ <DetectSpaces attribute="Normal Text" context="check_div_2_internal"/>
</context>
<!-- Internal context used by check_div_2 -->
@@ -345,7 +335,7 @@
<!-- Same as check_div_2, but with double pop to exit the surrounding context -->
<context name="check_div_2_pop" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop#pop" lineEndContext="#pop#pop">
<AnyChar attribute="Operator" String="/%" context="#pop#pop"/>
- <RegExpr attribute="Normal Text" String="\s+" context="check_div_2_pop_internal"/>
+ <DetectSpaces attribute="Normal Text" context="check_div_2_pop_internal"/>
</context>
<!-- Internal context used by check_div_2_pop -->
@@ -355,8 +345,7 @@
</context>
<context name="Line Continue" attribute="Normal Text" lineEndContext="#pop">
- <RegExpr attribute="Keyword" String="(while|until)\b(?!.*\bdo\b)" context="#stay" firstNonSpace="true"/>
- <RegExpr attribute="Keyword" String="(if|unless)\b" context="#stay" firstNonSpace="true"/>
+ <RegExpr attribute="Keyword" String="(while|until)\b(?!.*\bdo\b)|(if|unless)\b" context="#stay" firstNonSpace="true"/>
<IncludeRules context="Normal"/>
</context>
@@ -390,7 +379,7 @@
<context name="Embedded documentation" attribute="Blockcomment" lineEndContext="#stay">
<RegExpr attribute="Comment" String="^=end(?:\s.*|$)" context="#pop" endRegion="comment block" column="0"/>
<DetectSpaces />
- <IncludeRules context="##Alerts" />
+ <IncludeRules context="##Comments" />
</context>
<context name="RegEx 1" attribute="Regular Expression" lineEndContext="#stay">
@@ -433,8 +422,7 @@
<context name="General Comment" attribute="Comment" lineEndContext="#pop">
<DetectSpaces />
- <IncludeRules context="##Alerts" />
- <IncludeRules context="##Modelines" />
+ <IncludeRules context="##Comments" />
</context>
<!-- HEREDOC support
@@ -443,15 +431,11 @@
<!-- here we markup the heredoc markers -->
<context name="find_heredoc" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
<RegExpr attribute="Keyword" context="apostrophed_normal_heredoc" String="'(\w+)'" />
- <RegExpr attribute="Keyword" context="normal_heredoc" String="(\w+)" />
- <RegExpr attribute="Keyword" context="normal_heredoc" String="&quot;(\w+)&quot;" />
- <RegExpr attribute="Keyword" context="normal_heredoc" String="`(\w+)`" />
+ <RegExpr attribute="Keyword" context="normal_heredoc" String="(?|(\w+)|&quot;(\w+)&quot;|`(\w+)`)" />
</context>
<context name="find_indented_heredoc" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
<RegExpr attribute="Keyword" context="apostrophed_indented_heredoc" String="'(\w+)'" />
- <RegExpr attribute="Keyword" context="indented_heredoc" String="(\w+)" />
- <RegExpr attribute="Keyword" context="indented_heredoc" String="&quot;(\w+)&quot;" />
- <RegExpr attribute="Keyword" context="indented_heredoc" String="`(\w+)`" />
+ <RegExpr attribute="Keyword" context="indented_heredoc" String="(?|(\w+)|&quot;(\w+)&quot;|`(\w+)`)" />
</context>
<!-- these are the real heredoc contexts -->
<context name="indented_heredoc" attribute="Here Document" lineEndContext="#stay" dynamic="true">
@@ -463,11 +447,11 @@
</context>
<context name="normal_heredoc" attribute="Here Document" lineEndContext="#stay" dynamic="true">
- <RegExpr attribute="Keyword" context="#pop#pop" String="%1$" dynamic="true" endRegion="HereDocument" column="0"/>
+ <RegExpr attribute="Keyword" context="#pop#pop" String="^%1$" dynamic="true" endRegion="HereDocument" column="0"/>
<IncludeRules context="heredoc_rules" />
</context>
<context name="apostrophed_normal_heredoc" attribute="Here Document" lineEndContext="#stay" dynamic="true">
- <RegExpr attribute="Keyword" context="#pop#pop" String="%1$" dynamic="true" endRegion="HereDocument" column="0"/>
+ <RegExpr attribute="Keyword" context="#pop#pop" String="^%1$" dynamic="true" endRegion="HereDocument" column="0"/>
</context>
<!-- rules for heredoc types -->
@@ -481,8 +465,8 @@
<DetectSpaces />
<Detect2Chars attribute="Operator" char="&lt;" char1="&lt;" context="#pop"/>
<!-- comments -->
- <RegExpr attribute="Comment" String="#\s*BEGIN.*$" context="#stay" beginRegion="marker" column="0"/>
- <RegExpr attribute="Comment" String="#\s*END.*$" context="#stay" endRegion="marker" column="0"/>
+ <RegExpr attribute="Comment" String="^#\s*BEGIN.*$" context="#stay" beginRegion="marker" column="0"/>
+ <RegExpr attribute="Comment" String="^#\s*END.*$" context="#stay" endRegion="marker" column="0"/>
<DetectChar attribute="Comment" char="#" context="General Comment"/>
</context>
@@ -602,7 +586,7 @@
-->
<context name="gdl_dq_string_5" attribute="String" lineEndContext="#stay" dynamic="true">
<IncludeRules context="dq_string_rules" />
- <RegExpr attribute="String" String="\\%1" context="#stay" dynamic="true" />
+ <StringDetect attribute="String" String="\%1" context="#stay" dynamic="true" />
<RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1" dynamic="true" endRegion="GdlInput" />
</context>
<!-- rules to be included in all dq_string contexts -->
@@ -667,7 +651,7 @@
-->
<context name="gdl_token_array_5" attribute="String" lineEndContext="#stay" dynamic="true">
<IncludeRules context="token_array_rules" />
- <RegExpr attribute="String" String="\\%1" context="#stay" dynamic="true"/>
+ <StringDetect attribute="String" String="\%1" context="#stay" dynamic="true"/>
<RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1" dynamic="true" endRegion="GdlInput" />
</context>
@@ -731,7 +715,7 @@
-->
<context name="gdl_apostrophed_5" attribute="Raw String" lineEndContext="#stay" dynamic="true">
<IncludeRules context="apostrophed_rules" />
- <RegExpr attribute="Raw String" String="\\%1" context="#stay" dynamic="true"/>
+ <StringDetect attribute="Raw String" String="\%1" context="#stay" dynamic="true"/>
<RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1" dynamic="true" endRegion="GdlInput" />
</context>
@@ -795,7 +779,7 @@
-->
<context name="gdl_shell_command_5" attribute="Command" lineEndContext="#stay" dynamic="true">
<IncludeRules context="shell_command_rules" />
- <RegExpr attribute="Command" String="\\%1" context="#stay" dynamic="true" />
+ <StringDetect attribute="Command" String="\%1" context="#stay" dynamic="true" />
<RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1" dynamic="true" endRegion="GdlInput" />
</context>
@@ -861,7 +845,7 @@
-->
<context name="gdl_regexpr_5" attribute="Regular Expression" lineEndContext="#stay" dynamic="true">
<IncludeRules context="regexpr_rules" />
- <RegExpr attribute="Regular Expression" String="\\%1" context="#stay" dynamic="true" />
+ <StringDetect attribute="Regular Expression" String="\%1" context="#stay" dynamic="true" />
<RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1[uiomxn]*" dynamic="true" endRegion="GdlInput" />
</context>
diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/valgrind-suppression.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/valgrind-suppression.xml
index d30fc77582..46d8c646f7 100644
--- a/src/libs/3rdparty/syntax-highlighting/data/syntax/valgrind-suppression.xml
+++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/valgrind-suppression.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
-<language name="Valgrind Suppression" section="Other" extensions="*.supp;" mimetype="" version="3" kateversion="2.4" author="Milian Wolff (mail@milianw.de)" license="LGPL">
+<language name="Valgrind Suppression" section="Other" extensions="*.supp;" mimetype="" version="4" kateversion="5.0" author="Milian Wolff (mail@milianw.de)" license="LGPL">
<highlighting>
<contexts>
<context name="File" attribute="Normal Text" lineEndContext="#stay">
@@ -9,7 +9,7 @@
</context>
<context name="Rule" attribute="Normal Text" lineEndContext="#stay" >
- <RegExpr attribute="RuleName" String="^[^\}]+$" context="Rule2" />
+ <RegExpr attribute="RuleName" String="^[^\}]+$" context="Rule2" column="0" />
<DetectChar char="}" attribute="Normal Text" context="#pop" firstNonSpace="true" />
</context>
@@ -25,8 +25,7 @@
<context name="Comment" attribute="Comment" lineEndContext="#pop">
<DetectSpaces />
- <IncludeRules context="##Alerts" />
- <IncludeRules context="##Modelines" />
+ <IncludeRules context="##Comments" />
<DetectIdentifier />
</context>
</contexts>
diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/xml.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/xml.xml
index bb88366c86..fbefcb6dad 100644
--- a/src/libs/3rdparty/syntax-highlighting/data/syntax/xml.xml
+++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/xml.xml
@@ -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="10" kateversion="3.4" section="Markup" extensions="*.docbook;*.xml;*.rc;*.daml;*.rdf;*.rss;*.xspf;*.xsd;*.svg;*.ui;*.kcfg;*.qrc;*.wsdl;*.scxml;*.xbel;*.dae;*.sch;*.brd" mimetype="text/xml;text/book;text/daml;text/rdf;application/rss+xml;application/xspf+xml;image/svg+xml;application/x-designer;application/x-xbel;application/xml;application/scxml+xml" casesensitive="1" indenter="xml" author="Wilbert Berendsen (wilbert@kde.nl)" license="LGPL">
+<language name="XML" version="12" 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">
<highlighting>
<contexts>
@@ -17,10 +17,10 @@
<context name="FindXML" attribute="Normal Text" lineEndContext="#stay">
<DetectSpaces />
<StringDetect attribute="Comment" context="Comment" String="&lt;!--" beginRegion="comment" />
- <StringDetect attribute="CDATA" context="CDATA" String="&lt;![CDATA[" beginRegion="cdata" />
- <RegExpr attribute="Doctype" context="Doctype" String="&lt;!DOCTYPE\s+" beginRegion="doctype" />
- <RegExpr attribute="Processing Instruction" context="PI" String="&lt;\?[\w:_-]*" beginRegion="pi" />
- <RegExpr attribute="Element" context="Element" String="&lt;&name;" beginRegion="element" />
+ <StringDetect attribute="CDATA" context="CDATAStart" String="&lt;![CDATA[" lookAhead="true" />
+ <RegExpr attribute="Doctype Symbols" context="DoctypeTagName" String="&lt;!(?=DOCTYPE\s+)" beginRegion="doctype" />
+ <IncludeRules context="FindProcessingInstruction" />
+ <RegExpr attribute="Element Symbols" context="ElementTagName" String="&lt;(?=(&name;))" beginRegion="element" />
<IncludeRules context="FindEntityRefs" />
<DetectIdentifier />
</context>
@@ -41,37 +41,67 @@
<DetectSpaces />
<StringDetect attribute="Comment" context="#pop" String="--&gt;" endRegion="comment" />
<RegExpr attribute="Error" context="#stay" String="-(?:\-(?!-&gt;))+" />
- <IncludeRules context="##Alerts" />
- <IncludeRules context="##Modelines" />
+ <IncludeRules context="##Comments" />
<DetectIdentifier />
</context>
+ <context name="CDATAStart" attribute="Other Text" lineEndContext="#pop">
+ <StringDetect attribute="CDATA Symbols" context="#stay" String="&lt;![" beginRegion="cdata" />
+ <StringDetect attribute="CDATA" context="#stay" String="CDATA" />
+ <DetectChar attribute="CDATA Symbols" context="#pop!CDATA" char="[" />
+ </context>
<context name="CDATA" attribute="Other Text" lineEndContext="#stay">
<DetectSpaces />
<DetectIdentifier />
- <StringDetect attribute="CDATA" context="#pop" String="]]&gt;" endRegion="cdata" />
+ <StringDetect attribute="CDATA Symbols" context="#pop" String="]]&gt;" endRegion="cdata" />
<StringDetect attribute="EntityRef" context="#stay" String="]]&amp;gt;" />
</context>
+ <context name="FindProcessingInstruction" attribute="Other Text" lineEndContext="#stay">
+ <RegExpr attribute="PI Symbols" context="PI TagName" String="&lt;\?(?=([\w:_-]*))" beginRegion="pi" />
+ </context>
+ <context name="PI TagName" attribute="Other Text" lineEndContext="#pop!PI" fallthrough="true" fallthroughContext="#pop!PI">
+ <RegExpr attribute="Processing Instruction" context="#pop!PI-XML" String="xml(?=\s|$)" insensitive="true" />
+ <StringDetect attribute="Processing Instruction" context="#pop!PI" String="%1" dynamic="true" />
+ </context>
<context name="PI" attribute="Other Text" lineEndContext="#stay">
- <Detect2Chars attribute="Processing Instruction" context="#pop" char="?" char1="&gt;" endRegion="pi" />
+ <Detect2Chars attribute="PI Symbols" context="#pop" char="?" char1="&gt;" endRegion="pi" />
+ </context>
+ <context name="PI-XML" attribute="Other Text" lineEndContext="#stay">
+ <IncludeRules context="PI" />
+ <RegExpr attribute="Attribute" context="#stay" String="(?:^|\s+)&name;" />
+ <DetectChar attribute="Attribute" context="Value" char="=" />
</context>
+ <context name="DoctypeTagName" attribute="Other Text" lineEndContext="#pop">
+ <StringDetect attribute="Doctype" context="#pop!DoctypeVariableName" String="DOCTYPE" />
+ </context>
+ <context name="DoctypeVariableName" attribute="Other Text" lineEndContext="#pop!Doctype" fallthrough="true" fallthroughContext="#pop!Doctype">
+ <DetectSpaces />
+ <RegExpr attribute="Doctype Name" context="#pop!Doctype" String="&name;" />
+ </context>
<context name="Doctype" attribute="Other Text" lineEndContext="#stay">
- <DetectChar attribute="Doctype" context="#pop" char="&gt;" endRegion="doctype" />
- <DetectChar attribute="Doctype" context="Doctype Internal Subset" char="[" beginRegion="int_subset" />
+ <DetectChar attribute="Doctype Symbols" context="#pop" char="&gt;" endRegion="doctype" />
+ <DetectChar attribute="Doctype Symbols" context="Doctype Internal Subset" char="[" beginRegion="int_subset" />
</context>
<context name="Doctype Internal Subset" attribute="Other Text" lineEndContext="#stay">
- <DetectChar attribute="Doctype" context="#pop" char="]" endRegion="int_subset" />
- <RegExpr attribute="Doctype" context="Doctype Markupdecl" String="&lt;!(?:ELEMENT|ENTITY|ATTLIST|NOTATION)\b" />
+ <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" />
- <RegExpr attribute="Processing Instruction" context="PI" String="&lt;\?[\w:_-]*" beginRegion="pi" />
+ <IncludeRules context="FindProcessingInstruction" />
<IncludeRules context="FindPEntityRefs" />
</context>
+ <context name="Doctype Markupdecl TagName" attribute="Other Text" lineEndContext="#pop">
+ <StringDetect attribute="Doctype" context="#pop!Doctype Markupdecl VariableName" String="%1" dynamic="true" />
+ </context>
+ <context name="Doctype Markupdecl VariableName" attribute="Other Text" lineEndContext="#pop!Doctype Markupdecl" fallthrough="true" fallthroughContext="#pop!Doctype Markupdecl">
+ <DetectSpaces />
+ <RegExpr attribute="Doctype Name" context="#pop!Doctype Markupdecl" String="&name;" />
+ </context>
<context name="Doctype Markupdecl" attribute="Other Text" lineEndContext="#stay">
- <DetectChar attribute="Doctype" context="#pop" char="&gt;" />
+ <DetectChar attribute="Doctype Symbols" context="#pop" char="&gt;" />
<DetectChar attribute="Value" context="Doctype Markupdecl DQ" char="&quot;" />
<DetectChar attribute="Value" context="Doctype Markupdecl SQ" char="&apos;" />
</context>
@@ -86,25 +116,31 @@
<IncludeRules context="FindPEntityRefs" />
</context>
+ <context name="ElementTagName" attribute="Other Text" lineEndContext="#pop!Element" fallthrough="true" fallthroughContext="#pop!Element">
+ <StringDetect attribute="Element" context="#pop!Element" String="%1" dynamic="true" />
+ </context>
<context name="Element" attribute="Other Text" lineEndContext="#stay">
- <Detect2Chars attribute="Element" context="#pop" char="/" char1="&gt;" endRegion="element" />
- <DetectChar attribute="Element" context="El Content" char="&gt;" />
+ <Detect2Chars attribute="Element Symbols" context="#pop" char="/" char1="&gt;" endRegion="element" />
+ <DetectChar attribute="Element Symbols" context="El Content" char="&gt;" />
<RegExpr attribute="Attribute" context="Attribute" String="(?:^|\s+)&name;" />
<RegExpr attribute="Error" context="#stay" String="\S" />
</context>
<context name="El Content" attribute="Other Text" lineEndContext="#stay">
- <RegExpr attribute="Element" context="El End" String="&lt;/&name;" />
+ <RegExpr attribute="Element Symbols" context="El End TagName" String="&lt;/(?=(&name;))" />
<IncludeRules context="FindXML" />
</context>
+ <context name="El End TagName" attribute="Other Text" lineEndContext="#pop!El End" fallthrough="true" fallthroughContext="#pop!El End">
+ <StringDetect attribute="Element" context="#pop!El End" String="%1" dynamic="true" />
+ </context>
<context name="El End" attribute="Other Text" lineEndContext="#stay">
- <DetectChar attribute="Element" context="#pop#pop#pop" char="&gt;" endRegion="element" />
+ <DetectChar attribute="Element Symbols" context="#pop#pop#pop" char="&gt;" endRegion="element" />
<RegExpr attribute="Error" context="#stay" String="\S" />
</context>
<context name="Attribute" attribute="Other Text" lineEndContext="#stay">
- <DetectChar attribute="Attribute" context="Value" char="=" />
+ <DetectChar attribute="Attribute" context="#pop!Value" char="=" />
<RegExpr attribute="Error" context="#stay" String="\S" />
</context>
@@ -115,29 +151,34 @@
</context>
<context name="Value DQ" attribute="Value" lineEndContext="#stay">
- <DetectChar attribute="Value" context="#pop#pop#pop" char="&quot;" />
+ <DetectChar attribute="Value" context="#pop#pop" char="&quot;" />
<IncludeRules context="FindEntityRefs" />
</context>
<context name="Value SQ" attribute="Value" lineEndContext="#stay">
- <DetectChar attribute="Value" context="#pop#pop#pop" char="&apos;" />
+ <DetectChar attribute="Value" context="#pop#pop" char="&apos;" />
<IncludeRules context="FindEntityRefs" />
</context>
</contexts>
<itemDatas>
- <itemData name="Normal Text" defStyleNum="dsNormal" />
- <itemData name="Other Text" defStyleNum="dsNormal" />
- <itemData name="Comment" defStyleNum="dsComment" spellChecking="false" />
- <itemData name="CDATA" defStyleNum="dsBaseN" bold="1" spellChecking="false" />
- <itemData name="Processing Instruction" defStyleNum="dsKeyword" spellChecking="false" />
- <itemData name="Doctype" defStyleNum="dsDataType" bold="1" spellChecking="false" />
- <itemData name="Element" defStyleNum="dsKeyword" spellChecking="false" />
- <itemData name="Attribute" defStyleNum="dsOthers" spellChecking="false" />
- <itemData name="Value" defStyleNum="dsString" spellChecking="false" />
- <itemData name="EntityRef" defStyleNum="dsDecVal" spellChecking="false" />
- <itemData name="PEntityRef" defStyleNum="dsDecVal" spellChecking="false" />
- <itemData name="Error" defStyleNum="dsError" spellChecking="false" />
+ <itemData name="Normal Text" defStyleNum="dsNormal" />
+ <itemData name="Other Text" defStyleNum="dsNormal" />
+ <itemData name="Comment" defStyleNum="dsComment" spellChecking="false" />
+ <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" />
+ <itemData name="PI Symbols" defStyleNum="dsFunction" bold="0" italic="0" spellChecking="false" />
+ <itemData name="Doctype" defStyleNum="dsDataType" bold="1" italic="0" spellChecking="false" />
+ <itemData name="Doctype Name" defStyleNum="dsDataType" bold="0" italic="0" spellChecking="false" />
+ <itemData name="Doctype Symbols" defStyleNum="dsDataType" bold="0" italic="0" spellChecking="false" />
+ <itemData name="Element" defStyleNum="dsKeyword" spellChecking="false" />
+ <itemData name="Element Symbols" defStyleNum="dsNormal" spellChecking="false" />
+ <itemData name="Attribute" defStyleNum="dsOthers" spellChecking="false" />
+ <itemData name="Value" defStyleNum="dsString" spellChecking="false" />
+ <itemData name="EntityRef" defStyleNum="dsDecVal" spellChecking="false" />
+ <itemData name="PEntityRef" defStyleNum="dsDecVal" spellChecking="false" />
+ <itemData name="Error" defStyleNum="dsError" spellChecking="false" />
</itemDatas>
</highlighting>
diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/yacc.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/yacc.xml
index 996d36df62..478dc396d8 100644
--- a/src/libs/3rdparty/syntax-highlighting/data/syntax/yacc.xml
+++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/yacc.xml
@@ -32,7 +32,7 @@ This code is released under the LGPL as part of kdelibs/kate.
========================================================================
-->
-<language name="Yacc/Bison" version="7" 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.0" section="Sources" extensions="*.y;*.yy;*.ypp;*.y++" mimetype="text/x-yacc;text/x-bison" priority="5" author="Jan Villat (jan.villat@net2000.ch)" license="LGPL">
<highlighting>
<contexts>
@@ -139,9 +139,9 @@ This code is released under the LGPL as part of kdelibs/kate.
<WordDetect attribute="Directive" context="#stay" String="%merge" />
<!-- Finish rule without the ';' character (see the 'rhses.1' rule in the 'src/parse-gram.y' file, from the Bison source) -->
- <RegExpr attribute="Open Rule" context="#pop" String="[\w\-\.](?=[\w\-\.]*:)" column="0" endRegion="rule" />
+ <RegExpr attribute="Open Rule" context="#pop" String="^[\w\-\.](?=[\w\-\.]*:)" column="0" endRegion="rule" />
<Detect2Chars attribute="Content-Type Delimiter" context="#pop" char="%" char1="%" lookAhead="true" firstNonSpace="true" endRegion="rule" />
- <RegExpr attribute="Directive" context="#pop" String="%(?:union|code|destructor|printer|start|(?:no\-)?default\-prec|nterm|token|type|left|right|nonassoc|precedence)\b" lookAhead="true" column="0" endRegion="rule" />
+ <RegExpr attribute="Directive" context="#pop" String="^%(?:union|code|destructor|printer|start|(?:no\-)?default\-prec|nterm|token|type|left|right|nonassoc|precedence)\b" lookAhead="true" column="0" endRegion="rule" />
</context>
<!-- 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). -->
@@ -201,13 +201,11 @@ This code is released under the LGPL as part of kdelibs/kate.
<context name="CommentStar" attribute="Comment" lineEndContext="#stay">
<DetectSpaces />
<Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="comment" />
- <IncludeRules context="##Alerts" />
- <IncludeRules context="##Modelines" />
+ <IncludeRules context="##Comments" />
</context>
<context name="CommentSlash" attribute="Comment" lineEndContext="#pop">
<DetectSpaces />
- <IncludeRules context="##Alerts" />
- <IncludeRules context="##Modelines" />
+ <IncludeRules context="##Comments" />
</context>
<context name="StringOrChar" attribute="Normal Text" lineEndContext="#stay">
diff --git a/src/libs/3rdparty/syntax-highlighting/data/themes/atom-one-dark.theme b/src/libs/3rdparty/syntax-highlighting/data/themes/atom-one-dark.theme
new file mode 100644
index 0000000000..dcd9511402
--- /dev/null
+++ b/src/libs/3rdparty/syntax-highlighting/data/themes/atom-one-dark.theme
@@ -0,0 +1,352 @@
+{
+ "custom-styles": {
+ "Go": {
+ "Predeclared Identifier": {
+ "selected-text-color": "#d19a66",
+ "text-color": "#d19a66"
+ }
+ },
+ "INI Files": {
+ "Assignment": {
+ "selected-text-color": "#abb2bf",
+ "text-color": "#abb2bf"
+ },
+ "Section": {
+ "selected-text-color": "#56b6c2",
+ "text-color": "#56b6c2"
+ }
+ },
+ "JavaScript": {
+ "Built-in Objects": {
+ "selected-text-color": "#d19a66",
+ "text-color": "#d19a66"
+ },
+ "Function Declaration": {
+ "selected-text-color": "#56b6c2",
+ "text-color": "#56b6c2"
+ },
+ "Function Name": {
+ "selected-text-color": "#56b6c2",
+ "text-color": "#56b6c2"
+ },
+ "Module": {
+ "selected-text-color": "#c678dd",
+ "text-color": "#c678dd"
+ },
+ "Object Member": {
+ "selected-text-color": "#e06c75",
+ "text-color": "#e06c75"
+ },
+ "Object Method (Built-in)": {
+ "selected-text-color": "#56b6c2",
+ "text-color": "#56b6c2"
+ }
+ },
+ "Markdown": {
+ "Code": {
+ "selected-text-color": "#d19a66",
+ "text-color": "#d19a66"
+ },
+ "Emphasis Text": {
+ "selected-text-color": "#c678dd",
+ "text-color": "#c678dd"
+ },
+ "Fenced Code": {
+ "selected-text-color": "#d19a66",
+ "text-color": "#d19a66"
+ },
+ "Header H1": {
+ "selected-text-color": "#e06c75",
+ "text-color": "#e06c75"
+ },
+ "Header H2": {
+ "selected-text-color": "#e06c75",
+ "text-color": "#e06c75"
+ },
+ "Header H3": {
+ "selected-text-color": "#e06c75",
+ "text-color": "#e06c75"
+ },
+ "Header H4": {
+ "selected-text-color": "#e06c75",
+ "text-color": "#e06c75"
+ },
+ "Header H5": {
+ "selected-text-color": "#e06c75",
+ "text-color": "#e06c75"
+ },
+ "Header H6": {
+ "selected-text-color": "#e06c75",
+ "text-color": "#e06c75"
+ },
+ "Link": {
+ "selected-text-color": "#c678dd",
+ "text-color": "#c678dd"
+ },
+ "Reference-Link Name": {
+ "selected-text-color": "#56b6c2",
+ "text-color": "#56b6c2"
+ },
+ "Reference-Link Target": {
+ "selected-text-color": "#56b6c2",
+ "text-color": "#56b6c2"
+ },
+ "Reference-Link Target: Link": {
+ "selected-text-color": "#c678dd",
+ "text-color": "#c678dd"
+ },
+ "Reference-Link: Email": {
+ "selected-text-color": "#c678dd",
+ "text-color": "#c678dd"
+ },
+ "Reference-Link: Link": {
+ "selected-text-color": "#c678dd",
+ "text-color": "#c678dd"
+ },
+ "Strong Text": {
+ "selected-text-color": "#d19a66",
+ "text-color": "#d19a66"
+ }
+ },
+ "Python": {
+ "Builtin Function": {
+ "selected-text-color": "#56b6c2",
+ "text-color": "#56b6c2"
+ },
+ "String Substitution": {
+ "selected-text-color": "#d19a66",
+ "text-color": "#d19a66"
+ }
+ },
+ "Rust": {
+ "Lifetime": {
+ "selected-text-color": "#d19a66",
+ "text-color": "#d19a66"
+ },
+ "Macro": {
+ "selected-text-color": "#56b6c2",
+ "text-color": "#56b6c2"
+ },
+ "Self": {
+ "selected-text-color": "#e06c75",
+ "text-color": "#e06c75"
+ },
+ "Trait": {
+ "selected-text-color": "#d19a66",
+ "text-color": "#d19a66"
+ },
+ "Type": {
+ "selected-text-color": "#56b6c2",
+ "text-color": "#56b6c2"
+ }
+ },
+ "TypeScript": {
+ "Built-in Objects": {
+ "selected-text-color": "#d19a66",
+ "text-color": "#d19a66"
+ },
+ "Module": {
+ "selected-text-color": "#c678dd",
+ "text-color": "#c678dd"
+ },
+ "Object Member": {
+ "selected-text-color": "#e06c75",
+ "text-color": "#e06c75"
+ },
+ "Object Method (Built-in)": {
+ "italic": false,
+ "selected-text-color": "#56b6c2",
+ "text-color": "#56b6c2"
+ },
+ "Reserved": {
+ "italic": false
+ },
+ "Types": {
+ "selected-text-color": "#56b6c2",
+ "text-color": "#56b6c2"
+ }
+ },
+ "XML": {
+ "Attribute": {
+ "selected-text-color": "#d19a66",
+ "text-color": "#d19a66"
+ },
+ "Element": {
+ "selected-text-color": "#e06c75",
+ "text-color": "#e06c75"
+ }
+ }
+ },
+ "editor-colors": {
+ "BackgroundColor": "#282c34",
+ "BracketMatching": "#8e44ad",
+ "CodeFolding": "#363c4a",
+ "CurrentLine": "#0A99BBFF",
+ "CurrentLineNumber": "#abb2bf",
+ "IconBorder": "#282c34",
+ "IndentationLine": "#3a3f44",
+ "LineNumbers": "#636D83",
+ "MarkBookmark": "#0404bf",
+ "MarkBreakpointActive": "#8b0607",
+ "MarkBreakpointDisabled": "#820683",
+ "MarkBreakpointReached": "#6d6e07",
+ "MarkError": "#c24038",
+ "MarkExecution": "#4d4e50",
+ "MarkWarning": "#d19a66",
+ "ModifiedLines": "#e06c75",
+ "ReplaceHighlight": "#a34f56",
+ "SavedLines": "#98c379",
+ "SearchHighlight": "#3D528BFF",
+ "Separator": "#3f4347",
+ "SpellChecking": "#c24038",
+ "TabMarker": "#21252B",
+ "TemplateBackground": "#31363b",
+ "TemplateFocusedPlaceholder": "#123723",
+ "TemplatePlaceholder": "#123723",
+ "TemplateReadOnlyPlaceholder": "#4d1f24",
+ "TextSelection": "#363c4a",
+ "WordWrapMarker": "#3a3f44"
+ },
+ "metadata": {
+ "copyright": [
+ "SPDX-FileCopyrightText: 2016 GitHub Inc.",
+ "SPDX-FileCopyrightText: 2020 Waqar Ahmed <waqar.17a@gmail.com>"
+ ],
+ "license": "SPDX-License-Identifier: MIT",
+ "name": "Atom One Dark",
+ "revision": 2
+ },
+ "text-styles": {
+ "Alert": {
+ "background-color": "#4d1f24",
+ "bold": true,
+ "selected-text-color": "#95da4c",
+ "text-color": "#95da4c"
+ },
+ "Annotation": {
+ "selected-text-color": "#98c379",
+ "text-color": "#98c379"
+ },
+ "Attribute": {
+ "selected-text-color": "#c678dd",
+ "text-color": "#c678dd"
+ },
+ "BaseN": {
+ "selected-text-color": "#d19a66",
+ "text-color": "#d19a66"
+ },
+ "BuiltIn": {
+ "selected-text-color": "#c678dd",
+ "text-color": "#c678dd"
+ },
+ "Char": {
+ "selected-text-color": "#98c379",
+ "text-color": "#98c379"
+ },
+ "Comment": {
+ "italic": true,
+ "selected-text-color": "#5c6370",
+ "text-color": "#5c6370"
+ },
+ "CommentVar": {
+ "italic": true,
+ "selected-text-color": "#e06c75",
+ "text-color": "#e06c75"
+ },
+ "Constant": {
+ "selected-text-color": "#d19a66",
+ "text-color": "#d19a66"
+ },
+ "ControlFlow": {
+ "selected-text-color": "#c678dd",
+ "text-color": "#c678dd"
+ },
+ "DataType": {
+ "selected-text-color": "#c678dd",
+ "text-color": "#c678dd"
+ },
+ "DecVal": {
+ "selected-text-color": "#d19a66",
+ "text-color": "#d19a66"
+ },
+ "Documentation": {
+ "selected-text-color": "#da4453",
+ "text-color": "#a43340"
+ },
+ "Error": {
+ "selected-text-color": "#f44747",
+ "text-color": "#f44747",
+ "underline": true
+ },
+ "Extension": {
+ "bold": true,
+ "selected-text-color": "#61afef",
+ "text-color": "#61afef"
+ },
+ "Float": {
+ "selected-text-color": "#d19a66",
+ "text-color": "#d19a66"
+ },
+ "Function": {
+ "selected-text-color": "#61afef",
+ "text-color": "#61afef"
+ },
+ "Import": {
+ "selected-text-color": "#98c379",
+ "text-color": "#98c379"
+ },
+ "Information": {
+ "selected-text-color": "#e46700",
+ "text-color": "#c45b00"
+ },
+ "Keyword": {
+ "selected-text-color": "#c678dd",
+ "text-color": "#c678dd"
+ },
+ "Normal": {
+ "selected-text-color": "#abb2bf",
+ "text-color": "#abb2bf"
+ },
+ "Operator": {
+ "selected-text-color": "#c678dd",
+ "text-color": "#c678dd"
+ },
+ "Others": {
+ "selected-text-color": "#27ae60",
+ "text-color": "#27ae60"
+ },
+ "Preprocessor": {
+ "selected-text-color": "#c678dd",
+ "text-color": "#c678dd"
+ },
+ "RegionMarker": {
+ "background-color": "#153042",
+ "selected-text-color": "#3daee9",
+ "text-color": "#2980b9"
+ },
+ "SpecialChar": {
+ "selected-text-color": "#56b6c2",
+ "text-color": "#56b6c2"
+ },
+ "SpecialString": {
+ "selected-text-color": "#da4453",
+ "text-color": "#da4453"
+ },
+ "String": {
+ "selected-text-color": "#98c379",
+ "text-color": "#98c379"
+ },
+ "Variable": {
+ "selected-text-color": "#e06c75",
+ "text-color": "#e06c75"
+ },
+ "VerbatimString": {
+ "selected-text-color": "#da4453",
+ "text-color": "#da4453"
+ },
+ "Warning": {
+ "selected-text-color": "#da4453",
+ "text-color": "#da4453"
+ }
+ }
+}
diff --git a/src/libs/3rdparty/syntax-highlighting/data/themes/atom-one-light.theme b/src/libs/3rdparty/syntax-highlighting/data/themes/atom-one-light.theme
new file mode 100644
index 0000000000..69ce7cb2b0
--- /dev/null
+++ b/src/libs/3rdparty/syntax-highlighting/data/themes/atom-one-light.theme
@@ -0,0 +1,359 @@
+{
+ "custom-styles": {
+ "Go": {
+ "Predeclared Identifier": {
+ "selected-text-color": "#986801",
+ "text-color": "#986801"
+ }
+ },
+ "INI Files": {
+ "Assignment": {
+ "selected-text-color": "#383a42",
+ "text-color": "#383a42"
+ },
+ "Section": {
+ "selected-text-color": "#4078f2",
+ "text-color": "#4078f2"
+ }
+ },
+ "JavaScript": {
+ "Built-in Objects": {
+ "selected-text-color": "#986801",
+ "text-color": "#986801"
+ },
+ "Function Declaration": {
+ "selected-text-color": "#0184bc",
+ "text-color": "#0184bc"
+ },
+ "Function Name": {
+ "selected-text-color": "#0184bc",
+ "text-color": "#0184bc"
+ },
+ "Module": {
+ "selected-text-color": "#a626a4",
+ "text-color": "#a626a4"
+ },
+ "Object Member": {
+ "selected-text-color": "#e45649",
+ "text-color": "#e45649"
+ },
+ "Object Method (Built-in)": {
+ "selected-text-color": "#0184bc",
+ "text-color": "#0184bc"
+ }
+ },
+ "Markdown": {
+ "Code": {
+ "selected-text-color": "#d19a66",
+ "text-color": "#d19a66"
+ },
+ "Emphasis Text": {
+ "selected-text-color": "#a626a4",
+ "text-color": "#a626a4"
+ },
+ "Fenced Code": {
+ "selected-text-color": "#d19a66",
+ "text-color": "#d19a66"
+ },
+ "Header H1": {
+ "selected-text-color": "#e45649",
+ "text-color": "#e45649"
+ },
+ "Header H2": {
+ "selected-text-color": "#e45649",
+ "text-color": "#e45649"
+ },
+ "Header H3": {
+ "selected-text-color": "#e45649",
+ "text-color": "#e45649"
+ },
+ "Header H4": {
+ "selected-text-color": "#e45649",
+ "text-color": "#e45649"
+ },
+ "Header H5": {
+ "selected-text-color": "#e45649",
+ "text-color": "#e45649"
+ },
+ "Header H6": {
+ "selected-text-color": "#e45649",
+ "text-color": "#e45649"
+ },
+ "Line Break": {
+ "text-color": "#383a42"
+ },
+ "Link": {
+ "selected-text-color": "#a626a4",
+ "text-color": "#a626a4"
+ },
+ "Reference-Link Name": {
+ "selected-text-color": "#4078f2",
+ "text-color": "#4078f2"
+ },
+ "Reference-Link Target": {
+ "selected-text-color": "#4078f2",
+ "text-color": "#4078f2"
+ },
+ "Reference-Link Target: Link": {
+ "selected-text-color": "#a626a4",
+ "text-color": "#a626a4"
+ },
+ "Reference-Link: Email": {
+ "selected-text-color": "#a626a4",
+ "text-color": "#a626a4"
+ },
+ "Reference-Link: Link": {
+ "selected-text-color": "#a626a4",
+ "text-color": "#a626a4"
+ },
+ "Strong Text": {
+ "selected-text-color": "#986801",
+ "text-color": "#986801"
+ }
+ },
+ "Python": {
+ "Builtin Function": {
+ "selected-text-color": "#0184bc",
+ "text-color": "#0184bc"
+ },
+ "Import": {
+ "selected-text-color": "#a626a4",
+ "text-color": "#a626a4"
+ },
+ "String Substitution": {
+ "selected-text-color": "#986801",
+ "text-color": "#986801"
+ }
+ },
+ "Rust": {
+ "Lifetime": {
+ "selected-text-color": "#986801",
+ "text-color": "#986801"
+ },
+ "Macro": {
+ "selected-text-color": "#4078f2",
+ "text-color": "#4078f2"
+ },
+ "Self": {
+ "selected-text-color": "#e45649",
+ "text-color": "#e45649"
+ },
+ "Trait": {
+ "selected-text-color": "#986801",
+ "text-color": "#986801"
+ },
+ "Type": {
+ "selected-text-color": "#0184bc",
+ "text-color": "#0184bc"
+ }
+ },
+ "TypeScript": {
+ "Built-in Objects": {
+ "selected-text-color": "#986801",
+ "text-color": "#986801"
+ },
+ "Module": {
+ "selected-text-color": "#a626a4",
+ "text-color": "#a626a4"
+ },
+ "Object Member": {
+ "selected-text-color": "#e45649",
+ "text-color": "#e45649"
+ },
+ "Object Method (Built-in)": {
+ "italic": false,
+ "selected-text-color": "#0184bc",
+ "text-color": "#0184bc"
+ },
+ "Reserved": {
+ "italic": false
+ },
+ "Types": {
+ "selected-text-color": "#4078f2",
+ "text-color": "#4078f2"
+ }
+ },
+ "XML": {
+ "Attribute": {
+ "selected-text-color": "#986801",
+ "text-color": "#986801"
+ },
+ "Element": {
+ "selected-text-color": "#e45649",
+ "text-color": "#e45649"
+ }
+ }
+ },
+ "editor-colors": {
+ "BackgroundColor": "#fafafa",
+ "BracketMatching": "#ff6e6e",
+ "CodeFolding": "#e5e5e6",
+ "CurrentLine": "#0C383A42",
+ "CurrentLineNumber": "#383a42",
+ "IconBorder": "#fafafa",
+ "IndentationLine": "#626772",
+ "LineNumbers": "#9D9D9F",
+ "MarkBookmark": "#0404bf",
+ "MarkBreakpointActive": "#8b0607",
+ "MarkBreakpointDisabled": "#820683",
+ "MarkBreakpointReached": "#6d6e07",
+ "MarkError": "#c24038",
+ "MarkExecution": "#4d4e50",
+ "MarkWarning": "#ce7c2b",
+ "ModifiedLines": "#e06c75",
+ "ReplaceHighlight": "#ef747e",
+ "SavedLines": "#98c379",
+ "SearchHighlight": "#33526FFF",
+ "Separator": "#a6b0ba",
+ "SpellChecking": "#c24038",
+ "TabMarker": "#8894a6",
+ "TemplateBackground": "#31363b",
+ "TemplateFocusedPlaceholder": "#123723",
+ "TemplatePlaceholder": "#123723",
+ "TemplateReadOnlyPlaceholder": "#4d1f24",
+ "TextSelection": "#e5e5e6",
+ "WordWrapMarker": "#cddff1"
+ },
+ "metadata": {
+ "copyright": [
+ "SPDX-FileCopyrightText: 2016 GitHub Inc.",
+ "SPDX-FileCopyrightText: 2020 Waqar Ahmed <waqar.17a@gmail.com>"
+ ],
+ "license": "SPDX-License-Identifier: MIT",
+ "name": "Atom One Light",
+ "revision": 3
+ },
+ "text-styles": {
+ "Alert": {
+ "background-color": "#4d1f24",
+ "bold": true,
+ "selected-text-color": "#95da4c",
+ "text-color": "#95da4c"
+ },
+ "Annotation": {
+ "selected-text-color": "#50a14f",
+ "text-color": "#50a14f"
+ },
+ "Attribute": {
+ "selected-text-color": "#a626a4",
+ "text-color": "#a626a4"
+ },
+ "BaseN": {
+ "selected-text-color": "#986801",
+ "text-color": "#986801"
+ },
+ "BuiltIn": {
+ "selected-text-color": "#a626a4",
+ "text-color": "#a626a4"
+ },
+ "Char": {
+ "selected-text-color": "#50a14f",
+ "text-color": "#50a14f"
+ },
+ "Comment": {
+ "italic": true,
+ "selected-text-color": "#a0a1a7",
+ "text-color": "#a0a1a7"
+ },
+ "CommentVar": {
+ "italic": true,
+ "selected-text-color": "#e45649",
+ "text-color": "#e45649"
+ },
+ "Constant": {
+ "selected-text-color": "#986801",
+ "text-color": "#986801"
+ },
+ "ControlFlow": {
+ "selected-text-color": "#a626a4",
+ "text-color": "#a626a4"
+ },
+ "DataType": {
+ "selected-text-color": "#a626a4",
+ "text-color": "#a626a4"
+ },
+ "DecVal": {
+ "selected-text-color": "#986801",
+ "text-color": "#986801"
+ },
+ "Documentation": {
+ "selected-text-color": "#da4453",
+ "text-color": "#e45649"
+ },
+ "Error": {
+ "selected-text-color": "#f44747",
+ "text-color": "#f44747",
+ "underline": true
+ },
+ "Extension": {
+ "bold": true,
+ "selected-text-color": "#4078f2",
+ "text-color": "#4078f2"
+ },
+ "Float": {
+ "selected-text-color": "#986801",
+ "text-color": "#986801"
+ },
+ "Function": {
+ "selected-text-color": "#4078f2",
+ "text-color": "#4078f2"
+ },
+ "Import": {
+ "selected-text-color": "#50a14f",
+ "text-color": "#50a14f"
+ },
+ "Information": {
+ "selected-text-color": "#e46700",
+ "text-color": "#c45b00"
+ },
+ "Keyword": {
+ "selected-text-color": "#a626a4",
+ "text-color": "#a626a4"
+ },
+ "Normal": {
+ "selected-text-color": "#383a42",
+ "text-color": "#383a42"
+ },
+ "Operator": {
+ "selected-text-color": "#a626a4",
+ "text-color": "#a626a4"
+ },
+ "Others": {
+ "selected-text-color": "#27ae60",
+ "text-color": "#27ae60"
+ },
+ "Preprocessor": {
+ "selected-text-color": "#a626a4",
+ "text-color": "#a626a4"
+ },
+ "RegionMarker": {
+ "background-color": "#153042",
+ "selected-text-color": "#3daee9",
+ "text-color": "#2980b9"
+ },
+ "SpecialChar": {
+ "selected-text-color": "#0184bc",
+ "text-color": "#0184bc"
+ },
+ "SpecialString": {
+ "selected-text-color": "#da4453",
+ "text-color": "#da4453"
+ },
+ "String": {
+ "selected-text-color": "#50a14f",
+ "text-color": "#50a14f"
+ },
+ "Variable": {
+ "selected-text-color": "#e45649",
+ "text-color": "#e45649"
+ },
+ "VerbatimString": {
+ "selected-text-color": "#da4453",
+ "text-color": "#da4453"
+ },
+ "Warning": {
+ "selected-text-color": "#da4453",
+ "text-color": "#da4453"
+ }
+ }
+}
diff --git a/src/libs/3rdparty/syntax-highlighting/data/themes/ayu-dark.theme b/src/libs/3rdparty/syntax-highlighting/data/themes/ayu-dark.theme
index 9c84e5af5d..ebfde02797 100644
--- a/src/libs/3rdparty/syntax-highlighting/data/themes/ayu-dark.theme
+++ b/src/libs/3rdparty/syntax-highlighting/data/themes/ayu-dark.theme
@@ -1,6 +1,6 @@
{
"_comments": [
- "Last update: Sep 21, 2020 (revision 2)",
+ "Last update: Feb 22, 2021 (revision 3)",
"This file has been converted from: https://github.com/dempfi/ayu",
"Also see: https://github.com/ayu-theme"
],
@@ -11,7 +11,7 @@
],
"license": "SPDX-License-Identifier: MIT",
"name": "ayu Dark",
- "revision": 2
+ "revision": 3
},
"editor-colors": {
"BackgroundColor": "#0a0e14",
@@ -176,5 +176,30 @@
"selected-text-color": "#f07178",
"text-color": "#f07178"
}
+ },
+ "custom-styles": {
+ "XML": {
+ "Attribute": {
+ "selected-text-color": "#ffb454",
+ "text-color": "#ffb454"
+ },
+ "Element": {
+ "selected-text-color": "#39bae6",
+ "text-color": "#39bae6",
+ "bold": false
+ },
+ "Element Symbols": {
+ "selected-text-color": "#307896",
+ "text-color": "#22647d"
+ },
+ "EntityRef": {
+ "selected-text-color": "#95e6cb",
+ "text-color": "#95e6cb"
+ },
+ "PEntityRef": {
+ "selected-text-color": "#95e6cb",
+ "text-color": "#95e6cb"
+ }
+ }
}
}
diff --git a/src/libs/3rdparty/syntax-highlighting/data/themes/ayu-mirage.theme b/src/libs/3rdparty/syntax-highlighting/data/themes/ayu-mirage.theme
index cd9ff7488e..e389ecf298 100644
--- a/src/libs/3rdparty/syntax-highlighting/data/themes/ayu-mirage.theme
+++ b/src/libs/3rdparty/syntax-highlighting/data/themes/ayu-mirage.theme
@@ -1,6 +1,6 @@
{
"_comments": [
- "Last update: Sep 21, 2020 (revision 2)",
+ "Last update: Feb 22, 2021 (revision 3)",
"This file has been converted from: https://github.com/dempfi/ayu",
"Also see: https://github.com/ayu-theme"
],
@@ -11,7 +11,7 @@
],
"license": "SPDX-License-Identifier: MIT",
"name": "ayu Mirage",
- "revision": 2
+ "revision": 3
},
"editor-colors": {
"BackgroundColor": "#1f2430",
@@ -176,5 +176,30 @@
"selected-text-color": "#f28779",
"text-color": "#f28779"
}
+ },
+ "custom-styles": {
+ "XML": {
+ "Attribute": {
+ "selected-text-color": "#ffd580",
+ "text-color": "#ffd580"
+ },
+ "Element": {
+ "selected-text-color": "#5ccfe6",
+ "text-color": "#5ccfe6",
+ "bold": false
+ },
+ "Element Symbols": {
+ "selected-text-color": "#4788a2",
+ "text-color": "#3d7a8b"
+ },
+ "EntityRef": {
+ "selected-text-color": "#95e6cb",
+ "text-color": "#95e6cb"
+ },
+ "PEntityRef": {
+ "selected-text-color": "#95e6cb",
+ "text-color": "#95e6cb"
+ }
+ }
}
}
diff --git a/src/libs/3rdparty/syntax-highlighting/data/themes/breeze-dark.theme b/src/libs/3rdparty/syntax-highlighting/data/themes/breeze-dark.theme
index 93f8fa9cac..712da4acc4 100644
--- a/src/libs/3rdparty/syntax-highlighting/data/themes/breeze-dark.theme
+++ b/src/libs/3rdparty/syntax-highlighting/data/themes/breeze-dark.theme
@@ -5,7 +5,7 @@
"SPDX-FileCopyrightText: 2016 Dominik Haumann <dhaumann@kde.org>"
],
"license": "SPDX-License-Identifier: MIT",
- "revision" : 2,
+ "revision" : 6,
"name" : "Breeze Dark"
},
"text-styles": {
@@ -36,8 +36,8 @@
"bold" : true
},
"Operator" : {
- "text-color" : "#cfcfc2",
- "selected-text-color" : "#cfcfc2"
+ "text-color" : "#3f8058",
+ "selected-text-color" : "#54aa75"
},
"BuiltIn" : {
"text-color" : "#7f8c8d",
@@ -149,7 +149,7 @@
"editor-colors": {
"BackgroundColor" : "#232629",
"CodeFolding" : "#224e65",
- "BracketMatching" : "#8e44ad",
+ "BracketMatching" : "#323030",
"CurrentLine" : "#2A2E32",
"IconBorder" : "#31363b",
"IndentationLine" : "#3a3f44",
@@ -167,7 +167,7 @@
"SavedLines" : "#1c8042",
"SearchHighlight" : "#218058",
"TextSelection" : "#2d5c76",
- "Separator" : "#7a7c7d",
+ "Separator" : "#3f4347",
"SpellChecking" : "#c0392b",
"TabMarker" : "#4d4d4d",
"TemplateBackground" : "#31363b",
diff --git a/src/libs/3rdparty/syntax-highlighting/data/themes/breeze-light.theme b/src/libs/3rdparty/syntax-highlighting/data/themes/breeze-light.theme
index 0a27e2d354..7d0116bea9 100644
--- a/src/libs/3rdparty/syntax-highlighting/data/themes/breeze-light.theme
+++ b/src/libs/3rdparty/syntax-highlighting/data/themes/breeze-light.theme
@@ -5,7 +5,7 @@
"SPDX-FileCopyrightText: 2016 Dominik Haumann <dhaumann@kde.org>"
],
"license": "SPDX-License-Identifier: MIT",
- "revision" : 4,
+ "revision" : 8,
"name" : "Breeze Light"
},
"text-styles": {
@@ -36,8 +36,8 @@
"bold" : true
},
"Operator" : {
- "text-color" : "#1f1c1b",
- "selected-text-color" : "#ffffff"
+ "text-color" : "#ca60ca",
+ "selected-text-color" : "#a44ea4"
},
"BuiltIn" : {
"text-color" : "#644a9b",
@@ -167,7 +167,7 @@
"SavedLines" : "#2ecc71",
"SearchHighlight" : "#ffff00",
"TextSelection" : "#94caef",
- "Separator" : "#a0a0a0",
+ "Separator" : "#d5d5d5",
"SpellChecking" : "#bf0303",
"TabMarker" : "#d2d2d2",
"TemplateBackground" : "#d6d2d0",
diff --git a/src/libs/3rdparty/syntax-highlighting/data/themes/dracula.theme b/src/libs/3rdparty/syntax-highlighting/data/themes/dracula.theme
index 82786160b8..93b1833334 100644
--- a/src/libs/3rdparty/syntax-highlighting/data/themes/dracula.theme
+++ b/src/libs/3rdparty/syntax-highlighting/data/themes/dracula.theme
@@ -1,13 +1,547 @@
{
+ "custom-styles": {
+ "Alerts": {
+ "Region Marker": {
+ "selected-text-color": "#6db8c7",
+ "text-color": "#6db8c7"
+ }
+ },
+ "Apache Configuration": {
+ "Directives": {
+ "bold": false
+ }
+ },
+ "Bash": {
+ "Path": {
+ "selected-text-color": "#f1fa8c",
+ "text-color": "#f1fa8c"
+ },
+ "Redirection": {
+ "selected-text-color": "#ff79c6",
+ "text-color": "#ff79c6"
+ },
+ "Variable": {
+ "selected-text-color": "#bd93f9",
+ "text-color": "#bd93f9"
+ }
+ },
+ "C": {
+ "Prep. Lib": {
+ "selected-text-color": "#f1fa8c",
+ "text-color": "#f1fa8c"
+ }
+ },
+ "C++": {
+ "Qt Macros": {
+ "bold": false,
+ "selected-text-color": "#50fa7b",
+ "text-color": "#50fa7b"
+ }
+ },
+ "CMake": {
+ "Builtin Variable": {
+ "selected-text-color": "#ffb86c",
+ "text-color": "#ffb86c"
+ }
+ },
+ "CSS": {
+ "Color": {
+ "bold": false
+ },
+ "Property": {
+ "selected-text-color": "#8be9fd",
+ "text-color": "#8be9fd"
+ },
+ "Selector Class": {
+ "italic": true
+ },
+ "Selector Id": {
+ "bold": false,
+ "selected-text-color": "#50fa7b",
+ "text-color": "#50fa7b"
+ },
+ "Selector Pseudo": {
+ "selected-text-color": "#50fa7b",
+ "text-color": "#50fa7b"
+ },
+ "Selector Tag": {
+ "selected-text-color": "#ff79c6",
+ "text-color": "#ff79c6"
+ },
+ "Unit": {
+ "selected-text-color": "#ff79c6",
+ "text-color": "#ff79c6"
+ }
+ },
+ "D": {
+ "Attribute": {
+ "bold": false
+ },
+ "Declarator": {
+ "bold": false
+ },
+ "Deprecated": {
+ "bold": false
+ },
+ "Expression": {
+ "bold": false
+ },
+ "Module": {
+ "bold": false
+ },
+ "Property": {
+ "bold": false
+ },
+ "Template": {
+ "bold": false
+ }
+ },
+ "Diff": {
+ "Added line": {
+ "selected-text-color": "#5fde38",
+ "text-color": "#50fa7b"
+ },
+ "Changed line (new)": {
+ "background-color": "#50fa7b",
+ "selected-text-color": "#5fde38",
+ "text-color": "#50fa7b"
+ },
+ "Changed line (old)": {
+ "selected-text-color": "#e66eb4",
+ "text-color": "#ff79c6"
+ },
+ "Removed line": {
+ "selected-text-color": "#e66eb4",
+ "text-color": "#ff79c6"
+ }
+ },
+ "Doxygen": {
+ "Custom Tags": {
+ "selected-text-color": "#d465a7",
+ "text-color": "#d465a7"
+ },
+ "Description": {
+ "selected-text-color": "#c58e53",
+ "text-color": "#c58e53"
+ },
+ "Entities": {
+ "bold": false
+ },
+ "HTML Tag": {
+ "bold": false,
+ "selected-text-color": "#d465a7",
+ "text-color": "#d465a7"
+ },
+ "Region": {
+ "selected-text-color": "#6db8c7",
+ "text-color": "#6db8c7"
+ },
+ "Tags": {
+ "bold": false,
+ "selected-text-color": "#d465a7",
+ "text-color": "#d465a7"
+ },
+ "Word": {
+ "bold": false,
+ "selected-text-color": "#c58e53",
+ "text-color": "#c58e53"
+ }
+ },
+ "GNU Assembler": {
+ "Label": {
+ "underline": true
+ }
+ },
+ "Go": {
+ "Builtin Function": {
+ "selected-text-color": "#50fa7b",
+ "text-color": "#50fa7b"
+ }
+ },
+ "HTML": {
+ "Doctype": {
+ "bold": false,
+ "italic": false,
+ "selected-text-color": "#ff79c6",
+ "text-color": "#ff79c6"
+ }
+ },
+ "ISO C++": {
+ "Prep. Lib": {
+ "selected-text-color": "#f1fa8c",
+ "text-color": "#f1fa8c"
+ },
+ "Standard Suffix": {
+ "selected-text-color": "#ff79c6",
+ "text-color": "#ff79c6"
+ },
+ "UDL Numeric Suffix": {
+ "selected-text-color": "#ff79c6",
+ "text-color": "#ff79c6"
+ },
+ "UDL String Suffix": {
+ "selected-text-color": "#ff79c6",
+ "text-color": "#ff79c6"
+ }
+ },
+ "Intel x86 (NASM)": {
+ "Label": {
+ "underline": true
+ },
+ "Registers": {
+ "selected-text-color": "#ffb86c",
+ "text-color": "#ffb86c"
+ }
+ },
+ "JSON": {
+ "Style_Keyword": {
+ "selected-text-color": "#bd93f9",
+ "text-color": "#bd93f9"
+ },
+ "Style_String_Key": {
+ "italic": false
+ }
+ },
+ "JavaScript": {
+ "Built-in Objects": {
+ "italic": true
+ },
+ "Function (Built-in)": {
+ "selected-text-color": "#50fa7b",
+ "text-color": "#50fa7b"
+ },
+ "Object Member": {
+ "selected-text-color": "#f8f8f2",
+ "text-color": "#f8f8f2"
+ }
+ },
+ "JavaScript React (JSX)": {
+ "Attribute": {
+ "italic": true
+ },
+ "Component Tag": {
+ "bold": false,
+ "selected-text-color": "#8be9fd",
+ "text-color": "#8be9fd"
+ }
+ },
+ "Makefile": {
+ "Operator": {
+ "selected-text-color": "#ff79c6",
+ "text-color": "#ff79c6"
+ },
+ "Prereq": {
+ "italic": false,
+ "selected-text-color": "#f1fa8c",
+ "text-color": "#f1fa8c"
+ },
+ "Target": {
+ "selected-text-color": "#8be9fd",
+ "text-color": "#8be9fd"
+ },
+ "Variable": {
+ "selected-text-color": "#ffb86c",
+ "text-color": "#ffb86c"
+ }
+ },
+ "Markdown": {
+ "Blockquote: Link": {
+ "selected-text-color": "#8be9fd",
+ "text-color": "#8be9fd"
+ },
+ "Email": {
+ "selected-text-color": "#8be9fd",
+ "text-color": "#8be9fd"
+ },
+ "Emphasis Text": {
+ "selected-text-color": "#f1fa8c",
+ "text-color": "#f1fa8c"
+ },
+ "Header H1": {
+ "selected-text-color": "#bd93f9",
+ "text-color": "#bd93f9"
+ },
+ "Header H2": {
+ "selected-text-color": "#bd93f9",
+ "text-color": "#bd93f9"
+ },
+ "Header H3": {
+ "selected-text-color": "#bd93f9",
+ "text-color": "#bd93f9"
+ },
+ "Header H4": {
+ "selected-text-color": "#bd93f9",
+ "text-color": "#bd93f9"
+ },
+ "Header H5": {
+ "selected-text-color": "#bd93f9",
+ "text-color": "#bd93f9"
+ },
+ "Header H6": {
+ "selected-text-color": "#bd93f9",
+ "text-color": "#bd93f9"
+ },
+ "Inline Image": {
+ "selected-text-color": "#ffb86c",
+ "text-color": "#ffb86c"
+ },
+ "Inline Image: Link": {
+ "selected-text-color": "#8be9fd",
+ "text-color": "#8be9fd"
+ },
+ "Link": {
+ "selected-text-color": "#8be9fd",
+ "text-color": "#8be9fd"
+ },
+ "List: Emphasis Text": {
+ "selected-text-color": "#f1fa8c",
+ "text-color": "#f1fa8c"
+ },
+ "List: Link": {
+ "selected-text-color": "#8be9fd",
+ "text-color": "#8be9fd"
+ },
+ "List: Strong Text": {
+ "selected-text-color": "#ffb86c",
+ "text-color": "#ffb86c"
+ },
+ "Normal Text: Link": {
+ "selected-text-color": "#8be9fd",
+ "text-color": "#8be9fd"
+ },
+ "Reference Image": {
+ "selected-text-color": "#ffb86c",
+ "text-color": "#ffb86c"
+ },
+ "Reference-Link": {
+ "selected-text-color": "#8be9fd",
+ "text-color": "#8be9fd"
+ },
+ "Reference-Link Name": {
+ "selected-text-color": "#ff79c6",
+ "text-color": "#ff79c6",
+ "underline": false
+ },
+ "Reference-Link Target": {
+ "selected-text-color": "#ff79c6",
+ "text-color": "#ff79c6"
+ },
+ "Reference-Link Target: Link": {
+ "selected-text-color": "#8be9fd",
+ "text-color": "#8be9fd"
+ },
+ "Reference-Link: Link": {
+ "selected-text-color": "#8be9fd",
+ "text-color": "#8be9fd"
+ },
+ "Strong Text": {
+ "selected-text-color": "#ffb86c",
+ "text-color": "#ffb86c"
+ }
+ },
+ "Modelines": {
+ "Variable": {
+ "selected-text-color": "#c58e53",
+ "text-color": "#c58e53"
+ }
+ },
+ "PHP/PHP": {
+ "Backslash Code": {
+ "bold": false,
+ "selected-text-color": "#ff79c6",
+ "text-color": "#ff79c6"
+ },
+ "Control Structures": {
+ "selected-text-color": "#ff79c6",
+ "text-color": "#ff79c6"
+ },
+ "Library Constant": {
+ "bold": false,
+ "selected-text-color": "#bd93f9",
+ "text-color": "#bd93f9"
+ },
+ "Special Variable": {
+ "bold": false,
+ "selected-text-color": "#f8f8f2",
+ "text-color": "#f8f8f2"
+ },
+ "Variable": {
+ "selected-text-color": "#f8f8f2",
+ "text-color": "#f8f8f2"
+ }
+ },
+ "Python": {
+ "Builtin Function": {
+ "selected-text-color": "#50fa7b",
+ "text-color": "#50fa7b"
+ },
+ "Special Variable": {
+ "selected-text-color": "#bd93f9",
+ "text-color": "#bd93f9"
+ }
+ },
+ "QMake": {
+ "Backslash Code": {
+ "bold": false
+ },
+ "Predefined Variable": {
+ "bold": false,
+ "selected-text-color": "#ffb86c",
+ "text-color": "#ffb86c"
+ }
+ },
+ "Ruby": {
+ "Access Control": {
+ "bold": false,
+ "selected-text-color": "#50fa7b",
+ "text-color": "#50fa7b"
+ },
+ "Default globals": {
+ "bold": false
+ },
+ "Definition": {
+ "selected-text-color": "#50fa7b",
+ "text-color": "#50fa7b"
+ },
+ "Global Constant": {
+ "bold": false,
+ "italic": true,
+ "selected-text-color": "#8be9fd",
+ "text-color": "#8be9fd"
+ },
+ "Kernel methods": {
+ "bold": false,
+ "selected-text-color": "#8be9fd",
+ "text-color": "#8be9fd"
+ },
+ "Message": {
+ "selected-text-color": "#50fa7b",
+ "text-color": "#50fa7b"
+ },
+ "Module mixin methods": {
+ "bold": false
+ },
+ "Pseudo variable": {
+ "selected-text-color": "#50fa7b",
+ "text-color": "#50fa7b"
+ }
+ },
+ "Rust": {
+ "Attribute": {
+ "selected-text-color": "#f8f8f2",
+ "text-color": "#f8f8f2"
+ },
+ "CConstant": {
+ "bold": false
+ },
+ "CType": {
+ "italic": true,
+ "selected-text-color": "#8be9fd",
+ "text-color": "#8be9fd"
+ },
+ "Constant": {
+ "bold": false
+ },
+ "Definition": {
+ "selected-text-color": "#50fa7b",
+ "text-color": "#50fa7b"
+ },
+ "Lifetime": {
+ "selected-text-color": "#ff79c6",
+ "text-color": "#ff79c6"
+ },
+ "Macro": {
+ "selected-text-color": "#8be9fd",
+ "text-color": "#8be9fd"
+ },
+ "Scope": {
+ "selected-text-color": "#f8f8f2",
+ "text-color": "#f8f8f2"
+ },
+ "Self": {
+ "italic": true,
+ "selected-text-color": "#bd93f9",
+ "text-color": "#bd93f9"
+ },
+ "Trait": {
+ "selected-text-color": "#f8f8f2",
+ "text-color": "#f8f8f2"
+ }
+ },
+ "SPDX-Comments": {
+ "SPDX Deprecated License": {
+ "selected-text-color": "#d465a7",
+ "text-color": "#d465a7"
+ },
+ "SPDX Deprecated License Exception": {
+ "selected-text-color": "#d465a7",
+ "text-color": "#d465a7"
+ },
+ "SPDX License": {
+ "selected-text-color": "#d465a7",
+ "text-color": "#d465a7"
+ },
+ "SPDX License Exception": {
+ "selected-text-color": "#d465a7",
+ "text-color": "#d465a7"
+ },
+ "SPDX Tag": {
+ "selected-text-color": "#d465a7",
+ "text-color": "#d465a7"
+ },
+ "SPDX Value": {
+ "selected-text-color": "#d465a7",
+ "text-color": "#d465a7"
+ }
+ },
+ "TypeScript": {
+ "Built-in Objects": {
+ "italic": true
+ },
+ "Function (Built-in)": {
+ "selected-text-color": "#50fa7b",
+ "text-color": "#50fa7b"
+ },
+ "Object Member": {
+ "selected-text-color": "#f8f8f2",
+ "text-color": "#f8f8f2"
+ }
+ },
+ "TypeScript React (TSX)": {
+ "Attribute": {
+ "italic": true
+ },
+ "Component Tag": {
+ "bold": false,
+ "selected-text-color": "#8be9fd",
+ "text-color": "#8be9fd"
+ }
+ },
+ "YAML": {
+ "Attribute": {
+ "selected-text-color": "#f1fa8c",
+ "text-color": "#f1fa8c"
+ },
+ "Key": {
+ "bold": false,
+ "selected-text-color": "#8be9fd",
+ "text-color": "#8be9fd"
+ },
+ "List": {
+ "selected-text-color": "#f1fa8c",
+ "text-color": "#f1fa8c"
+ }
+ }
+ },
"editor-colors": {
"BackgroundColor": "#282a36",
- "BracketMatching": "#55007f",
- "CodeFolding": "#8be9fd",
- "CurrentLine": "#282a36",
+ "BracketMatching": "#7c62a5",
+ "CodeFolding": "#44475a",
+ "CurrentLine": "#44475a",
"CurrentLineNumber": "#f8f8f2",
"IconBorder": "#282a36",
"IndentationLine": "#6272a4",
- "LineNumbers": "#909194",
+ "LineNumbers": "#6272a4",
"MarkBookmark": "#8be9fd",
"MarkBreakpointActive": "#ff5555",
"MarkBreakpointDisabled": "#bd93f9",
@@ -16,10 +550,10 @@
"MarkExecution": "#44475a",
"MarkWarning": "#ffb86c",
"ModifiedLines": "#ff79c6",
- "ReplaceHighlight": "#50fa7b",
+ "ReplaceHighlight": "#2c8843",
"SavedLines": "#50fa7b",
- "SearchHighlight": "#b39800",
- "Separator": "#909194",
+ "SearchHighlight": "#566591",
+ "Separator": "#45474e",
"SpellChecking": "#ff5555",
"TabMarker": "#6272a4",
"TemplateBackground": "#282a36",
@@ -36,7 +570,7 @@
],
"license": "SPDX-License-Identifier: MIT",
"name": "Dracula",
- "revision": 1
+ "revision": 7
},
"text-styles": {
"Alert": {
@@ -49,20 +583,20 @@
"text-color": "#ff79c6"
},
"Attribute": {
- "selected-text-color": "#8be9fd",
- "text-color": "#8be9fd"
+ "selected-text-color": "#ff79c6",
+ "text-color": "#ff79c6"
},
"BaseN": {
- "selected-text-color": "#ffb86c",
- "text-color": "#ffb86c"
+ "selected-text-color": "#bd93f9",
+ "text-color": "#bd93f9"
},
"BuiltIn": {
"selected-text-color": "#8be9fd",
"text-color": "#8be9fd"
},
"Char": {
- "selected-text-color": "#ff79c6",
- "text-color": "#ff79c6"
+ "selected-text-color": "#f1fa8c",
+ "text-color": "#f1fa8c"
},
"Comment": {
"selected-text-color": "#6272a4",
@@ -78,17 +612,17 @@
"text-color": "#bd93f9"
},
"ControlFlow": {
- "bold": true,
- "selected-text-color": "#ffb86c",
- "text-color": "#ffb86c"
+ "selected-text-color": "#ff79c6",
+ "text-color": "#ff79c6"
},
"DataType": {
+ "italic": true,
"selected-text-color": "#8be9fd",
"text-color": "#8be9fd"
},
"DecVal": {
- "selected-text-color": "#ffb86c",
- "text-color": "#ffb86c"
+ "selected-text-color": "#bd93f9",
+ "text-color": "#bd93f9"
},
"Documentation": {
"selected-text-color": "#ffb86c",
@@ -100,13 +634,12 @@
"underline": true
},
"Extension": {
- "bold": true,
- "selected-text-color": "#0095ff",
- "text-color": "#0095ff"
+ "selected-text-color": "#8be9fd",
+ "text-color": "#8be9fd"
},
"Float": {
- "selected-text-color": "#ffb86c",
- "text-color": "#ffb86c"
+ "selected-text-color": "#bd93f9",
+ "text-color": "#bd93f9"
},
"Function": {
"selected-text-color": "#50fa7b",
@@ -117,11 +650,10 @@
"text-color": "#ff79c6"
},
"Information": {
- "selected-text-color": "#f67400",
- "text-color": "#f67400"
+ "selected-text-color": "#f1fa8c",
+ "text-color": "#f1fa8c"
},
"Keyword": {
- "bold": true,
"selected-text-color": "#ff79c6",
"text-color": "#ff79c6"
},
@@ -138,8 +670,8 @@
"text-color": "#50fa7b"
},
"Preprocessor": {
- "selected-text-color": "#50fa7b",
- "text-color": "#50fa7b"
+ "selected-text-color": "#ff79c6",
+ "text-color": "#ff79c6"
},
"RegionMarker": {
"selected-text-color": "#8be9fd",
diff --git a/src/libs/3rdparty/syntax-highlighting/data/themes/github-dark.theme b/src/libs/3rdparty/syntax-highlighting/data/themes/github-dark.theme
new file mode 100644
index 0000000000..313e99f052
--- /dev/null
+++ b/src/libs/3rdparty/syntax-highlighting/data/themes/github-dark.theme
@@ -0,0 +1,216 @@
+{
+ "custom-styles": {
+ "INI Files": {
+ "Section": {
+ "selected-text-color": "#b392f0",
+ "text-color": "#b392f0"
+ }
+ },
+ "Python": {
+ "Builtin Function": {
+ "selected-text-color": "#b392f0",
+ "text-color": "#b392f0"
+ },
+ "Import": {
+ "selected-text-color": "#f97583",
+ "text-color": "#f97583"
+ },
+ "Special Variable": {
+ "selected-text-color": "#79b8ff",
+ "text-color": "#79b8ff"
+ }
+ },
+ "Rust": {
+ "Attribute": {
+ "selected-text-color": "#e1e4e8",
+ "text-color": "#e1e4e8"
+ },
+ "Macro": {
+ "selected-text-color": "#79b8ff",
+ "text-color": "#79b8ff"
+ },
+ "Self": {
+ "selected-text-color": "#79b8ff",
+ "text-color": "#79b8ff"
+ },
+ "Trait": {
+ "selected-text-color": "#e1e4e8",
+ "text-color": "#e1e4e8"
+ }
+ },
+ "XML": {
+ "Element": {
+ "selected-text-color": "#85e89d",
+ "text-color": "#85e89d"
+ }
+ }
+ },
+ "editor-colors": {
+ "BackgroundColor": "#24292e",
+ "BracketMatching": "#65676a",
+ "CodeFolding": "#253749",
+ "CurrentLine": "#2b3036",
+ "CurrentLineNumber": "#e1e4e8",
+ "IconBorder": "#24292e",
+ "IndentationLine": "#d7dbe0",
+ "LineNumbers": "#444d56",
+ "MarkBookmark": "#8be9fd",
+ "MarkBreakpointActive": "#ff5555",
+ "MarkBreakpointDisabled": "#bd93f9",
+ "MarkBreakpointReached": "#f1fa8c",
+ "MarkError": "#b31d28",
+ "MarkExecution": "#44475a",
+ "MarkWarning": "#ffab70",
+ "ModifiedLines": "#f97583",
+ "ReplaceHighlight": "#40c661",
+ "SavedLines": "#28a745",
+ "SearchHighlight": "#404030",
+ "Separator": "#1b1f23",
+ "SpellChecking": "#ff5555",
+ "TabMarker": "#444d56",
+ "TemplateBackground": "#23241e",
+ "TemplateFocusedPlaceholder": "#22231d",
+ "TemplatePlaceholder": "#22231d",
+ "TemplateReadOnlyPlaceholder": "#262721",
+ "TextSelection": "#253749",
+ "WordWrapMarker": "#2f3031"
+ },
+ "metadata": {
+ "copyright": [
+ "SPDX-FileCopyrightText: 2020 GitHub Inc.",
+ "SPDX-FileCopyrightText: 2020 Waqar Ahmed <waqar.17a@gmail.com>"
+ ],
+ "license": "SPDX-License-Identifier: MIT",
+ "name": "GitHub Dark",
+ "revision": 2
+ },
+ "text-styles": {
+ "Alert": {
+ "bold": true,
+ "selected-text-color": "#ff5555",
+ "text-color": "#ff5555"
+ },
+ "Annotation": {
+ "selected-text-color": "#6a737d",
+ "text-color": "#6a737d"
+ },
+ "Attribute": {
+ "selected-text-color": "#f97583",
+ "text-color": "#f97583"
+ },
+ "BaseN": {
+ "selected-text-color": "#79b8ff",
+ "text-color": "#79b8ff"
+ },
+ "BuiltIn": {
+ "selected-text-color": "#f97583",
+ "text-color": "#f97583"
+ },
+ "Char": {
+ "selected-text-color": "#9ecbff",
+ "text-color": "#9ecbff"
+ },
+ "Comment": {
+ "selected-text-color": "#6a737d",
+ "text-color": "#6a737d"
+ },
+ "CommentVar": {
+ "selected-text-color": "#6a737d",
+ "text-color": "#6a737d"
+ },
+ "Constant": {
+ "selected-text-color": "#79b8ff",
+ "text-color": "#79b8ff"
+ },
+ "ControlFlow": {
+ "selected-text-color": "#f97583",
+ "text-color": "#f97583"
+ },
+ "DataType": {
+ "selected-text-color": "#f97583",
+ "text-color": "#f97583"
+ },
+ "DecVal": {
+ "selected-text-color": "#79b8ff",
+ "text-color": "#79b8ff"
+ },
+ "Documentation": {
+ "selected-text-color": "#6a737d",
+ "text-color": "#6a737d"
+ },
+ "Error": {
+ "selected-text-color": "#ff5555",
+ "text-color": "#ff5555",
+ "underline": true
+ },
+ "Extension": {
+ "bold": true,
+ "selected-text-color": "#f97583",
+ "text-color": "#f97583"
+ },
+ "Float": {
+ "selected-text-color": "#79b8ff",
+ "text-color": "#79b8ff"
+ },
+ "Function": {
+ "selected-text-color": "#b392f0",
+ "text-color": "#b392f0"
+ },
+ "Import": {
+ "selected-text-color": "#9ecbff",
+ "text-color": "#9ecbff"
+ },
+ "Information": {
+ "selected-text-color": "#6a737d",
+ "text-color": "#6a737d"
+ },
+ "Keyword": {
+ "selected-text-color": "#f97583",
+ "text-color": "#f97583"
+ },
+ "Normal": {
+ "selected-text-color": "#e1e4e8",
+ "text-color": "#e1e4e8"
+ },
+ "Operator": {
+ "selected-text-color": "#e1e4e8",
+ "text-color": "#e1e4e8"
+ },
+ "Others": {
+ "selected-text-color": "#b392f0",
+ "text-color": "#b392f0"
+ },
+ "Preprocessor": {
+ "selected-text-color": "#f97583",
+ "text-color": "#f97583"
+ },
+ "RegionMarker": {
+ "selected-text-color": "#6a737d",
+ "text-color": "#6a737d"
+ },
+ "SpecialChar": {
+ "selected-text-color": "#79b8ff",
+ "text-color": "#79b8ff"
+ },
+ "SpecialString": {
+ "selected-text-color": "#9ecbff",
+ "text-color": "#9ecbff"
+ },
+ "String": {
+ "selected-text-color": "#9ecbff",
+ "text-color": "#9ecbff"
+ },
+ "Variable": {
+ "selected-text-color": "#ffab70",
+ "text-color": "#ffab70"
+ },
+ "VerbatimString": {
+ "selected-text-color": "#9ecbff",
+ "text-color": "#9ecbff"
+ },
+ "Warning": {
+ "selected-text-color": "#ff5555",
+ "text-color": "#ff5555"
+ }
+ }
+}
diff --git a/src/libs/3rdparty/syntax-highlighting/data/themes/github-light.theme b/src/libs/3rdparty/syntax-highlighting/data/themes/github-light.theme
new file mode 100644
index 0000000000..5f465c653c
--- /dev/null
+++ b/src/libs/3rdparty/syntax-highlighting/data/themes/github-light.theme
@@ -0,0 +1,216 @@
+{
+ "custom-styles": {
+ "INI Files": {
+ "Section": {
+ "selected-text-color": "#6f42c1",
+ "text-color": "#6f42c1"
+ }
+ },
+ "Python": {
+ "Builtin Function": {
+ "selected-text-color": "#6f42c1",
+ "text-color": "#6f42c1"
+ },
+ "Import": {
+ "selected-text-color": "#d73a49",
+ "text-color": "#d73a49"
+ },
+ "Special Variable": {
+ "selected-text-color": "#005cc5",
+ "text-color": "#005cc5"
+ }
+ },
+ "Rust": {
+ "Attribute": {
+ "selected-text-color": "#24292e",
+ "text-color": "#24292e"
+ },
+ "Macro": {
+ "selected-text-color": "#005cc5",
+ "text-color": "#005cc5"
+ },
+ "Self": {
+ "selected-text-color": "#005cc5",
+ "text-color": "#005cc5"
+ },
+ "Trait": {
+ "selected-text-color": "#24292e",
+ "text-color": "#24292e"
+ }
+ },
+ "XML": {
+ "Element": {
+ "selected-text-color": "#22863a",
+ "text-color": "#22863a"
+ }
+ }
+ },
+ "editor-colors": {
+ "BackgroundColor": "#ffffff",
+ "BracketMatching": "#bef5cb",
+ "CodeFolding": "#f6f8fa",
+ "CurrentLine": "#f6f8fa",
+ "CurrentLineNumber": "#24292e",
+ "IconBorder": "#ffffff",
+ "IndentationLine": "#d7dbe0",
+ "LineNumbers": "#c7c2bc",
+ "MarkBookmark": "#8be9fd",
+ "MarkBreakpointActive": "#ff5555",
+ "MarkBreakpointDisabled": "#bd93f9",
+ "MarkBreakpointReached": "#f1fa8c",
+ "MarkError": "#b31d28",
+ "MarkExecution": "#44475a",
+ "MarkWarning": "#e36209",
+ "ModifiedLines": "#d73a49",
+ "ReplaceHighlight": "#50fa7b",
+ "SavedLines": "#28a745",
+ "SearchHighlight": "#ffea7f",
+ "Separator": "#e1e4e8",
+ "SpellChecking": "#ff5555",
+ "TabMarker": "#d1d5da",
+ "TemplateBackground": "#23241e",
+ "TemplateFocusedPlaceholder": "#22231d",
+ "TemplatePlaceholder": "#22231d",
+ "TemplateReadOnlyPlaceholder": "#262721",
+ "TextSelection": "#dee6fc",
+ "WordWrapMarker": "#e1e4e8"
+ },
+ "metadata": {
+ "copyright": [
+ "SPDX-FileCopyrightText: 2020 GitHub Inc.",
+ "SPDX-FileCopyrightText: 2020 Waqar Ahmed <waqar.17a@gmail.com>"
+ ],
+ "license": "SPDX-License-Identifier: MIT",
+ "name": "GitHub Light",
+ "revision": 2
+ },
+ "text-styles": {
+ "Alert": {
+ "bold": true,
+ "selected-text-color": "#ff5555",
+ "text-color": "#ff5555"
+ },
+ "Annotation": {
+ "selected-text-color": "#6a737d",
+ "text-color": "#6a737d"
+ },
+ "Attribute": {
+ "selected-text-color": "#d73a49",
+ "text-color": "#d73a49"
+ },
+ "BaseN": {
+ "selected-text-color": "#005cc5",
+ "text-color": "#005cc5"
+ },
+ "BuiltIn": {
+ "selected-text-color": "#d73a49",
+ "text-color": "#d73a49"
+ },
+ "Char": {
+ "selected-text-color": "#032f62",
+ "text-color": "#032f62"
+ },
+ "Comment": {
+ "selected-text-color": "#6a737d",
+ "text-color": "#6a737d"
+ },
+ "CommentVar": {
+ "selected-text-color": "#6a737d",
+ "text-color": "#6a737d"
+ },
+ "Constant": {
+ "selected-text-color": "#005cc5",
+ "text-color": "#005cc5"
+ },
+ "ControlFlow": {
+ "selected-text-color": "#d73a49",
+ "text-color": "#d73a49"
+ },
+ "DataType": {
+ "selected-text-color": "#d73a49",
+ "text-color": "#d73a49"
+ },
+ "DecVal": {
+ "selected-text-color": "#005cc5",
+ "text-color": "#005cc5"
+ },
+ "Documentation": {
+ "selected-text-color": "#6a737d",
+ "text-color": "#6a737d"
+ },
+ "Error": {
+ "selected-text-color": "#ff5555",
+ "text-color": "#ff5555",
+ "underline": true
+ },
+ "Extension": {
+ "bold": true,
+ "selected-text-color": "#d73a49",
+ "text-color": "#d73a49"
+ },
+ "Float": {
+ "selected-text-color": "#005cc5",
+ "text-color": "#005cc5"
+ },
+ "Function": {
+ "selected-text-color": "#6f42c1",
+ "text-color": "#6f42c1"
+ },
+ "Import": {
+ "selected-text-color": "#032f62",
+ "text-color": "#032f62"
+ },
+ "Information": {
+ "selected-text-color": "#6a737d",
+ "text-color": "#6a737d"
+ },
+ "Keyword": {
+ "selected-text-color": "#d73a49",
+ "text-color": "#d73a49"
+ },
+ "Normal": {
+ "selected-text-color": "#24292e",
+ "text-color": "#24292e"
+ },
+ "Operator": {
+ "selected-text-color": "#24292e",
+ "text-color": "#24292e"
+ },
+ "Others": {
+ "selected-text-color": "#6f42c1",
+ "text-color": "#6f42c1"
+ },
+ "Preprocessor": {
+ "selected-text-color": "#d73a49",
+ "text-color": "#d73a49"
+ },
+ "RegionMarker": {
+ "selected-text-color": "#6a737d",
+ "text-color": "#6a737d"
+ },
+ "SpecialChar": {
+ "selected-text-color": "#005cc5",
+ "text-color": "#005cc5"
+ },
+ "SpecialString": {
+ "selected-text-color": "#032f62",
+ "text-color": "#032f62"
+ },
+ "String": {
+ "selected-text-color": "#032f62",
+ "text-color": "#032f62"
+ },
+ "Variable": {
+ "selected-text-color": "#e36209",
+ "text-color": "#e36209"
+ },
+ "VerbatimString": {
+ "selected-text-color": "#032f62",
+ "text-color": "#032f62"
+ },
+ "Warning": {
+ "selected-text-color": "#ff5555",
+ "text-color": "#ff5555"
+ }
+ }
+}
diff --git a/src/libs/3rdparty/syntax-highlighting/data/themes/monokai.theme b/src/libs/3rdparty/syntax-highlighting/data/themes/monokai.theme
new file mode 100644
index 0000000000..3df8e66c00
--- /dev/null
+++ b/src/libs/3rdparty/syntax-highlighting/data/themes/monokai.theme
@@ -0,0 +1,394 @@
+{
+ "custom-styles": {
+ "C": {
+ "Prep. Lib": {
+ "selected-text-color": "#e6db74",
+ "text-color": "#e6db74"
+ }
+ },
+ "C++": {
+ "Qt Classes": {
+ "bold": false,
+ "selected-text-color": "#66d9ef",
+ "text-color": "#66d9ef"
+ },
+ "Qt Macros": {
+ "bold": false,
+ "selected-text-color": "#f92672",
+ "text-color": "#f92672"
+ },
+ "Qt Types": {
+ "bold": false,
+ "selected-text-color": "#66D9EF",
+ "text-color": "#66D9EF"
+ }
+ },
+ "CMake": {
+ "Builtin Variable": {
+ "selected-text-color": "#f8f8f2",
+ "text-color": "#f8f8f2"
+ },
+ "False Special Arg": {
+ "selected-text-color": "#e03232",
+ "text-color": "#e03232"
+ },
+ "True Special Arg": {
+ "selected-text-color": "#38bd38",
+ "text-color": "#38bd38"
+ }
+ },
+ "Doxygen": {
+ "Tags": {
+ "bold": false,
+ "selected-text-color": "#52afbf",
+ "text-color": "#52afbf"
+ },
+ "Word": {
+ "bold": false,
+ "selected-text-color": "#7ba822",
+ "text-color": "#7ba822",
+ "underline": true
+ }
+ },
+ "Diff": {
+ "Added line": {
+ "selected-text-color": "#a6e22e",
+ "text-color": "#a6e22e"
+ },
+ "Changed line (new)": {
+ "selected-text-color": "#a6e22e",
+ "text-color": "#a6e22e"
+ },
+ "Changed line (old)": {
+ "selected-text-color": "#f92672",
+ "text-color": "#f92672"
+ },
+ "Removed line": {
+ "selected-text-color": "#f92672",
+ "text-color": "#f92672"
+ }
+ },
+ "Go": {
+ "Builtin Function": {
+ "selected-text-color": "#a6e22e",
+ "text-color": "#a6e22e"
+ },
+ "Predeclared Identifier": {
+ "selected-text-color": "#ae81ff",
+ "text-color": "#ae81ff"
+ }
+ },
+ "ISO C++": {
+ "Attribute": {
+ "selected-text-color": "#f8f8f2",
+ "text-color": "#f8f8f2"
+ },
+ "Boost Stuff": {
+ "bold": false
+ },
+ "Prep. Lib": {
+ "selected-text-color": "#e6db74",
+ "text-color": "#e6db74"
+ },
+ "Standard Attribute": {
+ "selected-text-color": "#f8f8f2",
+ "text-color": "#f8f8f2"
+ },
+ "Standard Macros": {
+ "selected-text-color": "#f92672",
+ "text-color": "#f92672"
+ },
+ "Standard Suffix": {
+ "selected-text-color": "#f92672",
+ "text-color": "#f92672"
+ },
+ "UDL Numeric Suffix": {
+ "selected-text-color": "#f92672",
+ "text-color": "#f92672"
+ },
+ "UDL String Suffix": {
+ "selected-text-color": "#f92672",
+ "text-color": "#f92672"
+ }
+ },
+ "JSON": {
+ "Style_String_Key": {
+ "italic": false,
+ "selected-text-color": "#f92672",
+ "text-color": "#f92672"
+ }
+ },
+ "JavaScript": {
+ "Object Member": {
+ "selected-text-color": "#f8f8f2",
+ "text-color": "#f8f8f2"
+ },
+ "Substitution": {
+ "selected-text-color": "#f92672",
+ "text-color": "#f92672"
+ }
+ },
+ "JavaScript React (JSX)": {
+ "Component Tag": {
+ "bold": false,
+ "selected-text-color": "#66d9ef",
+ "text-color": "#66d9ef"
+ }
+ },
+ "Makefile": {
+ "FuncParam": {
+ "selected-text-color": "#fd971f",
+ "text-color": "#fd971f"
+ },
+ "Target": {
+ "selected-text-color": "#a6e22e",
+ "text-color": "#a6e22e"
+ },
+ "Variable": {
+ "italic": false,
+ "selected-text-color": "#f8f8f2",
+ "text-color": "#f8f8f2"
+ }
+ },
+ "Markdown": {
+ "Emphasis Text": {
+ "selected-text-color": "#66D9EF",
+ "text-color": "#66D9EF"
+ },
+ "Reference-Link ID": {
+ "selected-text-color": "#ae81ff",
+ "text-color": "#ae81ff"
+ },
+ "Reference-Link Name": {
+ "selected-text-color": "#ae81ff",
+ "text-color": "#ae81ff"
+ },
+ "Reference-Link Target": {
+ "selected-text-color": "#ae81ff",
+ "text-color": "#ae81ff"
+ },
+ "Strong Text": {
+ "selected-text-color": "#66d9ef",
+ "text-color": "#66d9ef"
+ }
+ },
+ "Python": {
+ "Import": {
+ "selected-text-color": "#f92672",
+ "text-color": "#f92672"
+ }
+ },
+ "Rust": {
+ "Definition": {
+ "selected-text-color": "#a6e22e",
+ "text-color": "#a6e22e"
+ },
+ "Lifetime": {
+ "selected-text-color": "#f92672",
+ "text-color": "#f92672"
+ },
+ "Macro": {
+ "selected-text-color": "#a6e22e",
+ "text-color": "#a6e22e"
+ },
+ "Self": {
+ "selected-text-color": "#fd971f",
+ "text-color": "#fd971f"
+ }
+ },
+ "TypeScript": {
+ "Function (Built-in)": {
+ "selected-text-color": "#a6e22e",
+ "text-color": "#a6e22e"
+ },
+ "Object Member": {
+ "selected-text-color": "#f8f8f2",
+ "text-color": "#f8f8f2"
+ },
+ "Substitution": {
+ "selected-text-color": "#f92672",
+ "text-color": "#f92672"
+ }
+ },
+ "TypeScript React (TSX)": {
+ "Component Tag": {
+ "bold": false,
+ "selected-text-color": "#66d9ef",
+ "text-color": "#66d9ef"
+ },
+ "Substitution": {
+ "selected-text-color": "#f92672",
+ "text-color": "#f92672"
+ }
+ }
+ },
+ "editor-colors": {
+ "BackgroundColor": "#272822",
+ "BracketMatching": "#5b5a4a",
+ "CodeFolding": "#3a3b32",
+ "CurrentLine": "#3e3d32",
+ "CurrentLineNumber": "#d1d931",
+ "IconBorder": "#272822",
+ "IndentationLine": "#6272a4",
+ "LineNumbers": "#909194",
+ "MarkBookmark": "#66D9EF",
+ "MarkBreakpointActive": "#ff5555",
+ "MarkBreakpointDisabled": "#bd93f9",
+ "MarkBreakpointReached": "#f1fa8c",
+ "MarkError": "#ff5555",
+ "MarkExecution": "#44475a",
+ "MarkWarning": "#ffb86c",
+ "ModifiedLines": "#ff473d",
+ "ReplaceHighlight": "#735d16",
+ "SavedLines": "#20e852",
+ "SearchHighlight": "#245676",
+ "Separator": "#45474e",
+ "SpellChecking": "#ff5555",
+ "TabMarker": "#6272a4",
+ "TemplateBackground": "#23241e",
+ "TemplateFocusedPlaceholder": "#22231d",
+ "TemplatePlaceholder": "#22231d",
+ "TemplateReadOnlyPlaceholder": "#262721",
+ "TextSelection": "#3f413e",
+ "WordWrapMarker": "#282a36"
+ },
+ "metadata": {
+ "copyright": [
+ "SPDX-FileCopyrightText: 2006 Wimer Hazenberg",
+ "SPDX-FileCopyrightText: 2020 Waqar Ahmed <waqar.17a@gmail.com>"
+ ],
+ "license": "SPDX-License-Identifier: MIT",
+ "name": "Monokai",
+ "revision": 5
+ },
+ "text-styles": {
+ "Alert": {
+ "bold": true,
+ "selected-text-color": "#ff5555",
+ "text-color": "#ff5555"
+ },
+ "Annotation": {
+ "selected-text-color": "#75715e",
+ "text-color": "#75715e"
+ },
+ "Attribute": {
+ "selected-text-color": "#f92672",
+ "text-color": "#f92672"
+ },
+ "BaseN": {
+ "selected-text-color": "#ae81ff",
+ "text-color": "#ae81ff"
+ },
+ "BuiltIn": {
+ "selected-text-color": "#66D9EF",
+ "text-color": "#66D9EF"
+ },
+ "Char": {
+ "selected-text-color": "#e6db74",
+ "text-color": "#e6db74"
+ },
+ "Comment": {
+ "selected-text-color": "#75715e",
+ "text-color": "#75715e"
+ },
+ "CommentVar": {
+ "selected-text-color": "#75715e",
+ "text-color": "#75715e"
+ },
+ "Constant": {
+ "selected-text-color": "#ae81ff",
+ "text-color": "#ae81ff"
+ },
+ "ControlFlow": {
+ "selected-text-color": "#f92672",
+ "text-color": "#f92672"
+ },
+ "DataType": {
+ "italic": true,
+ "selected-text-color": "#66d9ef",
+ "text-color": "#66d9ef"
+ },
+ "DecVal": {
+ "selected-text-color": "#ae81ff",
+ "text-color": "#ae81ff"
+ },
+ "Documentation": {
+ "selected-text-color": "#75715e",
+ "text-color": "#75715e"
+ },
+ "Error": {
+ "selected-text-color": "#ff5555",
+ "text-color": "#ff5555",
+ "underline": true
+ },
+ "Extension": {
+ "bold": true,
+ "selected-text-color": "#a6e22e",
+ "text-color": "#a6e22e"
+ },
+ "Float": {
+ "selected-text-color": "#ae81ff",
+ "text-color": "#ae81ff"
+ },
+ "Function": {
+ "selected-text-color": "#a6e22e",
+ "text-color": "#a6e22e"
+ },
+ "Import": {
+ "selected-text-color": "#f92672",
+ "text-color": "#f92672"
+ },
+ "Information": {
+ "selected-text-color": "#f1fa8c",
+ "text-color": "#f1fa8c"
+ },
+ "Keyword": {
+ "selected-text-color": "#f92672",
+ "text-color": "#f92672"
+ },
+ "Normal": {
+ "selected-text-color": "#f8f8f2",
+ "text-color": "#f8f8f2"
+ },
+ "Operator": {
+ "selected-text-color": "#f8f8f2",
+ "text-color": "#f8f8f2"
+ },
+ "Others": {
+ "selected-text-color": "#a6e22e",
+ "text-color": "#a6e22e"
+ },
+ "Preprocessor": {
+ "selected-text-color": "#f92672",
+ "text-color": "#f92672"
+ },
+ "RegionMarker": {
+ "selected-text-color": "#75715e",
+ "text-color": "#75715e"
+ },
+ "SpecialChar": {
+ "selected-text-color": "#ae81ff",
+ "text-color": "#ae81ff"
+ },
+ "SpecialString": {
+ "selected-text-color": "#e6db74",
+ "text-color": "#e6db74"
+ },
+ "String": {
+ "selected-text-color": "#e6db74",
+ "text-color": "#e6db74"
+ },
+ "Variable": {
+ "selected-text-color": "#f8f8f2",
+ "text-color": "#f8f8f2"
+ },
+ "VerbatimString": {
+ "selected-text-color": "#e6db74",
+ "text-color": "#e6db74"
+ },
+ "Warning": {
+ "selected-text-color": "#ff5555",
+ "text-color": "#ff5555"
+ }
+ }
+}
diff --git a/src/libs/3rdparty/syntax-highlighting/data/themes/oblivion.theme b/src/libs/3rdparty/syntax-highlighting/data/themes/oblivion.theme
new file mode 100644
index 0000000000..a433fb883a
--- /dev/null
+++ b/src/libs/3rdparty/syntax-highlighting/data/themes/oblivion.theme
@@ -0,0 +1,179 @@
+{
+ "_comments": [
+ "This theme has been adapted from the GtkSourceView Oblivion theme"
+ ],
+ "metadata": {
+ "copyright": [
+ "SPDX-FileCopyrightText: 2007 Paolo Borelli <pborelli@gnome.org>, GtkSourceView team",
+ "SPDX-FileCopyrightText: 2020 Alexander Schlarb <alexander@ninetailed.ninja>"
+ ],
+ "name": "Oblivion",
+ "revision": 2,
+ "license": "SPDX-License-Identifier: MIT"
+ },
+ "text-styles": {
+ "Alert": {
+ "background-color": "#451e1a",
+ "bold": true,
+ "selected-text-color": "#e85848",
+ "text-color": "#e85848"
+ },
+ "Annotation": {
+ "selected-text-color": "#ad7fa8",
+ "text-color": "#ad7fa8"
+ },
+ "Attribute": {
+ "selected-text-color": "#ad7fa8",
+ "text-color": "#ad7fa8"
+ },
+ "BaseN": {
+ "selected-text-color": "#fce94f",
+ "text-color": "#edd400"
+ },
+ "BuiltIn": {
+ "selected-text-color": "#729fcf",
+ "text-color": "#729fcf"
+ },
+ "Char": {
+ "selected-text-color": "#fcaf3e",
+ "text-color": "#ce5c00"
+ },
+ "Comment": {
+ "selected-text-color": "#8ae234",
+ "text-color": "#30a100"
+ },
+ "CommentVar": {
+ "selected-text-color": "#ad7fa8",
+ "text-color": "#ad7fa8"
+ },
+ "Constant": {
+ "bold": true,
+ "selected-text-color": "#ffffff",
+ "text-color": "#edd400"
+ },
+ "ControlFlow": {
+ "bold": true,
+ "selected-text-color": "#ffffff",
+ "text-color": "#ffffff"
+ },
+ "DataType": {
+ "selected-text-color": "#508ed8",
+ "text-color": "#508ed8"
+ },
+ "DecVal": {
+ "selected-text-color": "#fce94f",
+ "text-color": "#edd400"
+ },
+ "Documentation": {
+ "selected-text-color": "#8ae234",
+ "text-color": "#4e9a06"
+ },
+ "Error": {
+ "selected-text-color": "#e85848",
+ "text-color": "#e85848",
+ "underline": true
+ },
+ "Extension": {
+ "bold": true,
+ "selected-text-color": "#508ed8",
+ "text-color": "#508ed8"
+ },
+ "Float": {
+ "selected-text-color": "#fcaf3e",
+ "text-color": "#ce5c00"
+ },
+ "Function": {
+ "bold": true,
+ "selected-text-color": "#729fcf",
+ "text-color": "#729fcf"
+ },
+ "Import": {
+ "selected-text-color": "#ad7fa8",
+ "text-color": "#ad7fa8"
+ },
+ "Information": {
+ "selected-text-color": "#c0a25f",
+ "text-color": "#c0a25f"
+ },
+ "Keyword": {
+ "bold": true,
+ "selected-text-color": "#ffffff",
+ "text-color": "#ffffff"
+ },
+ "Normal": {
+ "selected-text-color": "#eeeeec",
+ "text-color": "#d3d7c1"
+ },
+ "Operator": {
+ "selected-text-color": "#eeeeec",
+ "text-color": "#eeeeec"
+ },
+ "Others": {
+ "selected-text-color": "#fce94f",
+ "text-color": "#edd400"
+ },
+ "Preprocessor": {
+ "selected-text-color": "#ad7fa8",
+ "text-color": "#ad7fa8"
+ },
+ "RegionMarker": {
+ "background-color": "#1c2c3f",
+ "selected-text-color": "#508ed8",
+ "text-color": "#508ed8"
+ },
+ "SpecialChar": {
+ "selected-text-color": "#fcaf3e",
+ "text-color": "#ce5c00"
+ },
+ "SpecialString": {
+ "selected-text-color": "#fce94f",
+ "text-color": "#fce94f"
+ },
+ "String": {
+ "selected-text-color": "#fce94f",
+ "text-color": "#edd400"
+ },
+ "Variable": {
+ "selected-text-color": "#ce5c00",
+ "text-color": "#ce5c00"
+ },
+ "VerbatimString": {
+ "selected-text-color": "#fce94f",
+ "text-color": "#c4a000"
+ },
+ "Warning": {
+ "selected-text-color": "#e85848",
+ "text-color": "#e85848"
+ }
+ },
+ "editor-colors": {
+ "BackgroundColor": "#201f1f",
+ "BracketMatching": "#8f5902",
+ "CodeFolding": "#19395f",
+ "CurrentLine": "#2e3436",
+ "CurrentLineNumber": "#ffffff",
+ "IconBorder": "#302f2f",
+ "IndentationLine": "#989595",
+ "LineNumbers": "#e0dedb",
+ "MarkBookmark": "#0000cc",
+ "MarkBreakpointActive": "#cc0000",
+ "MarkBreakpointDisabled": "#cc00cc",
+ "MarkBreakpointReached": "#00cc00",
+ "MarkError": "#cc0000",
+ "MarkExecution": "#888a85",
+ "MarkWarning": "#ad7fa8",
+ "ModifiedLines": "#451e1a",
+ "ReplaceHighlight": "#356703",
+ "SavedLines": "#23321a",
+ "SearchHighlight": "#4e9a06",
+ "Separator": "#787775",
+ "SpellChecking": "#e85848",
+ "TabMarker": "#555753",
+ "TemplateBackground": "#302f2f",
+ "TemplateFocusedPlaceholder": "#23321a",
+ "TemplatePlaceholder": "#23321a",
+ "TemplateReadOnlyPlaceholder": "#451e1a",
+ "TextSelection": "#184880",
+ "WordWrapMarker": "#3c3a3a"
+ }
+}
diff --git a/src/libs/3rdparty/syntax-highlighting/data/themes/solarized-dark.theme b/src/libs/3rdparty/syntax-highlighting/data/themes/solarized-dark.theme
index 035e1db9c0..b8d13b31d3 100644
--- a/src/libs/3rdparty/syntax-highlighting/data/themes/solarized-dark.theme
+++ b/src/libs/3rdparty/syntax-highlighting/data/themes/solarized-dark.theme
@@ -9,7 +9,7 @@
"SPDX-FileCopyrightText: 2018 Andrew Crouthamel <andrew.crouthamel@kdemail.net>"
],
"license": "SPDX-License-Identifier: MIT",
- "revision" : 2,
+ "revision" : 5,
"name" : "Solarized Dark"
},
"text-styles": {
@@ -23,8 +23,7 @@
},
"Keyword" : {
"text-color" : "#859900",
- "selected-text-color" : "#859900",
- "bold" : true
+ "selected-text-color" : "#859900"
},
"Function" : {
"text-color" : "#268bd2",
@@ -36,8 +35,7 @@
},
"ControlFlow" : {
"text-color" : "#859900",
- "selected-text-color" : "#859900",
- "bold" : true
+ "selected-text-color" : "#859900"
},
"Operator" : {
"text-color" : "#859900",
@@ -49,8 +47,7 @@
},
"Extension" : {
"text-color" : "#268bd2",
- "selected-text-color" : "#268bd2",
- "bold" : true
+ "selected-text-color" : "#268bd2"
},
"Preprocessor" : {
"text-color" : "#cb4b16",
@@ -86,8 +83,7 @@
},
"DataType" : {
"text-color" : "#b58900",
- "selected-text-color" : "#b58900",
- "bold" : true
+ "selected-text-color" : "#b58900"
},
"DecVal" : {
"text-color" : "#2aa198",
@@ -153,13 +149,13 @@
},
"editor-colors": {
"BackgroundColor" : "#002b36",
- "CodeFolding" : "#6c71c4",
- "BracketMatching" : "#073642",
+ "CodeFolding": "#083d4a",
+ "BracketMatching" : "#083d4a",
"CurrentLine" : "#073642",
"IconBorder" : "#073642",
- "IndentationLine" : "#073642",
+ "IndentationLine" : "#083d4a",
"LineNumbers" : "#586e75",
- "CurrentLineNumber" : "#586e75",
+ "CurrentLineNumber": "#93a1a1",
"MarkBookmark" : "#268bd2",
"MarkBreakpointActive" : "#dc322f",
"MarkBreakpointReached" : "#b58900",
@@ -168,11 +164,11 @@
"MarkWarning" : "#cb4b16",
"MarkError" : "#dc322f",
"ModifiedLines" : "#cb4b16",
- "ReplaceHighlight" : "#859900",
+ "ReplaceHighlight": "#3c4300",
"SavedLines" : "#2aa198",
- "SearchHighlight" : "#b58900",
- "TextSelection" : "#eee8d5",
- "Separator" : "#002b36",
+ "SearchHighlight": "#0a4d5e",
+ "TextSelection": "#083d4a",
+ "Separator" : "#1c3e49",
"SpellChecking" : "#dc322f",
"TabMarker" : "#586e75",
"TemplateBackground" : "#073642",
@@ -180,5 +176,17 @@
"TemplateFocusedPlaceholder" : "#073642",
"TemplateReadOnlyPlaceholder" : "#073642",
"WordWrapMarker" : "#586e75"
+ },
+ "custom-styles": {
+ "XML": {
+ "Element": {
+ "selected-text-color": "#839496",
+ "text-color": "#268bd2"
+ },
+ "Element Symbols": {
+ "selected-text-color": "#586e75",
+ "text-color": "#657b83"
+ }
+ }
}
}
diff --git a/src/libs/3rdparty/syntax-highlighting/data/themes/solarized-light.theme b/src/libs/3rdparty/syntax-highlighting/data/themes/solarized-light.theme
index 8cab40db48..a532b128f8 100644
--- a/src/libs/3rdparty/syntax-highlighting/data/themes/solarized-light.theme
+++ b/src/libs/3rdparty/syntax-highlighting/data/themes/solarized-light.theme
@@ -9,7 +9,7 @@
"SPDX-FileCopyrightText: 2018 Andrew Crouthamel <andrew.crouthamel@kdemail.net>"
],
"license": "SPDX-License-Identifier: MIT",
- "revision" : 2,
+ "revision" : 4,
"name" : "Solarized Light"
},
"text-styles": {
@@ -172,7 +172,7 @@
"SavedLines" : "#2aa198",
"SearchHighlight" : "#b58900",
"TextSelection" : "#073642",
- "Separator" : "#fdf6e3",
+ "Separator" : "#e0dccc",
"SpellChecking" : "#dc322f",
"TabMarker" : "#93a1a1",
"TemplateBackground" : "#eee8d5",
@@ -180,5 +180,17 @@
"TemplateFocusedPlaceholder" : "#eee8d5",
"TemplateReadOnlyPlaceholder" : "#eee8d5",
"WordWrapMarker" : "#93a1a1"
+ },
+ "custom-styles": {
+ "XML": {
+ "Element": {
+ "selected-text-color": "#268bd2",
+ "text-color": "#268bd2"
+ },
+ "Element Symbols": {
+ "selected-text-color": "#93a1a1",
+ "text-color": "#839496"
+ }
+ }
}
}
diff --git a/src/libs/3rdparty/syntax-highlighting/data/themes/theme-data.qrc b/src/libs/3rdparty/syntax-highlighting/data/themes/theme-data.qrc
index 0a6f24385a..fe0a1627be 100644
--- a/src/libs/3rdparty/syntax-highlighting/data/themes/theme-data.qrc
+++ b/src/libs/3rdparty/syntax-highlighting/data/themes/theme-data.qrc
@@ -1,15 +1,21 @@
<!DOCTYPE RCC>
<RCC version="1.0">
<qresource prefix="/org.kde.syntax-highlighting/themes">
+ <file>atom-one-dark.theme</file>
+ <file>atom-one-light.theme</file>
<file>breeze-dark.theme</file>
<file>breeze-light.theme</file>
<file>ayu-dark.theme</file>
<file>ayu-light.theme</file>
<file>ayu-mirage.theme</file>
<file>dracula.theme</file>
+ <file>github-dark.theme</file>
+ <file>github-light.theme</file>
<file>gruvbox-dark.theme</file>
<file>gruvbox-light.theme</file>
+ <file>monokai.theme</file>
<file>nord.theme</file>
+ <file>oblivion.theme</file>
<file>printing.theme</file>
<file>radical.theme</file>
<file>solarized-dark.theme</file>
diff --git a/src/libs/3rdparty/syntax-highlighting/src/cli/CMakeLists.txt b/src/libs/3rdparty/syntax-highlighting/src/cli/CMakeLists.txt
index 113115359e..1a4d24d828 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/cli/CMakeLists.txt
+++ b/src/libs/3rdparty/syntax-highlighting/src/cli/CMakeLists.txt
@@ -2,4 +2,4 @@ add_executable(kate-syntax-highlighter kate-syntax-highlighter.cpp)
ecm_mark_nongui_executable(kate-syntax-highlighter)
target_link_libraries(kate-syntax-highlighter KF5SyntaxHighlighting)
-install(TARGETS kate-syntax-highlighter ${INSTALL_TARGETS_DEFAULT_ARGS})
+install(TARGETS kate-syntax-highlighter ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
diff --git a/src/libs/3rdparty/syntax-highlighting/src/cli/kate-syntax-highlighter.cpp b/src/libs/3rdparty/syntax-highlighting/src/cli/kate-syntax-highlighter.cpp
index a178c1ba27..a009c4f259 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/cli/kate-syntax-highlighter.cpp
+++ b/src/libs/3rdparty/syntax-highlighting/src/cli/kate-syntax-highlighter.cpp
@@ -6,10 +6,10 @@
#include "ksyntaxhighlighting_version.h"
+#include <ansihighlighter.h>
#include <definition.h>
#include <definitiondownloader.h>
#include <htmlhighlighter.h>
-#include <ansihighlighter.h>
#include <repository.h>
#include <theme.h>
@@ -21,8 +21,14 @@
using namespace KSyntaxHighlighting;
-template<class Highlighter, class ...Ts>
-static void applyHighlighter(Highlighter &highlighter, QCommandLineParser &parser, bool fromFileName, const QString &inFileName, const QCommandLineOption &stdinOption, const QCommandLineOption &outputName, const Ts &...highlightParams)
+template<class Highlighter, class... Ts>
+static void applyHighlighter(Highlighter &highlighter,
+ QCommandLineParser &parser,
+ bool fromFileName,
+ const QString &inFileName,
+ const QCommandLineOption &stdinOption,
+ const QCommandLineOption &outputName,
+ const Ts &...highlightParams)
{
if (parser.isSet(outputName))
highlighter.setOutputFile(parser.value(outputName));
@@ -56,16 +62,19 @@ int main(int argc, char **argv)
parser.addVersionOption();
parser.addPositionalArgument(app.translate("SyntaxHighlightingCLI", "source"), app.translate("SyntaxHighlightingCLI", "The source file to highlight."));
- QCommandLineOption listDefs(QStringList() << QStringLiteral("l") << QStringLiteral("list"), app.translate("SyntaxHighlightingCLI", "List all available syntax definitions."));
+ QCommandLineOption listDefs(QStringList() << QStringLiteral("l") << QStringLiteral("list"),
+ app.translate("SyntaxHighlightingCLI", "List all available syntax definitions."));
parser.addOption(listDefs);
QCommandLineOption listThemes(QStringList() << QStringLiteral("list-themes"), app.translate("SyntaxHighlightingCLI", "List all available themes."));
parser.addOption(listThemes);
- QCommandLineOption updateDefs(QStringList() << QStringLiteral("u") << QStringLiteral("update"), app.translate("SyntaxHighlightingCLI", "Download new/updated syntax definitions."));
+ QCommandLineOption updateDefs(QStringList() << QStringLiteral("u") << QStringLiteral("update"),
+ app.translate("SyntaxHighlightingCLI", "Download new/updated syntax definitions."));
parser.addOption(updateDefs);
- QCommandLineOption outputName(
- QStringList() << QStringLiteral("o") << QStringLiteral("output"), app.translate("SyntaxHighlightingCLI", "File to write HTML output to (default: stdout)."), app.translate("SyntaxHighlightingCLI", "output"));
+ QCommandLineOption outputName(QStringList() << QStringLiteral("o") << QStringLiteral("output"),
+ app.translate("SyntaxHighlightingCLI", "File to write HTML output to (default: stdout)."),
+ app.translate("SyntaxHighlightingCLI", "output"));
parser.addOption(outputName);
QCommandLineOption syntaxName(QStringList() << QStringLiteral("s") << QStringLiteral("syntax"),
@@ -73,18 +82,23 @@ int main(int argc, char **argv)
app.translate("SyntaxHighlightingCLI", "syntax"));
parser.addOption(syntaxName);
- QCommandLineOption themeName(
- QStringList() << QStringLiteral("t") << QStringLiteral("theme"), app.translate("SyntaxHighlightingCLI", "Color theme to use for highlighting."), app.translate("SyntaxHighlightingCLI", "theme"), repo.defaultTheme(Repository::LightTheme).name());
+ QCommandLineOption themeName(QStringList() << QStringLiteral("t") << QStringLiteral("theme"),
+ app.translate("SyntaxHighlightingCLI", "Color theme to use for highlighting."),
+ app.translate("SyntaxHighlightingCLI", "theme"),
+ repo.defaultTheme(Repository::LightTheme).name());
parser.addOption(themeName);
- QCommandLineOption outputFormatOption(QStringList() << QStringLiteral("f") << QStringLiteral("output-format"),
- app.translate("SyntaxHighlightingCLI", "Use the specified format instead of html. Must be html, ansi or ansi256Colors."),
- app.translate("SyntaxHighlightingCLI", "format"),
- QStringLiteral("html"));
+ QCommandLineOption outputFormatOption(
+ QStringList() << QStringLiteral("f") << QStringLiteral("output-format"),
+ app.translate("SyntaxHighlightingCLI", "Use the specified format instead of html. Must be html, ansi or ansi256Colors."),
+ app.translate("SyntaxHighlightingCLI", "format"),
+ QStringLiteral("html"));
parser.addOption(outputFormatOption);
QCommandLineOption traceOption(QStringList() << QStringLiteral("syntax-trace"),
- app.translate("SyntaxHighlightingCLI", "Add information to debug a syntax file. Only works with --output-format=ansi or ansi256Colors. Possible values are format, region and context."),
+ app.translate("SyntaxHighlightingCLI",
+ "Add information to debug a syntax file. Only works with --output-format=ansi or ansi256Colors. Possible "
+ "values are format, region, context and stackSize."),
app.translate("SyntaxHighlightingCLI", "type"));
parser.addOption(traceOption);
@@ -92,12 +106,14 @@ int main(int argc, char **argv)
app.translate("SyntaxHighlightingCLI", "Disable ANSI background for the default color."));
parser.addOption(noAnsiEditorBg);
- QCommandLineOption titleOption(QStringList() << QStringLiteral("T") << QStringLiteral("title"),
- app.translate("SyntaxHighlightingCLI", "Set HTML page's title\n(default: the filename or \"Kate Syntax Highlighter\" if reading from stdin)."),
- app.translate("SyntaxHighlightingCLI", "title"));
+ QCommandLineOption titleOption(
+ QStringList() << QStringLiteral("T") << QStringLiteral("title"),
+ app.translate("SyntaxHighlightingCLI", "Set HTML page's title\n(default: the filename or \"Kate Syntax Highlighter\" if reading from stdin)."),
+ app.translate("SyntaxHighlightingCLI", "title"));
parser.addOption(titleOption);
- QCommandLineOption stdinOption(QStringList() << QStringLiteral("stdin"), app.translate("SyntaxHighlightingCLI", "Read file from stdin. The -s option must also be used."));
+ QCommandLineOption stdinOption(QStringList() << QStringLiteral("stdin"),
+ app.translate("SyntaxHighlightingCLI", "Read file from stdin. The -s option must also be used."));
parser.addOption(stdinOption);
parser.process(app);
@@ -117,7 +133,9 @@ int main(int argc, char **argv)
if (parser.isSet(updateDefs)) {
DefinitionDownloader downloader(&repo);
- QObject::connect(&downloader, &DefinitionDownloader::informationMessage, [](const QString &msg) { std::cout << qPrintable(msg) << std::endl; });
+ QObject::connect(&downloader, &DefinitionDownloader::informationMessage, [](const QString &msg) {
+ std::cout << qPrintable(msg) << std::endl;
+ });
QObject::connect(&downloader, &DefinitionDownloader::done, &app, &QCoreApplication::quit);
downloader.start();
return app.exec();
@@ -139,7 +157,7 @@ int main(int argc, char **argv)
def = repo.definitionForMimeType(syntax);
if (!def.isValid()) {
/* see if it's a extension instead */
- def = repo.definitionForFileName(QLatin1String("f.")+syntax);
+ def = repo.definitionForFileName(QLatin1String("f.") + syntax);
if (!def.isValid())
/* see if it's a filename instead */
def = repo.definitionForFileName(syntax);
@@ -178,13 +196,15 @@ int main(int argc, char **argv)
auto debugOptions = AnsiHighlighter::TraceOptions();
if (parser.isSet(traceOption)) {
const auto options = parser.values(traceOption);
- for (auto const& option : options) {
+ for (auto const &option : options) {
if (option == QStringLiteral("format")) {
debugOptions |= AnsiHighlighter::TraceOption::Format;
} else if (option == QStringLiteral("region")) {
debugOptions |= AnsiHighlighter::TraceOption::Region;
} else if (option == QStringLiteral("context")) {
debugOptions |= AnsiHighlighter::TraceOption::Context;
+ } else if (option == QStringLiteral("stackSize")) {
+ debugOptions |= AnsiHighlighter::TraceOption::StackSize;
} else {
std::cerr << "Unknown trace name." << std::endl;
return 2;
diff --git a/src/libs/3rdparty/syntax-highlighting/src/indexer/CMakeLists.txt b/src/libs/3rdparty/syntax-highlighting/src/indexer/CMakeLists.txt
index 9fa26b27ce..508cd276cc 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/indexer/CMakeLists.txt
+++ b/src/libs/3rdparty/syntax-highlighting/src/indexer/CMakeLists.txt
@@ -27,7 +27,7 @@ elseif(CMAKE_CROSSCOMPILING)
${CMAKE_CURRENT_BINARY_DIR}/native_katehighlightingindexer-prefix/src/native_katehighlightingindexer-build/bin/katehighlightingindexer)
else()
# host build
- add_executable(katehighlightingindexer katehighlightingindexer.cpp)
+ add_executable(katehighlightingindexer katehighlightingindexer.cpp ../lib/worddelimiters.cpp)
if(Qt5XmlPatterns_FOUND)
target_link_libraries(katehighlightingindexer Qt5::XmlPatterns)
else()
diff --git a/src/libs/3rdparty/syntax-highlighting/src/indexer/katehighlightingindexer.cpp b/src/libs/3rdparty/syntax-highlighting/src/indexer/katehighlightingindexer.cpp
index b5d04934e6..86b3a38b12 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/indexer/katehighlightingindexer.cpp
+++ b/src/libs/3rdparty/syntax-highlighting/src/indexer/katehighlightingindexer.cpp
@@ -1,14 +1,16 @@
/*
SPDX-FileCopyrightText: 2014 Christoph Cullmann <cullmann@kde.org>
+ SPDX-FileCopyrightText: 2020 Jonathan Poelen <jonathan.poelen@gmail.com>
SPDX-License-Identifier: MIT
*/
+#include <QCborValue>
#include <QCoreApplication>
#include <QDebug>
#include <QFile>
#include <QFileInfo>
-#include <QCborValue>
+#include <QMutableMapIterator>
#include <QRegularExpression>
#include <QVariant>
#include <QXmlStreamReader>
@@ -18,426 +20,2228 @@
#include <QXmlSchemaValidator>
#endif
+#include "../lib/worddelimiters_p.h"
#include "../lib/xml_p.h"
+#include <array>
+
+using KSyntaxHighlighting::WordDelimiters;
using KSyntaxHighlighting::Xml::attrToBool;
-namespace
+class HlFilesChecker
{
-QStringList readListing(const QString &fileName)
-{
- QFile file(fileName);
- if (!file.open(QIODevice::ReadOnly)) {
- return QStringList();
- }
-
- QXmlStreamReader xml(&file);
- QStringList listing;
- while (!xml.atEnd()) {
- xml.readNext();
+public:
+ void setDefinition(const QStringRef &verStr, const QString &filename, const QString &name)
+ {
+ m_currentDefinition = &*m_definitions.insert(name, Definition{});
+ m_currentDefinition->languageName = name;
+ m_currentDefinition->filename = filename;
+ m_currentDefinition->kateVersionStr = verStr.toString();
+ m_currentKeywords = nullptr;
+ m_currentContext = nullptr;
- // add only .xml files, no .json or stuff
- if (xml.isCharacters() && xml.text().toString().contains(QLatin1String(".xml"))) {
- listing.append(xml.text().toString());
+ const auto idx = verStr.indexOf(QLatin1Char('.'));
+ if (idx <= 0) {
+ qWarning() << filename << "invalid kateversion" << verStr;
+ m_success = false;
+ } else {
+ m_currentDefinition->kateVersion = {verStr.left(idx).toInt(), verStr.mid(idx + 1).toInt()};
}
}
- if (xml.hasError()) {
- qWarning() << "XML error while reading" << fileName << " - " << qPrintable(xml.errorString()) << "@ offset" << xml.characterOffset();
- listing.clear();
+ void processElement(QXmlStreamReader &xml)
+ {
+ if (xml.isStartElement()) {
+ if (m_currentContext) {
+ m_currentContext->rules.append(Context::Rule{});
+ auto &rule = m_currentContext->rules.back();
+ m_success = rule.parseElement(m_currentDefinition->filename, xml) && m_success;
+ } else if (m_currentKeywords) {
+ m_success = m_currentKeywords->items.parseElement(m_currentDefinition->filename, xml) && m_success;
+ } else if (xml.name() == QStringLiteral("context")) {
+ processContextElement(xml);
+ } else if (xml.name() == QStringLiteral("list")) {
+ processListElement(xml);
+ } else if (xml.name() == QStringLiteral("keywords")) {
+ m_success = m_currentDefinition->parseKeywords(xml) && m_success;
+ } else if (xml.name() == QStringLiteral("emptyLine")) {
+ m_success = parseEmptyLine(m_currentDefinition->filename, xml) && m_success;
+ } else if (xml.name() == QStringLiteral("itemData")) {
+ m_success = m_currentDefinition->itemDatas.parseElement(m_currentDefinition->filename, xml) && m_success;
+ }
+ } else if (xml.isEndElement()) {
+ if (m_currentContext && xml.name() == QStringLiteral("context")) {
+ m_currentContext = nullptr;
+ } else if (m_currentKeywords && xml.name() == QStringLiteral("list")) {
+ m_currentKeywords = nullptr;
+ }
+ }
}
- return listing;
-}
+ //! Resolve context attribute and include tag
+ void resolveContexts()
+ {
+ QMutableMapIterator<QString, Definition> def(m_definitions);
+ while (def.hasNext()) {
+ def.next();
+ auto &definition = def.value();
+ auto &contexts = definition.contexts;
+
+ if (contexts.isEmpty()) {
+ qWarning() << definition.filename << "has no context";
+ m_success = false;
+ continue;
+ }
-/**
- * check if the "extensions" attribute have valid wildcards
- * @param extensions extensions string to check
- * @return valid?
- */
-bool checkExtensions(const QString &extensions)
-{
- // get list of extensions
-#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
- const QStringList extensionParts = extensions.split(QLatin1Char(';'), QString::SkipEmptyParts);
-#else
- const QStringList extensionParts = extensions.split(QLatin1Char(';'), Qt::SkipEmptyParts);
-#endif
+ QMutableMapIterator<QString, Context> contextIt(contexts);
+ while (contextIt.hasNext()) {
+ contextIt.next();
+ auto &context = contextIt.value();
+ resolveContextName(definition, context, context.lineEndContext, context.line);
+ resolveContextName(definition, context, context.lineEmptyContext, context.line);
+ resolveContextName(definition, context, context.fallthroughContext, context.line);
+ for (auto &rule : context.rules) {
+ resolveContextName(definition, context, rule.context, rule.line);
+ }
+ }
- // ok if empty
- if (extensionParts.isEmpty()) {
- return true;
+ definition.firstContext = &*definition.contexts.find(definition.firstContextName);
+ }
+
+ resolveIncludeRules();
}
- // check that only valid wildcard things are inside the parts
- for (const auto &extension : extensionParts) {
- for (const auto c : extension) {
- // eat normal things
- if (c.isDigit() || c.isLetter()) {
- continue;
+ bool check() const
+ {
+ bool success = m_success;
+
+ const auto usedContexts = extractUsedContexts();
+
+ QMap<const Definition *, const Definition *> maxVersionByDefinitions;
+
+ QMapIterator<QString, Definition> def(m_definitions);
+ while (def.hasNext()) {
+ def.next();
+ const auto &definition = def.value();
+ const auto &filename = definition.filename;
+
+ auto *maxDef = maxKateVersionDefinition(definition, maxVersionByDefinitions);
+ if (maxDef != &definition) {
+ qWarning() << definition.filename << "depends on a language" << maxDef->languageName << "in version" << maxDef->kateVersionStr
+ << ". Please, increase kateversion.";
+ success = false;
}
- // allow some special characters
- if (c == QLatin1Char('.') || c == QLatin1Char('-') || c == QLatin1Char('_') || c == QLatin1Char('+')) {
- continue;
+ QSet<const Keywords *> referencedKeywords;
+ QSet<ItemDatas::Style> usedAttributeNames;
+ success = checkKeywordsList(definition, referencedKeywords) && success;
+ success = checkContexts(definition, referencedKeywords, usedAttributeNames, usedContexts) && success;
+
+ // search for non-existing or unreferenced keyword lists.
+ for (const auto &keywords : definition.keywordsList) {
+ if (!referencedKeywords.contains(&keywords)) {
+ qWarning() << filename << "line" << keywords.line << "unused keyword:" << keywords.name;
+ }
}
- // only allowed wildcard things: '?' and '*'
- if (c == QLatin1Char('?') || c == QLatin1Char('*')) {
- continue;
+ // search for non-existing itemDatas.
+ const auto invalidNames = usedAttributeNames - definition.itemDatas.styleNames;
+ for (const auto &styleName : invalidNames) {
+ qWarning() << filename << "line" << styleName.line << "reference of non-existing itemData attributes:" << styleName.name;
+ success = false;
}
- qWarning() << "invalid character" << c << " seen in extensions wildcard";
- return false;
+ // search for unused itemDatas.
+ const auto unusedNames = definition.itemDatas.styleNames - usedAttributeNames;
+ for (const auto &styleName : unusedNames) {
+ qWarning() << filename << "line" << styleName.line << "unused itemData:" << styleName.name;
+ success = false;
+ }
}
+
+ return success;
}
- // all checks passed
- return true;
-}
+private:
+ enum class XmlBool {
+ Unspecified,
+ False,
+ True,
+ };
-//! Check that a regular expression in a RegExpr rule:
-//! - is not empty
-//! - isValid()
-//! - character ranges such as [A-Z] are valid and not accidentally e.g. [A-z].
-//! - dynamic=true but no place holder used?
-bool checkRegularExpression(const QString &hlFilename, QXmlStreamReader &xml)
-{
- if (xml.name() == QLatin1String("RegExpr") || xml.name() == QLatin1String("emptyLine")) {
- // get right attribute
- const QString string(xml.attributes().value((xml.name() == QLatin1String("RegExpr")) ? QLatin1String("String") : QLatin1String("regexpr")).toString());
+ struct Context;
- // validate regexp
- const QRegularExpression regexp(string);
- if (!regexp.isValid()) {
- qWarning() << hlFilename << "line" << xml.lineNumber() << "broken regex:" << string << "problem:" << regexp.errorString() << "at offset" << regexp.patternErrorOffset();
- return false;
- } else if (string.isEmpty()) {
- qWarning() << hlFilename << "line" << xml.lineNumber() << "empty regex not allowed.";
- return false;
+ struct ContextName {
+ QString name;
+ int popCount = 0;
+ bool stay = false;
+
+ const Context *context = nullptr;
+ };
+
+ struct Parser {
+ const QString &filename;
+ QXmlStreamReader &xml;
+ QXmlStreamAttribute &attr;
+ bool success;
+
+ //! Read a string type attribute, \c sucess = \c false when \p str is not empty
+ //! \return \c true when attr.name() == attrName, otherwise false
+ bool extractString(QString &str, const QString &attrName)
+ {
+ if (attr.name() != attrName)
+ return false;
+
+ str = attr.value().toString();
+ if (str.isEmpty()) {
+ qWarning() << filename << "line" << xml.lineNumber() << attrName << "attribute is empty";
+ success = false;
+ }
+
+ return true;
}
- // catch possible case typos: [A-z] or [a-Z]
- const int azOffset = std::max(string.indexOf(QStringLiteral("A-z")), string.indexOf(QStringLiteral("a-Z")));
- if (azOffset >= 0) {
- qWarning() << hlFilename << "line" << xml.lineNumber() << "broken regex:" << string << "problem: [a-Z] or [A-z] at offset" << azOffset;
- return false;
+ //! Read a bool type attribute, \c sucess = \c false when \p xmlBool is not \c XmlBool::Unspecified.
+ //! \return \c true when attr.name() == attrName, otherwise false
+ bool extractXmlBool(XmlBool &xmlBool, const QString &attrName)
+ {
+ if (attr.name() != attrName)
+ return false;
+
+ xmlBool = attr.value().isNull() ? XmlBool::Unspecified : attrToBool(attr.value()) ? XmlBool::True : XmlBool::False;
+
+ return true;
}
- // dynamic == true and no place holder?
- if (xml.name() == QLatin1String("RegExpr") && attrToBool(xml.attributes().value(QStringLiteral("dynamic")))) {
- static const QRegularExpression placeHolder(QStringLiteral("%\\d+"));
- if (!string.contains(placeHolder)) {
- qWarning() << hlFilename << "line" << xml.lineNumber() << "broken regex:" << string << "problem: dynamic=true but no %\\d+ placeholder";
+ //! Read a positive integer type attribute, \c sucess = \c false when \p positive is already greater than or equal to 0
+ //! \return \c true when attr.name() == attrName, otherwise false
+ bool extractPositive(int &positive, const QString &attrName)
+ {
+ if (attr.name() != attrName)
return false;
+
+ bool ok = true;
+ positive = attr.value().toInt(&ok);
+
+ if (!ok || positive < 0) {
+ qWarning() << filename << "line" << xml.lineNumber() << attrName << "should be a positive integer:" << attr.value();
+ success = false;
}
+
+ return true;
}
- }
- return true;
-}
+ //! Read a color, \c sucess = \c false when \p color is already greater than or equal to 0
+ //! \return \c true when attr.name() == attrName, otherwise false
+ bool checkColor(const QString &attrName)
+ {
+ if (attr.name() != attrName)
+ return false;
-//! Check that keyword list items do not have trailing or leading spaces,
-//! e.g.: <item> keyword </item>
-bool checkItemsTrimmed(const QString &hlFilename, QXmlStreamReader &xml)
-{
- if (xml.name() == QLatin1String("item")) {
- const QString keyword = xml.readElementText();
- if (keyword != keyword.trimmed()) {
- qWarning() << hlFilename << "line" << xml.lineNumber() << "keyword with leading/trailing spaces:" << keyword;
- return false;
+ const auto value = attr.value().toString();
+ if (value.isEmpty() /*|| QColor(value).isValid()*/) {
+ qWarning() << filename << "line" << xml.lineNumber() << attrName << "should be a color:" << attr.value();
+ success = false;
+ }
+
+ return true;
}
- }
- return true;
-}
+ //! Read a QChar, \c sucess = \c false when \p c is not \c '\0' or does not have one char
+ //! \return \c true when attr.name() == attrName, otherwise false
+ bool extractChar(QChar &c, const QString &attrName)
+ {
+ if (attr.name() != attrName)
+ return false;
-//! Checks that DetectChar and Detect2Chars really only have one char
-//! in the attributes 'char' and 'char1'.
-bool checkSingleChars(const QString &hlFilename, QXmlStreamReader &xml)
-{
- const bool testChar1 = xml.name() == QLatin1String("Detect2Chars");
- const bool testChar = testChar1 || xml.name() == QLatin1String("DetectChar");
+ if (attr.value().size() == 1)
+ c = attr.value()[0];
+ else {
+ c = QLatin1Char('_');
+ qWarning() << filename << "line" << xml.lineNumber() << attrName << "must contain exactly one char:" << attr.value();
+ success = false;
+ }
- if (testChar) {
- const QString c = xml.attributes().value(QLatin1String("char")).toString();
- if (c.size() != 1) {
- qWarning() << hlFilename << "line" << xml.lineNumber() << "'char' must contain exactly one char:" << c;
- return false;
+ return true;
}
- }
- if (testChar1) {
- const QString c = xml.attributes().value(QLatin1String("char1")).toString();
- if (c.size() != 1) {
- qWarning() << hlFilename << "line" << xml.lineNumber() << "'char1' must contain exactly one char:" << c;
+ //! \return parsing status when \p isExtracted is \c true, otherwise \c false
+ bool checkIfExtracted(bool isExtracted)
+ {
+ if (isExtracted)
+ return success;
+
+ qWarning() << filename << "line" << xml.lineNumber() << "unknown attribute:" << attr.name();
return false;
}
- }
+ };
- return true;
-}
+ struct Keywords {
+ struct Items {
+ struct Item {
+ QString content;
+ int line;
+
+ friend uint qHash(const Item &item, uint seed = 0)
+ {
+ return qHash(item.content, seed);
+ }
-//! Search for rules with lookAhead="true" and context="#stay".
-//! This would cause an infinite loop.
-bool checkLookAhead(const QString &hlFilename, QXmlStreamReader &xml)
-{
- if (xml.attributes().hasAttribute(QStringLiteral("lookAhead"))) {
- auto lookAhead = xml.attributes().value(QStringLiteral("lookAhead"));
- if (attrToBool(lookAhead)) {
- auto context = xml.attributes().value(QStringLiteral("context"));
- if (context == QStringLiteral("#stay")) {
- qWarning() << hlFilename << "line" << xml.lineNumber() << "Infinite loop: lookAhead with context #stay";
+ friend bool operator==(const Item &item0, const Item &item1)
+ {
+ return item0.content == item1.content;
+ }
+ };
+
+ QVector<Item> keywords;
+ QSet<Item> includes;
+
+ bool parseElement(const QString &filename, QXmlStreamReader &xml)
+ {
+ bool success = true;
+
+ const int line = xml.lineNumber();
+ QString content = xml.readElementText();
+
+ if (content.isEmpty()) {
+ qWarning() << filename << "line" << line << "is empty:" << xml.name();
+ success = false;
+ }
+
+ if (xml.name() == QStringLiteral("include")) {
+ includes.insert({content, line});
+ } else if (xml.name() == QStringLiteral("item")) {
+ keywords.append({content, line});
+ } else {
+ qWarning() << filename << "line" << line << "invalid element:" << xml.name();
+ success = false;
+ }
+
+ return success;
+ }
+ };
+
+ QString name;
+ Items items;
+ int line;
+
+ bool parseElement(const QString &filename, QXmlStreamReader &xml)
+ {
+ line = xml.lineNumber();
+
+ bool success = true;
+ for (auto &attr : xml.attributes()) {
+ Parser parser{filename, xml, attr, success};
+
+ const bool isExtracted = parser.extractString(name, QStringLiteral("name"));
+
+ success = parser.checkIfExtracted(isExtracted);
+ }
+ return success;
+ }
+ };
+
+ struct Context {
+ struct Rule {
+ enum class Type {
+ Unknown,
+ AnyChar,
+ Detect2Chars,
+ DetectChar,
+ DetectIdentifier,
+ DetectSpaces,
+ Float,
+ HlCChar,
+ HlCHex,
+ HlCOct,
+ HlCStringChar,
+ IncludeRules,
+ Int,
+ LineContinue,
+ RangeDetect,
+ RegExpr,
+ StringDetect,
+ WordDetect,
+ keyword,
+ };
+
+ Type type{};
+
+ bool isDotRegex = false;
+ int line = -1;
+
+ // commonAttributes
+ QString attribute;
+ ContextName context;
+ QString beginRegion;
+ QString endRegion;
+ int column = -1;
+ XmlBool lookAhead{};
+ XmlBool firstNonSpace{};
+
+ // StringDetect, WordDetect, keyword
+ XmlBool insensitive{};
+
+ // DetectChar, StringDetect, RegExpr, keyword
+ XmlBool dynamic{};
+
+ // Regex
+ XmlBool minimal{};
+
+ // DetectChar, Detect2Chars, LineContinue, RangeDetect
+ QChar char0;
+ // Detect2Chars, RangeDetect
+ QChar char1;
+
+ // AnyChar, DetectChar, StringDetect, RegExpr, WordDetect, keyword
+ QString string;
+
+ // Float, HlCHex, HlCOct, Int, WordDetect, keyword
+ QString additionalDeliminator;
+ QString weakDeliminator;
+
+ // rules included by IncludeRules
+ QVector<const Rule *> includedRules;
+
+ // IncludeRules included by IncludeRules
+ QSet<const Rule *> includedIncludeRules;
+
+ QString filename;
+
+ bool parseElement(const QString &filename, QXmlStreamReader &xml)
+ {
+ this->filename = filename;
+
+ line = xml.lineNumber();
+
+ using Pair = QPair<QString, Type>;
+ static const auto pairs = {
+ Pair{QStringLiteral("AnyChar"), Type::AnyChar},
+ Pair{QStringLiteral("Detect2Chars"), Type::Detect2Chars},
+ Pair{QStringLiteral("DetectChar"), Type::DetectChar},
+ Pair{QStringLiteral("DetectIdentifier"), Type::DetectIdentifier},
+ Pair{QStringLiteral("DetectSpaces"), Type::DetectSpaces},
+ Pair{QStringLiteral("Float"), Type::Float},
+ Pair{QStringLiteral("HlCChar"), Type::HlCChar},
+ Pair{QStringLiteral("HlCHex"), Type::HlCHex},
+ Pair{QStringLiteral("HlCOct"), Type::HlCOct},
+ Pair{QStringLiteral("HlCStringChar"), Type::HlCStringChar},
+ Pair{QStringLiteral("IncludeRules"), Type::IncludeRules},
+ Pair{QStringLiteral("Int"), Type::Int},
+ Pair{QStringLiteral("LineContinue"), Type::LineContinue},
+ Pair{QStringLiteral("RangeDetect"), Type::RangeDetect},
+ Pair{QStringLiteral("RegExpr"), Type::RegExpr},
+ Pair{QStringLiteral("StringDetect"), Type::StringDetect},
+ Pair{QStringLiteral("WordDetect"), Type::WordDetect},
+ Pair{QStringLiteral("keyword"), Type::keyword},
+ };
+
+ for (auto pair : pairs) {
+ if (xml.name() == pair.first) {
+ type = pair.second;
+ bool success = parseAttributes(filename, xml);
+ success = checkMandoryAttributes(filename, xml) && success;
+ if (success && type == Type::RegExpr) {
+ // ., (.) followed by *, +, {1} or nothing
+ static const QRegularExpression isDot(QStringLiteral(R"(^\(?\.(?:[*+][*+?]?|[*+]|\{1\})?\$?$)"));
+ // remove "(?:" and ")"
+ static const QRegularExpression removeParentheses(QStringLiteral(R"(\((?:\?:)?|\))"));
+ // remove parentheses on a double from the string
+ auto reg = QString(string).replace(removeParentheses, QString());
+ isDotRegex = reg.contains(isDot);
+ }
+ return success;
+ }
+ }
+
+ qWarning() << filename << "line" << xml.lineNumber() << "unknown element:" << xml.name();
return false;
}
+
+ private:
+ bool parseAttributes(const QString &filename, QXmlStreamReader &xml)
+ {
+ bool success = true;
+
+ for (auto &attr : xml.attributes()) {
+ Parser parser{filename, xml, attr, success};
+ XmlBool includeAttrib{};
+
+ // clang-format off
+ const bool isExtracted
+ = parser.extractString(attribute, QStringLiteral("attribute"))
+ || parser.extractString(context.name, QStringLiteral("context"))
+ || parser.extractXmlBool(lookAhead, QStringLiteral("lookAhead"))
+ || parser.extractXmlBool(firstNonSpace, QStringLiteral("firstNonSpace"))
+ || parser.extractString(beginRegion, QStringLiteral("beginRegion"))
+ || parser.extractString(endRegion, QStringLiteral("endRegion"))
+ || parser.extractPositive(column, QStringLiteral("column"))
+ || ((type == Type::RegExpr
+ || type == Type::StringDetect
+ || type == Type::WordDetect
+ || type == Type::keyword
+ ) && parser.extractXmlBool(insensitive, QStringLiteral("insensitive")))
+ || ((type == Type::DetectChar
+ || type == Type::RegExpr
+ || type == Type::StringDetect
+ || type == Type::keyword
+ ) && parser.extractXmlBool(dynamic, QStringLiteral("dynamic")))
+ || ((type == Type::RegExpr)
+ && parser.extractXmlBool(minimal, QStringLiteral("minimal")))
+ || ((type == Type::DetectChar
+ || type == Type::Detect2Chars
+ || type == Type::LineContinue
+ || type == Type::RangeDetect
+ ) && parser.extractChar(char0, QStringLiteral("char")))
+ || ((type == Type::Detect2Chars
+ || type == Type::RangeDetect
+ ) && parser.extractChar(char1, QStringLiteral("char1")))
+ || ((type == Type::AnyChar
+ || type == Type::RegExpr
+ || type == Type::StringDetect
+ || type == Type::WordDetect
+ || type == Type::keyword
+ ) && parser.extractString(string, QStringLiteral("String")))
+ || ((type == Type::IncludeRules)
+ && parser.extractXmlBool(includeAttrib, QStringLiteral("includeAttrib")))
+ || ((type == Type::Float
+ || type == Type::HlCHex
+ || type == Type::HlCOct
+ || type == Type::Int
+ || type == Type::keyword
+ || type == Type::WordDetect
+ ) && (parser.extractString(additionalDeliminator, QStringLiteral("additionalDeliminator"))
+ || parser.extractString(weakDeliminator, QStringLiteral("weakDeliminator"))))
+ ;
+ // clang-format on
+
+ success = parser.checkIfExtracted(isExtracted);
+
+ if (type == Type::LineContinue && char0 == QLatin1Char('\0')) {
+ char0 = QLatin1Char('\\');
+ }
+ }
+
+ return success;
+ }
+
+ bool checkMandoryAttributes(const QString &filename, QXmlStreamReader &xml)
+ {
+ QString missingAttr;
+
+ switch (type) {
+ case Type::Unknown:
+ return false;
+
+ case Type::AnyChar:
+ case Type::RegExpr:
+ case Type::StringDetect:
+ case Type::WordDetect:
+ case Type::keyword:
+ missingAttr = string.isEmpty() ? QStringLiteral("String") : QString();
+ break;
+
+ case Type::DetectChar:
+ missingAttr = !char0.unicode() ? QStringLiteral("char") : QString();
+ break;
+
+ case Type::Detect2Chars:
+ case Type::RangeDetect:
+ missingAttr = !char0.unicode() && !char1.unicode() ? QStringLiteral("char and char1")
+ : !char0.unicode() ? QStringLiteral("char")
+ : !char1.unicode() ? QStringLiteral("char1")
+ : QString();
+ break;
+
+ case Type::IncludeRules:
+ missingAttr = context.name.isEmpty() ? QStringLiteral("context") : QString();
+ break;
+
+ case Type::DetectIdentifier:
+ case Type::DetectSpaces:
+ case Type::Float:
+ case Type::HlCChar:
+ case Type::HlCHex:
+ case Type::HlCOct:
+ case Type::HlCStringChar:
+ case Type::Int:
+ case Type::LineContinue:
+ break;
+ }
+
+ if (!missingAttr.isEmpty()) {
+ qWarning() << filename << "line" << xml.lineNumber() << "missing attribute:" << missingAttr;
+ return false;
+ }
+
+ return true;
+ }
+ };
+
+ int line;
+ QString name;
+ QString attribute;
+ ContextName lineEndContext;
+ ContextName lineEmptyContext;
+ ContextName fallthroughContext;
+ QVector<Rule> rules;
+ XmlBool dynamic{};
+ XmlBool fallthrough{};
+
+ bool parseElement(const QString &filename, QXmlStreamReader &xml)
+ {
+ line = xml.lineNumber();
+
+ bool success = true;
+
+ for (auto &attr : xml.attributes()) {
+ Parser parser{filename, xml, attr, success};
+ XmlBool noIndentationBasedFolding{};
+
+ const bool isExtracted = parser.extractString(name, QStringLiteral("name")) || parser.extractString(attribute, QStringLiteral("attribute"))
+ || parser.extractString(lineEndContext.name, QStringLiteral("lineEndContext"))
+ || parser.extractString(lineEmptyContext.name, QStringLiteral("lineEmptyContext"))
+ || parser.extractString(fallthroughContext.name, QStringLiteral("fallthroughContext"))
+ || parser.extractXmlBool(dynamic, QStringLiteral("dynamic")) || parser.extractXmlBool(fallthrough, QStringLiteral("fallthrough"))
+ || parser.extractXmlBool(noIndentationBasedFolding, QStringLiteral("noIndentationBasedFolding"));
+
+ success = parser.checkIfExtracted(isExtracted);
+ }
+
+ if (name.isEmpty()) {
+ qWarning() << filename << "line" << xml.lineNumber() << "missing attribute: name";
+ success = false;
+ }
+
+ if (attribute.isEmpty()) {
+ qWarning() << filename << "line" << xml.lineNumber() << "missing attribute: attribute";
+ success = false;
+ }
+
+ if (lineEndContext.name.isEmpty()) {
+ qWarning() << filename << "line" << xml.lineNumber() << "missing attribute: lineEndContext";
+ success = false;
+ }
+
+ return success;
}
+ };
+
+ struct Version {
+ int majorRevision;
+ int minorRevision;
+
+ Version(int majorRevision = 0, int minorRevision = 0)
+ : majorRevision(majorRevision)
+ , minorRevision(minorRevision)
+ {
+ }
+
+ bool operator<(const Version &version) const
+ {
+ return majorRevision < version.majorRevision || (majorRevision == version.majorRevision && minorRevision < version.minorRevision);
+ }
+ };
+
+ struct ItemDatas {
+ struct Style {
+ QString name;
+ int line;
+
+ friend uint qHash(const Style &style, uint seed = 0)
+ {
+ return qHash(style.name, seed);
+ }
+
+ friend bool operator==(const Style &style0, const Style &style1)
+ {
+ return style0.name == style1.name;
+ }
+ };
+
+ QSet<Style> styleNames;
+
+ bool parseElement(const QString &filename, QXmlStreamReader &xml)
+ {
+ bool success = true;
+
+ QString name;
+ QString defStyleNum;
+ XmlBool boolean;
+
+ for (auto &attr : xml.attributes()) {
+ Parser parser{filename, xml, attr, success};
+
+ const bool isExtracted = parser.extractString(name, QStringLiteral("name")) || parser.extractString(defStyleNum, QStringLiteral("defStyleNum"))
+ || parser.extractXmlBool(boolean, QStringLiteral("bold")) || parser.extractXmlBool(boolean, QStringLiteral("italic"))
+ || parser.extractXmlBool(boolean, QStringLiteral("underline")) || parser.extractXmlBool(boolean, QStringLiteral("strikeOut"))
+ || parser.extractXmlBool(boolean, QStringLiteral("spellChecking")) || parser.checkColor(QStringLiteral("color"))
+ || parser.checkColor(QStringLiteral("selColor")) || parser.checkColor(QStringLiteral("backgroundColor"))
+ || parser.checkColor(QStringLiteral("selBackgroundColor"));
+
+ success = parser.checkIfExtracted(isExtracted);
+ }
+
+ if (!name.isEmpty()) {
+ const auto len = styleNames.size();
+ styleNames.insert({name, int(xml.lineNumber())});
+ if (len == styleNames.size()) {
+ qWarning() << filename << "line" << xml.lineNumber() << "itemData duplicate:" << name;
+ success = false;
+ }
+ }
+
+ return success;
+ }
+ };
+
+ struct Definition {
+ QMap<QString, Keywords> keywordsList;
+ QMap<QString, Context> contexts;
+ ItemDatas itemDatas;
+ QString firstContextName;
+ const Context *firstContext = nullptr;
+ QString filename;
+ WordDelimiters wordDelimiters;
+ XmlBool casesensitive{};
+ Version kateVersion{};
+ QString kateVersionStr;
+ QString languageName;
+ QSet<const Definition *> referencedDefinitions;
+
+ // Parse <keywords ...>
+ bool parseKeywords(QXmlStreamReader &xml)
+ {
+ wordDelimiters.append(xml.attributes().value(QStringLiteral("additionalDeliminator")));
+ wordDelimiters.remove(xml.attributes().value(QStringLiteral("weakDeliminator")));
+ return true;
+ }
+ };
+
+ // Parse <context>
+ void processContextElement(QXmlStreamReader &xml)
+ {
+ Context context;
+ m_success = context.parseElement(m_currentDefinition->filename, xml) && m_success;
+ if (m_currentDefinition->firstContextName.isEmpty())
+ m_currentDefinition->firstContextName = context.name;
+ if (m_currentDefinition->contexts.contains(context.name)) {
+ qWarning() << m_currentDefinition->filename << "line" << xml.lineNumber() << "duplicate context:" << context.name;
+ m_success = false;
+ }
+ m_currentContext = &*m_currentDefinition->contexts.insert(context.name, context);
}
- return true;
-}
-/**
- * Helper class to search for non-existing keyword include.
- */
-class KeywordIncludeChecker
-{
-public:
- void processElement(const QString &hlFilename, const QString &hlName, QXmlStreamReader &xml)
+ // Parse <list name="...">
+ void processListElement(QXmlStreamReader &xml)
{
- if (xml.name() == QLatin1String("list")) {
- auto &keywords = m_keywordMap[hlName];
- keywords.filename = hlFilename;
- auto name = xml.attributes().value(QLatin1String("name")).toString();
- m_currentIncludes = &keywords.includes[name];
- } else if (xml.name() == QLatin1String("include")) {
- if (!m_currentIncludes) {
- qWarning() << hlFilename << "line" << xml.lineNumber() << "<include> tag ouside <list>";
- m_success = false;
- } else {
- m_currentIncludes->push_back({xml.lineNumber(), xml.readElementText()});
+ Keywords keywords;
+ m_success = keywords.parseElement(m_currentDefinition->filename, xml) && m_success;
+ if (m_currentDefinition->keywordsList.contains(keywords.name)) {
+ qWarning() << m_currentDefinition->filename << "line" << xml.lineNumber() << "duplicate list:" << keywords.name;
+ m_success = false;
+ }
+ m_currentKeywords = &*m_currentDefinition->keywordsList.insert(keywords.name, keywords);
+ }
+
+ const Definition *maxKateVersionDefinition(const Definition &definition, QMap<const Definition *, const Definition *> &maxVersionByDefinitions) const
+ {
+ auto it = maxVersionByDefinitions.find(&definition);
+ if (it != maxVersionByDefinitions.end()) {
+ return it.value();
+ } else {
+ auto it = maxVersionByDefinitions.insert(&definition, &definition);
+ for (const auto &referencedDef : definition.referencedDefinitions) {
+ auto *maxDef = maxKateVersionDefinition(*referencedDef, maxVersionByDefinitions);
+ if (it.value()->kateVersion < maxDef->kateVersion) {
+ it.value() = maxDef;
+ }
}
+ return it.value();
}
}
- bool check() const
+ // Initialize the referenced rules (Rule::includedRules)
+ void resolveIncludeRules()
{
- bool success = m_success;
- for (auto &keywords : m_keywordMap) {
- QMapIterator<QString, QVector<Keywords::Include>> includes(keywords.includes);
- while (includes.hasNext()) {
- includes.next();
- for (auto &include : includes.value()) {
- bool containsKeywordName = true;
- int const idx = include.name.indexOf(QStringLiteral("##"));
- if (idx == -1) {
- auto &keywordName = includes.key();
- containsKeywordName = keywords.includes.contains(keywordName);
- } else {
- auto defName = include.name.mid(idx + 2);
- auto listName = include.name.left(idx);
- auto it = m_keywordMap.find(defName);
- if (it == m_keywordMap.end()) {
- qWarning() << keywords.filename << "line" << include.line << "unknown definition in" << include.name;
- success = false;
- } else {
- containsKeywordName = it->includes.contains(listName);
- }
+ QSet<const Context *> usedContexts;
+ QVector<const Context *> contexts;
+
+ QMutableMapIterator<QString, Definition> def(m_definitions);
+ while (def.hasNext()) {
+ def.next();
+ auto &definition = def.value();
+ QMutableMapIterator<QString, Context> contextIt(definition.contexts);
+ while (contextIt.hasNext()) {
+ contextIt.next();
+ for (auto &rule : contextIt.value().rules) {
+ if (rule.type != Context::Rule::Type::IncludeRules) {
+ continue;
}
- if (!containsKeywordName) {
- qWarning() << keywords.filename << "line" << include.line << "unknown keyword name in" << include.name;
- success = false;
+ if (rule.context.stay) {
+ qWarning() << definition.filename << "line" << rule.line << "IncludeRules refers to himself";
+ m_success = false;
+ continue;
+ }
+ if (rule.context.popCount) {
+ qWarning() << definition.filename << "line" << rule.line << "IncludeRules with #pop prefix";
+ m_success = false;
+ }
+
+ if (!rule.context.context) {
+ m_success = false;
+ continue;
+ }
+
+ usedContexts.clear();
+ usedContexts.insert(rule.context.context);
+ contexts.clear();
+ contexts.append(rule.context.context);
+
+ for (int i = 0; i < contexts.size(); ++i) {
+ for (const auto &includedRule : contexts[i]->rules) {
+ if (includedRule.type != Context::Rule::Type::IncludeRules) {
+ rule.includedRules.append(&includedRule);
+ } else if (&rule == &includedRule) {
+ qWarning() << definition.filename << "line" << rule.line << "IncludeRules refers to himself by recursivity";
+ m_success = false;
+ } else {
+ rule.includedIncludeRules.insert(&includedRule);
+
+ if (includedRule.includedRules.isEmpty()) {
+ const auto *context = includedRule.context.context;
+ if (context && !usedContexts.contains(context)) {
+ contexts.append(context);
+ usedContexts.insert(context);
+ }
+ } else {
+ rule.includedRules.append(includedRule.includedRules);
+ }
+ }
+ }
}
}
}
}
- return success;
}
-private:
- struct Keywords {
- QString filename;
- struct Include {
- qint64 line;
- QString name;
- };
- QMap<QString, QVector<Include>> includes;
- };
- QHash<QString, Keywords> m_keywordMap;
- QVector<Keywords::Include> *m_currentIncludes = nullptr;
- bool m_success = true;
-};
+ //! Recursively extracts the contexts used from the first context of the definitions.
+ //! This method detects groups of contexts which are only used among themselves.
+ QSet<const Context *> extractUsedContexts() const
+ {
+ QSet<const Context *> usedContexts;
+ QVector<const Context *> contexts;
+
+ QMapIterator<QString, Definition> def(m_definitions);
+ while (def.hasNext()) {
+ def.next();
+ const auto &definition = def.value();
+
+ if (definition.firstContext) {
+ usedContexts.insert(definition.firstContext);
+ contexts.clear();
+ contexts.append(definition.firstContext);
+
+ for (int i = 0; i < contexts.size(); ++i) {
+ auto appendContext = [&](const Context *context) {
+ if (context && !usedContexts.contains(context)) {
+ contexts.append(context);
+ usedContexts.insert(context);
+ }
+ };
-/**
- * Helper class to search for non-existing or unreferenced keyword lists.
- */
-class KeywordChecker
-{
-public:
- KeywordChecker(const QString &filename)
- : m_filename(filename)
+ const auto *context = contexts[i];
+ appendContext(context->lineEndContext.context);
+ appendContext(context->lineEmptyContext.context);
+ appendContext(context->fallthroughContext.context);
+
+ for (auto &rule : context->rules) {
+ appendContext(rule.context.context);
+ }
+ }
+ }
+ }
+
+ return usedContexts;
+ }
+
+ //! Check contexts and rules
+ bool checkContexts(const Definition &definition,
+ QSet<const Keywords *> &referencedKeywords,
+ QSet<ItemDatas::Style> &usedAttributeNames,
+ const QSet<const Context *> &usedContexts) const
{
+ bool success = true;
+
+ QMapIterator<QString, Context> contextIt(definition.contexts);
+ while (contextIt.hasNext()) {
+ contextIt.next();
+
+ const auto &context = contextIt.value();
+ const auto &filename = definition.filename;
+
+ if (!usedContexts.contains(&context)) {
+ qWarning() << filename << "line" << context.line << "unused context:" << context.name;
+ success = false;
+ continue;
+ }
+
+ if (context.name.startsWith(QStringLiteral("#pop"))) {
+ qWarning() << filename << "line" << context.line << "the context name must not start with '#pop':" << context.name;
+ success = false;
+ }
+
+ if (!context.attribute.isEmpty())
+ usedAttributeNames.insert({context.attribute, context.line});
+
+ success = checkfallthrough(definition, context) && success;
+ success = checkUreachableRules(definition.filename, context) && success;
+ success = suggestRuleMerger(definition.filename, context) && success;
+
+ for (const auto &rule : context.rules) {
+ if (!rule.attribute.isEmpty())
+ usedAttributeNames.insert({rule.attribute, rule.line});
+ success = checkLookAhead(rule) && success;
+ success = checkStringDetect(rule) && success;
+ success = checkAnyChar(rule) && success;
+ success = checkKeyword(definition, rule, referencedKeywords) && success;
+ success = checkRegExpr(filename, rule, context) && success;
+ success = checkDelimiters(definition, rule) && success;
+ }
+ }
+
+ return success;
}
- void processElement(QXmlStreamReader &xml)
+ //! Check that a regular expression in a RegExpr rule:
+ //! - isValid()
+ //! - character ranges such as [A-Z] are valid and not accidentally e.g. [A-z].
+ //! - dynamic=true but no place holder used?
+ //! - is not . with lookAhead="1"
+ //! - is not ^... without column ou firstNonSpace attribute
+ //! - is not equivalent to DetectSpaces, DetectChar, Detect2Chars, StringDetect, DetectIdentifier, RangeDetect
+ //! - has no unused captures
+ //! - has no unnecessary quantifier with lookAhead
+ bool checkRegExpr(const QString &filename, const Context::Rule &rule, const Context &context) const
{
- if (xml.name() == QLatin1String("list")) {
- const QString name = xml.attributes().value(QLatin1String("name")).toString();
- if (m_existingNames.contains(name)) {
- qWarning() << m_filename << "list duplicate:" << name;
- m_success = false;
+ if (rule.type == Context::Rule::Type::RegExpr) {
+ const QRegularExpression regexp(rule.string);
+ if (!checkRegularExpression(rule.filename, regexp, rule.line)) {
+ return false;
+ }
+
+ // dynamic == true and no place holder?
+ if (rule.dynamic == XmlBool::True) {
+ static const QRegularExpression placeHolder(QStringLiteral("%\\d+"));
+ if (!rule.string.contains(placeHolder)) {
+ qWarning() << rule.filename << "line" << rule.line << "broken regex:" << rule.string << "problem: dynamic=true but no %\\d+ placeholder";
+ return false;
+ }
+ }
+
+ auto reg = rule.string;
+ reg.replace(QStringLiteral("{1}"), QString());
+
+ // is DetectSpaces
+ // optional ^ then \s, [\s], [\t ], [ \t] possibly in (...) or (?:...) followed by *, +
+ static const QRegularExpression isDetectSpaces(
+ QStringLiteral(R"(^\^?(?:\((?:\?:)?)?\^?(?:\\s|\[(?:\\s| (?:\t|\\t)|(?:\t|\\t) )\])\)?(?:[*+][*+?]?|[*+])?\)?\)?$)"));
+ if (rule.string.contains(isDetectSpaces)) {
+ char const *extraMsg = rule.string.contains(QLatin1Char('^')) ? "+ column=\"0\" or firstNonSpace=\"1\"" : "";
+ qWarning() << rule.filename << "line" << rule.line << "RegExpr should be replaced by DetectSpaces / DetectChar / AnyChar" << extraMsg << ":"
+ << rule.string;
+ return false;
+ }
+
+ // is RangeDetect
+ static const QRegularExpression isRange(QStringLiteral(
+ R"(^(\\(?:[^0BDPSWbdpswoux]|x[0-9a-fA-F]{2}|x\{[0-9a-fA-F]+\}|0\d\d|o\{[0-7]+\}|u[0-9a-fA-F]{4})|[^[.]|\[[^].\\]\])(?:\.|\[^\1\])\*[?*]?\1$)"));
+ if (( rule.lookAhead == XmlBool::True
+ || rule.minimal == XmlBool::True
+ || rule.string.contains(QStringLiteral(".*?"))
+ || rule.string.contains(QStringLiteral("[^"))
+ ) && reg.contains(isRange)
+ ) {
+ qWarning() << filename << "line" << rule.line << "RegExpr should be replaced by RangeDetect:" << rule.string;
+ return false;
+ }
+
+ // replace \c, \xhhh, \x{hhh...}, \0dd, \o{ddd}, \uhhhh, with _
+ static const QRegularExpression sanitize1(
+ QStringLiteral(R"(\\(?:[^0BDPSWbdpswoux]|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(sanitize1, QStringLiteral("_"));
+
+ // use minimal or lazy operator
+ static const QRegularExpression isMinimal(QStringLiteral(
+ R"([.][*+][^][?+*()|$]*$)"));
+ if (rule.lookAhead == XmlBool::True
+ && rule.minimal != XmlBool::True
+ && reg.contains(isMinimal)
+ ) {
+ qWarning() << filename << "line" << rule.line << "RegExpr should be have minimal=\"1\" or use lazy operator (i.g, '.*' -> '.*?'):" << rule.string;
+ return false;
+ }
+
+ // replace [:...:] with ___
+ static const QRegularExpression sanitize2(QStringLiteral(R"(\[:\w+:\])"));
+ reg.replace(sanitize2, QStringLiteral("___"));
+
+ // replace [ccc...], [special] with ...
+ static const QRegularExpression sanitize3(QStringLiteral(R"(\[(?:\^\]?[^]]*|\]?[^]\\]*?\\.[^]]*|\][^]]{2,}|[^]]{3,})\]|(\[\]?[^]]*\]))"));
+ reg.replace(sanitize3, QStringLiteral("...\\1"));
+
+ // replace [c] with _
+ static const QRegularExpression sanitize4(QStringLiteral(R"(\[.\])"));
+ reg.replace(sanitize4, QStringLiteral("_"));
+
+ const int len = reg.size();
+ // replace [cC] with _
+ static const QRegularExpression toInsensitive(QStringLiteral(R"(\[(?:([^]])\1)\])"));
+ reg = reg.toUpper();
+ reg.replace(toInsensitive, QString());
+
+ // is StringDetect
+ // ignore (?:, ) and {n}
+ static const QRegularExpression isStringDetect(QStringLiteral(R"(^\^?(?:[^|\\?*+$^[{(.]|{(?!\d+,\d*}|,\d+})|\(\?:)+$)"));
+ if (reg.contains(isStringDetect)) {
+ char const *extraMsg = rule.string.contains(QLatin1Char('^')) ? "+ column=\"0\" or firstNonSpace=\"1\"" : "";
+ qWarning() << rule.filename << "line" << rule.line << "RegExpr should be replaced by StringDetect / Detect2Chars / DetectChar" << extraMsg
+ << ":" << rule.string;
+ if (len != reg.size())
+ qWarning() << rule.filename << "line" << rule.line << "insensitive=\"1\" missing:" << rule.string;
+ return false;
+ }
+
+ // column="0" or firstNonSpace="1"
+ if (rule.column == -1 && rule.firstNonSpace != XmlBool::True) {
+ // ^ without |
+ // (^sas*) -> ok
+ // (^sa|s*) -> ko
+ // (^(sa|s*)) -> ok
+ auto first = qAsConst(reg).begin();
+ auto last = qAsConst(reg).end();
+ int depth = 0;
+
+ while (QLatin1Char('(') == *first) {
+ ++depth;
+ ++first;
+ if (QLatin1Char('?') == *first || QLatin1Char(':') == first[1]) {
+ first += 2;
+ }
+ }
+
+ if (QLatin1Char('^') == *first) {
+ const int bolDepth = depth;
+ bool replace = true;
+
+ while (++first != last) {
+ if (QLatin1Char('(') == *first) {
+ ++depth;
+ } else if (QLatin1Char(')') == *first) {
+ --depth;
+ if (depth < bolDepth) {
+ // (^a)? === (^a|) -> ko
+ if (first + 1 != last && QStringLiteral("*?").contains(first[1])) {
+ replace = false;
+ break;
+ }
+ }
+ } else if (QLatin1Char('|') == *first) {
+ // ignore '|' within subgroup
+ if (depth <= bolDepth) {
+ replace = false;
+ break;
+ }
+ }
+ }
+
+ if (replace) {
+ qWarning() << rule.filename << "line" << rule.line << "column=\"0\" or firstNonSpace=\"1\" missing with RegExpr:" << rule.string;
+ return false;
+ }
+ }
+ }
+
+ // add ^ with column=0
+ if (rule.column == 0 && !rule.isDotRegex) {
+ bool hasStartOfLine = false;
+ auto first = qAsConst(reg).begin();
+ auto last = qAsConst(reg).end();
+ for (; first != last; ++first) {
+ if (*first == QLatin1Char('^')) {
+ hasStartOfLine = true;
+ break;
+ }
+ else if (*first == QLatin1Char('(')) {
+ if (last - first >= 3 && first[1] == QLatin1Char('?') && first[2] == QLatin1Char(':')) {
+ first += 2;
+ }
+ }
+ else {
+ break;
+ }
+ }
+
+ if (!hasStartOfLine) {
+ qWarning() << rule.filename << "line" << rule.line << "start of line missing in the pattern with column=\"0\" (i.e. abc -> ^abc):" << rule.string;
+ return false;
+ }
+ }
+
+ bool useCapture = false;
+
+ // detection of unnecessary capture
+ if (regexp.captureCount()) {
+ auto maximalCapture = [](const QString(&referenceNames)[9], const QString &s) {
+ int maxCapture = 9;
+ while (maxCapture && !s.contains(referenceNames[maxCapture - 1])) {
+ --maxCapture;
+ }
+ return maxCapture;
+ };
+
+ int maxCaptureUsed = 0;
+ // maximal dynamic reference
+ if (rule.context.context && !rule.context.stay) {
+ for (const auto &nextRule : rule.context.context->rules) {
+ if (nextRule.dynamic == XmlBool::True) {
+ static const QString cap[]{
+ QStringLiteral("%1"),
+ QStringLiteral("%2"),
+ QStringLiteral("%3"),
+ QStringLiteral("%4"),
+ QStringLiteral("%5"),
+ QStringLiteral("%6"),
+ QStringLiteral("%7"),
+ QStringLiteral("%8"),
+ QStringLiteral("%9"),
+ };
+ int maxDynamicCapture = maximalCapture(cap, nextRule.string);
+ maxCaptureUsed = std::max(maxCaptureUsed, maxDynamicCapture);
+ }
+ }
+ }
+
+ static const QString num1[]{
+ QStringLiteral("\\1"),
+ QStringLiteral("\\2"),
+ QStringLiteral("\\3"),
+ QStringLiteral("\\4"),
+ QStringLiteral("\\5"),
+ QStringLiteral("\\6"),
+ QStringLiteral("\\7"),
+ QStringLiteral("\\8"),
+ QStringLiteral("\\9"),
+ };
+ static const QString num2[]{
+ QStringLiteral("\\g1"),
+ QStringLiteral("\\g2"),
+ QStringLiteral("\\g3"),
+ QStringLiteral("\\g4"),
+ QStringLiteral("\\g5"),
+ QStringLiteral("\\g6"),
+ QStringLiteral("\\g7"),
+ QStringLiteral("\\g8"),
+ QStringLiteral("\\g9"),
+ };
+ const int maxBackReference = std::max(maximalCapture(num1, rule.string), maximalCapture(num1, rule.string));
+
+ const int maxCapture = std::max(maxCaptureUsed, maxBackReference);
+
+ if (maxCapture && regexp.captureCount() > maxCapture) {
+ qWarning() << rule.filename << "line" << rule.line << "RegExpr with" << regexp.captureCount() << "captures but only" << maxCapture
+ << "are used. Please, replace '(...)' with '(?:...)':" << rule.string;
+ return false;
+ }
+
+ useCapture = maxCapture;
+ }
+
+ if (!useCapture) {
+ // is DetectIdentifier
+ static const QRegularExpression isInsensitiveDetectIdentifier(
+ QStringLiteral(R"(^(\((\?:)?)?\[((a-z|_){2}|(A-Z|_){2})\]([+][*?]?)?\[((0-9|a-z|_){3}|(0-9|A-Z|_){3})\][*][*?]?(\))?$)"));
+ static const QRegularExpression isSensitiveDetectIdentifier(
+ QStringLiteral(R"(^(\((\?:)?)?\[(a-z|A-Z|_){3}\]([+][*?]?)?\[(0-9|a-z|A-Z|_){4}\][*][*?]?(\))?$)"));
+ auto &isDetectIdentifier = (rule.insensitive == XmlBool::True) ? isInsensitiveDetectIdentifier : isSensitiveDetectIdentifier;
+ if (rule.string.contains(isDetectIdentifier)) {
+ qWarning() << rule.filename << "line" << rule.line << "RegExpr should be replaced by DetectIdentifier:" << rule.string;
+ return false;
+ }
+ }
+
+ if (rule.isDotRegex) {
+ // search next rule with same column or firstNonSpace
+ int i = &rule - context.rules.data() + 1;
+ const bool hasColumn = (rule.column != -1);
+ const bool hasFirstNonSpace = (rule.firstNonSpace == XmlBool::True);
+ const bool isSpecial = (hasColumn || hasFirstNonSpace);
+ for (; i < context.rules.size(); ++i) {
+ auto &rule2 = context.rules[i];
+ if (rule2.type == Context::Rule::Type::IncludeRules && isSpecial) {
+ i = context.rules.size();
+ break;
+ }
+
+ const bool hasColumn2 = (rule2.column != -1);
+ const bool hasFirstNonSpace2 = (rule2.firstNonSpace == XmlBool::True);
+ if ((!isSpecial && !hasColumn2 && !hasFirstNonSpace2) || (hasColumn && rule.column == rule2.column)
+ || (hasFirstNonSpace && hasFirstNonSpace2)) {
+ break;
+ }
+ }
+
+ auto ruleFilename = (filename == rule.filename) ? QString() : QStringLiteral("in ") + rule.filename;
+ if (i == context.rules.size()) {
+ if (rule.lookAhead == XmlBool::True && rule.firstNonSpace != XmlBool::True && rule.column == -1 && rule.beginRegion.isEmpty()
+ && rule.endRegion.isEmpty() && !useCapture) {
+ qWarning() << filename << "context line" << context.line << ": RegExpr line" << rule.line << ruleFilename
+ << "should be replaced by fallthroughContext:" << rule.string;
+ }
+ } else {
+ auto &nextRule = context.rules[i];
+ auto nextRuleFilename = (filename == nextRule.filename) ? QString() : QStringLiteral("in ") + nextRule.filename;
+ qWarning() << filename << "context line" << context.line << "contains unreachable element line" << nextRule.line << nextRuleFilename
+ << "because a dot RegExpr is used line" << rule.line << ruleFilename;
+ }
+
+ // unnecessary quantifier
+ static const QRegularExpression unnecessaryQuantifier1(QStringLiteral(
+ R"([*+?]([.][*+?]{0,2})?$)"));
+ static const QRegularExpression unnecessaryQuantifier2(QStringLiteral(
+ R"([*+?]([.][*+?]{0,2})?[)]*$)"));
+ auto &unnecessaryQuantifier = useCapture ? unnecessaryQuantifier1 : unnecessaryQuantifier2;
+ if (rule.lookAhead == XmlBool::True && rule.minimal != XmlBool::True && reg.contains(unnecessaryQuantifier)) {
+ qWarning() << filename << "line" << rule.line << "Last quantifier is not necessary (i.g., 'xyz*' -> 'xy', 'xyz+.' -> 'xyz.'):"
+ << rule.string;
+ return false;
+ }
}
- m_existingNames.insert(name);
- } else if (xml.name() == QLatin1String("keyword")) {
- const QString context = xml.attributes().value(QLatin1String("String")).toString();
- if (!context.isEmpty())
- m_usedNames.insert(context);
}
+
+ return true;
}
- bool check() const
+ // Parse and check <emptyLine>
+ bool parseEmptyLine(const QString &filename, QXmlStreamReader &xml)
{
- bool success = m_success;
- const auto invalidNames = m_usedNames - m_existingNames;
- if (!invalidNames.isEmpty()) {
- qWarning() << m_filename << "Reference of non-existing keyword list:" << invalidNames;
- success = false;
+ bool success = true;
+
+ QString pattern;
+ XmlBool casesensitive{};
+
+ for (auto &attr : xml.attributes()) {
+ Parser parser{filename, xml, attr, success};
+
+ const bool isExtracted =
+ parser.extractString(pattern, QStringLiteral("regexpr")) || parser.extractXmlBool(casesensitive, QStringLiteral("casesensitive"));
+
+ success = parser.checkIfExtracted(isExtracted);
}
- const auto unusedNames = m_existingNames - m_usedNames;
- if (!unusedNames.isEmpty()) {
- qWarning() << m_filename << "Unused keyword lists:" << unusedNames;
+ if (pattern.isEmpty()) {
+ qWarning() << filename << "line" << xml.lineNumber() << "missing attribute: regexpr";
success = false;
+ } else {
+ success = checkRegularExpression(filename, QRegularExpression(pattern), xml.lineNumber());
}
return success;
}
-private:
- QString m_filename;
- QSet<QString> m_usedNames;
- QSet<QString> m_existingNames;
- bool m_success = true;
-};
+ //! Check that a regular expression:
+ //! - isValid()
+ //! - character ranges such as [A-Z] are valid and not accidentally e.g. [A-z].
+ bool checkRegularExpression(const QString &filename, const QRegularExpression &regexp, int line) const
+ {
+ const auto pattern = regexp.pattern();
-/**
- * Helper class to search for non-existing contexts and invalid version
- */
-class ContextChecker
-{
-public:
- void setKateVersion(const QStringRef &verStr, const QString &hlFilename, const QString &hlName)
+ // validate regexp
+ if (!regexp.isValid()) {
+ qWarning() << filename << "line" << line << "broken regex:" << pattern << "problem:" << regexp.errorString() << "at offset"
+ << regexp.patternErrorOffset();
+ return false;
+ }
+
+ // catch possible case typos: [A-z] or [a-Z]
+ const int azOffset = std::max(pattern.indexOf(QStringLiteral("A-z")), pattern.indexOf(QStringLiteral("a-Z")));
+ if (azOffset >= 0) {
+ qWarning() << filename << "line" << line << "broken regex:" << pattern << "problem: [a-Z] or [A-z] at offset" << azOffset;
+ return false;
+ }
+
+ return true;
+ }
+
+ //! Search for rules with lookAhead="true" and context="#stay".
+ //! This would cause an infinite loop.
+ bool checkfallthrough(const Definition &definition, const Context &context) const
{
- const auto idx = verStr.indexOf(QLatin1Char('.'));
- if (idx <= 0) {
- qWarning() << hlFilename << "invalid kateversion" << verStr;
- m_success = false;
- } else {
- auto &language = m_contextMap[hlName];
- language.version = {verStr.left(idx).toInt(), verStr.mid(idx + 1).toInt()};
+ bool success = true;
+
+ if (!context.fallthroughContext.name.isEmpty()) {
+ if (context.fallthroughContext.stay) {
+ qWarning() << definition.filename << "line" << context.line << "possible infinite loop due to fallthroughContext=\"#stay\" in context "
+ << context.name;
+ success = false;
+ }
+
+ const bool mandatoryFallthroughAttribute = definition.kateVersion < Version{5, 62};
+ if (context.fallthrough == XmlBool::True && !mandatoryFallthroughAttribute) {
+ qWarning() << definition.filename << "line" << context.line << "fallthrough attribute is unnecessary with kateversion >= 5.62 in context"
+ << context.name;
+ success = false;
+ } else if (context.fallthrough != XmlBool::True && mandatoryFallthroughAttribute) {
+ qWarning() << definition.filename << "line" << context.line
+ << "fallthroughContext attribute without fallthrough=\"1\" attribute is only valid with kateversion >= 5.62 in context"
+ << context.name;
+ success = false;
+ }
}
+
+ return success;
}
- void processElement(const QString &hlFilename, const QString &hlName, QXmlStreamReader &xml)
+ //! Search for additionalDeliminator/weakDeliminator which has no effect.
+ bool checkDelimiters(const Definition &definition, const Context::Rule &rule) const
{
- if (xml.name() == QLatin1String("context")) {
- auto &language = m_contextMap[hlName];
- language.hlFilename = hlFilename;
- const QString name = xml.attributes().value(QLatin1String("name")).toString();
- if (language.isFirstContext) {
- language.isFirstContext = false;
- language.usedContextNames.insert(name);
+ if (rule.additionalDeliminator.isEmpty() && rule.weakDeliminator.isEmpty())
+ return true;
+
+ bool success = true;
+
+ if (definition.kateVersion < Version{5, 79}) {
+ qWarning() << definition.filename << "line" << rule.line
+ << "additionalDeliminator and weakDeliminator are only available since version \"5.79\". Please, increase kateversion.";
+ success = false;
+ }
+
+ for (QChar c : rule.additionalDeliminator) {
+ if (!definition.wordDelimiters.contains(c)) {
+ return success;
}
+ }
- if (language.existingContextNames.contains(name)) {
- qWarning() << hlFilename << "Duplicate context:" << name;
- m_success = false;
+ for (QChar c : rule.weakDeliminator) {
+ if (definition.wordDelimiters.contains(c)) {
+ return success;
+ }
+ }
+
+ qWarning() << rule.filename << "line" << rule.line << "unnecessary use of additionalDeliminator and/or weakDeliminator" << rule.string;
+ return false;
+ }
+
+ //! Search for rules with lookAhead="true" and context="#stay".
+ //! This would cause an infinite loop.
+ bool checkKeyword(const Definition &definition, const Context::Rule &rule, QSet<const Keywords *> &referencedKeywords) const
+ {
+ if (rule.type == Context::Rule::Type::keyword) {
+ auto it = definition.keywordsList.find(rule.string);
+ if (it != definition.keywordsList.end()) {
+ referencedKeywords.insert(&*it);
} else {
- language.existingContextNames.insert(name);
+ qWarning() << rule.filename << "line" << rule.line << "reference of non-existing keyword list:" << rule.string;
+ return false;
}
+ }
+ return true;
+ }
- auto fallthroughContext = xml.attributes().value(QLatin1String("fallthroughContext"));
- if (!fallthroughContext.isEmpty()) {
- if (fallthroughContext == QLatin1String("#stay")) {
- qWarning() << hlFilename << "possible infinite loop due to fallthroughContext=\"#stay\" in context " << name;
- m_success = false;
+ //! Search for rules with lookAhead="true" and context="#stay".
+ //! This would cause an infinite loop.
+ bool checkLookAhead(const Context::Rule &rule) const
+ {
+ if (rule.lookAhead == XmlBool::True && rule.context.stay) {
+ qWarning() << rule.filename << "line" << rule.line << "infinite loop: lookAhead with context #stay";
+ }
+ return true;
+ }
+
+ //! Check that StringDetect contains more that 2 characters
+ //! Fix with following command:
+ //! \code
+ //! sed -E
+ //! '/StringDetect/{/dynamic="(1|true)|insensitive="(1|true)/!{s/StringDetect(.*)String="(.|&lt;|&gt;|&quot;|&amp;)(.|&lt;|&gt;|&quot;|&amp;)"/Detect2Chars\1char="\2"
+ //! char1="\3"/;t;s/StringDetect(.*)String="(.|&lt;|&gt;|&quot;|&amp;)"/DetectChar\1char="\2"/}}' -i file.xml...
+ //! \endcode
+ bool checkStringDetect(const Context::Rule &rule) const
+ {
+ if (rule.type == Context::Rule::Type::StringDetect) {
+ // dynamic == true and no place holder?
+ if (rule.dynamic == XmlBool::True) {
+ static const QRegularExpression placeHolder(QStringLiteral("%\\d+"));
+ if (!rule.string.contains(placeHolder)) {
+ qWarning() << rule.filename << "line" << rule.line << "broken regex:" << rule.string << "problem: dynamic=true but no %\\d+ placeholder";
+ return false;
+ }
+ } else {
+ if (rule.string.size() <= 1) {
+ const auto replacement = rule.insensitive == XmlBool::True ? QStringLiteral("AnyChar") : QStringLiteral("DetectChar");
+ qWarning() << rule.filename << "line" << rule.line << "StringDetect should be replaced by" << replacement;
+ return false;
}
- auto fallthrough = xml.attributes().value(QLatin1String("fallthrough"));
- if (fallthrough.isEmpty() && language.version < Version{5, 62}) {
- qWarning() << hlFilename << "fallthroughContext attribute without fallthrough attribute is only valid with kateversion >= 5.62 in context " << name;
- m_success = false;
+ if (rule.string.size() <= 2 && rule.insensitive != XmlBool::True) {
+ qWarning() << rule.filename << "line" << rule.line << "StringDetect should be replaced by Detect2Chars";
+ return false;
}
}
+ }
+ return true;
+ }
- processContext(hlName, xml.attributes().value(QLatin1String("lineEndContext")).toString());
- processContext(hlName, xml.attributes().value(QLatin1String("lineEmptyContext")).toString());
- processContext(hlName, xml.attributes().value(QLatin1String("fallthroughContext")).toString());
- } else if (xml.name() == QLatin1String("include")) {
- // <include> tag inside <list>
- processVersion(hlFilename, hlName, xml, {5, 53}, QLatin1String("<include>"));
- } else {
- if (xml.attributes().hasAttribute(QLatin1String("context"))) {
- const QString context = xml.attributes().value(QLatin1String("context")).toString();
- if (context.isEmpty()) {
- qWarning() << hlFilename << "Missing context name in line" << xml.lineNumber();
- m_success = false;
- } else {
- processContext(hlName, context);
+ //! Check that AnyChar contains more that 1 character
+ bool checkAnyChar(const Context::Rule &rule) const
+ {
+ if (rule.type == Context::Rule::Type::AnyChar && rule.string.size() <= 1) {
+ qWarning() << rule.filename << "line" << rule.line << "AnyChar should be replaced by DetectChar";
+ return false;
+ }
+ return true;
+ }
+
+ //! Check \<include> and delimiter in a keyword list
+ bool checkKeywordsList(const Definition &definition, QSet<const Keywords *> &referencedKeywords) const
+ {
+ bool success = true;
+
+ bool includeNotSupport = (definition.kateVersion < Version{5, 53});
+ QMapIterator<QString, Keywords> keywordsIt(definition.keywordsList);
+ while (keywordsIt.hasNext()) {
+ keywordsIt.next();
+
+ for (const auto &include : keywordsIt.value().items.includes) {
+ if (includeNotSupport) {
+ qWarning() << definition.filename << "line" << include.line
+ << "<include> is only available since version \"5.53\". Please, increase kateversion.";
+ success = false;
+ }
+ success = checkKeywordInclude(definition, include, referencedKeywords) && success;
+ }
+
+ // Check that keyword list items do not have deliminator character
+#if 0
+ for (const auto& keyword : keywordsIt.value().items.keywords) {
+ for (QChar c : keyword.content) {
+ if (definition.wordDelimiters.contains(c)) {
+ qWarning() << definition.filename << "line" << keyword.line << "keyword with delimiter:" << c << "in" << keyword.content;
+ success = false;
+ }
}
}
+#endif
}
+
+ return success;
}
- bool check() const
+ //! Search for non-existing keyword include.
+ bool checkKeywordInclude(const Definition &definition, const Keywords::Items::Item &include, QSet<const Keywords *> &referencedKeywords) const
{
- bool success = m_success;
+ bool containsKeywordName = true;
+ int const idx = include.content.indexOf(QStringLiteral("##"));
+ if (idx == -1) {
+ auto it = definition.keywordsList.find(include.content);
+ containsKeywordName = (it != definition.keywordsList.end());
+ if (containsKeywordName) {
+ referencedKeywords.insert(&*it);
+ }
+ } else {
+ auto defName = include.content.mid(idx + 2);
+ auto listName = include.content.left(idx);
+ auto it = m_definitions.find(defName);
+ if (it == m_definitions.end()) {
+ qWarning() << definition.filename << "line" << include.line << "unknown definition in" << include.content;
+ return false;
+ }
+ containsKeywordName = it->keywordsList.contains(listName);
+ }
+
+ if (!containsKeywordName) {
+ qWarning() << definition.filename << "line" << include.line << "unknown keyword name in" << include.content;
+ }
+
+ return containsKeywordName;
+ }
+
+ //! Check if a rule is hidden by another
+ //! - rule hidden by DetectChar or AnyChar
+ //! - DetectSpaces, AnyChar, Int, Float with all their characters hidden by DetectChar or AnyChar
+ //! - StringDetect, WordDetect, RegExpr with as prefix Detect2Chars or other strings
+ //! - duplicate rule (Int, Float, keyword with same String, etc)
+ //! - Rule hidden by a dot regex
+ bool checkUreachableRules(const QString &filename, const Context &context) const
+ {
+ struct RuleAndInclude {
+ const Context::Rule *rule;
+ const Context::Rule *includeRules;
+
+ explicit operator bool() const
+ {
+ return rule;
+ }
+ };
+
+ // Associate QChar with RuleAndInclude
+ struct CharTable {
+ /// Search RuleAndInclude associated with @p c.
+ RuleAndInclude find(QChar c) const
+ {
+ if (c.unicode() < 128)
+ return m_asciiMap[c.unicode()];
+ auto it = m_utf8Map.find(c);
+ return it == m_utf8Map.end() ? RuleAndInclude{nullptr, nullptr} : it.value();
+ }
+
+ /// Search RuleAndInclude associated with the characters of @p s.
+ /// \return an empty QVector when at least one character is not found.
+ QVector<RuleAndInclude> find(QStringView s) const
+ {
+ QVector<RuleAndInclude> result;
+
+ for (QChar c : s) {
+ if (!find(c)) {
+ return result;
+ }
+ }
- // recursive search for the required miximal version
- struct GetRequiredVersion {
- QHash<const Language *, Version> versionMap;
+ for (QChar c : s) {
+ result.append(find(c));
+ }
- Version operator()(const QHash<QString, Language> &contextMap, const Language &language)
+ return result;
+ }
+
+ /// Associates @p c with a rule.
+ void append(QChar c, const Context::Rule &rule, const Context::Rule *includeRule = nullptr)
{
- auto &version = versionMap[&language];
- if (version < language.version) {
- version = language.version;
- for (auto &languageName : language.usedLanguageName) {
- auto it = contextMap.find(languageName);
- if (it != contextMap.end()) {
- version = std::max(operator()(contextMap, *it), version);
+ if (c.unicode() < 128)
+ m_asciiMap[c.unicode()] = {&rule, includeRule};
+ else
+ m_utf8Map[c] = {&rule, includeRule};
+ }
+
+ /// Associates each character of @p s with a rule.
+ void append(QStringView s, const Context::Rule &rule, const Context::Rule *includeRule = nullptr)
+ {
+ for (QChar c : s) {
+ append(c, rule, includeRule);
+ }
+ }
+
+ private:
+ RuleAndInclude m_asciiMap[127]{};
+ QMap<QChar, RuleAndInclude> m_utf8Map;
+ };
+
+ struct Char4Tables {
+ CharTable chars;
+ CharTable charsColumn0;
+ QMap<int, CharTable> charsColumnGreaterThan0;
+ CharTable charsFirstNonSpace;
+ };
+
+ // View on Char4Tables members
+ struct CharTableArray {
+ // Append Char4Tables members that satisfies firstNonSpace and column.
+ // Char4Tables::char is always added.
+ CharTableArray(Char4Tables &tables, const Context::Rule &rule)
+ {
+ if (rule.firstNonSpace == XmlBool::True)
+ appendTable(tables.charsFirstNonSpace);
+
+ if (rule.column == 0)
+ appendTable(tables.charsColumn0);
+ else if (rule.column > 0)
+ appendTable(tables.charsColumnGreaterThan0[rule.column]);
+
+ appendTable(tables.chars);
+ }
+
+ // Removes Char4Tables::chars when the rule contains firstNonSpace or column
+ void removeNonSpecialWhenSpecial()
+ {
+ if (m_size > 1) {
+ --m_size;
+ }
+ }
+
+ /// Search RuleAndInclude associated with @p c.
+ RuleAndInclude find(QChar c) const
+ {
+ for (int i = 0; i < m_size; ++i) {
+ if (auto ruleAndInclude = m_charTables[i]->find(c))
+ return ruleAndInclude;
+ }
+ return RuleAndInclude{nullptr, nullptr};
+ }
+
+ /// Search RuleAndInclude associated with the characters of @p s.
+ /// \return an empty QVector when at least one character is not found.
+ QVector<RuleAndInclude> find(QStringView s) const
+ {
+ for (int i = 0; i < m_size; ++i) {
+ auto result = m_charTables[i]->find(s);
+ if (result.size()) {
+ while (++i < m_size) {
+ result.append(m_charTables[i]->find(s));
}
+ return result;
}
}
- return version;
- };
+ return QVector<RuleAndInclude>();
+ }
+
+ /// Associates @p c with a rule.
+ void append(QChar c, const Context::Rule &rule, const Context::Rule *includeRule = nullptr)
+ {
+ for (int i = 0; i < m_size; ++i) {
+ m_charTables[i]->append(c, rule, includeRule);
+ }
+ }
+
+ /// Associates each character of @p s with a rule.
+ void append(QStringView s, const Context::Rule &rule, const Context::Rule *includeRule = nullptr)
+ {
+ for (int i = 0; i < m_size; ++i) {
+ m_charTables[i]->append(s, rule, includeRule);
+ }
+ }
+
+ private:
+ void appendTable(CharTable &t)
+ {
+ m_charTables[m_size] = &t;
+ ++m_size;
+ }
+
+ CharTable *m_charTables[3];
+ int m_size = 0;
};
- GetRequiredVersion getRequiredVersion;
- for (auto &language : m_contextMap) {
- const auto invalidContextNames = language.usedContextNames - language.existingContextNames;
- if (!invalidContextNames.isEmpty()) {
- qWarning() << language.hlFilename << "Reference of non-existing contexts:" << invalidContextNames;
- success = false;
+ // Iterates over all the rules, including those in includedRules
+ struct RuleIterator {
+ RuleIterator(const QVector<Context::Rule> &rules, const Context::Rule &endRule)
+ : m_end(&endRule - rules.data())
+ , m_rules(rules)
+ {
}
- const auto unusedNames = language.existingContextNames - language.usedContextNames;
- if (!unusedNames.isEmpty()) {
- qWarning() << language.hlFilename << "Unused contexts:" << unusedNames;
- success = false;
+ /// \return next rule or nullptr
+ const Context::Rule *next()
+ {
+ // if in includedRules
+ if (m_includedRules) {
+ ++m_i2;
+ if (m_i2 != m_rules[m_i].includedRules.size()) {
+ return (*m_includedRules)[m_i2];
+ }
+ ++m_i;
+ m_includedRules = nullptr;
+ }
+
+ // if is a includedRules
+ while (m_i < m_end && m_rules[m_i].type == Context::Rule::Type::IncludeRules) {
+ if (m_rules[m_i].includedRules.size()) {
+ m_i2 = 0;
+ m_includedRules = &m_rules[m_i].includedRules;
+ return (*m_includedRules)[m_i2];
+ }
+ ++m_i;
+ }
+
+ if (m_i < m_end) {
+ ++m_i;
+ return &m_rules[m_i - 1];
+ }
+
+ return nullptr;
+ }
+
+ /// \return current IncludeRules or nullptr
+ const Context::Rule *currentIncludeRules() const
+ {
+ return m_includedRules ? &m_rules[m_i] : nullptr;
+ }
+
+ private:
+ int m_i = 0;
+ int m_i2;
+ int m_end;
+ const QVector<Context::Rule> &m_rules;
+ const QVector<const Context::Rule *> *m_includedRules = nullptr;
+ };
+
+ // Dot regex container that satisfies firstNonSpace and column.
+ struct DotRegex {
+ /// Append a dot regex rule.
+ void append(const Context::Rule &rule, const Context::Rule *includedRule)
+ {
+ auto array = extractDotRegexes(rule);
+ if (array[0])
+ *array[0] = {&rule, includedRule};
+ if (array[1])
+ *array[1] = {&rule, includedRule};
+ }
+
+ /// Search dot regex which hides @p rule
+ RuleAndInclude find(const Context::Rule &rule)
+ {
+ auto array = extractDotRegexes(rule);
+ if (array[0])
+ return *array[0];
+ if (array[1])
+ return *array[1];
+ return RuleAndInclude{};
+ }
+
+ private:
+ using Array = std::array<RuleAndInclude *, 2>;
+
+ Array extractDotRegexes(const Context::Rule &rule)
+ {
+ Array ret{};
+
+ if (rule.firstNonSpace != XmlBool::True && rule.column == -1) {
+ ret[0] = &dotRegex;
+ } else {
+ if (rule.firstNonSpace == XmlBool::True)
+ ret[0] = &dotRegexFirstNonSpace;
+
+ if (rule.column == 0)
+ ret[1] = &dotRegexColumn0;
+ else if (rule.column > 0)
+ ret[1] = &dotRegexColumnGreaterThan0[rule.column];
+ }
+
+ return ret;
+ }
+
+ RuleAndInclude dotRegex{};
+ RuleAndInclude dotRegexColumn0{};
+ QMap<int, RuleAndInclude> dotRegexColumnGreaterThan0{};
+ RuleAndInclude dotRegexFirstNonSpace{};
+ };
+
+ bool success = true;
+
+ // characters of DetectChar/AnyChar
+ Char4Tables detectChars;
+ // characters of dynamic DetectChar
+ Char4Tables dynamicDetectChars;
+ // characters of LineContinue
+ Char4Tables lineContinueChars;
+
+ RuleAndInclude intRule{};
+ RuleAndInclude floatRule{};
+ RuleAndInclude hlCCharRule{};
+ RuleAndInclude hlCOctRule{};
+ RuleAndInclude hlCHexRule{};
+ RuleAndInclude hlCStringCharRule{};
+
+ // Contains includedRules and included includedRules
+ QMap<Context const*, RuleAndInclude> includeContexts;
+
+ DotRegex dotRegex;
+
+ for (const Context::Rule &rule : context.rules) {
+ bool isUnreachable = false;
+ QVector<RuleAndInclude> unreachableBy;
+
+ // declare rule as unreacheable if ruleAndInclude is not empty
+ auto updateUnreachable1 = [&](RuleAndInclude ruleAndInclude) {
+ if (ruleAndInclude) {
+ isUnreachable = true;
+ unreachableBy.append(ruleAndInclude);
+ }
+ };
+
+ // declare rule as unreacheable if ruleAndIncludes is not empty
+ auto updateUnreachable2 = [&](const QVector<RuleAndInclude> &ruleAndIncludes) {
+ if (!ruleAndIncludes.isEmpty()) {
+ isUnreachable = true;
+ unreachableBy.append(ruleAndIncludes);
+ }
+ };
+
+ // check if rule2.firstNonSpace/column is compatible with those of rule
+ auto isCompatible = [&rule](Context::Rule const &rule2) {
+ return (rule2.firstNonSpace != XmlBool::True && rule2.column == -1) || (rule.column == rule2.column && rule.column != -1)
+ || (rule.firstNonSpace == rule2.firstNonSpace && rule.firstNonSpace == XmlBool::True);
+ };
+
+ updateUnreachable1(dotRegex.find(rule));
+
+ switch (rule.type) {
+ // checks if hidden by DetectChar/AnyChar
+ // then add the characters to detectChars
+ case Context::Rule::Type::AnyChar: {
+ auto tables = CharTableArray(detectChars, rule);
+ updateUnreachable2(tables.find(rule.string));
+ tables.removeNonSpecialWhenSpecial();
+ tables.append(rule.string, rule);
+ break;
+ }
+
+ // check if is hidden by DetectChar/AnyChar
+ // then add the characters to detectChars or dynamicDetectChars
+ case Context::Rule::Type::DetectChar: {
+ auto &chars4 = (rule.dynamic != XmlBool::True) ? detectChars : dynamicDetectChars;
+ auto tables = CharTableArray(chars4, rule);
+ updateUnreachable1(tables.find(rule.char0));
+ tables.removeNonSpecialWhenSpecial();
+ tables.append(rule.char0, rule);
+ break;
+ }
+
+ // check if hidden by DetectChar/AnyChar
+ // then add spaces characters to detectChars
+ case Context::Rule::Type::DetectSpaces: {
+ auto tables = CharTableArray(detectChars, rule);
+ updateUnreachable2(tables.find(QStringLiteral(" \t")));
+ tables.removeNonSpecialWhenSpecial();
+ tables.append(QLatin1Char(' '), rule);
+ tables.append(QLatin1Char('\t'), rule);
+ break;
+ }
+
+ // check if hidden by DetectChar/AnyChar
+ case Context::Rule::Type::HlCChar:
+ updateUnreachable1(CharTableArray(detectChars, rule).find(QLatin1Char('\'')));
+ updateUnreachable1(hlCCharRule);
+ hlCCharRule = {&rule, nullptr};
+ break;
+
+ // check if hidden by DetectChar/AnyChar
+ case Context::Rule::Type::HlCHex:
+ updateUnreachable1(CharTableArray(detectChars, rule).find(QLatin1Char('0')));
+ updateUnreachable1(hlCHexRule);
+ hlCHexRule = {&rule, nullptr};
+ break;
+
+ // check if hidden by DetectChar/AnyChar
+ case Context::Rule::Type::HlCOct:
+ updateUnreachable1(CharTableArray(detectChars, rule).find(QLatin1Char('0')));
+ updateUnreachable1(hlCOctRule);
+ hlCOctRule = {&rule, nullptr};
+ break;
+
+ // check if hidden by DetectChar/AnyChar
+ case Context::Rule::Type::HlCStringChar:
+ updateUnreachable1(CharTableArray(detectChars, rule).find(QLatin1Char('\\')));
+ updateUnreachable1(hlCStringCharRule);
+ hlCStringCharRule = {&rule, nullptr};
+ break;
+
+ // check if hidden by DetectChar/AnyChar
+ case Context::Rule::Type::Int:
+ updateUnreachable2(CharTableArray(detectChars, rule).find(QStringLiteral("0123456789")));
+ updateUnreachable1(intRule);
+ intRule = {&rule, nullptr};
+ break;
+
+ // check if hidden by DetectChar/AnyChar
+ case Context::Rule::Type::Float:
+ updateUnreachable2(CharTableArray(detectChars, rule).find(QStringLiteral("0123456789.")));
+ updateUnreachable1(floatRule);
+ floatRule = {&rule, nullptr};
+ break;
+
+ // check if hidden by DetectChar/AnyChar or another LineContinue
+ case Context::Rule::Type::LineContinue: {
+ updateUnreachable1(CharTableArray(detectChars, rule).find(rule.char0));
+
+ auto tables = CharTableArray(lineContinueChars, rule);
+ updateUnreachable1(tables.find(rule.char0));
+ tables.removeNonSpecialWhenSpecial();
+ tables.append(rule.char0, rule);
+ break;
+ }
+
+ // check if hidden by DetectChar/AnyChar or another Detect2Chars/RangeDetect
+ case Context::Rule::Type::Detect2Chars:
+ case Context::Rule::Type::RangeDetect:
+ updateUnreachable1(CharTableArray(detectChars, rule).find(rule.char0));
+ if (!isUnreachable) {
+ RuleIterator ruleIterator(context.rules, rule);
+ while (const auto *rulePtr = ruleIterator.next()) {
+ if (isUnreachable)
+ break;
+ const auto &rule2 = *rulePtr;
+ if (rule2.type == rule.type && isCompatible(rule2) && rule.char0 == rule2.char0 && rule.char1 == rule2.char1) {
+ updateUnreachable1({&rule2, ruleIterator.currentIncludeRules()});
+ }
+ }
+ }
+ break;
+
+ case Context::Rule::Type::RegExpr: {
+ if (rule.isDotRegex) {
+ dotRegex.append(rule, nullptr);
+ break;
+ }
+
+ // check that `rule` does not have another RegExpr as a prefix
+ RuleIterator ruleIterator(context.rules, rule);
+ while (const auto *rulePtr = ruleIterator.next()) {
+ if (isUnreachable)
+ break;
+ 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()});
+ }
+ }
+
+ Q_FALLTHROUGH();
+ }
+ // check if a rule does not have another rule as a prefix
+ case Context::Rule::Type::WordDetect:
+ case Context::Rule::Type::StringDetect: {
+ // check that dynamic `rule` does not have another dynamic StringDetect as a prefix
+ if (rule.type == Context::Rule::Type::StringDetect && rule.dynamic == XmlBool::True) {
+ RuleIterator ruleIterator(context.rules, rule);
+ while (const auto *rulePtr = ruleIterator.next()) {
+ if (isUnreachable)
+ break;
+
+ const auto &rule2 = *rulePtr;
+ if (rule2.type != Context::Rule::Type::StringDetect || rule2.dynamic != XmlBool::True || !isCompatible(rule2)) {
+ continue;
+ }
+
+ const bool isSensitive = (rule2.insensitive == XmlBool::True);
+ const auto caseSensitivity = isSensitive ? Qt::CaseInsensitive : Qt::CaseSensitive;
+ if ((isSensitive || rule.insensitive != XmlBool::True) && rule.string.startsWith(rule2.string, caseSensitivity)) {
+ updateUnreachable1({&rule2, ruleIterator.currentIncludeRules()});
+ }
+ }
+ }
+
+ // string used for comparison and truncated from "dynamic" part
+ QStringView s = rule.string;
+
+ // truncate to '%' with dynamic rules
+ if (rule.dynamic == XmlBool::True) {
+ static const QRegularExpression dynamicPosition(QStringLiteral(R"(^(?:[^%]*|%(?![1-9]))*)"));
+ auto result = dynamicPosition.match(rule.string);
+ s = s.left(result.capturedLength());
+ }
+
+ QString sanitizedRegex;
+ // truncate to special character with RegExpr.
+ // If regexp contains '|', `s` becomes empty.
+ if (rule.type == Context::Rule::Type::RegExpr) {
+ static const QRegularExpression regularChars(QStringLiteral(R"(^(?:[^.?*+^$[{(\\|]+|\\[-.?*+^$[\]{}()\\|]+|\[[^^\\]\])+)"));
+ static const QRegularExpression sanitizeChars(QStringLiteral(R"(\\([-.?*+^$[\]{}()\\|])|\[([^^\\])\])"));
+ const qsizetype result = regularChars.match(rule.string).capturedLength();
+ const qsizetype pos = qMin(result, s.size());
+ if (rule.string.indexOf(QLatin1Char('|'), pos) < pos) {
+ sanitizedRegex = rule.string.left(qMin(result, s.size()));
+ sanitizedRegex.replace(sanitizeChars, QStringLiteral("\\1"));
+ s = sanitizedRegex;
+ } else {
+ s = QStringView();
+ }
+ }
+
+ // check if hidden by DetectChar/AnyChar
+ if (s.size() > 0) {
+ auto t = CharTableArray(detectChars, rule);
+ if (rule.insensitive != XmlBool::True) {
+ updateUnreachable1(t.find(s[0]));
+ } else {
+ QChar c2[]{s[0].toLower(), s[0].toUpper()};
+ updateUnreachable2(t.find(QStringView(c2, 2)));
+ }
+ }
+
+ // check if Detect2Chars, StringDetect, WordDetect is not a prefix of s
+ if (s.size() > 0 && !isUnreachable) {
+ // combination of uppercase and lowercase
+ RuleAndInclude detect2CharsInsensitives[]{{}, {}, {}, {}};
+
+ RuleIterator ruleIterator(context.rules, rule);
+ while (const auto *rulePtr = ruleIterator.next()) {
+ if (isUnreachable)
+ break;
+ const auto &rule2 = *rulePtr;
+ const bool isSensitive = (rule2.insensitive == XmlBool::True);
+ const auto caseSensitivity = isSensitive ? Qt::CaseInsensitive : Qt::CaseSensitive;
+
+ switch (rule2.type) {
+ // check that it is not a detectChars prefix
+ case Context::Rule::Type::Detect2Chars:
+ if (isCompatible(rule2) && s.size() >= 2) {
+ if (rule.insensitive != XmlBool::True) {
+ if (rule2.char0 == s[0] && rule2.char1 == s[1]) {
+ updateUnreachable1({&rule2, ruleIterator.currentIncludeRules()});
+ }
+ } else {
+ // when the string is case insensitive,
+ // all 4 upper/lower case combinations must be found
+ auto set = [&](RuleAndInclude &x, QChar c1, QChar c2) {
+ if (!x && rule2.char0 == c1 && rule2.char0 == c2) {
+ x = {&rule2, ruleIterator.currentIncludeRules()};
+ }
+ };
+ set(detect2CharsInsensitives[0], s[0].toLower(), s[1].toLower());
+ set(detect2CharsInsensitives[1], s[0].toLower(), s[1].toUpper());
+ set(detect2CharsInsensitives[2], s[0].toUpper(), s[1].toUpper());
+ set(detect2CharsInsensitives[3], s[0].toUpper(), s[1].toLower());
+
+ if (detect2CharsInsensitives[0] && detect2CharsInsensitives[1] && detect2CharsInsensitives[2]
+ && detect2CharsInsensitives[3]) {
+ isUnreachable = true;
+ unreachableBy.append(detect2CharsInsensitives[0]);
+ unreachableBy.append(detect2CharsInsensitives[1]);
+ unreachableBy.append(detect2CharsInsensitives[2]);
+ unreachableBy.append(detect2CharsInsensitives[3]);
+ }
+ }
+ }
+ break;
+
+ // check that it is not a StringDetect prefix
+ case Context::Rule::Type::StringDetect:
+ if (isCompatible(rule2) && rule2.dynamic != XmlBool::True && (isSensitive || rule.insensitive != XmlBool::True)
+ && s.startsWith(rule2.string, caseSensitivity)) {
+ updateUnreachable1({&rule2, ruleIterator.currentIncludeRules()});
+ }
+ break;
+
+ // check if a WordDetect is hidden by another WordDetect
+ case Context::Rule::Type::WordDetect:
+ if (rule.type == Context::Rule::Type::WordDetect && isCompatible(rule2) && (isSensitive || rule.insensitive != XmlBool::True)
+ && 0 == rule.string.compare(rule2.string, caseSensitivity)) {
+ updateUnreachable1({&rule2, ruleIterator.currentIncludeRules()});
+ }
+ break;
+
+ default:;
+ }
+ }
+ }
+
+ break;
}
- auto requiredVersion = getRequiredVersion(m_contextMap, language);
- if (language.version < requiredVersion) {
- qWarning().nospace() << language.hlFilename << " depends on a language in version " << requiredVersion.majorRevision << "." << requiredVersion.minorRevision << ". Please, increase kateversion.";
+ // check if hidden by another keyword rule
+ case Context::Rule::Type::keyword: {
+ RuleIterator ruleIterator(context.rules, rule);
+ while (const auto *rulePtr = ruleIterator.next()) {
+ if (isUnreachable)
+ break;
+ const auto &rule2 = *rulePtr;
+ if (rule2.type == Context::Rule::Type::keyword && isCompatible(rule2) && rule.string == rule2.string) {
+ updateUnreachable1({&rule2, ruleIterator.currentIncludeRules()});
+ }
+ }
+ // TODO check that all keywords are hidden by another rules
+ break;
+ }
+
+ // add characters in those used but without checking if they are already.
+ // <DetectChar char="}" />
+ // <includedRules .../> <- reference an another <DetectChar char="}" /> who will not be checked
+ // <includedRules .../> <- reference a <DetectChar char="{" /> who will be added
+ // <DetectChar char="{" /> <- hidden by previous rule
+ case Context::Rule::Type::IncludeRules:
+ if (auto &ruleAndInclude = includeContexts[rule.context.context]) {
+ updateUnreachable1(ruleAndInclude);
+ }
+ else {
+ ruleAndInclude.rule = &rule;
+ }
+
+ for (const auto *rulePtr : rule.includedIncludeRules) {
+ includeContexts.insert(rulePtr->context.context, RuleAndInclude{rulePtr, &rule});
+ }
+
+ for (const auto *rulePtr : rule.includedRules) {
+ const auto &rule2 = *rulePtr;
+ switch (rule2.type) {
+ case Context::Rule::Type::AnyChar: {
+ auto tables = CharTableArray(detectChars, rule2);
+ tables.removeNonSpecialWhenSpecial();
+ tables.append(rule2.string, rule2, &rule);
+ break;
+ }
+
+ case Context::Rule::Type::DetectChar: {
+ auto &chars4 = (rule.dynamic != XmlBool::True) ? detectChars : dynamicDetectChars;
+ auto tables = CharTableArray(chars4, rule2);
+ tables.removeNonSpecialWhenSpecial();
+ tables.append(rule2.char0, rule2, &rule);
+ break;
+ }
+
+ case Context::Rule::Type::DetectSpaces: {
+ auto tables = CharTableArray(detectChars, rule2);
+ tables.removeNonSpecialWhenSpecial();
+ tables.append(QLatin1Char(' '), rule2, &rule);
+ tables.append(QLatin1Char('\t'), rule2, &rule);
+ break;
+ }
+
+ case Context::Rule::Type::HlCChar:
+ hlCCharRule = {&rule2, &rule};
+ break;
+
+ case Context::Rule::Type::HlCHex:
+ hlCHexRule = {&rule2, &rule};
+ break;
+
+ case Context::Rule::Type::HlCOct:
+ hlCOctRule = {&rule2, &rule};
+ break;
+
+ case Context::Rule::Type::HlCStringChar:
+ hlCStringCharRule = {&rule2, &rule};
+ break;
+
+ case Context::Rule::Type::Int:
+ intRule = {&rule2, &rule};
+ break;
+
+ case Context::Rule::Type::Float:
+ floatRule = {&rule2, &rule};
+ break;
+
+ case Context::Rule::Type::LineContinue: {
+ auto tables = CharTableArray(lineContinueChars, rule2);
+ tables.removeNonSpecialWhenSpecial();
+ tables.append(rule2.char0, rule2, &rule);
+ break;
+ }
+
+ case Context::Rule::Type::RegExpr:
+ if (rule2.isDotRegex) {
+ dotRegex.append(rule2, &rule);
+ }
+ break;
+
+ case Context::Rule::Type::WordDetect:
+ case Context::Rule::Type::StringDetect:
+ case Context::Rule::Type::Detect2Chars:
+ case Context::Rule::Type::IncludeRules:
+ case Context::Rule::Type::DetectIdentifier:
+ case Context::Rule::Type::keyword:
+ case Context::Rule::Type::Unknown:
+ case Context::Rule::Type::RangeDetect:
+ break;
+ }
+ }
+ break;
+
+ case Context::Rule::Type::DetectIdentifier:
+ case Context::Rule::Type::Unknown:
+ break;
+ }
+
+ if (isUnreachable) {
success = false;
+ QString message;
+ message.reserve(128);
+ for (auto &ruleAndInclude : unreachableBy) {
+ message += QStringLiteral("line ");
+ if (ruleAndInclude.includeRules) {
+ message += QString::number(ruleAndInclude.includeRules->line);
+ message += QStringLiteral(" [by '");
+ message += ruleAndInclude.includeRules->context.name;
+ message += QStringLiteral("' line ");
+ message += QString::number(ruleAndInclude.rule->line);
+ if (ruleAndInclude.includeRules->filename != ruleAndInclude.rule->filename) {
+ message += QStringLiteral(" (");
+ message += ruleAndInclude.rule->filename;
+ message += QLatin1Char(')');
+ }
+ message += QLatin1Char(']');
+ } else {
+ message += QString::number(ruleAndInclude.rule->line);
+ }
+ message += QStringLiteral(", ");
+ }
+ message.chop(2);
+ qWarning() << filename << "line" << rule.line << "unreachable element by" << message;
}
}
return success;
}
-private:
- //! Extract the referenced context name and language.
+ //! Proposes to merge certain rule sequences
+ //! - several DetectChar/AnyChar into AnyChar
+ //! - several RegExpr into one RegExpr
+ bool suggestRuleMerger(const QString &filename, const Context &context) const
+ {
+ bool success = true;
+
+ if (context.rules.isEmpty())
+ return success;
+
+ auto it = context.rules.begin();
+ const auto end = context.rules.end() - 1;
+
+ for (; it < end; ++it) {
+ auto& rule1 = *it;
+ 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
+ && rule1.context.popCount == rule2.context.popCount
+ ;
+ };
+
+ switch (rule1.type) {
+ // request to merge AnyChar/DetectChar
+ case Context::Rule::Type::AnyChar:
+ case Context::Rule::Type::DetectChar:
+ if ((rule2.type == Context::Rule::Type::AnyChar || rule2.type == Context::Rule::Type::DetectChar) && isCommonCompatible() && rule1.column == rule2.column) {
+ qWarning() << filename << "line" << rule2.line << "can be merged as AnyChar with the previous rule";
+ success = false;
+ }
+ break;
+
+ // request to merge multiple RegExpr
+ case Context::Rule::Type::RegExpr:
+ if (rule2.type == Context::Rule::Type::RegExpr && isCommonCompatible() && rule1.dynamic == rule2.dynamic && (rule1.column == rule2.column || (rule1.column <= 0 && rule2.column <= 0))) {
+ qWarning() << filename << "line" << rule2.line << "can be merged with the previous rule";
+ success = false;
+ }
+ break;
+
+ case Context::Rule::Type::DetectSpaces:
+ case Context::Rule::Type::HlCChar:
+ case Context::Rule::Type::HlCHex:
+ case Context::Rule::Type::HlCOct:
+ case Context::Rule::Type::HlCStringChar:
+ case Context::Rule::Type::Int:
+ case Context::Rule::Type::Float:
+ case Context::Rule::Type::LineContinue:
+ case Context::Rule::Type::WordDetect:
+ case Context::Rule::Type::StringDetect:
+ case Context::Rule::Type::Detect2Chars:
+ case Context::Rule::Type::IncludeRules:
+ case Context::Rule::Type::DetectIdentifier:
+ case Context::Rule::Type::keyword:
+ case Context::Rule::Type::Unknown:
+ case Context::Rule::Type::RangeDetect:
+ break;
+ }
+ }
+
+ return success;
+ }
+
+ //! Initialize the referenced context (ContextName::context)
//! Some input / output examples are:
//! - "#stay" -> ""
//! - "#pop" -> ""
@@ -445,161 +2249,140 @@ private:
//! - "#pop!Comment" -> "Comment"
//! - "##ISO C++" -> ""
//! - "Comment##ISO C++"-> "Comment" in ISO C++
- void processContext(const QString &language, QString context)
+ void resolveContextName(Definition &definition, const Context &context, ContextName &contextName, int line)
{
- if (context.isEmpty())
- return;
-
- // filter out #stay and #pop
- static QRegularExpression stayPop(QStringLiteral("^(#stay|#pop)+"));
- context.remove(stayPop);
-
- // handle cross-language context references
- if (context.contains(QStringLiteral("##"))) {
-#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
- const QStringList list = context.split(QStringLiteral("##"), QString::SkipEmptyParts);
-#else
- const QStringList list = context.split(QStringLiteral("##"), Qt::SkipEmptyParts);
-#endif
- if (list.size() == 1) {
- // nothing to do, other language is included: e.g. ##Doxygen
- } else if (list.size() == 2) {
- // specific context of other language, e.g. Comment##ISO C++
- m_contextMap[list[1]].usedContextNames.insert(list[0]);
- m_contextMap[language].usedLanguageName.insert(list[1]);
+ QString name = contextName.name;
+ if (name.isEmpty()) {
+ contextName.stay = true;
+ } else if (name.startsWith(QStringLiteral("#stay"))) {
+ name = name.mid(5);
+ contextName.stay = true;
+ contextName.context = &context;
+ if (!name.isEmpty()) {
+ qWarning() << definition.filename << "line" << line << "invalid context in" << context.name;
+ m_success = false;
+ }
+ } else {
+ while (name.startsWith(QStringLiteral("#pop"))) {
+ name = name.mid(4);
+ ++contextName.popCount;
}
- return;
- }
-
- // handle #pop!context" (#pop was already removed above)
- if (context.startsWith(QLatin1Char('!')))
- context.remove(0, 1);
-
- if (!context.isEmpty())
- m_contextMap[language].usedContextNames.insert(context);
- }
-
-private:
- struct Version {
- int majorRevision;
- int minorRevision;
-
- Version(int majorRevision = 0, int minorRevision = 0)
- : majorRevision(majorRevision)
- , minorRevision(minorRevision)
- {
- }
- bool operator<(const Version &version) const
- {
- return majorRevision < version.majorRevision || (majorRevision == version.majorRevision && minorRevision < version.minorRevision);
- }
- };
+ if (contextName.popCount && !name.isEmpty()) {
+ if (name.startsWith(QLatin1Char('!')) && name.size() > 1) {
+ name = name.mid(1);
+ } else {
+ qWarning() << definition.filename << "line" << line << "'!' missing between '#pop' and context name" << context.name;
+ m_success = false;
+ }
+ }
- void processVersion(const QString &hlFilename, const QString &hlName, QXmlStreamReader &xml, Version const &requiredVersion, QLatin1String item)
- {
- auto &language = m_contextMap[hlName];
+ if (!name.isEmpty()) {
+ const int idx = name.indexOf(QStringLiteral("##"));
+ if (idx == -1) {
+ auto it = definition.contexts.find(name);
+ 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);
+ if (it != m_definitions.end()) {
+ definition.referencedDefinitions.insert(&*it);
+ auto ctxIt = it->contexts.find(listName.isEmpty() ? it->firstContextName : listName);
+ if (ctxIt != it->contexts.end()) {
+ contextName.context = &*ctxIt;
+ }
+ } else {
+ qWarning() << definition.filename << "line" << line << "unknown definition in" << context.name;
+ m_success = false;
+ }
+ }
- if (language.version < requiredVersion) {
- qWarning().nospace() << hlFilename << " " << item << " in line " << xml.lineNumber() << " is only available since version " << requiredVersion.majorRevision << "." << requiredVersion.minorRevision
- << ". Please, increase kateversion.";
- // update the version to cancel future warnings
- language.version = requiredVersion;
- m_success = false;
+ if (!contextName.context) {
+ qWarning() << definition.filename << "line" << line << "unknown context" << name << "in" << context.name;
+ m_success = false;
+ }
+ }
}
}
- class Language
- {
- public:
- // filename on disk or in Qt resource
- QString hlFilename;
-
- // Is true, if the first context in xml file is encountered, and
- // false in all other cases. This is required, since the first context
- // is typically not referenced explicitly. So we will simply add the
- // first context to the usedContextNames list.
- bool isFirstContext = true;
+ QMap<QString, Definition> m_definitions;
+ Definition *m_currentDefinition = nullptr;
+ Keywords *m_currentKeywords = nullptr;
+ Context *m_currentContext = nullptr;
+ bool m_success = true;
+};
- // holds all contexts that were referenced
- QSet<QString> usedContextNames;
+namespace
+{
+QStringList readListing(const QString &fileName)
+{
+ QFile file(fileName);
+ if (!file.open(QIODevice::ReadOnly)) {
+ return QStringList();
+ }
- // holds all existing context names
- QSet<QString> existingContextNames;
+ QXmlStreamReader xml(&file);
+ QStringList listing;
+ while (!xml.atEnd()) {
+ xml.readNext();
- // holds all existing language names
- QSet<QString> usedLanguageName;
+ // add only .xml files, no .json or stuff
+ if (xml.isCharacters() && xml.text().toString().contains(QLatin1String(".xml"))) {
+ listing.append(xml.text().toString());
+ }
+ }
- // kateversion language attribute
- Version version;
- };
+ if (xml.hasError()) {
+ qWarning() << "XML error while reading" << fileName << " - " << qPrintable(xml.errorString()) << "@ offset" << xml.characterOffset();
+ listing.clear();
+ }
- /**
- * "Language name" to "Language" map.
- * Example key: "Doxygen"
- */
- QHash<QString, Language> m_contextMap;
- bool m_success = true;
-};
+ return listing;
+}
/**
- * Helper class to search for non-existing itemDatas.
+ * check if the "extensions" attribute have valid wildcards
+ * @param extensions extensions string to check
+ * @return valid?
*/
-class AttributeChecker
+bool checkExtensions(const QString &extensions)
{
-public:
- AttributeChecker(const QString &filename)
- : m_filename(filename)
- {
+ // get list of extensions
+ const QStringList extensionParts = extensions.split(QLatin1Char(';'), Qt::SkipEmptyParts);
+
+ // ok if empty
+ if (extensionParts.isEmpty()) {
+ return true;
}
- void processElement(QXmlStreamReader &xml)
- {
- if (xml.name() == QLatin1String("itemData")) {
- const QString name = xml.attributes().value(QLatin1String("name")).toString();
- if (!name.isEmpty()) {
- if (m_existingAttributeNames.contains(name)) {
- qWarning() << m_filename << "itemData duplicate:" << name;
- m_success = false;
- } else {
- m_existingAttributeNames.insert(name);
- }
+ // check that only valid wildcard things are inside the parts
+ for (const auto &extension : extensionParts) {
+ for (const auto c : extension) {
+ // eat normal things
+ if (c.isDigit() || c.isLetter()) {
+ continue;
}
- } else if (xml.attributes().hasAttribute(QLatin1String("attribute"))) {
- const QString name = xml.attributes().value(QLatin1String("attribute")).toString();
- if (name.isEmpty()) {
- qWarning() << m_filename << "specified attribute is empty:" << xml.name();
- m_success = false;
- } else {
- m_usedAttributeNames.insert(name);
+
+ // allow some special characters
+ if (c == QLatin1Char('.') || c == QLatin1Char('-') || c == QLatin1Char('_') || c == QLatin1Char('+')) {
+ continue;
}
- }
- }
- bool check() const
- {
- bool success = m_success;
- const auto invalidNames = m_usedAttributeNames - m_existingAttributeNames;
- if (!invalidNames.isEmpty()) {
- qWarning() << m_filename << "Reference of non-existing itemData attributes:" << invalidNames;
- success = false;
- }
+ // only allowed wildcard things: '?' and '*'
+ if (c == QLatin1Char('?') || c == QLatin1Char('*')) {
+ continue;
+ }
- auto unusedNames = m_existingAttributeNames - m_usedAttributeNames;
- if (!unusedNames.isEmpty()) {
- qWarning() << m_filename << "Unused itemData:" << unusedNames;
- success = false;
+ qWarning() << "invalid character" << c << "seen in extensions wildcard";
+ return false;
}
-
- return success;
}
-private:
- QString m_filename;
- QSet<QString> m_usedAttributeNames;
- QSet<QString> m_existingAttributeNames;
- bool m_success = true;
-};
+ // all checks passed
+ return true;
+}
}
@@ -631,12 +2414,12 @@ int main(int argc, char *argv[])
}
// text attributes
- const QStringList textAttributes = QStringList() << QStringLiteral("name") << QStringLiteral("section") << QStringLiteral("mimetype") << QStringLiteral("extensions") << QStringLiteral("style") << QStringLiteral("author")
+ const QStringList textAttributes = QStringList() << QStringLiteral("name") << QStringLiteral("section") << QStringLiteral("mimetype")
+ << QStringLiteral("extensions") << QStringLiteral("style") << QStringLiteral("author")
<< QStringLiteral("license") << QStringLiteral("indenter");
// index all given highlightings
- ContextChecker contextChecker;
- KeywordIncludeChecker keywordIncludeChecker;
+ HlFilesChecker filesChecker;
QVariantMap hls;
int anyError = 0;
for (const QString &hlFilename : qAsConst(hlFilenames)) {
@@ -693,70 +2476,20 @@ int main(int argc, char *argv[])
// remember hl
hls[QFileInfo(hlFile).fileName()] = hl;
- AttributeChecker attributeChecker(hlFilename);
- KeywordChecker keywordChecker(hlFilename);
-
const QString hlName = hl[QStringLiteral("name")].toString();
- contextChecker.setKateVersion(xml.attributes().value(QStringLiteral("kateversion")), hlFilename, hlName);
+ filesChecker.setDefinition(xml.attributes().value(QStringLiteral("kateversion")), hlFilename, hlName);
// scan for broken regex or keywords with spaces
while (!xml.atEnd()) {
xml.readNext();
- if (!xml.isStartElement()) {
- continue;
- }
-
- // search for used/existing contexts if applicable
- contextChecker.processElement(hlFilename, hlName, xml);
-
- // search for existing keyword includes
- keywordIncludeChecker.processElement(hlFilename, hlName, xml);
-
- // search for used/existing attributes if applicable
- attributeChecker.processElement(xml);
-
- // search for used/existing keyword lists if applicable
- keywordChecker.processElement(xml);
-
- // scan for bad regex
- if (!checkRegularExpression(hlFilename, xml)) {
- anyError = 7;
- continue;
- }
-
- // scan for bogus <item> lala </item> spaces
- if (!checkItemsTrimmed(hlFilename, xml)) {
- anyError = 8;
- continue;
- }
-
- // check single chars in DetectChar and Detect2Chars
- if (!checkSingleChars(hlFilename, xml)) {
- anyError = 8;
- continue;
- }
-
- // scan for lookAhead="true" with context="#stay"
- if (!checkLookAhead(hlFilename, xml)) {
- anyError = 7;
- continue;
- }
- }
-
- if (!attributeChecker.check()) {
- anyError = 7;
- }
-
- if (!keywordChecker.check()) {
- anyError = 7;
+ filesChecker.processElement(xml);
}
}
- if (!contextChecker.check())
- anyError = 7;
+ filesChecker.resolveContexts();
- if (!keywordIncludeChecker.check())
+ if (!filesChecker.check())
anyError = 7;
// bail out if any problem was seen
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/CMakeLists.txt b/src/libs/3rdparty/syntax-highlighting/src/lib/CMakeLists.txt
index 97aeee3dbc..722f92742b 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/CMakeLists.txt
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/CMakeLists.txt
@@ -55,7 +55,7 @@ ecm_generate_headers(SyntaxHighlighting_HEADERS
REQUIRED_HEADERS SyntaxHighlighting_HEADERS
)
-install(TARGETS KF5SyntaxHighlighting EXPORT KF5SyntaxHighlightingTargets ${INSTALL_TARGETS_DEFAULT_ARGS})
+install(TARGETS KF5SyntaxHighlighting EXPORT KF5SyntaxHighlightingTargets ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
install(FILES
${SyntaxHighlighting_HEADERS}
${CMAKE_CURRENT_BINARY_DIR}/ksyntaxhighlighting_export.h
@@ -66,7 +66,7 @@ if(BUILD_QCH)
KF5SyntaxHighlighting_QCH
NAME KSyntaxHighlighting
BASE_NAME KF5SyntaxHighlighting
- VERSION ${KF5_VERSION}
+ VERSION ${KF_VERSION}
ORG_DOMAIN org.kde
SOURCES # using only public headers, to cover only public API
${SyntaxHighlighting_HEADERS}
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/abstracthighlighter.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/abstracthighlighter.cpp
index 5eefc3a48d..2ad9d371f9 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/abstracthighlighter.cpp
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/abstracthighlighter.cpp
@@ -128,7 +128,8 @@ State AbstractHighlighter::highlightLine(const QString &text, const State &state
* see https://phabricator.kde.org/D18509
*/
int endlessLoopingCounter = 0;
- while (!stateData->topContext()->lineEmptyContext().isStay() || (stateData->topContext()->lineEmptyContext().isStay() && !stateData->topContext()->lineEndContext().isStay())) {
+ while (!stateData->topContext()->lineEmptyContext().isStay()
+ || (stateData->topContext()->lineEmptyContext().isStay() && !stateData->topContext()->lineEndContext().isStay())) {
/**
* line empty context switches
*/
@@ -143,7 +144,8 @@ State AbstractHighlighter::highlightLine(const QString &text, const State &state
* line end context switches only when lineEmptyContext is #stay. This avoids
* skipping empty lines after a line continuation character (see bug 405903)
*/
- } else if (!stateData->topContext()->lineEndContext().isStay() && !d->switchContext(stateData, stateData->topContext()->lineEndContext(), QStringList()))
+ } else if (!stateData->topContext()->lineEndContext().isStay()
+ && !d->switchContext(stateData, stateData->topContext()->lineEndContext(), QStringList()))
break;
// guard against endless loops
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/abstracthighlighter_p.h b/src/libs/3rdparty/syntax-highlighting/src/lib/abstracthighlighter_p.h
index 6128beccfa..11332fdcfd 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/abstracthighlighter_p.h
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/abstracthighlighter_p.h
@@ -10,6 +10,10 @@
#include "definition.h"
#include "theme.h"
+QT_BEGIN_NAMESPACE
+class QStringList;
+QT_END_NAMESPACE
+
namespace KSyntaxHighlighting
{
class ContextSwitch;
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/ansihighlighter.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/ansihighlighter.cpp
index abe5e8d2be..688f0c6bf0 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/ansihighlighter.cpp
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/ansihighlighter.cpp
@@ -5,36 +5,39 @@
*/
#include "ansihighlighter.h"
+#include "context_p.h"
#include "definition.h"
+#include "definition_p.h"
#include "format.h"
#include "ksyntaxhighlighting_logging.h"
#include "state.h"
-#include "theme.h"
#include "state_p.h"
-#include "context_p.h"
-#include "definition_p.h"
+#include "theme.h"
+#include <QColor>
#include <QFile>
#include <QFileInfo>
-#include <QTextStream>
-#include <QColor>
#include <QMap>
-#include <QtMath>
+#include <QTextStream>
-#include <vector>
#include <cmath>
+#include <vector>
using namespace KSyntaxHighlighting;
namespace
{
- struct CieLab
- {
- double l;
- double a;
- double b;
- };
+struct CieLab {
+ double l;
+ double a;
+ double b;
+};
+#ifndef M_PI
+constexpr double M_PI = 3.14159265358979323846;
+#endif
+
+// clang-format off
// xterm color reference
// constexpr Rgb888 xterm256Colors[] {
// {0x00, 0x00, 0x00}, {0x80, 0x00, 0x00}, {0x00, 0x80, 0x00}, {0x80, 0x80, 0x00},
@@ -377,207 +380,208 @@ namespace
constexpr double illuminant_D65[] {
0.95047, 1.00000, 1.08883,
};
+// clang-format on
- // convert a sRGB (D65) color to CIELAB (D65)
- CieLab rgbToLab(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);
- };
+// convert a sRGB (D65) color to CIELAB (D65)
+CieLab rgbToLab(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 = inverseGammaCompanding(qRed(rgb));
- const double g = inverseGammaCompanding(qGreen(rgb));
- const double b = inverseGammaCompanding(qBlue(rgb));
+ const double r = inverseGammaCompanding(qRed(rgb));
+ const double g = inverseGammaCompanding(qGreen(rgb));
+ const double b = inverseGammaCompanding(qBlue(rgb));
- 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]);
+ 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;
- };
+ // 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]);
+ 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),
- };
- }
+ return CieLab{
+ 116.0 * f_y - 16.0,
+ 500.0 * (f_x - f_y),
+ 200.0 * (f_y - f_z),
+ };
+}
+constexpr double epsilon = 1e-15;
- constexpr double epsilon = 1e-15;
+inline double sinDegree(double x)
+{
+ return std::sin(x * M_PI / 180.0);
+}
- inline double sinDegree(double x) { return std::sin(x * M_PI / 180.0); }
+inline double cosDegree(double x)
+{
+ return std::cos(x * M_PI / 180.0);
+}
- inline double cosDegree(double x) { return std::cos(x * M_PI / 180.0); }
+inline double pow2(double x)
+{
+ return x * x;
+}
- inline double pow2(double x) { return x * x; }
+inline double computeHPrime(double a_prime, double b)
+{
+ if (std::abs(a_prime) < epsilon && std::abs(b) < epsilon)
+ return 0.0;
- inline double computeHPrime(double a_prime, double b)
- {
- if (std::abs(a_prime) < epsilon && std::abs(b) < epsilon)
- return 0.0;
+ const double value = std::atan2(b, a_prime) * 180.0 / M_PI;
+ return (value < 0.0) ? value + 360.0 : value;
+}
- const double value = std::atan2(b, a_prime) * 180.0 / M_PI;
- return (value < 0.0) ? value + 360.0 : value;
- }
+inline double computeDeltaHPrime(double C1_prime, double C2_prime, double h1_prime, double h2_prime)
+{
+ if (C1_prime * C2_prime < epsilon)
+ return 0.0;
- inline double computeDeltaHPrime(double C1_prime, double C2_prime, double h1_prime, double h2_prime)
- {
- if (C1_prime * C2_prime < epsilon)
- return 0.0;
+ const double diff = h2_prime - h1_prime;
- const double diff = h2_prime - h1_prime;
+ if (std::abs(diff) <= 180.0)
+ return diff;
+ else if (diff > 180.0)
+ return diff - 360.0;
+ else
+ return diff + 360.0;
+}
- if (std::abs(diff) <= 180.0)
- return diff;
- else if (diff > 180.0)
- return diff - 360.0;
- else
- return diff + 360.0;
- }
+inline double computeHPrimeBar(double C1_prime, double C2_prime, double h1_prime, double h2_prime)
+{
+ const double sum = h1_prime + h2_prime;
- inline double computeHPrimeBar(double C1_prime, double C2_prime, double h1_prime, double h2_prime)
- {
- const double sum = h1_prime + h2_prime;
+ if (C1_prime * C2_prime < epsilon)
+ return sum;
- if (C1_prime * C2_prime < epsilon)
- return sum;
+ const double dist = std::abs(h1_prime - h2_prime);
- const double dist = std::abs(h1_prime - h2_prime);
+ if (dist <= 180.0)
+ return 0.5 * sum;
+ else if (sum < 360.0)
+ return 0.5 * (sum + 360.0);
+ else
+ return 0.5 * (sum - 360.0);
+}
- if (dist <= 180.0)
- return 0.5 * sum;
- else if (sum < 360.0)
- return 0.5 * (sum + 360.0);
- else
- return 0.5 * (sum - 360.0);
- }
+/// 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)
+{
+ const double L1 = color1.l;
+ const double a1 = color1.a;
+ const double b1 = color1.b;
+ const double L2 = color2.l;
+ const double a2 = color2.a;
+ const double b2 = color2.b;
+
+ const double _25_pow_7 = /*std::pow(25.0, 7.0) = */ 6103515625.0;
+
+ const double C1_ab = std::sqrt(a1 * a1 + b1 * b1);
+ const double C2_ab = std::sqrt(a2 * a2 + b2 * b2);
+ const double C_ab_bar = 0.5 * (C1_ab + C2_ab);
+ const double c_ab_bar_pow_7 = std::pow(C_ab_bar, 7.0);
+ const double G = 0.5 * (1.0 - std::sqrt(c_ab_bar_pow_7 / (c_ab_bar_pow_7 + _25_pow_7)));
+ const double a1_prime = (1.0 + G) * a1;
+ const double a2_prime = (1.0 + G) * a2;
+ const double C1_prime = std::sqrt(a1_prime * a1_prime + b1 * b1);
+ const double C2_prime = std::sqrt(a2_prime * a2_prime + b2 * b2);
+ const double h1_prime = computeHPrime(a1_prime, b1);
+ const double h2_prime = computeHPrime(a2_prime, b2);
+
+ const double deltaL_prime = L2 - L1;
+ const double deltaC_prime = C2_prime - C1_prime;
+ const double deltah_prime = computeDeltaHPrime(C1_prime, C2_prime, h1_prime, h2_prime);
+ const double deltaH_prime = 2.0 * std::sqrt(C1_prime * C2_prime) * sinDegree(0.5 * deltah_prime);
+
+ const double L_primeBar = 0.5 * (L1 + L2);
+ const double C_primeBar = 0.5 * (C1_prime + C2_prime);
+ const double h_primeBar = computeHPrimeBar(C1_prime, C2_prime, h1_prime, h2_prime);
+
+ const double T = 1.0 - 0.17 * cosDegree(h_primeBar - 30.0) + 0.24 * cosDegree(2.0 * h_primeBar) + 0.32 * cosDegree(3.0 * h_primeBar + 6.0)
+ - 0.20 * cosDegree(4.0 * h_primeBar - 63.0);
+
+ const double C_primeBar_pow7 = std::pow(C_primeBar, 7.0);
+ const double R_C = 2.0 * std::sqrt(C_primeBar_pow7 / (C_primeBar_pow7 + _25_pow_7));
+ const double S_L = 1.0 + (0.015 * pow2(L_primeBar - 50.0)) / std::sqrt(20.0 + pow2(L_primeBar - 50.0));
+ const double S_C = 1.0 + 0.045 * C_primeBar;
+ const double S_H = 1.0 + 0.015 * C_primeBar * T;
+ const double R_T = -R_C * sinDegree(60.0 * std::exp(-pow2((h_primeBar - 275) / 25.0)));
+
+ constexpr double kL = 1.0;
+ constexpr double kC = 1.0;
+ constexpr double kH = 1.0;
+
+ const double deltaL = deltaL_prime / (kL * S_L);
+ const double deltaC = deltaC_prime / (kC * S_C);
+ const double deltaH = deltaH_prime / (kH * S_H);
+
+ return /*std::sqrt*/ (deltaL * deltaL + deltaC * deltaC + deltaH * deltaH + R_T * deltaC * deltaH);
+}
+
+struct AnsiBuffer {
+ using ColorCache = QMap<QRgb, int>;
- /// 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)
+ void append(char c)
{
- const double L1 = color1.l;
- const double a1 = color1.a;
- const double b1 = color1.b;
- const double L2 = color2.l;
- const double a2 = color2.a;
- const double b2 = color2.b;
-
- const double _25_pow_7 = /*std::pow(25.0, 7.0) = */6103515625.0;
-
- const double C1_ab = std::sqrt(a1 * a1 + b1 * b1);
- const double C2_ab = std::sqrt(a2 * a2 + b2 * b2);
- const double C_ab_bar = 0.5 * (C1_ab + C2_ab);
- const double c_ab_bar_pow_7 = std::pow(C_ab_bar, 7.0);
- const double G = 0.5 * (1.0 - std::sqrt(c_ab_bar_pow_7 / (c_ab_bar_pow_7 + _25_pow_7)));
- const double a1_prime = (1.0 + G) * a1;
- const double a2_prime = (1.0 + G) * a2;
- const double C1_prime = std::sqrt(a1_prime * a1_prime + b1 * b1);
- const double C2_prime = std::sqrt(a2_prime * a2_prime + b2 * b2);
- const double h1_prime = computeHPrime(a1_prime, b1);
- const double h2_prime = computeHPrime(a2_prime, b2);
-
- const double deltaL_prime = L2 - L1;
- const double deltaC_prime = C2_prime - C1_prime;
- const double deltah_prime = computeDeltaHPrime(C1_prime, C2_prime, h1_prime, h2_prime);
- const double deltaH_prime = 2.0 * std::sqrt(C1_prime * C2_prime) * sinDegree(0.5 * deltah_prime);
-
- const double L_primeBar = 0.5 * (L1 + L2);
- const double C_primeBar = 0.5 * (C1_prime + C2_prime);
- const double h_primeBar = computeHPrimeBar(C1_prime, C2_prime, h1_prime, h2_prime);
-
- const double T = 1.0
- - 0.17 * cosDegree(h_primeBar - 30.0)
- + 0.24 * cosDegree(2.0 * h_primeBar)
- + 0.32 * cosDegree(3.0 * h_primeBar + 6.0)
- - 0.20 * cosDegree(4.0 * h_primeBar - 63.0);
-
- const double C_primeBar_pow7 = std::pow(C_primeBar, 7.0);
- const double R_C = 2.0 * std::sqrt(C_primeBar_pow7 / (C_primeBar_pow7 + _25_pow_7));
- const double S_L = 1.0 + (0.015 * pow2(L_primeBar - 50.0))
- / std::sqrt(20.0 + pow2(L_primeBar - 50.0));
- const double S_C = 1.0 + 0.045 * C_primeBar;
- const double S_H = 1.0 + 0.015 * C_primeBar * T;
- const double R_T = -R_C * sinDegree(60.0 * std::exp(-pow2((h_primeBar - 275) / 25.0)));
-
- constexpr double kL = 1.0;
- constexpr double kC = 1.0;
- constexpr double kH = 1.0;
-
- const double deltaL = deltaL_prime / (kL * S_L);
- const double deltaC = deltaC_prime / (kC * S_C);
- const double deltaH = deltaH_prime / (kH * S_H);
-
- return /*std::sqrt*/( deltaL * deltaL
- + deltaC * deltaC
- + deltaH * deltaH
- + R_T * deltaC * deltaH);
+ Q_ASSERT(remaining() >= 1);
+ m_data[m_size] = c;
+ ++m_size;
}
- struct AnsiBuffer
+ void append(QLatin1String str)
{
- using ColorCache = QMap<QRgb, int>;
-
- void append(char c)
- {
- Q_ASSERT(remaining() >= 1);
- m_data[m_size] = c;
- ++m_size;
- }
-
- void append(QLatin1String str)
- {
- Q_ASSERT(remaining() >= str.size());
- memcpy(m_data + m_size, str.data(), str.size());
- m_size += str.size();
- }
+ Q_ASSERT(remaining() >= str.size());
+ memcpy(m_data + m_size, str.data(), str.size());
+ m_size += str.size();
+ }
- void appendForeground(QRgb rgb, bool is256Colors, ColorCache& colorCache)
- {
- append(QLatin1String("38;"));
- append(rgb, is256Colors, colorCache);
- }
+ void appendForeground(QRgb rgb, bool is256Colors, ColorCache &colorCache)
+ {
+ append(QLatin1String("38;"));
+ append(rgb, is256Colors, colorCache);
+ }
- void appendBackground(QRgb rgb, bool is256Colors, ColorCache& colorCache)
- {
- append(QLatin1String("48;"));
- append(rgb, is256Colors, colorCache);
- }
+ void appendBackground(QRgb rgb, bool is256Colors, ColorCache &colorCache)
+ {
+ append(QLatin1String("48;"));
+ append(rgb, is256Colors, colorCache);
+ }
- void append(QRgb rgb, bool is256Colors, ColorCache& colorCache)
- {
- auto appendUInt8 = [&](int x){
- Q_ASSERT(x <= 255 && x >= 0);
- if (x > 99) {
- if (x >= 200) {
- append('2');
- x -= 200;
- }
- else {
- append('1');
- x -= 100;
- }
- } else if (x < 10) {
- append(char('0' + x));
- return ;
+ void append(QRgb rgb, bool is256Colors, ColorCache &colorCache)
+ {
+ auto appendUInt8 = [&](int x) {
+ Q_ASSERT(x <= 255 && x >= 0);
+ if (x > 99) {
+ if (x >= 200) {
+ append('2');
+ x -= 200;
+ } else {
+ append('1');
+ x -= 100;
}
+ } else if (x < 10) {
+ append(char('0' + x));
+ return;
+ }
+ // 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"
@@ -588,518 +592,540 @@ namespace
"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"
- ;
- auto* p = tb2digits + x * 2;
- append(p[0]);
- append(p[1]);
- };
+ "90" "91" "92" "93" "94" "95" "96" "97" "98" "99";
+ // clang-format on
+
+ auto *p = tb2digits + x * 2;
+ append(p[0]);
+ append(p[1]);
+ };
- if (is256Colors) {
- double dist = 1e24;
- int idx = 0;
- auto it = colorCache.find(rgb);
- if (it == colorCache.end()) {
- const auto lab = rgbToLab(rgb);
- // find the nearest xterm color
- for (CieLab const& xtermLab : xterm240Labs) {
- auto dist2 = calculate_CIEDE2000(lab, xtermLab);
- if (dist2 < dist) {
- dist = dist2;
- idx = &xtermLab - xterm240Labs;
- }
+ if (is256Colors) {
+ double dist = 1e24;
+ int idx = 0;
+ auto it = colorCache.find(rgb);
+ if (it == colorCache.end()) {
+ const auto lab = rgbToLab(rgb);
+ // find the nearest xterm color
+ for (CieLab const &xtermLab : xterm240Labs) {
+ auto dist2 = calculate_CIEDE2000(lab, xtermLab);
+ if (dist2 < dist) {
+ dist = dist2;
+ idx = &xtermLab - xterm240Labs;
}
- // add 16 to convert 240 colors mode to 256 colors mode
- idx += 16;
- colorCache.insert(rgb, idx);
}
- else {
- idx = it.value();
- }
-
- append('5');
- append(';');
- appendUInt8(idx);
+ // add 16 to convert 240 colors mode to 256 colors mode
+ idx += 16;
+ colorCache.insert(rgb, idx);
} else {
- append('2');
- append(';');
- appendUInt8(qRed(rgb));
- append(';');
- appendUInt8(qGreen(rgb));
- append(';');
- appendUInt8(qBlue(rgb));
+ idx = it.value();
}
+
+ append('5');
append(';');
+ appendUInt8(idx);
+ } else {
+ append('2');
+ append(';');
+ appendUInt8(qRed(rgb));
+ append(';');
+ appendUInt8(qGreen(rgb));
+ append(';');
+ appendUInt8(qBlue(rgb));
}
+ append(';');
+ }
- // Replace last character with 'm'. Last character must be ';'
- void setFinalStyle()
- {
- Q_ASSERT(m_data[m_size-1] == ';');
- m_data[m_size-1] = 'm';
- }
+ // Replace last character with 'm'. Last character must be ';'
+ void setFinalStyle()
+ {
+ Q_ASSERT(m_data[m_size - 1] == ';');
+ m_data[m_size - 1] = 'm';
+ }
- void clear()
- {
- m_size = 0;
- }
+ void clear()
+ {
+ m_size = 0;
+ }
- QLatin1String latin1() const
- {
- return QLatin1String(m_data, m_size);
- }
+ QLatin1String latin1() const
+ {
+ return QLatin1String(m_data, m_size);
+ }
- private:
- char m_data[128];
- int m_size = 0;
+private:
+ char m_data[128];
+ int m_size = 0;
- int remaining() const noexcept
- {
- return 128 - m_size;
+ int remaining() const noexcept
+ {
+ return 128 - m_size;
+ }
+};
+
+void fillString(QString &s, int n, const QString &fill)
+{
+ if (n > 0) {
+ for (; n > fill.size(); n -= fill.size()) {
+ s += fill;
}
- };
+ s += fill.left(n);
+ }
+}
- void fillString(QString &s, int n, const QString &fill)
+struct GraphLine {
+ QString graphLine;
+ QString labelLine;
+ int graphLineLength = 0;
+ int labelLineLength = 0;
+ int nextLabelOffset = 0;
+
+ template<class String> void pushLabel(int offset, String const &s, int charCounter)
{
- if (n > 0) {
- for (; n > fill.size(); n -= fill.size()) {
- s += fill;
- }
- s += fill.left(n);
- }
+ Q_ASSERT(offset >= labelLineLength);
+ const int n = offset - labelLineLength;
+ labelLineLength += charCounter + n;
+ fillLine(labelLine, n);
+ labelLine += s;
+ nextLabelOffset = labelLineLength;
}
- struct GraphLine
+ template<class String> void pushGraph(int offset, String const &s, int charCounter)
{
- QString graphLine;
- QString labelLine;
- int graphLineLength = 0;
- int labelLineLength = 0;
- int nextLabelOffset = 0;
-
- template<class String>
- void pushLabel(int offset, String const& s, int charCounter)
- {
- Q_ASSERT(offset >= labelLineLength);
- const int n = offset - labelLineLength;
- labelLineLength += charCounter + n;
- fillLine(labelLine, n);
- labelLine += s;
- nextLabelOffset = labelLineLength;
+ Q_ASSERT(offset >= graphLineLength);
+ const int n = offset - graphLineLength;
+ graphLineLength += charCounter + n;
+ fillLine(graphLine, n);
+ const int ps1 = graphLine.size();
+ graphLine += s;
+ if (offset >= labelLineLength) {
+ const int n2 = offset - labelLineLength;
+ labelLineLength += n2 + 1;
+ fillLine(labelLine, n2);
+ labelLine += graphLine.rightRef(graphLine.size() - ps1);
}
+ }
- template<class String>
- void pushGraph(int offset, String const& s, int charCounter)
- {
- Q_ASSERT(offset >= graphLineLength);
- const int n = offset - graphLineLength;
- graphLineLength += charCounter + n;
- fillLine(graphLine, n);
- const int ps1 = graphLine.size();
- graphLine += s;
- if (offset >= labelLineLength) {
- const int n2 = offset - labelLineLength;
- labelLineLength += n2 + 1;
- fillLine(labelLine, n2);
- labelLine += graphLine.rightRef(graphLine.size() - ps1);
- }
- }
+private:
+ static void fillLine(QString &s, int n)
+ {
+ Q_ASSERT(n >= 0);
+ fillString(s,
+ n,
+ QStringLiteral(" "
+ " "
+ " "));
+ }
+};
- private:
- static void fillLine(QString& s, int n)
- {
- Q_ASSERT(n >= 0);
- fillString(s, n, QStringLiteral(
- " "
- " "
- " "
- ));
- }
- };
+/**
+ * Returns the first free line at a given position or create a new one
+ */
+GraphLine &lineAtOffset(std::vector<GraphLine> &graphLines, int offset)
+{
+ const auto last = graphLines.end();
+ auto p = std::find_if(graphLines.begin(), last, [=](GraphLine const &line) {
+ return line.nextLabelOffset < offset;
+ });
+ if (p == last) {
+ graphLines.emplace_back();
+ return graphLines.back();
+ }
+ return *p;
+}
- /**
- * Returns the first free line at a given position or create a new one
- */
- GraphLine& lineAtOffset(std::vector<GraphLine> &graphLines, int offset)
+// disable bold, italic and underline on |
+const QLatin1String graphSymbol("\x1b[21;23;24m|");
+// reverse video
+const QLatin1String nameStyle("\x1b[7m");
+
+/**
+ * ANSI Highlighter dedicated to traces
+ */
+class DebugSyntaxHighlighter : public KSyntaxHighlighting::AbstractHighlighter
+{
+public:
+ using TraceOption = KSyntaxHighlighting::AnsiHighlighter::TraceOption;
+ using TraceOptions = KSyntaxHighlighting::AnsiHighlighter::TraceOptions;
+
+ void setDefinition(const KSyntaxHighlighting::Definition &def) override
{
- const auto last = graphLines.end();
- auto p = std::find_if(graphLines.begin(), last, [=](GraphLine const& line) {
- return line.nextLabelOffset < offset;
- });
- if (p == last) {
- graphLines.emplace_back();
- return graphLines.back();
- }
- return *p;
+ AbstractHighlighter::setDefinition(def);
+ m_defData = DefinitionData::get(def);
+ m_contextCapture.setDefinition(def);
}
- // disable bold, italic and underline on |
- const QLatin1String graphSymbol("\x1b[21;23;24m|");
- // reverse video
- const QLatin1String nameStyle("\x1b[7m");
-
- /**
- * ANSI Highlighter dedicated to traces
- */
- class DebugSyntaxHighlighter : public KSyntaxHighlighting::AbstractHighlighter
+ void highlightData(QTextStream &in,
+ QTextStream &out,
+ QLatin1String infoStyle,
+ QLatin1String editorBackground,
+ const std::vector<QPair<QString, QString>> &ansiStyles,
+ TraceOptions traceOptions)
{
- public:
- using TraceOption = KSyntaxHighlighting::AnsiHighlighter::TraceOption;
- using TraceOptions = KSyntaxHighlighting::AnsiHighlighter::TraceOptions;
+ initRegionStyles(ansiStyles);
- void setDefinition(const KSyntaxHighlighting::Definition & def) override
- {
- AbstractHighlighter::setDefinition(def);
- m_defData = DefinitionData::get(def);
- m_contextCapture.setDefinition(def);
- }
+ m_hasFormatTrace = traceOptions.testFlag(TraceOption::Format);
+ m_hasRegionTrace = traceOptions.testFlag(TraceOption::Region);
+ m_hasStackSizeTrace = traceOptions.testFlag(TraceOption::StackSize);
+ m_hasContextTrace = traceOptions.testFlag(TraceOption::Context);
+ const bool hasFormatOrContextTrace = m_hasFormatTrace || m_hasContextTrace || m_hasStackSizeTrace;
- void highlightData(QTextStream &in, QTextStream &out, QLatin1String infoStyle, QLatin1String editorBackground, const std::vector<QPair<QString, QString>> &ansiStyles, TraceOptions traceOptions)
- {
- initRegionStyles(ansiStyles);
-
- m_hasFormatTrace = traceOptions.testFlag(TraceOption::Format);
- m_hasRegionTrace = traceOptions.testFlag(TraceOption::Region);
- const bool hasContextTrace = traceOptions.testFlag(TraceOption::Context);
- const bool hasFormatOrContextTrace = m_hasFormatTrace || hasContextTrace;
-
- const bool hasSeparator = hasFormatOrContextTrace && m_hasRegionTrace;
- const QString resetBgColor = (editorBackground.isEmpty() ? QStringLiteral("\x1b[0m") : editorBackground);
-
- bool firstLine = true;
- State state;
- while (!in.atEnd()) {
- const QString currentLine = in.readLine();
- auto oldState = state;
- state = highlightLine(currentLine, state);
-
- if (hasSeparator) {
- if (!firstLine)
- out << QStringLiteral("\x1b[0m────────────────────────────────────────────────────\x1b[K\n");
- firstLine = false;
- }
+ const bool hasSeparator = hasFormatOrContextTrace && m_hasRegionTrace;
+ const QString resetBgColor = (editorBackground.isEmpty() ? QStringLiteral("\x1b[0m") : editorBackground);
- if (!m_regions.empty()) {
- printRegions(out, infoStyle, currentLine.size());
- out << resetBgColor;
- }
+ bool firstLine = true;
+ State state;
+ while (!in.atEnd()) {
+ const QString currentLine = in.readLine();
+ auto oldState = state;
+ state = highlightLine(currentLine, state);
+
+ if (hasSeparator) {
+ if (!firstLine)
+ out << QStringLiteral("\x1b[0m────────────────────────────────────────────────────\x1b[K\n");
+ firstLine = false;
+ }
- for (const auto &fragment : m_highlightedFragments) {
- auto const& ansiStyle = ansiStyles[fragment.formatId];
- out << ansiStyle.first << currentLine.midRef(fragment.offset, fragment.length) << ansiStyle.second;
- }
+ if (!m_regions.empty()) {
+ printRegions(out, infoStyle, currentLine.size());
+ out << resetBgColor;
+ }
- out << QStringLiteral("\x1b[K\n");
+ for (const auto &fragment : m_highlightedFragments) {
+ auto const &ansiStyle = ansiStyles[fragment.formatId];
+ out << ansiStyle.first << currentLine.midRef(fragment.offset, fragment.length) << ansiStyle.second;
+ }
- if (hasFormatOrContextTrace && !m_highlightedFragments.empty()) {
- if (hasContextTrace)
- appendContextNames(oldState, currentLine);
+ out << QStringLiteral("\x1b[K\n");
- printFormats(out, infoStyle, ansiStyles);
- out << resetBgColor;
- }
+ if (hasFormatOrContextTrace && !m_highlightedFragments.empty()) {
+ if (m_hasContextTrace || m_hasStackSizeTrace)
+ appendContextNames(oldState, currentLine);
- m_highlightedFragments.clear();
+ printFormats(out, infoStyle, ansiStyles);
+ out << resetBgColor;
}
- }
- void applyFormat(int offset, int length, const KSyntaxHighlighting::Format &format) override
- {
- m_highlightedFragments.push_back({m_hasFormatTrace ? format.name() : QString(), offset, length, format.id()});
+ m_highlightedFragments.clear();
}
+ }
- void applyFolding(int offset, int /*length*/, FoldingRegion region) override
- {
- if (!m_hasRegionTrace) return;
-
- const auto id = region.id();
+ void applyFormat(int offset, int length, const KSyntaxHighlighting::Format &format) override
+ {
+ m_highlightedFragments.push_back({m_hasFormatTrace ? format.name() : QString(), offset, length, format.id()});
+ }
- if (region.type() == FoldingRegion::Begin) {
- m_regions.push_back(Region{m_regionDepth, offset, -1, id, Region::State::Open});
- ++m_regionDepth;
- } else {
- // find open region
- auto it = m_regions.rbegin();
- auto eit = m_regions.rend();
- for (int depth = 0; it != eit; ++it) {
- if (it->regionId == id && it->bindIndex < 0) {
- if (it->state == Region::State::Close)
- ++depth;
- else if (--depth < 0)
- break;
- }
+ void applyFolding(int offset, int /*length*/, FoldingRegion region) override
+ {
+ if (!m_hasRegionTrace)
+ return;
+
+ const auto id = region.id();
+
+ if (region.type() == FoldingRegion::Begin) {
+ m_regions.push_back(Region{m_regionDepth, offset, -1, id, Region::State::Open});
+ // swap with previous region if this is a closing region with same offset in order to superimpose labels
+ if (m_regions.size() >= 2) {
+ auto &previousRegion = m_regions[m_regions.size() - 2];
+ if (previousRegion.state == Region::State::Close && previousRegion.offset == offset) {
+ std::swap(previousRegion, m_regions.back());
+ if (previousRegion.bindIndex != -1)
+ m_regions[previousRegion.bindIndex].bindIndex = m_regions.size() - 1;
}
-
- if (it != eit) {
- it->bindIndex = int(m_regions.size());
- int bindIndex = int(&*it - m_regions.data());
- m_regions.push_back(Region{it->depth, offset, bindIndex, id, Region::State::Close});
- } else {
- m_regions.push_back(Region{-1, offset, -1, id, Region::State::Close});
+ }
+ ++m_regionDepth;
+ } else {
+ // find open region
+ auto it = m_regions.rbegin();
+ auto eit = m_regions.rend();
+ for (int depth = 0; it != eit; ++it) {
+ if (it->regionId == id && it->bindIndex < 0) {
+ if (it->state == Region::State::Close)
+ ++depth;
+ else if (--depth < 0)
+ break;
}
+ }
- m_regionDepth = std::max(m_regionDepth-1, 0);
+ if (it != eit) {
+ it->bindIndex = int(m_regions.size());
+ int bindIndex = int(&*it - m_regions.data());
+ m_regions.push_back(Region{it->depth, offset, bindIndex, id, Region::State::Close});
+ } else {
+ m_regions.push_back(Region{-1, offset, -1, id, Region::State::Close});
}
+
+ m_regionDepth = std::max(m_regionDepth - 1, 0);
}
+ }
- using KSyntaxHighlighting::AbstractHighlighter::highlightLine;
+ using KSyntaxHighlighting::AbstractHighlighter::highlightLine;
- private:
- /**
- * Initializes with colors of \p ansiStyle without duplicate.
- */
- void initRegionStyles(const std::vector<QPair<QString, QString>> &ansiStyles)
- {
- m_regionStyles.resize(ansiStyles.size());
- for (std::size_t i = 0; i < m_regionStyles.size(); ++i)
- m_regionStyles[i] = ansiStyles[i].first;
+private:
+ /**
+ * Initializes with colors of \p ansiStyle without duplicate.
+ */
+ void initRegionStyles(const std::vector<QPair<QString, QString>> &ansiStyles)
+ {
+ m_regionStyles.resize(ansiStyles.size());
+ for (std::size_t i = 0; i < m_regionStyles.size(); ++i)
+ m_regionStyles[i] = ansiStyles[i].first;
- std::sort(m_regionStyles.begin(), m_regionStyles.end());
- m_regionStyles.erase(std::unique(m_regionStyles.begin(), m_regionStyles.end()), m_regionStyles.end());
- }
+ std::sort(m_regionStyles.begin(), m_regionStyles.end());
+ m_regionStyles.erase(std::unique(m_regionStyles.begin(), m_regionStyles.end()), m_regionStyles.end());
+ }
- /**
- * Append the context name in front of the format name.
- */
- void appendContextNames(State &state, const QString &currentLine)
- {
- auto newState = state;
- for (auto &fragment : m_highlightedFragments) {
- QString contextName = extractContextName(StateData::get(newState));
-
- m_contextCapture.offsetNext = 0;
- m_contextCapture.lengthNext = 0;
- // truncate the line to deduce the context from the format
- const auto lineFragment = currentLine.mid(0, fragment.offset + fragment.length + 1);
- newState = m_contextCapture.highlightLine(lineFragment, state);
-
- // Deduced context does not start at the position of the format.
- // This can happen because of lookAhead/fallthrought attribute,
- // assertion in regex, etc.
- if (m_contextCapture.offset != fragment.offset && m_contextCapture.length != fragment.length) {
- contextName.insert(0, QLatin1Char('~'));
- }
- fragment.name.insert(0, contextName);
+ /**
+ * Append the context name in front of the format name.
+ */
+ void appendContextNames(State &state, const QString &currentLine)
+ {
+ auto newState = state;
+ for (auto &fragment : m_highlightedFragments) {
+ QString contextName = extractContextName(StateData::get(newState));
+
+ m_contextCapture.offsetNext = 0;
+ m_contextCapture.lengthNext = 0;
+ // truncate the line to deduce the context from the format
+ const auto lineFragment = currentLine.mid(0, fragment.offset + fragment.length + 1);
+ newState = m_contextCapture.highlightLine(lineFragment, state);
+
+ // Deduced context does not start at the position of the format.
+ // This can happen because of lookAhead/fallthrought attribute,
+ // assertion in regex, etc.
+ if (m_contextCapture.offset != fragment.offset && m_contextCapture.length != fragment.length) {
+ contextName.insert(0, QLatin1Char('~'));
}
+ fragment.name.insert(0, contextName);
}
+ }
- /**
- * \return Current context name with definition name if different
- * from the current definition name
- */
- QString extractContextName(StateData *stateData) const
- {
+ /**
+ * \return Current context name with definition name if different
+ * from the current definition name
+ */
+ QString extractContextName(StateData *stateData) const
+ {
+ QString label;
+
+ if (m_hasStackSizeTrace) {
+ label += QLatin1Char('(') % QString::number(stateData->size()) % QLatin1Char(')');
+ }
+
+ if (m_hasContextTrace) {
// first state is empty
if (stateData->isEmpty()) {
- return QStringLiteral("[???]");
+ return label + QStringLiteral("[???]");
}
const auto context = stateData->topContext();
const auto defData = DefinitionData::get(context->definition());
- const auto contextName = (defData != m_defData)
- ? QString(QLatin1Char('<') % defData->name % QLatin1Char('>'))
- : QString();
- return QString(contextName % QLatin1Char('[') % context->name() % QLatin1Char(']'));
+ const auto contextName = (defData != m_defData) ? QString(QLatin1Char('<') % defData->name % QLatin1Char('>')) : QString();
+ return QString(label % contextName % QLatin1Char('[') % context->name() % QLatin1Char(']'));
}
- void printFormats(QTextStream &out, QLatin1String regionStyle, const std::vector<QPair<QString, QString>> &ansiStyles)
- {
- // init graph
- m_formatGraph.clear();
- for (auto const& fragment : m_highlightedFragments) {
- GraphLine& line = lineAtOffset(m_formatGraph, fragment.offset);
- auto const& style = ansiStyles[fragment.formatId].first;
- line.pushLabel(fragment.offset, style % nameStyle % fragment.name % regionStyle, fragment.name.size());
-
- for (GraphLine* pline = m_formatGraph.data(); pline <= &line; ++pline) {
- pline->pushGraph(fragment.offset, style % graphSymbol % regionStyle, 1);
- }
- }
+ return label;
+ }
- // display graph
- out << regionStyle;
- auto first = m_formatGraph.begin();
- auto last = m_formatGraph.end();
- --last;
- for (; first != last; ++first) {
- out << first->graphLine << "\x1b[K\n" << first->labelLine << "\x1b[K\n";
+ void printFormats(QTextStream &out, QLatin1String regionStyle, const std::vector<QPair<QString, QString>> &ansiStyles)
+ {
+ // init graph
+ m_formatGraph.clear();
+ for (auto const &fragment : m_highlightedFragments) {
+ GraphLine &line = lineAtOffset(m_formatGraph, fragment.offset);
+ auto const &style = ansiStyles[fragment.formatId].first;
+ line.pushLabel(fragment.offset, style % nameStyle % fragment.name % regionStyle, fragment.name.size());
+
+ for (GraphLine *pline = m_formatGraph.data(); pline <= &line; ++pline) {
+ pline->pushGraph(fragment.offset, style % graphSymbol % regionStyle, 1);
}
- out << first->graphLine << "\x1b[K\n" << first->labelLine << "\x1b[K\x1b[0m\n";
}
- void printRegions(QTextStream &out, QLatin1String regionStyle, int lineLength)
- {
- const QString continuationLine = QStringLiteral(
- "------------------------------"
- "------------------------------"
- "------------------------------");
-
- bool hasContinuation = false;
-
- m_regionGraph.clear();
- QString label;
- QString numStr;
-
- // init graph
- for (Region& region : m_regions) {
- if (region.state == Region::State::Continuation) {
- hasContinuation = true;
- continue;
- }
+ // display graph
+ out << regionStyle;
+ auto first = m_formatGraph.begin();
+ auto last = m_formatGraph.end();
+ --last;
+ for (; first != last; ++first) {
+ out << first->graphLine << "\x1b[K\n" << first->labelLine << "\x1b[K\n";
+ }
+ out << first->graphLine << "\x1b[K\n" << first->labelLine << "\x1b[K\x1b[0m\n";
+ }
+
+ void printRegions(QTextStream &out, QLatin1String regionStyle, int lineLength)
+ {
+ const QString continuationLine = QStringLiteral(
+ "------------------------------"
+ "------------------------------"
+ "------------------------------");
+
+ bool hasContinuation = false;
+
+ m_regionGraph.clear();
+ QString label;
+ QString numStr;
+
+ // init graph
+ for (Region &region : m_regions) {
+ if (region.state == Region::State::Continuation) {
+ hasContinuation = true;
+ continue;
+ }
- auto pushGraphs = [&](int offset, const GraphLine *endline, const QStringView &style){
- for (GraphLine* pline = m_regionGraph.data(); pline <= endline; ++pline) {
- // a label can hide a graph
- if (pline->graphLineLength <= offset) {
- pline->pushGraph(offset, style % graphSymbol % regionStyle, 1);
- }
+ auto pushGraphs = [&](int offset, const GraphLine *endline, const QStringView &style) {
+ for (GraphLine *pline = m_regionGraph.data(); pline <= endline; ++pline) {
+ // a label can hide a graph
+ if (pline->graphLineLength <= offset) {
+ pline->pushGraph(offset, style % graphSymbol % regionStyle, 1);
}
- };
+ }
+ };
- QChar openChar;
- QChar closeChar;
- int lpad = 0;
- int rpad = 0;
+ QChar openChar;
+ QChar closeChar;
+ int lpad = 0;
+ int rpad = 0;
- int offsetLabel = region.offset;
+ int offsetLabel = region.offset;
- numStr.setNum(region.regionId);
+ numStr.setNum(region.regionId);
- if (region.state == Region::State::Open) {
- openChar = QLatin1Char('(');
- if (region.bindIndex == -1) {
- rpad = lineLength - region.offset - numStr.size();
- } else {
- rpad = m_regions[region.bindIndex].offset - region.offset - 2;
- closeChar = QLatin1Char(')');
- }
- // close without open
- } else if (region.bindIndex == -1) {
- closeChar = QLatin1Char('>');
- // label already present, we only display the graph
- } else if (m_regions[region.bindIndex].state == Region::State::Open) {
- const auto &openRegion = m_regions[region.bindIndex];
- // here offset is a graph index
- const GraphLine &line = m_regionGraph[openRegion.offset];
- const auto &style = m_regionStyles[openRegion.depth % m_regionStyles.size()];
- pushGraphs(region.offset, &line, style);
- continue;
+ if (region.state == Region::State::Open) {
+ openChar = QLatin1Char('(');
+ if (region.bindIndex == -1) {
+ rpad = lineLength - region.offset - numStr.size();
} else {
+ rpad = m_regions[region.bindIndex].offset - region.offset - 2;
closeChar = QLatin1Char(')');
- lpad = region.offset - numStr.size();
- offsetLabel = 0;
}
+ // close without open
+ } else if (region.bindIndex == -1) {
+ closeChar = QLatin1Char('>');
+ // label already present, we only display the graph
+ } else if (m_regions[region.bindIndex].state == Region::State::Open) {
+ const auto &openRegion = m_regions[region.bindIndex];
+ // here offset is a graph index
+ const GraphLine &line = m_regionGraph[openRegion.offset];
+ const auto &style = m_regionStyles[openRegion.depth % m_regionStyles.size()];
+ pushGraphs(region.offset, &line, style);
+ continue;
+ } else {
+ closeChar = QLatin1Char(')');
+ lpad = region.offset - numStr.size();
+ offsetLabel = 0;
+ }
- const QStringView openS(&openChar, openChar.unicode() ? 1 : 0);
- const QStringView closeS(&closeChar, closeChar.unicode() ? 1 : 0);
+ const QStringView openS(&openChar, openChar.unicode() ? 1 : 0);
+ const QStringView closeS(&closeChar, closeChar.unicode() ? 1 : 0);
- label.clear();
- fillString(label, lpad, continuationLine);
- label += numStr;
- fillString(label, rpad, continuationLine);
+ label.clear();
+ fillString(label, lpad, continuationLine);
+ label += numStr;
+ fillString(label, rpad, continuationLine);
- GraphLine &line = lineAtOffset(m_regionGraph, offsetLabel);
- const auto &style = m_regionStyles[region.depth % m_regionStyles.size()];
- line.pushLabel(offsetLabel, style % nameStyle % openS % label % closeS % regionStyle, label.size() + openS.size() + closeS.size());
- pushGraphs(region.offset, &line, style);
+ GraphLine &line = lineAtOffset(m_regionGraph, offsetLabel);
+ const auto &style = m_regionStyles[region.depth % m_regionStyles.size()];
+ line.pushLabel(offsetLabel, style % nameStyle % openS % label % closeS % regionStyle, label.size() + openS.size() + closeS.size());
+ pushGraphs(region.offset, &line, style);
- // transforms offset into graph index when region is on 1 line
- if (region.state == Region::State::Open && region.bindIndex != -1) {
- region.offset = &line - m_regionGraph.data();
- }
+ // transforms offset into graph index when region is on 1 line
+ if (region.state == Region::State::Open && region.bindIndex != -1) {
+ region.offset = &line - m_regionGraph.data();
}
+ }
- out << regionStyle;
-
- // display regions which are neither closed nor open
- if (hasContinuation) {
- label.clear();
- fillString(label, lineLength ? lineLength : 5, continuationLine);
- for (const auto &region : m_regions) {
- if (region.state == Region::State::Continuation && region.bindIndex == -1) {
- const auto &style = m_regionStyles[region.depth % m_regionStyles.size()];
- out << style << nameStyle << label << regionStyle << "\x1b[K\n";
- }
- }
- }
+ out << regionStyle;
- // display graph
- if (!m_regionGraph.empty()) {
- auto first = m_regionGraph.rbegin();
- auto last = m_regionGraph.rend();
- --last;
- for (; first != last; ++first) {
- out << first->labelLine << "\x1b[K\n" << first->graphLine << "\x1b[K\n";
+ // display regions which are neither closed nor open
+ if (hasContinuation) {
+ label.clear();
+ fillString(label, lineLength ? lineLength : 5, continuationLine);
+ for (const auto &region : m_regions) {
+ if (region.state == Region::State::Continuation && region.bindIndex == -1) {
+ const auto &style = m_regionStyles[region.depth % m_regionStyles.size()];
+ out << style << nameStyle << label << regionStyle << "\x1b[K\n";
}
- out << first->labelLine << "\x1b[K\n" << first->graphLine << "\x1b[K\x1b[0m\n";
}
+ }
- // keep regions that are not closed
- m_regions.erase(std::remove_if(m_regions.begin(), m_regions.end(), [](Region const& region){
- return region.bindIndex != -1 || region.state == Region::State::Close;
- }), m_regions.end());
- // all remaining regions become Continuation
- for (auto& region : m_regions) {
- region.offset = 0;
- region.state = Region::State::Continuation;
+ // display graph
+ if (!m_regionGraph.empty()) {
+ auto first = m_regionGraph.rbegin();
+ auto last = m_regionGraph.rend();
+ --last;
+ for (; first != last; ++first) {
+ out << first->labelLine << "\x1b[K\n" << first->graphLine << "\x1b[K\n";
}
+ out << first->labelLine << "\x1b[K\n" << first->graphLine << "\x1b[K\x1b[0m\n";
}
- struct HighlightFragment
- {
- QString name;
- int offset;
- int length;
- quint16 formatId;
- };
+ // keep regions that are not closed
+ m_regions.erase(std::remove_if(m_regions.begin(),
+ m_regions.end(),
+ [](Region const &region) {
+ return region.bindIndex != -1 || region.state == Region::State::Close;
+ }),
+ m_regions.end());
+ // all remaining regions become Continuation
+ for (auto &region : m_regions) {
+ region.offset = 0;
+ region.state = Region::State::Continuation;
+ }
+ }
- struct ContextCaptureHighlighter : KSyntaxHighlighting::AbstractHighlighter
- {
- int offset;
- int length;
- int offsetNext;
- int lengthNext;
-
- void applyFormat(int offset, int length, const KSyntaxHighlighting::Format &/*format*/) override
- {
- offset = offsetNext;
- length = lengthNext;
- offsetNext = offset;
- lengthNext = length;
- }
+ struct HighlightFragment {
+ QString name;
+ int offset;
+ int length;
+ quint16 formatId;
+ };
- using KSyntaxHighlighting::AbstractHighlighter::highlightLine;
- };
+ struct ContextCaptureHighlighter : KSyntaxHighlighting::AbstractHighlighter {
+ int offset;
+ int length;
+ int offsetNext;
+ int lengthNext;
- struct Region
+ void applyFormat(int offset, int length, const KSyntaxHighlighting::Format & /*format*/) override
{
- enum class State : int8_t
- {
- Open,
- Close,
- Continuation,
- };
+ offset = offsetNext;
+ length = lengthNext;
+ offsetNext = offset;
+ lengthNext = length;
+ }
+
+ using KSyntaxHighlighting::AbstractHighlighter::highlightLine;
+ };
- int depth;
- int offset;
- int bindIndex;
- quint16 regionId;
- State state;
+ struct Region {
+ enum class State : int8_t {
+ Open,
+ Close,
+ Continuation,
};
- bool m_hasFormatTrace;
- bool m_hasRegionTrace;
+ int depth;
+ int offset;
+ int bindIndex;
+ quint16 regionId;
+ State state;
+ };
- std::vector<HighlightFragment> m_highlightedFragments;
- std::vector<GraphLine> m_formatGraph;
- ContextCaptureHighlighter m_contextCapture;
- DefinitionData* m_defData;
+ bool m_hasFormatTrace;
+ bool m_hasRegionTrace;
+ bool m_hasStackSizeTrace;
+ bool m_hasContextTrace;
- int m_regionDepth = 0;
- std::vector<Region> m_regions;
- std::vector<GraphLine> m_regionGraph;
- std::vector<QStringView> m_regionStyles;
- };
+ std::vector<HighlightFragment> m_highlightedFragments;
+ std::vector<GraphLine> m_formatGraph;
+ ContextCaptureHighlighter m_contextCapture;
+ DefinitionData *m_defData;
+
+ int m_regionDepth = 0;
+ std::vector<Region> m_regions;
+ std::vector<GraphLine> m_regionGraph;
+ std::vector<QStringView> m_regionStyles;
+};
} // anonymous namespace
class KSyntaxHighlighting::AnsiHighlighterPrivate
@@ -1186,13 +1212,13 @@ void AnsiHighlighter::highlightData(QIODevice *dev, AnsiFormat format, bool useE
}
// initialize ansiStyles
- for (auto&& definition : qAsConst(definitions)) {
+ for (auto &&definition : qAsConst(definitions)) {
const auto formats = definition.formats();
- for (auto&& format : formats) {
+ for (auto &&format : 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(std::max(std::size_t(id * 2), std::size_t(32)));
}
AnsiBuffer buffer;
@@ -1210,11 +1236,16 @@ void AnsiHighlighter::highlightData(QIODevice *dev, AnsiFormat format, bool useE
buffer.appendForeground(format.textColor(theme).rgb(), is256Colors, colorCache);
else
buffer.append(foregroundDefaultColor);
- if (hasBg) buffer.appendBackground(format.backgroundColor(theme).rgb(), is256Colors, colorCache);
- if (hasBold) buffer.append(QLatin1String("1;"));
- if (hasItalic) buffer.append(QLatin1String("3;"));
- if (hasUnderline) buffer.append(QLatin1String("4;"));
- if (hasStrikeThrough) buffer.append(QLatin1String("9;"));
+ if (hasBg)
+ buffer.appendBackground(format.backgroundColor(theme).rgb(), is256Colors, colorCache);
+ if (hasBold)
+ buffer.append(QLatin1String("1;"));
+ if (hasItalic)
+ buffer.append(QLatin1String("3;"));
+ if (hasUnderline)
+ buffer.append(QLatin1String("4;"));
+ if (hasStrikeThrough)
+ buffer.append(QLatin1String("9;"));
// if there is ANSI style
if (buffer.latin1().size() > 2) {
@@ -1231,10 +1262,14 @@ void AnsiHighlighter::highlightData(QIODevice *dev, AnsiFormat format, bool useE
d->ansiStyles[id].second = buffer.latin1();
} else if (hasEffect) {
buffer.append(QLatin1String("\x1b["));
- if (hasBold) buffer.append(QLatin1String("21;"));
- if (hasItalic) buffer.append(QLatin1String("23;"));
- if (hasUnderline) buffer.append(QLatin1String("24;"));
- if (hasStrikeThrough) buffer.append(QLatin1String("29;"));
+ if (hasBold)
+ buffer.append(QLatin1String("21;"));
+ if (hasItalic)
+ buffer.append(QLatin1String("23;"));
+ if (hasUnderline)
+ buffer.append(QLatin1String("24;"));
+ if (hasStrikeThrough)
+ buffer.append(QLatin1String("29;"));
buffer.setFinalStyle();
d->ansiStyles[id].second = buffer.latin1();
}
@@ -1286,6 +1321,6 @@ 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()];
+ auto const &ansiStyle = d->ansiStyles[format.id()];
d->out << ansiStyle.first << d->currentLine.midRef(offset, length) << ansiStyle.second;
}
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/ansihighlighter.h b/src/libs/3rdparty/syntax-highlighting/src/lib/ansihighlighter.h
index 6593799234..e4a7cb09f8 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/ansihighlighter.h
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/ansihighlighter.h
@@ -10,9 +10,9 @@
#include "abstracthighlighter.h"
#include "ksyntaxhighlighting_export.h"
+#include <QFlags>
#include <QIODevice>
#include <QString>
-#include <QFlags>
#include <memory>
@@ -23,26 +23,29 @@ class AnsiHighlighterPrivate;
class KSYNTAXHIGHLIGHTING_EXPORT AnsiHighlighter final : public AbstractHighlighter
{
public:
- enum class AnsiFormat
- {
+ enum class AnsiFormat {
TrueColor,
XTerm256Color,
};
- enum class TraceOption
- {
+ enum class TraceOption {
NoOptions,
- Format = 1 << 0,
- Region = 1 << 1,
+ Format = 1 << 0,
+ Region = 1 << 1,
Context = 1 << 2,
+ StackSize = 1 << 3,
};
Q_DECLARE_FLAGS(TraceOptions, TraceOption)
AnsiHighlighter();
~AnsiHighlighter() override;
- void highlightFile(const QString &fileName, AnsiFormat format = AnsiFormat::TrueColor, bool useEditorBackground = true, TraceOptions traceOptions = TraceOptions());
- void highlightData(QIODevice *device, AnsiFormat format = AnsiFormat::TrueColor, bool useEditorBackground = true, TraceOptions traceOptions = TraceOptions());
+ void highlightFile(const QString &fileName,
+ AnsiFormat format = AnsiFormat::TrueColor,
+ bool useEditorBackground = true,
+ TraceOptions traceOptions = TraceOptions());
+ void
+ highlightData(QIODevice *device, AnsiFormat format = AnsiFormat::TrueColor, bool useEditorBackground = true, TraceOptions traceOptions = TraceOptions());
void setOutputFile(const QString &fileName);
void setOutputFile(FILE *fileHandle);
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/context.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/context.cpp
index 4d83da3d05..f980ea5be8 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/context.cpp
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/context.cpp
@@ -135,7 +135,8 @@ void Context::resolveIncludes()
context = defData->contextByName(inc->contextName());
}
if (!context) {
- qCWarning(Log) << "Unable to resolve include rule for definition" << inc->contextName() << "##" << inc->definitionName() << "in" << m_def.definition().name();
+ qCWarning(Log) << "Unable to resolve include rule for definition" << inc->contextName() << "##" << inc->definitionName() << "in"
+ << m_def.definition().name();
++it;
continue;
}
@@ -171,7 +172,8 @@ void Context::resolveAttributeFormat()
m_attributeFormat = DefinitionData::get(def)->formatByName(m_attribute);
if (!m_attributeFormat.isValid()) {
if (m_attributeContext) {
- qCWarning(Log) << "Context: Unknown format" << m_attribute << "in context" << m_name << "of definition" << m_def.definition().name() << "from included context" << m_attributeContext->m_name << "of definition" << def.name();
+ qCWarning(Log) << "Context: Unknown format" << m_attribute << "in context" << m_name << "of definition" << m_def.definition().name()
+ << "from included context" << m_attributeContext->m_name << "of definition" << def.name();
} else {
qCWarning(Log) << "Context: Unknown format" << m_attribute << "in context" << m_name << "of definition" << m_def.definition().name();
}
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/contextswitch.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/contextswitch.cpp
index 1ec4759103..14c50396d8 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/contextswitch.cpp
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/contextswitch.cpp
@@ -27,7 +27,7 @@ Context *ContextSwitch::context() const
return m_context;
}
-void ContextSwitch::parse(const QStringView &contextInstr)
+void ContextSwitch::parse(const QStringRef &contextInstr)
{
if (contextInstr.isEmpty() || contextInstr == QLatin1String("#stay"))
return;
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/contextswitch_p.h b/src/libs/3rdparty/syntax-highlighting/src/lib/contextswitch_p.h
index e861cbaded..c84948d9f7 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/contextswitch_p.h
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/contextswitch_p.h
@@ -25,7 +25,7 @@ public:
int popCount() const;
Context *context() const;
- void parse(const QStringView &contextInstr);
+ void parse(const QStringRef &contextInstr);
void resolve(const Definition &def);
private:
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/definition.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/definition.cpp
index 0b6975d775..2ff090f61b 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/definition.cpp
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/definition.cpp
@@ -19,15 +19,14 @@
#include "repository.h"
#include "repository_p.h"
#include "rule_p.h"
-#include "xml_p.h"
#include "worddelimiters_p.h"
+#include "xml_p.h"
#include <QCborMap>
#include <QCoreApplication>
#include <QFile>
#include <QHash>
#include <QStringList>
-#include <QVector>
#include <QXmlStreamReader>
#include <algorithm>
@@ -234,7 +233,9 @@ QVector<Format> Definition::formats() const
// sort formats so that the order matches the order of the itemDatas in the xml files.
auto formatList = QVector<Format>::fromList(d->formats.values());
- std::sort(formatList.begin(), formatList.end(), [](const KSyntaxHighlighting::Format &lhs, const KSyntaxHighlighting::Format &rhs) { return lhs.id() < rhs.id(); });
+ std::sort(formatList.begin(), formatList.end(), [](const KSyntaxHighlighting::Format &lhs, const KSyntaxHighlighting::Format &rhs) {
+ return lhs.id() < rhs.id();
+ });
return formatList;
}
@@ -244,15 +245,16 @@ QVector<Definition> Definition::includedDefinitions() const
d->load();
// init worklist and result used as guard with this definition
- QVector<Definition> queue {*this};
- QVector<Definition> definitions {*this};
+ QVector<Definition> queue{*this};
+ QVector<Definition> definitions{*this};
while (!queue.isEmpty()) {
// Iterate all context rules to find associated Definitions. This will
// automatically catch other Definitions referenced with IncludeRuldes or ContextSwitch.
const auto definition = queue.takeLast();
for (const auto &context : qAsConst(definition.d->contexts)) {
// handle context switch attributes of this context itself
- for (const auto switchContext : {context->lineEndContext().context(), context->lineEmptyContext().context(), context->fallthroughContext().context()}) {
+ for (const auto switchContext :
+ {context->lineEndContext().context(), context->lineEmptyContext().context(), context->fallthroughContext().context()}) {
if (switchContext) {
if (!definitions.contains(switchContext->definition())) {
queue.push_back(switchContext->definition());
@@ -387,6 +389,12 @@ bool DefinitionData::load(OnlyKeywords onlyKeywords)
context->resolveAttributeFormat();
}
+ for (const auto context : qAsConst(contexts)) {
+ for (const auto &rule : context->rules()) {
+ rule->resolvePostProcessing();
+ }
+ }
+
return true;
}
@@ -449,18 +457,10 @@ bool DefinitionData::loadMetaData(const QString &file, const QCborMap &obj)
fileName = file;
const auto exts = obj.value(QLatin1String("extensions")).toString();
-#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
- for (const auto &ext : exts.split(QLatin1Char(';'), QString::SkipEmptyParts))
-#else
for (const auto &ext : exts.split(QLatin1Char(';'), Qt::SkipEmptyParts))
-#endif
extensions.push_back(ext);
const auto mts = obj.value(QLatin1String("mimetype")).toString();
-#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
- for (const auto &mt : mts.split(QLatin1Char(';'), QString::SkipEmptyParts))
-#else
for (const auto &mt : mts.split(QLatin1Char(';'), Qt::SkipEmptyParts))
-#endif
mimetypes.push_back(mt);
return true;
@@ -485,18 +485,10 @@ bool DefinitionData::loadLanguage(QXmlStreamReader &reader)
author = reader.attributes().value(QLatin1String("author")).toString();
license = reader.attributes().value(QLatin1String("license")).toString();
const auto exts = reader.attributes().value(QLatin1String("extensions")).toString();
-#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
- for (const auto &ext : exts.split(QLatin1Char(';'), QString::SkipEmptyParts))
-#else
for (const auto &ext : exts.split(QLatin1Char(';'), Qt::SkipEmptyParts))
-#endif
extensions.push_back(ext);
const auto mts = reader.attributes().value(QLatin1String("mimetype")).toString();
-#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
- for (const auto &mt : mts.split(QLatin1Char(';'), QString::SkipEmptyParts))
-#else
for (const auto &mt : mts.split(QLatin1Char(';'), Qt::SkipEmptyParts))
-#endif
mimetypes.push_back(mt);
if (reader.attributes().hasAttribute(QLatin1String("casesensitive")))
caseSensitive = Xml::attrToBool(reader.attributes().value(QLatin1String("casesensitive"))) ? Qt::CaseSensitive : Qt::CaseInsensitive;
@@ -630,19 +622,15 @@ void DefinitionData::loadGeneral(QXmlStreamReader &reader)
caseSensitive = Xml::attrToBool(reader.attributes().value(QLatin1String("casesensitive"))) ? Qt::CaseSensitive : Qt::CaseInsensitive;
// adapt wordDelimiters
- for (QChar c : reader.attributes().value(QLatin1String("additionalDeliminator")))
- wordDelimiters.append(c);
- for (QChar c : reader.attributes().value(QLatin1String("weakDeliminator")))
- wordDelimiters.remove(c);
+ wordDelimiters.append(reader.attributes().value(QLatin1String("additionalDeliminator")));
+ wordDelimiters.remove(reader.attributes().value(QLatin1String("weakDeliminator")));
// adapt WordWrapDelimiters
- auto wordWrapDeliminatorAttr = reader.attributes().value(
- QLatin1String("wordWrapDeliminator"));
+ QStringRef wordWrapDeliminatorAttr = reader.attributes().value(QLatin1String("wordWrapDeliminator"));
if (wordWrapDeliminatorAttr.isEmpty())
wordWrapDelimiters = wordDelimiters;
else {
- for (QChar c : wordWrapDeliminatorAttr)
- wordWrapDelimiters.append(c);
+ wordWrapDelimiters.append(wordWrapDeliminatorAttr);
}
} else if (reader.name() == QLatin1String("folding")) {
if (reader.attributes().hasAttribute(QLatin1String("indentationsensitive")))
@@ -776,15 +764,15 @@ void DefinitionData::loadSpellchecking(QXmlStreamReader &reader)
}
}
-bool DefinitionData::checkKateVersion(const QStringView &verStr)
+bool DefinitionData::checkKateVersion(const QStringRef &verStr)
{
const auto idx = verStr.indexOf(QLatin1Char('.'));
if (idx <= 0) {
qCWarning(Log) << "Skipping" << fileName << "due to having no valid kateversion attribute:" << verStr;
return false;
}
- const auto major = verStr.left(idx).toString().toInt();
- const auto minor = verStr.mid(idx + 1).toString().toInt();
+ const auto major = verStr.left(idx).toInt();
+ const auto minor = verStr.mid(idx + 1).toInt();
if (major > SyntaxHighlighting_VERSION_MAJOR || (major == SyntaxHighlighting_VERSION_MAJOR && minor > SyntaxHighlighting_VERSION_MINOR)) {
qCWarning(Log) << "Skipping" << fileName << "due to being too new, version:" << verStr;
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/definition.h b/src/libs/3rdparty/syntax-highlighting/src/lib/definition.h
index 8226fbdd24..0cc2df70d0 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/definition.h
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/definition.h
@@ -17,6 +17,8 @@
QT_BEGIN_NAMESPACE
class QChar;
class QString;
+class QStringList;
+template<typename T> class QVector;
QT_END_NAMESPACE
namespace KSyntaxHighlighting
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/definition_p.h b/src/libs/3rdparty/syntax-highlighting/src/lib/definition_p.h
index 274f7640b5..c334e31ac0 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/definition_p.h
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/definition_p.h
@@ -53,7 +53,7 @@ public:
void loadComments(QXmlStreamReader &reader);
void loadFoldingIgnoreList(QXmlStreamReader &reader);
void loadSpellchecking(QXmlStreamReader &reader);
- bool checkKateVersion(const QStringView &verStr);
+ bool checkKateVersion(const QStringRef &verStr);
void resolveIncludeKeywords();
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/definitiondownloader.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/definitiondownloader.cpp
index 35bb29f82f..93db5ac62a 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/definitiondownloader.cpp
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/definitiondownloader.cpp
@@ -43,7 +43,7 @@ void DefinitionDownloaderPrivate::definitionListDownloadFinished(QNetworkReply *
const auto networkError = reply->error();
if (networkError != QNetworkReply::NoError) {
qCWarning(Log) << networkError;
- emit q->done(); // TODO return error
+ Q_EMIT q->done(); // TODO return error
return;
}
@@ -60,7 +60,7 @@ void DefinitionDownloaderPrivate::definitionListDownloadFinished(QNetworkReply *
}
if (pendingDownloads == 0)
- emit q->informationMessage(QObject::tr("All syntax definitions are up-to-date."));
+ Q_EMIT q->informationMessage(QObject::tr("All syntax definitions are up-to-date."));
checkDone();
}
@@ -72,14 +72,14 @@ void DefinitionDownloaderPrivate::updateDefinition(QXmlStreamReader &parser)
auto localDef = repo->definitionForName(name.toString());
if (!localDef.isValid()) {
- 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.toString()));
downloadDefinition(QUrl(parser.attributes().value(QLatin1String("url")).toString()));
return;
}
const auto version = parser.attributes().value(QLatin1String("version"));
if (localDef.version() < version.toFloat()) {
- 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.toString(), version.toString()));
downloadDefinition(QUrl(parser.attributes().value(QLatin1String("url")).toString()));
}
}
@@ -94,7 +94,9 @@ void DefinitionDownloaderPrivate::downloadDefinition(const QUrl &downloadUrl)
QNetworkRequest req(url);
auto reply = nam->get(req);
- QObject::connect(reply, &QNetworkReply::finished, q, [this, reply]() { downloadDefinitionFinished(reply); });
+ QObject::connect(reply, &QNetworkReply::finished, q, [this, reply]() {
+ downloadDefinitionFinished(reply);
+ });
++pendingDownloads;
needsReload = true;
}
@@ -134,7 +136,7 @@ void DefinitionDownloaderPrivate::checkDone()
if (needsReload)
repo->reload();
- emit QTimer::singleShot(0, q, &DefinitionDownloader::done);
+ Q_EMIT QTimer::singleShot(0, q, &DefinitionDownloader::done);
}
}
@@ -161,10 +163,12 @@ DefinitionDownloader::~DefinitionDownloader()
void DefinitionDownloader::start()
{
- const QString url = QLatin1String("https://www.kate-editor.org/syntax/update-") + QString::number(SyntaxHighlighting_VERSION_MAJOR) + QLatin1Char('.') + QString::number(SyntaxHighlighting_VERSION_MINOR) + QLatin1String(".xml");
+ const QString url = QLatin1String("https://www.kate-editor.org/syntax/update-") + QString::number(SyntaxHighlighting_VERSION_MAJOR) + QLatin1Char('.')
+ + QString::number(SyntaxHighlighting_VERSION_MINOR) + QLatin1String(".xml");
auto req = QNetworkRequest(QUrl(url));
- req.setAttribute(QNetworkRequest::RedirectPolicyAttribute,
- QNetworkRequest::NoLessSafeRedirectPolicy);
+ req.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
auto reply = d->nam->get(req);
- QObject::connect(reply, &QNetworkReply::finished, this, [=]() { d->definitionListDownloadFinished(reply); });
+ QObject::connect(reply, &QNetworkReply::finished, this, [=]() {
+ d->definitionListDownloadFinished(reply);
+ });
}
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/format.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/format.cpp
index 716ff197af..4bd25fb31c 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/format.cpp
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/format.cpp
@@ -19,7 +19,7 @@
using namespace KSyntaxHighlighting;
-static Theme::TextStyle stringToDefaultFormat(const QStringView &str)
+static Theme::TextStyle stringToDefaultFormat(const QStringRef &str)
{
if (!str.startsWith(QLatin1String("ds")))
return Theme::Normal;
@@ -98,13 +98,16 @@ Theme::TextStyle Format::textStyle() const
bool Format::isDefaultTextStyle(const Theme &theme) const
{
// use QColor::fromRgba for background QRgb => QColor conversion to avoid unset colors == black!
- return (!hasTextColor(theme)) && (!hasBackgroundColor(theme)) && (selectedTextColor(theme) == theme.selectedTextColor(Theme::Normal)) && (selectedBackgroundColor(theme) == QColor::fromRgba(theme.selectedBackgroundColor(Theme::Normal))) &&
- (isBold(theme) == theme.isBold(Theme::Normal)) && (isItalic(theme) == theme.isItalic(Theme::Normal)) && (isUnderline(theme) == theme.isUnderline(Theme::Normal)) && (isStrikeThrough(theme) == theme.isStrikeThrough(Theme::Normal));
+ return (!hasTextColor(theme)) && (!hasBackgroundColor(theme)) && (selectedTextColor(theme).rgba() == theme.selectedTextColor(Theme::Normal))
+ && (selectedBackgroundColor(theme).rgba() == (theme.selectedBackgroundColor(Theme::Normal))) && (isBold(theme) == theme.isBold(Theme::Normal))
+ && (isItalic(theme) == theme.isItalic(Theme::Normal)) && (isUnderline(theme) == theme.isUnderline(Theme::Normal))
+ && (isStrikeThrough(theme) == theme.isStrikeThrough(Theme::Normal));
}
bool Format::hasTextColor(const Theme &theme) const
{
- return textColor(theme) != theme.textColor(Theme::Normal) && (d->style.textColor || theme.textColor(d->defaultStyle) || d->styleOverride(theme).textColor);
+ return textColor(theme) != QColor::fromRgba(theme.textColor(Theme::Normal))
+ && (d->style.textColor || theme.textColor(d->defaultStyle) || d->styleOverride(theme).textColor);
}
QColor Format::textColor(const Theme &theme) const
@@ -112,7 +115,7 @@ QColor Format::textColor(const Theme &theme) const
const auto overrideStyle = d->styleOverride(theme);
if (overrideStyle.textColor)
return overrideStyle.textColor;
- return d->style.textColor ? d->style.textColor : theme.textColor(d->defaultStyle);
+ return d->style.textColor ? QColor::fromRgba(d->style.textColor) : QColor::fromRgba(theme.textColor(d->defaultStyle));
}
QColor Format::selectedTextColor(const Theme &theme) const
@@ -120,13 +123,14 @@ QColor Format::selectedTextColor(const Theme &theme) const
const auto overrideStyle = d->styleOverride(theme);
if (overrideStyle.selectedTextColor)
return overrideStyle.selectedTextColor;
- return d->style.selectedTextColor ? d->style.selectedTextColor : theme.selectedTextColor(d->defaultStyle);
+ return d->style.selectedTextColor ? QColor::fromRgba(d->style.selectedTextColor) : QColor::fromRgba(theme.selectedTextColor(d->defaultStyle));
}
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 backgroundColor(theme) != QColor::fromRgba(theme.backgroundColor(Theme::Normal))
+ && (d->style.backgroundColor || theme.backgroundColor(d->defaultStyle) || d->styleOverride(theme).backgroundColor);
}
QColor Format::backgroundColor(const Theme &theme) const
@@ -136,7 +140,7 @@ QColor Format::backgroundColor(const Theme &theme) const
return overrideStyle.backgroundColor;
// use QColor::fromRgba for background QRgb => QColor conversion to avoid unset colors == black!
- return d->style.backgroundColor ? d->style.backgroundColor : QColor::fromRgba(theme.backgroundColor(d->defaultStyle));
+ return d->style.backgroundColor ? QColor::fromRgba(d->style.backgroundColor) : QColor::fromRgba(theme.backgroundColor(d->defaultStyle));
}
QColor Format::selectedBackgroundColor(const Theme &theme) const
@@ -146,7 +150,8 @@ QColor Format::selectedBackgroundColor(const Theme &theme) const
return overrideStyle.selectedBackgroundColor;
// use QColor::fromRgba for background QRgb => QColor conversion to avoid unset colors == black!
- return d->style.selectedBackgroundColor ? d->style.selectedBackgroundColor : QColor::fromRgba(theme.selectedBackgroundColor(d->defaultStyle));
+ return d->style.selectedBackgroundColor ? QColor::fromRgba(d->style.selectedBackgroundColor)
+ : QColor::fromRgba(theme.selectedBackgroundColor(d->defaultStyle));
}
bool Format::isBold(const Theme &theme) const
@@ -231,7 +236,7 @@ void FormatPrivate::load(QXmlStreamReader &reader)
name = reader.attributes().value(QLatin1String("name")).toString();
defaultStyle = stringToDefaultFormat(reader.attributes().value(QLatin1String("defStyleNum")));
- QStringView attribute = reader.attributes().value(QLatin1String("color"));
+ QStringRef attribute = reader.attributes().value(QLatin1String("color"));
if (!attribute.isEmpty()) {
style.textColor = QColor(attribute.toString()).rgba();
}
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/htmlhighlighter.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/htmlhighlighter.cpp
index a95888f40f..a191fab7e9 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/htmlhighlighter.cpp
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/htmlhighlighter.cpp
@@ -44,21 +44,13 @@ void HtmlHighlighter::setOutputFile(const QString &fileName)
return;
}
d->out.reset(new QTextStream(d->file.get()));
-#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
- d->out->setEncoding(QStringConverter::Utf8);
-#else
d->out->setCodec("UTF-8");
-#endif
}
void HtmlHighlighter::setOutputFile(FILE *fileHandle)
{
d->out.reset(new QTextStream(fileHandle, QIODevice::WriteOnly));
-#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
- d->out->setEncoding(QStringConverter::Utf8);
-#else
d->out->setCodec("UTF-8");
-#endif
}
void HtmlHighlighter::highlightFile(const QString &fileName, const QString &title)
@@ -76,6 +68,33 @@ void HtmlHighlighter::highlightFile(const QString &fileName, const QString &titl
highlightData(&f, title);
}
+/**
+ * @brief toHtmlRgba
+ * Converts QColor -> rgba(r, g, b, a) if there is an alpha channel
+ * otherwise it will just return the hexcode. This is because QColor
+ * outputs #AARRGGBB, whereas browser support #RRGGBBAA.
+ *
+ * @param color
+ * @return
+ */
+static QString toHtmlRgbaString(const QColor &color)
+{
+ if (color.alpha() == 0xFF)
+ return color.name();
+
+ QString rgba = QStringLiteral("rgba(");
+ rgba.append(QString::number(color.red()));
+ rgba.append(QLatin1Char(','));
+ rgba.append(QString::number(color.green()));
+ rgba.append(QLatin1Char(','));
+ rgba.append(QString::number(color.blue()));
+ rgba.append(QLatin1Char(','));
+ // this must be alphaF
+ rgba.append(QString::number(color.alphaF()));
+ rgba.append(QLatin1Char(')'));
+ return rgba;
+}
+
void HtmlHighlighter::highlightData(QIODevice *dev, const QString &title)
{
if (!d->out) {
@@ -94,19 +113,16 @@ void HtmlHighlighter::highlightData(QIODevice *dev, const QString &title)
*d->out << "<html><head>\n";
*d->out << "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>\n";
*d->out << "<title>" << htmlTitle << "</title>\n";
- *d->out << "<meta name=\"generator\" content=\"KF5::SyntaxHighlighting - Definition (" << definition().name() << ") - Theme (" << theme().name() << ")\"/>\n";
+ *d->out << "<meta name=\"generator\" content=\"KF5::SyntaxHighlighting - Definition (" << definition().name() << ") - Theme (" << theme().name()
+ << ")\"/>\n";
*d->out << "</head><body";
- *d->out << " style=\"background-color:" << QColor(theme().editorColor(Theme::BackgroundColor)).name();
+ *d->out << " style=\"background-color:" << toHtmlRgbaString(QColor::fromRgba(theme().editorColor(Theme::BackgroundColor)));
if (theme().textColor(Theme::Normal))
- *d->out << ";color:" << QColor(theme().textColor(Theme::Normal)).name();
+ *d->out << ";color:" << toHtmlRgbaString(QColor::fromRgba(theme().textColor(Theme::Normal)));
*d->out << "\"><pre>\n";
QTextStream in(dev);
-#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
- in.setEncoding(QStringConverter::Utf8);
-#else
in.setCodec("UTF-8");
-#endif
while (!in.atEnd()) {
d->currentLine = in.readLine();
state = highlightLine(d->currentLine, state);
@@ -128,9 +144,9 @@ void HtmlHighlighter::applyFormat(int offset, int length, const Format &format)
// collect potential output, cheaper than thinking about "is there any?"
QVarLengthArray<QString, 16> formatOutput;
if (format.hasTextColor(theme()))
- formatOutput << QStringLiteral("color:") << format.textColor(theme()).name() << QStringLiteral(";");
+ formatOutput << QStringLiteral("color:") << toHtmlRgbaString(format.textColor(theme())) << QStringLiteral(";");
if (format.hasBackgroundColor(theme()))
- formatOutput << QStringLiteral("background-color:") << format.backgroundColor(theme()).name() << QStringLiteral(";");
+ formatOutput << QStringLiteral("background-color:") << toHtmlRgbaString(format.backgroundColor(theme())) << QStringLiteral(";");
if (format.isBold(theme()))
formatOutput << QStringLiteral("font-weight:bold;");
if (format.isItalic(theme()))
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/keywordlist.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/keywordlist.cpp
index b599ce29a1..b763fd7505 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/keywordlist.cpp
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/keywordlist.cpp
@@ -16,7 +16,7 @@
using namespace KSyntaxHighlighting;
-bool KeywordList::contains(const QStringView &str, Qt::CaseSensitivity caseSensitive) const
+bool KeywordList::contains(const QStringRef &str, Qt::CaseSensitivity caseSensitive) const
{
/**
* get right vector to search in
@@ -26,7 +26,9 @@ bool KeywordList::contains(const QStringView &str, Qt::CaseSensitivity caseSensi
/**
* search with right predicate
*/
- return std::binary_search(vectorToSearch.begin(), vectorToSearch.end(), QStringView(str), [caseSensitive](const QStringView &a, const QStringView &b) { return a.compare(b, caseSensitive) < 0; });
+ return std::binary_search(vectorToSearch.begin(), vectorToSearch.end(), QStringView(str), [caseSensitive](const QStringView &a, const QStringView &b) {
+ return a.compare(b, caseSensitive) < 0;
+ });
}
void KeywordList::load(QXmlStreamReader &reader)
@@ -90,7 +92,9 @@ void KeywordList::initLookupForCaseSensitivity(Qt::CaseSensitivity caseSensitive
/**
* sort with right predicate
*/
- std::sort(vectorToSort.begin(), vectorToSort.end(), [caseSensitive](const QStringView &a, const QStringView &b) { return a.compare(b, caseSensitive) < 0; });
+ std::sort(vectorToSort.begin(), vectorToSort.end(), [caseSensitive](const QStringView &a, const QStringView &b) {
+ return a.compare(b, caseSensitive) < 0;
+ });
}
void KeywordList::resolveIncludeKeywords(DefinitionData &def)
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/keywordlist_p.h b/src/libs/3rdparty/syntax-highlighting/src/lib/keywordlist_p.h
index 68b1ec6290..de5e58804e 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/keywordlist_p.h
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/keywordlist_p.h
@@ -9,8 +9,8 @@
#define KSYNTAXHIGHLIGHTING_KEYWORDLIST_P_H
#include <QString>
-#include <QStringView>
#include <QStringList>
+#include <QStringView>
#include <vector>
@@ -53,10 +53,13 @@ public:
}
/** Checks if @p str is a keyword in this list. */
- bool contains(const QStringView &str) const { return contains(str, m_caseSensitive); }
+ bool contains(const QStringRef &str) const
+ {
+ return contains(str, m_caseSensitive);
+ }
/** Checks if @p str is a keyword in this list, overriding the global case-sensitivity setting. */
- bool contains(const QStringView &str, Qt::CaseSensitivity caseSensitive) const;
+ bool contains(const QStringRef &str, Qt::CaseSensitivity caseSensitive) const;
void load(QXmlStreamReader &reader);
void setCaseSensitivity(Qt::CaseSensitivity caseSensitive);
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/repository.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/repository.cpp
index 2252bc67d2..1e3191a7bc 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/repository.cpp
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/repository.cpp
@@ -18,6 +18,7 @@
#include <QDirIterator>
#include <QFile>
#include <QFileInfo>
+#include <QPalette>
#ifndef NO_STANDARD_PATHS
#include <QStandardPaths>
@@ -62,7 +63,9 @@ Definition Repository::definitionForName(const QString &defName) const
static void sortDefinitions(QVector<Definition> &definitions)
{
- std::stable_sort(definitions.begin(), definitions.end(), [](const Definition &lhs, const Definition &rhs) { return lhs.priority() > rhs.priority(); });
+ std::stable_sort(definitions.begin(), definitions.end(), [](const Definition &lhs, const Definition &rhs) {
+ return lhs.priority() > rhs.priority();
+ });
}
Definition Repository::definitionForFileName(const QString &fileName) const
@@ -133,13 +136,52 @@ Theme Repository::theme(const QString &themeName) const
return Theme();
}
-Theme Repository::defaultTheme(Repository::DefaultTheme t)
+Theme Repository::defaultTheme(Repository::DefaultTheme t) const
{
if (t == DarkTheme)
return theme(QLatin1String("Breeze Dark"));
return theme(QLatin1String("Breeze Light"));
}
+Theme Repository::defaultTheme(Repository::DefaultTheme t)
+{
+ return qAsConst(*this).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) {
+ const auto background = theme.editorColor(KSyntaxHighlighting::Theme::EditorColorRole::BackgroundColor);
+ if (background == base.rgb()) {
+ 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 : qAsConst(matchingThemes)) {
+ auto selection = theme.editorColor(KSyntaxHighlighting::Theme::EditorColorRole::TextSelection);
+ if (selection == highlight.rgb()) {
+ return theme;
+ }
+ }
+ return matchingThemes.first();
+ }
+
+ // fallback to just use the default light or dark theme
+ return defaultTheme((base.lightness() < 128) ? KSyntaxHighlighting::Repository::DarkTheme : KSyntaxHighlighting::Repository::LightTheme);
+}
+
+Theme Repository::themeForPalette(const QPalette &palette)
+{
+ return qAsConst(*this).themeForPalette(palette);
+}
+
void RepositoryPrivate::load(Repository *repo)
{
// always add invalid default "None" highlighting
@@ -147,7 +189,8 @@ void RepositoryPrivate::load(Repository *repo)
// do lookup in standard paths, if not disabled
#ifndef NO_STANDARD_PATHS
- for (const auto &dir : QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("org.kde.syntax-highlighting/syntax"), QStandardPaths::LocateDirectory))
+ for (const auto &dir :
+ QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("org.kde.syntax-highlighting/syntax"), QStandardPaths::LocateDirectory))
loadSyntaxFolder(repo, dir);
// backward compatibility with Kate
@@ -176,7 +219,8 @@ void RepositoryPrivate::load(Repository *repo)
// do lookup in standard paths, if not disabled
#ifndef NO_STANDARD_PATHS
- for (const auto &dir : QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("org.kde.syntax-highlighting/themes"), QStandardPaths::LocateDirectory))
+ for (const auto &dir :
+ QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("org.kde.syntax-highlighting/themes"), QStandardPaths::LocateDirectory))
loadThemeFolder(dir);
#endif
@@ -256,7 +300,9 @@ 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(); });
+ 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);
return;
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/repository.h b/src/libs/3rdparty/syntax-highlighting/src/lib/repository.h
index 9da4474685..bf91018242 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/repository.h
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/repository.h
@@ -11,10 +11,11 @@
#include <memory>
#include <qglobal.h>
-#include <qvector.h>
QT_BEGIN_NAMESPACE
class QString;
+template<typename T> class QVector;
+class QPalette;
QT_END_NAMESPACE
/**
@@ -209,10 +210,33 @@ public:
/**
* Returns a default theme instance of the given type.
* The returned Theme is guaranteed to be a valid theme.
+ * @since 5.79
+ */
+ Theme defaultTheme(DefaultTheme t = LightTheme) const;
+
+ /**
+ * Returns a default theme instance of the given type.
+ * The returned Theme is guaranteed to be a valid theme.
+ *
+ * KF6: remove in favor of const variant
*/
Theme defaultTheme(DefaultTheme t = LightTheme);
/**
+ * Returns the best matching theme for the given palette
+ * @since 5.79
+ **/
+ Theme themeForPalette(const QPalette &palette) const;
+
+ /**
+ * Returns the best matching theme for the given palette
+ * @since 5.77
+ *
+ * KF6: remove in favor of const variant
+ **/
+ Theme themeForPalette(const QPalette &palette);
+
+ /**
* Reloads the repository.
* This is a moderately expensive operations and should thus only be
* triggered when the installed syntax definition files changed.
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/rule.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/rule.cpp
index 22f59e0211..98fe756875 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/rule.cpp
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/rule.cpp
@@ -10,8 +10,8 @@
#include "definition_p.h"
#include "ksyntaxhighlighting_logging.h"
#include "rule_p.h"
-#include "xml_p.h"
#include "worddelimiters_p.h"
+#include "xml_p.h"
#include <QString>
#include <QXmlStreamReader>
@@ -31,9 +31,7 @@ static bool isOctalChar(QChar c)
static bool isHexChar(QChar c)
{
- return isDigit(c)
- || (c <= QLatin1Char('f') && QLatin1Char('a') <= c)
- || (c <= QLatin1Char('F') && QLatin1Char('A') <= c);
+ return isDigit(c) || (c <= QLatin1Char('f') && QLatin1Char('a') <= c) || (c <= QLatin1Char('F') && QLatin1Char('A') <= c);
}
static int matchEscapedChar(const QString &text, int offset)
@@ -44,9 +42,18 @@ static int matchEscapedChar(const QString &text, int offset)
const auto c = text.at(offset + 1);
switch (c.unicode()) {
// control chars
- case 'a': case 'b': case 'e': case 'f':
- case 'n': case 'r': case 't': case 'v':
- case '"': case '\'': case '?': case '\\':
+ case 'a':
+ case 'b':
+ case 'e':
+ case 'f':
+ case 'n':
+ case 'r':
+ case 't':
+ case 'v':
+ case '"':
+ case '\'':
+ case '?':
+ case '\\':
return offset + 2;
// hex encoded character
@@ -59,8 +66,14 @@ static int matchEscapedChar(const QString &text, int offset)
return offset;
// octal encoding, simple \0 is OK, too, unlike simple \x above
- case '0': case '1': case '2': case '3':
- case '4': case '5': case '6': case '7':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
if (offset + 2 < text.size() && isOctalChar(text.at(offset + 2))) {
if (offset + 3 < text.size() && isOctalChar(text.at(offset + 3)))
return offset + 4;
@@ -81,6 +94,13 @@ static QString replaceCaptures(const QString &pattern, const QStringList &captur
return result;
}
+Rule::~Rule()
+{
+ if (!m_additionalDeliminator.isEmpty() || !m_weakDeliminator.isEmpty()) {
+ delete m_wordDelimiters;
+ }
+}
+
Definition Rule::definition() const
{
return m_def.definition();
@@ -124,12 +144,17 @@ bool Rule::load(QXmlStreamReader &reader)
void Rule::resolveContext()
{
- auto const& def = m_def.definition();
+ auto const &def = m_def.definition();
m_context.resolve(def);
// cache for DefinitionData::wordDelimiters, is accessed VERY often
m_wordDelimiters = &DefinitionData::get(def)->wordDelimiters;
+ if (!m_additionalDeliminator.isEmpty() || !m_weakDeliminator.isEmpty()) {
+ m_wordDelimiters = new WordDelimiters(*m_wordDelimiters);
+ m_wordDelimiters->append(m_additionalDeliminator);
+ m_wordDelimiters->remove(m_weakDeliminator);
+ }
}
void Rule::resolveAttributeFormat(Context *lookupContext)
@@ -151,7 +176,13 @@ bool Rule::doLoad(QXmlStreamReader &reader)
return true;
}
-Rule::Ptr Rule::create(const QStringView &name)
+void Rule::loadAdditionalWordDelimiters(QXmlStreamReader &reader)
+{
+ m_additionalDeliminator = reader.attributes().value(QLatin1String("additionalDeliminator")).toString();
+ m_weakDeliminator = reader.attributes().value(QLatin1String("weakDeliminator")).toString();
+}
+
+Rule::Ptr Rule::create(const QStringRef &name)
{
if (name == QLatin1String("AnyChar"))
return std::make_shared<AnyChar>();
@@ -283,6 +314,12 @@ MatchResult DetectSpaces::doMatch(const QString &text, int offset, const QString
return offset;
}
+bool Float::doLoad(QXmlStreamReader &reader)
+{
+ loadAdditionalWordDelimiters(reader);
+ return true;
+}
+
MatchResult Float::doMatch(const QString &text, int offset, const QStringList &) const
{
if (offset > 0 && !isWordDelimiter(text.at(offset - 1)))
@@ -344,6 +381,12 @@ MatchResult HlCChar::doMatch(const QString &text, int offset, const QStringList
return offset;
}
+bool HlCHex::doLoad(QXmlStreamReader &reader)
+{
+ loadAdditionalWordDelimiters(reader);
+ return true;
+}
+
MatchResult HlCHex::doMatch(const QString &text, int offset, const QStringList &) const
{
if (offset > 0 && !isWordDelimiter(text.at(offset - 1)))
@@ -367,6 +410,12 @@ MatchResult HlCHex::doMatch(const QString &text, int offset, const QStringList &
return offset;
}
+bool HlCOct::doLoad(QXmlStreamReader &reader)
+{
+ loadAdditionalWordDelimiters(reader);
+ return true;
+}
+
MatchResult HlCOct::doMatch(const QString &text, int offset, const QStringList &) const
{
if (offset > 0 && !isWordDelimiter(text.at(offset - 1)))
@@ -411,11 +460,7 @@ bool IncludeRules::includeAttribute() const
bool IncludeRules::doLoad(QXmlStreamReader &reader)
{
const auto s = reader.attributes().value(QLatin1String("context"));
-#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
- const auto split = s.split(QLatin1String("##"), QString::KeepEmptyParts);
-#else
- const auto split = s.split(QString::fromLatin1("##"), Qt::KeepEmptyParts);
-#endif
+ const auto split = s.split(QLatin1String("##"), Qt::KeepEmptyParts);
if (split.isEmpty())
return false;
m_contextName = split.at(0).toString();
@@ -433,6 +478,12 @@ MatchResult IncludeRules::doMatch(const QString &text, int offset, const QString
return offset;
}
+bool Int::doLoad(QXmlStreamReader &reader)
+{
+ loadAdditionalWordDelimiters(reader);
+ return true;
+}
+
MatchResult Int::doMatch(const QString &text, int offset, const QStringList &) const
{
if (offset > 0 && !isWordDelimiter(text.at(offset - 1)))
@@ -466,6 +517,8 @@ bool KeywordListRule::doLoad(QXmlStreamReader &reader)
m_hasCaseSensitivityOverride = false;
}
+ loadAdditionalWordDelimiters(reader);
+
return !m_keywordList->isEmpty();
}
@@ -478,11 +531,10 @@ MatchResult KeywordListRule::doMatch(const QString &text, int offset, const QStr
return offset;
if (m_hasCaseSensitivityOverride) {
- if (m_keywordList->contains(QStringView(text).mid(offset, newOffset - offset),
- m_caseSensitivityOverride))
+ if (m_keywordList->contains(text.midRef(offset, newOffset - offset), m_caseSensitivityOverride))
return newOffset;
} else {
- if (m_keywordList->contains(QStringView(text).mid(offset, newOffset - offset)))
+ if (m_keywordList->contains(text.midRef(offset, newOffset - offset)))
return newOffset;
}
@@ -540,21 +592,52 @@ bool RegExpr::doLoad(QXmlStreamReader &reader)
const auto isMinimal = Xml::attrToBool(reader.attributes().value(QLatin1String("minimal")));
const auto isCaseInsensitive = Xml::attrToBool(reader.attributes().value(QLatin1String("insensitive")));
- m_regexp.setPatternOptions((isMinimal ? QRegularExpression::InvertedGreedinessOption : QRegularExpression::NoPatternOption) | (isCaseInsensitive ? QRegularExpression::CaseInsensitiveOption : QRegularExpression::NoPatternOption));
+ m_regexp.setPatternOptions((isMinimal ? QRegularExpression::InvertedGreedinessOption : QRegularExpression::NoPatternOption)
+ | (isCaseInsensitive ? QRegularExpression::CaseInsensitiveOption : QRegularExpression::NoPatternOption)
+ // DontCaptureOption is removed by resolvePostProcessing() when necessary
+ | QRegularExpression::DontCaptureOption);
- // optimize the pattern for the non-dynamic case, we use them OFTEN
m_dynamic = Xml::attrToBool(reader.attributes().value(QLatin1String("dynamic")));
+
+ return !m_regexp.pattern().isEmpty();
+}
+
+void KSyntaxHighlighting::RegExpr::resolvePostProcessing()
+{
+ if (m_isResolved)
+ 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 (rule->isDynamic()) {
+ hasCapture = true;
+ m_regexp.setPatternOptions(m_regexp.patternOptions() & ~QRegularExpression::DontCaptureOption);
+ break;
+ }
+ }
+ }
+
+ // optimize the pattern for the non-dynamic case, we use them OFTEN
if (!m_dynamic) {
m_regexp.optimize();
}
- // always using m_regexp.isValid() would be better, but parses the regexp and thus is way too expensive for release builds
+ 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 (Log().isDebugEnabled()) {
- if (!m_regexp.isValid())
+ if (!isValid) {
qCDebug(Log) << "Invalid regexp:" << m_regexp.pattern();
+ }
}
- return !m_regexp.pattern().isEmpty();
}
MatchResult RegExpr::doMatch(const QString &text, int offset, const QStringList &captures) const
@@ -606,8 +689,7 @@ MatchResult StringDetect::doMatch(const QString &text, int offset, const QString
*/
const auto &pattern = m_dynamic ? replaceCaptures(m_string, captures, false) : m_string;
- if (offset + pattern.size() <= text.size()
- && QStringView(text).mid(offset, pattern.size()).compare(pattern, m_caseSensitivity) == 0)
+ if (text.midRef(offset, pattern.size()).compare(pattern, m_caseSensitivity) == 0)
return offset + pattern.size();
return offset;
}
@@ -616,6 +698,7 @@ bool WordDetect::doLoad(QXmlStreamReader &reader)
{
m_word = reader.attributes().value(QLatin1String("String")).toString();
m_caseSensitivity = Xml::attrToBool(reader.attributes().value(QLatin1String("insensitive"))) ? Qt::CaseInsensitive : Qt::CaseSensitive;
+ loadAdditionalWordDelimiters(reader);
return !m_word.isEmpty();
}
@@ -631,7 +714,7 @@ MatchResult WordDetect::doMatch(const QString &text, int offset, const QStringLi
if (offset > 0 && !isWordDelimiter(text.at(offset - 1)) && !isWordDelimiter(text.at(offset)))
return offset;
- if (QStringView(text).mid(offset, m_word.size()).compare(m_word, m_caseSensitivity) != 0)
+ if (text.midRef(offset, m_word.size()).compare(m_word, m_caseSensitivity) != 0)
return offset;
if (text.size() == offset + m_word.size() || isWordDelimiter(text.at(offset + m_word.size())) || isWordDelimiter(text.at(offset + m_word.size() - 1)))
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/rule_p.h b/src/libs/3rdparty/syntax-highlighting/src/lib/rule_p.h
index 788aecdad3..678f47af17 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/rule_p.h
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/rule_p.h
@@ -33,7 +33,7 @@ class Rule
{
public:
Rule() = default;
- virtual ~Rule() = default;
+ virtual ~Rule();
typedef std::shared_ptr<Rule> Ptr;
@@ -83,16 +83,21 @@ public:
bool load(QXmlStreamReader &reader);
void resolveContext();
void resolveAttributeFormat(Context *lookupContext);
+ virtual void resolvePostProcessing()
+ {
+ }
virtual MatchResult doMatch(const QString &text, int offset, const QStringList &captures) const = 0;
- static Rule::Ptr create(const QStringView &name);
+ static Rule::Ptr create(const QStringRef &name);
protected:
virtual bool doLoad(QXmlStreamReader &reader);
bool isWordDelimiter(QChar c) const;
+ void loadAdditionalWordDelimiters(QXmlStreamReader &reader);
+
private:
Q_DISABLE_COPY(Rule)
@@ -107,7 +112,10 @@ private:
bool m_lookAhead = false;
// cache for DefinitionData::wordDelimiters, is accessed VERY often
- WordDelimiters* m_wordDelimiters = nullptr;
+ WordDelimiters *m_wordDelimiters = nullptr;
+
+ QString m_additionalDeliminator;
+ QString m_weakDeliminator;
protected:
bool m_dynamic = false;
@@ -160,6 +168,7 @@ protected:
class Float : public Rule
{
protected:
+ bool doLoad(QXmlStreamReader &reader) override;
MatchResult doMatch(const QString &text, int offset, const QStringList &) const override;
};
@@ -183,6 +192,7 @@ private:
class Int : public Rule
{
protected:
+ bool doLoad(QXmlStreamReader &reader) override;
MatchResult doMatch(const QString &text, int offset, const QStringList &captures) const override;
};
@@ -195,12 +205,14 @@ protected:
class HlCHex : public Rule
{
protected:
+ bool doLoad(QXmlStreamReader &reader) override;
MatchResult doMatch(const QString &text, int offset, const QStringList &) const override;
};
class HlCOct : public Rule
{
protected:
+ bool doLoad(QXmlStreamReader &reader) override;
MatchResult doMatch(const QString &text, int offset, const QStringList &) const override;
};
@@ -246,11 +258,13 @@ private:
class RegExpr : public Rule
{
protected:
+ void resolvePostProcessing() override;
bool doLoad(QXmlStreamReader &reader) override;
MatchResult doMatch(const QString &text, int offset, const QStringList &captures) const override;
private:
QRegularExpression m_regexp;
+ bool m_isResolved = false;
};
class StringDetect : public Rule
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/state.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/state.cpp
index f9b4f4b4ab..ea5bd36e4f 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/state.cpp
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/state.cpp
@@ -56,7 +56,7 @@ bool StateData::pop(int popCount)
// keep the initial context alive in any case
Q_ASSERT(!isEmpty());
const bool initialContextSurvived = m_contextStack.size() > popCount;
- m_contextStack.resize(std::max(1, int(m_contextStack.size()) - popCount));
+ m_contextStack.resize(std::max(1, m_contextStack.size() - popCount));
return initialContextSurvived;
}
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/state_p.h b/src/libs/3rdparty/syntax-highlighting/src/lib/state_p.h
index d76f84c93b..80bf8f4b02 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/state_p.h
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/state_p.h
@@ -13,6 +13,10 @@
#include "definitionref_p.h"
+QT_BEGIN_NAMESPACE
+class QStringList;
+QT_END_NAMESPACE
+
namespace KSyntaxHighlighting
{
class Context;
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/theme.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/theme.cpp
index 56b244a8ee..beb1e87797 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/theme.cpp
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/theme.cpp
@@ -47,7 +47,7 @@ QString Theme::name() const
QString Theme::translatedName() const
{
- return m_data ? QCoreApplication::translate("Theme", m_data->name().toUtf8().constData()) : QString();
+ return m_data ? QCoreApplication::instance()->translate("Theme", m_data->name().toUtf8().constData()) : QString();
}
bool Theme::isReadOnly() const
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/themedata.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/themedata.cpp
index f8283b4456..2919a31a6e 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/themedata.cpp
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/themedata.cpp
@@ -30,7 +30,7 @@ ThemeData::ThemeData()
/**
* Convert QJsonValue @p val into a color, if possible. Valid colors are only
- * in hex format: #rrggbb. On error, returns 0x00000000.
+ * in hex format: #aarrggbb. On error, returns 0x00000000.
*/
static inline QRgb readColor(const QJsonValue &val)
{
@@ -43,7 +43,7 @@ static inline QRgb readColor(const QJsonValue &val)
return unsetColor;
}
const QColor color(str);
- return color.isValid() ? color.rgb() : unsetColor;
+ return color.isValid() ? color.rgba() : unsetColor;
}
static inline TextStyleData readThemeData(const QJsonObject &obj)
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/worddelimiters.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/worddelimiters.cpp
index 71cf73ca33..634eeb70bb 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/worddelimiters.cpp
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/worddelimiters.cpp
@@ -11,7 +11,7 @@ using namespace KSyntaxHighlighting;
WordDelimiters::WordDelimiters()
: asciiDelimiters{}
{
- for(const char *p = "\t !%&()*+,-./:;<=>?[\\]^{|}~"; *p; ++p)
+ for (const char *p = "\t !%&()*+,-./:;<=>?[\\]^{|}~"; *p; ++p)
// int(*p) fix -Wchar-subscripts
asciiDelimiters[int(*p)] = true;
}
@@ -24,20 +24,24 @@ bool WordDelimiters::contains(QChar c) const
return notAsciiDelimiters.contains(c);
}
-void WordDelimiters::append(QChar c)
+void WordDelimiters::append(QStringView s)
{
- if (c.unicode() < 128) {
- asciiDelimiters[c.unicode()] = true;
- } else {
- notAsciiDelimiters.append(c);
+ for (QChar c : s) {
+ if (c.unicode() < 128) {
+ asciiDelimiters[c.unicode()] = true;
+ } else {
+ notAsciiDelimiters.append(c);
+ }
}
}
-void WordDelimiters::remove(QChar c)
+void WordDelimiters::remove(QStringView s)
{
- if (c.unicode() < 128) {
- asciiDelimiters[c.unicode()] = false;
- } else {
- notAsciiDelimiters.remove(c);
+ for (QChar c : s) {
+ if (c.unicode() < 128) {
+ asciiDelimiters[c.unicode()] = false;
+ } else {
+ notAsciiDelimiters.remove(c);
+ }
}
}
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/worddelimiters_p.h b/src/libs/3rdparty/syntax-highlighting/src/lib/worddelimiters_p.h
index 51708fc13f..3fa5db10a4 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/worddelimiters_p.h
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/worddelimiters_p.h
@@ -30,14 +30,14 @@ public:
bool contains(QChar c) const;
/**
- * Appends the character @p c to word delimiter.
+ * Appends each character of @p s to word delimiters.
*/
- void append(QChar c);
+ void append(QStringView s);
/**
- * Removes the character @p c from word delimiters.
+ * Removes each character of @p s from word delimiters.
*/
- void remove(QChar c);
+ void remove(QStringView c);
private:
/**
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/xml_p.h b/src/libs/3rdparty/syntax-highlighting/src/lib/xml_p.h
index eddf97f218..65f46a6abc 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/xml_p.h
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/xml_p.h
@@ -15,9 +15,9 @@ namespace KSyntaxHighlighting
namespace Xml
{
/** Parse a xs:boolean attribute. */
-inline bool attrToBool(const QStringView &str)
+inline bool attrToBool(const QStringRef &str)
{
- return str == QLatin1String("1") || str.compare(QString("true"), Qt::CaseInsensitive) == 0;
+ return str == QLatin1String("1") || str.compare(QLatin1String("true"), Qt::CaseInsensitive) == 0;
}
}