public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Tobias Burnus <burnus@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r14-1983] Fortran's gfc_match_char: %S to match symbol with host_assoc
Date: Tue, 20 Jun 2023 11:23:53 +0000 (GMT)	[thread overview]
Message-ID: <20230620112353.3E22E3858D1E@sourceware.org> (raw)

https://gcc.gnu.org/g:0607e93490058ec31b6ab57078c54771f139b870

commit r14-1983-g0607e93490058ec31b6ab57078c54771f139b870
Author: Tobias Burnus <tobias@codesourcery.com>
Date:   Tue Jun 20 13:23:40 2023 +0200

    Fortran's gfc_match_char: %S to match symbol with host_assoc
    
    gfc_match ("... %s ...", ...) matches a gfc_symbol but with
    host_assoc = 0. This commit adds '%S' as variant which matches
    with host_assoc = 1
    
    gcc/fortran/ChangeLog:
    
            * match.cc (gfc_match_char): Match with '%S' a symbol
            with host_assoc = 1.

Diff:
---
 gcc/fortran/match.cc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gcc/fortran/match.cc b/gcc/fortran/match.cc
index e7be7fddc64..1203787fe77 100644
--- a/gcc/fortran/match.cc
+++ b/gcc/fortran/match.cc
@@ -1084,7 +1084,8 @@ gfc_match_char (char c, bool gobble_ws)
 
    %%  Literal percent sign
    %e  Expression, pointer to a pointer is set
-   %s  Symbol, pointer to the symbol is set
+   %s  Symbol, pointer to the symbol is set (host_assoc = 0)
+   %S  Symbol, pointer to the symbol is set (host_assoc = 1)
    %n  Name, character buffer is set to name
    %t  Matches end of statement.
    %o  Matches an intrinsic operator, returned as an INTRINSIC enum.
@@ -1151,8 +1152,9 @@ loop:
 	  goto loop;
 
 	case 's':
+	case 'S':
 	  vp = va_arg (argp, void **);
-	  n = gfc_match_symbol ((gfc_symbol **) vp, 0);
+	  n = gfc_match_symbol ((gfc_symbol **) vp, c == 'S');
 	  if (n != MATCH_YES)
 	    {
 	      m = n;

                 reply	other threads:[~2023-06-20 11:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230620112353.3E22E3858D1E@sourceware.org \
    --to=burnus@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).