Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: Error parsing $(...)
- X-seq: zsh-workers 26610
- From: TomÃÅ Smetana <t.smetana@xxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: PATCH: Error parsing $(...)
- Date: Thu, 26 Feb 2009 09:45:07 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:subject :message-id:x-mailer:mime-version:content-type; bh=HFGoA3GOyuxLIF9EdhzOc9jY5L7mZ3jfwebxSjzkJm8=; b=dOvvc7Gh3DQ5OkRxdSxbKZrRaRy0PmDCg35EETywjyvK7vc14sOzJoY7VYxzFaFM/g SoY0gZDr2hJBhLolB6ZkCHve33K1HdsQ1fuZnkT5+851mcHpjxoqQ3XWnVpvf/C9+Qn7 k7SR+7aA8ik5A7IbLr2NSaxQleYubl9j8vezM=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:x-mailer:mime-version:content-type; b=L9y1aFN0iqiycamr4LYI8NfOQIl2ctHcWvARUakXCRVBlip5L3z1gtaLk4akSAU/NG aS7T5ymK1DEtLJwK4MJ9IkvOFZABDn6+7XDbK0byWJagMGbkWaKR7n460vmNZ5q4/uqi KuiK+3FNHrFOnH2ZdPHbzsFJikEoAw5X2RpT4=
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
Hello,
I have stumbled upon a problem with comments in $(...) construct. Consider
the following script:
# Comment containing '
VAR=$(
echo a
# Comment containing '
)
echo $VAR
This is syntactically correct but zsh would throw an error parsing it:
parse error near `VAR=$('
Note that the same script works OK in ksh or bash. It seems that the '\''
character doesn't lose its special meaning even though it appears in the
comment. I have written a patch (attached) which seems to fix the problem.
Could you please review the patch and consider applying it?
Please cc: me in the answers I'm not subscribed.
Thanks and regards,
Tomas Smetana
Index: Src/lex.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/lex.c,v
retrieving revision 1.49
diff -u -r1.49 lex.c
--- Src/lex.c 25 Feb 2009 10:24:01 -0000 1.49
+++ Src/lex.c 26 Feb 2009 08:28:08 -0000
@@ -1854,6 +1854,11 @@
else
add(c);
break;
+ case '#':
+ add(c);
+ while ((c = hgetc()) != '\n' && !lexstop)
+ add(c);
+ break;
}
}
while (pct);
Messages sorted by:
Reverse Date,
Date,
Thread,
Author