=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/main.c,v retrieving revision 1.63 retrieving revision 1.64 diff -u -r1.63 -r1.64 --- src/usr.bin/mandoc/main.c 2011/01/03 23:39:27 1.63 +++ src/usr.bin/mandoc/main.c 2011/01/04 22:28:17 1.64 @@ -1,6 +1,6 @@ -/* $Id: main.c,v 1.63 2011/01/03 23:39:27 schwarze Exp $ */ +/* $Id: main.c,v 1.64 2011/01/04 22:28:17 schwarze 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 @@ -162,9 +162,21 @@ "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", + "data block still open", + "input stack limit exceeded, infinite loop?", "skipping bad character", "skipping text before the first section header", @@ -182,7 +194,6 @@ "missing list type", "line argument(s) will be lost", "body argument(s) will be lost", - "tbl(1) error", "generic fatal error", @@ -509,10 +520,7 @@ } 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 @@ -781,7 +789,7 @@ continue; } else break; - case (ROFF_CONT): + default: break; } @@ -799,9 +807,20 @@ * 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) :