tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: "Anthony J. Bentley" <anthony@cathet.us>
To: tech@mdocml.bsd.lv
Subject: tbl(7) should allow comma-separated options
Date: Mon, 24 Nov 2014 18:33:24 -0700	[thread overview]
Message-ID: <31999.1416879204@cathet.us> (raw)

Hi,

The following table (from nsdejavu(1)) displays incorrectly in mandoc.
Groff displays it correctly.

mandoc doesn't like the comma-separated options. Options after the
first one are currently ignored.

.TS
center,box;
l l.
foo bar
.TE

mandoc: foo.7:2:7: ERROR: bad table syntax

Here's a patch (but is it right?):


Index: tbl_opts.c
===================================================================
RCS file: /cvs/src/usr.bin/mandoc/tbl_opts.c,v
retrieving revision 1.5
diff -u -p -u -p -r1.5 tbl_opts.c
--- tbl_opts.c	20 Apr 2014 16:44:44 -0000	1.5
+++ tbl_opts.c	25 Nov 2014 01:29:42 -0000
@@ -178,7 +178,7 @@ again:	/*
 	 *
 	 * options	::= option_list [:space:]* [;][\n]
 	 * option_list	::= option option_tail
-	 * option_tail	::= [:space:]+ option_list |
+	 * option_tail	::= [,:space:]+ option_list |
 	 *		::= epsilon
 	 * option	::= [:alpha:]+ args
 	 * args		::= [:space:]* [(] [:alpha:]+ [)]
@@ -209,7 +209,7 @@ again:	/*
 
 	buf[i] = '\0';
 
-	while (isspace((unsigned char)p[*pos]))
+	while (isspace((unsigned char)p[*pos]) || p[*pos] == ',')
 		(*pos)++;
 
 	/*
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

             reply	other threads:[~2014-11-25  1:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-25  1:33 Anthony J. Bentley [this message]
2014-11-25  5:52 ` Ingo Schwarze
2014-11-25  6:42   ` Anthony J. Bentley

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=31999.1416879204@cathet.us \
    --to=anthony@cathet.us \
    --cc=tech@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).