Remove unneeded desugaring code.
This commit is contained in:
parent
ec404ca8fe
commit
92f2eecf6c
2 changed files with 1 additions and 7 deletions
|
|
@ -8,7 +8,7 @@ HCFChoice *h_desugar(HAllocator *mm__, HCFStack *stk__, const HParser *parser) {
|
||||||
if (nstk__ == NULL) {
|
if (nstk__ == NULL) {
|
||||||
nstk__ = h_cfstack_new(mm__);
|
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);
|
parser->vtable->desugar(mm__, nstk__, parser->env);
|
||||||
((HParser *)parser)->desugared = nstk__->last_completed;
|
((HParser *)parser)->desugared = nstk__->last_completed;
|
||||||
if (stk__ == NULL)
|
if (stk__ == NULL)
|
||||||
|
|
|
||||||
|
|
@ -12,16 +12,10 @@ static HParseResult* parse_unimplemented(void* env, HParseState *state) {
|
||||||
return &result;
|
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 = {
|
static const HParserVtable unimplemented_vt = {
|
||||||
.parse = parse_unimplemented,
|
.parse = parse_unimplemented,
|
||||||
.isValidRegular = h_false,
|
.isValidRegular = h_false,
|
||||||
.isValidCF = h_false,
|
.isValidCF = h_false,
|
||||||
.desugar = desugar_unimplemented,
|
|
||||||
.compile_to_rvm = h_not_regular,
|
.compile_to_rvm = h_not_regular,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue