tokenizer: fix number tokenizer eating non-number characters
This commit is contained in:
parent
e300baf0db
commit
ac04cf7828
10
main.c
10
main.c
|
@ -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,8 +448,11 @@ static void after_gc(struct uns_gc *gc_)
|
|||
);
|
||||
|
||||
|
||||
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);
|
||||
|
|
Reference in New Issue