source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: schwarze@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: show the {MDOC,MAN}_EQN node, it contains interesting
Date: Sun, 19 Oct 2014 21:43:48 -0400 (EDT)	[thread overview]
Message-ID: <201410200143.s9K1hmXp001466@krisdoz.my.domain> (raw)

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

                 reply	other threads:[~2014-10-20  1:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201410200143.s9K1hmXp001466@krisdoz.my.domain \
    --to=schwarze@mdocml.bsd.lv \
    --cc=source@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).