From 288ba2a3bff8e3088cb3d7234b0e92fa6d0bcd35 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Mon, 31 Dec 2018 07:46:07 +0000 Subject: 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. --- mdoc.c | 8 ++++---- mdoc_state.c | 6 +++--- mdoc_validate.c | 6 +++--- roff_int.h | 3 +-- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/mdoc.c b/mdoc.c index 22101188..bb3ec58b 100644 --- a/mdoc.c +++ b/mdoc.c @@ -1,4 +1,4 @@ -/* $Id: mdoc.c,v 1.273 2018/12/31 04:55:46 schwarze Exp $ */ +/* $Id: mdoc.c,v 1.274 2018/12/31 07:46:07 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010, 2012-2018 Ingo Schwarze @@ -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 5fd38f16..c0f3c430 100644 --- a/mdoc_state.c +++ b/mdoc_state.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_state.c,v 1.13 2018/12/31 04:55:47 schwarze Exp $ */ +/* $Id: mdoc_state.c,v 1.14 2018/12/31 07:46:07 schwarze Exp $ */ /* * Copyright (c) 2014, 2015, 2017 Ingo Schwarze * @@ -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 f4a7b748..d20b2a07 100644 --- a/mdoc_validate.c +++ b/mdoc_validate.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_validate.c,v 1.367 2018/12/31 04:55:47 schwarze Exp $ */ +/* $Id: mdoc_validate.c,v 1.368 2018/12/31 07:46:07 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2018 Ingo Schwarze @@ -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++) diff --git a/roff_int.h b/roff_int.h index 29afb92f..e13b53e6 100644 --- a/roff_int.h +++ b/roff_int.h @@ -1,4 +1,4 @@ -/* $Id: roff_int.h,v 1.14 2018/12/31 07:08:12 schwarze Exp $ */ +/* $Id: roff_int.h,v 1.15 2018/12/31 07:46:07 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2013,2014,2015,2017,2018 Ingo Schwarze @@ -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. */ -- cgit v1.2.3-56-ge451