From patchwork Fri Dec 9 21:12:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 61736 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9239F38896C1 for ; Fri, 9 Dec 2022 21:13:22 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by sourceware.org (Postfix) with ESMTPS id F41E0387220B; Fri, 9 Dec 2022 21:13:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F41E0387220B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.96,232,1665475200"; d="diff'?scan'208";a="89158021" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa4.mentor.iphmx.com with ESMTP; 09 Dec 2022 13:12:54 -0800 IronPort-SDR: MF2nmN9kV/XoLNnVAf+r/Ukv4sHkE7wdlVKN/M+F8C7A11daNJlDc+W3AA+4skt8a51PEDbg0d BaQ4edmdU0QY7J2aCrqx8SZTSfVH9Ww7QFzgc1E1m6jiFRfJZaf2a+1j81sf2R14cGWZsUO+48 f5F84SUM9UlmoMMR7Ygn+f+pMF4m1nus1+TqEVTaloPa56aFFmnB2gHT2RLGsyFbjwVVVqd4Tw dMhuFfdYnifaSgKLZ2zBOIrP3OxoNHEXM2tjc5mX7BqE+IJP5we2m4bkEt5JND8dZVfne0xr2k 4mM= Message-ID: <091af345-e484-7cca-e7df-b31bffbbe293@codesourcery.com> Date: Fri, 9 Dec 2022 22:12:47 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Content-Language: en-US To: gcc-patches , fortran From: Tobias Burnus Subject: [Patch] Fortran: Replace simple '.' quotes by %<.%> X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-09.mgc.mentorg.com (139.181.222.9) To svr-ies-mbx-12.mgc.mentorg.com (139.181.222.12) X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Found when working on the just submitted/committed patch. I intent to commit it to mainline as obvious tomorrow (or Sun or Mon), unless there are comments. Tobias ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955 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 --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 @@ -195,3 +195,3 @@ gfc_match_member_sep(gfc_symbol *sym) 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 @@ -4061,3 +4061,3 @@ gfc_match_oacc_routine (void) gfc_error ("Syntax error in !$ACC ROUTINE ( NAME ) at %C, expecting" - " ')' after NAME"); + " %<)%> after NAME"); gfc_current_locus = old_loc; @@ -5350,4 +5350,4 @@ gfc_match_omp_context_selector (gfc_omp_set_selector *oss) { - 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); @@ -5370,3 +5370,3 @@ gfc_match_omp_context_selector (gfc_omp_set_selector *oss) { - gfc_error ("selector '%s' does not accept any properties at %C", + gfc_error ("selector %qs does not accept any properties at %C", selector); @@ -5379,3 +5379,3 @@ gfc_match_omp_context_selector (gfc_omp_set_selector *oss) { - gfc_error ("expected '(' at %C"); + gfc_error ("expected %<(%> at %C"); return MATCH_ERROR; @@ -5401,3 +5401,3 @@ gfc_match_omp_context_selector (gfc_omp_set_selector *oss) { - gfc_error ("expected ')' at %C"); + gfc_error ("expected %<)%> at %C"); return MATCH_ERROR; @@ -5514,3 +5514,3 @@ gfc_match_omp_context_selector (gfc_omp_set_selector *oss) { - gfc_error ("expected ')' at %C"); + gfc_error ("expected %<)%> at %C"); return MATCH_ERROR; @@ -5524,3 +5524,3 @@ gfc_match_omp_context_selector (gfc_omp_set_selector *oss) { - gfc_error ("expected '(' at %C"); + gfc_error ("expected %<(%> at %C"); return MATCH_ERROR; @@ -5570,4 +5570,4 @@ gfc_match_omp_context_selector_specification (gfc_omp_declare_variant *odv) { - gfc_error ("expected 'construct', 'device', 'implementation' or " - "'user' at %C"); + gfc_error ("expected %, %, % " + "or % at %C"); return MATCH_ERROR; @@ -5578,3 +5578,3 @@ gfc_match_omp_context_selector_specification (gfc_omp_declare_variant *odv) { - gfc_error ("expected '=' at %C"); + gfc_error ("expected %<=%> at %C"); return MATCH_ERROR; @@ -5585,3 +5585,3 @@ gfc_match_omp_context_selector_specification (gfc_omp_declare_variant *odv) { - gfc_error ("expected '{' at %C"); + gfc_error ("expected %<{%> at %C"); return MATCH_ERROR; @@ -5600,3 +5600,3 @@ gfc_match_omp_context_selector_specification (gfc_omp_declare_variant *odv) { - gfc_error ("expected '}' at %C"); + gfc_error ("expected %<}%> at %C"); return MATCH_ERROR; @@ -5622,3 +5622,3 @@ gfc_match_omp_declare_variant (void) { - gfc_error ("expected '(' at %C"); + gfc_error ("expected %<(%> at %C"); return MATCH_ERROR; @@ -5670,3 +5670,3 @@ gfc_match_omp_declare_variant (void) { - gfc_error ("expected ')' at %C"); + gfc_error ("expected %<)%> at %C"); return MATCH_ERROR; @@ -5680,3 +5680,3 @@ gfc_match_omp_declare_variant (void) { - gfc_error ("expected 'match' at %C"); + gfc_error ("expected % at %C"); return MATCH_ERROR; @@ -5689,3 +5689,3 @@ gfc_match_omp_declare_variant (void) { - gfc_error ("expected '(' at %C"); + gfc_error ("expected %<(%> at %C"); return MATCH_ERROR; @@ -5698,3 +5698,3 @@ gfc_match_omp_declare_variant (void) { - gfc_error ("expected ')' at %C"); + gfc_error ("expected %<)%> at %C"); return MATCH_ERROR; @@ -7380,3 +7380,3 @@ resolve_omp_clauses (gfc_code *code, gfc_omp_clauses *omp_clauses, 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", 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 @@ -588,3 +588,3 @@ match_real_constant (gfc_expr **result, int signflag) { - 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")) @@ -2072,4 +2072,4 @@ gfc_match_varspec (gfc_expr *primary, int equiv_flag, bool sub_flag, { - 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; diff --git a/gcc/fortran/resolve.cc b/gcc/fortran/resolve.cc index 75dc4b59105..5f746d2244a 100644 --- a/gcc/fortran/resolve.cc +++ b/gcc/fortran/resolve.cc @@ -516,3 +516,3 @@ gfc_resolve_formal_arglist (gfc_symbol *proc) 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, @@ -4383,4 +4383,4 @@ resolve_operator (gfc_expr *e) 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 @@ -8214,3 +8214,3 @@ check_symbols: { - gfc_error ("Expected '*' in coindex specification in ALLOCATE " + gfc_error ("Expected %<*%> in coindex specification in ALLOCATE " "statement at %L", &e->where); @@ -11188,3 +11188,3 @@ resolve_ordinary_assign (gfc_code *code, gfc_namespace *ns) "assignment at %L - check that there is a matching specific " - "subroutine for '=' operator", &lhs->where); + "subroutine for %<=%> operator", &lhs->where); return false;