From a98d254132a47ab6826511a1ab1dcd7763e588c1 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Sun, 29 Aug 2010 11:29:51 +0000 Subject: Allow `.xx\}' where xx is a macro (e.g., `.br\}') to close scope. This is experimental and hasn't been rigorously tested. It's only implemented in -mdoc for the time being. This is absolutely required for pod2man. It does, however, make the pod2man preamble be processed in full. --- roff.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'roff.c') diff --git a/roff.c b/roff.c index 52a0e344..5cfacbb5 100644 --- a/roff.c +++ b/roff.c @@ -59,7 +59,7 @@ enum rofft { ROFF_rm, ROFF_tr, ROFF_cblock, - ROFF_ccond, + ROFF_ccond, /* FIXME: remove this. */ ROFF_nr, ROFF_MAX }; @@ -764,8 +764,13 @@ roff_cond_sub(ROFF_ARGS) if (l != r->last) return(ROFFRULE_DENY == rr ? ROFF_IGN : ROFF_CONT); - if (ROFF_MAX == (t = roff_parse(*bufp, &pos))) + if (ROFF_MAX == (t = roff_parse(*bufp, &pos))) { + if ('\\' == (*bufp)[pos] && '}' == (*bufp)[pos + 1]) + return(roff_ccond + (r, ROFF_ccond, bufp, szp, + ln, pos, pos + 2, offs)); return(ROFFRULE_DENY == rr ? ROFF_IGN : ROFF_CONT); + } /* * A denied conditional must evaluate its children if and only @@ -797,6 +802,8 @@ roff_cond_text(ROFF_ARGS) * scope permits us to do so. */ + /* FIXME: use roff_ccond? */ + st = &(*bufp)[pos]; if (NULL == (ep = strstr(st, "\\}"))) { roffnode_cleanscope(r); -- cgit