diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2015-01-26 00:57:22 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2015-01-26 00:57:22 +0000 |
commit | 40e6bb12623d39d53c3ab3ebf4ea56e96a873c33 (patch) | |
tree | 26ababa4ce4eb18c889d833708d191750f52e207 /mandoc.h | |
parent | 3c01eadf2c2162ef71538063e43d2f0e31dfff0a (diff) | |
download | mandoc-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.h | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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) |