public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-4590] Fortran: Replace simple '.' quotes by %<.%>
@ 2022-12-10 7:34 Tobias Burnus
0 siblings, 0 replies; only message in thread
From: Tobias Burnus @ 2022-12-10 7:34 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:84f6f8a2a97f88be01e223c9c9dbab801a4f501f
commit r13-4590-g84f6f8a2a97f88be01e223c9c9dbab801a4f501f
Author: Tobias Burnus <tobias@codesourcery.com>
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 %<constructs%>, %<device%>, %<implementation%> "
+ "or %<user%> 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 %<match%> 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 %<allocate%> 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 %<q%> 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;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-12-10 7:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-10 7:34 [gcc r13-4590] Fortran: Replace simple '.' quotes by %<.%> Tobias Burnus
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).