[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] printing multiple heredocs in list
From: |
Chet Ramey |
Subject: |
Re: [PATCH] printing multiple heredocs in list |
Date: |
Fri, 30 Jun 2023 16:02:47 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 |
On 6/29/23 4:01 AM, Grisha Levit wrote:
If there are multiple commands in a row that each require printing the
connector prior to the heredoc body, the connector ends up in the wrong
place for commands after the first:
OK. The parser builds lists (connections) left-side heavy. What do you
think of replacing the test for was_heredoc in your patch with
(printing_connection == 1), so if we're called recursively to print a
second connection on the left side (Connector->first), we print the here-
document body after our caller has been able to add the connector in
the right place. That way you shouldn't need to print any deferred
here-documents in make_command_string().
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/