summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--regress/usr.bin/mandoc/mdoc/Bl/diag.in12
-rw-r--r--regress/usr.bin/mandoc/mdoc/Bl/diag.out_ascii7
-rw-r--r--usr.bin/mandoc/mdoc_macro.c16
3 files changed, 29 insertions, 6 deletions
diff --git a/regress/usr.bin/mandoc/mdoc/Bl/diag.in b/regress/usr.bin/mandoc/mdoc/Bl/diag.in
index c234988c7f3..2c2a9aec9df 100644
--- a/regress/usr.bin/mandoc/mdoc/Bl/diag.in
+++ b/regress/usr.bin/mandoc/mdoc/Bl/diag.in
@@ -1,4 +1,4 @@
-.Dd October 28, 2009
+.Dd January 4, 2012
.Dt BL-DIAG 1
.Os OpenBSD
.Sh NAME
@@ -37,3 +37,13 @@ x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x
.It zehn__zehn
x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x
.El
+.Pp
+Check that It is not parsed in Bl:
+.Bl -diag -compact
+.It Nx
+.No Nx
+.It Ox
+.No Ox
+.It Fx
+.No Fx
+.El
diff --git a/regress/usr.bin/mandoc/mdoc/Bl/diag.out_ascii b/regress/usr.bin/mandoc/mdoc/Bl/diag.out_ascii
index fe667c5f7c1..c6178b94ebe 100644
--- a/regress/usr.bin/mandoc/mdoc/Bl/diag.out_ascii
+++ b/regress/usr.bin/mandoc/mdoc/Bl/diag.out_ascii
@@ -28,4 +28,9 @@ DDEESSCCRRIIPPTTIIOONN
zzeehhnn____zzeehhnn x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x
x x x x x x x x x
-OpenBSD October 28, 2009 OpenBSD
+ Check that It is not parsed in Bl:
+ NNxx NetBSD
+ OOxx OpenBSD
+ FFxx FreeBSD
+
+OpenBSD January 4, 2012 OpenBSD
diff --git a/usr.bin/mandoc/mdoc_macro.c b/usr.bin/mandoc/mdoc_macro.c
index b8dd1b21f17..1c96266df20 100644
--- a/usr.bin/mandoc/mdoc_macro.c
+++ b/usr.bin/mandoc/mdoc_macro.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_macro.c,v 1.72 2011/12/03 23:01:21 schwarze Exp $ */
+/* $Id: mdoc_macro.c,v 1.73 2012/01/04 02:17:42 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
@@ -224,7 +224,6 @@ mdoc_macroend(struct mdoc *m)
static enum mdoct
lookup(enum mdoct from, const char *p)
{
- /* FIXME: make -diag lists be un-PARSED. */
if ( ! (MDOC_PARSED & mdoc_macros[from].flags))
return(MDOC_MAX);
@@ -980,7 +979,7 @@ in_line(MACRO_PROT_ARGS)
static int
blk_full(MACRO_PROT_ARGS)
{
- int la, nl;
+ int la, nl, nparsed;
struct mdoc_arg *arg;
struct mdoc_node *head; /* save of head macro */
struct mdoc_node *body; /* save of body macro */
@@ -1035,6 +1034,14 @@ blk_full(MACRO_PROT_ARGS)
head = body = NULL;
/*
+ * Exception: Heads of `It' macros in `-diag' lists are not
+ * parsed, even though `It' macros in general are parsed.
+ */
+ nparsed = MDOC_It == tok &&
+ MDOC_Bl == m->last->parent->tok &&
+ LIST_diag == m->last->parent->norm->Bl.type;
+
+ /*
* The `Nd' macro has all arguments in its body: it's a hybrid
* of block partial-explicit and full-implicit. Stupid.
*/
@@ -1142,7 +1149,8 @@ blk_full(MACRO_PROT_ARGS)
continue;
}
- ntok = ARGS_QWORD == ac ? MDOC_MAX : lookup(tok, p);
+ ntok = nparsed || ARGS_QWORD == ac ?
+ MDOC_MAX : lookup(tok, p);
if (MDOC_MAX == ntok) {
if ( ! dword(m, line, la, p, DELIM_MAX))