diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-01-01 22:27:08 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-01-01 22:27:08 +0000 |
commit | e42168f3c9168eabd49050d6133c5a77f19985c7 (patch) | |
tree | c2b557609ab8741e69245a09c9a586c06d5f6eee | |
parent | 36060e6f93695c0dc996afbb3c9f53f6a825488b (diff) | |
download | mandoc-e42168f3c9168eabd49050d6133c5a77f19985c7.tar.gz |
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).
-rw-r--r-- | main.c | 4 | ||||
-rw-r--r-- | mandoc.h | 5 | ||||
-rw-r--r-- | tbl_data.c | 3 | ||||
-rw-r--r-- | tree.c | 2 |
4 files changed, 13 insertions, 1 deletions
@@ -176,9 +176,13 @@ 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", @@ -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 */ @@ -52,6 +52,9 @@ data(struct tbl *tbl, struct tbl_span *dp, 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; @@ -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(' '); } |