From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: [PATCH] [[:blank:]] only matches on SPC and TAB
Date: Mon, 14 May 2018 06:41:40 +0200 [thread overview]
Message-ID: <CAKc7PVDe5TyYMXaY0ib72vHdGSGoaFo_ceC_nsgSSnXASrtZuQ@mail.gmail.com> (raw)
In-Reply-To: <CAKc7PVDyrTMsmBSEDcMC=CNVCjOnEDVtywRYA0=UnNCBpF=7JQ@mail.gmail.com>
On 14 May 2018 at 04:27, Sebastian Gniazdowski <sgniazdowski@gmail.com> wrote:
> I'm currently coding a new plugin and literally have chosen [[:blank:]] because it's not unicode spaces.
I thought that I'll prove this – follows main code from my ini-file parser:
while read -r -t 1 __line; do
if [[ "$__line" = (#b)[[:blank:]]#\[([^\]]##)\][[:blank:]]# ]]; then
__cur_section="${match[1]}"
elif [[ "$__line" =
(#b)[[:blank:]]#([^[:blank:]=]##)[[:blank:]]#[=][[:blank:]]#(*) ]];
then
match[2]="${match[2]%"${match[2]##*[! $'\t']}"}"
__access_string="${__out_hash}[${__key_prefix}<$__cur_section>_${match[1]}]"
: "${(P)__access_string::=${match[2]}}"
fi
done < "$__ini_file"
[[:blank:]] is like a platform. I've really gone into paranoid state
that my platform will change, so I'm even proving this. If I would
want users to use unicode spaces in ini-file, I would use [[:space:]].
Let's not discard this degree of freedom.
Whole code:
https://github.com/zdharma/the-z-invoker/blob/master/-zflai_read_ini_file
--
Best regards,
Sebastian Gniazdowski
next prev parent reply other threads:[~2018-05-14 4:42 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-13 21:25 Stephane Chazelas
2018-05-13 21:49 ` [PATCH v2] " Stephane Chazelas
2018-05-14 2:27 ` [PATCH] " Sebastian Gniazdowski
2018-05-14 4:41 ` Sebastian Gniazdowski [this message]
2018-05-14 6:36 ` Stephane Chazelas
2018-05-14 6:44 ` Stephane Chazelas
2018-05-14 8:47 ` Peter Stephenson
2018-05-14 12:34 ` Stephane Chazelas
2018-05-14 13:50 ` Peter Stephenson
2018-05-14 15:51 ` Stephane Chazelas
2018-05-14 16:31 ` Sebastian Gniazdowski
2018-05-14 16:50 ` Bart Schaefer
2018-05-14 19:52 ` Daniel Tameling
2018-05-14 20:42 ` Stephane Chazelas
2018-05-15 18:12 ` Stephane Chazelas
2018-05-16 4:18 ` Sebastian Gniazdowski
2018-05-15 19:06 ` Oliver Kiddle
2018-05-16 13:15 ` Stephane Chazelas
2018-05-16 13:40 ` Peter Stephenson
2018-05-16 16:31 ` Stephane Chazelas
2018-05-16 21:02 ` [PATCH v4] " Stephane Chazelas
2018-05-17 8:29 ` Peter Stephenson
2018-05-17 22:05 ` [PATCH] " Oliver Kiddle
2018-05-17 9:03 ` Sebastian Gniazdowski
2018-05-17 10:10 ` Sebastian Gniazdowski
2018-05-14 8:11 ` Sebastian Gniazdowski
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=CAKc7PVDe5TyYMXaY0ib72vHdGSGoaFo_ceC_nsgSSnXASrtZuQ@mail.gmail.com \
--to=sgniazdowski@gmail.com \
--cc=zsh-workers@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).