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.
This commit is contained in:
Tobias Burnus 2022-12-10 08:34:04 +01:00
parent 325529e21e
commit 84f6f8a2a9
4 changed files with 28 additions and 28 deletions

View File

@ -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;
}

View File

@ -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);
}

View File

@ -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)

View File

@ -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;
}