aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mandoc.h
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-01-26 00:57:22 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-01-26 00:57:22 +0000
commit445b12f7ab17bc0449361eeb2f956d5a1a9bcdd6 (patch)
treeaddd569e7b40f08deeb3e88a3ad2f5c06621ede5 /mandoc.h
parent552620095793cb4451871506a6b9373d2677acd9 (diff)
downloadmandoc-445b12f7ab17bc0449361eeb2f956d5a1a9bcdd6.tar.gz
mandoc-445b12f7ab17bc0449361eeb2f956d5a1a9bcdd6.tar.zst
mandoc-445b12f7ab17bc0449361eeb2f956d5a1a9bcdd6.zip
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.
Diffstat (limited to 'mandoc.h')
-rw-r--r--mandoc.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/mandoc.h b/mandoc.h
index 96c570bb..c0979ee0 100644
--- a/mandoc.h
+++ b/mandoc.h
@@ -1,4 +1,4 @@
-/* $Id: mandoc.h,v 1.186 2015/01/24 01:58:33 schwarze Exp $ */
+/* $Id: mandoc.h,v 1.187 2015/01/26 00:57:22 schwarze Exp $ */
/*
* Copyright (c) 2010, 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -136,6 +136,10 @@ enum mandocerr {
MANDOCERR_EQNEOF, /* unexpected end of equation */
/* related to tables */
+ MANDOCERR_TBLOPT_ALPHA, /* non-alphabetic character in tbl options */
+ MANDOCERR_TBLOPT_BAD, /* skipping unknown tbl option: option */
+ MANDOCERR_TBLOPT_NOARG, /* missing tbl option argument */
+ MANDOCERR_TBLOPT_ARGSZ, /* wrong tbl option argument size */
MANDOCERR_TBLNOLAYOUT, /* no table layout cells specified */
MANDOCERR_TBLNODATA, /* no table data cells specified */
MANDOCERR_TBLIGNDATA, /* ignore data in cell */
@@ -175,8 +179,6 @@ enum mandocerr {
MANDOCERR_TOOLARGE, /* input too large */
MANDOCERR_CHAR_UNSUPP, /* unsupported control character: number */
MANDOCERR_REQ_UNSUPP, /* unsupported roff request: request */
- MANDOCERR_TBL, /* unsupported table syntax */
- MANDOCERR_TBLOPT, /* unsupported table option */
MANDOCERR_TBLLAYOUT, /* unsupported table layout */
MANDOCERR_TBLMACRO, /* ignoring macro in table: macro */
@@ -186,7 +188,6 @@ enum mandocerr {
struct tbl_opts {
char tab; /* cell-separator */
char decimal; /* decimal point */
- int linesize;
int opts;
#define TBL_OPT_CENTRE (1 << 0)
#define TBL_OPT_EXPAND (1 << 1)