* mandoc: Cleanup, no functional change: Since the man(7) and roff(7)
@ 2018-12-31 10:05 schwarze
0 siblings, 0 replies; only message in thread
From: schwarze @ 2018-12-31 10:05 UTC (permalink / raw)
To: source
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2018-12-31 10:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-31 10:05 mandoc: Cleanup, no functional change: Since the man(7) and roff(7) 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).