From 08be124a58f07e4e41c58ea794f3e9eb04230e2b Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Fri, 10 Oct 2014 08:44:24 +0000 Subject: 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. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tree.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'tree.c') diff --git a/tree.c b/tree.c index 20386632..087ab55a 100644 --- a/tree.c +++ b/tree.c @@ -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 * Copyright (c) 2013, 2014 Ingo Schwarze @@ -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 : ""); -- cgit v1.2.3-56-ge451