From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1534) id E44A0383D8F6; Sat, 10 Dec 2022 07:34:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E44A0383D8F6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1670657663; bh=QFIi+F7ivaV6Gk8gfMuFcKudkNykAmjxKyS/J2uN72A=; h=From:To:Subject:Date:From; b=dfKPLGqVyg4m+Glrl6DV/1kBKWUTwOG2am7U1erjs+TAUscpBcmdXyUqR45DjptRC JUVp/yPZiy3kex451aVo2aLY/lm5EhSPB/YRfHTME4q9pH104+V/biyO7sGDOYSvxe rGKgEqvargDL5WL/woQ9XK6X8MucwK84mE0Woixw= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Tobias Burnus To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-4590] Fortran: Replace simple '.' quotes by %<.%> X-Act-Checkin: gcc X-Git-Author: Tobias Burnus X-Git-Refname: refs/heads/master X-Git-Oldrev: 325529e21e81fbc3561d2568cb7e8a26296e5b2f X-Git-Newrev: 84f6f8a2a97f88be01e223c9c9dbab801a4f501f Message-Id: <20221210073422.E44A0383D8F6@sourceware.org> Date: Sat, 10 Dec 2022 07:34:22 +0000 (GMT) List-Id: https://gcc.gnu.org/g:84f6f8a2a97f88be01e223c9c9dbab801a4f501f commit r13-4590-g84f6f8a2a97f88be01e223c9c9dbab801a4f501f Author: Tobias Burnus Date: Sat Dec 10 08:34:04 2022 +0100 Fortran: Replace simple '.' quotes by %<.%> When using %qs instead of '%s' or %<=%> instead of '=' looks nicer by having nicer quotes and bold text, if the terminal supports it; otherwise, plain quotes are used. gcc/fortran/ChangeLog: * match.cc (gfc_match_member_sep): Use %<...%> in gfc_error. * openmp.cc (gfc_match_oacc_routine, gfc_match_omp_context_selector, gfc_match_omp_context_selector_specification, gfc_match_omp_declare_variant, resolve_omp_clauses): Likewise; use %qs instead of '%s'. * primary.cc (match_real_constant, gfc_match_varspec): Likewise. * resolve.cc (gfc_resolve_formal_arglist, resolve_operator, resolve_ordinary_assign): Likewise. Diff: --- gcc/fortran/match.cc | 2 +- gcc/fortran/openmp.cc | 38 +++++++++++++++++++------------------- gcc/fortran/primary.cc | 6 +++--- gcc/fortran/resolve.cc | 10 +++++----- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/gcc/fortran/match.cc b/gcc/fortran/match.cc index 7ba0f349993..89fb115c0f6 100644 --- a/gcc/fortran/match.cc +++ b/gcc/fortran/match.cc @@ -193,7 +193,7 @@ gfc_match_member_sep(gfc_symbol *sym) if (gfc_match_name (name) != MATCH_YES) { gfc_error ("Expected structure component or operator name " - "after '.' at %C"); + "after %<.%> at %C"); goto error; } diff --git a/gcc/fortran/openmp.cc b/gcc/fortran/openmp.cc index 4b4e6ac6947..7edc78ad0cb 100644 --- a/gcc/fortran/openmp.cc +++ b/gcc/fortran/openmp.cc @@ -4059,7 +4059,7 @@ gfc_match_oacc_routine (void) if (gfc_match_char (')') != MATCH_YES) { gfc_error ("Syntax error in !$ACC ROUTINE ( NAME ) at %C, expecting" - " ')' after NAME"); + " %<)%> after NAME"); gfc_current_locus = old_loc; return MATCH_ERROR; } @@ -5348,8 +5348,8 @@ gfc_match_omp_context_selector (gfc_omp_set_selector *oss) } else { - gfc_error ("selector '%s' not allowed for context selector " - "set '%s' at %C", + gfc_error ("selector %qs not allowed for context selector " + "set %qs at %C", selector, oss->trait_set_selector_name); return MATCH_ERROR; } @@ -5368,7 +5368,7 @@ gfc_match_omp_context_selector (gfc_omp_set_selector *oss) { if (property_kind == CTX_PROPERTY_NONE) { - gfc_error ("selector '%s' does not accept any properties at %C", + gfc_error ("selector %qs does not accept any properties at %C", selector); return MATCH_ERROR; } @@ -5377,7 +5377,7 @@ gfc_match_omp_context_selector (gfc_omp_set_selector *oss) { if (gfc_match (" (") != MATCH_YES) { - gfc_error ("expected '(' at %C"); + gfc_error ("expected %<(%> at %C"); return MATCH_ERROR; } if (gfc_match_expr (&os->score) != MATCH_YES @@ -5399,7 +5399,7 @@ gfc_match_omp_context_selector (gfc_omp_set_selector *oss) if (gfc_match (" )") != MATCH_YES) { - gfc_error ("expected ')' at %C"); + gfc_error ("expected %<)%> at %C"); return MATCH_ERROR; } @@ -5512,7 +5512,7 @@ gfc_match_omp_context_selector (gfc_omp_set_selector *oss) if (gfc_match (" )") != MATCH_YES) { - gfc_error ("expected ')' at %C"); + gfc_error ("expected %<)%> at %C"); return MATCH_ERROR; } } @@ -5522,7 +5522,7 @@ gfc_match_omp_context_selector (gfc_omp_set_selector *oss) { if (gfc_match (" (") != MATCH_YES) { - gfc_error ("expected '(' at %C"); + gfc_error ("expected %<(%> at %C"); return MATCH_ERROR; } } @@ -5568,22 +5568,22 @@ gfc_match_omp_context_selector_specification (gfc_omp_declare_variant *odv) if (m != MATCH_YES || i == selector_set_count) { - gfc_error ("expected 'construct', 'device', 'implementation' or " - "'user' at %C"); + gfc_error ("expected %, %, % " + "or % at %C"); return MATCH_ERROR; } m = gfc_match (" ="); if (m != MATCH_YES) { - gfc_error ("expected '=' at %C"); + gfc_error ("expected %<=%> at %C"); return MATCH_ERROR; } m = gfc_match (" {"); if (m != MATCH_YES) { - gfc_error ("expected '{' at %C"); + gfc_error ("expected %<{%> at %C"); return MATCH_ERROR; } @@ -5598,7 +5598,7 @@ gfc_match_omp_context_selector_specification (gfc_omp_declare_variant *odv) m = gfc_match (" }"); if (m != MATCH_YES) { - gfc_error ("expected '}' at %C"); + gfc_error ("expected %<}%> at %C"); return MATCH_ERROR; } @@ -5620,7 +5620,7 @@ gfc_match_omp_declare_variant (void) if (gfc_match (" (") != MATCH_YES) { - gfc_error ("expected '(' at %C"); + gfc_error ("expected %<(%> at %C"); return MATCH_ERROR; } @@ -5668,7 +5668,7 @@ gfc_match_omp_declare_variant (void) if (gfc_match (" )") != MATCH_YES) { - gfc_error ("expected ')' at %C"); + gfc_error ("expected %<)%> at %C"); return MATCH_ERROR; } @@ -5678,7 +5678,7 @@ gfc_match_omp_declare_variant (void) { if (first_p) { - gfc_error ("expected 'match' at %C"); + gfc_error ("expected % at %C"); return MATCH_ERROR; } else @@ -5687,7 +5687,7 @@ gfc_match_omp_declare_variant (void) if (gfc_match (" (") != MATCH_YES) { - gfc_error ("expected '(' at %C"); + gfc_error ("expected %<(%> at %C"); return MATCH_ERROR; } @@ -5696,7 +5696,7 @@ gfc_match_omp_declare_variant (void) if (gfc_match (" )") != MATCH_YES) { - gfc_error ("expected ')' at %C"); + gfc_error ("expected %<)%> at %C"); return MATCH_ERROR; } @@ -7378,7 +7378,7 @@ resolve_omp_clauses (gfc_code *code, gfc_omp_clauses *omp_clauses, for (n = omp_clauses->lists[OMP_LIST_ALLOCATE]; n; n = n->next) if (n->sym->mark == 1) - gfc_error ("%qs specified in 'allocate' clause at %L but not " + gfc_error ("%qs specified in % clause at %L but not " "in an explicit privatization clause", n->sym->name, &n->where); } diff --git a/gcc/fortran/primary.cc b/gcc/fortran/primary.cc index 19f2e78c8ff..21a8eb73c23 100644 --- a/gcc/fortran/primary.cc +++ b/gcc/fortran/primary.cc @@ -586,7 +586,7 @@ match_real_constant (gfc_expr **result, int signflag) if (c == 'q') { - if (!gfc_notify_std (GFC_STD_GNU, "exponent-letter 'q' in " + if (!gfc_notify_std (GFC_STD_GNU, "exponent-letter % in " "real-literal-constant at %C")) return MATCH_ERROR; else if (warn_real_q_constant) @@ -2070,8 +2070,8 @@ gfc_match_varspec (gfc_expr *primary, int equiv_flag, bool sub_flag, || (sym->ts.type == BT_CLASS && CLASS_DATA (sym) && CLASS_DATA (sym)->attr.dimension)) { - gfc_error ("Array section designator, e.g. '(:)', is required " - "besides the coarray designator '[...]' at %C"); + gfc_error ("Array section designator, e.g. %<(:)%>, is required " + "besides the coarray designator %<[...]%> at %C"); return MATCH_ERROR; } if ((sym->ts.type != BT_CLASS && !sym->attr.codimension) diff --git a/gcc/fortran/resolve.cc b/gcc/fortran/resolve.cc index 158bf08ec26..0f5f1d277e4 100644 --- a/gcc/fortran/resolve.cc +++ b/gcc/fortran/resolve.cc @@ -514,7 +514,7 @@ gfc_resolve_formal_arglist (gfc_symbol *proc) { /* F03:C1263 (R1238) The function-name and each dummy-arg-name shall be specified, explicitly or implicitly, to be scalar. */ - gfc_error ("Argument '%s' of statement function '%s' at %L " + gfc_error ("Argument %qs of statement function %qs at %L " "must be scalar", sym->name, proc->name, &proc->declared_at); continue; @@ -4381,8 +4381,8 @@ resolve_operator (gfc_expr *e) guessed = lookup_uop_fuzzy (name, e->value.op.uop->ns->uop_root); if (guessed) snprintf (msg, sizeof (msg), - _("Unknown operator %%<%s%%> at %%L; did you mean '%s'?"), - name, guessed); + _("Unknown operator %%<%s%%> at %%L; did you mean " + "%%<%s%%>?"), name, guessed); else snprintf (msg, sizeof (msg), _("Unknown operator %%<%s%%> at %%L"), name); @@ -8213,7 +8213,7 @@ check_symbols: { if (i == (ar->dimen + ar->codimen - 1)) { - gfc_error ("Expected '*' in coindex specification in ALLOCATE " + gfc_error ("Expected %<*%> in coindex specification in ALLOCATE " "statement at %L", &e->where); goto failure; } @@ -11187,7 +11187,7 @@ resolve_ordinary_assign (gfc_code *code, gfc_namespace *ns) { gfc_error ("Nonallocatable variable must not be polymorphic in intrinsic " "assignment at %L - check that there is a matching specific " - "subroutine for '=' operator", &lhs->where); + "subroutine for %<=%> operator", &lhs->where); return false; }