* error reporting for line traps
[not found] ` <201101151514.15245.brad@comstyle.com>
@ 2011-01-17 1:36 ` Ingo Schwarze
0 siblings, 0 replies; only message in thread
From: Ingo Schwarze @ 2011-01-17 1:36 UTC (permalink / raw)
To: tech; +Cc: brad
Hi Kristaps,
Brad wrote on Sat, Jan 15, 2011 at 03:14:13PM -0500:
> yasm_arch.7:75:2: ERROR: skipping unknown macro: .it 1 an-trap
In oder to help people who are being helpful by reporting mandoc issues,
i'd like mandoc messages to be as specific as possible, in particular
when something is really hopeless for now, and is known to be hopeless.
One of the cases where mandoc itself can provide clear recommendations
even without human review is when a page uses roff requests that are
clearly important, but are blatantly mishandled by mandoc. We already
report a couple of these: .am, .ami, .am1, and .dei.
Now .it turns out to be another one of the kind, it is not easy
to implement, and it is apparently used in real manuals, so add it
to the list.
While here, also make the respective message more explicit.
OK?
Yours,
Ingo
Index: main.c
===================================================================
RCS file: /cvs/src/usr.bin/mandoc/main.c,v
retrieving revision 1.68
diff -u -p -r1.68 main.c
--- main.c 16 Jan 2011 19:27:25 -0000 1.68
+++ main.c 17 Jan 2011 01:19:32 -0000
@@ -181,7 +181,7 @@ static const char * const mandocerrs[MAN
"escaped character not allowed in a name",
"skipping text before the first section header",
"skipping unknown macro",
- "NOT IMPLEMENTED: skipping request",
+ "NOT IMPLEMENTED, please use groff: skipping request",
"line scope broken",
"argument count wrong",
"skipping end of block that is not open",
Index: roff.c
===================================================================
RCS file: /cvs/src/usr.bin/mandoc/roff.c,v
retrieving revision 1.29
diff -u -p -r1.29 roff.c
--- roff.c 12 Jan 2011 20:56:40 -0000 1.29
+++ roff.c 17 Jan 2011 01:19:33 -0000
@@ -47,6 +47,7 @@ enum rofft {
ROFF_ie,
ROFF_if,
ROFF_ig,
+ ROFF_it,
ROFF_ne,
ROFF_nh,
ROFF_nr,
@@ -168,6 +169,7 @@ static struct roffmac roffs[ROFF_MAX] =
{ "ie", roff_cond, roff_cond_text, roff_cond_sub, ROFFMAC_STRUCT, NULL },
{ "if", roff_cond, roff_cond_text, roff_cond_sub, ROFFMAC_STRUCT, NULL },
{ "ig", roff_block, roff_block_text, roff_block_sub, 0, NULL },
+ { "it", roff_line_ignore, NULL, NULL, 0, NULL },
{ "ne", roff_line_ignore, NULL, NULL, 0, NULL },
{ "nh", roff_line_ignore, NULL, NULL, 0, NULL },
{ "nr", roff_nr, NULL, NULL, 0, NULL },
@@ -930,6 +932,9 @@ roff_evalcond(const char *v, int *pos)
static enum rofferr
roff_line_ignore(ROFF_ARGS)
{
+
+ if (ROFF_it == tok)
+ (*r->msg)(MANDOCERR_REQUEST, r->data, ln, ppos, "it");
return(ROFF_IGN);
}
--
To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv
^ permalink raw reply [flat|nested] only message in thread