=================================================================== RCS file: /cvs/mandoc/term.c,v retrieving revision 1.31 retrieving revision 1.34 diff -u -p -r1.31 -r1.34 --- mandoc/term.c 2009/03/01 13:06:49 1.31 +++ mandoc/term.c 2009/03/02 12:09:32 1.34 @@ -1,4 +1,4 @@ -/* $Id: term.c,v 1.31 2009/03/01 13:06:49 kristaps Exp $ */ +/* $Id: term.c,v 1.34 2009/03/02 12:09:32 kristaps Exp $ */ /* * Copyright (c) 2009 Kristaps Dzonsons * @@ -25,8 +25,6 @@ #include "term.h" -#define INDENT 6 - /* * Performs actions on nodes of the abstract syntax tree. Both pre- and * post-fix operations are defined here. @@ -934,6 +932,9 @@ static int termp_ft_pre(DECL_ARGS) { + if (SEC_SYNOPSIS == node->sec) + if (node->prev && MDOC_Fo == node->prev->tok) + vspace(p); TERMPAIR_SETFLAG(p, pair, ttypes[TTYPE_FUNC_TYPE]); return(1); } @@ -944,7 +945,7 @@ static void termp_ft_post(DECL_ARGS) { - if (node->sec == SEC_SYNOPSIS) + if (SEC_SYNOPSIS == node->sec) newln(p); } @@ -1065,20 +1066,17 @@ termp_bd_pre(DECL_ARGS) bl = &node->parent->data.block; - i = arg_getattr(MDOC_Offset, bl->argc, bl->argv); if (-1 != i) { assert(1 == bl->argv[i].sz); p->offset += arg_offset(&bl->argv[i]); } - if ( ! arg_hasattr(MDOC_Literal, bl->argc, bl->argv)) - return(1); - p->flags |= TERMP_LITERAL; for (n = node->child; n; n = n->next) { - assert(MDOC_TEXT == n->type); /* FIXME */ + if (MDOC_TEXT != n->type) + errx(1, "non-text displays unsupported"); if ((*n->data.text.string)) { word(p, n->data.text.string); flushln(p); @@ -1144,7 +1142,8 @@ static void termp_bx_post(DECL_ARGS) { - p->flags |= TERMP_NOSPACE; + if (node->child) + p->flags |= TERMP_NOSPACE; word(p, "BSD"); } @@ -1295,6 +1294,7 @@ termp_cd_pre(DECL_ARGS) { TERMPAIR_SETFLAG(p, pair, ttypes[TTYPE_CONFIG]); + newln(p); return(1); }