From 0c96c706fef52effd833861ae408c0cedef51125 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Tue, 12 Apr 2011 11:25:37 -0600 Subject: [PATCH] PATCH: [perl #86972]: Tweak error messages An earlier commit in this series changed some error messages. I realized that it did not make sense really to use "/a" for the regex modifier, when the message was for the infix form "(?a:", so this just removes the slash. --- regcomp.c | 6 +++--- t/re/reg_mesg.t | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/regcomp.c b/regcomp.c index 8cad5b1..e37bc46 100644 --- a/regcomp.c +++ b/regcomp.c @@ -7140,13 +7140,13 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 *flagp,U32 depth) excess_modifier: RExC_parse++; if (has_charset_modifier == ASCII_RESTRICT_PAT_MOD) { - vFAIL2("Regexp modifier \"/%c\" may appear a maximum of twice", ASCII_RESTRICT_PAT_MOD); + vFAIL2("Regexp modifier \"%c\" may appear a maximum of twice", ASCII_RESTRICT_PAT_MOD); } else if (has_charset_modifier == *(RExC_parse - 1)) { - vFAIL2("Regexp modifier \"/%c\" may not appear twice", *(RExC_parse - 1)); + vFAIL2("Regexp modifier \"%c\" may not appear twice", *(RExC_parse - 1)); } else { - vFAIL3("Regexp modifiers \"/%c\" and \"/%c\" are mutually exclusive", has_charset_modifier, *(RExC_parse - 1)); + vFAIL3("Regexp modifiers \"%c\" and \"%c\" are mutually exclusive", has_charset_modifier, *(RExC_parse - 1)); } /*NOTREACHED*/ case ONCE_PAT_MOD: /* 'o' */ diff --git a/t/re/reg_mesg.t b/t/re/reg_mesg.t index 827900f..976798c 100644 --- a/t/re/reg_mesg.t +++ b/t/re/reg_mesg.t @@ -64,11 +64,11 @@ my @death = '/(?^-i)foo/' => 'Sequence (?^-...) not recognized in regex; marked by {#} in m/(?^-{#}i)foo/', '/(?^d:foo)/' => 'Sequence (?^d...) not recognized in regex; marked by {#} in m/(?^d{#}:foo)/', '/(?^d)foo/' => 'Sequence (?^d...) not recognized in regex; marked by {#} in m/(?^d{#})foo/', - '/(?^lu:foo)/' => 'Regexp modifiers "/l" and "/u" are mutually exclusive in regex; marked by {#} in m/(?^lu{#}:foo)/', - '/(?^lu)foo/' => 'Regexp modifiers "/l" and "/u" are mutually exclusive in regex; marked by {#} in m/(?^lu{#})foo/', -'/(?da:foo)/' => 'Regexp modifiers "/d" and "/a" are mutually exclusive in regex; marked by {#} in m/(?da{#}:foo)/', -'/(?lil:foo)/' => 'Regexp modifier "/l" may not appear twice in regex; marked by {#} in m/(?lil{#}:foo)/', -'/(?aaia:foo)/' => 'Regexp modifier "/a" may appear a maximum of twice in regex; marked by {#} in m/(?aaia{#}:foo)/', + '/(?^lu:foo)/' => 'Regexp modifiers "l" and "u" are mutually exclusive in regex; marked by {#} in m/(?^lu{#}:foo)/', + '/(?^lu)foo/' => 'Regexp modifiers "l" and "u" are mutually exclusive in regex; marked by {#} in m/(?^lu{#})foo/', +'/(?da:foo)/' => 'Regexp modifiers "d" and "a" are mutually exclusive in regex; marked by {#} in m/(?da{#}:foo)/', +'/(?lil:foo)/' => 'Regexp modifier "l" may not appear twice in regex; marked by {#} in m/(?lil{#}:foo)/', +'/(?aaia:foo)/' => 'Regexp modifier "a" may appear a maximum of twice in regex; marked by {#} in m/(?aaia{#}:foo)/', '/((x)/' => 'Unmatched ( in regex; marked by {#} in m/({#}(x)/', -- 2.7.4