summaryrefslogtreecommitdiff
path: root/Src/lex.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/lex.c')
-rw-r--r--Src/lex.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/Src/lex.c b/Src/lex.c
index 889612825..59e9d1472 100644
--- a/Src/lex.c
+++ b/Src/lex.c
@@ -1359,17 +1359,13 @@ gettokstr(int c, int sub)
case LX2_DASH:
/*
* - shouldn't be treated as a special character unless
- * we're in a pattern. Howeve,simply counting "[" doesn't
- * work as []a-z] is a valid expression and we don't know
- * down here what this "[" is for as $foo[stuff] is valid
- * in zsh. So just detect an opening [, which is enough
- * to turn this into a pattern; the Dash will be harmlessly
- * untokenised if not wanted.
+ * we're in a pattern. Unfortunately, working out for
+ * sure in complicated expressions whether we're in a
+ * pattern is tricky. So we'll make it special and
+ * turn it back any time we don't need it special.
+ * This is not ideal as it's a lot of work.
*/
- if (seen_brct)
- c = Dash;
- else
- c = '-';
+ c = Dash;
break;
case LX2_BANG:
/*