source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mandoc: Cleanup, no functional change: Use the new parser flag
@ 2018-12-31  7:46 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2018-12-31  7:46 UTC (permalink / raw)
  To: source

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-12-31  7:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-31  7:46 mandoc: Cleanup, no functional change: Use the new parser flag schwarze

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).