source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: kristaps@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: Allow `.xx\}' where xx is a macro (e.g., `.br\}') to close
Date: Sun, 29 Aug 2010 07:29:51 -0400 (EDT)	[thread overview]
Message-ID: <201008291129.o7TBTpAI006784@krisdoz.my.domain> (raw)

Log Message:
-----------
Allow `.xx\}' where xx is a macro (e.g., `.br\}') to close scope.  This is
experimental and hasn't been rigorously tested.  It's only implemented in 
-mdoc for the time being.  This is absolutely required for pod2man.  It
does, however, make the pod2man preamble be processed in full.

Modified Files:
--------------
    mdocml:
        mdoc.c
        roff.c

Revision Data
-------------
Index: mdoc.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc.c,v
retrieving revision 1.163
retrieving revision 1.164
diff -Lmdoc.c -Lmdoc.c -u -p -r1.163 -r1.164
--- mdoc.c
+++ mdoc.c
@@ -758,11 +758,14 @@ mdoc_pmacro(struct mdoc *m, int ln, char
 
 	/* 
 	 * Copy the first word into a nil-terminated buffer.
-	 * Stop copying when a tab, space, or eoln is encountered.
+	 * Stop copying when a tab, space, backslash, or eoln is encountered.
 	 */
 
 	j = 0;
-	while (j < 4 && '\0' != buf[i] && ' ' != buf[i] && '\t' != buf[i])
+	while (j < 4 && '\0' != buf[i] && 
+			' ' != buf[i] && 
+			'\t' != buf[i] && 
+			'\\' != buf[i])
 		mac[j++] = buf[i++];
 	mac[j] = '\0';
 
Index: roff.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/roff.c,v
retrieving revision 1.99
retrieving revision 1.100
diff -Lroff.c -Lroff.c -u -p -r1.99 -r1.100
--- roff.c
+++ roff.c
@@ -59,7 +59,7 @@ enum	rofft {
 	ROFF_rm,
 	ROFF_tr,
 	ROFF_cblock,
-	ROFF_ccond,
+	ROFF_ccond, /* FIXME: remove this. */
 	ROFF_nr,
 	ROFF_MAX
 };
@@ -764,8 +764,13 @@ roff_cond_sub(ROFF_ARGS)
 	if (l != r->last)
 		return(ROFFRULE_DENY == rr ? ROFF_IGN : ROFF_CONT);
 
-	if (ROFF_MAX == (t = roff_parse(*bufp, &pos)))
+	if (ROFF_MAX == (t = roff_parse(*bufp, &pos))) {
+		if ('\\' == (*bufp)[pos] && '}' == (*bufp)[pos + 1])
+			return(roff_ccond
+				(r, ROFF_ccond, bufp, szp, 
+				 ln, pos, pos + 2, offs));
 		return(ROFFRULE_DENY == rr ? ROFF_IGN : ROFF_CONT);
+	}
 
 	/*
 	 * A denied conditional must evaluate its children if and only
@@ -796,6 +801,8 @@ roff_cond_text(ROFF_ARGS)
 	 * We display the value of the text if out current evaluation
 	 * scope permits us to do so.
 	 */
+
+	/* FIXME: use roff_ccond? */
 
 	st = &(*bufp)[pos];
 	if (NULL == (ep = strstr(st, "\\}"))) {
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

                 reply	other threads:[~2010-08-29 11:29 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=201008291129.o7TBTpAI006784@krisdoz.my.domain \
    --to=kristaps@mdocml.bsd.lv \
    --cc=source@mdocml.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).