version 1.203, 2010/12/25 13:50:37 |
version 1.216, 2011/02/06 21:44:36 |
Line 73 static void termp_an_post(DECL_ARGS); |
|
Line 73 static void termp_an_post(DECL_ARGS); |
|
static void termp_bd_post(DECL_ARGS); |
static void termp_bd_post(DECL_ARGS); |
static void termp_bk_post(DECL_ARGS); |
static void termp_bk_post(DECL_ARGS); |
static void termp_bl_post(DECL_ARGS); |
static void termp_bl_post(DECL_ARGS); |
static void termp_bx_post(DECL_ARGS); |
|
static void termp_d1_post(DECL_ARGS); |
static void termp_d1_post(DECL_ARGS); |
static void termp_fo_post(DECL_ARGS); |
static void termp_fo_post(DECL_ARGS); |
static void termp_in_post(DECL_ARGS); |
static void termp_in_post(DECL_ARGS); |
Line 95 static int termp_bk_pre(DECL_ARGS); |
|
Line 94 static int termp_bk_pre(DECL_ARGS); |
|
static int termp_bl_pre(DECL_ARGS); |
static int termp_bl_pre(DECL_ARGS); |
static int termp_bold_pre(DECL_ARGS); |
static int termp_bold_pre(DECL_ARGS); |
static int termp_bt_pre(DECL_ARGS); |
static int termp_bt_pre(DECL_ARGS); |
|
static int termp_bx_pre(DECL_ARGS); |
static int termp_cd_pre(DECL_ARGS); |
static int termp_cd_pre(DECL_ARGS); |
static int termp_d1_pre(DECL_ARGS); |
static int termp_d1_pre(DECL_ARGS); |
static int termp_ex_pre(DECL_ARGS); |
static int termp_ex_pre(DECL_ARGS); |
Line 187 static const struct termact termacts[MDOC_MAX] = { |
|
Line 187 static const struct termact termacts[MDOC_MAX] = { |
|
{ termp_quote_pre, termp_quote_post }, /* Bo */ |
{ termp_quote_pre, termp_quote_post }, /* Bo */ |
{ termp_quote_pre, termp_quote_post }, /* Bq */ |
{ termp_quote_pre, termp_quote_post }, /* Bq */ |
{ termp_xx_pre, NULL }, /* Bsx */ |
{ termp_xx_pre, NULL }, /* Bsx */ |
{ NULL, termp_bx_post }, /* Bx */ |
{ termp_bx_pre, NULL }, /* Bx */ |
{ NULL, NULL }, /* Db */ |
{ NULL, NULL }, /* Db */ |
{ NULL, NULL }, /* Dc */ |
{ NULL, NULL }, /* Dc */ |
{ termp_quote_pre, termp_quote_post }, /* Do */ |
{ termp_quote_pre, termp_quote_post }, /* Do */ |
Line 312 print_mdoc_node(DECL_ARGS) |
|
Line 312 print_mdoc_node(DECL_ARGS) |
|
|
|
memset(&npair, 0, sizeof(struct termpair)); |
memset(&npair, 0, sizeof(struct termpair)); |
npair.ppair = pair; |
npair.ppair = pair; |
|
|
|
switch (n->type) { |
|
case (MDOC_TEXT): |
|
if (' ' == *n->string && MDOC_LINE & n->flags) |
|
term_newln(p); |
|
term_word(p, n->string); |
|
break; |
|
case (MDOC_EQN): |
|
break; |
|
case (MDOC_TBL): |
|
term_tbl(p, n->span); |
|
break; |
|
default: |
|
if (termacts[n->tok].pre && ENDBODY_NOT == n->end) |
|
chld = (*termacts[n->tok].pre) |
|
(p, &npair, m, n); |
|
break; |
|
} |
|
|
if (MDOC_TEXT == n->type) |
|
term_word(p, n->string); |
|
else if (termacts[n->tok].pre && ENDBODY_NOT == n->end) |
|
chld = (*termacts[n->tok].pre)(p, &npair, m, n); |
|
|
|
/* |
/* |
* Keeps only work until the end of a line. If a keep was |
* Keeps only work until the end of a line. If a keep was |
* invoked in a prior line, revert it to PREKEEP. |
* invoked in a prior line, revert it to PREKEEP. |
Line 353 print_mdoc_node(DECL_ARGS) |
|
Line 366 print_mdoc_node(DECL_ARGS) |
|
|
|
term_fontpopq(p, font); |
term_fontpopq(p, font); |
|
|
if (MDOC_TEXT != n->type && termacts[n->tok].post && |
switch (n->type) { |
! (MDOC_ENDED & n->flags)) { |
case (MDOC_TEXT): |
|
break; |
|
case (MDOC_TBL): |
|
break; |
|
case (MDOC_EQN): |
|
break; |
|
default: |
|
if ( ! termacts[n->tok].post || MDOC_ENDED & n->flags) |
|
break; |
(void)(*termacts[n->tok].post)(p, &npair, m, n); |
(void)(*termacts[n->tok].post)(p, &npair, m, n); |
|
|
/* |
/* |
Line 372 print_mdoc_node(DECL_ARGS) |
|
Line 393 print_mdoc_node(DECL_ARGS) |
|
*/ |
*/ |
if (ENDBODY_NOSPACE == n->end) |
if (ENDBODY_NOSPACE == n->end) |
p->flags |= TERMP_NOSPACE; |
p->flags |= TERMP_NOSPACE; |
|
break; |
} |
} |
|
|
if (MDOC_EOS & n->flags) |
if (MDOC_EOS & n->flags) |
|
|
termp_ns_pre(DECL_ARGS) |
termp_ns_pre(DECL_ARGS) |
{ |
{ |
|
|
p->flags |= TERMP_NOSPACE; |
if ( ! (MDOC_LINE & n->flags)) |
|
p->flags |= TERMP_NOSPACE; |
return(1); |
return(1); |
} |
} |
|
|
Line 1583 termp_bd_pre(DECL_ARGS) |
|
Line 1606 termp_bd_pre(DECL_ARGS) |
|
return(1); |
return(1); |
|
|
tabwidth = p->tabwidth; |
tabwidth = p->tabwidth; |
p->tabwidth = term_len(p, 8); |
if (DISP_literal == n->norm->Bd.type) |
|
p->tabwidth = term_len(p, 8); |
|
|
rm = p->rmargin; |
rm = p->rmargin; |
rmax = p->maxrmargin; |
rmax = p->maxrmargin; |
p->rmargin = p->maxrmargin = TERM_MAXMARGIN; |
p->rmargin = p->maxrmargin = TERM_MAXMARGIN; |
Line 1654 termp_bd_post(DECL_ARGS) |
|
Line 1679 termp_bd_post(DECL_ARGS) |
|
|
|
|
|
/* ARGSUSED */ |
/* ARGSUSED */ |
static void |
static int |
termp_bx_post(DECL_ARGS) |
termp_bx_pre(DECL_ARGS) |
{ |
{ |
|
|
if (n->child) |
if (NULL != (n = n->child)) { |
|
term_word(p, n->string); |
p->flags |= TERMP_NOSPACE; |
p->flags |= TERMP_NOSPACE; |
term_word(p, "BSD"); |
term_word(p, "BSD"); |
|
} else { |
|
term_word(p, "BSD"); |
|
return(0); |
|
} |
|
|
|
if (NULL != (n = n->next)) { |
|
p->flags |= TERMP_NOSPACE; |
|
term_word(p, "-"); |
|
p->flags |= TERMP_NOSPACE; |
|
term_word(p, n->string); |
|
} |
|
|
|
return(0); |
} |
} |
|
|
|
|
Line 1694 termp_xx_pre(DECL_ARGS) |
|
Line 1733 termp_xx_pre(DECL_ARGS) |
|
break; |
break; |
} |
} |
|
|
assert(pp); |
|
term_word(p, pp); |
term_word(p, pp); |
return(1); |
if (n->child) { |
|
p->flags |= TERMP_KEEP; |
|
term_word(p, n->child->string); |
|
p->flags &= ~TERMP_KEEP; |
|
} |
|
return(0); |
} |
} |
|
|
|
|
Line 1855 termp_quote_pre(DECL_ARGS) |
|
Line 1898 termp_quote_pre(DECL_ARGS) |
|
case (MDOC_Bq): |
case (MDOC_Bq): |
term_word(p, "["); |
term_word(p, "["); |
break; |
break; |
case (MDOC__T): |
|
/* FALLTHROUGH */ |
|
case (MDOC_Do): |
case (MDOC_Do): |
/* FALLTHROUGH */ |
/* FALLTHROUGH */ |
case (MDOC_Dq): |
case (MDOC_Dq): |
Line 1867 termp_quote_pre(DECL_ARGS) |
|
Line 1908 termp_quote_pre(DECL_ARGS) |
|
case (MDOC_Pq): |
case (MDOC_Pq): |
term_word(p, "("); |
term_word(p, "("); |
break; |
break; |
|
case (MDOC__T): |
|
/* FALLTHROUGH */ |
case (MDOC_Qo): |
case (MDOC_Qo): |
/* FALLTHROUGH */ |
/* FALLTHROUGH */ |
case (MDOC_Qq): |
case (MDOC_Qq): |
Line 1919 termp_quote_post(DECL_ARGS) |
|
Line 1962 termp_quote_post(DECL_ARGS) |
|
case (MDOC_Bq): |
case (MDOC_Bq): |
term_word(p, "]"); |
term_word(p, "]"); |
break; |
break; |
case (MDOC__T): |
|
/* FALLTHROUGH */ |
|
case (MDOC_Do): |
case (MDOC_Do): |
/* FALLTHROUGH */ |
/* FALLTHROUGH */ |
case (MDOC_Dq): |
case (MDOC_Dq): |
Line 1931 termp_quote_post(DECL_ARGS) |
|
Line 1972 termp_quote_post(DECL_ARGS) |
|
case (MDOC_Pq): |
case (MDOC_Pq): |
term_word(p, ")"); |
term_word(p, ")"); |
break; |
break; |
|
case (MDOC__T): |
|
/* FALLTHROUGH */ |
case (MDOC_Qo): |
case (MDOC_Qo): |
/* FALLTHROUGH */ |
/* FALLTHROUGH */ |
case (MDOC_Qq): |
case (MDOC_Qq): |
Line 2148 termp__t_post(DECL_ARGS) |
|
Line 2191 termp__t_post(DECL_ARGS) |
|
* If we're in an `Rs' and there's a journal present, then quote |
* If we're in an `Rs' and there's a journal present, then quote |
* us instead of underlining us (for disambiguation). |
* us instead of underlining us (for disambiguation). |
*/ |
*/ |
if (n->parent && MDOC_Rs == n->parent->tok && |
if (n->parent && MDOC_Rs == n->parent->tok && |
n->parent->norm->Rs.titlejournal) |
n->parent->norm->Rs.quote_T) |
termp_quote_post(p, pair, m, n); |
termp_quote_post(p, pair, m, n); |
|
|
termp____post(p, pair, m, n); |
termp____post(p, pair, m, n); |
Line 2165 termp__t_pre(DECL_ARGS) |
|
Line 2208 termp__t_pre(DECL_ARGS) |
|
* us instead of underlining us (for disambiguation). |
* us instead of underlining us (for disambiguation). |
*/ |
*/ |
if (n->parent && MDOC_Rs == n->parent->tok && |
if (n->parent && MDOC_Rs == n->parent->tok && |
n->parent->norm->Rs.titlejournal) |
n->parent->norm->Rs.quote_T) |
return(termp_quote_pre(p, pair, m, n)); |
return(termp_quote_pre(p, pair, m, n)); |
|
|
term_fontpush(p, TERMFONT_UNDER); |
term_fontpush(p, TERMFONT_UNDER); |