Commits

Tim Hatch committed 58fe7c2 Draft

Make BashLexer recognize end of words around '&', '|', and ';' properly.

Fixes #844

Comments (0)

Files changed (1)

pygments/lexers/shell.py

         'data': [
             (r'(?s)\$?"(\\\\|\\[0-7]+|\\.|[^"\\])*"', String.Double),
             (r"(?s)\$?'(\\\\|\\[0-7]+|\\.|[^'\\])*'", String.Single),
-            (r';', Text),
+            (r';', Punctuation),
+            (r'&', Punctuation),
             (r'\s+', Text),
-            (r'[^=\s\[\]{}()$"\'`\\<]+', Text),
+            (r'[^=\s\[\]{}()$"\'`\\<&|;]+', Text),
             (r'\d+(?= |\Z)', Number),
             (r'\$#?(\w+|.)', Name.Variable),
             (r'<', Text),