Implemented a bunch more desugaring
This commit is contained in:
parent
5ae267f3ed
commit
101e90ad9b
11 changed files with 51 additions and 35 deletions
|
|
@ -35,20 +35,15 @@ static HParseResult* parse_butnot(void *env, HParseState *state) {
|
|||
}
|
||||
}
|
||||
|
||||
static bool bn_isValidCF(void *env) {
|
||||
HTwoParsers *tp = (HTwoParsers*)env;
|
||||
return (tp->p1->vtable->isValidCF(tp->p1->env) &&
|
||||
tp->p2->vtable->isValidCF(tp->p2->env));
|
||||
}
|
||||
|
||||
static HCFChoice* desugar_butnot(HAllocator *mm__, void *env) {
|
||||
|
||||
assert_message(0, "'h_butnot' is not context-free, can't be desugared");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static const HParserVtable butnot_vt = {
|
||||
.parse = parse_butnot,
|
||||
.isValidRegular = h_false,
|
||||
.isValidCF = bn_isValidCF,
|
||||
.isValidCF = h_false,
|
||||
.desugar = desugar_butnot,
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue