summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mandoc.121
-rw-r--r--mandoc.h3
-rw-r--r--mdoc_validate.c4
-rw-r--r--read.c3
-rw-r--r--roff.c9
5 files changed, 26 insertions, 14 deletions
diff --git a/mandoc.1 b/mandoc.1
index fda33f00..578a5bda 100644
--- a/mandoc.1
+++ b/mandoc.1
@@ -1201,6 +1201,15 @@ list has a
.Fl width
argument.
That has no effect.
+.It Sy "wrong number of cells"
+In a line of a
+.Ic \&Bl Fl column
+list, the number of tabs or
+.Ic \&Ta
+macros is less than the number expected from the list header line
+or exceeds the expected number by more than one.
+Missing cells remain empty, and all cells exceeding the number of
+columns are joined into one single cell.
.It Sy "unknown AT&T UNIX version"
.Pq mdoc
An
@@ -1252,6 +1261,12 @@ request or a
layout modifier has an unknown
.Ar font
argument.
+.It Sy "odd number of characters in request"
+.Pq roff
+A
+.Ic \&tr
+request contains an odd number of characters.
+The last character is mapped to the blank character.
.El
.Ss "Warnings related to plain text"
.Bl -ohang
@@ -1538,12 +1553,6 @@ When parsing for a request or a user-defined macro name to be called,
only the escape sequence is discarded.
The characters preceding it are used as the request or macro name,
the characters following it are used as the arguments to the request or macro.
-.It Sy "argument count wrong"
-.Pq mdoc , man , roff
-The indicated request or macro has too few or too many arguments.
-The syntax tree will contain the wrong number of arguments as given.
-Formatting behaviour depends on the specific request or macro in question.
-Note that the same message may also occur as a WARNING, see above.
.It Sy "NOT IMPLEMENTED: Bd -file"
.Pq mdoc
For security reasons, the
diff --git a/mandoc.h b/mandoc.h
index a2293d34..d11be744 100644
--- a/mandoc.h
+++ b/mandoc.h
@@ -117,12 +117,14 @@ enum mandocerr {
MANDOCERR_BD_REP, /* skipping duplicate display type: Bd -type */
MANDOCERR_BL_REP, /* skipping duplicate list type: Bl -type */
MANDOCERR_BL_SKIPW, /* skipping -width argument: Bl -type */
+ MANDOCERR_BL_COL, /* wrong number of cells */
MANDOCERR_AT_BAD, /* unknown AT&T UNIX version: At version */
MANDOCERR_FA_COMMA, /* comma in function argument: arg */
MANDOCERR_FN_PAREN, /* parenthesis in function name: arg */
MANDOCERR_RS_BAD, /* invalid content in Rs block: macro */
MANDOCERR_SM_BAD, /* invalid Boolean argument: macro arg */
MANDOCERR_FT_BAD, /* unknown font, skipping request: ft font */
+ MANDOCERR_TR_ODD, /* odd number of characters in request: tr char */
/* related to plain text */
MANDOCERR_FI_BLANK, /* blank line in fill mode, using .sp */
@@ -167,7 +169,6 @@ enum mandocerr {
/* related to request and macro arguments */
MANDOCERR_NAMESC, /* escaped character not allowed in a name: name */
- MANDOCERR_ARGCOUNT, /* argument count wrong */
MANDOCERR_BD_FILE, /* NOT IMPLEMENTED: Bd -file */
MANDOCERR_BL_NOTYPE, /* missing list type, using -item: Bl */
MANDOCERR_NM_NONAME, /* missing manual name, using "": Nm */
diff --git a/mdoc_validate.c b/mdoc_validate.c
index 63694626..76b6e8a5 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -1221,9 +1221,9 @@ post_it(POST_ARGS)
i++;
if (i < cols || i > cols + 1)
- mandoc_vmsg(MANDOCERR_ARGCOUNT,
+ mandoc_vmsg(MANDOCERR_BL_COL,
mdoc->parse, nit->line, nit->pos,
- "columns == %d (have %d)", cols, i);
+ "%d columns, %d cells", cols, i);
break;
default:
abort();
diff --git a/read.c b/read.c
index 0b59a8f8..46cbe254 100644
--- a/read.c
+++ b/read.c
@@ -161,12 +161,14 @@ static const char * const mandocerrs[MANDOCERR_MAX] = {
"skipping duplicate display type",
"skipping duplicate list type",
"skipping -width argument",
+ "wrong number of cells",
"unknown AT&T UNIX version",
"comma in function argument",
"parenthesis in function name",
"invalid content in Rs block",
"invalid Boolean argument",
"unknown font, skipping request",
+ "odd number of characters in request",
/* related to plain text */
"blank line in fill mode, using .sp",
@@ -211,7 +213,6 @@ static const char * const mandocerrs[MANDOCERR_MAX] = {
/* related to request and macro arguments */
"escaped character not allowed in a name",
- "argument count wrong",
"NOT IMPLEMENTED: Bd -file",
"missing list type, using -item",
"missing manual name, using \"\"",
diff --git a/roff.c b/roff.c
index 79c40c83..c07b192e 100644
--- a/roff.c
+++ b/roff.c
@@ -2538,7 +2538,8 @@ roff_cc(ROFF_ARGS)
r->control = 0;
if (*p != '\0')
- mandoc_msg(MANDOCERR_ARGCOUNT, r->parse, ln, ppos, NULL);
+ mandoc_vmsg(MANDOCERR_ARG_EXCESS, r->parse,
+ ln, p - buf->buf, "cc ... %s", p);
return(ROFF_IGN);
}
@@ -2553,7 +2554,7 @@ roff_tr(ROFF_ARGS)
p = buf->buf + pos;
if (*p == '\0') {
- mandoc_msg(MANDOCERR_ARGCOUNT, r->parse, ln, ppos, NULL);
+ mandoc_msg(MANDOCERR_REQ_EMPTY, r->parse, ln, ppos, "tr");
return(ROFF_IGN);
}
@@ -2581,8 +2582,8 @@ roff_tr(ROFF_ARGS)
}
ssz = (size_t)(p - second);
} else if (*second == '\0') {
- mandoc_msg(MANDOCERR_ARGCOUNT, r->parse,
- ln, (int)(p - buf->buf), NULL);
+ mandoc_vmsg(MANDOCERR_TR_ODD, r->parse,
+ ln, first - buf->buf, "tr %s", first);
second = " ";
p--;
}