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

@ -13,12 +13,8 @@ static HParseResult* parse_ch(void* env, HParseState *state) {
}
}
static HCFChoice* desugar_ch(HAllocator *mm__, void *env) {
HCFChoice *ret = h_new(HCFChoice, 1);
ret->type = HCF_CHAR;
ret->chr = (uint8_t)(unsigned long)(env);
ret->action = NULL;
return ret;
static void desugar_ch(HAllocator *mm__, HCFStack *stk__, void *env) {
HCFS_ADD_CHAR( (uint8_t)(unsigned long)(env) );
}
static bool h_svm_action_ch(HArena *arena, HSVMContext *ctx, void* env) {