-/* $Id: tree.c,v 1.38 2011/07/21 11:34:53 kristaps Exp $ */
+/* $Id: tree.c,v 1.44 2011/07/21 23:30:39 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@bsd.lv>
*
#endif
#include <assert.h>
+#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
switch (ep->type) {
case (EQN_ROOT):
- puts("eqn-root");
- print_box(ep->child, indent + 1);
- return;
+ printf("eqn-root(%d, %d, %d, %d)\n",
+ EQN_DEFSIZE == ep->size ? 0 : ep->size,
+ ep->pos, ep->font, ep->mark);
+ print_box(ep->first, indent + 1);
+ break;
+ case (EQN_SUBEXPR):
+ printf("eqn-subxpr(%d, %d, %d, %d, %d, %d, \"%s\", \"%s\")\n",
+ EQN_DEFSIZE == ep->size ? 0 : ep->size,
+ ep->pos, ep->font, ep->mark,
+ ep->pile, ep->above,
+ ep->left ? ep->left : "",
+ ep->right ? ep->right : "");
+ print_box(ep->first, indent + 1);
+ break;
case (EQN_TEXT):
- printf("eqn-text: [%s]\n", ep->text);
- print_box(ep->next, indent);
- return;
+ printf("eqn-text(%d, %d, %d, %d): [%s]\n",
+ EQN_DEFSIZE == ep->size ? 0 : ep->size,
+ ep->pos, ep->font, ep->mark, ep->text);
+ break;
default:
break;
}
+
+ print_box(ep->next, indent);
}
static void