version 1.105, 2010/07/02 12:54:33 |
version 1.108, 2010/07/02 17:42:23 |
|
|
pre_an(PRE_ARGS) |
pre_an(PRE_ARGS) |
{ |
{ |
|
|
if (NULL == n->args || 1 == n->args->argc) |
if (NULL == n->args) |
return(1); |
return(1); |
mdoc_vmsg(mdoc, MANDOCERR_SYNTARGCOUNT, |
if (n->args->argc > 1) |
n->line, n->pos, |
if ( ! mdoc_nmsg(mdoc, n, MANDOCERR_ARGCOUNT)) |
"line arguments == 1 (have %d)", |
return(0); |
n->args->argc); |
|
return(0); |
if (MDOC_Split == n->args->argv[0].arg) |
|
n->data.An.auth = AUTH_split; |
|
else if (MDOC_Nosplit == n->args->argv[0].arg) |
|
n->data.An.auth = AUTH_nosplit; |
|
else |
|
abort(); |
|
|
|
return(1); |
} |
} |
|
|
|
|
Line 957 post_bf(POST_ARGS) |
|
Line 964 post_bf(POST_ARGS) |
|
} |
} |
|
|
np = mdoc->last; |
np = mdoc->last; |
|
assert(MDOC_BLOCK == np->parent->type); |
|
assert(MDOC_Bf == np->parent->tok); |
np->data.Bf = mandoc_calloc(1, sizeof(struct mdoc_bf)); |
np->data.Bf = mandoc_calloc(1, sizeof(struct mdoc_bf)); |
|
|
/* |
/* |
Line 964 post_bf(POST_ARGS) |
|
Line 973 post_bf(POST_ARGS) |
|
* If neither is specified, let it through with a warning. |
* If neither is specified, let it through with a warning. |
*/ |
*/ |
|
|
if (np->args && np->child) { |
if (np->parent->args && np->child) { |
mdoc_nmsg(mdoc, np, MANDOCERR_SYNTARGVCOUNT); |
mdoc_nmsg(mdoc, np, MANDOCERR_SYNTARGVCOUNT); |
return(0); |
return(0); |
} else if (NULL == np->args && NULL == np->child) |
} else if (NULL == np->parent->args && NULL == np->child) |
return(mdoc_nmsg(mdoc, np, MANDOCERR_FONTTYPE)); |
return(mdoc_nmsg(mdoc, np, MANDOCERR_FONTTYPE)); |
|
|
/* Extract argument into data. */ |
/* Extract argument into data. */ |
|
|
if (np->args) { |
if (np->parent->args) { |
arg = np->args->argv[0].arg; |
arg = np->parent->args->argv[0].arg; |
if (MDOC_Emphasis == arg) |
if (MDOC_Emphasis == arg) |
np->data.Bf->font = FONT_Em; |
np->data.Bf->font = FONT_Em; |
else if (MDOC_Literal == arg) |
else if (MDOC_Literal == arg) |
Line 1074 post_at(POST_ARGS) |
|
Line 1083 post_at(POST_ARGS) |
|
static int |
static int |
post_an(POST_ARGS) |
post_an(POST_ARGS) |
{ |
{ |
|
struct mdoc_node *np; |
|
|
if (mdoc->last->args) { |
np = mdoc->last; |
if (NULL == mdoc->last->child) |
if (AUTH__NONE != np->data.An.auth && np->child) |
return(1); |
return(mdoc_nmsg(mdoc, np, MANDOCERR_ARGCOUNT)); |
return(mdoc_nmsg(mdoc, mdoc->last, MANDOCERR_ARGCOUNT)); |
if (AUTH__NONE != np->data.An.auth || np->child) |
} |
|
|
|
if (mdoc->last->child) |
|
return(1); |
return(1); |
return(mdoc_nmsg(mdoc, mdoc->last, MANDOCERR_NOARGS)); |
return(mdoc_nmsg(mdoc, np, MANDOCERR_NOARGS)); |
} |
} |
|
|
|
|
Line 1125 post_it(POST_ARGS) |
|
Line 1132 post_it(POST_ARGS) |
|
if (NULL == mdoc->last->head->child) |
if (NULL == mdoc->last->head->child) |
if ( ! mdoc_nmsg(mdoc, mdoc->last, MANDOCERR_NOARGS)) |
if ( ! mdoc_nmsg(mdoc, mdoc->last, MANDOCERR_NOARGS)) |
return(0); |
return(0); |
if (NULL == mdoc->last->body->child) |
|
if ( ! mdoc_nmsg(mdoc, mdoc->last, MANDOCERR_NOBODY)) |
|
return(0); |
|
break; |
break; |
case (LIST_bullet): |
case (LIST_bullet): |
/* FALLTHROUGH */ |
/* FALLTHROUGH */ |
Line 1136 post_it(POST_ARGS) |
|
Line 1140 post_it(POST_ARGS) |
|
case (LIST_enum): |
case (LIST_enum): |
/* FALLTHROUGH */ |
/* FALLTHROUGH */ |
case (LIST_hyphen): |
case (LIST_hyphen): |
|
if (NULL == mdoc->last->body->child) |
|
if ( ! mdoc_nmsg(mdoc, mdoc->last, MANDOCERR_NOBODY)) |
|
return(0); |
/* FALLTHROUGH */ |
/* FALLTHROUGH */ |
case (LIST_item): |
case (LIST_item): |
if (mdoc->last->head->child) |
if (mdoc->last->head->child) |
if ( ! mdoc_nmsg(mdoc, mdoc->last, MANDOCERR_ARGSLOST)) |
if ( ! mdoc_nmsg(mdoc, mdoc->last, MANDOCERR_ARGSLOST)) |
return(0); |
|
if (NULL == mdoc->last->body->child) |
|
if ( ! mdoc_nmsg(mdoc, mdoc->last, MANDOCERR_NOBODY)) |
|
return(0); |
return(0); |
break; |
break; |
case (LIST_column): |
case (LIST_column): |