Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Change message for mismatch between specified arguments in directives…
  • Loading branch information
usev6 committed Jan 24, 2015
1 parent 4553a0e commit 878c6ae
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/HLL/sprintf.nqp
Expand Up @@ -59,14 +59,14 @@ my module sprintf {
my @statements;
@statements.push( $_.made ) for $<statement>;

if $assert_used_args && $*ARGS_USED < +@*ARGS_HAVE {
nqp::die("Too few directives: found $*ARGS_USED,"
~ " fewer than the " ~ +@*ARGS_HAVE ~ " arguments after the format string")
}
if $*ARGS_USED > +@*ARGS_HAVE {
nqp::die("Too many directives: found $*ARGS_USED, but "
~ (+@*ARGS_HAVE > 0 ?? "only " ~ +@*ARGS_HAVE !! "no")
~ " arguments after the format string")
if ($assert_used_args && $*ARGS_USED < +@*ARGS_HAVE) || ($*ARGS_USED > +@*ARGS_HAVE) {
nqp::die("Directives specify "
~ ($*ARGS_USED == 1 ?? "1 argument, but "
!! "$*ARGS_USED arguments, but ")
~ (+@*ARGS_HAVE < 1 ?? "no argument was"
!! +@*ARGS_HAVE == 1 ?? "1 argument was"
!! +@*ARGS_HAVE ~ " arguments were")
~ " supplied")
}
make nqp::join('', @statements);
}
Expand Down

0 comments on commit 878c6ae

Please sign in to comment.