From 665b1e68d5b53cb294f7752c5e7c8f40f8d9fec9 Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Sun, 3 Jan 2021 20:15:51 -0600 Subject: [PATCH] Pluralize arity compile warning. --- src/core/compile.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/core/compile.c b/src/core/compile.c index 57c9cbe2..a1733d71 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -439,22 +439,22 @@ static JanetSlot janetc_call(JanetFopts opts, JanetSlot *slots, JanetSlot fun) { min_arity = -1 - min_arity; if (min_arity > max && max >= 0) { const uint8_t *es = janet_formatc( - "%v expects at most %d argument, got at least %d", - fun.constant, max, min_arity); + "%v expects at most %d argument%s, got at least %d", + fun.constant, max, max == 1 ? "" : "s", min_arity); janetc_error(c, es); } } else { /* Call has no splices */ if (min_arity > max && max >= 0) { const uint8_t *es = janet_formatc( - "%v expects at most %d argument, got %d", - fun.constant, max, min_arity); + "%v expects at most %d argument%s, got %d", + fun.constant, max, max == 1 ? "" : "s", min_arity); janetc_error(c, es); } if (min_arity < min) { const uint8_t *es = janet_formatc( - "%v expects at least %d argument, got %d", - fun.constant, min, min_arity); + "%v expects at least %d argument%s, got %d", + fun.constant, min, min == 1 ? "" : "s", min_arity); janetc_error(c, es); } }