source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: kristaps@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: Add a warning if a data cell has no layout.
Date: Sat, 1 Jan 2011 17:27:08 -0500 (EST)	[thread overview]
Message-ID: <201101012227.p01MR8YL021609@krisdoz.my.domain> (raw)

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

                 reply	other threads:[~2011-01-01 22:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201101012227.p01MR8YL021609@krisdoz.my.domain \
    --to=kristaps@mdocml.bsd.lv \
    --cc=source@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).