From 3aae5aea6108aec8f9c8d9e61ef797f5291a0c60 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sun, 12 Oct 2014 19:31:41 +0000 Subject: 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. --- read.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'read.c') diff --git a/read.c b/read.c index 2b984371..d44fc91e 100644 --- a/read.c +++ b/read.c @@ -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", -- cgit