summaryrefslogtreecommitdiffstats
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
commit40e6bb12623d39d53c3ab3ebf4ea56e96a873c33 (patch)
tree26ababa4ce4eb18c889d833708d191750f52e207 /mandoc.h
parent3c01eadf2c2162ef71538063e43d2f0e31dfff0a (diff)
downloadmandoc-40e6bb12623d39d53c3ab3ebf4ea56e96a873c33.tar.gz
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.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/mandoc.h b/mandoc.h
index 368d3773..a5735a2e 100644
--- a/mandoc.h
+++ b/mandoc.h
@@ -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)