-/* $Id: tree.c,v 1.58 2014/10/10 15:26:29 schwarze Exp $ */
+/* $Id: tree.c,v 1.60 2014/11/28 05:51:32 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
t = "text";
break;
case MDOC_TBL:
- /* FALLTHROUGH */
+ break;
case MDOC_EQN:
+ t = "eqn";
break;
default:
abort();
}
break;
case MDOC_TBL:
- /* FALLTHROUGH */
+ break;
case MDOC_EQN:
+ p = "EQ";
break;
case MDOC_ROOT:
p = "root";
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');
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)
case MAN_BODY:
t = "block-body";
break;
- case MAN_TAIL:
- t = "block-tail";
- break;
case MAN_TBL:
- /* FALLTHROUGH */
+ break;
case MAN_EQN:
+ t = "eqn";
break;
default:
abort();
/* FALLTHROUGH */
case MAN_HEAD:
/* FALLTHROUGH */
- case MAN_TAIL:
- /* FALLTHROUGH */
case MAN_BODY:
p = man_macronames[n->tok];
break;
p = "root";
break;
case MAN_TBL:
- /* FALLTHROUGH */
+ break;
case MAN_EQN:
+ p = "EQ";
break;
default:
abort();
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');
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)