diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2014-10-10 08:44:24 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2014-10-10 08:44:24 +0000 |
commit | 08be124a58f07e4e41c58ea794f3e9eb04230e2b (patch) | |
tree | 7ae377429c8c326e79f2bb6133d4f43f2a9dfecc /tree.c | |
parent | 12f47a5652f90a1d86d7f6245d2d7f4dfae9f04e (diff) | |
download | mandoc-08be124a58f07e4e41c58ea794f3e9eb04230e2b.tar.gz mandoc-08be124a58f07e4e41c58ea794f3e9eb04230e2b.tar.zst mandoc-08be124a58f07e4e41c58ea794f3e9eb04230e2b.zip |
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.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -1,4 +1,4 @@ -/* $Id: tree.c,v 1.55 2014/09/28 11:32:33 kristaps Exp $ */ +/* $Id: tree.c,v 1.56 2014/10/10 08:44:24 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2013, 2014 Ingo Schwarze <schwarze@openbsd.org> @@ -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 : ""); |