]> git.cameronkatri.com Git - mandoc.git/blobdiff - tree.c
Put tbl_alloc function right into the addspan() one, as this is the only
[mandoc.git] / tree.c
diff --git a/tree.c b/tree.c
index 70bd73d9ef27dc7ed15e56fe0c235839c0e39f71..65652adb2111bc3e4775b598cc0cbbf0d9067d64 100644 (file)
--- a/tree.c
+++ b/tree.c
@@ -1,4 +1,4 @@
-/*     $Id: tree.c,v 1.31 2011/01/03 13:59:21 kristaps Exp $ */
+/*     $Id: tree.c,v 1.34 2011/02/06 22:02:58 kristaps Exp $ */
 /*
  * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@bsd.lv>
  *
@@ -92,6 +92,9 @@ print_mdoc(const struct mdoc_node *n, int indent)
        case (MDOC_TBL):
                t = "tbl";
                break;
+       case (MDOC_EQN):
+               t = "eqn";
+               break;
        default:
                abort();
                /* NOTREACHED */
@@ -128,6 +131,9 @@ print_mdoc(const struct mdoc_node *n, int indent)
                break;
        case (MDOC_TBL):
                break;
+       case (MDOC_EQN):
+               p = "eqn";
+               break;
        case (MDOC_ROOT):
                p = "root";
                break;
@@ -198,6 +204,9 @@ print_man(const struct man_node *n, int indent)
        case (MAN_TBL):
                t = "tbl";
                break;
+       case (MAN_EQN):
+               t = "eqn";
+               break;
        default:
                abort();
                /* NOTREACHED */
@@ -223,6 +232,9 @@ print_man(const struct man_node *n, int indent)
                break;
        case (MAN_TBL):
                break;
+       case (MAN_EQN):
+               p = "eqn";
+               break;
        default:
                abort();
                /* NOTREACHED */
@@ -254,8 +266,6 @@ print_span(const struct tbl_span *sp, int indent)
        for (i = 0; i < indent; i++)
                putchar('\t');
 
-       printf("tbl: ");
-
        switch (sp->pos) {
        case (TBL_SPAN_HORIZ):
                putchar('-');
@@ -282,8 +292,14 @@ print_span(const struct tbl_span *sp, int indent)
                default:
                        break;
                }
-               printf("[%s%s]", dp->string, dp->layout ?  "" : "*");
-               if (dp->next)
-                       putchar(' ');
+               printf("[\"%s\"", dp->string ? dp->string : "");
+               if (dp->spans)
+                       printf("(%d)", dp->spans);
+               if (NULL == dp->layout)
+                       putchar('*');
+               putchar(']');
+               putchar(' ');
        }
+
+       printf("(tbl) %d:1", sp->line);
 }