version 1.97, 2010/06/12 12:10:55 |
version 1.98, 2010/06/12 12:38:01 |
Line 532 pre_display(PRE_ARGS) |
|
Line 532 pre_display(PRE_ARGS) |
|
static int |
static int |
pre_bl(PRE_ARGS) |
pre_bl(PRE_ARGS) |
{ |
{ |
int i, width, offs, comp, dup; |
int i, width, comp, dup; |
|
const char *offs; |
enum mdoc_list lt; |
enum mdoc_list lt; |
|
|
if (MDOC_BLOCK != n->type) { |
if (MDOC_BLOCK != n->type) { |
Line 552 pre_bl(PRE_ARGS) |
|
Line 553 pre_bl(PRE_ARGS) |
|
*/ |
*/ |
|
|
assert(LIST__NONE == n->data.Bl.type); |
assert(LIST__NONE == n->data.Bl.type); |
offs = width = -1; |
width = -1; |
|
|
/* LINTED */ |
/* LINTED */ |
for (i = 0; n->args && i < (int)n->args->argc; i++) { |
for (i = 0; n->args && i < (int)n->args->argc; i++) { |
lt = LIST__NONE; |
lt = LIST__NONE; |
dup = comp = 0; |
dup = comp = 0; |
|
offs = NULL; |
switch (n->args->argv[i].arg) { |
switch (n->args->argv[i].arg) { |
/* Set list types. */ |
/* Set list types. */ |
case (MDOC_Bullet): |
case (MDOC_Bullet): |
Line 604 pre_bl(PRE_ARGS) |
|
Line 606 pre_bl(PRE_ARGS) |
|
width = i; |
width = i; |
break; |
break; |
case (MDOC_Offset): |
case (MDOC_Offset): |
if (offs >= 0) |
/* NB: this can be empty! */ |
dup++; |
if (n->args->argv[i].sz) { |
offs = i; |
offs = n->args->argv[i].value[0]; |
|
dup = (NULL != n->data.Bd.offs); |
|
break; |
|
} |
|
if ( ! mdoc_nmsg(mdoc, n, MANDOCERR_IGNARGV)) |
|
return(0); |
break; |
break; |
} |
} |
|
|
Line 617 pre_bl(PRE_ARGS) |
|
Line 624 pre_bl(PRE_ARGS) |
|
|
|
if (comp && ! dup) |
if (comp && ! dup) |
n->data.Bl.comp = comp; |
n->data.Bl.comp = comp; |
|
if (offs && ! dup) |
|
n->data.Bl.offs = offs; |
|
|
/* Check: multiple list types. */ |
/* Check: multiple list types. */ |
|
|
Line 632 pre_bl(PRE_ARGS) |
|
Line 641 pre_bl(PRE_ARGS) |
|
/* The list type should come first. */ |
/* The list type should come first. */ |
|
|
if (n->data.Bl.type == LIST__NONE) |
if (n->data.Bl.type == LIST__NONE) |
if (width >= 0 || offs >= 0 || n->data.Bl.comp) |
if (width >= 0 || n->data.Bl.offs || n->data.Bl.comp) |
if ( ! mdoc_nmsg(mdoc, n, MANDOCERR_LISTFIRST)) |
if ( ! mdoc_nmsg(mdoc, n, MANDOCERR_LISTFIRST)) |
return(0); |
return(0); |
|
|