summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mdoc.713
-rw-r--r--mdoc_html.c2
-rw-r--r--mdoc_man.c20
-rw-r--r--mdoc_term.c8
-rw-r--r--mdoc_validate.c29
5 files changed, 33 insertions, 39 deletions
diff --git a/mdoc.7 b/mdoc.7
index 14b996e1..c6c54147 100644
--- a/mdoc.7
+++ b/mdoc.7
@@ -1185,13 +1185,12 @@ See also
and
.Sx \&Dl .
.Ss \&Db
-Switch debugging mode.
-Its syntax is as follows:
-.Pp
-.D1 Pf \. Sx \&Db Cm on | off
-.Pp
-This macro is ignored by
-.Xr mandoc 1 .
+This macro is obsolete.
+No replacement is needed.
+It is ignored by
+.Xr mandoc 1
+and groff including its arguments.
+It was formerly used to toggle a debugging mode.
.Ss \&Dc
Close a
.Sx \&Do
diff --git a/mdoc_html.c b/mdoc_html.c
index 2f561b6f..43123028 100644
--- a/mdoc_html.c
+++ b/mdoc_html.c
@@ -183,7 +183,7 @@ static const struct htmlmdoc mdocs[MDOC_MAX] = {
{mdoc_quote_pre, mdoc_quote_post}, /* Bq */
{mdoc_xx_pre, NULL}, /* Bsx */
{mdoc_bx_pre, NULL}, /* Bx */
- {NULL, NULL}, /* Db */
+ {mdoc_skip_pre, NULL}, /* Db */
{NULL, NULL}, /* Dc */
{mdoc_quote_pre, mdoc_quote_post}, /* Do */
{mdoc_quote_pre, mdoc_quote_post}, /* Dq */
diff --git a/mdoc_man.c b/mdoc_man.c
index 483c986f..bbfa0324 100644
--- a/mdoc_man.c
+++ b/mdoc_man.c
@@ -84,7 +84,7 @@ static int pre_dl(DECL_ARGS);
static int pre_en(DECL_ARGS);
static int pre_enc(DECL_ARGS);
static int pre_em(DECL_ARGS);
-static int pre_es(DECL_ARGS);
+static int pre_skip(DECL_ARGS);
static int pre_ex(DECL_ARGS);
static int pre_fa(DECL_ARGS);
static int pre_fd(DECL_ARGS);
@@ -183,7 +183,7 @@ static const struct manact manacts[MDOC_MAX + 1] = {
{ cond_body, pre_enc, post_enc, "[", "]" }, /* Bq */
{ NULL, pre_ux, NULL, "BSD/OS", NULL }, /* Bsx */
{ NULL, pre_bx, NULL, NULL, NULL }, /* Bx */
- { NULL, NULL, NULL, NULL, NULL }, /* Db */
+ { NULL, pre_skip, NULL, NULL, NULL }, /* Db */
{ NULL, NULL, NULL, NULL, NULL }, /* Dc */
{ cond_body, pre_enc, post_enc, "\\(lq", "\\(rq" }, /* Do */
{ cond_body, pre_enc, post_enc, "\\(lq", "\\(rq" }, /* Dq */
@@ -235,7 +235,7 @@ static const struct manact manacts[MDOC_MAX + 1] = {
{ cond_body, pre_enc, post_enc, "{", "}" }, /* Bro */
{ NULL, NULL, NULL, NULL, NULL }, /* Brc */
{ NULL, NULL, post_percent, NULL, NULL }, /* %C */
- { NULL, pre_es, NULL, NULL, NULL }, /* Es */
+ { NULL, pre_skip, NULL, NULL, NULL }, /* Es */
{ cond_body, pre_en, post_en, NULL, NULL }, /* En */
{ NULL, pre_ux, NULL, "DragonFly", NULL }, /* Dx */
{ NULL, NULL, post_percent, NULL, NULL }, /* %Q */
@@ -1132,13 +1132,6 @@ post_eo(DECL_ARGS)
}
static int
-pre_es(DECL_ARGS)
-{
-
- return(0);
-}
-
-static int
pre_fa(DECL_ARGS)
{
int am_Fa;
@@ -1678,6 +1671,13 @@ pre_rv(DECL_ARGS)
}
static int
+pre_skip(DECL_ARGS)
+{
+
+ return(0);
+}
+
+static int
pre_sm(DECL_ARGS)
{
diff --git a/mdoc_term.c b/mdoc_term.c
index af662bc3..379a0356 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -91,7 +91,6 @@ static int termp_bt_pre(DECL_ARGS);
static int termp_bx_pre(DECL_ARGS);
static int termp_cd_pre(DECL_ARGS);
static int termp_d1_pre(DECL_ARGS);
-static int termp_es_pre(DECL_ARGS);
static int termp_ex_pre(DECL_ARGS);
static int termp_fa_pre(DECL_ARGS);
static int termp_fd_pre(DECL_ARGS);
@@ -111,6 +110,7 @@ static int termp_quote_pre(DECL_ARGS);
static int termp_rs_pre(DECL_ARGS);
static int termp_rv_pre(DECL_ARGS);
static int termp_sh_pre(DECL_ARGS);
+static int termp_skip_pre(DECL_ARGS);
static int termp_sm_pre(DECL_ARGS);
static int termp_sp_pre(DECL_ARGS);
static int termp_ss_pre(DECL_ARGS);
@@ -183,7 +183,7 @@ static const struct termact termacts[MDOC_MAX] = {
{ termp_quote_pre, termp_quote_post }, /* Bq */
{ termp_xx_pre, NULL }, /* Bsx */
{ termp_bx_pre, NULL }, /* Bx */
- { NULL, NULL }, /* Db */
+ { termp_skip_pre, NULL }, /* Db */
{ NULL, NULL }, /* Dc */
{ termp_quote_pre, termp_quote_post }, /* Do */
{ termp_quote_pre, termp_quote_post }, /* Dq */
@@ -235,7 +235,7 @@ static const struct termact termacts[MDOC_MAX] = {
{ termp_quote_pre, termp_quote_post }, /* Bro */
{ NULL, NULL }, /* Brc */
{ NULL, termp____post }, /* %C */
- { termp_es_pre, NULL }, /* Es */
+ { termp_skip_pre, NULL }, /* Es */
{ termp_quote_pre, termp_quote_post }, /* En */
{ termp_xx_pre, NULL }, /* Dx */
{ NULL, termp____post }, /* %Q */
@@ -1838,7 +1838,7 @@ termp_sp_pre(DECL_ARGS)
}
static int
-termp_es_pre(DECL_ARGS)
+termp_skip_pre(DECL_ARGS)
{
return(0);
diff --git a/mdoc_validate.c b/mdoc_validate.c
index dffd925d..e5849068 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -72,7 +72,6 @@ static enum mdoc_sec a2sec(const char *);
static size_t macro2len(enum mdoct);
static void rewrite_macro2len(char **);
-static int ebool(POST_ARGS);
static int berr_ge1(POST_ARGS);
static int bwarn_ge1(POST_ARGS);
static int ewarn_eq0(POST_ARGS);
@@ -122,6 +121,7 @@ static int post_sh_head(POST_ARGS);
static int post_sh_name(POST_ARGS);
static int post_sh_see_also(POST_ARGS);
static int post_sh_authors(POST_ARGS);
+static int post_sm(POST_ARGS);
static int post_st(POST_ARGS);
static int post_vt(POST_ARGS);
static int pre_an(PRE_ARGS);
@@ -199,7 +199,7 @@ static const struct valids mdoc_valids[MDOC_MAX] = {
{ NULL, NULL }, /* Bq */
{ NULL, NULL }, /* Bsx */
{ NULL, post_bx }, /* Bx */
- { NULL, ebool }, /* Db */
+ { pre_obsolete, NULL }, /* Db */
{ NULL, NULL }, /* Dc */
{ NULL, NULL }, /* Do */
{ NULL, NULL }, /* Dq */
@@ -226,7 +226,7 @@ static const struct valids mdoc_valids[MDOC_MAX] = {
{ NULL, NULL }, /* Sc */
{ NULL, NULL }, /* So */
{ NULL, NULL }, /* Sq */
- { NULL, ebool }, /* Sm */
+ { NULL, post_sm }, /* Sm */
{ NULL, post_hyph }, /* Sx */
{ NULL, NULL }, /* Sy */
{ NULL, NULL }, /* Tn */
@@ -1622,36 +1622,31 @@ post_bk(POST_ARGS)
}
static int
-ebool(struct mdoc *mdoc)
+post_sm(struct mdoc *mdoc)
{
struct mdoc_node *nch;
- enum mdoct tok;
- tok = mdoc->last->tok;
nch = mdoc->last->child;
- if (NULL == nch) {
- if (MDOC_Sm == tok)
- mdoc->flags ^= MDOC_SMOFF;
+ if (nch == NULL) {
+ mdoc->flags ^= MDOC_SMOFF;
return(1);
}
- assert(MDOC_TEXT == nch->type);
+ assert(nch->type == MDOC_TEXT);
- if (0 == strcmp(nch->string, "on")) {
- if (MDOC_Sm == tok)
- mdoc->flags &= ~MDOC_SMOFF;
+ if ( ! strcmp(nch->string, "on")) {
+ mdoc->flags &= ~MDOC_SMOFF;
return(1);
}
- if (0 == strcmp(nch->string, "off")) {
- if (MDOC_Sm == tok)
- mdoc->flags |= MDOC_SMOFF;
+ if ( ! strcmp(nch->string, "off")) {
+ mdoc->flags |= MDOC_SMOFF;
return(1);
}
mandoc_vmsg(MANDOCERR_SM_BAD,
mdoc->parse, nch->line, nch->pos,
- "%s %s", mdoc_macronames[tok], nch->string);
+ "%s %s", mdoc_macronames[mdoc->last->tok], nch->string);
return(mdoc_node_relink(mdoc, nch));
}