source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: schwarze@mandoc.bsd.lv
To: source@mandoc.bsd.lv
Subject: mandoc: Cleanup, no functional change: Use the new parser flag
Date: Mon, 31 Dec 2018 02:46:38 -0500 (EST)	[thread overview]
Message-ID: <05f85a39f06dac11@fantadrom.bsd.lv> (raw)

Log Message:
-----------
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.

Modified Files:
--------------
    mandoc:
        mdoc.c
        mdoc_state.c
        mdoc_validate.c
        roff_int.h

Revision Data
-------------
Index: roff_int.h
===================================================================
RCS file: /home/cvs/mandoc/mandoc/roff_int.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -Lroff_int.h -Lroff_int.h -u -p -r1.14 -r1.15
--- roff_int.h
+++ roff_int.h
@@ -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. */
Index: mdoc_validate.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/mdoc_validate.c,v
retrieving revision 1.367
retrieving revision 1.368
diff -Lmdoc_validate.c -Lmdoc_validate.c -u -p -r1.367 -r1.368
--- mdoc_validate.c
+++ 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
 {
 	char		*cp;
 
-	if (MDOC_LITERAL & mdoc->flags)
+	if (mdoc->flags & ROFF_NOFILL)
 		return;
 
 	for (cp = p; NULL != (p = strchr(p, '\t')); p++)
Index: mdoc.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/mdoc.c,v
retrieving revision 1.273
retrieving revision 1.274
diff -Lmdoc.c -Lmdoc.c -u -p -r1.273 -r1.274
--- mdoc.c
+++ mdoc.c
@@ -210,7 +210,7 @@ mdoc_ptext(struct roff_man *mdoc, int li
 			 * 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 li
 	 * 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 li
 
 	roff_word_alloc(mdoc, line, offs, buf+offs);
 
-	if (mdoc->flags & MDOC_LITERAL)
+	if (mdoc->flags & ROFF_NOFILL)
 		return 1;
 
 	/*
Index: mdoc_state.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/mdoc_state.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -Lmdoc_state.c -Lmdoc_state.c -u -p -r1.13 -r1.14
--- mdoc_state.c
+++ 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;
--
 To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv

                 reply	other threads:[~2018-12-31  7:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=05f85a39f06dac11@fantadrom.bsd.lv \
    --to=schwarze@mandoc.bsd.lv \
    --cc=source@mandoc.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).