summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2020-01-23 14:17:37 -0700
committerKarl Williamson <khw@cpan.org>2020-01-23 15:46:56 -0700
commit3b34e85be6e52776818bf176a474c628a4552cb3 (patch)
tree2af4ea251a1cdaf6f7a0827af84a12a7cd0ed119
parent8d1e72f0f234299a86ddd5ce728d7cff6b44a547 (diff)
downloadperl-3b34e85be6e52776818bf176a474c628a4552cb3.tar.gz
Revise \o{ missing '}' error message
All the other messages raised when a construct is expecting a terminating '}' but none is found include the '}' in the message. '\o{' did not. Since these diagnostics are getting revised anyway, and I didn't find any CPAN modules relying on the wording, this commit makes the messages consistent by adding the '}' to the \o message.
-rw-r--r--dquote.c5
-rw-r--r--t/lib/warnings/toke2
-rw-r--r--t/re/reg_mesg.t14
3 files changed, 9 insertions, 12 deletions
diff --git a/dquote.c b/dquote.c
index 4c688b694f..c032198529 100644
--- a/dquote.c
+++ b/dquote.c
@@ -297,7 +297,7 @@ Perl_grok_bslash_o(pTHX_ char **s, const char * const send, UV *uv,
while (isOCTAL(**s)) { /* Position beyond the legal digits */
(*s)++;
}
- *message = "Missing right brace on \\o{";
+ *message = "Missing right brace on \\o{}";
return FALSE;
}
@@ -459,9 +459,6 @@ Perl_grok_bslash_x(pTHX_ char ** s, const char * const send, UV *uv,
while (*s < send && isXDIGIT(**s)) { /* Position beyond legal digits */
(*s)++;
}
- /* XXX The corresponding message above for \o is just '\\o{'; other
- * messages for other constructs include the '}', so are inconsistent.
- */
*message = "Missing right brace on \\x{}";
return FALSE;
}
diff --git a/t/lib/warnings/toke b/t/lib/warnings/toke
index e22f51ebaa..5e83286437 100644
--- a/t/lib/warnings/toke
+++ b/t/lib/warnings/toke
@@ -1368,7 +1368,7 @@ my $a = "\o{";
my $a = "\o{}";
EXPECT
Missing braces on \o{} at - line 3, within string
-Missing right brace on \o{ at - line 4, within string
+Missing right brace on \o{} at - line 4, within string
Empty \o{} at - line 5, within string
BEGIN not safe after errors--compilation aborted at - line 6.
########
diff --git a/t/re/reg_mesg.t b/t/re/reg_mesg.t
index 2793e9d95c..66ffa88bcf 100644
--- a/t/re/reg_mesg.t
+++ b/t/re/reg_mesg.t
@@ -200,11 +200,11 @@ my @death =
'/[\x{X]/' => 'Missing right brace on \x{} {#} m/[\x{{#}X]/',
'/[\x{A]/' => 'Missing right brace on \x{} {#} m/[\x{A{#}]/',
- '/\o{1/' => 'Missing right brace on \o{ {#} m/\o{1{#}/',
- '/\o{X/' => 'Missing right brace on \o{ {#} m/\o{{#}X/',
+ '/\o{1/' => 'Missing right brace on \o{} {#} m/\o{1{#}/',
+ '/\o{X/' => 'Missing right brace on \o{} {#} m/\o{{#}X/',
- '/[\o{X]/' => 'Missing right brace on \o{ {#} m/[\o{{#}X]/',
- '/[\o{7]/' => 'Missing right brace on \o{ {#} m/[\o{7{#}]/',
+ '/[\o{X]/' => 'Missing right brace on \o{} {#} m/[\o{{#}X]/',
+ '/[\o{7]/' => 'Missing right brace on \o{} {#} m/[\o{7{#}]/',
'/[[:barf:]]/' => 'POSIX class [:barf:] unknown {#} m/[[:barf:]{#}]/',
@@ -263,10 +263,10 @@ my @death =
'm/(?[[^\N{LATIN CAPITAL LETTER A WITH MACRON AND GRAVE}]])/' => '\N{} here is restricted to one character {#} m/(?[[^\N{U+100.300{#}}]])/',
'm/(?[ \p{Digit} & (?^(?[ \p{Thai} | \p{Lao} ]))])/' => 'Sequence (?^(...) not recognized {#} m/(?[ \p{Digit} & (?^({#}?[ \p{Thai} | \p{Lao} ]))])/',
'm/(?[ \p{Digit} & (?(?[ \p{Thai} | \p{Lao} ]))])/' => 'Unexpected character {#} m/(?[ \p{Digit} & (?{#}(?[ \p{Thai} | \p{Lao} ]))])/',
- 'm/\o{/' => 'Missing right brace on \o{ {#} m/\o{{#}/',
+ 'm/\o{/' => 'Missing right brace on \o{} {#} m/\o{{#}/',
'm/\o/' => 'Missing braces on \o{} {#} m/\o{#}/',
'm/\o{}/' => 'Empty \o{} {#} m/\o{}{#}/',
- 'm/[\o{]/' => 'Missing right brace on \o{ {#} m/[\o{{#}]/',
+ 'm/[\o{]/' => 'Missing right brace on \o{} {#} m/[\o{{#}]/',
'm/[\o]/' => 'Missing braces on \o{} {#} m/[\o{#}]/',
'm/[\o{}]/' => 'Empty \o{} {#} m/[\o{}{#}]/',
'm/(?^-i:foo)/' => 'Sequence (?^-...) not recognized {#} m/(?^-{#}i:foo)/',
@@ -463,7 +463,7 @@ my @death_utf8 = mark_as_utf8(
'/ネ[\x{ネ]ネ/' => 'Missing right brace on \x{} {#} m/ネ[\x{{#}ネ]ネ/',
'/ネ[\x{ネ]/' => 'Missing right brace on \x{} {#} m/ネ[\x{{#}ネ]/',
- '/ネ\o{ネ/' => 'Missing right brace on \o{ {#} m/ネ\o{{#}ネ/',
+ '/ネ\o{ネ/' => 'Missing right brace on \o{} {#} m/ネ\o{{#}ネ/',
'/[ネ-a]ネ/' => 'Invalid [] range "ネ-a" {#} m/[ネ-a{#}]ネ/',