diff --git a/src/desugar.c b/src/desugar.c index ce87ca326b1d8ad533c8b9eecbaf81e4513eb488..a613644e9c5f5dab017b761000a3c6856b8393a5 100644 --- a/src/desugar.c +++ b/src/desugar.c @@ -8,7 +8,7 @@ HCFChoice *h_desugar(HAllocator *mm__, HCFStack *stk__, const HParser *parser) { if (nstk__ == NULL) { nstk__ = h_cfstack_new(mm__); } - // we're going to do something naughty and cast away the const to memoize + assert(parser->vtable->desugar != NULL); parser->vtable->desugar(mm__, nstk__, parser->env); ((HParser *)parser)->desugared = nstk__->last_completed; if (stk__ == NULL) diff --git a/src/parsers/unimplemented.c b/src/parsers/unimplemented.c index 18255ac2434c50b845b1116b702cbfaa83fc6601..7c3c6671f8946fc61dd7f33ccd5971cf00e88ed8 100644 --- a/src/parsers/unimplemented.c +++ b/src/parsers/unimplemented.c @@ -12,16 +12,10 @@ static HParseResult* parse_unimplemented(void* env, HParseState *state) { return &result; } -static HCFChoice* desugar_unimplemented(HAllocator *mm__, HCFStack *stk__, void *env) { - assert_message(0, "'h_unimplemented' is not context-free, can't be desugared"); - return NULL; -} - static const HParserVtable unimplemented_vt = { .parse = parse_unimplemented, .isValidRegular = h_false, .isValidCF = h_false, - .desugar = desugar_unimplemented, .compile_to_rvm = h_not_regular, };