From: Ingo Schwarze <schwarze@usta.de>
To: tech@mdocml.bsd.lv
Subject: Re: mdocml: `-diag' lists aren't parsed, unlike other list types.
Date: Wed, 4 Jan 2012 03:29:32 +0100 [thread overview]
Message-ID: <20120104022932.GH2607@iris.usta.de> (raw)
In-Reply-To: <201201021548.q02Fm65M026067@krisdoz.my.domain>
Hi Kristaps,
kristaps@mdocml.bsd.lv wrote on Mon, Jan 02, 2012 at 10:48:06AM -0500:
> `-diag' lists aren't parsed, unlike other list types.
> This fixes a TODO entry raised by deraadt@.
i hate to say so, but this fix is incomplete:
It only fixes the first .It macro in each -diag list.
To fix the subsequent ones as well, the check
has to be moved after the creation of the .It block,
such that we can look for the parent.
While moving the check, we can drop the if-statement
and make the comment more precise.
OK?
Ingo
CVSROOT: /cvs
Module name: src
Changes by: schwarze@cvs.openbsd.org 2012/01/03 19:17:42
Modified files:
usr.bin/mandoc : mdoc_macro.c
regress/usr.bin/mandoc/mdoc/Bl: diag.in diag.out_ascii
Log message:
Heads of .It macros in -diag lists are not parsed,
even though .It macros in general are parsed.
Fixing a bug reported by deraadt@,
based on an incomplete fix by kristaps@,
and update the test suite to catch this issue.
--- /co/mdocml/mdoc_macro.c Wed Jan 4 03:24:13 2012
+++ ./mdoc_macro.c Wed Jan 4 03:17:42 2012
@@ -994,16 +990,6 @@
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. */
@@ -1046,6 +1032,14 @@
return(0);
head = body = NULL;
+
+ /*
+ * Exception: Heads of `It' macros in `-diag' lists are not
+ * parsed, even though `It' macros in general are parsed.
+ */
+ nparsed = MDOC_It == tok &&
+ MDOC_Bl == m->last->parent->tok &&
+ LIST_diag == m->last->parent->norm->Bl.type;
/*
* The `Nd' macro has all arguments in its body: it's a hybrid
--
To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv
next parent reply other threads:[~2012-01-04 2:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <201201021548.q02Fm65M026067@krisdoz.my.domain>
2012-01-04 2:29 ` Ingo Schwarze [this message]
2012-01-04 11:58 ` Kristaps Dzonsons
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=20120104022932.GH2607@iris.usta.de \
--to=schwarze@usta.de \
--cc=tech@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).