aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roff.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-08-29 11:29:51 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-08-29 11:29:51 +0000
commite5b395c743b2bac472ad457fa3dd62a5956261c6 (patch)
treed3966841c43e3608d7b7584d6a75cb55b7268b63 /roff.c
parent3ea3625363ef1d13288de47e35bfb037d130d3f5 (diff)
downloadmandoc-e5b395c743b2bac472ad457fa3dd62a5956261c6.tar.gz
mandoc-e5b395c743b2bac472ad457fa3dd62a5956261c6.tar.zst
mandoc-e5b395c743b2bac472ad457fa3dd62a5956261c6.zip
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.
Diffstat (limited to 'roff.c')
-rw-r--r--roff.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/roff.c b/roff.c
index b111ad23..ece3dfd2 100644
--- a/roff.c
+++ b/roff.c
@@ -1,4 +1,4 @@
-/* $Id: roff.c,v 1.99 2010/08/24 12:48:43 kristaps Exp $ */
+/* $Id: roff.c,v 1.100 2010/08/29 11:29:51 kristaps Exp $ */
/*
* Copyright (c) 2010 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
@@ -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);