From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 8470 invoked from network); 6 Jul 2023 02:28:39 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 6 Jul 2023 02:28:39 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1688610519; b=Pnyla0qDqkkFArqG8cTJ++uMxrvZ3JheUUvN7vnl/uNWDFxTSRhIDw/Rucyuxc0KCSKz8eQQdf lN+fsnt8WSUvURi/bkobtl45BN0Gvv840ppXhfCtaNcF80NF0zM7uc0A/jfvWxr5Hfk6ePkAMU QLQ9X/ewRXyFSPhwr4zblZTS6lahY47dADGfzn7Gglw6eJ72KBN8dn7DovoU2sYhPvYrWS2GBV Mbho2e9+h4IYbg97mhODhssBFrGLRjVNEHMPekfQ+BFoKnq+7+zI82iEdxX3qNOcDie9NN0Jb1 +Q+Wo5FEkLkdkqa9nBH66QoYu60wWO5vfJ0BzmlSkOONnw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ej1-f42.google.com) smtp.remote-ip=209.85.218.42; dkim=pass header.d=gmail.com header.s=20221208 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1688610519; bh=algY5hHUqWYYhpsKjopIU3uL7pJlncrmqamHw3Z6+KI=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Cc:To:Subject: Message-ID:Date:From:References:In-Reply-To:MIME-Version:DKIM-Signature: DKIM-Signature; b=B/PMa6wEemQ5ptw5Oz2wy84OwpcDqkSV5wlylxTZ/Vg3nK3wt+knfpv9ZbbCcTlnAEHEQ4+QvO moyr0N+9K01JkR2xOUnEmv7CAju76f2Vhmn86J1QiPR+XETQIjLT7dpUYvNzyVWgMZSNqYgtn/ UQxbK0DmOQ0jae0VCn56R90gboGAh2FC8PGrvtpUmRS/1Gw3VCNF6hw1Ywmxtg452hZA7Jdp7A LRGpiqALfxlUdxijYKzHif2b4Jhw3Zy2EnKXJvR7kI0Vw9xkKRcGcq0ERQIh/Fo3nDCbXfo48f maEnaneSsFBVaoanc0c3IFDWPsvGnwEezETr7qPreE1NfA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:Cc:To:Subject:Message-ID:Date:From:References:In-Reply-To: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=ZpCrME26fn6Cl3Z4fxQh1Oats3+MyJmM2fxNf71yHzs=; b=iQLqGRmU84q6MggxNT7+9mIPvX ZqvohSE0UQopi/aXWJxY+JRQiJl5Bu9LbxLQVIfcfX9AgIrzfLKn/B4FMfdLYa8nYtTe1vmvqBPRy gLf3IVPvZVhWWCwaspqjtAqoNjUfAyDJDBEi7RcTPawqugfcnmcNQJIiyyyEv3H2mV0QZex4PlsgN MQ92/JyeAw2TXxx7JdOCOmjQyRjPgFTgPk66rMx+PCbYlDEixq5CR3L4sbaVVypVk3CPlN4+vcQ6W wYSA0qKM3SPpq39livowHa8Cx2+ef1ymuvgmwRFdwuRCF+h3L8+cyfzFrw+oQO/xAojnTzZR0tJf5 2pmjUn6g==; Received: by zero.zsh.org with local id 1qHEjV-0008rF-Iv; Thu, 06 Jul 2023 02:28:37 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ej1-f42.google.com) smtp.remote-ip=209.85.218.42; dkim=pass header.d=gmail.com header.s=20221208 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-ej1-f42.google.com ([209.85.218.42]:59684) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1qHEiu-0008XB-CN; Thu, 06 Jul 2023 02:28:02 +0000 Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-992f15c36fcso17986566b.3 for ; Wed, 05 Jul 2023 19:28:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688610480; x=1691202480; h=content-transfer-encoding:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ZpCrME26fn6Cl3Z4fxQh1Oats3+MyJmM2fxNf71yHzs=; b=U8pjBoFuyUbP7XXk6SwBX30J4VFPpxWTxOzoMDz+09kb53mC2qW5tbDH08AlIcLwZi kGJjU/E2+3efCWW9THJbw2K+qlgilQRbW64AdijKKKh3LGYFGYqvY9T6XKenO2/TivjQ /3GO/KgJPhNDBvUGuuOkRyXpi7HWui5CLmPDSBQq+f0MeBhE2sOFK0H/Y42xZQLbrEKx 57hBea78tcnJH5Fogl0kMINrfMC2lJsaFzxipgtdEEiCHiXvgqAJSSIyx2hE6fFmkUa0 fg+qiFx5SaRXas9yaBpjS7CerKmvB7Lg7eHsIEbBKBgt9XULhken8eA0rmH8bv8+AU45 6ZnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688610480; x=1691202480; h=content-transfer-encoding:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZpCrME26fn6Cl3Z4fxQh1Oats3+MyJmM2fxNf71yHzs=; b=Lx/BWh77lIPnkAU8M2108ofY4/QdTnUaIyBJXAP3zVNYYnnFnGidTlsmlroaGmM+71 fsI1bBL8x6xGQfyqvm/bn+ofZv8ydEWD4Q+2+URH7FWjmqKPsUIZOcrzU3w0j2Krka9l 6vyoi/T438ZNuBYjarfVfon6q4m2n6Jz1pZUtjdiJ1KMv9T2U9il170mUKzg1Mtr47aW sztnuLvIHgmEtEW+JeApyhH09BtSj9q0XNYQGJhk8lxaNc1c419a3WZ5a0wQHAj+lFhP GzL1KsrxNiDmlOPaQvTFmHQIPWVADETnHL1a4NKrrVyRWIOvKo0r7MNVaEEfC0V1d4ow FhoA== X-Gm-Message-State: ABy/qLa9ZETLGheJJ6e5oON80JN6KzEMF/wlX3QwyIub12GrwLgXlYdX zDxvVxi7c5N9HHYZkEb2kCkkTJ/c3hjI3OL195ywNUAC X-Google-Smtp-Source: APBJJlEE5uWgBNIv0Q3/bhiII2kTUFjFMHsumTnR+pIvImwbUS3e1fCRHXZ/GjbsPNzijl7ze1o5YwxCUvZf5w9wt5Y= X-Received: by 2002:a17:907:9505:b0:969:faf3:7dba with SMTP id ew5-20020a170907950500b00969faf37dbamr286836ejc.52.1688610479648; Wed, 05 Jul 2023 19:27:59 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a17:907:8a08:b0:977:e915:2f69 with HTTP; Wed, 5 Jul 2023 19:27:58 -0700 (PDT) In-Reply-To: References: From: Mikael Magnusson Date: Thu, 6 Jul 2023 04:27:58 +0200 Message-ID: Subject: Re: [PATCH] Support the mksh's ${|func;} substitution To: Bart Schaefer Cc: zsh-workers@zsh.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 51907 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: On 7/6/23, Bart Schaefer wrote: > On Tue, Jul 4, 2023 at 10:32=E2=80=AFPM Bart Schaefer > wrote: >> >> The first three of those are implementable within the structure of the >> patch from workers/51898 although it's a little messy because of the >> multiple "return" points in paramsubst(). > > Fiddling with this has led me to find a few other issues with either > of Sebastian's or my earlier patch in this thread, namely, both need > to be more clever about finding the closing brace of the ${|...} > substitution. This in turn leads me to ask if one of the old hands > with the lexer can explain why, inside double quotes, "}" is always > replaced by Outbrace but "{" is not replaced by Inbrace unless it is > preceded by "$"? > > A small tweak to the lexer still passes all tests and makes > skipparens(Inbrace, Outbrace, &str) work more consistently, but I > don't want to have missed something. I'm not one of said old hands, but presumably it's because { on its own is not special inside double quotes? Possibly related, % echo ${:-a{}b} a{}b % echo "${:-a{}b}" a{b} ^ People occasionally get confused by this in #zsh, it comes up in relation to %F{} or so usually. It would probably be bad if this behavior changed. --=20 Mikael Magnusson