aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mandoc.1
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-10-12 19:31:41 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-10-12 19:31:41 +0000
commit9bdc68b0e9c4ef307f52f16b3727a115cf20e060 (patch)
tree553f1dc246856c95ce4fc3c65ac2c4abdcb2f4bd /mandoc.1
parent714b0f49e6eaefc48e0a4bc4859300de82444b58 (diff)
downloadmandoc-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 'mandoc.1')
-rw-r--r--mandoc.139
1 files changed, 28 insertions, 11 deletions
diff --git a/mandoc.1 b/mandoc.1
index 3773ce94..7b387359 100644
--- a/mandoc.1
+++ b/mandoc.1
@@ -1,4 +1,4 @@
-.\" $Id: mandoc.1,v 1.117 2014/10/11 21:14:16 schwarze Exp $
+.\" $Id: mandoc.1,v 1.118 2014/10/12 19:31:41 schwarze Exp $
.\"
.\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
.\" Copyright (c) 2012, 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -15,7 +15,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: October 11 2014 $
+.Dd $Mdocdate: October 12 2014 $
.Dt MANDOC 1
.Os
.Sh NAME
@@ -911,8 +911,11 @@ The previous, interrupted macro is deleted from the parse tree.
.Ss "Warnings related to missing arguments"
.Bl -ohang
.It Sy "skipping empty request"
-.Pq roff
-The macro name is missing from a macro definition request.
+.Pq roff , eqn
+The macro name is missing from a macro definition request,
+or an
+.Xr eqn 7
+control statement or operation keyword lacks its required argument.
.It Sy "conditional request controls empty scope"
.Pq roff
A conditional request is only useful if any of the following
@@ -1046,6 +1049,11 @@ The
utility assumes
.Fl std
even when it is not specified, but other implementations may not.
+.It Sy "missing eqn box, using \(dq\(dq"
+.Pq eqn
+A diacritic mark or a binary operator is found,
+but there is nothing to the left of it.
+An empty box is inserted.
.El
.Ss "Warnings related to bad macro arguments"
.Bl -ohang
@@ -1218,7 +1226,6 @@ keeps the code more readable.
.It "equation scope open on exit"
.It "overlapping equation scopes"
.It "unexpected end of equation"
-.It "equation syntax error"
.El
.Ss "Errors related to tables"
.Bl -inset -compact
@@ -1272,12 +1279,15 @@ macro.
It may be mistyped or unsupported.
The request or macro is discarded including its arguments.
.It Sy "skipping item outside list"
-.Pq mdoc
+.Pq mdoc , eqn
An
.Ic \&It
macro occurs outside any
.Ic \&Bl
-list.
+list, or an
+.Xr eqn 7
+.Ic above
+delimiter occurs outside any pile.
It is discarded including its arguments.
.It Sy "skipping column outside column list"
.Pq mdoc
@@ -1298,7 +1308,9 @@ block closing macro, a
.Ic \&RE
or
.Ic \&UE
-macro, or the end of an equation, table, or
+macro, an
+.Xr eqn 7
+right delimiter or closing brace, or the end of an equation, table, or
.Xr roff 7
conditional request is encountered but no matching block is open.
The offending request or macro is discarded.
@@ -1395,11 +1407,16 @@ An
.Ic \&St
macro has an unknown argument and is discarded.
.It Sy "skipping request without numeric argument"
-.Pq roff
+.Pq roff , eqn
An
.Ic \&it
-request has a non-numeric or negative argument or no argument at all.
-The invalid request is ignored.
+request or an
+.Xr eqn 7
+.Ic \&size
+or
+.Ic \&gsize
+statement has a non-numeric or negative argument or no argument at all.
+The invalid request or statement is ignored.
.It Sy "skipping all arguments"
.Pq mdoc , man , eqn , roff
An