From 3e043306f1594f7528788a1c593995b391fc7a5a Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Thu, 25 Oct 2001 19:28:43 +0000 Subject: Enforce proper ordering of heading levels: specifically, ensure the user doesn't skip a heading level (\H before any \C or \A, or \S straight after \C with no intervening \H). The precise criterion is that when creating section a.b.c.d, sections a.b.c, a.b and a should already exist. This ensures the section tree really is a properly formed tree with no missing nodes. [originally from svn r1329] --- error.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'error.c') diff --git a/error.c b/error.c index b4a3898..c81aa8c 100644 --- a/error.c +++ b/error.c @@ -162,6 +162,11 @@ static void do_error(int code, va_list ap) { sprintf(error, "macro `%.200s' already defined", sp); flags = FILEPOS; break; + case err_sectjump: + fpos = *va_arg(ap, filepos *); + sprintf(error, "expected higher heading levels before this one"); + flags = FILEPOS; + break; case err_whatever: sp = va_arg(ap, char *); vsprintf(error, sp, ap); -- cgit v1.1