source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Strip out the `\z' escape.
@ 2010-08-24 12:18 kristaps
  0 siblings, 0 replies; only message in thread
From: kristaps @ 2010-08-24 12:18 UTC (permalink / raw)
  To: source

Log Message:
-----------
Strip out the `\z' escape.  This is the first recursive sequence,
getting mandoc ready to handle pod2man's complex escapes.

Modified Files:
--------------
    mdocml:
        man.7
        mandoc.c
        mdoc.7
        out.c

Revision Data
-------------
Index: mandoc.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mandoc.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -Lmandoc.c -Lmandoc.c -u -p -r1.29 -r1.30
--- mandoc.c
+++ mandoc.c
@@ -171,6 +171,13 @@ mandoc_special(char *p)
 	case ('['):
 		term = ']';
 		break;
+	case ('z'):
+		len = 1;
+		if ('\\' == *p) {
+			p += mandoc_special(p);
+			return(*p ? (int)(p - sv) : 0);
+		}
+		break;
 	default:
 		len = 1;
 		p--;
Index: man.7
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/man.7,v
retrieving revision 1.82
retrieving revision 1.83
diff -Lman.7 -Lman.7 -u -p -r1.82 -r1.83
--- man.7
+++ man.7
@@ -936,6 +936,8 @@ The
 .Pq text colour ,
 .Sq \eM
 .Pq text filling colour ,
+.Sq \ez
+.Pq zero-length character ,
 and
 .Sq \es
 .Pq text size
Index: out.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/out.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -Lout.c -Lout.c -u -p -r1.24 -r1.25
--- out.c
+++ out.c
@@ -172,6 +172,7 @@ a2roffdeco(enum roffdeco *d, const char 
 	int		 i, j, lim;
 	char		 term, c;
 	const char	*wp;
+	enum roffdeco	 dd;
 
 	*d = DECO_NONE;
 	lim = i = 0;
@@ -275,7 +276,7 @@ a2roffdeco(enum roffdeco *d, const char 
 				return(i);
 			i++;
 		} 
-		
+
 		break;
 	case ('['):
 		*d = DECO_SPECIAL;
@@ -284,6 +285,14 @@ a2roffdeco(enum roffdeco *d, const char 
 	case ('c'):
 		*d = DECO_NOSPACE;
 		return(i);
+	case ('z'):
+		*d = DECO_NONE;
+		if ('\\' == wp[i]) {
+			*word = &wp[++i];
+			return(i + a2roffdeco(&dd, word, sz));
+		} else
+			lim = 1;
+		break;
 	default:
 		*d = DECO_SSPECIAL;
 		i--;
Index: mdoc.7
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc.7,v
retrieving revision 1.151
retrieving revision 1.152
diff -Lmdoc.7 -Lmdoc.7 -u -p -r1.151 -r1.152
--- mdoc.7
+++ mdoc.7
@@ -2844,6 +2844,8 @@ The
 .Pq text colour ,
 .Sq \eM
 .Pq text filling colour ,
+.Sq \ez
+.Pq zero-length character ,
 and
 .Sq \es
 .Pq text size
--
 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-08-24 12:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-24 12:18 mdocml: Strip out the `\z' escape 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).