diff options
author | Tobias Burnus <tobias@codesourcery.com> | 2023-06-20 13:23:40 +0200 |
---|---|---|
committer | Tobias Burnus <tobias@codesourcery.com> | 2023-06-20 13:23:40 +0200 |
commit | 0607e93490058ec31b6ab57078c54771f139b870 (patch) | |
tree | 7fe3372ce1d5736c933c60d35a19a3d08d1925c6 | |
parent | 9d597e00757eedfb6b6cf5e0b5138b8029aeb28e (diff) | |
download | gcc-0607e93490058ec31b6ab57078c54771f139b870.zip gcc-0607e93490058ec31b6ab57078c54771f139b870.tar.gz gcc-0607e93490058ec31b6ab57078c54771f139b870.tar.bz2 |
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.
-rw-r--r-- | gcc/fortran/match.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/fortran/match.cc b/gcc/fortran/match.cc index e7be7fd..1203787 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; |