txlyre há 4 horas atrás
pai
commit
7e832c2e00
1 ficheiros alterados com 3 adições e 3 exclusões
  1. 3 3
      qic.c

+ 3 - 3
qic.c

@@ -2855,7 +2855,7 @@ node_t *_parse_stmt(list_t *tokens, size_t *pos, int allow_comma)
     if (AT(RCB))
       PARSE_ERROR("empty enum");
 
-    do
+    while (!AT(EOF))
     {
       if (AT(RCB))
         break;
@@ -2879,7 +2879,7 @@ node_t *_parse_stmt(list_t *tokens, size_t *pos, int allow_comma)
         v = parse_expr(tokens, pos);
 
       table_set(h, k, v);
-    } while (MATCH(COMMA));
+    }
 
     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++);
 
           v = nodet(N_LITERAL, token(T_NUMBER, strdup(buf)));
-        }
+        } else k++;
 
         if (!const_set(name, v))
           COMPILE_ERROR("redeclaration of compile-time constant: '%s'", name);