|
56 | 56 |
|
57 | 57 | <!ENTITY arithmetic_as_subshell "\(((?:[^`'"()$]++|\$\{[^`'"(){}$]+\}|\$(?=[^{`'"()])|`[^`]*+`|\((?1)(?:[)]|(?=['"])))++)(?:[)](?=$|[^)])|["'])">
|
58 | 58 |
|
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;])"> |
61 | 61 |
|
62 | 62 | <!ENTITY dblbracket_close "\]\](?=($|[ &tab;;|&)]))">
|
63 | 63 |
|
64 | 64 | <!ENTITY weakDeliminatorSymbols "^%#[]$.{}:-/">
|
65 | 65 | ]>
|
66 | 66 |
|
| 67 | +<!-- |
| 68 | +https://git.savannah.gnu.org/cgit/bash.git/tree/NEWS |
| 69 | +current: bash-5.2 |
| 70 | +--> |
| 71 | + |
67 | 72 | <language
|
68 | 73 | name="Bash"
|
69 |
| - version="51" |
| 74 | + version="53" |
70 | 75 | kateversion="5.79"
|
71 | 76 | section="Scripts"
|
72 | 77 | extensions="*.sh;*.bash;*.ebuild;*.eclass;*.exlib;*.exheres-0;.bashrc;.bash_profile;.bash_login;.profile;PKGBUILD;APKBUILD"
|
|
872 | 877 |
|
873 | 878 | <!-- FindPathThenPopInAlternateValue consumes path in ${xx:here}-->
|
874 | 879 | <context attribute="Normal Text" lineEndContext="#pop" name="FindPathThenPopInAlternateValue">
|
| 880 | + <DetectChar attribute="Variable" char="&"/> |
875 | 881 | <Detect2Chars context="#pop!PathThenPopInAlternateValue" char="?" char1="(" lookAhead="1"/>
|
876 | 882 | <Detect2Chars context="#pop!PathThenPopInAlternateValue" char="*" char1="(" lookAhead="1"/>
|
877 | 883 | <Detect2Chars context="#pop!PathThenPopInAlternateValue" char="+" char1="(" lookAhead="1"/>
|
|
1239 | 1245 | <IncludeRules context="Start"/>
|
1240 | 1246 | </context>
|
1241 | 1247 |
|
1242 |
| - <!-- StringEsc eats till ', but escaping many characters --> |
| 1248 | + <!-- StringEsc eats till ', but escaping many characters in $'...' --> |
1243 | 1249 | <context attribute="String SingleQ" lineEndContext="#stay" name="StringEsc">
|
1244 | 1250 | <DetectSpaces attribute="String SingleQ"/>
|
1245 | 1251 | <DetectIdentifier attribute="String SingleQ"/>
|
1246 | 1252 | <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\\'"?]|[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.)"/> |
1248 | 1254 | </context>
|
1249 | 1255 |
|
1250 | 1256 | <context attribute="Normal Text" lineEndContext="#stay" name="FindWord">
|
|
1368 | 1374 | <!-- called as soon as ${xxx@ is encoutered -->
|
1369 | 1375 | <context attribute="Normal Text" lineEndContext="#stay" name="VarTransformation" fallthroughContext="#pop!VarError">
|
1370 | 1376 | <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"/> |
1372 | 1378 | </context>
|
1373 | 1379 |
|
1374 | 1380 | <context attribute="Escape" lineEndContext="#pop" name="BraceExpansion">
|
|
1495 | 1501 | <IncludeRules context="FindNormalText"/>
|
1496 | 1502 | </context>
|
1497 | 1503 |
|
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"> |
1499 | 1508 | <DetectSpaces attribute="Normal Text" context="#pop!ExprBracketParam3"/>
|
1500 | 1509 | <AnyChar context="TestMaybeBinary" String="-=!" lookAhead="1"/>
|
1501 | 1510 | <IncludeRules context="FindExprBracketEnd"/>
|
1502 | 1511 | </context>
|
1503 | 1512 |
|
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"> |
1505 | 1517 | <DetectSpaces attribute="Normal Text" context="#pop!ExprBracketFinal"/>
|
1506 | 1518 | <IncludeRules context="FindExprBracketEnd"/>
|
1507 | 1519 | </context>
|
|
1525 | 1537 | <RegExpr attribute="Expression" context="#pop" String="&binary_operators;"/>
|
1526 | 1538 | </context>
|
1527 | 1539 |
|
| 1540 | + <context attribute="Normal Text" lineEndContext="#pop" name="SkipSpaces" fallthroughContext="#pop"> |
| 1541 | + <DetectSpaces context="#pop"/> |
| 1542 | + </context> |
1528 | 1543 |
|
1529 |
| - <!-- ExprDblBracket consumes an expression till ]] --> |
| 1544 | + |
| 1545 | + <!-- ExprDblBracket consumes an expression till ]] in [[ ... ]] --> |
1530 | 1546 | <context attribute="Normal Text" lineEndContext="#stay" name="ExprDblBracket" fallthroughContext="#pop!ExprDblBracketNot">
|
1531 | 1547 | <DetectSpaces attribute="Normal Text" context="#stay"/>
|
1532 | 1548 | <DetectChar attribute="Comment" context="Comment" char="#"/>
|
|
1641 | 1657 | <DetectChar attribute="Operator" context="ExprDblBracketValuePattern" char=")" endRegion="expression" beginRegion="subshell"/>
|
1642 | 1658 | </context>
|
1643 | 1659 |
|
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"> |
1645 | 1664 | <DetectSpaces attribute="Normal Text" context="#pop!ExprDblBracketParam3"/>
|
1646 | 1665 | <AnyChar context="TestMaybeBinary2" String="-=!" lookAhead="1"/>
|
1647 | 1666 | <AnyChar attribute="Expression" context="#pop!ExprDblBracketParam3Spe" String="<>"/>
|
|
1657 | 1676 | <DetectSpaces attribute="Normal Text" context="#pop!ExprDblBracketParam3"/>
|
1658 | 1677 | </context>
|
1659 | 1678 |
|
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"> |
1661 | 1683 | <DetectSpaces attribute="Normal Text" context="#pop!ExprDblBracketFinal"/>
|
1662 | 1684 | <IncludeRules context="FindExprDblBracketEnd"/>
|
1663 | 1685 | <AnyChar attribute="Error" context="#stay" String="<>"/>
|
|
1773 | 1795 | <DetectChar attribute="Error" context="#pop" char="]"/>
|
1774 | 1796 | </context>
|
1775 | 1797 |
|
1776 |
| - <!-- SubShell consumes shell input till ) --> |
| 1798 | + <!-- SubShell consumes shell input till ) in (...) --> |
1777 | 1799 | <context attribute="Normal Text" lineEndContext="#stay" name="SubShell" fallthroughContext="Command">
|
1778 | 1800 | <DetectChar attribute="Keyword" context="#pop" char=")" endRegion="subshell"/>
|
1779 | 1801 | <IncludeRules context="Start"/>
|
|
1788 | 1810 | <IncludeRules context="NormalOption"/>
|
1789 | 1811 | </context>
|
1790 | 1812 |
|
1791 |
| - <!-- AssignArray consumes everything till ), marking assignments --> |
| 1813 | + <!-- AssignArray consumes everything till ) in var=(...), marking assignments --> |
1792 | 1814 | <context attribute="Normal Text" lineEndContext="#stay" name="AssignArray" fallthroughContext="NormalOption">
|
1793 | 1815 | <DetectSpaces attribute="Normal Text" context="#stay"/>
|
1794 | 1816 | <DetectChar attribute="Comment" context="Comment" char="#"/>
|
|
1807 | 1829 | <IncludeRules context="Start"/>
|
1808 | 1830 | </context>
|
1809 | 1831 |
|
1810 |
| - <!-- Subscript consumes anything till ], marks as Variable --> |
| 1832 | + <!-- Subscript consumes anything till ] in [ ... ], marks as Variable --> |
1811 | 1833 | <context attribute="Normal Text" lineEndContext="#stay" name="Subscript" fallthroughContext="#pop!Subscript2">
|
1812 | 1834 | <DetectChar attribute="Parameter Expansion Operator" context="#pop" char="]"/>
|
1813 | 1835 | <AnyChar attribute="Decimal" context="#stay" String="0123456789"/>
|
|
0 commit comments