Skip to content

Commit f2d49d0

Browse files
committed
ParseXS: change error msgs argument => parameter
Several error messages complain about things like "duplicate argument" when they mean "duplicate parameter". So update these messages to be more accurate.
1 parent a9182b6 commit f2d49d0

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2087,7 +2087,7 @@ sub INPUT_handler {
20872087
(\w+ | length\(\w+\)) # name or length(name)
20882088
$
20892089
/xs
2090-
or $self->blurt("Error: invalid argument declaration '$ln'"), next;
2090+
or $self->blurt("Error: invalid parameter declaration '$ln'"), next;
20912091

20922092
# length(s) is only allowed in the XSUB's signature.
20932093
if ($var_name =~ /^length\((\w+)\)$/) {
@@ -2116,7 +2116,7 @@ sub INPUT_handler {
21162116
or (!$param->{is_synthetic} and exists $param->{type})
21172117
) {
21182118
$self->blurt(
2119-
"Error: duplicate definition of argument '$var_name' ignored");
2119+
"Error: duplicate definition of parameter '$var_name' ignored");
21202120
next;
21212121
}
21222122
$param->{in_input} = 1;
@@ -2230,7 +2230,7 @@ sub OUTPUT_handler {
22302230
#
22312231
my ($outarg, $outcode) = /^\s*(\S+)\s*(.*?)\s*$/s;
22322232

2233-
$self->blurt("Error: duplicate OUTPUT argument '$outarg' ignored"), next
2233+
$self->blurt("Error: duplicate OUTPUT parameter '$outarg' ignored"), next
22342234
if $self->{xsub_map_varname_to_seen_in_OUTPUT}->{$outarg}++;
22352235

22362236
if (!$self->{xsub_seen_RETVAL_in_OUTPUT} and $outarg eq 'RETVAL') {
@@ -2251,7 +2251,7 @@ sub OUTPUT_handler {
22512251
: $self->{xsub_sig}{names}{$outarg}{arg_num};
22522252

22532253
unless (defined $var_num) {
2254-
$self->blurt("Error: OUTPUT $outarg not an argument");
2254+
$self->blurt("Error: OUTPUT $outarg not an parameter");
22552255
next;
22562256
}
22572257

dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Node.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ sub parse {
557557
# regex doesn't work. This code path should ideally never be
558558
# reached, and indicates a design weakness in $C_arg.
559559
@param_texts = split(/\s*,\s*/, $sig_text);
560-
Warn($pxs, "Warning: cannot parse argument list '$sig_text', fallback to split");
560+
Warn($pxs, "Warning: cannot parse parameter list '$sig_text', fallback to split");
561561
}
562562
}
563563
else {
@@ -649,7 +649,7 @@ sub parse {
649649

650650
if (exists $self->{names}{$name}) {
651651
$pxs->blurt(
652-
"Error: duplicate definition of argument '$name' ignored");
652+
"Error: duplicate definition of parameter '$name' ignored");
653653
next;
654654
}
655655

dist/ExtUtils-ParseXS/t/001-basic.t

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ EOF
894894

895895
for my $var (qw(a b c alien)) {
896896
my $count = () =
897-
$stderr =~ /duplicate definition of argument '$var'/g;
897+
$stderr =~ /duplicate definition of parameter '$var'/g;
898898
is($count, 1, "One dup error for \"$var\"");
899899
}
900900
}
@@ -1190,7 +1190,7 @@ EOF
11901190
'int',
11911191
'X::Y::f1(THIS, int i)',
11921192
],
1193-
[ 1, 0, qr/\QError: duplicate definition of argument 'THIS' /,
1193+
[ 1, 0, qr/\QError: duplicate definition of parameter 'THIS' /,
11941194
"C++: f1 dup THIS" ],
11951195
],
11961196

@@ -1200,7 +1200,7 @@ EOF
12001200
'int',
12011201
'X::Y::f2(int THIS, int i)',
12021202
],
1203-
[ 1, 0, qr/\QError: duplicate definition of argument 'THIS' /,
1203+
[ 1, 0, qr/\QError: duplicate definition of parameter 'THIS' /,
12041204
"C++: f2 dup THIS" ],
12051205
],
12061206

@@ -1210,7 +1210,7 @@ EOF
12101210
'int',
12111211
'X::Y::new(int CLASS, int i)',
12121212
],
1213-
[ 1, 0, qr/\QError: duplicate definition of argument 'CLASS' /,
1213+
[ 1, 0, qr/\QError: duplicate definition of parameter 'CLASS' /,
12141214
"C++: new dup CLASS" ],
12151215
],
12161216

@@ -1251,7 +1251,7 @@ EOF
12511251
' int THIS',
12521252
' long THIS',
12531253
],
1254-
[ 1, 0, qr/\QError: duplicate definition of argument 'THIS'/,
1254+
[ 1, 0, qr/\QError: duplicate definition of parameter 'THIS'/,
12551255
"dup err" ],
12561256
],
12571257

@@ -1262,7 +1262,7 @@ EOF
12621262
'int',
12631263
'X::Y::f6(int THIS)',
12641264
],
1265-
[ 1, 0, qr/\QError: duplicate definition of argument 'THIS'/,
1265+
[ 1, 0, qr/\QError: duplicate definition of parameter 'THIS'/,
12661266
"dup err" ],
12671267
],
12681268

@@ -1273,7 +1273,7 @@ EOF
12731273
'int',
12741274
'X::Y::f7(THIS)',
12751275
],
1276-
[ 1, 0, qr/\QError: duplicate definition of argument 'THIS'/,
1276+
[ 1, 0, qr/\QError: duplicate definition of parameter 'THIS'/,
12771277
"dup err" ],
12781278
],
12791279

@@ -1300,7 +1300,7 @@ EOF
13001300
' int CLASS',
13011301
' long CLASS',
13021302
],
1303-
[ 1, 0, qr/\QError: duplicate definition of argument 'CLASS'/,
1303+
[ 1, 0, qr/\QError: duplicate definition of parameter 'CLASS'/,
13041304
"dup err" ],
13051305
],
13061306

@@ -1311,7 +1311,7 @@ EOF
13111311
'int',
13121312
'X::Y::new(int CLASS)',
13131313
],
1314-
[ 1, 0, qr/\QError: duplicate definition of argument 'CLASS'/,
1314+
[ 1, 0, qr/\QError: duplicate definition of parameter 'CLASS'/,
13151315
"dup err" ],
13161316
],
13171317

@@ -1322,7 +1322,7 @@ EOF
13221322
'int',
13231323
'X::Y::new(CLASS)',
13241324
],
1325-
[ 1, 0, qr/\QError: duplicate definition of argument 'CLASS'/,
1325+
[ 1, 0, qr/\QError: duplicate definition of parameter 'CLASS'/,
13261326
"dup err" ],
13271327
],
13281328

0 commit comments

Comments
 (0)