Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] [[:blank:]] only matches on SPC and TAB
- X-seq: zsh-workers 42766
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: [PATCH] [[:blank:]] only matches on SPC and TAB
- Date: Mon, 14 May 2018 06:41:40 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-transfer-encoding; bh=p+4KqdG2EQCO4L3FKOk36CcqLarjcet3GmvL9Q18AzQ=; b=X/U6Bdq1QsCYTmfzua9BnlayBivwnZET+uPonvbrUFgNDdcIATFHuqgoHuJ2jQoSSi MzF2p4cHNxhqjyEiJ7PuhGtkDVAEatEOC3ZMfyULZBRnmF7Pd73le0rin+JBwq1rfu/X 6IFEWtNY4hR5PhU8g96Q2sppNGkQhoKWjGU2fHfTCCi4+9aLrBeNvfunOcQAjs2KZTS0 jmtm++WTbziowLpi0JaqkfYlRY2UVtvVYfz+AhZexFVqyuZQESkCiRxbJuE+70S6owqc KfKQcnBrhxcTHO0HwjD1+P6d0C2SVLQAGIz/Ujd6q/YcwpHajMMlhq6jVNJrrnHUnD+T N2BA==
- In-reply-to: <CAKc7PVDyrTMsmBSEDcMC=CNVCjOnEDVtywRYA0=UnNCBpF=7JQ@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20180513212553.GA29028@chaz.gmail.com> <CAKc7PVDyrTMsmBSEDcMC=CNVCjOnEDVtywRYA0=UnNCBpF=7JQ@mail.gmail.com>
On 14 May 2018 at 04:27, Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author