diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2012-01-02 15:48:05 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2012-01-02 15:48:05 +0000 |
commit | 0063d2a7bca693266f0e8bf45e0bb7790a356048 (patch) | |
tree | 8d7b6d986a4ac112e081f011e22a24d9db190637 | |
parent | 95486df829fe5c6101c46a06f073c025f0f27170 (diff) | |
download | mandoc-0063d2a7bca693266f0e8bf45e0bb7790a356048.tar.gz mandoc-0063d2a7bca693266f0e8bf45e0bb7790a356048.tar.zst mandoc-0063d2a7bca693266f0e8bf45e0bb7790a356048.zip |
`-diag' lists aren't parsed, unlike other list types. This fixes a TODO
entry raised by deraadt@.
-rw-r--r-- | TODO | 5 | ||||
-rw-r--r-- | mdoc_macro.c | 18 |
2 files changed, 15 insertions, 8 deletions
@@ -1,6 +1,6 @@ ************************************************************************ * Official mandoc TODO. -* $Id: TODO,v 1.126 2011/12/05 00:41:40 schwarze Exp $ +* $Id: TODO,v 1.127 2012/01/02 15:48:05 kristaps Exp $ ************************************************************************ ************************************************************************ @@ -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 ************************************************************************ diff --git a/mdoc_macro.c b/mdoc_macro.c index c1ab436a..6b818754 100644 --- a/mdoc_macro.c +++ b/mdoc_macro.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_macro.c,v 1.113 2011/12/03 23:59:14 schwarze Exp $ */ +/* $Id: mdoc_macro.c,v 1.114 2012/01/02 15:48:05 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org> @@ -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)) |