Skip to content

Commit 2e2220a

Browse files
committed
Update xml syntax definitions for:
bash, cmake, commonlisp, isocpp, javascript-react, julia, latex, lua, markdown, modelines, nix, php, python, rhtml, ruby, swift, xml, yaml, zig, zsh.
1 parent d06b359 commit 2e2220a

21 files changed

+2839
-728
lines changed

skylighting-core/test/expected/abc.ruby.native

+17-14
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
[ [ ( NormalTok , "words " )
2-
, ( KeywordTok , "=" )
3-
, ( OtherTok , " %w(" )
4-
, ( StringTok , "A BaRK BOoK tREaT COmMOn SqUAD CoNfuSE" )
2+
, ( OperatorTok , "=" )
3+
, ( NormalTok , " " )
4+
, ( OtherTok , "%w(" )
5+
, ( VerbatimStringTok , "A BaRK BOoK tREaT COmMOn SqUAD CoNfuSE" )
56
, ( OtherTok , ")" )
67
, ( NormalTok , " " )
7-
, ( KeywordTok , "<<" )
8+
, ( OperatorTok , "<<" )
89
, ( NormalTok , " " )
910
, ( StringTok , "\"\"" )
1011
]
@@ -14,36 +15,38 @@
1415
, ( NormalTok , " " )
1516
, ( ControlFlowTok , "do" )
1617
, ( NormalTok , " " )
17-
, ( KeywordTok , "|" )
18+
, ( OperatorTok , "|" )
1819
, ( NormalTok , "word" )
19-
, ( KeywordTok , "|" )
20+
, ( OperatorTok , "|" )
2021
]
2122
, [ ( NormalTok , " blocks " )
22-
, ( KeywordTok , "=" )
23+
, ( OperatorTok , "=" )
2324
, ( NormalTok , " " )
2425
, ( StringTok
2526
, "\"BO XK DQ CP NA GT RE TG QD FS JW HU VI AN OB ER FS LY PC ZM\""
2627
)
2728
]
2829
, [ ( NormalTok , " res " )
29-
, ( KeywordTok , "=" )
30+
, ( OperatorTok , "=" )
3031
, ( NormalTok , " word" )
3132
, ( AttributeTok , ".each_char.all?" )
32-
, ( KeywordTok , "{|" )
33+
, ( OperatorTok , "{|" )
3334
, ( NormalTok , "c" )
34-
, ( KeywordTok , "|" )
35+
, ( OperatorTok , "|" )
3536
, ( NormalTok , " blocks" )
3637
, ( AttributeTok , ".sub!" )
3738
, ( NormalTok , "(" )
38-
, ( SpecialStringTok , "/\\w?" )
39+
, ( SpecialStringTok , "/" )
40+
, ( SpecialCharTok , "\\w" )
41+
, ( SpecialStringTok , "?" )
3942
, ( SpecialCharTok , "#{" )
4043
, ( NormalTok , "c" )
41-
, ( SpecialCharTok , "}" )
42-
, ( SpecialStringTok , "\\w?/i" )
44+
, ( SpecialCharTok , "}\\w" )
45+
, ( SpecialStringTok , "?/i" )
4346
, ( NormalTok , ", " )
4447
, ( StringTok , "\"\"" )
4548
, ( NormalTok , ")" )
46-
, ( KeywordTok , "}" )
49+
, ( OperatorTok , "}" )
4750
, ( NormalTok , " " )
4851
, ( CommentTok , "#regexps can be interpolated like strings" )
4952
]

skylighting-core/xml/bash.xml

+36-14
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,22 @@
5656

5757
<!ENTITY arithmetic_as_subshell "\(((?:[^`'&quot;()$]++|\$\{[^`'&quot;(){}$]+\}|\$(?=[^{`'&quot;()])|`[^`]*+`|\((?1)(?:[)]|(?=['&quot;])))++)(?:[)](?=$|[^)])|[&quot;'])">
5858

59-
<!ENTITY unary_operators "-[abcdefghkprstuwxGLNOSovRnz]&eos;">
60-
<!ENTITY binary_operators "(?:-(?:e[fq]|[nolg]t|[nlg]e)|==?|!=)&eos;">
59+
<!ENTITY unary_operators "-[abcdefghkprstuwxGLNOSovRnz](?=\\?$|[ &tab;])">
60+
<!ENTITY binary_operators "(?:-(?:e[fq]|[nolg]t|[nlg]e)|==?|!=)(?=\\?$|[ &tab;])">
6161

6262
<!ENTITY dblbracket_close "\]\](?=($|[ &tab;;|&amp;)]))">
6363

6464
<!ENTITY weakDeliminatorSymbols "^&#37;#[]$.{}:-/">
6565
]>
6666

67+
<!--
68+
https://git.savannah.gnu.org/cgit/bash.git/tree/NEWS
69+
current: bash-5.2
70+
-->
71+
6772
<language
6873
name="Bash"
69-
version="51"
74+
version="53"
7075
kateversion="5.79"
7176
section="Scripts"
7277
extensions="*.sh;*.bash;*.ebuild;*.eclass;*.exlib;*.exheres-0;.bashrc;.bash_profile;.bash_login;.profile;PKGBUILD;APKBUILD"
@@ -872,6 +877,7 @@
872877

873878
<!-- FindPathThenPopInAlternateValue consumes path in ${xx:here}-->
874879
<context attribute="Normal Text" lineEndContext="#pop" name="FindPathThenPopInAlternateValue">
880+
<DetectChar attribute="Variable" char="&amp;"/>
875881
<Detect2Chars context="#pop!PathThenPopInAlternateValue" char="?" char1="(" lookAhead="1"/>
876882
<Detect2Chars context="#pop!PathThenPopInAlternateValue" char="*" char1="(" lookAhead="1"/>
877883
<Detect2Chars context="#pop!PathThenPopInAlternateValue" char="+" char1="(" lookAhead="1"/>
@@ -1239,12 +1245,12 @@
12391245
<IncludeRules context="Start"/>
12401246
</context>
12411247

1242-
<!-- StringEsc eats till ', but escaping many characters -->
1248+
<!-- StringEsc eats till ', but escaping many characters in $'...' -->
12431249
<context attribute="String SingleQ" lineEndContext="#stay" name="StringEsc">
12441250
<DetectSpaces attribute="String SingleQ"/>
12451251
<DetectIdentifier attribute="String SingleQ"/>
12461252
<DetectChar attribute="String SingleQ" context="#pop" char="'"/>
1247-
<RegExpr attribute="String Escape" context="#stay" String="\\(?:[abefnrtv\\']|[0-7]{1,3}|x[A-Fa-f0-9]{1,2}|c.)"/>
1253+
<RegExpr attribute="String Escape" context="#stay" String="\\(?:[abeEfnrtv\\'&quot;?]|[0-7]{1,3}|x[A-Fa-f0-9]{1,2}|u[A-Fa-f0-9]{1,4}|U[A-Fa-f0-9]{1,8}|c.)"/>
12481254
</context>
12491255

12501256
<context attribute="Normal Text" lineEndContext="#stay" name="FindWord">
@@ -1368,7 +1374,7 @@
13681374
<!-- called as soon as ${xxx@ is encoutered -->
13691375
<context attribute="Normal Text" lineEndContext="#stay" name="VarTransformation" fallthroughContext="#pop!VarError">
13701376
<DetectChar attribute="Parameter Expansion" context="#pop" char="}"/>
1371-
<AnyChar attribute="Parameter Expansion" context="#stay" String="UuLQEPAKa"/>
1377+
<AnyChar attribute="Parameter Expansion" context="#stay" String="UuLQEPAKak"/>
13721378
</context>
13731379

13741380
<context attribute="Escape" lineEndContext="#pop" name="BraceExpansion">
@@ -1495,13 +1501,19 @@
14951501
<IncludeRules context="FindNormalText"/>
14961502
</context>
14971503

1498-
<context attribute="Normal Text" lineEndContext="#stay" name="ExprBracketParam2" fallthroughContext="ExprBracketValue">
1504+
<context attribute="Normal Text" lineEndContext="#stay" name="ExprBracketParam2" fallthroughContext="#pop!ExprBracketParam2_Value">
1505+
<LineContinue attribute="Escape" context="SkipSpaces"/>
1506+
</context>
1507+
<context attribute="Normal Text" lineEndContext="#stay" name="ExprBracketParam2_Value" fallthroughContext="ExprBracketValue">
14991508
<DetectSpaces attribute="Normal Text" context="#pop!ExprBracketParam3"/>
15001509
<AnyChar context="TestMaybeBinary" String="-=!" lookAhead="1"/>
15011510
<IncludeRules context="FindExprBracketEnd"/>
15021511
</context>
15031512

1504-
<context attribute="Normal Text" lineEndContext="ExprBracketFinal" name="ExprBracketParam3" fallthroughContext="ExprBracketValue">
1513+
<context attribute="Normal Text" lineEndContext="ExprBracketFinal" name="ExprBracketParam3" fallthroughContext="#pop!ExprBracketParam3_Value">
1514+
<LineContinue attribute="Escape" context="SkipSpaces"/>
1515+
</context>
1516+
<context attribute="Normal Text" lineEndContext="ExprBracketFinal" name="ExprBracketParam3_Value" fallthroughContext="ExprBracketValue">
15051517
<DetectSpaces attribute="Normal Text" context="#pop!ExprBracketFinal"/>
15061518
<IncludeRules context="FindExprBracketEnd"/>
15071519
</context>
@@ -1525,8 +1537,12 @@
15251537
<RegExpr attribute="Expression" context="#pop" String="&binary_operators;"/>
15261538
</context>
15271539

1540+
<context attribute="Normal Text" lineEndContext="#pop" name="SkipSpaces" fallthroughContext="#pop">
1541+
<DetectSpaces context="#pop"/>
1542+
</context>
15281543

1529-
<!-- ExprDblBracket consumes an expression till ]] -->
1544+
1545+
<!-- ExprDblBracket consumes an expression till ]] in [[ ... ]] -->
15301546
<context attribute="Normal Text" lineEndContext="#stay" name="ExprDblBracket" fallthroughContext="#pop!ExprDblBracketNot">
15311547
<DetectSpaces attribute="Normal Text" context="#stay"/>
15321548
<DetectChar attribute="Comment" context="Comment" char="#"/>
@@ -1641,7 +1657,10 @@
16411657
<DetectChar attribute="Operator" context="ExprDblBracketValuePattern" char=")" endRegion="expression" beginRegion="subshell"/>
16421658
</context>
16431659

1644-
<context attribute="Normal Text" lineEndContext="#stay" name="ExprDblBracketParam2" fallthroughContext="ExprDblBracketValuePattern">
1660+
<context attribute="Normal Text" lineEndContext="#stay" name="ExprDblBracketParam2" fallthroughContext="#pop!ExprDblBracketParam2_Value">
1661+
<LineContinue attribute="Escape" context="SkipSpaces"/>
1662+
</context>
1663+
<context attribute="Normal Text" lineEndContext="#stay" name="ExprDblBracketParam2_Value" fallthroughContext="ExprDblBracketValuePattern">
16451664
<DetectSpaces attribute="Normal Text" context="#pop!ExprDblBracketParam3"/>
16461665
<AnyChar context="TestMaybeBinary2" String="-=!" lookAhead="1"/>
16471666
<AnyChar attribute="Expression" context="#pop!ExprDblBracketParam3Spe" String="&lt;>"/>
@@ -1657,7 +1676,10 @@
16571676
<DetectSpaces attribute="Normal Text" context="#pop!ExprDblBracketParam3"/>
16581677
</context>
16591678

1660-
<context attribute="Normal Text" lineEndContext="#stay" name="ExprDblBracketParam3" fallthroughContext="ExprDblBracketValuePattern">
1679+
<context attribute="Normal Text" lineEndContext="#stay" name="ExprDblBracketParam3" fallthroughContext="#pop!ExprDblBracketParam3_Value">
1680+
<LineContinue attribute="Escape" context="SkipSpaces"/>
1681+
</context>
1682+
<context attribute="Normal Text" lineEndContext="#stay" name="ExprDblBracketParam3_Value" fallthroughContext="ExprDblBracketValuePattern">
16611683
<DetectSpaces attribute="Normal Text" context="#pop!ExprDblBracketFinal"/>
16621684
<IncludeRules context="FindExprDblBracketEnd"/>
16631685
<AnyChar attribute="Error" context="#stay" String="&lt;>"/>
@@ -1773,7 +1795,7 @@
17731795
<DetectChar attribute="Error" context="#pop" char="]"/>
17741796
</context>
17751797

1776-
<!-- SubShell consumes shell input till ) -->
1798+
<!-- SubShell consumes shell input till ) in (...) -->
17771799
<context attribute="Normal Text" lineEndContext="#stay" name="SubShell" fallthroughContext="Command">
17781800
<DetectChar attribute="Keyword" context="#pop" char=")" endRegion="subshell"/>
17791801
<IncludeRules context="Start"/>
@@ -1788,7 +1810,7 @@
17881810
<IncludeRules context="NormalOption"/>
17891811
</context>
17901812

1791-
<!-- AssignArray consumes everything till ), marking assignments -->
1813+
<!-- AssignArray consumes everything till ) in var=(...), marking assignments -->
17921814
<context attribute="Normal Text" lineEndContext="#stay" name="AssignArray" fallthroughContext="NormalOption">
17931815
<DetectSpaces attribute="Normal Text" context="#stay"/>
17941816
<DetectChar attribute="Comment" context="Comment" char="#"/>
@@ -1807,7 +1829,7 @@
18071829
<IncludeRules context="Start"/>
18081830
</context>
18091831

1810-
<!-- Subscript consumes anything till ], marks as Variable -->
1832+
<!-- Subscript consumes anything till ] in [ ... ], marks as Variable -->
18111833
<context attribute="Normal Text" lineEndContext="#stay" name="Subscript" fallthroughContext="#pop!Subscript2">
18121834
<DetectChar attribute="Parameter Expansion Operator" context="#pop" char="]"/>
18131835
<AnyChar attribute="Decimal" context="#stay" String="0123456789"/>

0 commit comments

Comments
 (0)