mirror of
https://github.com/janet-lang/janet
synced 2025-05-02 15:34:15 +00:00
Pluralize arity compile warning.
This commit is contained in:
parent
2ca9300bf7
commit
665b1e68d5
@ -439,22 +439,22 @@ static JanetSlot janetc_call(JanetFopts opts, JanetSlot *slots, JanetSlot fun) {
|
|||||||
min_arity = -1 - min_arity;
|
min_arity = -1 - min_arity;
|
||||||
if (min_arity > max && max >= 0) {
|
if (min_arity > max && max >= 0) {
|
||||||
const uint8_t *es = janet_formatc(
|
const uint8_t *es = janet_formatc(
|
||||||
"%v expects at most %d argument, got at least %d",
|
"%v expects at most %d argument%s, got at least %d",
|
||||||
fun.constant, max, min_arity);
|
fun.constant, max, max == 1 ? "" : "s", min_arity);
|
||||||
janetc_error(c, es);
|
janetc_error(c, es);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Call has no splices */
|
/* Call has no splices */
|
||||||
if (min_arity > max && max >= 0) {
|
if (min_arity > max && max >= 0) {
|
||||||
const uint8_t *es = janet_formatc(
|
const uint8_t *es = janet_formatc(
|
||||||
"%v expects at most %d argument, got %d",
|
"%v expects at most %d argument%s, got %d",
|
||||||
fun.constant, max, min_arity);
|
fun.constant, max, max == 1 ? "" : "s", min_arity);
|
||||||
janetc_error(c, es);
|
janetc_error(c, es);
|
||||||
}
|
}
|
||||||
if (min_arity < min) {
|
if (min_arity < min) {
|
||||||
const uint8_t *es = janet_formatc(
|
const uint8_t *es = janet_formatc(
|
||||||
"%v expects at least %d argument, got %d",
|
"%v expects at least %d argument%s, got %d",
|
||||||
fun.constant, min, min_arity);
|
fun.constant, min, min == 1 ? "" : "s", min_arity);
|
||||||
janetc_error(c, es);
|
janetc_error(c, es);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user