summaryrefslogtreecommitdiffstatshomepage
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
commitf39e2b991210f1443885f9363e390ca32e234309 (patch)
tree636ffaa24545219f2760d5539c968e14c25ef4ef /mdocml.c
parentf560c8171b3c347f410aed692168d4bd5ee00513 (diff)
downloadmandoc-f39e2b991210f1443885f9363e390ca32e234309.tar.gz
mandoc-f39e2b991210f1443885f9363e390ca32e234309.tar.zst
mandoc-f39e2b991210f1443885f9363e390ca32e234309.zip
*** empty log message ***
Diffstat (limited to 'mdocml.c')
-rw-r--r--mdocml.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/mdocml.c b/mdocml.c
index 49b953a5..d872caa3 100644
--- a/mdocml.c
+++ b/mdocml.c
@@ -1,4 +1,4 @@
-/* $Id: mdocml.c,v 1.25 2008/12/28 00:34:20 kristaps Exp $ */
+/* $Id: mdocml.c,v 1.26 2008/12/28 21:25:09 kristaps Exp $ */
/*
* Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -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";