diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2018-12-31 07:46:07 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2018-12-31 07:46:07 +0000 |
commit | 2ec872dc0da85b23fb0d72c9d83ec1aa8f06ea19 (patch) | |
tree | 2a44175f93c0a79365ec8978d7131fe0e36c2f03 | |
parent | c307b01e3d5709e7d34106b6fe8e98b468bf33f8 (diff) | |
download | mandoc-2ec872dc0da85b23fb0d72c9d83ec1aa8f06ea19.tar.gz |
Cleanup, no functional change:
Use the new parser flag ROFF_NOFILL in the mdoc(7) parser, too,
instead of the old MDOC_LITERAL, which was an alias for the
former MAN_LITERAL.
-rw-r--r-- | mdoc.c | 6 | ||||
-rw-r--r-- | mdoc_state.c | 4 | ||||
-rw-r--r-- | mdoc_validate.c | 4 | ||||
-rw-r--r-- | roff_int.h | 1 |
4 files changed, 7 insertions, 8 deletions
@@ -210,7 +210,7 @@ mdoc_ptext(struct roff_man *mdoc, int line, char *buf, int offs) * Strip trailing tabs in literal context only; * outside, they affect the next line. */ - if (MDOC_LITERAL & mdoc->flags) + if (mdoc->flags & ROFF_NOFILL) continue; break; case '\\': @@ -235,7 +235,7 @@ mdoc_ptext(struct roff_man *mdoc, int line, char *buf, int offs) * but add a single vertical space elsewhere. */ - if (buf[offs] == '\0' && ! (mdoc->flags & MDOC_LITERAL)) { + if (buf[offs] == '\0' && (mdoc->flags & ROFF_NOFILL) == 0) { switch (mdoc->last->type) { case ROFFT_TEXT: sp = mdoc->last->string; @@ -260,7 +260,7 @@ mdoc_ptext(struct roff_man *mdoc, int line, char *buf, int offs) roff_word_alloc(mdoc, line, offs, buf+offs); - if (mdoc->flags & MDOC_LITERAL) + if (mdoc->flags & ROFF_NOFILL) return 1; /* diff --git a/mdoc_state.c b/mdoc_state.c index 78ce3bcd..67b88aa4 100644 --- a/mdoc_state.c +++ b/mdoc_state.c @@ -228,10 +228,10 @@ state_dl(STATE_ARGS) switch (n->type) { case ROFFT_HEAD: - mdoc->flags |= MDOC_LITERAL; + mdoc->flags |= ROFF_NOFILL; break; case ROFFT_BODY: - mdoc->flags &= ~MDOC_LITERAL; + mdoc->flags &= ~ROFF_NOFILL; break; default: break; diff --git a/mdoc_validate.c b/mdoc_validate.c index 58755a2e..b02c17ff 100644 --- a/mdoc_validate.c +++ b/mdoc_validate.c @@ -338,7 +338,7 @@ mdoc_validate(struct roff_man *mdoc) check_text(mdoc, n->line, n->pos, n->string); if (np->tok != MDOC_Ql && np->tok != MDOC_Dl && (np->tok != MDOC_Bd || - (mdoc->flags & MDOC_LITERAL) == 0) && + (mdoc->flags & ROFF_NOFILL) == 0) && (np->tok != MDOC_It || np->type != ROFFT_HEAD || np->parent->parent->norm->Bl.type != LIST_diag)) check_text_em(mdoc, n->line, n->pos, n->string); @@ -411,7 +411,7 @@ check_text(struct roff_man *mdoc, int ln, int pos, char *p) { char *cp; - if (MDOC_LITERAL & mdoc->flags) + if (mdoc->flags & ROFF_NOFILL) return; for (cp = p; NULL != (p = strchr(p, '\t')); p++) @@ -54,7 +54,6 @@ struct roff_man { #define MDOC_PHRASEQF (1 << 13) /* Quote first word encountered. */ #define MDOC_PHRASEQL (1 << 14) /* Quote last word of this phrase. */ #define MDOC_PHRASEQN (1 << 15) /* Quote first word of the next phrase. */ -#define MDOC_LITERAL ROFF_NOFILL #define MAN_NEWLINE MDOC_NEWLINE enum roff_sec lastsec; /* Last section seen. */ enum roff_sec lastnamed; /* Last standard section seen. */ |