mirror of
https://github.com/cc65/cc65.git
synced 2025-02-10 09:31:08 +00:00
Allows one trailing comma before the closing curly of a struct/union initializer.
This commit is contained in:
parent
25d10d9d9a
commit
9075a853dc
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user