source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Collapse `nf', `fi', `Vb', and `Ve' into one function as in
@ 2010-07-23 13:22 kristaps
  0 siblings, 0 replies; only message in thread
From: kristaps @ 2010-07-23 13:22 UTC (permalink / raw)
  To: source

Log Message:
-----------
Collapse `nf', `fi', `Vb', and `Ve' into one function as in man_html.c.

Modified Files:
--------------
    mdocml:
        man_term.c

Revision Data
-------------
Index: man_term.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/man_term.c,v
retrieving revision 1.83
retrieving revision 1.84
diff -Lman_term.c -Lman_term.c -u -p -r1.83 -r1.84
--- man_term.c
+++ man_term.c
@@ -92,10 +92,9 @@ static	int		  pre_RS(DECL_ARGS);
 static	int		  pre_SH(DECL_ARGS);
 static	int		  pre_SS(DECL_ARGS);
 static	int		  pre_TP(DECL_ARGS);
-static	int		  pre_fi(DECL_ARGS);
 static	int		  pre_ign(DECL_ARGS);
 static	int		  pre_in(DECL_ARGS);
-static	int		  pre_nf(DECL_ARGS);
+static	int		  pre_literal(DECL_ARGS);
 static	int		  pre_sp(DECL_ARGS);
 
 static	void		  post_IP(DECL_ARGS);
@@ -130,8 +129,8 @@ static	const struct termact termacts[MAN
 	{ NULL, NULL, MAN_NOTEXT }, /* na */
 	{ pre_I, NULL, 0 }, /* i */
 	{ pre_sp, NULL, MAN_NOTEXT }, /* sp */
-	{ pre_nf, NULL, 0 }, /* nf */
-	{ pre_fi, NULL, 0 }, /* fi */
+	{ pre_literal, NULL, 0 }, /* nf */
+	{ pre_literal, NULL, 0 }, /* fi */
 	{ NULL, NULL, 0 }, /* r */
 	{ NULL, NULL, 0 }, /* RE */
 	{ pre_RS, post_RS, 0 }, /* RS */
@@ -139,8 +138,8 @@ static	const struct termact termacts[MAN
 	{ pre_ign, NULL, 0 }, /* UC */
 	{ pre_ign, NULL, 0 }, /* PD */
  	{ pre_sp, NULL, MAN_NOTEXT }, /* Sp */
- 	{ pre_nf, NULL, 0 }, /* Vb */
- 	{ pre_fi, NULL, 0 }, /* Ve */
+ 	{ pre_literal, NULL, 0 }, /* Vb */
+ 	{ pre_literal, NULL, 0 }, /* Ve */
 	{ pre_ign, NULL, 0 }, /* AT */
 	{ pre_in, NULL, MAN_NOTEXT }, /* in */
 };
@@ -250,24 +249,24 @@ pre_I(DECL_ARGS)
 
 /* ARGSUSED */
 static int
-pre_fi(DECL_ARGS)
+pre_literal(DECL_ARGS)
 {
 
 	term_newln(p);
-	mt->fl &= ~MANT_LITERAL;
+	switch (n->tok) {
+	case (MAN_Vb):
+		/* FALLTHROUGH */
+	case (MAN_nf):
+		mt->fl |= MANT_LITERAL;
+		return(MAN_Vb != n->tok);
+	default:
+		mt->fl &= ~MANT_LITERAL;
+		break;
+	}
+
 	return(1);
 }
 
-
-/* ARGSUSED */
-static int
-pre_nf(DECL_ARGS)
-{
-
-	term_newln(p);
-	mt->fl |= MANT_LITERAL;
-	return(MAN_Vb != n->tok);
-}
 
 
 /* ARGSUSED */
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

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

only message in thread, other threads:[~2010-07-23 13:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-23 13:22 mdocml: Collapse `nf', `fi', `Vb', and `Ve' into one function as in kristaps

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