summaryrefslogtreecommitdiff
path: root/Src/lex.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2015-06-18 14:54:41 +0100
committerPeter Stephenson <pws@zsh.org>2015-06-24 10:21:12 +0100
commit39b28980f38e83e15cdeb19a489b5659af97fe93 (patch)
treee68f09fc59fc7008ff732704cbabed7e3df5f188 /Src/lex.c
parenta68d22eb00ea5c85422d70d1be7efa42acfda739 (diff)
downloadzsh-39b28980f38e83e15cdeb19a489b5659af97fe93.tar.gz
zsh-39b28980f38e83e15cdeb19a489b5659af97fe93.zip
various posts: Implement assignment parsing for typeset.
Typeset assignments now work like raw assignments except for no "+=" and no GLOB_ASSIGN. Documented in typeset builtin doc and mentioned in release notes. Tests to ensure basic sanity. Enabled by default, can be turned off by "disable -r" with typeset family of commands.
Diffstat (limited to 'Src/lex.c')
-rw-r--r--Src/lex.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Src/lex.c b/Src/lex.c
index 841fb0b86..d56f670d2 100644
--- a/Src/lex.c
+++ b/Src/lex.c
@@ -1182,7 +1182,7 @@ gettokstr(int c, int sub)
c = Outpar;
}
} else if (peek != ENVSTRING &&
- incmdpos && !bct && !brct) {
+ (incmdpos || intypeset) && !bct && !brct) {
char *t = tokstr;
if (idigit(*t))
while (++t < lexbuf.ptr && idigit(*t));
@@ -1200,7 +1200,7 @@ gettokstr(int c, int sub)
t++;
if (t == lexbuf.ptr) {
e = hgetc();
- if (e == '(' && incmdpos) {
+ if (e == '(') {
*lexbuf.ptr = '\0';
return ENVARRAY;
}