forked from qt-creator/qt-creator
GenericHighlighter: Update from KSyntaxHighlighting
Change-Id: I81891762ceb44c7329a75e6d982532419102a232 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
committed by
Orgad Shaneh
parent
e5a8958e31
commit
d2a7adba56
12
src/share/3rdparty/generic-highlighter/bash.xml
vendored
12
src/share/3rdparty/generic-highlighter/bash.xml
vendored
@@ -8,7 +8,7 @@
|
||||
<!ENTITY noword "(?![\w$+-])"> <!-- no word, $, + or - following -->
|
||||
<!ENTITY pathpart "([\w_@.%*?+-]|\\ )"> <!-- valid character in a file name -->
|
||||
]>
|
||||
<language name="Bash" version="6" kateversion="5.0" section="Scripts" extensions="*.sh;*.bash;*.ebuild;*.eclass;*.nix;.bashrc;.bash_profile;.bash_login;.profile;PKGBUILD" mimetype="application/x-shellscript" casesensitive="1" author="Wilbert Berendsen (wilbert@kde.nl)" license="LGPL">
|
||||
<language name="Bash" version="8" 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">
|
||||
|
||||
<!-- (c) 2004 by Wilbert Berendsen (wilbert@kde.nl)
|
||||
Changes by Matthew Woehlke (mw_triad@users.sourceforge.net)
|
||||
@@ -540,7 +540,7 @@
|
||||
<RegExpr attribute="Variable" context="AssignSubscr" String="\b&varname;(?=\[.+\]\+?=)" />
|
||||
<!-- handle functions with function keyword before keywords -->
|
||||
<StringDetect attribute="Function" context="#stay" String=":()" />
|
||||
<RegExpr attribute="Keyword" context="FunctionDef" String="\bfunction\b" />
|
||||
<WordDetect attribute="Keyword" context="FunctionDef" String="function" />
|
||||
<!-- mark function definitions without function keyword -->
|
||||
<RegExpr attribute="Function" context="#stay" String="&funcname;\s*\(\)" />
|
||||
<!-- handle keywords -->
|
||||
@@ -551,7 +551,7 @@
|
||||
<!-- handle here-string -->
|
||||
<RegExpr attribute="Redirection" context="#stay" String="\d*<<<" />
|
||||
<!-- handle here document -->
|
||||
<StringDetect attribute="Redirection" context="HereDoc" String="<<" lookAhead="true" />
|
||||
<Detect2Chars attribute="Redirection" context="HereDoc" char="<" char1="<" lookAhead="true" />
|
||||
<!-- handle process subst -->
|
||||
<RegExpr attribute="Redirection" context="ProcessSubst" String="[<>]\(" />
|
||||
<!-- handle redirection -->
|
||||
@@ -580,7 +580,7 @@
|
||||
<!-- handle here-string -->
|
||||
<RegExpr attribute="Redirection" context="#stay" String="\d*<<<" />
|
||||
<!-- handle here document -->
|
||||
<StringDetect attribute="Redirection" context="HereDoc" String="<<" lookAhead="true" />
|
||||
<Detect2Chars attribute="Redirection" context="HereDoc" char="<" char1="<" lookAhead="true" />
|
||||
<!-- handle process subst -->
|
||||
<RegExpr attribute="Redirection" context="ProcessSubst" String="[<>]\(" />
|
||||
<!-- handle redirection -->
|
||||
@@ -647,7 +647,7 @@
|
||||
<RegExpr attribute="Variable" context="VarBrace" String="\$\{[*@#?$!_0-9-](?=[:#%/=?+-])" />
|
||||
<StringDetect attribute="Variable" context="ExprDblParenSubst" String="$((" beginRegion="expression" />
|
||||
<StringDetect attribute="Redirection" context="SubstFile" String="$(<" />
|
||||
<StringDetect attribute="Variable" context="SubstCommand" String="$(" />
|
||||
<Detect2Chars attribute="Variable" context="SubstCommand" char="$" char1="(" />
|
||||
<DetectChar attribute="Backquote" context="SubstBackq" char="`" />
|
||||
<RegExpr attribute="Escape" context="#stay" String="\\[`$\\]" />
|
||||
</context>
|
||||
@@ -902,7 +902,7 @@
|
||||
<RegExpr attribute="Redirection" context="HereDocQ" String="(<<\s*'(&word;)')" lookAhead="true" />
|
||||
<RegExpr attribute="Redirection" context="HereDocQ" String="(<<\s*\\(&word;))" lookAhead="true" />
|
||||
<RegExpr attribute="Redirection" context="HereDocNQ" String="(<<\s*(&word;))" lookAhead="true" />
|
||||
<StringDetect attribute="Redirection" context="#pop" String="<<" /><!-- always met -->
|
||||
<Detect2Chars attribute="Redirection" context="#pop" char="<" char1="<" /><!-- always met -->
|
||||
</context>
|
||||
|
||||
<context attribute="Normal Text" lineEndContext="#pop" name="HereDocRemainder">
|
||||
|
||||
4107
src/share/3rdparty/generic-highlighter/cmake.xml
vendored
4107
src/share/3rdparty/generic-highlighter/cmake.xml
vendored
File diff suppressed because it is too large
Load Diff
@@ -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="2" kateversion="2.4" author="Jan Janssen (medhefgo@web.de)" license="LGPL">
|
||||
<language name="INI Files" section="Configuration" extensions="*.ini;*.pls;*.kcfgc" mimetype="" version="3" kateversion="2.4" author="Jan Janssen (medhefgo@web.de)" license="LGPL">
|
||||
|
||||
<highlighting>
|
||||
<list name="keywords">
|
||||
@@ -44,8 +44,6 @@
|
||||
<Float attribute="Float" />
|
||||
<Int attribute="Int" />
|
||||
<keyword attribute="Keyword" String="keywords" />
|
||||
<RegExpr attribute="Comment" context="#pop" String=";.*$" />
|
||||
<RegExpr attribute="Comment" context="#pop" String="#.*$" />
|
||||
</context>
|
||||
|
||||
<context name="Comment" attribute="Comment" lineEndContext="#pop">
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
Enhance tr/// and y/// support.
|
||||
-->
|
||||
<language name="Perl" version="5" kateversion="2.4" section="Scripts" extensions="*.pl;*.PL;*.pm" mimetype="application/x-perl;text/x-perl" priority="5" author="Anders Lund (anders@alweb.dk)" license="LGPLv2">
|
||||
<language name="Perl" version="6" kateversion="2.4" section="Scripts" extensions="*.pl;*.PL;*.pm;*.pl6;*.PL6;*.p6;*.pm6;" mimetype="application/x-perl;text/x-perl" priority="5" author="Anders Lund (anders@alweb.dk)" license="LGPLv2">
|
||||
<highlighting>
|
||||
<list name="keywords">
|
||||
<item>if</item>
|
||||
|
||||
134
src/share/3rdparty/generic-highlighter/yacc.xml
vendored
134
src/share/3rdparty/generic-highlighter/yacc.xml
vendored
@@ -10,6 +10,17 @@ This code is released under the LGPL as part of kdelibs/kate.
|
||||
|
||||
|
||||
== UPDATE HISTORY ==
|
||||
2018-02-20 // Nibaldo González <nibgonz@gmail.com>
|
||||
|
||||
Fix '$' symbol, highlighted as 'dsError' by C++ (isocpp.xml).
|
||||
Update syntax for Bison (3.0.4):
|
||||
- Add declarations, directives in rules and the '@' variable.
|
||||
- Allow a tag in '%union', declarations in multiple lines and
|
||||
grammar declarations in the grammar rules section.
|
||||
- The ';' char is not necessary to finish a rule. Allow '; |'
|
||||
within rules.
|
||||
Add mimetypes and extensions '*.ypp' & '*.y++'.
|
||||
|
||||
2007-10-01 // Sebastian Pipping <webmaster@hartwork.org>
|
||||
|
||||
Added: Extension "*.yy" for Bison
|
||||
@@ -19,13 +30,9 @@ This code is released under the LGPL as part of kdelibs/kate.
|
||||
YACC.XML 1.00 - First released.
|
||||
|
||||
|
||||
== TODO ==
|
||||
- Add a mime type (cannot find it !?)
|
||||
|
||||
|
||||
========================================================================
|
||||
-->
|
||||
<language name="Yacc/Bison" version="3" kateversion="2.4" section="Sources" extensions="*.y;*.yy" author="Jan Villat (jan.villat@net2000.ch)" license="LGPL">
|
||||
<language name="Yacc/Bison" version="4" kateversion="2.4" 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>
|
||||
@@ -44,16 +51,32 @@ This code is released under the LGPL as part of kdelibs/kate.
|
||||
|
||||
<context name="Declarations" attribute="Normal Text" lineEndContext="#stay">
|
||||
<IncludeRules context="Comment" />
|
||||
<StringDetect attribute="Directive" context="Union Start" String="%union" />
|
||||
<Detect2Chars attribute="Content-Type Delimiter" context="Rules" char="%" char1="%" beginRegion="rules" endRegion="declarations" />
|
||||
|
||||
<!-- not sure that strict yacc allows that ... but it is commonly used -->
|
||||
<!-- Prologue Declarations -->
|
||||
<Detect2Chars attribute="Content-Type Delimiter" context="C Declarations" char="%" char1="{" beginRegion="cdeclarations" column="0" />
|
||||
|
||||
<IncludeRules context="Grammar Declarations" />
|
||||
<WordDetect attribute="Directive" context="Code-Symbols Start" String="%initial-action" />
|
||||
<WordDetect attribute="Directive" context="Code-Symbols Start" String="%param" />
|
||||
<WordDetect attribute="Directive" context="Code-Symbols Start" String="%lex-param" />
|
||||
<WordDetect attribute="Directive" context="Code-Symbols Start" String="%parse-param" />
|
||||
<WordDetect attribute="Directive" context="Percent Command In" String="%<flag>" />
|
||||
<!-- Any word followed by '%' (End with ';' or '%') -->
|
||||
<DetectChar attribute="Directive" context="Percent Command" char="%" />
|
||||
</context>
|
||||
<context name="Grammar Declarations" attribute="Normal Text" lineEndContext="#stay">
|
||||
<WordDetect attribute="Directive" context="Union Start" String="%union" />
|
||||
<WordDetect attribute="Directive" context="Union Start" String="%code" />
|
||||
<WordDetect attribute="Directive" context="Code-Symbols Start" String="%destructor" />
|
||||
<WordDetect attribute="Directive" context="Code-Symbols Start" String="%printer" />
|
||||
</context>
|
||||
|
||||
<context name="Union Start" attribute="Normal Text" lineEndContext="#stay">
|
||||
<IncludeRules context="Comment" />
|
||||
<DetectSpaces />
|
||||
<DetectChar attribute="Normal Text" context="Union In" char="{" beginRegion="union" />
|
||||
<RegExpr attribute="Normal Text" context="#pop!Union Tag" String="[^\s\{](?=(\s|$|//))" />
|
||||
</context>
|
||||
<context name="Union Tag" attribute="Normal Text" lineEndContext="#stay">
|
||||
<IncludeRules context="Comment" />
|
||||
<DetectSpaces />
|
||||
<DetectChar attribute="Normal Text" context="Union In" char="{" beginRegion="union" />
|
||||
@@ -70,39 +93,109 @@ This code is released under the LGPL as part of kdelibs/kate.
|
||||
<IncludeRules context="##C++" />
|
||||
</context>
|
||||
|
||||
<!-- '%'<decl> ('{' <Code-Symbols In> '}')+ <Percent Command In> [';'] -->
|
||||
<context name="Code-Symbols Start" attribute="Normal Text" lineEndContext="#stay">
|
||||
<IncludeRules context="Comment" />
|
||||
<DetectSpaces />
|
||||
<DetectChar attribute="Normal Text" context="Code-Symbols In" char="{" beginRegion="code-symbols" />
|
||||
<RegExpr attribute="Alert" context="#pop" String="." />
|
||||
</context>
|
||||
<context name="Code-Symbols In" attribute="Normal Text" lineEndContext="#stay">
|
||||
<DetectChar attribute="Normal Text" context="#pop#pop!Code-Symbols End" char="}" endRegion="code-symbols" />
|
||||
<DetectChar attribute="Normal Text" context="Code-Symbols InIn" char="{" />
|
||||
<IncludeRules context="Symbol-Variable" />
|
||||
<IncludeRules context="##C++" />
|
||||
</context>
|
||||
<context name="Code-Symbols InIn" attribute="Normal Text" lineEndContext="#stay">
|
||||
<DetectChar attribute="Normal Text" context="Code-Symbols InIn" char="{" />
|
||||
<DetectChar attribute="Normal Text" context="#pop" char="}" />
|
||||
<IncludeRules context="Symbol-Variable" />
|
||||
<IncludeRules context="##C++" />
|
||||
</context>
|
||||
<context name="Code-Symbols End" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop!Percent Command In">
|
||||
<IncludeRules context="Comment" />
|
||||
<DetectSpaces />
|
||||
<DetectChar attribute="Normal Text" context="#pop" char=";" lookAhead="true" />
|
||||
<DetectChar attribute="Normal Text" context="Code-Symbols In" char="{" beginRegion="code-symbols" />
|
||||
</context>
|
||||
|
||||
<context name="Rules" attribute="Rule" lineEndContext="#stay">
|
||||
<IncludeRules context="Comment" />
|
||||
<Detect2Chars attribute="Content-Type Delimiter" context="User Code" char="%" char1="%" beginRegion="code" endRegion="rules" />
|
||||
<DetectChar attribute="Normal Text" context="Rule In" char=":" beginRegion="rule" />
|
||||
<DetectChar attribute="Rule" context="Grammar Declaration Start" char="%" lookAhead="true" />
|
||||
</context>
|
||||
|
||||
<context name="Rule In" attribute="Definition" lineEndContext="#stay">
|
||||
<IncludeRules context="Comment" />
|
||||
<DetectChar attribute="Normal Text" context="#pop" char=";" endRegion="rule" />
|
||||
<DetectChar attribute="Normal Text" context="Rule End" char=";" endRegion="rule" />
|
||||
<DetectChar attribute="Normal Text" context="Normal C Bloc" char="{" beginRegion="bloc" />
|
||||
<DetectChar attribute="Normal Text" context="#stay" char="|" />
|
||||
<IncludeRules context="StringOrChar" />
|
||||
<RegExpr attribute="Directive" context="#stay" String="%\?(?=\{)" />
|
||||
<WordDetect attribute="Directive" context="#stay" String="%empty" />
|
||||
<WordDetect attribute="Directive" context="#stay" String="%prec" />
|
||||
<WordDetect attribute="Directive" context="#stay" String="%dprec" />
|
||||
<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" />
|
||||
<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" />
|
||||
</context>
|
||||
<!-- The Bison parser allows to have ';' followed by '|', without the rule ending.
|
||||
The problem here is that the ';' char has endRegion="rule" (although it is not very relevant). -->
|
||||
<context name="Rule End" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop#pop">
|
||||
<DetectSpaces />
|
||||
<DetectChar attribute="Normal Text" context="#stay" char=";" />
|
||||
<DetectChar attribute="Normal Text" context="#pop" char="|" />
|
||||
<IncludeRules context="Comment" />
|
||||
</context>
|
||||
|
||||
<context name="Grammar Declaration Start" attribute="Normal Text" lineEndContext="#stay">
|
||||
<!-- In the rules section, only highlighting exact declarations -->
|
||||
<IncludeRules context="Grammar Declarations" />
|
||||
<WordDetect attribute="Directive" context="Percent Command In" String="%start" />
|
||||
<WordDetect attribute="Directive" context="Percent Command In" String="%default-prec" />
|
||||
<WordDetect attribute="Directive" context="Percent Command In" String="%no-default-prec" />
|
||||
<WordDetect attribute="Directive" context="Percent Command In" String="%nterm" />
|
||||
<WordDetect attribute="Directive" context="Percent Command In" String="%token" />
|
||||
<WordDetect attribute="Directive" context="Percent Command In" String="%type" />
|
||||
<WordDetect attribute="Directive" context="Percent Command In" String="%left" />
|
||||
<WordDetect attribute="Directive" context="Percent Command In" String="%right" />
|
||||
<WordDetect attribute="Directive" context="Percent Command In" String="%nonassoc" />
|
||||
<WordDetect attribute="Directive" context="Percent Command In" String="%precedence" />
|
||||
|
||||
<DetectChar attribute="Rule" context="#pop" char="%" /> <!-- End when there is an invalid declaration -->
|
||||
<DetectChar attribute="Normal Text" context="#pop" char=";" />
|
||||
<IncludeRules context="Comment" />
|
||||
<DetectSpaces />
|
||||
<RegExpr attribute="Alert" context="#pop" String=".+" />
|
||||
</context>
|
||||
|
||||
<context name="User Code" attribute="Normal Text" lineEndContext="#stay">
|
||||
<IncludeRules context="##C++" />
|
||||
</context>
|
||||
|
||||
<context name="Percent Command" attribute="Directive" lineEndContext="#pop">
|
||||
<context name="Percent Command" attribute="Directive" lineEndContext="#pop!Percent Command In">
|
||||
<IncludeRules context="Comment" />
|
||||
<RegExpr attribute="Normal Text" context="Percent Command In" String="\W" lookAhead="true" />
|
||||
<RegExpr attribute="Normal Text" context="#pop!Percent Command In" String="[^\w\-]" lookAhead="true" />
|
||||
</context>
|
||||
<context name="Percent Command In" attribute="Normal Text" lineEndContext="#pop#pop">
|
||||
<context name="Percent Command In" attribute="Normal Text" lineEndContext="#stay">
|
||||
<!-- This can be applied to multiple lines -->
|
||||
<DetectChar attribute="Normal Text" context="#pop" char=";" lookAhead="true" />
|
||||
<DetectChar attribute="Normal Text" context="#pop" char="%" lookAhead="true" firstNonSpace="true" />
|
||||
<Detect2Chars attribute="Normal Text" context="#pop" char="%" char1="%" lookAhead="true" />
|
||||
<IncludeRules context="StringOrChar" />
|
||||
<DetectChar attribute="Data Type" context="PC type" char="<" />
|
||||
<IncludeRules context="Comment" />
|
||||
</context>
|
||||
<context name="PC type" attribute="Data Type" lineEndContext="#pop#pop#pop">
|
||||
<context name="PC type" attribute="Data Type" lineEndContext="#pop#pop">
|
||||
<DetectChar attribute="Data Type" context="#pop" char=">" />
|
||||
</context>
|
||||
|
||||
<context name="Comment" attribute="Comment" lineEndContext="#stay">
|
||||
<Detect2Chars attribute="Comment" context="CommentStar" char="/" char1="*" />
|
||||
<!-- not sure that strict yacc allows that ... but I saw it in some sources ... -->
|
||||
<Detect2Chars attribute="Comment" context="CommentSlash" char="/" char1="/" />
|
||||
</context>
|
||||
<context name="CommentStar" attribute="Comment" lineEndContext="#stay">
|
||||
@@ -128,15 +221,20 @@ This code is released under the LGPL as part of kdelibs/kate.
|
||||
<context name="Normal C Bloc" attribute="Normal Text" lineEndContext="#stay">
|
||||
<DetectChar attribute="Normal Text" context="Normal C Bloc" char="{" beginRegion="bloc" />
|
||||
<DetectChar attribute="Normal Text" context="#pop" char="}" endRegion="bloc" />
|
||||
<IncludeRules context="Symbol-Variable" />
|
||||
<IncludeRules context="##C++" />
|
||||
</context>
|
||||
<context name="Symbol-Variable" attribute="Normal Text" lineEndContext="#stay">
|
||||
<DetectChar attribute="Directive" context="Dol" char="$" />
|
||||
<RegExpr attribute="Directive" context="#stay" String="@(\$?)(\d+|[A-Za-z_]\w*)?" />
|
||||
</context>
|
||||
<context name="Dol" attribute="Normal Text" fallthrough="true" fallthroughContext="DolEnd" lineEndContext="#stay">
|
||||
<RegExpr attribute="Data Type" context="DolEnd" String="<[^>]+>" />
|
||||
</context>
|
||||
<context name="DolEnd" attribute="Normal Text" lineEndContext="#stay">
|
||||
<RegExpr attribute="Directive" context="#pop#pop" String="\d+" />
|
||||
<context name="DolEnd" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop#pop">
|
||||
<RegExpr attribute="Directive" context="#pop#pop" String="@?\d+" />
|
||||
<DetectChar attribute="Directive" context="#pop#pop" char="$" />
|
||||
<DetectIdentifier attribute="Directive" context="#pop#pop" />
|
||||
</context>
|
||||
</contexts>
|
||||
|
||||
@@ -147,6 +245,7 @@ This code is released under the LGPL as part of kdelibs/kate.
|
||||
<itemData name="Content-Type Delimiter" defStyleNum="dsBaseN" bold="1" />
|
||||
<itemData name="Directive" defStyleNum="dsKeyword"/>
|
||||
<itemData name="Rule" defStyleNum="dsString" />
|
||||
<itemData name="Open Rule" defStyleNum="dsString" bold="1" />
|
||||
<itemData name="Backslash Code" defStyleNum="dsString" bold="1" />
|
||||
<itemData name="Alert" defStyleNum="dsAlert" />
|
||||
<itemData name="String" defStyleNum="dsString"/>
|
||||
@@ -158,6 +257,7 @@ This code is released under the LGPL as part of kdelibs/kate.
|
||||
<general>
|
||||
<comments>
|
||||
<comment name="multiLine" start="/*" end="*/" />
|
||||
<comment name="singleLine" start="//" />
|
||||
</comments>
|
||||
</general>
|
||||
</language>
|
||||
|
||||
Reference in New Issue
Block a user