Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: syntactic trivia
- X-seq: zsh-users 26329
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Cc: Ray Andrews <rayandrews@xxxxxxxxxxx>, Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: syntactic trivia
- Date: Mon, 4 Jan 2021 05:34:36 +0000
- Archived-at: <https://zsh.org/users/26329>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-users/2021-01/20210104053436.16a83f0e%40tarpaulin.shahaf.local2>
- In-reply-to: <CAH+w=7ZjJXD24wYEKrkv_ojkgVdCi4QtywJ3qK3XmWG+vb5juw@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <565cd2e7-c999-5735-4089-a56870713432@eastlink.ca> <20210102153217.xkpqakxgh7ulikqr@chazelas.org> <f1eb20ff-3010-7a8e-7e3f-2523642e84b2@eastlink.ca> <CAH+w=7ZjJXD24wYEKrkv_ojkgVdCi4QtywJ3qK3XmWG+vb5juw@mail.gmail.com>
Bart Schaefer wrote on Sat, 02 Jan 2021 11:13 -0800:
> Assuming not, a more reasonable approach would be to allow line
> continuation to appear AFTER a comment, e.g.,
>
> [[ stuff ]] && do-this # Why did I do this? \
> || do-that
>
> It's unlikely that any significant amount of existing code has
> comments ending with a backslash,
I'd actually expect this to be somewhat common in codebases that
restrict themselves to some fixed column width. For example,
Subversion (which is written in 80-column C) has these:
tools/examples/svnput.c:39: * cc svnput.c -o svnput \
tools/examples/svnput.c:40: * -I/usr/local/include/subversion-1 -I/usr/local/apache2/include \
tools/examples/svnput.c:41: * -L/usr/local/apache2/lib -L/usr/local/lib \
subversion/include/svn_repos.h:2467: * @defgroup svn_repos_hook_wrappers Hook-sensitive wrappers for libsvn_fs \
subversion/include/svn_repos.h:2949: * @defgroup svn_repos_inspection Data structures and editor things for \
subversion/include/svn_client.h:2357: * @defgroup Status Report interesting information about paths in the \
subversion/libsvn_client/merge.c:12314: * / \
subversion/libsvn_client/merge.c:12315: * -----o prev. \
subversion/libsvn_client/merge.c:12316: * YCA \ merges \
The first of these examples is probably the most typical one. (The
second one is Doxygen directives, which may or may not actually need
explicit line continuation. The third one is an ASCII art diagram.)
> but such a change would probably have to be controlled by an option
> nonetheless.
I can't say I'm a fan of syntax-changing options, and in this case
there's an easy workaround:
if foo # ...
then bar # ...
else baz # ...
fi
Cheers,
Daniel
P.S. Ray, please use more specific subject lines. If you wouldn't
have picked a book called "syntactic trivia" from the shelf at a book
shop, then it's not a good subject line.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author