source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: kristaps@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: `-diag' lists aren't parsed, unlike other list types.
Date: Mon, 2 Jan 2012 10:48:06 -0500 (EST)	[thread overview]
Message-ID: <201201021548.q02Fm65M026067@krisdoz.my.domain> (raw)

Log Message:
-----------
`-diag' lists aren't parsed, unlike other list types.  This fixes a TODO
entry raised by deraadt@.

Modified Files:
--------------
    mdocml:
        TODO
        mdoc_macro.c

Revision Data
-------------
Index: TODO
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/TODO,v
retrieving revision 1.126
retrieving revision 1.127
diff -LTODO -LTODO -u -p -r1.126 -r1.127
--- TODO
+++ TODO
@@ -12,9 +12,6 @@
   and then triggers an unknown macro error
   reported by naddy@  Sun, 3 Jul 2011 21:52:24 +0200
 
-- .It is parsed in general, except in .Bl -diag
-  deraadt@  Mon, 07 Nov 2011 11:10:52 -0700
-
 ************************************************************************
 * formatter bugs
 ************************************************************************
Index: mdoc_macro.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_macro.c,v
retrieving revision 1.113
retrieving revision 1.114
diff -Lmdoc_macro.c -Lmdoc_macro.c -u -p -r1.113 -r1.114
--- mdoc_macro.c
+++ mdoc_macro.c
@@ -228,7 +228,6 @@ mdoc_macroend(struct mdoc *m)
 static enum mdoct
 lookup(enum mdoct from, const char *p)
 {
-	/* FIXME: make -diag lists be un-PARSED. */
 
 	if ( ! (MDOC_PARSED & mdoc_macros[from].flags))
 		return(MDOC_MAX);
@@ -984,7 +983,7 @@ in_line(MACRO_PROT_ARGS)
 static int
 blk_full(MACRO_PROT_ARGS)
 {
-	int		  la, nl;
+	int		  la, nl, nparsed;
 	struct mdoc_arg	 *arg;
 	struct mdoc_node *head; /* save of head macro */
 	struct mdoc_node *body; /* save of body macro */
@@ -995,6 +994,16 @@ blk_full(MACRO_PROT_ARGS)
 	enum margverr	  av;
 	char		 *p;
 
+	/*
+	 * Exception: `-diag' lists are not parsed, but lists in general
+	 * are parsed.
+	 */
+	nparsed = 0;
+	if (MDOC_It == tok && NULL != m->last &&
+			MDOC_Bl == m->last->tok &&
+			LIST_diag == m->last->norm->Bl.type)
+		nparsed = 1;
+
 	nl = MDOC_NEWLINE & m->flags;
 
 	/* Close out prior implicit scope. */
@@ -1146,7 +1155,8 @@ blk_full(MACRO_PROT_ARGS)
 			continue;
 		}
 
-		ntok = ARGS_QWORD == ac ? MDOC_MAX : lookup(tok, p);
+		ntok = nparsed || ARGS_QWORD == ac ? 
+			MDOC_MAX : lookup(tok, p);
 
 		if (MDOC_MAX == ntok) {
 			if ( ! dword(m, line, la, p, DELIM_MAX))
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

                 reply	other threads:[~2012-01-02 15:48 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=201201021548.q02Fm65M026067@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).