=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/mdoc_term.c,v retrieving revision 1.212 retrieving revision 1.213 diff -c -r1.212 -r1.213 *** src/usr.bin/mandoc/mdoc_term.c 2015/03/09 17:41:36 1.212 --- src/usr.bin/mandoc/mdoc_term.c 2015/04/02 21:03:18 1.213 *************** *** 1,4 **** ! /* $OpenBSD: mdoc_term.c,v 1.212 2015/03/09 17:41:36 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010, 2012-2015 Ingo Schwarze --- 1,4 ---- ! /* $OpenBSD: mdoc_term.c,v 1.213 2015/04/02 21:03:18 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010, 2012-2015 Ingo Schwarze *************** *** 8,16 **** * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * ! * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF ! * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --- 8,16 ---- * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * ! * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF ! * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF *************** *** 26,36 **** #include #include - #include "mandoc.h" #include "mandoc_aux.h" #include "out.h" #include "term.h" - #include "mdoc.h" #include "main.h" struct termpair { --- 26,37 ---- #include #include #include "mandoc_aux.h" + #include "mandoc.h" + #include "roff.h" + #include "mdoc.h" #include "out.h" #include "term.h" #include "main.h" struct termpair { *************** *** 329,335 **** */ switch (n->type) { ! case MDOC_TEXT: if (' ' == *n->string && MDOC_LINE & n->flags) term_newln(p); if (MDOC_DELIMC & n->flags) --- 330,336 ---- */ switch (n->type) { ! case ROFFT_TEXT: if (' ' == *n->string && MDOC_LINE & n->flags) term_newln(p); if (MDOC_DELIMC & n->flags) *************** *** 338,351 **** if (MDOC_DELIMO & n->flags) p->flags |= TERMP_NOSPACE; break; ! case MDOC_EQN: if ( ! (n->flags & MDOC_LINE)) p->flags |= TERMP_NOSPACE; term_eqn(p, n->eqn); if (n->next != NULL && ! (n->next->flags & MDOC_LINE)) p->flags |= TERMP_NOSPACE; break; ! case MDOC_TBL: if (p->tbl.cols == NULL) term_newln(p); term_tbl(p, n->span); --- 339,352 ---- if (MDOC_DELIMO & n->flags) p->flags |= TERMP_NOSPACE; break; ! case ROFFT_EQN: if ( ! (n->flags & MDOC_LINE)) p->flags |= TERMP_NOSPACE; term_eqn(p, n->eqn); if (n->next != NULL && ! (n->next->flags & MDOC_LINE)) p->flags |= TERMP_NOSPACE; break; ! case ROFFT_TBL: if (p->tbl.cols == NULL) term_newln(p); term_tbl(p, n->span); *************** *** 365,375 **** (ENDBODY_NOT == n->end ? n : n->body)->prev_font); switch (n->type) { ! case MDOC_TEXT: break; ! case MDOC_TBL: break; ! case MDOC_EQN: break; default: if ( ! termacts[n->tok].post || MDOC_ENDED & n->flags) --- 366,376 ---- (ENDBODY_NOT == n->end ? n : n->body)->prev_font); switch (n->type) { ! case ROFFT_TEXT: break; ! case ROFFT_TBL: break; ! case ROFFT_EQN: break; default: if ( ! termacts[n->tok].post || MDOC_ENDED & n->flags) *************** *** 566,574 **** while (nn->prev == NULL) { do { nn = nn->parent; ! if (nn->type == MDOC_ROOT) return; ! } while (nn->type != MDOC_BLOCK); if (nn->tok == MDOC_Sh || nn->tok == MDOC_Ss) return; if (nn->tok == MDOC_It && --- 567,575 ---- while (nn->prev == NULL) { do { nn = nn->parent; ! if (nn->type == ROFFT_ROOT) return; ! } while (nn->type != ROFFT_BLOCK); if (nn->tok == MDOC_Sh || nn->tok == MDOC_Ss) return; if (nn->tok == MDOC_It && *************** *** 612,618 **** int i, offset, width; enum mdoc_list type; ! if (MDOC_BLOCK == n->type) { print_bvspace(p, n->parent->parent, n); return(1); } --- 613,619 ---- int i, offset, width; enum mdoc_list type; ! if (n->type == ROFFT_BLOCK) { print_bvspace(p, n->parent->parent, n); return(1); } *************** *** 664,670 **** switch (type) { case LIST_column: ! if (MDOC_HEAD == n->type) break; /* --- 665,671 ---- switch (type) { case LIST_column: ! if (n->type == ROFFT_HEAD) break; /* *************** *** 681,688 **** ncols == 5 ? term_len(p, 3) : term_len(p, 1); /* ! * Calculate the offset by applying all prior MDOC_BODY, ! * so we stop at the MDOC_HEAD (NULL == nn->prev). */ for (i = 0, nn = n->prev; --- 682,689 ---- ncols == 5 ? term_len(p, 3) : term_len(p, 1); /* ! * Calculate the offset by applying all prior ROFFT_BODY, ! * so we stop at the ROFFT_HEAD (nn->prev == NULL). */ for (i = 0, nn = n->prev; *************** *** 732,742 **** switch (type) { case LIST_diag: ! if (MDOC_BODY == n->type) term_word(p, "\\ \\ "); break; case LIST_inset: ! if (MDOC_BODY == n->type && n->parent->head->nchild) term_word(p, "\\ "); break; default: --- 733,743 ---- switch (type) { case LIST_diag: ! if (n->type == ROFFT_BODY) term_word(p, "\\ \\ "); break; case LIST_inset: ! if (n->type == ROFFT_BODY && n->parent->head->nchild) term_word(p, "\\ "); break; default: *************** *** 747,753 **** switch (type) { case LIST_diag: ! if (MDOC_HEAD == n->type) term_fontpush(p, TERMFONT_BOLD); break; default: --- 748,754 ---- switch (type) { case LIST_diag: ! if (n->type == ROFFT_HEAD) term_fontpush(p, TERMFONT_BOLD); break; default: *************** *** 775,787 **** case LIST_hyphen: if (width <= (int)term_len(p, 2)) p->flags |= TERMP_HANG; ! if (MDOC_HEAD != n->type) break; p->flags |= TERMP_NOBREAK; p->trailspace = 1; break; case LIST_hang: ! if (MDOC_HEAD != n->type) break; /* --- 776,788 ---- case LIST_hyphen: if (width <= (int)term_len(p, 2)) p->flags |= TERMP_HANG; ! if (n->type != ROFFT_HEAD) break; p->flags |= TERMP_NOBREAK; p->trailspace = 1; break; case LIST_hang: ! if (n->type != ROFFT_HEAD) break; /* *************** *** 800,806 **** p->trailspace = 1; break; case LIST_tag: ! if (MDOC_HEAD != n->type) break; p->flags |= TERMP_NOBREAK | TERMP_BRIND; --- 801,807 ---- p->trailspace = 1; break; case LIST_tag: ! if (n->type != ROFFT_HEAD) break; p->flags |= TERMP_NOBREAK | TERMP_BRIND; *************** *** 810,816 **** p->flags |= TERMP_DANGLE; break; case LIST_column: ! if (MDOC_HEAD == n->type) break; if (NULL == n->next) { --- 811,817 ---- p->flags |= TERMP_DANGLE; break; case LIST_column: ! if (n->type == ROFFT_HEAD) break; if (NULL == n->next) { *************** *** 823,829 **** break; case LIST_diag: ! if (MDOC_HEAD != n->type) break; p->flags |= TERMP_NOBREAK | TERMP_BRIND; p->trailspace = 1; --- 824,830 ---- break; case LIST_diag: ! if (n->type != ROFFT_HEAD) break; p->flags |= TERMP_NOBREAK | TERMP_BRIND; p->trailspace = 1; *************** *** 847,853 **** * don't want to recalculate rmargin and offsets when * using `Bd' or `Bl' within `-hang' overstep lists. */ ! if (MDOC_HEAD == n->type && NULL != n->next && NULL != n->next->child && (MDOC_Bl == n->next->child->tok || --- 848,854 ---- * don't want to recalculate rmargin and offsets when * using `Bd' or `Bl' within `-hang' overstep lists. */ ! if (n->type == ROFFT_HEAD && NULL != n->next && NULL != n->next->child && (MDOC_Bl == n->next->child->tok || *************** *** 863,869 **** case LIST_hyphen: /* FALLTHROUGH */ case LIST_tag: ! if (MDOC_HEAD == n->type) p->rmargin = p->offset + width; else p->offset += width; --- 864,870 ---- case LIST_hyphen: /* FALLTHROUGH */ case LIST_tag: ! if (n->type == ROFFT_HEAD) p->rmargin = p->offset + width; else p->offset += width; *************** *** 875,881 **** * XXX - this behaviour is not documented: the * right-most column is filled to the right margin. */ ! if (MDOC_HEAD == n->type) break; if (NULL == n->next && p->rmargin < p->maxrmargin) p->rmargin = p->maxrmargin; --- 876,882 ---- * XXX - this behaviour is not documented: the * right-most column is filled to the right margin. */ ! if (n->type == ROFFT_HEAD) break; if (NULL == n->next && p->rmargin < p->maxrmargin) p->rmargin = p->maxrmargin; *************** *** 889,895 **** * HEAD character (temporarily bold, in some cases). */ ! if (MDOC_HEAD == n->type) switch (type) { case LIST_bullet: term_fontpush(p, TERMFONT_BOLD); --- 890,896 ---- * HEAD character (temporarily bold, in some cases). */ ! if (n->type == ROFFT_HEAD) switch (type) { case LIST_bullet: term_fontpush(p, TERMFONT_BOLD); *************** *** 927,937 **** case LIST_hyphen: /* FALLTHROUGH */ case LIST_enum: ! if (MDOC_HEAD == n->type) return(0); break; case LIST_column: ! if (MDOC_HEAD == n->type) return(0); break; default: --- 928,938 ---- case LIST_hyphen: /* FALLTHROUGH */ case LIST_enum: ! if (n->type == ROFFT_HEAD) return(0); break; case LIST_column: ! if (n->type == ROFFT_HEAD) return(0); break; default: *************** *** 946,952 **** { enum mdoc_list type; ! if (MDOC_BLOCK == n->type) return; type = n->parent->parent->parent->norm->Bl.type; --- 947,953 ---- { enum mdoc_list type; ! if (n->type == ROFFT_BLOCK) return; type = n->parent->parent->parent->norm->Bl.type; *************** *** 957,967 **** case LIST_diag: /* FALLTHROUGH */ case LIST_inset: ! if (MDOC_BODY == n->type) term_newln(p); break; case LIST_column: ! if (MDOC_BODY == n->type) term_flushln(p); break; default: --- 958,968 ---- case LIST_diag: /* FALLTHROUGH */ case LIST_inset: ! if (n->type == ROFFT_BODY) term_newln(p); break; case LIST_column: ! if (n->type == ROFFT_BODY) term_flushln(p); break; default: *************** *** 985,996 **** { const char *cp; ! if (MDOC_BLOCK == n->type) { p->flags |= TERMP_PREKEEP; return(1); } ! if (MDOC_BODY == n->type) { if (NULL == n->child) return(0); p->flags |= TERMP_NOSPACE; --- 986,997 ---- { const char *cp; ! if (n->type == ROFFT_BLOCK) { p->flags |= TERMP_PREKEEP; return(1); } ! if (n->type == ROFFT_BODY) { if (NULL == n->child) return(0); p->flags |= TERMP_NOSPACE; *************** *** 1009,1025 **** if (NULL == n->child && NULL == meta->name) return(0); ! if (MDOC_HEAD == n->type) synopsis_pre(p, n->parent); ! if (MDOC_HEAD == n->type && NULL != n->next && NULL != n->next->child) { p->flags |= TERMP_NOSPACE | TERMP_NOBREAK | TERMP_BRIND; p->trailspace = 1; p->rmargin = p->offset + term_len(p, 1); if (NULL == n->child) { p->rmargin += term_strlen(p, meta->name); ! } else if (MDOC_TEXT == n->child->type) { p->rmargin += term_strlen(p, n->child->string); if (n->child->next) p->flags |= TERMP_HANG; --- 1010,1026 ---- if (NULL == n->child && NULL == meta->name) return(0); ! if (n->type == ROFFT_HEAD) synopsis_pre(p, n->parent); ! if (n->type == ROFFT_HEAD && NULL != n->next && NULL != n->next->child) { p->flags |= TERMP_NOSPACE | TERMP_NOBREAK | TERMP_BRIND; p->trailspace = 1; p->rmargin = p->offset + term_len(p, 1); if (NULL == n->child) { p->rmargin += term_strlen(p, meta->name); ! } else if (n->child->type == ROFFT_TEXT) { p->rmargin += term_strlen(p, n->child->string); if (n->child->next) p->flags |= TERMP_HANG; *************** *** 1039,1052 **** termp_nm_post(DECL_ARGS) { ! if (MDOC_BLOCK == n->type) { p->flags &= ~(TERMP_KEEP | TERMP_PREKEEP); ! } else if (MDOC_HEAD == n->type && NULL != n->next && NULL != n->next->child) { term_flushln(p); p->flags &= ~(TERMP_NOBREAK | TERMP_BRIND | TERMP_HANG); p->trailspace = 0; ! } else if (MDOC_BODY == n->type && n->child) term_flushln(p); } --- 1040,1053 ---- termp_nm_post(DECL_ARGS) { ! if (n->type == ROFFT_BLOCK) { p->flags &= ~(TERMP_KEEP | TERMP_PREKEEP); ! } else if (n->type == ROFFT_HEAD && NULL != n->next && NULL != n->next->child) { term_flushln(p); p->flags &= ~(TERMP_NOBREAK | TERMP_BRIND | TERMP_HANG); p->trailspace = 0; ! } else if (n->type == ROFFT_BODY && n->child != NULL) term_flushln(p); } *************** *** 1059,1065 **** if ( ! (n->nchild == 0 && (n->next == NULL || ! n->next->type == MDOC_TEXT || n->next->flags & MDOC_LINE))) p->flags |= TERMP_NOSPACE; --- 1060,1066 ---- if ( ! (n->nchild == 0 && (n->next == NULL || ! n->next->type == ROFFT_TEXT || n->next->flags & MDOC_LINE))) p->flags |= TERMP_NOSPACE; *************** *** 1116,1122 **** if (SEC_SEE_ALSO != n->sec) return(1); ! if (MDOC_BLOCK == n->type && n->prev) term_vspace(p); return(1); } --- 1117,1123 ---- if (SEC_SEE_ALSO != n->sec) return(1); ! if (n->type == ROFFT_BLOCK && n->prev != NULL) term_vspace(p); return(1); } *************** *** 1212,1218 **** termp_nd_pre(DECL_ARGS) { ! if (n->type == MDOC_BODY) term_word(p, "\\(en"); return(1); } --- 1213,1219 ---- termp_nd_pre(DECL_ARGS) { ! if (n->type == ROFFT_BODY) term_word(p, "\\(en"); return(1); } *************** *** 1221,1234 **** termp_bl_pre(DECL_ARGS) { ! return(MDOC_HEAD != n->type); } static void termp_bl_post(DECL_ARGS) { ! if (MDOC_BLOCK == n->type) term_newln(p); } --- 1222,1235 ---- termp_bl_pre(DECL_ARGS) { ! return(n->type != ROFFT_HEAD); } static void termp_bl_post(DECL_ARGS) { ! if (n->type == ROFFT_BLOCK) term_newln(p); } *************** *** 1239,1245 **** if (NULL == (n = n->child)) return(0); ! assert(MDOC_TEXT == n->type); term_word(p, n->string); if (NULL == (n = n->next)) --- 1240,1246 ---- if (NULL == (n = n->child)) return(0); ! assert(n->type == ROFFT_TEXT); term_word(p, n->string); if (NULL == (n = n->next)) *************** *** 1249,1255 **** term_word(p, "("); p->flags |= TERMP_NOSPACE; ! assert(MDOC_TEXT == n->type); term_word(p, n->string); p->flags |= TERMP_NOSPACE; --- 1250,1256 ---- term_word(p, "("); p->flags |= TERMP_NOSPACE; ! assert(n->type == ROFFT_TEXT); term_word(p, n->string); p->flags |= TERMP_NOSPACE; *************** *** 1319,1331 **** termp_vt_pre(DECL_ARGS) { ! if (MDOC_ELEM == n->type) { synopsis_pre(p, n); return(termp_under_pre(p, pair, meta, n)); ! } else if (MDOC_BLOCK == n->type) { synopsis_pre(p, n); return(1); ! } else if (MDOC_HEAD == n->type) return(0); return(termp_under_pre(p, pair, meta, n)); --- 1320,1332 ---- termp_vt_pre(DECL_ARGS) { ! if (n->type == ROFFT_ELEM) { synopsis_pre(p, n); return(termp_under_pre(p, pair, meta, n)); ! } else if (n->type == ROFFT_BLOCK) { synopsis_pre(p, n); return(1); ! } else if (n->type == ROFFT_HEAD) return(0); return(termp_under_pre(p, pair, meta, n)); *************** *** 1359,1365 **** { switch (n->type) { ! case MDOC_BLOCK: /* * Vertical space before sections, except * when the previous section was empty. --- 1360,1366 ---- { switch (n->type) { ! case ROFFT_BLOCK: /* * Vertical space before sections, except * when the previous section was empty. *************** *** 1370,1379 **** n->prev->body->child != NULL)) term_vspace(p); break; ! case MDOC_HEAD: term_fontpush(p, TERMFONT_BOLD); break; ! case MDOC_BODY: p->offset = term_len(p, p->defindent); if (SEC_AUTHORS == n->sec) p->flags &= ~(TERMP_SPLIT|TERMP_NOSPLIT); --- 1371,1380 ---- n->prev->body->child != NULL)) term_vspace(p); break; ! case ROFFT_HEAD: term_fontpush(p, TERMFONT_BOLD); break; ! case ROFFT_BODY: p->offset = term_len(p, p->defindent); if (SEC_AUTHORS == n->sec) p->flags &= ~(TERMP_SPLIT|TERMP_NOSPLIT); *************** *** 1389,1398 **** { switch (n->type) { ! case MDOC_HEAD: term_newln(p); break; ! case MDOC_BODY: term_newln(p); p->offset = 0; break; --- 1390,1399 ---- { switch (n->type) { ! case ROFFT_HEAD: term_newln(p); break; ! case ROFFT_BODY: term_newln(p); p->offset = 0; break; *************** *** 1431,1437 **** termp_d1_pre(DECL_ARGS) { ! if (MDOC_BLOCK != n->type) return(1); term_newln(p); p->offset += term_len(p, p->defindent + 1); --- 1432,1438 ---- termp_d1_pre(DECL_ARGS) { ! if (n->type != ROFFT_BLOCK) return(1); term_newln(p); p->offset += term_len(p, p->defindent + 1); *************** *** 1467,1473 **** p->flags |= TERMP_NOBREAK | TERMP_BRIND | TERMP_HANG; } ! assert(MDOC_TEXT == n->type); term_fontpush(p, TERMFONT_BOLD); term_word(p, n->string); term_fontpop(p); --- 1468,1474 ---- p->flags |= TERMP_NOBREAK | TERMP_BRIND | TERMP_HANG; } ! assert(n->type == ROFFT_TEXT); term_fontpush(p, TERMFONT_BOLD); term_word(p, n->string); term_fontpop(p); *************** *** 1484,1490 **** p->flags |= TERMP_NOSPACE; for (n = n->next; n; n = n->next) { ! assert(MDOC_TEXT == n->type); term_fontpush(p, TERMFONT_UNDER); if (pretty) p->flags |= TERMP_NBRWORD; --- 1485,1491 ---- p->flags |= TERMP_NOSPACE; for (n = n->next; n; n = n->next) { ! assert(n->type == ROFFT_TEXT); term_fontpush(p, TERMFONT_UNDER); if (pretty) p->flags |= TERMP_NBRWORD; *************** *** 1541,1550 **** struct mdoc_node *nn; int offset; ! if (MDOC_BLOCK == n->type) { print_bvspace(p, n, n); return(1); ! } else if (MDOC_HEAD == n->type) return(0); /* Handle the -offset argument. */ --- 1542,1551 ---- struct mdoc_node *nn; int offset; ! if (n->type == ROFFT_BLOCK) { print_bvspace(p, n, n); return(1); ! } else if (n->type == ROFFT_HEAD) return(0); /* Handle the -offset argument. */ *************** *** 1588,1594 **** for (nn = n->child; nn; nn = nn->next) { if (DISP_centered == n->norm->Bd.type) { ! if (MDOC_TEXT == nn->type) { len = term_strlen(p, nn->string); p->offset = len >= rm ? 0 : lm + len >= rm ? rm - len : --- 1589,1595 ---- for (nn = n->child; nn; nn = nn->next) { if (DISP_centered == n->norm->Bd.type) { ! if (nn->type == ROFFT_TEXT) { len = term_strlen(p, nn->string); p->offset = len >= rm ? 0 : lm + len >= rm ? rm - len : *************** *** 1641,1647 **** { size_t rm, rmax; ! if (MDOC_BODY != n->type) return; rm = p->rmargin; --- 1642,1648 ---- { size_t rm, rmax; ! if (n->type != ROFFT_BODY) return; rm = p->rmargin; *************** *** 1735,1750 **** { switch (n->type) { ! case MDOC_BLOCK: term_newln(p); if (n->prev) term_vspace(p); break; ! case MDOC_HEAD: term_fontpush(p, TERMFONT_BOLD); p->offset = term_len(p, (p->defindent+1)/2); break; ! case MDOC_BODY: p->offset = term_len(p, p->defindent); break; default: --- 1736,1751 ---- { switch (n->type) { ! case ROFFT_BLOCK: term_newln(p); if (n->prev) term_vspace(p); break; ! case ROFFT_HEAD: term_fontpush(p, TERMFONT_BOLD); p->offset = term_len(p, (p->defindent+1)/2); break; ! case ROFFT_BODY: p->offset = term_len(p, p->defindent); break; default: *************** *** 1758,1764 **** termp_ss_post(DECL_ARGS) { ! if (n->type == MDOC_HEAD || n->type == MDOC_BODY) term_newln(p); } --- 1759,1765 ---- termp_ss_post(DECL_ARGS) { ! if (n->type == ROFFT_HEAD || n->type == ROFFT_BODY) term_newln(p); } *************** *** 1849,1855 **** termp_quote_pre(DECL_ARGS) { ! if (MDOC_BODY != n->type && MDOC_ELEM != n->type) return(1); switch (n->tok) { --- 1850,1856 ---- termp_quote_pre(DECL_ARGS) { ! if (n->type != ROFFT_BODY && n->type != ROFFT_ELEM) return(1); switch (n->tok) { *************** *** 1916,1922 **** termp_quote_post(DECL_ARGS) { ! if (n->type != MDOC_BODY && n->type != MDOC_ELEM) return; p->flags |= TERMP_NOSPACE; --- 1917,1923 ---- termp_quote_post(DECL_ARGS) { ! if (n->type != ROFFT_BODY && n->type != ROFFT_ELEM) return; p->flags |= TERMP_NOSPACE; *************** *** 1984,1990 **** termp_eo_pre(DECL_ARGS) { ! if (n->type != MDOC_BODY) return(1); if (n->end == ENDBODY_NOT && --- 1985,1991 ---- termp_eo_pre(DECL_ARGS) { ! if (n->type != ROFFT_BODY) return(1); if (n->end == ENDBODY_NOT && *************** *** 2005,2011 **** { int body, tail; ! if (n->type != MDOC_BODY) return; if (n->end != ENDBODY_NOT) { --- 2006,2012 ---- { int body, tail; ! if (n->type != ROFFT_BODY) return; if (n->end != ENDBODY_NOT) { *************** *** 2032,2041 **** pretty = MDOC_SYNPRETTY & n->flags; ! if (MDOC_BLOCK == n->type) { synopsis_pre(p, n); return(1); ! } else if (MDOC_BODY == n->type) { if (pretty) { rmargin = p->rmargin; p->rmargin = p->offset + term_len(p, 4); --- 2033,2042 ---- pretty = MDOC_SYNPRETTY & n->flags; ! if (n->type == ROFFT_BLOCK) { synopsis_pre(p, n); return(1); ! } else if (n->type == ROFFT_BODY) { if (pretty) { rmargin = p->rmargin; p->rmargin = p->offset + term_len(p, 4); *************** *** 2070,2076 **** termp_fo_post(DECL_ARGS) { ! if (MDOC_BODY != n->type) return; p->flags |= TERMP_NOSPACE; --- 2071,2077 ---- termp_fo_post(DECL_ARGS) { ! if (n->type != ROFFT_BODY) return; p->flags |= TERMP_NOSPACE; *************** *** 2087,2095 **** termp_bf_pre(DECL_ARGS) { ! if (MDOC_HEAD == n->type) return(0); ! else if (MDOC_BODY != n->type) return(1); if (FONT_Em == n->norm->Bf.font) --- 2088,2096 ---- termp_bf_pre(DECL_ARGS) { ! if (n->type == ROFFT_HEAD) return(0); ! else if (n->type != ROFFT_BODY) return(1); if (FONT_Em == n->norm->Bf.font) *************** *** 2195,2205 **** { switch (n->type) { ! case MDOC_BLOCK: break; ! case MDOC_HEAD: return(0); ! case MDOC_BODY: if (n->parent->args || 0 == n->prev->nchild) p->flags |= TERMP_PREKEEP; break; --- 2196,2206 ---- { switch (n->type) { ! case ROFFT_BLOCK: break; ! case ROFFT_HEAD: return(0); ! case ROFFT_BODY: if (n->parent->args || 0 == n->prev->nchild) p->flags |= TERMP_PREKEEP; break; *************** *** 2215,2221 **** termp_bk_post(DECL_ARGS) { ! if (MDOC_BODY == n->type) p->flags &= ~(TERMP_KEEP | TERMP_PREKEEP); } --- 2216,2222 ---- termp_bk_post(DECL_ARGS) { ! if (n->type == ROFFT_BODY) p->flags &= ~(TERMP_KEEP | TERMP_PREKEEP); }