version 1.182, 2010/08/20 22:51:29 |
version 1.187, 2010/09/25 16:41:33 |
Line 92 static void termp_sh_post(DECL_ARGS); |
|
Line 92 static void termp_sh_post(DECL_ARGS); |
|
static void termp_sq_post(DECL_ARGS); |
static void termp_sq_post(DECL_ARGS); |
static void termp_ss_post(DECL_ARGS); |
static void termp_ss_post(DECL_ARGS); |
|
|
|
static int termp__a_pre(DECL_ARGS); |
static int termp_an_pre(DECL_ARGS); |
static int termp_an_pre(DECL_ARGS); |
static int termp_ap_pre(DECL_ARGS); |
static int termp_ap_pre(DECL_ARGS); |
static int termp_aq_pre(DECL_ARGS); |
static int termp_aq_pre(DECL_ARGS); |
Line 178 static const struct termact termacts[MDOC_MAX] = { |
|
Line 179 static const struct termact termacts[MDOC_MAX] = { |
|
{ termp_under_pre, NULL }, /* Va */ |
{ termp_under_pre, NULL }, /* Va */ |
{ termp_vt_pre, NULL }, /* Vt */ |
{ termp_vt_pre, NULL }, /* Vt */ |
{ termp_xr_pre, NULL }, /* Xr */ |
{ termp_xr_pre, NULL }, /* Xr */ |
{ NULL, termp____post }, /* %A */ |
{ termp__a_pre, termp____post }, /* %A */ |
{ termp_under_pre, termp____post }, /* %B */ |
{ termp_under_pre, termp____post }, /* %B */ |
{ NULL, termp____post }, /* %D */ |
{ NULL, termp____post }, /* %D */ |
{ termp_under_pre, termp____post }, /* %I */ |
{ termp_under_pre, termp____post }, /* %I */ |
Line 842 termp_it_pre(DECL_ARGS) |
|
Line 843 termp_it_pre(DECL_ARGS) |
|
if (MDOC_BODY == n->prev->type) |
if (MDOC_BODY == n->prev->type) |
p->flags |= TERMP_NOLPAD; |
p->flags |= TERMP_NOLPAD; |
|
|
p->flags |= TERMP_IGNDELIM; |
|
|
|
break; |
break; |
case (LIST_diag): |
case (LIST_diag): |
if (MDOC_HEAD == n->type) |
if (MDOC_HEAD == n->type) |
Line 1002 termp_it_post(DECL_ARGS) |
|
Line 1001 termp_it_post(DECL_ARGS) |
|
p->flags &= ~TERMP_TWOSPACE; |
p->flags &= ~TERMP_TWOSPACE; |
p->flags &= ~TERMP_NOLPAD; |
p->flags &= ~TERMP_NOLPAD; |
p->flags &= ~TERMP_HANG; |
p->flags &= ~TERMP_HANG; |
|
|
/* |
|
* TERMP_IGNDELIM is also set by `Pf', but it is safe |
|
* to clear it here because `Pf' cannot contain `It'. |
|
*/ |
|
|
|
p->flags &= ~TERMP_IGNDELIM; |
|
} |
} |
|
|
|
|
Line 1039 termp_nm_pre(DECL_ARGS) |
|
Line 1031 termp_nm_pre(DECL_ARGS) |
|
synopsis_pre(p, n->parent); |
synopsis_pre(p, n->parent); |
|
|
if (MDOC_HEAD == n->type && n->next->child) { |
if (MDOC_HEAD == n->type && n->next->child) { |
p->flags |= TERMP_NOSPACE | TERMP_NOBREAK | TERMP_HANG; |
p->flags |= TERMP_NOSPACE | TERMP_NOBREAK; |
p->rmargin = p->offset + term_len(p, 1) + |
p->rmargin = p->offset + term_len(p, 1); |
(NULL == n->child ? term_strlen(p, m->name) : |
if (NULL == n->child) { |
MDOC_TEXT == n->child->type ? |
p->rmargin += term_strlen(p, m->name); |
term_strlen(p, n->child->string) : |
} else if (MDOC_TEXT == n->child->type) { |
term_len(p, 5)); |
p->rmargin += term_strlen(p, n->child->string); |
|
if (n->child->next) |
|
p->flags |= TERMP_HANG; |
|
} else { |
|
p->rmargin += term_len(p, 5); |
|
p->flags |= TERMP_HANG; |
|
} |
} |
} |
|
|
term_fontpush(p, TERMFONT_BOLD); |
term_fontpush(p, TERMFONT_BOLD); |
Line 1088 termp_fl_pre(DECL_ARGS) |
|
Line 1086 termp_fl_pre(DECL_ARGS) |
|
|
|
/* ARGSUSED */ |
/* ARGSUSED */ |
static int |
static int |
|
termp__a_pre(DECL_ARGS) |
|
{ |
|
|
|
if (n->prev && MDOC__A == n->prev->tok) |
|
if (NULL == n->next || MDOC__A != n->next->tok) |
|
term_word(p, "and"); |
|
|
|
return(1); |
|
} |
|
|
|
|
|
/* ARGSUSED */ |
|
static int |
termp_an_pre(DECL_ARGS) |
termp_an_pre(DECL_ARGS) |
{ |
{ |
|
|
|
|
termp_pf_post(DECL_ARGS) |
termp_pf_post(DECL_ARGS) |
{ |
{ |
|
|
/* |
|
* XXX Resetting TERMP_IGNDELIM here is not safe |
|
* because `Pf' can be used inside `Bl -column'. |
|
*/ |
|
p->flags &= ~TERMP_IGNDELIM; |
p->flags &= ~TERMP_IGNDELIM; |
p->flags |= TERMP_NOSPACE; |
p->flags |= TERMP_NOSPACE; |
} |
} |
|
|
termp____post(DECL_ARGS) |
termp____post(DECL_ARGS) |
{ |
{ |
|
|
|
/* |
|
* Handle lists of authors. In general, print each followed by |
|
* a comma. Don't print the comma if there are only two |
|
* authors. |
|
*/ |
|
if (MDOC__A == n->tok && n->next && MDOC__A == n->next->tok) |
|
if (NULL == n->next->next || MDOC__A != n->next->next->tok) |
|
if (NULL == n->prev || MDOC__A != n->prev->tok) |
|
return; |
|
|
/* TODO: %U. */ |
/* TODO: %U. */ |
|
|
p->flags |= TERMP_NOSPACE; |
if (NULL == n->parent || MDOC_Rs != n->parent->tok) |
term_word(p, n->next ? "," : "."); |
return; |
|
|
|
if (NULL == n->next) { |
|
term_word(p, "."); |
|
p->flags |= TERMP_SENTENCE; |
|
} else |
|
term_word(p, ","); |
} |
} |
|
|
|
|