From a85db682710c7435e1093844491b4caa35aee90e Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Fri, 27 Feb 2009 10:23:58 +0000 Subject: 26622: improve comments within $(...) and add test --- ChangeLog | 7 ++++++- Src/lex.c | 3 ++- Test/A01grammar.ztst | 12 ++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 782dd06f3..4e00629cc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-02-27 Peter Stephenson + + * 26622: Src/lex.c, Test/A01grammar.ztst: improve 26617 and add + test. + 2009-02-26 Peter Stephenson * 26617, c.f. Tomáš Smetana, 26610: Src/lex.c: comments @@ -11252,5 +11257,5 @@ ***************************************************** * This is used by the shell to define $ZSH_PATCHLEVEL -* $Revision: 1.4582 $ +* $Revision: 1.4583 $ ***************************************************** diff --git a/Src/lex.c b/Src/lex.c index 6e14612f7..466447963 100644 --- a/Src/lex.c +++ b/Src/lex.c @@ -1813,7 +1813,7 @@ skipcomm(void) c = hgetc(); if (itok(c) || lexstop) break; - iswhite = isep(c); + iswhite = inblank(c); switch (c) { case '(': pct++; @@ -1861,6 +1861,7 @@ skipcomm(void) add(c); while ((c = hgetc()) != '\n' && !lexstop) add(c); + iswhite = 1; } break; } diff --git a/Test/A01grammar.ztst b/Test/A01grammar.ztst index f283451ce..a1ec2cc00 100644 --- a/Test/A01grammar.ztst +++ b/Test/A01grammar.ztst @@ -503,3 +503,15 @@ $ZTST_testdir/../Src/zsh -f NonExistentScript 127q:Non-existent script causes exit status 127 ?$ZTST_testdir/../Src/zsh: can't open input file: NonExistentScript + + (setopt nonomatch + # use this to get stuff at start of line + contents=$'# comment \'\necho value #with " stuff\n# comment\n#comment + echo not#comment\n' + eval 'VAR=$('"$contents"')' + print -l $VAR) +0:comments within $(...) +>value +>not#comment + + -- cgit 1.4.1