~mcf/cproc

6f874e47b62705b28175b135b3372a19a8108bf3 — Michael Forney 3 years ago e2855dd
main: Add specialized error message for stray ';' at toplevel
1 files changed, 4 insertions(+), 1 deletions(-)

M main.c
M main.c => main.c +4 -1
@@ 58,8 58,11 @@ main(int argc, char *argv[])
	} else {
		scopeinit();
		while (tok.kind != TEOF) {
			if (!decl(&filescope, NULL))
			if (!decl(&filescope, NULL)) {
				if (tok.kind == TSEMICOLON)
					error(&tok.loc, "unexpected ';' at top-level");
				error(&tok.loc, "expected declaration or function definition");
			}
		}
		emittentativedefns();
	}