Refactored all of the desugaring code to no longer depend on memory being initialized to 0. Everything is about 12% faster now.

This commit is contained in:
Dan Hirsch 2013-05-25 03:35:42 +02:00
parent d71215d494
commit ec404ca8fe
36 changed files with 411 additions and 417 deletions

View file

@ -21,22 +21,13 @@ static bool ignore_isValidCF(void *env) {
return (p->vtable->isValidCF(p->env));
}
static HCFChoice* desugar_ignore(HAllocator *mm__, void *env) {
HParser *p = (HParser*)env;
HCFChoice *ret = h_new(HCFChoice, 1);
HCFChoice *a = h_desugar(mm__, p);
ret->type = HCF_CHOICE;
ret->seq = h_new(HCFSequence*, 2);
ret->seq[0] = h_new(HCFSequence, 1);
ret->seq[0]->items = h_new(HCFChoice*, 2);
ret->seq[0]->items[0] = a;
ret->seq[0]->items[1] = NULL;
ret->seq[1] = NULL;
ret->reshape = h_act_ignore;
return ret;
static void desugar_ignore(HAllocator *mm__, HCFStack *stk__, void *env) {
HCFS_BEGIN_CHOICE() {
HCFS_BEGIN_SEQ() {
HCFS_DESUGAR( (HParser*)env );
} HCFS_END_SEQ();
HCFS_THIS_CHOICE->reshape = h_act_ignore;
} HCFS_END_CHOICE();
}
static bool h_svm_action_pop(HArena *arena, HSVMContext *ctx, void* arg) {