summaryrefslogtreecommitdiff
path: root/kde-frameworks/syntax-highlighting/files/syntax-highlighting-5.77.0-bashfix-2.patch
blob: 3ff4bdc013151caf532af841e0a135c4e49d1314 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
From b232881ed1ecc010b8a13c6aa295bbdddc87c70b Mon Sep 17 00:00:00 2001
From: Jonathan Poelen <jonathan.poelen@gmail.com>
Date: Thu, 10 Dec 2020 02:11:29 +0100
Subject: [PATCH] fix && and || in a subcontext and fix function name pattern

---
 data/syntax/bash.xml                  | 10 ++++++----
 6 files changed, 46 insertions(+), 4 deletions(-)

diff --git a/data/syntax/bash.xml b/data/syntax/bash.xml
index 3b8824df..70cee765 100644
--- a/data/syntax/bash.xml
+++ b/data/syntax/bash.xml
@@ -2,7 +2,7 @@
 <!DOCTYPE language SYSTEM "language.dtd"
 [
         <!ENTITY tab      "&#009;">
-        <!ENTITY funcname "[A-Za-z_:][A-Za-z0-9_:#&#37;@-]*">
+        <!ENTITY funcname "([^&_fragpathseps;{}=#$]|[+!@](?!\())([^&_fragpathseps;{}=$]*+([+!@](?!\())?+)*+">
         <!ENTITY varname  "[A-Za-z_][A-Za-z0-9_]*">
         <!ENTITY eos      "(?=$|[ &tab;])">                 <!-- eol or space following -->
         <!ENTITY eoexpr   "(?=$|[ &tab;&lt;>|&amp;;])">
@@ -28,7 +28,7 @@
         <!ENTITY heredocq "(?|&quot;([^&quot;]+)&quot;|'([^']+)'|\\(.[^&wordseps;&substseps;]*))">
 ]>
 
-<language name="Bash" version="16" kateversion="5.62" 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="17" kateversion="5.62" 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)
@@ -471,8 +471,8 @@
         <Detect2Chars attribute="Redirection" context="FdRedirection" char="&amp;" char1=">"/>
 
         <!-- handle branche conditions -->
-        <Detect2Chars attribute="Control" context="#pop" char="&amp;" char1="&amp;"/>
-        <Detect2Chars attribute="Control" context="#pop" char="|" char1="|"/>
+        <Detect2Chars attribute="Control" context="#stay" char="&amp;" char1="&amp;"/>
+        <Detect2Chars attribute="Control" context="#stay" char="|" char1="|"/>
 
         <!-- handle &, |, ; -->
         <AnyChar attribute="Control" context="#stay" String="&amp;|;"/>
@@ -1269,6 +1269,8 @@
 
       <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>
 
-- 
GitLab