Add #error

This commit is contained in:
Rui Ueyama 2020-04-01 20:46:47 +09:00
parent a939a7a906
commit e7fdc2e3f1
1 changed files with 3 additions and 0 deletions

View File

@ -769,6 +769,9 @@ static Token *preprocess2(Token *tok) {
continue;
}
if (equal(tok, "error"))
error_tok(tok, "error");
// `#`-only line is legal. It's called a null directive.
if (tok->at_bol)
continue;