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 8975 invoked from network); 31 Oct 2023 03:27:10 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 31 Oct 2023 03:27:10 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1698722831; b=R7Uy//+2rtp82y4E0xZp6n+mSmVTNLimbfvtXyc9yZYQBh0auLPukDK6rjKV7zxQ/BEe1rOi9L SN3v8KInhy1fSCgDFAuFvysCdUVBqi9puEV/gZwQnI4P1VZnrynQzLGPNfw5e+8d0BwfXJ3vby Bnlvno6UmH3o38kF47aEtaQG6Zjrx0ibFUI/bML3dyrHtgqGPJE2tout6fwSnu+2EfvaindqoV 0O0+KP59n0eGotArreJ8/L6egJTmS2p2kV06J81HwXZ9myeR1wxGVs+OGm99VXLSC3w4VH9oxQ 1JB6U5i/stOSk8QmlMvb5E/TXfYUVeYJ0DK/iJNLym4I4g==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ej1-f53.google.com) smtp.remote-ip=209.85.218.53; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 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=1698722831; bh=vyDpt55IXViHYVaX05tmJNy9600nve1QSlBESGzVVX4=; 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:In-Reply-To:References:MIME-Version:DKIM-Signature: DKIM-Signature; b=jhB21PRu3otLlpMT4GVWilQgAJXIAYt8VYCRpyNGQa2GhS/c6ZYfhkUPmJtDGkzjkmVvDd12Yh 0AOginBRX63D4dBneveiMD5PmF48mMcr5FxqLJQJLoXI+tm2N1KDXsw42vXJjpDJESZMF/gwIU YsjCdk/2aiH2GkCWA0gSwOEc9P/dh60og5dX0YEmLPCUsZQHuompfLfQwUpjoim8VHkFxN6Gd1 kwau+jmnn6GbEEYKurIrbsHv1Hu0+CnB6DvrNr0OBCPMFxoaZ5bJd/7/hCIxKbElZytAfJMrbZ Yl2+Kgun4/Tq+Rv8Ol7/b3l7r1mnadhbg8SRnLdl2AQRQQ==; 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:In-Reply-To:References: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=O6K1NBYU30SBFN9Z9qf66IS6Kma7eOyK0J2widC1K+U=; b=jVuJllbSzF1Nbea9PkQAFHVXfS 7sSMSQ01BEr7liQwpelCc6+/7Z5NB531lp3v+rS+qd0cgFm/HU63CqeqVhTc3ZN4EQKxpsTIC5K/3 DMvQw8SlZ8CKZxKAIVZCwcBTXXpluaDfXHYJXtVps2L3+CiihU6FPL+hQiuRw+Fol4LaOdfldYKa0 Od32zyxLXdk3K6+xf6rdVbCkUy23sAynPGg5CUOtsNQPnDndVUFoqYRqjwDqJoOpeg68pqc3nT9go jBxqJkIAqpJc0R+4AVMG0hB62z9KdyBTc5qu77yXGcD9VQFPiKO3Z5zCSBSa2gSp1Pf4jbp6+ud/n moTxnppg==; Received: by zero.zsh.org with local id 1qxfPJ-000BD5-Fy; Tue, 31 Oct 2023 03:27:09 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ej1-f53.google.com) smtp.remote-ip=209.85.218.53; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ej1-f53.google.com ([209.85.218.53]:46375) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1qxfP0-000Avk-5h; Tue, 31 Oct 2023 03:26:52 +0000 Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-9c53e8b7cf4so773462366b.1 for ; Mon, 30 Oct 2023 20:26:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20230601.gappssmtp.com; s=20230601; t=1698722809; x=1699327609; darn=zsh.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=O6K1NBYU30SBFN9Z9qf66IS6Kma7eOyK0J2widC1K+U=; b=qgVglJlQitKrR2e1bTRbo1+WtOc0qo968/BkI4FYzZUgHl3z91aC465oreB5pKENzm R7vGL1RpvR/hYyanPLBkXjDv+dVhw9OddAx3w+m5w2cq4eL3fWzCYiXnhkkTt0BTUvNO PHMK4Awsq0+zgRxXLHCNWiNUS+2NsOHhgtTEZVokwPhqgVUETCr00J38TFWMuyfXPtoC dogbrgSZEnFJOzXhKegp7/XNgu1/65twW/P+OqekZo/cZKsnFuSWwZJOnOonbuQSXqhk 5C+w9AljAq8aKZuM/IzvHVnFN4zQ7IVc99vcEWrBlZDEDtGmZt2z/hViej1iKgTcLnd2 uc/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698722809; x=1699327609; h=content-transfer-encoding:cc: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=O6K1NBYU30SBFN9Z9qf66IS6Kma7eOyK0J2widC1K+U=; b=fIlWoqZmSi1pDN9Qrv4tTRI2h41l7Og6Ba8IxQu51DYgPWEpA7xJCqelnT6GBN0nA5 Bkv1CH5LFWiLFNN66JH9XE63IDGFT1ArRZpJcGg/w/d16aa3NMbeQof1IyX8SCOdJi3y MvE+jtO4nCI7UcuM0kNIp/f/uiPgrbU+CXS1QnlZfuSmwY6EhwZpKAXzq2gC6CcHl00h dLi9YJTv7o+B8JGk03HeoZugqYPxGVX9vUx5wpbC0aoQYzUqQG48Qux7sV9nvJC5hNrW 6mpuHvdLy5Ushc3ngfFpQPb0/TDPhy7xoIu8hBBoIN1rcZIRxOnDU3gTODy5P8KoKljF O3cA== X-Gm-Message-State: AOJu0YzkgUEE/lpMVkwGMHNbvTB1I1WyVCUQqNziPMWnMF8Ba/2i60ji Qa2w5TkNqhp9c28TtdRFARqsenJepcCo5JJTWlG/m7AmtDSwUtoG X-Google-Smtp-Source: AGHT+IFRhsoROaixCtRihoUzpsNbLbHsvThTDrHvswQWfpbo2y+Ti/RAyA/BBM1K3QkB2x3oDdecFu183YQ3X1VFkZs= X-Received: by 2002:a17:907:868a:b0:9a5:9f3c:9615 with SMTP id qa10-20020a170907868a00b009a59f3c9615mr8878302ejc.63.1698722809446; Mon, 30 Oct 2023 20:26:49 -0700 (PDT) MIME-Version: 1.0 References: <72311-1698710659.978677@cDMN.pAu_.Ex7V> In-Reply-To: <72311-1698710659.978677@cDMN.pAu_.Ex7V> From: Bart Schaefer Date: Mon, 30 Oct 2023 20:26:38 -0700 Message-ID: Subject: Re: PATCH: pcre callouts To: Oliver Kiddle Cc: Zsh workers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 52255 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 Mon, Oct 30, 2023 at 5:04=E2=80=AFPM Oliver Kiddle wrote: > > So, e.g. (?C{foo}) or (?C'foo') will call the foo function. In Perl, > $_ is set to the string being examined. I've used .pcre.subject. Would > something else be better You could actually use ${.pcre._} I suppose. I'm undecided on whether that's better. > and should it perhaps start and end a new scope > to make that local? We do have a precedent for that now with ${|...} creating a scope. > This won't do anything for numeric callouts. They look mostly useful for > debugging. They could perhaps call a standard function passing the > number and string as parameters. What's an example of using a number callout outside of zsh? I see you're calling parse_string() here: > + if (!block->callout_number && > + ((prog =3D parse_string((char *) block->callout_string, 0)))) How are you solving the problem of finding the end of the callout? That is, (?C{code}) looks like it would have the same parsing problems I wrestled with for ${|code}. Is it just that you can skip everything from "(?" to the matching ")" without having to worry about (un)balanced braces inside, etc.?