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: Since the man(7) and roff(7)
Date: Mon, 31 Dec 2018 05:05:09 -0500 (EST)	[thread overview]
Message-ID: <05f8601715a1ec56@fantadrom.bsd.lv> (raw)

Log Message:
-----------
Cleanup, no functional change:
Since the man(7) and roff(7) validators no longer use the parser 
state flag ROFF_NOFILL, we can finally get rid of the function
man_state(), resulting in a better separation of parsing and validation.

Modified Files:
--------------
    mandoc:
        libman.h
        man.c
        man_macro.c
        man_validate.c

Revision Data
-------------
Index: libman.h
===================================================================
RCS file: /home/cvs/mandoc/mandoc/libman.h,v
retrieving revision 1.85
retrieving revision 1.86
diff -Llibman.h -Llibman.h -u -p -r1.85 -r1.86
--- libman.h
+++ libman.h
@@ -39,5 +39,4 @@ struct	man_macro {
 const struct man_macro *man_macro(enum roff_tok);
 
 void		  man_descope(struct roff_man *, int, int, char *);
-void		  man_state(struct roff_man *, struct roff_node *);
 void		  man_unscope(struct roff_man *, const struct roff_node *);
Index: man.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/man.c,v
retrieving revision 1.185
retrieving revision 1.186
diff -Lman.c -Lman.c -u -p -r1.185 -r1.186
--- man.c
+++ man.c
@@ -343,22 +343,3 @@ man_breakscope(struct roff_man *man, int
 		man->flags &= ~MAN_BLINE;
 	}
 }
-
-void
-man_state(struct roff_man *man, struct roff_node *n)
-{
-
-	switch(n->tok) {
-	case ROFF_nf:
-	case MAN_EX:
-		man->flags |= ROFF_NOFILL;
-		break;
-	case ROFF_fi:
-	case MAN_EE:
-		man->flags &= ~ROFF_NOFILL;
-		break;
-	default:
-		break;
-	}
-	man->last->flags |= NODE_VALID;
-}
Index: man_macro.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/man_macro.c,v
retrieving revision 1.141
retrieving revision 1.142
diff -Lman_macro.c -Lman_macro.c -u -p -r1.141 -r1.142
--- man_macro.c
+++ man_macro.c
@@ -429,7 +429,7 @@ in_line_eoln(MACRO_PROT_ARGS)
 	/* Rewind our element scope. */
 
 	for ( ; man->last; man->last = man->last->parent) {
-		man_state(man, man->last);
+		man->last->flags |= NODE_VALID;
 		if (man->last == n)
 			break;
 	}
Index: man_validate.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/man_validate.c,v
retrieving revision 1.145
retrieving revision 1.146
diff -Lman_validate.c -Lman_validate.c -u -p -r1.145 -r1.146
--- man_validate.c
+++ man_validate.c
@@ -153,7 +153,6 @@ man_validate(struct roff_man *man)
 	default:
 		if (n->tok < ROFF_MAX) {
 			roff_validate(man);
-			man_state(man, n);
 			break;
 		}
 		assert(n->tok >= MAN_TH && n->tok < MAN_MAX);
@@ -161,7 +160,7 @@ man_validate(struct roff_man *man)
 		if (*cp)
 			(*cp)(man, n);
 		if (man->last == n)
-			man_state(man, n);
+			n->flags |= NODE_VALID;
 		break;
 	}
 }
--
 To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv

                 reply	other threads:[~2018-12-31 10:05 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=05f8601715a1ec56@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).