From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from krisdoz.my.domain (kristaps@localhost [127.0.0.1]) by krisdoz.my.domain (8.14.3/8.14.3) with ESMTP id p01MR87w015458 for ; Sat, 1 Jan 2011 17:27:09 -0500 (EST) Received: (from kristaps@localhost) by krisdoz.my.domain (8.14.3/8.14.3/Submit) id p01MR8YL021609; Sat, 1 Jan 2011 17:27:08 -0500 (EST) Date: Sat, 1 Jan 2011 17:27:08 -0500 (EST) Message-Id: <201101012227.p01MR8YL021609@krisdoz.my.domain> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: kristaps@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: Add a warning if a data cell has no layout. X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- Add a warning if a data cell has no layout. Also make -Ttree show this with a little star next to the entry (yeah, this is mostly for testing). Modified Files: -------------- mdocml: main.c mandoc.h tbl_data.c tree.c Revision Data ------------- Index: tbl_data.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/tbl_data.c,v retrieving revision 1.6 retrieving revision 1.7 diff -Ltbl_data.c -Ltbl_data.c -u -p -r1.6 -r1.7 --- tbl_data.c +++ tbl_data.c @@ -52,6 +52,9 @@ data(struct tbl *tbl, struct tbl_span *d dat = mandoc_calloc(1, sizeof(struct tbl_dat)); dat->layout = cp; + if (NULL == dat->layout) + TBL_MSG(tbl, MANDOCERR_TBLEXTRADAT, ln, *pos); + if (dp->last) { dp->last->next = dat; dp->last = dat; Index: mandoc.h =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mandoc.h,v retrieving revision 1.41 retrieving revision 1.42 diff -Lmandoc.h -Lmandoc.h -u -p -r1.41 -r1.42 --- mandoc.h +++ mandoc.h @@ -99,13 +99,18 @@ enum mandocerr { MANDOCERR_BADESCAPE, /* unknown escape sequence */ MANDOCERR_BADQUOTE, /* unterminated quoted string */ + /* related to tables */ + MANDOCERR_TBLEXTRADAT, /* extra data cells */ + MANDOCERR_ERROR, /* ===== start of errors ===== */ + /* related to tables */ MANDOCERR_TBL, /* bad table syntax */ MANDOCERR_TBLOPT, /* bad table option */ MANDOCERR_TBLLAYOUT, /* bad table layout */ MANDOCERR_TBLNOLAYOUT, /* no table layout cells specified */ MANDOCERR_TBLNODATA, /* no table data cells specified */ + MANDOCERR_ROFFLOOP, /* input stack limit exceeded, infinite loop? */ MANDOCERR_BADCHAR, /* skipping bad character */ MANDOCERR_NOTEXT, /* skipping text before the first section header */ Index: tree.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/tree.c,v retrieving revision 1.28 retrieving revision 1.29 diff -Ltree.c -Ltree.c -u -p -r1.28 -r1.29 --- tree.c +++ tree.c @@ -278,7 +278,7 @@ print_span(const struct tbl_span *sp) default: break; } - printf("[%s]", dp->string); + printf("[%s%s]", dp->string, dp->layout ? "" : "*"); if (dp->next) putchar(' '); } Index: main.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/main.c,v retrieving revision 1.130 retrieving revision 1.131 diff -Lmain.c -Lmain.c -u -p -r1.130 -r1.131 --- main.c +++ main.c @@ -176,9 +176,13 @@ static const char * const mandocerrs[MAN "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", -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv