Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zsh_error_db --- hash-based database of error messages
- X-seq: zsh-workers 51226
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: zsh_error_db --- hash-based database of error messages
- Date: Fri, 16 Dec 2022 18:05:29 +0000
- Archived-at: <https://zsh.org/workers/51226>
- In-reply-to: <20221216174605.GE8411@tarpaulin.shahaf.local2>
- List-id: <zsh-workers.zsh.org>
- References: <527664940.183302.1671208973242@mail.virginmedia.com> <20221216174605.GE8411@tarpaulin.shahaf.local2>
On Fri, 2022-12-16 at 17:46 +0000, Daniel Shahaf wrote:
> Peter Stephenson wrote on Fri, Dec 16, 2022 at 16:42:53 +0000:
> > Following on from the retread of the discussion on error messages,
> > here's a very simply proof of concept for a hash-based database of
> > error messages. Even if it's adopted I don't intend the C code
> > to get much larger as the point is to allow it to be able to do
> > everything in shell code.
> >
>
> So, tl;dr:
>
> - Every error message would get an E42 identifier in the source string.
>
> - The "E42" will be looked up as a string key in a well-known assoc,
> where the value will be a more elaborate error message.
>
> - The more elaborate message, if there is one, will be used instead of
> the default message.
Yes, that's it in a nutshell; any further complexity would ideally
be in shell code.
I think at least we need something better than E <num> to try to avoid
duplicates, for example E <file-code> <num>. It's easy to search
the file for a duplicate, a bit more of a pain to search the entire
codebase. Maybe a two letter code, so we can have ZW for zle_word.c?
> Code review below.
I think those are all accurate, I'll update for the next version.
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author