summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/mdoc_macro.c
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2017-02-10 15:44:31 +0000
committerschwarze <schwarze@openbsd.org>2017-02-10 15:44:31 +0000
commit385121c9aace893fba9e430c2056b05ea6e62a37 (patch)
treec6c1a580ad31a57c480f01cdf35299c1ef35dc58 /usr.bin/mandoc/mdoc_macro.c
parentAdd not delete the event if more to write. (diff)
downloadwireguard-openbsd-385121c9aace893fba9e430c2056b05ea6e62a37.tar.xz
wireguard-openbsd-385121c9aace893fba9e430c2056b05ea6e62a37.zip
In -Ttree output mode, show the BROKEN node flag and
provide a -Onoval output option to show the unvalidated tree.
Diffstat (limited to 'usr.bin/mandoc/mdoc_macro.c')
-rw-r--r--usr.bin/mandoc/mdoc_macro.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/usr.bin/mandoc/mdoc_macro.c b/usr.bin/mandoc/mdoc_macro.c
index fe8cfa3422e..da944a8a615 100644
--- a/usr.bin/mandoc/mdoc_macro.c
+++ b/usr.bin/mandoc/mdoc_macro.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mdoc_macro.c,v 1.166 2017/01/10 13:46:53 schwarze Exp $ */
+/* $OpenBSD: mdoc_macro.c,v 1.167 2017/02/10 15:44:31 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012-2016 Ingo Schwarze <schwarze@openbsd.org>
@@ -573,16 +573,24 @@ blk_exp_close(MACRO_PROT_ARGS)
}
/*
- * Mismatching end macros can never break anything,
- * SYNOPSIS name blocks can never be broken,
+ * Mismatching end macros can never break anything
* and we only care about the breaking of BLOCKs.
*/
- if (body == NULL ||
- n->tok == MDOC_Nm ||
- n->type != ROFFT_BLOCK)
+ if (body == NULL || n->type != ROFFT_BLOCK)
continue;
+ /*
+ * SYNOPSIS name blocks can not be broken themselves,
+ * but they do get broken together with a broken child.
+ */
+
+ if (n->tok == MDOC_Nm) {
+ if (later != NULL)
+ n->flags |= NODE_BROKEN | NODE_ENDED;
+ continue;
+ }
+
if (n->tok == MDOC_It) {
itblk = n;
continue;
@@ -985,7 +993,7 @@ blk_full(MACRO_PROT_ARGS)
/* Close out prior implicit scopes. */
- rew_last(mdoc, n);
+ rew_pending(mdoc, n);
}
/* Skip items outside lists. */