summaryrefslogtreecommitdiff
path: root/pygments
diff options
context:
space:
mode:
Diffstat (limited to 'pygments')
-rw-r--r--pygments/lexers/shell.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/pygments/lexers/shell.py b/pygments/lexers/shell.py
index 097ca624..e65fbcb5 100644
--- a/pygments/lexers/shell.py
+++ b/pygments/lexers/shell.py
@@ -40,8 +40,8 @@ class BashLexer(RegexLexer):
'root': [
include('basic'),
(r'`', String.Backtick, 'backticks'),
- include('interp'),
include('data'),
+ include('interp'),
],
'interp': [
(r'\$\(\(', Keyword, 'math'),
@@ -71,7 +71,8 @@ class BashLexer(RegexLexer):
'data': [
(r'(?s)\$?"(\\\\|\\[0-7]+|\\.|[^"\\$])*"', String.Double),
(r'"', String.Double, 'string'),
- (r"(?s)\$?'(\\\\|\\[0-7]+|\\.|[^'\\])*'", String.Single),
+ (r"(?s)\$'(\\\\|\\[0-7]+|\\.|[^'\\])*'", String.Single),
+ (r"(?s)'.*?'", String.Single),
(r';', Punctuation),
(r'&', Punctuation),
(r'\|', Punctuation),
@@ -82,7 +83,7 @@ class BashLexer(RegexLexer):
],
'string': [
(r'"', String.Double, '#pop'),
- (r'(\\\\|\\[0-7]+|\\[\w\W]|[^"\\$])+', String.Double),
+ (r'(?s)(\\\\|\\[0-7]+|\\.|[^"\\$])+', String.Double),
include('interp'),
],
'curly': [