=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/mdoc_term.c,v retrieving revision 1.9 retrieving revision 1.10 diff -c -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 **** ! /* $Id: mdoc_term.c,v 1.9 2009/06/18 21:45:31 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * --- 1,4 ---- ! /* $Id: mdoc_term.c,v 1.10 2009/06/18 21:50:45 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * *************** *** 583,588 **** --- 583,590 ---- break; } + /* FIXME: mandated by parser. */ + errx(1, "list type not supported"); /* NOTREACHED */ } *************** *** 599,604 **** --- 601,609 ---- 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,1065 **** --- 1065,1072 ---- { 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,1098 **** --- 1100,1107 ---- { 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,1153 **** { const struct mdoc_node *n; ! if (NULL == (n = node->child)) ! errx(1, "expected text line argument"); term_word(p, n->string); if (NULL == (n = n->next)) return(0); --- 1155,1163 ---- { const struct mdoc_node *n; ! assert(node->child && MDOC_TEXT == node->child->type); ! n = node->child; ! term_word(p, n->string); if (NULL == (n = n->next)) return(0); *************** *** 1281,1288 **** { const char *lb; ! if (NULL == node->child) ! errx(1, "expected text line argument"); if ((lb = mdoc_a2lib(node->child->string))) { term_word(p, lb); return(0); --- 1291,1297 ---- { const char *lb; ! assert(node->child && MDOC_TEXT == node->child->type); if ((lb = mdoc_a2lib(node->child->string))) { term_word(p, lb); return(0); *************** *** 1390,1397 **** { const struct mdoc_node *n; ! if (NULL == node->child) ! errx(1, "expected text line arguments"); /* FIXME: can be "type funcname" "type varname"... */ --- 1399,1405 ---- { const struct mdoc_node *n; ! assert(node->child && MDOC_TEXT == node->child->type); /* FIXME: can be "type funcname" "type varname"... */ *************** *** 1498,1503 **** --- 1506,1513 ---- 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,1631 **** } - /* FIXME: consolidate the following into termp_system. */ - - /* ARGSUSED */ static int termp_ox_pre(DECL_ARGS) --- 1633,1638 ---- *************** *** 1949,1956 **** 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"); term_word(p, n->string); } p->flags &= ~ttypes[TTYPE_FUNC_NAME]; --- 1956,1962 ---- p->flags |= ttypes[TTYPE_FUNC_NAME]; for (n = node->child; n; n = n->next) { ! assert(MDOC_TEXT == n->type); term_word(p, n->string); } p->flags &= ~ttypes[TTYPE_FUNC_NAME]; *************** *** 1994,2002 **** return(1); } ! if (MDOC_TEXT != n->type) ! errx(1, "expected text line arguments"); ! if (0 == strcmp("Em", n->string)) TERMPAIR_SETFLAG(p, pair, ttypes[TTYPE_EMPH]); else if (0 == strcmp("Sy", n->string)) --- 2000,2006 ---- return(1); } ! 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,2040 **** termp_sm_pre(DECL_ARGS) { ! if (NULL == node->child || MDOC_TEXT != node->child->type) ! errx(1, "expected boolean line argument"); ! if (0 == strcmp("on", node->child->string)) { p->flags &= ~TERMP_NONOSPACE; p->flags &= ~TERMP_NOSPACE; --- 2036,2042 ---- termp_sm_pre(DECL_ARGS) { ! assert(node->child && MDOC_TEXT == node->child->type); if (0 == strcmp("on", node->child->string)) { p->flags &= ~TERMP_NONOSPACE; p->flags &= ~TERMP_NOSPACE;