diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-07-13 07:23:07 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-07-13 07:23:07 +0000 |
commit | 25984218728319c0e6aae65ffcdb4997a8036795 (patch) | |
tree | 9004cc211f9271d99ac9894140af4cc76ac02671 /mdoc_term.c | |
parent | c13cf29fb280ec0bdd7e124d786f95c82f3e2c71 (diff) | |
download | mandoc-25984218728319c0e6aae65ffcdb4997a8036795.tar.gz |
Err/warn fix (schwarze@openbsd.org).
Lots of whitespace churn in getting functions aligned nicely.
Diffstat (limited to 'mdoc_term.c')
-rw-r--r-- | mdoc_term.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/mdoc_term.c b/mdoc_term.c index df2258c1..7db43e79 100644 --- a/mdoc_term.c +++ b/mdoc_term.c @@ -571,16 +571,15 @@ arg_listtype(const struct mdoc_node *n) /* FALLTHROUGH */ case (MDOC_Column): /* FALLTHROUGH */ + case (MDOC_Hang): + /* FALLTHROUGH */ case (MDOC_Ohang): return(n->args->argv[i].arg); default: break; } - /* FIXME: mandated by parser. */ - - errx(1, "list type not supported"); - /* NOTREACHED */ + return(-1); } @@ -726,6 +725,7 @@ termp_it_pre(DECL_ARGS) (void)arg_getattrs(keys, vals, 3, bl); type = arg_listtype(bl); + assert(-1 != type); /* Calculate real width and offset. */ @@ -752,7 +752,7 @@ termp_it_pre(DECL_ARGS) /* * List-type can override the width in the case of fixed-head * values (bullet, dash/hyphen, enum). Tags need a non-zero - * offset. + * offset. FIXME: double-check that correct. */ switch (type) { @@ -768,6 +768,8 @@ termp_it_pre(DECL_ARGS) if (width < 5) width = 5; break; + case (MDOC_Hang): + /* FALLTHROUGH */ case (MDOC_Tag): if (0 == width) width = 10; @@ -785,6 +787,8 @@ termp_it_pre(DECL_ARGS) case (MDOC_Diag): term_word(p, "\\ "); /* FALLTHROUGH */ + case (MDOC_Hang): + /* FALLTHROUGH */ case (MDOC_Inset): if (MDOC_BODY == node->type) p->flags &= ~TERMP_NOSPACE; @@ -826,11 +830,17 @@ termp_it_pre(DECL_ARGS) /* FALLTHROUGH */ case (MDOC_Hyphen): /* FALLTHROUGH */ + case (MDOC_Hang): + /* FALLTHROUGH */ case (MDOC_Tag): if (MDOC_HEAD == node->type) p->flags |= TERMP_NOBREAK; else p->flags |= TERMP_NOLPAD; + + if (MDOC_HEAD == node->type && MDOC_Hang == type) + p->flags |= TERMP_NONOBREAK; + if (MDOC_HEAD == node->type && MDOC_Tag == type) if (NULL == node->next || NULL == node->next->child) @@ -872,6 +882,8 @@ termp_it_pre(DECL_ARGS) /* FALLTHROUGH */ case (MDOC_Hyphen): /* FALLTHROUGH */ + case (MDOC_Hang): + /* FALLTHROUGH */ case (MDOC_Tag): if (MDOC_HEAD == node->type) p->rmargin = p->offset + width; @@ -954,6 +966,7 @@ termp_it_post(DECL_ARGS) return; type = arg_listtype(node->parent->parent->parent); + assert(-1 != type); switch (type) { case (MDOC_Diag): |