diff --git a/src/core/peg.c b/src/core/peg.c index fa7aef20..11504cda 100644 --- a/src/core/peg.c +++ b/src/core/peg.c @@ -735,12 +735,6 @@ static const uint8_t *peg_getrange(Builder *b, Janet x) { return str; } -static int32_t peg_getboolean(Builder *b, Janet x) { - if (!janet_checktype(x, JANET_BOOLEAN)) - peg_panicf(b, "expected boolean, got %v", x); - return janet_unwrap_boolean(x); -} - static int32_t peg_getinteger(Builder *b, Janet x) { if (!janet_checkint(x)) peg_panicf(b, "expected integer, got %v", x); @@ -1269,7 +1263,7 @@ static uint32_t peg_compile1(Builder *b, Janet peg) { return 0; case JANET_BOOLEAN: { - int n = peg_getboolean(b, peg); + int n = janet_unwrap_boolean(peg); Reserve r = reserve(b, 2); emit_1(r, n ? RULE_NCHAR : RULE_NOTNCHAR, 0); break;