mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-05 10:48:29 +00:00
Make it possible to compile redbean with chibicc
This cuts build latency down from 5 seconds to 500 milliseconds.
This commit is contained in:
parent
552525cbdd
commit
6ff46ca373
50 changed files with 898 additions and 824 deletions
11
third_party/chibicc/preprocess.c
vendored
11
third_party/chibicc/preprocess.c
vendored
|
@ -284,7 +284,9 @@ static long eval_const_expr(Token **rest, Token *tok) {
|
|||
convert_pp_tokens(expr);
|
||||
Token *rest2;
|
||||
long val = const_expr(&rest2, expr);
|
||||
if (rest2->kind != TK_EOF) error_tok(rest2, "extra token");
|
||||
if (rest2->kind != TK_EOF && rest2->kind != TK_JAVADOWN) {
|
||||
error_tok(rest2, "extra token");
|
||||
}
|
||||
__arena_pop();
|
||||
return val;
|
||||
}
|
||||
|
@ -324,7 +326,12 @@ static MacroParam *read_macro_params(Token **rest, Token *tok,
|
|||
*rest = skip(tok->next, ')');
|
||||
return head.next;
|
||||
}
|
||||
if (tok->kind != TK_IDENT) error_tok(tok, "expected an identifier");
|
||||
if (tok->kind == TK_JAVADOWN) {
|
||||
tok = tok->next;
|
||||
}
|
||||
if (tok->kind != TK_IDENT) {
|
||||
error_tok(tok, "expected an identifier");
|
||||
}
|
||||
if (EQUAL(tok->next, "...")) {
|
||||
*va_args_name = strndup(tok->loc, tok->len);
|
||||
*rest = skip(tok->next->next, ')');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue