1
0
mirror of https://github.com/cc65/cc65.git synced 2025-01-14 00:32:08 +00:00

Fixed endlessly repeated error messages when a declaration lacks a required identifier.

This commit is contained in:
acqn 2022-11-02 23:58:20 +08:00
parent 9b39c3f949
commit aa5d44b2b0

View File

@ -1831,7 +1831,13 @@ static void Declarator (const DeclSpec* Spec, Declaration* D, declmode_t Mode)
NextToken (); NextToken ();
} else { } else {
if (Mode == DM_NEED_IDENT) { if (Mode == DM_NEED_IDENT) {
/* Some fix point tokens that are used for error recovery */
static const token_t TokenList[] = { TOK_COMMA, TOK_SEMI };
Error ("Identifier expected"); Error ("Identifier expected");
/* Try some smart error recovery */
SkipTokens (TokenList, sizeof(TokenList) / sizeof(TokenList[0]));
} }
D->Ident[0] = '\0'; D->Ident[0] = '\0';
} }