summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2008-12-08 12:46:28 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2008-12-08 12:46:28 +0000
commit590484168e25f0faf46db9b6df44c27b50ffeb50 (patch)
tree2710f24f8b76175801d4fb7b79499f2425c13e0d
parent1dc52a2bad8738c62ac5bc9689c09600eb7b1269 (diff)
downloadmandoc-590484168e25f0faf46db9b6df44c27b50ffeb50.tar.gz
Added warnings for using macros in the wrong sections.
-rw-r--r--Makefile5
-rw-r--r--html.c6
-rw-r--r--index.72
-rw-r--r--literals.c40
-rw-r--r--ml.h3
-rw-r--r--mlg.c15
-rw-r--r--private.h24
-rw-r--r--roff.c115
-rw-r--r--roff.h258
-rw-r--r--xml.c5
10 files changed, 311 insertions, 162 deletions
diff --git a/Makefile b/Makefile
index 714c10fd..a018165f 100644
--- a/Makefile
+++ b/Makefile
@@ -35,14 +35,15 @@ INSTALL = Makefile $(HEADS) $(SRCS) $(MANS)
FAIL = test.0 test.1 test.2 test.3 test.4 test.5 test.6 \
test.15 test.20 test.22 test.24 test.26 test.27 test.30 \
- test.36 test.37 test.40 test.50
+ test.36 test.37 test.40 test.50 test.61
SUCCEED = test.7 test.8 test.9 test.10 test.11 test.12 test.13 \
test.14 test.16 test.17 test.18 test.19 test.21 test.23 \
test.25 test.28 test.29 test.31 test.32 test.33 test.34 \
test.35 test.38 test.39 test.41 test.42 test.43 test.44 \
test.45 test.46 test.47 test.48 test.49 test.51 test.52 \
- test.54 test.55 test.56 test.57 test.58 test.59 test.60
+ test.54 test.55 test.56 test.57 test.58 test.59 test.60 \
+ test.62
all: mdocml
diff --git a/html.c b/html.c
index afba9b24..929b2625 100644
--- a/html.c
+++ b/html.c
@@ -75,7 +75,7 @@ static int html_begin(struct md_mbuf *,
const struct md_args *,
const struct tm *,
const char *, const char *,
- const char *, const char *);
+ enum roffmsec, const char *);
static int html_printargs(struct md_mbuf *, int,
const char *, const int *,
const char **, size_t *);
@@ -361,7 +361,7 @@ out:
static int
html_begin(struct md_mbuf *mbuf, const struct md_args *args,
const struct tm *tm, const char *os,
- const char *title, const char *section,
+ const char *title, enum roffmsec section,
const char *vol)
{
const char *preamble, *css, *trail;
@@ -389,7 +389,7 @@ html_begin(struct md_mbuf *mbuf, const struct md_args *args,
res = 0;
(void)snprintf(buf, sizeof(buf) - 1,
- preamble, title, section);
+ preamble, title, ml_section(section));
if ( ! ml_puts(mbuf, buf, &res))
return(0);
diff --git a/index.7 b/index.7
index 4619c094..53b294b4 100644
--- a/index.7
+++ b/index.7
@@ -61,6 +61,8 @@ sane macro argument values (such as those for
or
.Sq \&.Sm ) ,
.It
+valid manual sections and systems;
+.It
and so on.
.El
.\"
diff --git a/literals.c b/literals.c
index 71059cfb..d132c7ea 100644
--- a/literals.c
+++ b/literals.c
@@ -26,6 +26,46 @@
char *
+ml_section(enum roffmsec sec)
+{
+
+ switch (sec) {
+ case(ROFF_MSEC_1):
+ return("1");
+ case(ROFF_MSEC_2):
+ return("2");
+ case(ROFF_MSEC_3):
+ return("3");
+ case(ROFF_MSEC_3p):
+ return("3p");
+ case(ROFF_MSEC_4):
+ return("4");
+ case(ROFF_MSEC_5):
+ return("5");
+ case(ROFF_MSEC_6):
+ return("6");
+ case(ROFF_MSEC_7):
+ return("7");
+ case(ROFF_MSEC_8):
+ return("8");
+ case(ROFF_MSEC_9):
+ return("9");
+ case(ROFF_MSEC_UNASS):
+ return("unass");
+ case(ROFF_MSEC_DRAFT):
+ return("draft");
+ case(ROFF_MSEC_PAPER):
+ return("paper");
+ default:
+ break;
+ }
+
+ abort();
+ /* NOTREACHED */
+}
+
+
+char *
ml_literal(int tok, const int *argc,
const char **argv, const char **morep)
{
diff --git a/ml.h b/ml.h
index 3fea13b6..58a78ad6 100644
--- a/ml.h
+++ b/ml.h
@@ -34,7 +34,7 @@ struct ml_cbs {
const struct md_args *,
const struct tm *,
const char *, const char *,
- const char *, const char *);
+ enum roffmsec, const char *);
int (*ml_end)(struct md_mbuf *,
const struct md_args *);
ssize_t (*ml_beginstring)(struct md_mbuf *,
@@ -67,6 +67,7 @@ int ml_putchars(struct md_mbuf *,
char, size_t, size_t *);
char *ml_literal(int, const int *,
const char **, const char **);
+char *ml_section(enum roffmsec);
struct md_mlg *mlg_alloc(const struct md_args *,
const struct md_rbuf *, struct md_mbuf *,
diff --git a/mlg.c b/mlg.c
index 6ca4522d..e930b7d0 100644
--- a/mlg.c
+++ b/mlg.c
@@ -64,7 +64,7 @@ static void mlg_roffmsg(void *arg,
const char *, const char *);
static int mlg_roffhead(void *, const struct tm *,
const char *, const char *,
- const char *, const char *);
+ enum roffmsec, const char *);
static int mlg_rofftail(void *);
static int mlg_roffin(void *, int,
int *, const char **);
@@ -362,10 +362,10 @@ mlg_exit(struct md_mlg *p, int flush)
int c;
c = roff_free(p->tree, flush);
- free(p);
-
(*p->cbs.ml_free)(p->data);
+ free(p);
+
return(c);
}
@@ -415,7 +415,7 @@ mlg_alloc(const struct md_args *args,
static int
mlg_roffhead(void *arg, const struct tm *tm, const char *os,
- const char *title, const char *sec, const char *vol)
+ const char *title, enum roffmsec sec, const char *vol)
{
struct md_mlg *p;
@@ -462,6 +462,8 @@ mlg_literal_special(struct md_mlg *p, int tok, const char *start,
if ( ! mlg_begintag(p, MD_NS_INLINE, tok, NULL, more))
return(0);
+ /* FIXME: must be ml-filtered. */
+
lit = ml_literal(tok, argc, argv, more);
assert(lit);
@@ -510,12 +512,13 @@ mlg_formatted_special(struct md_mlg *p, int tok,
{
char buf[256], *lit;
- /* FIXME: *more must be ml-filtered. */
-
if ( ! mlg_begintag(p, MD_NS_INLINE, tok, NULL, more))
return(0);
+ /* FIXME: must be ml-filtered. */
+
lit = ml_literal(tok, argc, argv, more);
+
assert(lit);
assert(*more);
(void)snprintf(buf, sizeof(buf), lit, *more++);
diff --git a/private.h b/private.h
index e02e9701..109417cb 100644
--- a/private.h
+++ b/private.h
@@ -244,13 +244,33 @@ struct md_mbuf {
extern const char *const *toknames;
extern const char *const *tokargnames;
-enum roffmsg { ROFF_WARN, ROFF_ERROR };
+enum roffmsg {
+ ROFF_WARN,
+ ROFF_ERROR
+};
+
+enum roffmsec {
+ ROFF_MSEC_1,
+ ROFF_MSEC_2,
+ ROFF_MSEC_3,
+ ROFF_MSEC_3p,
+ ROFF_MSEC_4,
+ ROFF_MSEC_5,
+ ROFF_MSEC_6,
+ ROFF_MSEC_7,
+ ROFF_MSEC_8,
+ ROFF_MSEC_9,
+ ROFF_MSEC_UNASS,
+ ROFF_MSEC_DRAFT,
+ ROFF_MSEC_PAPER,
+ ROFF_MSEC_MAX
+};
struct roffcb {
void (*roffmsg)(void *, enum roffmsg,
const char *, const char *, const char *);
int (*roffhead)(void *, const struct tm *, const char *,
- const char *, const char *, const char *);
+ const char *, enum roffmsec, const char *);
int (*rofftail)(void *);
int (*roffdata)(void *, int, const char *, const char *);
int (*roffin)(void *, int, int *, const char **);
diff --git a/roff.c b/roff.c
index 00ced68a..fcb50368 100644
--- a/roff.c
+++ b/roff.c
@@ -57,7 +57,7 @@ struct rofftree {
char name[64]; /* `Nm' results. */
char os[64]; /* `Os' results. */
char title[64]; /* `Dt' results. */
- char section[64]; /* `Dt' results. */
+ enum roffmsec section;
char volume[64]; /* `Dt' results. */
int state;
#define ROFF_PRELUDE (1 << 1) /* In roff prelude. */
@@ -80,6 +80,8 @@ static int roffscan(int, const int *);
static int rofffindtok(const char *);
static int rofffindarg(const char *);
static int rofffindcallable(const char *);
+static int roffismsec(const char *);
+static int roffispunct(const char *);
static int roffargs(const struct rofftree *,
int, char *, char **);
static int roffargok(int, int);
@@ -88,6 +90,7 @@ static int roffnextopt(const struct rofftree *,
static int roffparseopts(struct rofftree *, int,
char ***, int *, char **);
static int roffcall(struct rofftree *, int, char **);
+static int roffexit(struct rofftree *, int);
static int roffparse(struct rofftree *, char *);
static int textparse(struct rofftree *, char *);
static int roffdata(struct rofftree *, int, char *);
@@ -133,7 +136,7 @@ roff_free(struct rofftree *tree, int flush)
while (tree->last) {
t = tree->last->tok;
- if ( ! (*tokens[t].cb)(t, tree, NULL, ROFF_EXIT))
+ if ( ! roffexit(tree, t))
goto end;
}
@@ -166,6 +169,7 @@ roff_alloc(const struct roffcb *cb, void *args)
tree->state = ROFF_PRELUDE;
tree->arg = args;
+ tree->section = ROFF_MSEC_MAX;
(void)memcpy(&tree->cb, cb, sizeof(struct roffcb));
@@ -326,14 +330,7 @@ roffparse(struct rofftree *tree, char *buf)
if (ROFF_MAX == (tok = rofffindtok(buf + 1))) {
roff_err(tree, buf + 1, "bogus line macro");
return(0);
- } else if (NULL == tokens[tok].cb) {
- roff_err(tree, buf + 1, "unsupported macro `%s'",
- toknames[tok]);
- return(0);
- }
-
- assert(ROFF___ != tok);
- if ( ! roffargs(tree, tok, buf, argv))
+ } else if ( ! roffargs(tree, tok, buf, argv))
return(0);
argvp = (char **)argv;
@@ -344,7 +341,7 @@ roffparse(struct rofftree *tree, char *buf)
if (ROFF_PRELUDE & tree->state) {
assert(NULL == tree->last);
- return((*tokens[tok].cb)(tok, tree, argvp, ROFF_ENTER));
+ return(roffcall(tree, tok, argvp));
}
assert(ROFF_BODY & tree->state);
@@ -375,9 +372,9 @@ roffparse(struct rofftree *tree, char *buf)
*/
if (ROFF_LAYOUT != tokens[tok].type)
- return((*tokens[tok].cb)(tok, tree, argvp, ROFF_ENTER));
+ return(roffcall(tree, tok, argvp));
if (0 == tokens[tok].ctx)
- return((*tokens[tok].cb)(tok, tree, argvp, ROFF_ENTER));
+ return(roffcall(tree, tok, argvp));
/*
* First consider implicit-end tags, like as follows:
@@ -419,7 +416,7 @@ roffparse(struct rofftree *tree, char *buf)
*/
if (NULL == n)
- return((*tokens[tok].cb)(tok, tree, argvp, ROFF_ENTER));
+ return(roffcall(tree, tok, argvp));
/*
* Close out all intermediary scoped blocks, then hang
@@ -428,11 +425,11 @@ roffparse(struct rofftree *tree, char *buf)
do {
t = tree->last->tok;
- if ( ! (*tokens[t].cb)(t, tree, NULL, ROFF_EXIT))
+ if ( ! roffexit(tree, t))
return(0);
} while (t != tok);
- return((*tokens[tok].cb)(tok, tree, argvp, ROFF_ENTER));
+ return(roffcall(tree, tok, argvp));
}
/*
@@ -468,7 +465,7 @@ roffparse(struct rofftree *tree, char *buf)
/* LINTED */
do {
t = tree->last->tok;
- if ( ! (*tokens[t].cb)(t, tree, NULL, ROFF_EXIT))
+ if ( ! roffexit(tree, t))
return(0);
} while (t != tokens[tok].ctx);
@@ -520,6 +517,41 @@ rofffindtok(const char *buf)
static int
+roffismsec(const char *p)
+{
+
+ if (0 == strcmp(p, "1"))
+ return(ROFF_MSEC_1);
+ else if (0 == strcmp(p, "2"))
+ return(ROFF_MSEC_2);
+ else if (0 == strcmp(p, "3"))
+ return(ROFF_MSEC_3);
+ else if (0 == strcmp(p, "3p"))
+ return(ROFF_MSEC_3p);
+ else if (0 == strcmp(p, "4"))
+ return(ROFF_MSEC_4);
+ else if (0 == strcmp(p, "5"))
+ return(ROFF_MSEC_5);
+ else if (0 == strcmp(p, "6"))
+ return(ROFF_MSEC_6);
+ else if (0 == strcmp(p, "7"))
+ return(ROFF_MSEC_7);
+ else if (0 == strcmp(p, "8"))
+ return(ROFF_MSEC_8);
+ else if (0 == strcmp(p, "9"))
+ return(ROFF_MSEC_9);
+ else if (0 == strcmp(p, "unass"))
+ return(ROFF_MSEC_UNASS);
+ else if (0 == strcmp(p, "draft"))
+ return(ROFF_MSEC_DRAFT);
+ else if (0 == strcmp(p, "paper"))
+ return(ROFF_MSEC_PAPER);
+
+ return(ROFF_MSEC_MAX);
+}
+
+
+static int
roffispunct(const char *p)
{
@@ -642,7 +674,15 @@ roffspecial(struct rofftree *tree, int tok, const char *start,
return(0);
case (ROFF_Xr):
+ if (2 == sz) {
+ assert(ordp[1]);
+ if (ROFF_MSEC_MAX != roffismsec(ordp[1]))
+ break;
+ roff_warn(tree, start, "invalid `%s' manual "
+ "section", toknames[tok]);
+ }
/* FALLTHROUGH */
+
case (ROFF_Fn):
if (0 != sz)
break;
@@ -707,17 +747,39 @@ roffspecial(struct rofftree *tree, int tok, const char *start,
static int
+roffexit(struct rofftree *tree, int tok)
+{
+
+ assert(tokens[tok].cb);
+ return((*tokens[tok].cb)(tok, tree, NULL, ROFF_EXIT));
+}
+
+
+static int
roffcall(struct rofftree *tree, int tok, char **argv)
{
+ int i;
+ enum roffmsec c;
if (NULL == tokens[tok].cb) {
- roff_err(tree, *argv, "unsupported macro `%s'",
+ roff_err(tree, *argv, "`%s' is unsupported",
toknames[tok]);
return(0);
}
- if ( ! (*tokens[tok].cb)(tok, tree, argv, ROFF_ENTER))
- return(0);
- return(1);
+ if (tokens[tok].sections && ROFF_MSEC_MAX != tree->section) {
+ i = 0;
+ while (ROFF_MSEC_MAX !=
+ (c = tokens[tok].sections[i++]))
+ if (c == tree->section)
+ break;
+ if (ROFF_MSEC_MAX == c) {
+ roff_warn(tree, *argv, "`%s' is not a valid "
+ "macro in this manual section",
+ toknames[tok]);
+ }
+ }
+
+ return((*tokens[tok].cb)(tok, tree, argv, ROFF_ENTER));
}
@@ -944,9 +1006,10 @@ roff_Dt(ROFFCALL_ARGS)
if (NULL == *argv) {
roff_err(tree, *argv, "`Dt' needs section");
return(0);
- } else if (strlcpy(tree->section, *argv, sizeof(tree->section))
- >= sizeof(tree->section)) {
- roff_err(tree, *argv, "`Dt' section too long");
+ }
+
+ if (ROFF_MSEC_MAX == (tree->section = roffismsec(*argv))) {
+ roff_err(tree, *argv, "bad `Dt' section");
return(0);
}
@@ -1077,6 +1140,10 @@ roff_Os(ROFFCALL_ARGS)
tree->state &= ~ROFF_PRELUDE;
tree->state |= ROFF_BODY;
+ assert(ROFF_MSEC_MAX != tree->section);
+ assert(0 != tree->title[0]);
+ assert(0 != tree->os[0]);
+
assert(NULL == tree->last);
return((*tree->cb.roffhead)(tree->arg, &tree->tm,
diff --git a/roff.h b/roff.h
index a07676b9..740fa1eb 100644
--- a/roff.h
+++ b/roff.h
@@ -39,6 +39,7 @@ struct rofftree;
struct rofftok {
int (*cb)(ROFFCALL_ARGS); /* Callback. */
+ const enum roffmsec *sections;
const int *args; /* Args (or NULL). */
const int *parents; /* Limit to parents. */
const int *children; /* Limit to kids. */
@@ -63,31 +64,44 @@ static int roff_noop(ROFFCALL_ARGS);
static int roff_depr(ROFFCALL_ARGS);
static int roff_ordered(ROFFCALL_ARGS);
-static const int roffarg_An[] = { ROFF_Split, ROFF_Nosplit, ROFF_ARGMAX };
-static const int roffarg_Bd[] = { ROFF_Ragged, ROFF_Unfilled, ROFF_Literal,
- ROFF_File, ROFF_Offset, ROFF_Filled, ROFF_Compact, ROFF_ARGMAX };
+static const int roffarg_An[] = { ROFF_Split, ROFF_Nosplit,
+ ROFF_ARGMAX };
+static const int roffarg_Bd[] = { ROFF_Ragged, ROFF_Unfilled,
+ ROFF_Literal, ROFF_File, ROFF_Offset, ROFF_Filled, ROFF_Compact,
+ ROFF_ARGMAX };
static const int roffarg_Bk[] = { ROFF_Words, ROFF_ARGMAX };
static const int roffarg_Ex[] = { ROFF_Std, ROFF_ARGMAX };
static const int roffarg_Rv[] = { ROFF_Std, ROFF_ARGMAX };
static const int roffarg_Bl[] = { ROFF_Bullet, ROFF_Dash, ROFF_Hyphen,
- ROFF_Item, ROFF_Enum, ROFF_Tag, ROFF_Diag, ROFF_Hang, ROFF_Ohang,
- ROFF_Inset, ROFF_Column, ROFF_Offset, ROFF_Width, ROFF_Compact,
- ROFF_ARGMAX };
+ ROFF_Item, ROFF_Enum, ROFF_Tag, ROFF_Diag, ROFF_Hang,
+ ROFF_Ohang, ROFF_Inset, ROFF_Column, ROFF_Offset, ROFF_Width,
+ ROFF_Compact, ROFF_ARGMAX };
static const int roffarg_St[] = { ROFF_p1003_1_88, ROFF_p1003_1_90,
- ROFF_p1003_1_96, ROFF_p1003_1_2001, ROFF_p1003_1_2004, ROFF_p1003_1,
- ROFF_p1003_1b, ROFF_p1003_1b_93, ROFF_p1003_1c_95, ROFF_p1003_1g_2000,
- ROFF_p1003_2_92, ROFF_p1387_2_95, ROFF_p1003_2, ROFF_p1387_2,
- ROFF_isoC_90, ROFF_isoC_amd1, ROFF_isoC_tcor1, ROFF_isoC_tcor2,
- ROFF_isoC_99, ROFF_ansiC, ROFF_ansiC_89, ROFF_ansiC_99, ROFF_ieee754,
- ROFF_iso8802_3, ROFF_xpg3, ROFF_xpg4, ROFF_xpg4_2, ROFF_xpg4_3,
- ROFF_xbd5, ROFF_xcu5, ROFF_xsh5, ROFF_xns5, ROFF_xns5_2d2_0,
- ROFF_xcurses4_2, ROFF_susv2, ROFF_susv3, ROFF_svid4, ROFF_ARGMAX };
+ ROFF_p1003_1_96, ROFF_p1003_1_2001, ROFF_p1003_1_2004,
+ ROFF_p1003_1, ROFF_p1003_1b, ROFF_p1003_1b_93, ROFF_p1003_1c_95,
+ ROFF_p1003_1g_2000, ROFF_p1003_2_92, ROFF_p1387_2_95,
+ ROFF_p1003_2, ROFF_p1387_2, ROFF_isoC_90, ROFF_isoC_amd1,
+ ROFF_isoC_tcor1, ROFF_isoC_tcor2, ROFF_isoC_99, ROFF_ansiC,
+ ROFF_ansiC_89, ROFF_ansiC_99, ROFF_ieee754, ROFF_iso8802_3,
+ ROFF_xpg3, ROFF_xpg4, ROFF_xpg4_2, ROFF_xpg4_3, ROFF_xbd5,
+ ROFF_xcu5, ROFF_xsh5, ROFF_xns5, ROFF_xns5_2d2_0,
+ ROFF_xcurses4_2, ROFF_susv2, ROFF_susv3, ROFF_svid4,
+ ROFF_ARGMAX };
static const int roffchild_Bl[] = { ROFF_It, ROFF_El, ROFF_MAX };
static const int roffchild_Fo[] = { ROFF_Fa, ROFF_Fc, ROFF_MAX };
static const int roffchild_Rs[] = { ROFF_Re, ROFF__A, ROFF__B, ROFF__D,
- ROFF__I, ROFF__J, ROFF__N, ROFF__O, ROFF__P, ROFF__R, ROFF__T, ROFF__V,
- ROFF_MAX };
+ ROFF__I, ROFF__J, ROFF__N, ROFF__O, ROFF__P, ROFF__R, ROFF__T,
+ ROFF__V, ROFF_MAX };
+
+static const enum roffmsec roffmsec_Cd[] = { ROFF_MSEC_4,
+ ROFF_MSEC_MAX };
+static const enum roffmsec roffmsec_Er[] = { ROFF_MSEC_2,
+ ROFF_MSEC_MAX };
+static const enum roffmsec roffmsec_Ex[] = { ROFF_MSEC_1,
+ ROFF_MSEC_6, ROFF_MSEC_8, ROFF_MSEC_MAX };
+static const enum roffmsec roffmsec_Rv[] = { ROFF_MSEC_2,
+ ROFF_MSEC_3, ROFF_MSEC_MAX };
static const int roffparent_El[] = { ROFF_Bl, ROFF_It, ROFF_MAX };
static const int roffparent_Fc[] = { ROFF_Fo, ROFF_Fa, ROFF_MAX };
@@ -96,112 +110,112 @@ static const int roffparent_It[] = { ROFF_Bl, ROFF_It, ROFF_MAX };
static const int roffparent_Re[] = { ROFF_Rs, ROFF_MAX };
static const struct rofftok tokens[ROFF_MAX] = {
- { roff_noop, NULL, NULL, NULL, 0, ROFF_COMMENT, 0 }, /* \" */
- { roff_Dd, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Dd */
- { roff_Dt, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Dt */
- { roff_Os, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Os */
- { roff_layout, NULL, NULL, NULL, ROFF_Sh, ROFF_LAYOUT, 0 }, /* Sh */
- { roff_layout, NULL, NULL, NULL, ROFF_Ss, ROFF_LAYOUT, 0 }, /* Ss */
- { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Pp */ /* XXX 0 args */
- { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_LSCOPE }, /* D1 */
- { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_LSCOPE }, /* Dl */
- { roff_layout, roffarg_Bd, NULL, NULL, 0, ROFF_LAYOUT, 0 }, /* Bd */
- { roff_noop, NULL, NULL, NULL, ROFF_Bd, ROFF_LAYOUT, 0 }, /* Ed */
- { roff_layout, roffarg_Bl, NULL, roffchild_Bl, 0, ROFF_LAYOUT, 0 }, /* Bl */
- { roff_noop, NULL, roffparent_El, NULL, ROFF_Bl, ROFF_LAYOUT, 0 }, /* El */
- { roff_layout, NULL, roffparent_It, NULL, ROFF_It, ROFF_LAYOUT, ROFF_PARSED | ROFF_SHALLOW }, /* It */
- { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Ad */ /* FIXME */
- { roff_text, roffarg_An, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED }, /* An */ /* FIXME: no-args? */
-/*Ok*/ { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Ar */
-/*Ok*/ { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Cd */ /* FIXME: section. */
-/*Ok*/ { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Cm */
-/*Ok*/ { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Dv */ /* XXX needs arg */
-/*Ok*/ { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Er */ /* XXX needs arg */ /* FIXME: section. */
-/*Ok*/ { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Ev */ /* XXX needs arg */
-/*Ok*/ {roff_ordered, roffarg_Ex, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Ex */ /* FIXME: sections. */
- { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Fa */ /* XXX needs arg */
-/*Ok*/ { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Fd */ /* FIXME: section/linebreak. */
-/*Ok*/ { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Fl */
-/*Ok*/ {roff_ordered, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Fn */ /* FIXME: section/linebreak. */
-/*Ok*/ { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED }, /* Ft */ /* FIXME: section/linebreak. */
-/*Ok*/ { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Ic */ /* FIXME: needs arg */
-/*Ok*/ {roff_ordered, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* In */ /* FIXME: section/linebreak. */
-/*OK*/ { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Li */
-/*Ok*/ { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Nd */ /* FIXME: section. */
-/*Ok*/ {roff_ordered, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Nm */ /* FIXME: sections. */
-/*Ok*/ { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE | ROFF_LSCOPE }, /* Op */
-/*Ok*/ { roff_depr, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Ot */
-/*Ok*/ { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Pa */
-/*Ok*/ {roff_ordered, roffarg_Rv, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Rv */
-/*Ok*/ {roff_ordered, roffarg_St, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* St */
-/*Ok*/ { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Va */
-/*Ok*/ { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Vt */ /* FIXME: section/linebreak. */
-/*Ok*/ {roff_ordered, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Xr */
- { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED }, /* %A */
- { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE}, /* %B */
- { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* %D */
- { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE}, /* %I */
- { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE}, /* %J */
- { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* %N */
- { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* %O */
- { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* %P */
- { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* %R */
- { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED }, /* %T */
- { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* %V */
- { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Ac */
- { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Ao */
-/*Ok*/ { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE | ROFF_LSCOPE }, /* Aq */
-/*Ok*/ {roff_ordered, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* At */
- { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Bc */
- { roff_layout, NULL, NULL, NULL, 0, ROFF_LAYOUT, 0 }, /* Bf */ /* FIXME */
- { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Bo */
-/*Ok*/ { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE | ROFF_LSCOPE }, /* Bq */
-/*Ok*/ {roff_ordered, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED }, /* Bsx */
-/*Ok*/ {roff_ordered, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED }, /* Bx */
- { NULL, NULL, NULL, NULL, 0, ROFF_SPECIAL, 0 }, /* Db */
- { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Dc */
- { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Do */
-/*Ok*/ { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE | ROFF_LSCOPE }, /* Dq */
- { NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Ec */
- { roff_noop, NULL, NULL, NULL, ROFF_Bf, ROFF_LAYOUT, 0 }, /* Ef */
-/*Ok*/ { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Em */ /* XXX needs arg */
- { NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Eo */
-/*Ok*/ {roff_ordered, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED }, /* Fx */
- { NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED }, /* Ms */
- { NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* No */
-/*Ok*/ { roff_Ns, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Ns */
-/*Ok*/ {roff_ordered, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED }, /* Nx */
-/*Ok*/ {roff_ordered, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED }, /* Ox */
- { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Pc */
- { NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED }, /* Pf */
- { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Po */
-/*Ok*/ { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE | ROFF_LSCOPE }, /* Pq */
- { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Qc */
-/*Ok*/ { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Ql */
- { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Qo */
-/*Ok*/ { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE | ROFF_LSCOPE }, /* Qq */
- { roff_noop, NULL, roffparent_Re, NULL, ROFF_Rs, ROFF_LAYOUT, 0 }, /* Re */
- { roff_layout, NULL, NULL, roffchild_Rs, 0, ROFF_LAYOUT, 0 }, /* Rs */
- { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Sc */
- { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* So */
-/*Ok*/ { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE | ROFF_LSCOPE }, /* Sq */
-/*Ok*/ {roff_ordered, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Sm */
-/*Ok*/ {roff_ordered, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Sx */
-/*Ok*/ { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Sy */
-/*Ok*/ { roff_text, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Tn */
-/*Ok*/ {roff_ordered, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED }, /* Ux */
- { NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Xc */
- { NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Xo */
-/*Ok*/ { roff_layout, NULL, NULL, roffchild_Fo, 0, ROFF_LAYOUT, 0 }, /* Fo */ /* FIXME: section/linebreak. */
-/*Ok*/ { roff_noop, NULL, roffparent_Fc, NULL, ROFF_Fo, ROFF_LAYOUT, 0 }, /* Fc */ /* FIXME: section/linebreak. */
-/*Ok*/ { roff_layout, NULL, NULL, NULL, 0, ROFF_LAYOUT, 0 }, /* Oo */
-/*Ok*/ { roff_noop, NULL, roffparent_Oc, NULL, ROFF_Oo, ROFF_LAYOUT, 0 }, /* Oc */
- { NULL, roffarg_Bk, NULL, NULL, 0, ROFF_LAYOUT, 0 }, /* Bk */
- { NULL, NULL, NULL, NULL, ROFF_Bk, ROFF_LAYOUT, 0 }, /* Ek */
-/*Ok*/ {roff_ordered, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Bt */
- { NULL, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Hf */
-/*Ok*/ { roff_depr, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Fr */
-/*Ok*/ {roff_ordered, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Ud */
+ { roff_noop, NULL, NULL, NULL, NULL, 0, ROFF_COMMENT, 0 }, /* \" */
+ { roff_Dd, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Dd */
+ { roff_Dt, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Dt */
+ { roff_Os, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Os */
+ { roff_layout, NULL, NULL, NULL, NULL, ROFF_Sh, ROFF_LAYOUT, 0 }, /* Sh */
+ { roff_layout, NULL, NULL, NULL, NULL, ROFF_Ss, ROFF_LAYOUT, 0 }, /* Ss */
+ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Pp */ /* XXX 0 args */
+ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_LSCOPE }, /* D1 */
+ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_LSCOPE }, /* Dl */
+ { roff_layout, NULL, roffarg_Bd, NULL, NULL, 0, ROFF_LAYOUT, 0 }, /* Bd */
+ { roff_noop, NULL, NULL, NULL, NULL, ROFF_Bd, ROFF_LAYOUT, 0 }, /* Ed */
+ { roff_layout, NULL, roffarg_Bl, NULL, roffchild_Bl, 0, ROFF_LAYOUT, 0 }, /* Bl */
+ { roff_noop, NULL, NULL, roffparent_El, NULL, ROFF_Bl, ROFF_LAYOUT, 0 }, /* El */
+ { roff_layout, NULL, NULL, roffparent_It, NULL, ROFF_It, ROFF_LAYOUT, ROFF_PARSED | ROFF_SHALLOW }, /* It */
+ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Ad */ /* FIXME */
+ { roff_text, NULL, roffarg_An, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED }, /* An */ /* FIXME: no-args? */
+/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Ar */
+/*Ok*/ { roff_text, roffmsec_Cd, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Cd */
+/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Cm */
+/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Dv */ /* XXX needs arg */
+/*Ok*/ { roff_text, roffmsec_Er, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Er */ /* XXX needs arg */
+/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Ev */ /* XXX needs arg */
+/*Ok*/ {roff_ordered, roffmsec_Ex, roffarg_Ex, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Ex */
+ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Fa */ /* XXX needs arg */
+/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Fd */ /* FIXME: section/linebreak. */
+/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Fl */
+/*Ok*/ {roff_ordered, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Fn */ /* FIXME: section/linebreak. */
+/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED }, /* Ft */ /* FIXME: section/linebreak. */
+/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Ic */ /* FIXME: needs arg */
+/*Ok*/ {roff_ordered, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* In */ /* FIXME: section/linebreak. */
+/*OK*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Li */
+/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Nd */ /* FIXME: section. */
+/*Ok*/ {roff_ordered, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Nm */ /* FIXME: sections. */
+/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE | ROFF_LSCOPE }, /* Op */
+/*Ok*/ { roff_depr, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Ot */
+/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Pa */
+/*Ok*/ {roff_ordered, roffmsec_Rv, roffarg_Rv, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Rv */
+/*Ok*/ {roff_ordered, NULL, roffarg_St, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* St */
+/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Va */
+/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Vt */ /* FIXME: section/linebreak. */
+/*Ok*/ {roff_ordered, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Xr */
+ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED }, /* %A */
+ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE}, /* %B */
+ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* %D */
+ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE}, /* %I */
+ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE}, /* %J */
+ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* %N */
+ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* %O */
+ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* %P */
+ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* %R */
+ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED }, /* %T */
+ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* %V */
+ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Ac */
+ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Ao */
+/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE | ROFF_LSCOPE }, /* Aq */
+/*Ok*/ {roff_ordered, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* At */
+ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Bc */
+ { roff_layout, NULL, NULL, NULL, NULL, 0, ROFF_LAYOUT, 0 }, /* Bf */ /* FIXME */
+ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Bo */
+/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE | ROFF_LSCOPE }, /* Bq */
+/*Ok*/ {roff_ordered, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED }, /* Bsx */
+/*Ok*/ {roff_ordered, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED }, /* Bx */
+ { NULL, NULL, NULL, NULL, NULL, 0, ROFF_SPECIAL, 0 }, /* Db */
+ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Dc */
+ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Do */
+/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE | ROFF_LSCOPE }, /* Dq */
+ { NULL, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Ec */
+ { roff_noop, NULL, NULL, NULL, NULL, ROFF_Bf, ROFF_LAYOUT, 0 }, /* Ef */
+/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Em */ /* XXX needs arg */
+ { NULL, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Eo */
+/*Ok*/ {roff_ordered, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED }, /* Fx */
+ { NULL, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED }, /* Ms */
+ { NULL, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* No */
+/*Ok*/ { roff_Ns, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Ns */
+/*Ok*/ {roff_ordered, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED }, /* Nx */
+/*Ok*/ {roff_ordered, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED }, /* Ox */
+ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Pc */
+ { NULL, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED }, /* Pf */
+ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Po */
+/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE | ROFF_LSCOPE }, /* Pq */
+ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Qc */
+/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Ql */
+ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Qo */
+/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE | ROFF_LSCOPE }, /* Qq */
+ { roff_noop, NULL, NULL, roffparent_Re, NULL, ROFF_Rs, ROFF_LAYOUT, 0 }, /* Re */
+ { roff_layout, NULL, NULL, NULL, roffchild_Rs, 0, ROFF_LAYOUT, 0 }, /* Rs */
+ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Sc */
+ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* So */
+/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE | ROFF_LSCOPE }, /* Sq */
+/*Ok*/ {roff_ordered, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Sm */
+/*Ok*/ {roff_ordered, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Sx */
+/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Sy */
+/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Tn */
+/*Ok*/ {roff_ordered, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED }, /* Ux */
+ { NULL, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Xc */
+ { NULL, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Xo */
+/*Ok*/ { roff_layout, NULL, NULL, NULL, roffchild_Fo, 0, ROFF_LAYOUT, 0 }, /* Fo */ /* FIXME: section/linebreak. */
+/*Ok*/ { roff_noop, NULL, NULL, roffparent_Fc, NULL, ROFF_Fo, ROFF_LAYOUT, 0 }, /* Fc */ /* FIXME: section/linebreak. */
+/*Ok*/ { roff_layout, NULL, NULL, NULL, NULL, 0, ROFF_LAYOUT, 0 }, /* Oo */
+/*Ok*/ { roff_noop, NULL, NULL, roffparent_Oc, NULL, ROFF_Oo, ROFF_LAYOUT, 0 }, /* Oc */
+ { NULL, NULL, roffarg_Bk, NULL, NULL, 0, ROFF_LAYOUT, 0 }, /* Bk */
+ { NULL, NULL, NULL, NULL, NULL, ROFF_Bk, ROFF_LAYOUT, 0 }, /* Ek */
+/*Ok*/ {roff_ordered, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Bt */
+ { NULL, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Hf */
+/*Ok*/ { roff_depr, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Fr */
+/*Ok*/ {roff_ordered, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Ud */
};
#define ROFF_VALUE (1 << 0)
diff --git a/xml.c b/xml.c
index fb1405e5..9d8a6693 100644
--- a/xml.c
+++ b/xml.c
@@ -44,7 +44,7 @@ static int xml_begin(struct md_mbuf *,
const struct md_args *,
const struct tm *,
const char *, const char *,
- const char *, const char *);
+ enum roffmsec, const char *);
static int xml_end(struct md_mbuf *,
const struct md_args *);
static ssize_t xml_printtagname(struct md_mbuf *,
@@ -123,7 +123,7 @@ xml_printtagname(struct md_mbuf *mbuf, enum md_ns ns, int tok)
static int
xml_begin(struct md_mbuf *mbuf, const struct md_args *args,
const struct tm *tm, const char *os,
- const char *title, const char *section,
+ const char *title, enum roffmsec section,
const char *vol)
{
@@ -199,6 +199,7 @@ int
xml_alloc(void **p)
{
+ *p = NULL;
return(1);
}