Re: Missing semicolon tolerated after double-bracket [[ ]] expression
From:
Greg Wooledge
Subject:
Re: Missing semicolon tolerated after double-bracket [[ ]] expression
Date:
Sat, 13 Sep 2025 11:02:18 -0400
User-agent:
Mutt/1.10.1 (2018-07-13)
On Sat, Sep 13, 2025 at 10:55:06 -0400, Lawrence Velázquez wrote:
> Yeah, I misunderstood how locale_setblanks [1] works. Its function
> comment is:
>
> Set every character in the <blank> character class to be a
> shell break character for the lexical analyzer when the
> locale changes.
>
> But it seems to only consider 0x00 through 0xFF, which are tabulated
> into syntax.c at build time [2].
I really think this is a bad idea. A script needs to have predictable
behavior regardless of what bizarre locales may exist on the target
system. (I'm obviously not talking about different error messages and
so on -- that's fine.) Parsing something differently at the syntax
level because "q" is a blank in some locale would just be horrible.
I'm guessing the intent was to make it comfortable for someone to *write*
scripts (for personal use) using the natural features of their own locale,
but this falls apart extremely quickly once you consider that a script
may be shared or distributed across locale boundaries.