diff options
Diffstat (limited to 'mdocml.c')
-rw-r--r-- | mdocml.c | 20 |
1 files changed, 15 insertions, 5 deletions
@@ -181,13 +181,16 @@ buf_begin(struct md_parse *p) static void print_node(const struct mdoc_node *n, int indent) { - const char *p, *t; - int i, j; - size_t argc; - struct mdoc_arg *argv; + const char *p, *t; + int i, j; + size_t argc, sz; + char **params; + struct mdoc_arg *argv; argv = NULL; argc = 0; + params = NULL; + sz = 0; switch (n->type) { case (MDOC_TEXT): @@ -202,6 +205,8 @@ print_node(const struct mdoc_node *n, int indent) case (MDOC_HEAD): p = mdoc_macronames[n->data.head.tok]; t = "block-head"; + params = n->data.head.args; + sz = n->data.head.sz; break; case (MDOC_ELEM): assert(NULL == n->child); @@ -209,6 +214,8 @@ print_node(const struct mdoc_node *n, int indent) t = "element"; argv = n->data.elem.argv; argc = n->data.elem.argc; + params = n->data.elem.args; + sz = n->data.elem.sz; break; case (MDOC_BLOCK): p = mdoc_macronames[n->data.block.tok]; @@ -231,6 +238,9 @@ print_node(const struct mdoc_node *n, int indent) (void)printf(" \"%s\"", argv[i].value[j]); } + for (i = 0; i < (int)sz; i++) + (void)printf(" \"%s\"", params[i]); + (void)printf("\n"); if (n->child) @@ -340,7 +350,7 @@ msg_err(void *arg, int tok, int col, enum mdoc_err type) fmt = "scope: closure macro `%s' has no context"; break; case (ERR_SCOPE_NONEST): - fmt = "scope: macro `%s' may not be nested"; + fmt = "scope: macro `%s' may not be nested in the current context"; break; case (ERR_MACRO_NOTSUP): fmt = "macro `%s' not supported"; |