summaryrefslogtreecommitdiffstats
path: root/mdocml.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2008-12-28 21:25:09 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2008-12-28 21:25:09 +0000
commit8152d04e0f0a42a8b75100cc7b3b8b46497d046f (patch)
tree8cf46436309431a364ef93550f4dc15717b8d85a /mdocml.c
parentfcdb2b181c2abba92921b7909898488fbe4c74f7 (diff)
downloadmandoc-8152d04e0f0a42a8b75100cc7b3b8b46497d046f.tar.gz
*** empty log message ***
Diffstat (limited to 'mdocml.c')
-rw-r--r--mdocml.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/mdocml.c b/mdocml.c
index 73c4a047..d0082bae 100644
--- a/mdocml.c
+++ b/mdocml.c
@@ -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";