From c93c28ddbd10b595b059b57e708baf92fe431c33 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Mon, 26 Jan 2015 00:54:10 +0000 Subject: Improve (or rather, rewrite) tbl(7) option parsing. * Allow the layout to start after the semicolon on the options line. * Ignore leading commas. * Option arguments cannot contain closing parentheses. * Avoid needless UNSUPP messages. * Better ERROR reporting. * Delete unused "linesize" field in struct tbl_opts. * No need for static buffers. * Garbage collect one almost empty wrapper function. Improved functionality, but minus 40 lines of code. --- usr.bin/mandoc/read.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'usr.bin/mandoc/read.c') diff --git a/usr.bin/mandoc/read.c b/usr.bin/mandoc/read.c index 7f8c4c62b0a..f2b4d96d28d 100644 --- a/usr.bin/mandoc/read.c +++ b/usr.bin/mandoc/read.c @@ -1,4 +1,4 @@ -/* $OpenBSD: read.c,v 1.90 2015/01/24 01:59:40 schwarze Exp $ */ +/* $OpenBSD: read.c,v 1.91 2015/01/26 00:54:09 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010-2015 Ingo Schwarze @@ -175,6 +175,10 @@ static const char * const mandocerrs[MANDOCERR_MAX] = { "unexpected end of equation", /* related to tables */ + "non-alphabetic character in tbl options", + "skipping unknown tbl option", + "missing tbl option argument", + "wrong tbl option argument size", "no table layout cells specified", "no table data cells specified", "ignore data in cell", @@ -213,8 +217,6 @@ static const char * const mandocerrs[MANDOCERR_MAX] = { "input too large", "unsupported control character", "unsupported roff request", - "unsupported table syntax", - "unsupported table option", "unsupported table layout", "ignoring macro in table", }; -- cgit v1.2.3