summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthäus G. Chajdas <dev@anteru.net>2020-12-29 09:48:53 +0100
committerMatthäus G. Chajdas <dev@anteru.net>2020-12-29 09:48:53 +0100
commitd7dcc6dfb392fd3b256196ae34c70b07d155b3dd (patch)
tree3a568ab6759d74e34a598b2caf33dde183bd1aab
parent23f9a8be707ec4ff211bbc0d43223cb24f0e0c44 (diff)
downloadpygments-git-d7dcc6dfb392fd3b256196ae34c70b07d155b3dd.tar.gz
Fix #1652.
in is a keyword in Bash, ZSH, and KSH.
-rw-r--r--CHANGES1
-rw-r--r--pygments/lexers/shell.py2
2 files changed, 2 insertions, 1 deletions
diff --git a/CHANGES b/CHANGES
index 7b7a3054..d62f23b0 100644
--- a/CHANGES
+++ b/CHANGES
@@ -25,6 +25,7 @@ Version 2.7.4
- Lex trailing whitespace as part of the prompt in shell lexers (#1645)
- Add missing ONLY keyword to Fortran (#1635)
- Add missing regex flags to JS/TS/... lexers (#1647)
+- Add missing ``in`` keyword to shell (#1652)
Thanks to Google's OSS-Fuzz project for finding many of these bugs.
diff --git a/pygments/lexers/shell.py b/pygments/lexers/shell.py
index daef1f39..e9dd3796 100644
--- a/pygments/lexers/shell.py
+++ b/pygments/lexers/shell.py
@@ -57,7 +57,7 @@ class BashLexer(RegexLexer):
(r'\$', Text),
],
'basic': [
- (r'\b(if|fi|else|while|do|done|for|then|return|function|case|'
+ (r'\b(if|fi|else|while|in|do|done|for|then|return|function|case|'
r'select|continue|until|esac|elif)(\s*)\b',
bygroups(Keyword, Text)),
(r'\b(alias|bg|bind|break|builtin|caller|cd|command|compgen|'