=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/mdoc_term.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- src/usr.bin/mandoc/mdoc_term.c 2009/06/18 21:45:31 1.9 +++ src/usr.bin/mandoc/mdoc_term.c 2009/06/18 21:50:45 1.10 @@ -1,4 +1,4 @@ -/* $Id: mdoc_term.c,v 1.9 2009/06/18 21:45:31 schwarze Exp $ */ +/* $Id: mdoc_term.c,v 1.10 2009/06/18 21:50:45 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -583,6 +583,8 @@ break; } + /* FIXME: mandated by parser. */ + errx(1, "list type not supported"); /* NOTREACHED */ } @@ -599,6 +601,9 @@ return(INDENT); if (0 == strcmp(*arg->value, "indent-two")) return(INDENT * 2); + + /* FIXME: needs to support field-widths (10n, etc.). */ + return(strlen(*arg->value)); } @@ -1060,6 +1065,8 @@ { int i; + /* FIXME: mandated by parser. */ + if (-1 == (i = arg_getattr(MDOC_Std, node))) errx(1, "expected -std argument"); if (1 != node->args->argv[i].sz) @@ -1093,6 +1100,8 @@ { int i; + /* FIXME: mandated by parser? */ + if (-1 == (i = arg_getattr(MDOC_Std, node))) errx(1, "expected -std argument"); if (1 != node->args->argv[i].sz) @@ -1146,8 +1155,9 @@ { const struct mdoc_node *n; - if (NULL == (n = node->child)) - errx(1, "expected text line argument"); + assert(node->child && MDOC_TEXT == node->child->type); + n = node->child; + term_word(p, n->string); if (NULL == (n = n->next)) return(0); @@ -1281,8 +1291,7 @@ { const char *lb; - if (NULL == node->child) - errx(1, "expected text line argument"); + assert(node->child && MDOC_TEXT == node->child->type); if ((lb = mdoc_a2lib(node->child->string))) { term_word(p, lb); return(0); @@ -1390,8 +1399,7 @@ { const struct mdoc_node *n; - if (NULL == node->child) - errx(1, "expected text line arguments"); + assert(node->child && MDOC_TEXT == node->child->type); /* FIXME: can be "type funcname" "type varname"... */ @@ -1498,6 +1506,8 @@ else if (MDOC_BODY != node->type) return(1); + /* FIXME: display type should be mandated by parser. */ + if (NULL == node->parent->args) errx(1, "missing display type"); @@ -1623,9 +1633,6 @@ } -/* FIXME: consolidate the following into termp_system. */ - - /* ARGSUSED */ static int termp_ox_pre(DECL_ARGS) @@ -1949,8 +1956,7 @@ p->flags |= ttypes[TTYPE_FUNC_NAME]; for (n = node->child; n; n = n->next) { - if (MDOC_TEXT != n->type) - errx(1, "expected text line argument"); + assert(MDOC_TEXT == n->type); term_word(p, n->string); } p->flags &= ~ttypes[TTYPE_FUNC_NAME]; @@ -1994,9 +2000,7 @@ return(1); } - if (MDOC_TEXT != n->type) - errx(1, "expected text line arguments"); - + assert(MDOC_TEXT == n->type); if (0 == strcmp("Em", n->string)) TERMPAIR_SETFLAG(p, pair, ttypes[TTYPE_EMPH]); else if (0 == strcmp("Sy", n->string)) @@ -2032,9 +2036,7 @@ termp_sm_pre(DECL_ARGS) { - if (NULL == node->child || MDOC_TEXT != node->child->type) - errx(1, "expected boolean line argument"); - + assert(node->child && MDOC_TEXT == node->child->type); if (0 == strcmp("on", node->child->string)) { p->flags &= ~TERMP_NONOSPACE; p->flags &= ~TERMP_NOSPACE;