diff options
| author | 2024-06-21 08:42:57 -0400 | |
|---|---|---|
| committer | 2024-06-21 08:42:57 -0400 | |
| commit | ac04cf78284b61844f03bfb5b96b74de7c14bfa3 (patch) | |
| tree | 5d6796a4bba5e6c7e8574361e9309940455ebe1f | |
| parent | parsing (diff) | |
tokenizer: fix number tokenizer eating non-number characters
| -rw-r--r-- | main.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -223,10 +223,12 @@ static void tokenize(FILE *input, struct token *tok) return; } default: - if (tonum(c) >= 0) + if (tonum(c) >= 0) { + ungetc(c, input); tok_num(input, tok, 1); - else + } else { tok_ident(input, tok, c); + } return; } } @@ -446,7 +448,10 @@ static void after_gc(struct uns_gc *gc_) ); - gc.next_alloc *= 2; + if (gc.after_collection >= gc.before_collection * 7/10) { + fprintf(stderr, "\tincreasing\n"); + gc.next_alloc *= 2; + } } static void init_gc(void) @@ -458,6 +463,7 @@ static void init_gc(void) gc.ctx = malloc(uns_cheney_c89_ctx_size); if(!gc.ctx || !uns_cheney_c89_init(&gc)) exit(1); + gc.next_alloc *= 2; uns_root_add(&gc, &empty_list); |
