zsh-users
 help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Roman Perepelitsa <roman.perepelitsa@gmail.com>
Cc: Daniel Shahaf <d.s@daniel.shahaf.name>, Zsh Users <zsh-users@zsh.org>
Subject: Re: z-sy-h and z-asug: zle-line-pre-redraw, POSTDISPLAY, coexistence (was: Re: emulate bash key bindings)
Date: Sun, 12 Jan 2020 03:42:00 +0100	[thread overview]
Message-ID: <CAKc7PVCNzvAWh0FjjVjQwx3u2c98rZh1rboSDsyTvQ0tA5oH3Q@mail.gmail.com> (raw)
In-Reply-To: <CAN=4vMp7aKDLbxvyLxPunc2UfexhKNZhZqbPSOxvd1EUXwXRaw@mail.gmail.com>

On Sat, 11 Jan 2020 at 15:30, Roman Perepelitsa
<roman.perepelitsa@gmail.com> wrote:
> Thanks, this is the hint I needed . $token at zsd-detect.main:325 is
> always a word in the command position, right?

Yes. As I've added some commits recently I'll link the line of code so
that the reference will be safe:

https://github.com/zdharma/zshelldoc/blob/ccba867/src/zsd-detect.main#L318

> I'm looking for a parser that's a bit more precise. Here are a few
> examples of zsh code I want to be handled correctly:
>
>   2>&1 x
>
>   x <<END
>   y
>   END
>
>   for x ( ; ) y
>
>   case x in
>     a) y;;
>     b)
>   esac

I would also add:

array=(
  x y z
)

> The parser needs to be fast as I'm going to be calling it from zle. It
> shouldn't perform I/O (no file globbing) and must not have side
> effects. These constraints mean that correct parsing is impossible to
> implement. For example, there is no way to figure out what `*` does .
> I'm OK with it. Given the choice between false positives (parser says
> something is a command when it isn't) and false negatives (parser
> misses a command), I would prefer false positives.
>
> I'm not asking you (or anyone else) to build this for me. Just sharing
> to provide context.

I hope that I've could help. I think that what's practically useful is
the TOKEN_TYPES array that's taken from z-sy-h/f-sy-h and extended,
and its way of use to decide on the state change that the parser
should undergo.


--
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org

  reply	other threads:[~2020-01-12  2:42 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20200107184011eucas1p241073778b2cdd5bf7e94b43851273d49@eucas1p2.samsung.com>
2020-01-07 18:38 ` emulate bash key bindings Andrey Butirsky
2020-01-08  2:26   ` Sebastian Gniazdowski
2020-01-08  2:37     ` Andrey Butirsky
2020-01-08  4:26       ` dana
2020-01-08  9:06       ` Mikael Magnusson
2020-01-08 10:00   ` Peter Stephenson
2020-01-08 21:55     ` Andrey Butirsky
2020-01-08 22:03       ` Roman Perepelitsa
2020-01-08 22:23         ` Daniel Shahaf
2020-01-09  0:05           ` Andrey Butirsky
2020-01-09  8:45             ` Roman Perepelitsa
2020-01-09  9:27               ` Andrey
2020-01-09 10:44                 ` Roman Perepelitsa
2020-01-09 11:03           ` Roman Perepelitsa
2020-01-10 17:06             ` Daniel Shahaf
2020-01-10 17:35               ` Roman Perepelitsa
2020-01-10 18:09                 ` z-sy-h and z-asug: zle-line-pre-redraw, POSTDISPLAY, coexistence (was: Re: emulate bash key bindings) Daniel Shahaf
2020-01-10 18:14                   ` Roman Perepelitsa
2020-01-10 18:29                     ` Daniel Shahaf
2020-01-10 18:43                       ` Roman Perepelitsa
2020-01-10 19:14                         ` Daniel Shahaf
2020-01-10 22:42                         ` Sebastian Gniazdowski
2020-01-10 22:54                           ` Roman Perepelitsa
2020-01-10 23:46                             ` Sebastian Gniazdowski
2020-01-11 14:30                               ` Roman Perepelitsa
2020-01-12  2:42                                 ` Sebastian Gniazdowski [this message]
2020-01-12  2:47                                   ` Sebastian Gniazdowski
2020-01-09 14:18     ` emulate bash key bindings Andrey Butirsky
2020-01-09 14:29       ` Peter Stephenson
2020-01-10  0:46         ` Andrey Butirsky
2020-01-10  9:51           ` Peter Stephenson
2020-01-10 10:58             ` Peter Stephenson
2020-01-10 11:07               ` Peter Stephenson
2020-01-10 11:47               ` Mikael Magnusson
2020-01-10 14:00               ` Andrey Butirsky

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=CAKc7PVCNzvAWh0FjjVjQwx3u2c98rZh1rboSDsyTvQ0tA5oH3Q@mail.gmail.com \
    --to=sgniazdowski@gmail.com \
    --cc=d.s@daniel.shahaf.name \
    --cc=roman.perepelitsa@gmail.com \
    --cc=zsh-users@zsh.org \
    /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).