@@@ misc wip
[mLib] / test / tvec-core.c
index fc1b413..d2a08c3 100644 (file)
@@ -1092,6 +1092,15 @@ int tvec_read(struct tvec_state *tv, const char *infile, FILE *fp)
        } else {
          /* Some non-whitespace thing. */
 
+         /* If there's no test, then report an error.  Set the muffle flag,
+          * because there's no point in complaining about every assignment
+          * in this block.
+          */
+         if (!tv->test) {
+           if (!(tv->f&TVSF_MUFFLE)) tvec_error(tv, "no current test");
+           tv->f |= TVSF_MUFFLE; goto flush_line;
+         }
+
          /* Put the character back and read a word, which ought to be a
           * register name.
           */
@@ -1100,6 +1109,11 @@ int tvec_read(struct tvec_state *tv, const char *infile, FILE *fp)
          if (tvec_readword(tv, &d, 0, "=:*;", "register name"))
            goto flush_line;
 
+         /* Open the test.  This is syntactically a paragraph of settings,
+          * so it's fair to report on missing register assignments.
+          */
+         open_test(tv);
+
          /* See what sort of thing we have found. */
          if (d.buf[0] == '@') {
            /* A special register assignment.  */
@@ -1133,20 +1147,6 @@ int tvec_read(struct tvec_state *tv, const char *infile, FILE *fp)
              { tvec_dupregerr(tv, rd->name); goto flush_line; }
          }
 
-         /* If there's no test, then report an error.  Set the muffle flag,
-          * because there's no point in complaining about every assignment
-          * in this block.
-          */
-         if (!tv->test) {
-           if (!(tv->f&TVSF_MUFFLE)) tvec_error(tv, "no current test");
-           tv->f |= TVSF_MUFFLE; goto flush_line;
-         }
-
-         /* Open the test.  This is syntactically a paragraph of settings,
-          * so it's fair to report on missing register assignments.
-          */
-         open_test(tv);
-
          /* Now there should be a separator. */
          tvec_skipspc(tv); ch = getc(tv->fp);