summaryrefslogtreecommitdiffstats
path: root/tree.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2014-10-10 08:44:24 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2014-10-10 08:44:24 +0000
commit56fe72aebb64bb54a4bbaf3edf6673253fafdf24 (patch)
treee745d5bbd763f04d5208104d8d03abd46e6b2663 /tree.c
parentab00e3652ae08997f4eb0cd41e34c86874cd4eb9 (diff)
downloadmandoc-56fe72aebb64bb54a4bbaf3edf6673253fafdf24.tar.gz
Re-write of eqn(7) parser and MathML output.
This adds parser-level support for the grammar described by the eqn second-edition technical paper, "Typesetting Mathematics — User's Guide" (Kernighan, Cherry). The reason for this re-write is the grouping rules, which were not possible given the existing implementation. The re-write has also considerably simplified the HTML (and, if it ever is completed, terminal) front-end.
Diffstat (limited to 'tree.c')
-rw-r--r--tree.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/tree.c b/tree.c
index c1538afd..29010607 100644
--- a/tree.c
+++ b/tree.c
@@ -275,6 +275,7 @@ print_box(const struct eqn_box *ep, int indent)
case EQN_ROOT:
t = "eqn-root";
break;
+ case EQN_LISTONE:
case EQN_LIST:
t = "eqn-list";
break;
@@ -284,15 +285,19 @@ print_box(const struct eqn_box *ep, int indent)
case EQN_TEXT:
t = "eqn-text";
break;
+ case EQN_PILE:
+ t = "eqn-pile";
+ break;
case EQN_MATRIX:
t = "eqn-matrix";
break;
}
assert(t);
- printf("%s(size=%d, pos=%d, font=%d, mark=%d, pile=%d, l=\"%s\", r=\"%s\") %s\n",
+ printf("%s(size=%d, args=%zu(%zu), pos=%d, font=%d, pile=%d, l=\"%s\", r=\"%s\") %s\n",
t, EQN_DEFSIZE == ep->size ? 0 : ep->size,
- ep->pos, ep->font, ep->mark, ep->pile,
+ ep->args, ep->expectargs,
+ ep->pos, ep->font, ep->pile,
ep->left ? ep->left : "",
ep->right ? ep->right : "",
ep->text ? ep->text : "");