mirror of
https://github.com/cc65/cc65.git
synced 2025-08-08 22:25:28 +00:00
Allows one trailing comma before the closing curly of a struct/union initializer.
This commit is contained in:
@@ -2230,6 +2230,13 @@ static unsigned ParseStructInit (Type* T, int* Braces, int AllowFlexibleMembers)
|
||||
|
||||
/* Check for excess elements */
|
||||
if (Entry == 0) {
|
||||
/* Is there just one trailing comma before a closing curly? */
|
||||
if (NextTok.Tok == TOK_RCURLY && CurTok.Tok == TOK_COMMA) {
|
||||
/* Skip comma and exit scope */
|
||||
NextToken ();
|
||||
break;
|
||||
}
|
||||
|
||||
if (HasCurly) {
|
||||
Error ("Excess elements in %s initializer", GetBasicTypeName (T));
|
||||
SkipInitializer (HasCurly);
|
||||
|
Reference in New Issue
Block a user