source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: show the {MDOC,MAN}_EQN node, it contains interesting
@ 2014-10-20  1:43 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2014-10-20  1:43 UTC (permalink / raw)
  To: source

Log Message:
-----------
show the {MDOC,MAN}_EQN node, it contains interesting information,
in particular line and column numbers and flags;
but hide the uninteresting EQN_ROOT box

Modified Files:
--------------
    mdocml:
        tree.c

Revision Data
-------------
Index: tree.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/tree.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -Ltree.c -Ltree.c -u -p -r1.58 -r1.59
--- tree.c
+++ tree.c
@@ -88,8 +88,9 @@ print_mdoc(const struct mdoc_node *n, in
 		t = "text";
 		break;
 	case MDOC_TBL:
-		/* FALLTHROUGH */
+		break;
 	case MDOC_EQN:
+		t = "eqn";
 		break;
 	default:
 		abort();
@@ -124,8 +125,9 @@ print_mdoc(const struct mdoc_node *n, in
 		}
 		break;
 	case MDOC_TBL:
-		/* FALLTHROUGH */
+		break;
 	case MDOC_EQN:
+		p = "EQ";
 		break;
 	case MDOC_ROOT:
 		p = "root";
@@ -138,9 +140,6 @@ print_mdoc(const struct mdoc_node *n, in
 	if (n->span) {
 		assert(NULL == p && NULL == t);
 		print_span(n->span, indent);
-	} else if (n->eqn) {
-		assert(NULL == p && NULL == t);
-		print_box(n->eqn->root, indent);
 	} else {
 		for (i = 0; i < indent; i++)
 			putchar('\t');
@@ -166,6 +165,8 @@ print_mdoc(const struct mdoc_node *n, in
 		putchar('\n');
 	}
 
+	if (n->eqn)
+		print_box(n->eqn->root->first, indent + 1);
 	if (n->child)
 		print_mdoc(n->child, indent + 1);
 	if (n->next)
@@ -203,8 +204,9 @@ print_man(const struct man_node *n, int 
 		t = "block-tail";
 		break;
 	case MAN_TBL:
-		/* FALLTHROUGH */
+		break;
 	case MAN_EQN:
+		t = "eqn";
 		break;
 	default:
 		abort();
@@ -230,8 +232,9 @@ print_man(const struct man_node *n, int 
 		p = "root";
 		break;
 	case MAN_TBL:
-		/* FALLTHROUGH */
+		break;
 	case MAN_EQN:
+		p = "EQ";
 		break;
 	default:
 		abort();
@@ -241,9 +244,6 @@ print_man(const struct man_node *n, int 
 	if (n->span) {
 		assert(NULL == p && NULL == t);
 		print_span(n->span, indent);
-	} else if (n->eqn) {
-		assert(NULL == p && NULL == t);
-		print_box(n->eqn->root, indent);
 	} else {
 		for (i = 0; i < indent; i++)
 			putchar('\t');
@@ -253,6 +253,8 @@ print_man(const struct man_node *n, int 
 		printf("%d:%d\n", n->line, n->pos + 1);
 	}
 
+	if (n->eqn)
+		print_box(n->eqn->root->first, indent + 1);
 	if (n->child)
 		print_man(n->child, indent + 1);
 	if (n->next)
--
 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:[~2014-10-20  1:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-20  1:43 mdocml: show the {MDOC,MAN}_EQN node, it contains interesting 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).