X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/mLib/blobdiff_plain/6e683a79101025ee0d371f0b9bece811856edd8d..5c0f2e080603967952db43eb7b12d44dd64f7169:/test/tvec-core.c?ds=inline diff --git a/test/tvec-core.c b/test/tvec-core.c index fc1b413..d2a08c3 100644 --- a/test/tvec-core.c +++ b/test/tvec-core.c @@ -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);