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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 13144 invoked from network); 12 Feb 2023 23:13:53 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 12 Feb 2023 23:13:53 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1676243633; b=GvJH6Weu+OtY6z5M1Vbujksvb+lojCMf4HPaca8GrSaseOoX/nYW2TzNb3sNj99ZOh18CHE8oT t83IiatNhVuM/PQdLMMnnc6dtRTd6uKViEjiDJj4G30dvhCB/ykQqQyVOrYh1X7GWcR3jX324k 4DFl96KGBqGUFw2Y9ZCAD2JYcuhgd5gLJUEjkgBZDx1sKbjkGBWoznVihVmVitFQtOowB6Qz6w 9WsEOXAPa5MN0QFIVyrx7mAglXdECRgp/H6IvLg+EIhd8lAdWe7at8zPrNsNC49YEQnFiQdbil UtPSFXM9gXoQ6HTywEwgAZldIKQV+0osSpPlkA9BGSKv2g==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ej1-f52.google.com) smtp.remote-ip=209.85.218.52; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1676243633; bh=ybQRNlhfRgXCy9gG/xUQGkzc8biaiTvlTHVfM5DntvE=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=FSx7rwEFT/MMuWO5EiGWu3+VKtyGpULQEtIwQxsWgnZfubDlaVTGUp2uPukJhipSkhWpFazov8 yyyaeUyENywy/T8u36eygvI5o9OqKOpmBrQokHf5BezTpR9NSqHiKCE/+HJoW/k9/MnjMSHAa4 kqP9FsLP8l45ThdjwoxD63FoV++FrWJ25Y/s8iW8d4qZO8tvi70zS7K7OiK/nCZ8Fa2II2Rdno O1O3QsBeYhBEJF42KeodHPfqZJHVygF5p3hKQwUv8/ZSKo0FuQlrBDM/CXIOdQ16IXUNOeI96Y r+hcDSG6/WM3KjCqN7Kyd8UabZvYzxzAkLzCB6YbmB3wPw==; 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-Type:To:Subject:Message-ID: Date:From:In-Reply-To:References:MIME-Version:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=8KgOGJqKAkNbhOLVQbar50oBiwLA1dR0I+ZO+ss6Lus=; b=KJP8S1fhVCJzd33gLufqWKDWR/ N3grZo9J044+2MscOBoqomYeiWuCP6AfM4RJDxKLzZ6n+jdqlnmWg4g31FhPCtYlcquWIivdoM3h0 YT/YTs5lj+a+ZmQPg8DT9wgXRG9gmKb5uSob5PLZTlN7eX0Fc7jc3+KvgYmxRJo1PTlbWHK2e0+cK 8J74I1vHjD3SJatFba8Bm3+2FeYfpnzTQn3Ime6zjVTWLrWRyNNDkbdCJr0XdW5PAWEMn8RI4R3Cw 9GEZWL7WO1PTefYPebeDQce8bHvThcB1PD2wCvnfpaE+Y4/32xWWE39GuSB5Fvb93jOVSP30K/KPs pTGH7VLg==; Received: by zero.zsh.org with local id 1pRLXd-0009kJ-5l; Sun, 12 Feb 2023 23:13:53 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ej1-f52.google.com) smtp.remote-ip=209.85.218.52; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ej1-f52.google.com ([209.85.218.52]:33291) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1pRLXO-0009R5-Nh; Sun, 12 Feb 2023 23:13:39 +0000 Received: by mail-ej1-f52.google.com with SMTP id ml19so28018276ejb.0 for ; Sun, 12 Feb 2023 15:13:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20210112.gappssmtp.com; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=8KgOGJqKAkNbhOLVQbar50oBiwLA1dR0I+ZO+ss6Lus=; b=zPiD6SzLid79gznw9dxbB/4RdDtNPbDwmL9X3IqAqA83hNk9XzI3RwKaTZhE3H4tKh y/JEoFAaOqjDg0ByFBzTactRGxVFCCaJrhZKJ1tTdhGW4ed95A6MDy4LQxaPuRgvrPYJ IV23OmXGaCwRIYJ7HcSDMIdEo/DXyYmdJtncJKWKDS6EUh0i0NSuPbRGF7Y73D7z9RKd G10YtO2WsHiCTlchEPe3iZj7eONVg71+SnIsH9TuH9txYqezd5o/YEHya+tZ/H0TggAi KuM9XkKtzBdbOWpJ72nJQzCuEwXg+0XMFobpy04zC1peCEseifP4STFN8k6f1vEqTWv8 YmxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=8KgOGJqKAkNbhOLVQbar50oBiwLA1dR0I+ZO+ss6Lus=; b=ZQPCyYzrPF6LdBgLgh1QN8C0Fs5TjXYm8nd0ZmhZ8WcUwvImTnM/mgQIOUBnEniTDB 7NMyNKH2L1ZPFxoyyxl1WTOmP99ZzuYEdqjZFFIgN/QL5BPRe1P/HsOTmHPccdHZ93Mr lVLXysMoWZMCebOui3NtDPAwivKiRVTwRoSa4uIPxoi11u3DPmk2Nwhx1g3Kl6V2ATnu cVx0GftRrXY0/9cSGcz2/sN/hX4eZXbxmESOrfNtMbSc9Gi40NueY3quPJ24wclv+NFi 4GGClXYmXiCzGwGSWfSMdAGE9a0J1LGXGVN3OIy04ILMZLUKuK2nFqTimLp+2R4RgMkY Ck9A== X-Gm-Message-State: AO0yUKVamK+C5P+RmVGXWuBGnQJshafhFDLLf/UJQCtMMbExWru2HtyW mlW2xheNIuYiRulFXTv48PqU2g+ifCn5d7yAbkfI4UQyHpxfth7c X-Google-Smtp-Source: AK7set8t6kqSmpKlzPOjgxaA1jYJD6K+To+Q2yqi8t1QCD8UFTf7R1g/RxAqnzBJbsQpS3wVgs8x7+PisJ850YFpPPI= X-Received: by 2002:a17:906:444e:b0:888:3594:6d5c with SMTP id i14-20020a170906444e00b0088835946d5cmr3668949ejp.6.1676243618429; Sun, 12 Feb 2023 15:13:38 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Sun, 12 Feb 2023 15:13:27 -0800 Message-ID: Subject: Re: [PATCH] More rigorous subscript checking in named references To: Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 51421 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 Sun, Feb 12, 2023 at 12:16 PM Bart Schaefer wrote: > > This covers the case Oliver called out, of extra stuff following a > valid subscript. On Sun, Feb 12, 2023 at 2:54 PM Oliver Kiddle wrote: > > That still leaves the oddities with a second subscript: > > typeset -n ref='arr[2][1]' > arr=( one two three ) > echo $ref > echo ${ref} > ref=Z > typeset -p arr > > Only case where the second subscript works is when ref is in braces. Hmm ... I think that has something to do with this: % arr[2]=two % arr[2][1]=Z zsh: no matches found: arr[2][1]=Z That is, there's a level deeper than where namerefs operate that doesn't parse past the first subscript. I'm not sure how hard to work on that (or if we even want the latter case to work). I'll keep a note of it, though.