diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-10-12 19:31:41 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-10-12 19:31:41 +0000 |
commit | 9bdc68b0e9c4ef307f52f16b3727a115cf20e060 (patch) | |
tree | 553f1dc246856c95ce4fc3c65ac2c4abdcb2f4bd /read.c | |
parent | 714b0f49e6eaefc48e0a4bc4859300de82444b58 (diff) | |
download | mandoc-9bdc68b0e9c4ef307f52f16b3727a115cf20e060.tar.gz mandoc-9bdc68b0e9c4ef307f52f16b3727a115cf20e060.tar.zst mandoc-9bdc68b0e9c4ef307f52f16b3727a115cf20e060.zip |
Improve error handling in the eqn(7) parser.
Get rid of the first fatal error, MANDOCERR_EQNSYNT.
In eqn(7), there is no need to be bug-compatible with groff, so there
is no need to abondon the whole equation in case of a syntax error.
In particular:
* Skip "back", "delim", "down", "fwd", "gfont", "gsize", "left",
"right", "size", and "up" without arguments.
* Skip "gsize" and "size" with a non-numeric argument.
* Skip closing delimiters that are not open.
* Skip "above" outside piles.
* For diacritic marks and binary operators without a left operand,
default to an empty box.
* Let piles and matrices take one argument rather than insisting
on a braced list. Let HTML output handle that, too.
* When rewinding, if the root box is guaranteed to match
the termination condition, no error handling is needed.
Diffstat (limited to 'read.c')
-rw-r--r-- | read.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,4 +1,4 @@ -/* $Id: read.c,v 1.89 2014/10/11 21:14:16 schwarze Exp $ */ +/* $Id: read.c,v 1.90 2014/10/12 19:31:41 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org> @@ -149,6 +149,7 @@ static const char * const mandocerrs[MANDOCERR_MAX] = { "missing font type, using \\fR", "unknown font type, using \\fR", "missing -std argument, adding it", + "missing eqn box, using \"\"", /* related to bad macro arguments */ "unterminated quoted argument", @@ -179,7 +180,6 @@ static const char * const mandocerrs[MANDOCERR_MAX] = { "equation scope open on exit", "overlapping equation scopes", "unexpected end of equation", - "equation syntax error", /* related to tables */ "bad table syntax", |