From 92242aeaf21903a4c5a12a7c74eb77fcd7158a52 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Thu, 7 Dec 2006 18:09:37 +0000 Subject: I've just noticed some unacceptably long lines in code paragraphs in the Halibut manual. They turn out to be \cfg directives with multiple braced sections after them. The obvious thing to do for legibility would be to wrap those sections by putting newlines between } and {, but that isn't legal in the Halibut syntax. Therefore, it is now :-) For paragraph types which don't have any body text (such as \cfg), we are now lenient about whitespace between multiple keywords. So I can fix the docs so they don't go over the limit, and be confident that the fixed version is still technically accurate. [originally from svn r6970] --- input.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'input.c') diff --git a/input.c b/input.c index 47d475a..a677129 100644 --- a/input.c +++ b/input.c @@ -903,7 +903,21 @@ static void read_file(paragraph ***ret, input *in, indexdata *idx, /* Get keywords. */ dtor(t), t = get_token(in); fp = t.pos; - while (t.type == tok_lbrace) { + while (t.type == tok_lbrace || + (t.type == tok_white && (needkw & 24))) { + /* + * In paragraph types which can't accept any + * body text (such as \cfg), we are lenient + * about whitespace between keywords. This is + * important for \cfg in particular since it + * can often have many keywords which are long + * pieces of text, so it's useful to permit the + * user to wrap the line between them. + */ + if (t.type == tok_white) { + dtor(t), t = get_token(in); /* eat the space */ + continue; + } /* This is a keyword. */ nkeys++; /* FIXME: there will be bugs if anyone specifies an -- cgit v1.1