From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.dk
Subject: Re: Here-strings and $functions
Date: Tue, 24 Jul 2001 10:12:04 +0200 (MET DST) [thread overview]
Message-ID: <200107240812.KAA13057@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: <1010724061840.ZM15617@candle.brasslantern.com>
Bart Schaefer wrote:
> ...
>
> gets converted internally into a REDIR_HERESTR, and so does the original
> example with <<<. But in the case of <<<, THE QUOTES ARE STILL PART OF
> THE STRING, as \230 tokens. For <<-, there are no quotes. So when we
> arrive in getredirs(), in the <<- case we need to insert quotes and then
> call bslashquote(), but in the <<< case we only need to untokenize().
>
> The only way to get this right is to know whether the original code was
> really a here-string, or actually a full-fledged here-document; but
> that information isn't passed down to getredirs() -- I'm not even sure
> whether it's available in gettext2().
>
> Otherwise we need to change the way <<< here-strings are parsed, so that
> they're stored untokenized and with quotes stripped.
Err... it would be enough to just remnulargs() for here strings,
wouldn't it? At least it seems to work. Just in case I missed
something I won't commit this just now (although I tried <<<, <<-, <<
and <<'EOF').
Bye
Sven
Index: Src/parse.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/parse.c,v
retrieving revision 1.28
diff -u -r1.28 parse.c
--- Src/parse.c 2001/07/09 16:05:14 1.28
+++ Src/parse.c 2001/07/24 08:10:33
@@ -1685,6 +1685,9 @@
if ((tokstr[0] == Inang || tokstr[0] == Outang) && tokstr[1] == Inpar)
type = tokstr[0] == Inang ? REDIR_INPIPE : REDIR_OUTPIPE;
break;
+ case REDIR_HERESTR:
+ remnulargs(name = dupstring(name));
+ break;
}
yylex();
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
next prev parent reply other threads:[~2001-07-24 8:12 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-07-22 22:47 Enhanced shell Peter Stephenson
2001-07-23 11:13 ` Oliver Kiddle
2001-07-23 11:38 ` Peter Stephenson
2001-07-23 18:03 ` Bart Schaefer
2001-07-24 13:42 ` Oliver Kiddle
2001-07-23 12:00 ` Nadav Har'El
2001-07-23 16:38 ` Enable/disable (was Re: Enhanced shell) Bart Schaefer
2001-07-23 22:00 ` Nadav Har'El
2001-07-24 1:12 ` Bart Schaefer
2001-07-24 2:45 ` Here-strings and $functions Bart Schaefer
2001-07-24 6:18 ` Bart Schaefer
2001-07-24 8:12 ` Sven Wischnowsky [this message]
2001-07-24 12:16 ` Bart Schaefer
2001-07-24 9:23 ` Enable/disable (was Re: Enhanced shell) Peter Stephenson
2001-07-24 12:10 ` PATCH: Doc errors (Re: Enable/disable (was Re: Enhanced shell)) Bart Schaefer
2001-07-29 9:53 ` Enhanced shell Zefram
2001-07-29 22:07 ` Peter Stephenson
2001-07-30 1:34 ` Bart Schaefer
2001-07-30 2:19 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200107240812.KAA13057@beta.informatik.hu-berlin.de \
--to=wischnow@informatik.hu-berlin.de \
--cc=zsh-workers@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).