aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-02-10 15:45:28 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-02-10 15:45:28 +0000
commita4aa2b1f59e2f2354dd17be89ef5ebc595a4bfc0 (patch)
tree8a0ac896c2f0126a6b24dfe59abd0846bfa12747
parent85cca7a5afcdad576c72653fa8e0373ddde2dbe6 (diff)
downloadmandoc-a4aa2b1f59e2f2354dd17be89ef5ebc595a4bfc0.tar.gz
mandoc-a4aa2b1f59e2f2354dd17be89ef5ebc595a4bfc0.tar.zst
mandoc-a4aa2b1f59e2f2354dd17be89ef5ebc595a4bfc0.zip
In -Ttree output mode, show the BROKEN node flag and
provide a -Onoval output option to show the unvalidated tree.
-rw-r--r--NEWS11
-rw-r--r--main.c8
-rw-r--r--manconf.h1
-rw-r--r--mandoc.117
-rw-r--r--manpath.c7
-rw-r--r--tree.c4
6 files changed, 35 insertions, 13 deletions
diff --git a/NEWS b/NEWS
index 7af92017..e5824131 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
-$Id: NEWS,v 1.14 2017/02/08 12:24:10 schwarze Exp $
+$Id: NEWS,v 1.15 2017/02/10 15:45:28 schwarze Exp $
This file lists the most important changes in the mdocml.bsd.lv distribution.
@@ -35,7 +35,8 @@ Changes in version 1.14.1, released on February XXX, 2017
* mdoc(7): Always do text production in the validator, never in the
formatters. Cleaner, simpler, shorter, helps NetBSD apropos(1)
and also makes -Ttree output more useful.
- * mdoc(7), man(7): Show metadata in -Ttree output.
+ * -Ttree: Show metadata and some additional node flags.
+ New -Onoval output option to show the unvalidated tree.
--- RELIABILITY BUGFIXES ---
* man(1): Make "man -l" work with standard input from a pipe or file,
as long as standard output is a terminal.
@@ -49,7 +50,7 @@ Changes in version 1.14.1, released on February XXX, 2017
shown was preformatted.
* mdoc(7): Fix syntax tree corruption leading to NULL dereference
for macro sequences like .Bl .Bl .It Bo .El .It.
- * mdoc(7): Fix syntax tree corruption leading to NULL dereference
+ * mdoc(7): Fix syntax tree corruption leading to NULL dereference
caused by .Ta following a nested .Bl -column breaking another block.
* mdoc(7) -Thtml: Fix a NULL dereference for .Bl -column with 0 columns.
* mdoc(7): Fix NULL dereference if the only child of the head
@@ -100,7 +101,7 @@ Changes in version 1.14.1, released on February XXX, 2017
Stuart Henderson, Ted Unangst, Theo de Raadt (OpenBSD), Abhinav
Upadhyay, Christos Zoulas, Kamil Rytarowski, Sevan Janiyan,
Thomas Klausner (NetBSD), Aaron M. Ucko, Bdale Garbee, Reiner
- Herrmann, Shane Kerr (Debian), Christian Neukirchen (Void Linux),
+ Herrmann, Shane Kerr (Debian), Leah Neukirchen (Void Linux),
Daniel Sabogal (Alpine Linux), Yuri Pankov (illumos),
Carsten Kunze (Heirloom roff), Kristaps Dzonsons (bsd.lv),
Anton Lindqvist, Jan Stary, Jeremy A. Mates, Mark Patruck,
@@ -218,7 +219,7 @@ Changes in version 1.13.4, released on July 14, 2016
again resulting in more than half a dozen important bug reports.
* Svyatoslav Mishyn (Crux Linux) for some patches, several bug
reports, and extensive release testing.
- * Christian Neukirchen (void Linux) for a number of compatibility
+ * Leah Neukirchen (Void Linux) for a number of compatibility
patches and suggestions and several bug reports.
* Christos Zoulas (NetBSD) for a bug fix patch and some useful
suggestions for cleanup.
diff --git a/main.c b/main.c
index 1b1b5b73..460fd05d 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.280 2017/01/27 13:47:10 schwarze Exp $ */
+/* $Id: main.c,v 1.281 2017/02/10 15:45:28 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2012, 2014-2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -742,7 +742,8 @@ parse(struct curparse *curp, int fd, const char *file)
if (man == NULL)
return;
if (man->macroset == MACROSET_MDOC) {
- mdoc_validate(man);
+ if (curp->outtype != OUTT_TREE || !curp->outopts->noval)
+ mdoc_validate(man);
switch (curp->outtype) {
case OUTT_HTML:
html_mdoc(curp->outdata, man);
@@ -765,7 +766,8 @@ parse(struct curparse *curp, int fd, const char *file)
}
}
if (man->macroset == MACROSET_MAN) {
- man_validate(man);
+ if (curp->outtype != OUTT_TREE || !curp->outopts->noval)
+ man_validate(man);
switch (curp->outtype) {
case OUTT_HTML:
html_man(curp->outdata, man);
diff --git a/manconf.h b/manconf.h
index 80578f6a..f5c678e8 100644
--- a/manconf.h
+++ b/manconf.h
@@ -35,6 +35,7 @@ struct manoutput {
int fragment;
int mdoc;
int synopsisonly;
+ int noval;
};
struct manconf {
diff --git a/mandoc.1 b/mandoc.1
index 91f5287b..45615d5d 100644
--- a/mandoc.1
+++ b/mandoc.1
@@ -1,4 +1,4 @@
-.\" $Id: mandoc.1,v 1.173 2017/01/31 19:44:04 schwarze Exp $
+.\" $Id: mandoc.1,v 1.174 2017/02/10 15:45:28 schwarze Exp $
.\"
.\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
.\" Copyright (c) 2012, 2014-2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -15,7 +15,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: January 31 2017 $
+.Dd $Mdocdate: February 10 2017 $
.Dt MANDOC 1
.Os
.Sh NAME
@@ -538,6 +538,8 @@ A closing parenthesis if the node is a closing delimiter.
.It
A full stop if the node ends a sentence.
.It
+BROKEN if the node is a block broken by another block.
+.It
NOSRC if the node is not in the input file,
but automatically generated from macros.
.It
@@ -545,6 +547,17 @@ NOPRT if the node is not supposed to generate output
for any output format.
.El
.El
+.Pp
+The following
+.Fl O
+argument is accepted:
+.Bl -tag -width Ds
+.It Cm noval
+Skip validation and show the unvalidated syntax tree.
+This can help to find out whether a given behaviour is caused by
+the parser or by the validator.
+Meta data is not available in this case.
+.El
.Sh ENVIRONMENT
.Bl -tag -width MANPAGER
.It Ev MANPAGER
diff --git a/manpath.c b/manpath.c
index 6da3620e..f43ace60 100644
--- a/manpath.c
+++ b/manpath.c
@@ -1,4 +1,4 @@
-/* $Id: manpath.c,v 1.32 2017/01/27 13:47:10 schwarze Exp $ */
+/* $Id: manpath.c,v 1.33 2017/02/10 15:45:28 schwarze Exp $ */
/*
* Copyright (c) 2011, 2014, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -226,7 +226,7 @@ manconf_output(struct manoutput *conf, const char *cp, int fromfile)
{
const char *const toks[] = {
"includes", "man", "paper", "style",
- "indent", "width", "fragment", "mdoc"
+ "indent", "width", "fragment", "mdoc", "noval"
};
const char *errstr;
@@ -310,6 +310,9 @@ manconf_output(struct manoutput *conf, const char *cp, int fromfile)
case 7:
conf->mdoc = 1;
return 0;
+ case 8:
+ conf->noval = 1;
+ return 0;
default:
if (fromfile)
warnx("-O %s: Bad argument", cp);
diff --git a/tree.c b/tree.c
index 9e68b69e..dd36ff59 100644
--- a/tree.c
+++ b/tree.c
@@ -1,4 +1,4 @@
-/* $Id: tree.c,v 1.72 2017/01/12 17:29:33 schwarze Exp $ */
+/* $Id: tree.c,v 1.73 2017/02/10 15:45:28 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2013, 2014, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -192,6 +192,8 @@ print_mdoc(const struct roff_node *n, int indent)
putchar(')');
if (NODE_EOS & n->flags)
putchar('.');
+ if (NODE_BROKEN & n->flags)
+ printf(" BROKEN");
if (NODE_NOSRC & n->flags)
printf(" NOSRC");
if (NODE_NOPRT & n->flags)