From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x334.google.com (mail-ot1-x334.google.com [IPv6:2607:f8b0:4864:20::334]) by sourceware.org (Postfix) with ESMTPS id 833E33858D1E; Tue, 20 Jun 2023 10:59:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 833E33858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ot1-x334.google.com with SMTP id 46e09a7af769-6b46f27f562so1722094a34.0; Tue, 20 Jun 2023 03:59:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687258749; x=1689850749; 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=zFKzEh3tc14kir0XChL+wF4Lgdf6JH6apXuBrhLE0R0=; b=P+ZC2hDaE2Dp7um2HE+RODb687kIeYOVxdrQhLDFUMxKRv35IFlzh07hsHLEoQ9dia bCcWhyYsRDUC3pyahbkv7ybYpqeJHDwfX0zPMDcONR124IEwlko/ZpROS+srDH5Wx5qu h2HhSkNnli/11tzy16KeB442/2a9yFbU4V8AQ1qkpw+sNdmB3w3gA075HdWf3XX8VDlU CC0uQM9u8RmutakPzWtYXDmMDxOewC0KOWy5Vb9/8u6tQMCnBy236tUnfthfo+JIrImW rcoxpY4ocvnGzfr5VW/Naf3/Ni7h18CjxwAbDSW4vzx9yRy7rSKln6cXxkI/nJC9J4KL gRoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687258749; x=1689850749; 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=zFKzEh3tc14kir0XChL+wF4Lgdf6JH6apXuBrhLE0R0=; b=gnxC55fZ8TId6C37NaxmqSQYgpApsJ0sLSqrwajb51Gd1ObXUoXZynmmN/LKx/H2/x vOzyYIjh9M4Y72D1GEvjYQpwrytNjlQsRnRDJyQlLeT9LGfjEaFMJCTp5GNp/cupkscx 281kofi74cK28p8wV+dn/VZIpUIaRQXerx0ONMgoiK8uw/i9n4K8sF4zqG+w3fTurr7z 2gx/5TNa31W69X3mgsfzK4n8fZIHdHN2L4/ITLwPRi6YEnT816dR3WbB9yF2kbVvJ8xa KejRY/2Ob+NcpsnwOC6Af2TN7qFPyp/lMcWvC1beP2wjUv2yyruDWTETEkDKUU9yxvTZ /cmQ== X-Gm-Message-State: AC+VfDyk23x3IxL+uVp+9iytAOkFVy7q5mIg5RETu19P3WFIr8O0TTkD uggveXc2lYEN7bJilYObJnKDST1TVyTU/vHcIjMJs5gs X-Google-Smtp-Source: ACHHUZ5scTHwxoCrUztQUHsmAi4PdDyQaqTDLDYnw/yEnB32v5jIB71339AAux/y1GIFGmLbQolVZlFKQm2CRjyMJlk= X-Received: by 2002:a05:6808:15a3:b0:39e:bfe9:6384 with SMTP id t35-20020a05680815a300b0039ebfe96384mr7705004oiw.0.1687258748627; Tue, 20 Jun 2023 03:59:08 -0700 (PDT) MIME-Version: 1.0 References: <7e2f6b2d-b1e2-8aed-f9ea-11f5a72c5794@codesourcery.com> In-Reply-To: <7e2f6b2d-b1e2-8aed-f9ea-11f5a72c5794@codesourcery.com> From: Paul Richard Thomas Date: Tue, 20 Jun 2023 11:58:57 +0100 Message-ID: Subject: Re: [Patch] Fortran's gfc_match_char: %S to match symbol with host_assoc To: Tobias Burnus Cc: gcc-patches , fortran Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Tobias, This looks good to me. I'm interested to see it in use :-) OK for trunk Paul On Tue, 20 Jun 2023 at 11:50, Tobias Burnus wrote= : > > When just matching a symbol, one can use 'gfc_match_symbol (&sym, host_as= soc)' > and has the option to match with and without host association. > > However, when matching something more complex via 'gfc_match' like > "something ( %s ) , " the match uses host_assoc =3D false. > While it can be combined ("something (" + symbol + " ) ,"), this requires > keeping track of the previous location and resetting it. > > It seems to be much simply to add a new flag supporting host_assoc =3D tr= ue, > which this patch does (using '%S'). The advantage is also that when looki= ng > at the comment or at the "%s" implementation, it is clear that there are = two > variants, making it less likely to choose the wrong matching. > > OK for mainline? > > Tobias > > PS: I will use it in an upcoming OpenMP to parse 'uses_allocators'. > ----------------- > Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe 2= 01, 80634 M=C3=BCnchen; Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch= =C3=A4ftsf=C3=BChrer: Thomas Heurung, Frank Th=C3=BCrauf; Sitz der Gesellsc= haft: M=C3=BCnchen; Registergericht M=C3=BCnchen, HRB 106955 --=20 "If you can't explain it simply, you don't understand it well enough" - Albert Einstein