source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: In -Ttree output mode, show the BROKEN node flag and  provide a
@ 2017-02-10 15:45 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2017-02-10 15:45 UTC (permalink / raw)
  To: source

Log Message:
-----------
In -Ttree output mode, show the BROKEN node flag and 
provide a -Onoval output option to show the unvalidated tree.

Modified Files:
--------------
    mdocml:
        NEWS
        main.c
        manconf.h
        mandoc.1
        manpath.c
        tree.c

Revision Data
-------------
Index: manpath.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/manpath.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -Lmanpath.c -Lmanpath.c -u -p -r1.32 -r1.33
--- manpath.c
+++ manpath.c
@@ -226,7 +226,7 @@ manconf_output(struct manoutput *conf, c
 {
 	const char *const toks[] = {
 	    "includes", "man", "paper", "style",
-	    "indent", "width", "fragment", "mdoc"
+	    "indent", "width", "fragment", "mdoc", "noval"
 	};
 
 	const char	*errstr;
@@ -309,6 +309,9 @@ manconf_output(struct manoutput *conf, c
 		return 0;
 	case 7:
 		conf->mdoc = 1;
+		return 0;
+	case 8:
+		conf->noval = 1;
 		return 0;
 	default:
 		if (fromfile)
Index: NEWS
===================================================================
RCS file: /home/cvs/mdocml/mdocml/NEWS,v
retrieving revision 1.14
retrieving revision 1.15
diff -LNEWS -LNEWS -u -p -r1.14 -r1.15
--- NEWS
+++ NEWS
@@ -35,7 +35,8 @@ Changes in version 1.14.1, released on F
  * 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 F
    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 F
    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 J
    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.
Index: main.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/main.c,v
retrieving revision 1.280
retrieving revision 1.281
diff -Lmain.c -Lmain.c -u -p -r1.280 -r1.281
--- main.c
+++ main.c
@@ -742,7 +742,8 @@ parse(struct curparse *curp, int fd, con
 	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, con
 		}
 	}
 	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);
Index: mandoc.1
===================================================================
RCS file: /home/cvs/mdocml/mdocml/mandoc.1,v
retrieving revision 1.173
retrieving revision 1.174
diff -Lmandoc.1 -Lmandoc.1 -u -p -r1.173 -r1.174
--- mandoc.1
+++ mandoc.1
@@ -538,12 +538,25 @@ A closing parenthesis if the node is a c
 .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
 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
Index: tree.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/tree.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -Ltree.c -Ltree.c -u -p -r1.72 -r1.73
--- tree.c
+++ tree.c
@@ -192,6 +192,8 @@ print_mdoc(const struct roff_node *n, in
 			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)
Index: manconf.h
===================================================================
RCS file: /home/cvs/mdocml/mdocml/manconf.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -Lmanconf.h -Lmanconf.h -u -p -r1.3 -r1.4
--- manconf.h
+++ manconf.h
@@ -35,6 +35,7 @@ struct	manoutput {
 	int	  fragment;
 	int	  mdoc;
 	int	  synopsisonly;
+	int	  noval;
 };
 
 struct	manconf {
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-02-10 15:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-10 15:45 mdocml: In -Ttree output mode, show the BROKEN node flag and provide a schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).