|
@@ -2855,7 +2855,7 @@ node_t *_parse_stmt(list_t *tokens, size_t *pos, int allow_comma)
|
|
|
if (AT(RCB))
|
|
if (AT(RCB))
|
|
|
PARSE_ERROR("empty enum");
|
|
PARSE_ERROR("empty enum");
|
|
|
|
|
|
|
|
- do
|
|
|
|
|
|
|
+ while (!AT(EOF))
|
|
|
{
|
|
{
|
|
|
if (AT(RCB))
|
|
if (AT(RCB))
|
|
|
break;
|
|
break;
|
|
@@ -2879,7 +2879,7 @@ node_t *_parse_stmt(list_t *tokens, size_t *pos, int allow_comma)
|
|
|
v = parse_expr(tokens, pos);
|
|
v = parse_expr(tokens, pos);
|
|
|
|
|
|
|
|
table_set(h, k, v);
|
|
table_set(h, k, v);
|
|
|
- } while (MATCH(COMMA));
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
EXPECT(RCB, "}");
|
|
EXPECT(RCB, "}");
|
|
|
|
|
|
|
@@ -4231,7 +4231,7 @@ void compile_block(buffer_t *gbuf, buffer_t *buf, list_t *ctx, table_t *ltab,
|
|
|
snprintf(buf, sizeof(buf), "%zu", k++);
|
|
snprintf(buf, sizeof(buf), "%zu", k++);
|
|
|
|
|
|
|
|
v = nodet(N_LITERAL, token(T_NUMBER, strdup(buf)));
|
|
v = nodet(N_LITERAL, token(T_NUMBER, strdup(buf)));
|
|
|
- }
|
|
|
|
|
|
|
+ } else k++;
|
|
|
|
|
|
|
|
if (!const_set(name, v))
|
|
if (!const_set(name, v))
|
|
|
COMPILE_ERROR("redeclaration of compile-time constant: '%s'", name);
|
|
COMPILE_ERROR("redeclaration of compile-time constant: '%s'", name);
|