source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Add a warning if a data cell has no layout.
@ 2011-01-01 22:27 kristaps
  0 siblings, 0 replies; only message in thread
From: kristaps @ 2011-01-01 22:27 UTC (permalink / raw)
  To: source

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-01-01 22:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-01 22:27 mdocml: Add a warning if a data cell has no layout kristaps

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).