diff options
author | Frits van Bommel <fvbommel@gmail.com> | 2015-04-22 10:10:17 +0200 |
---|---|---|
committer | Frits van Bommel <fvbommel@gmail.com> | 2015-04-22 10:10:17 +0200 |
commit | d1c02a72e08c7059bba54f5bcdadd32e27d29202 (patch) | |
tree | 937e96e0c911063e62d5acc4c1b7832ccc1559da | |
parent | 4f2a6c2f49d221b6e815ba4df96c5440cffc30d5 (diff) | |
download | pygments-d1c02a72e08c7059bba54f5bcdadd32e27d29202.tar.gz |
Fix highlighting for $# in the shell lexer.
If '$' is directly followed by '#' the variable ends right there. This is especially important at the end of a string, as the closing quote would be lexed as part of the variable instead, but was wrong in every other case as well.
Fixed by simply removing the '#?' and letting the following '.' eat it.
-rw-r--r-- | pygments/lexers/shell.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pygments/lexers/shell.py b/pygments/lexers/shell.py index a9c1e6b9..1e3640bf 100644 --- a/pygments/lexers/shell.py +++ b/pygments/lexers/shell.py @@ -47,7 +47,7 @@ class BashLexer(RegexLexer): (r'\$\(\(', Keyword, 'math'), (r'\$\(', Keyword, 'paren'), (r'\$\{#?', String.Interpol, 'curly'), - (r'\$#?(\w+|.)', Name.Variable), + (r'\$(\w+|.)', Name.Variable), ], 'basic': [ (r'\b(if|fi|else|while|do|done|for|then|return|function|case|' |