=================================================================== RCS file: /cvs/mandoc/main.c,v retrieving revision 1.127 retrieving revision 1.134 diff -u -p -r1.127 -r1.134 --- mandoc/main.c 2010/12/29 14:38:14 1.127 +++ mandoc/main.c 2011/01/04 12:06:21 1.134 @@ -1,6 +1,6 @@ -/* $Id: main.c,v 1.127 2010/12/29 14:38:14 kristaps Exp $ */ +/* $Id: main.c,v 1.134 2011/01/04 12:06:21 kristaps Exp $ */ /* - * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons + * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any @@ -153,6 +153,7 @@ static const char * const mandocerrs[MANDOCERR_MAX] = /* related to missing macro arguments */ "skipping empty macro", + "argument count wrong", "missing display type", "list type must come first", "tag lists require a width argument", @@ -176,13 +177,20 @@ static const char * const mandocerrs[MANDOCERR_MAX] = "bad comment style", "unknown escape sequence", "unterminated quoted string", + + /* related to tables */ + "extra data cells", "generic error", + /* related to tables */ "bad table syntax", "bad table option", "bad table layout", "no table layout cells specified", + "no table data cells specified", + "ignore data in cell", + "input stack limit exceeded, infinite loop?", "skipping bad character", "skipping text before the first section header", @@ -526,10 +534,7 @@ fdesc(struct curparse *curp) } assert(curp->roff); - if ( ! roff_endparse(curp->roff)) { - assert(MANDOCLEVEL_FATAL <= file_status); - goto cleanup; - } + roff_endparse(curp->roff); /* * With -Wstop and warnings or errors of at least @@ -798,11 +803,19 @@ rerun: continue; } else break; - case (ROFF_CONT): + default: break; } /* + * If we encounter errors in the recursive parsebuf() + * call, make sure we don't continue parsing. + */ + + if (MANDOCLEVEL_FATAL <= file_status) + break; + + /* * If input parsers have not been allocated, do so now. * We keep these instanced betwen parsers, but set them * locally per parse routine since we can use different @@ -816,9 +829,20 @@ rerun: * Lastly, push down into the parsers themselves. One * of these will have already been set in the pset() * routine. + * If libroff returns ROFF_TBL, then add it to the + * currently open parse. Since we only get here if + * there does exist data (see tbl_data.c), we're + * guaranteed that something's been allocated. */ - if (curp->man || curp->mdoc) { + if (ROFF_TBL == rr) { + assert(curp->man || curp->mdoc); + if (curp->man) + man_addspan(curp->man, roff_span(curp->roff)); + else + mdoc_addspan(curp->mdoc, roff_span(curp->roff)); + + } else if (curp->man || curp->mdoc) { rc = curp->man ? man_parseln(curp->man, curp->line, ln.buf, of) :