discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
* Improving error messages?
@ 2010-06-30 22:50 Thomas Klausner
  2010-06-30 23:12 ` Ingo Schwarze
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Klausner @ 2010-06-30 22:50 UTC (permalink / raw)
  To: discuss

[-- Attachment #1: Type: text/plain, Size: 693 bytes --]

Hi!

Recently I stumbled over a problem in pfstat(8) where a Bl had no
matching El; the mandoc version at that time wasn't even complaining
about it, just the error code returned was 1.

I've tried to file a proper bug report about this and reproduce the
problem first.

mandoc-1.10.1 is complaining about the man page with the error:

test.1:14:2: scope broken, syntax violated: multi-line scope breaks multi-line of It

I must confess, I wouldn't have a clue how to find the root cause of
this from the description.

groff-1.19.2 complains about the same problem this way:

mdoc warning: A .Bl directive has no matching .El (#14)

Perhaps the error message can be improved?

Cheers,
 Thomas

[-- Attachment #2: test.1 --]
[-- Type: text/plain, Size: 160 bytes --]

.Dd June 30, 2010
.Dt TEST 1
.Os
.Sh NAME
.Nm test
.Nd test page
.Sh DESCRIPTION
.Bl -bullet
.It
first
.It
second
.\".El
.Sh BUGS
The missing .El is not found.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Improving error messages?
  2010-06-30 22:50 Improving error messages? Thomas Klausner
@ 2010-06-30 23:12 ` Ingo Schwarze
  0 siblings, 0 replies; 2+ messages in thread
From: Ingo Schwarze @ 2010-06-30 23:12 UTC (permalink / raw)
  To: discuss

Hi Thomas,

Thomas Klausner wrote on Thu, Jul 01, 2010 at 12:50:34AM +0200:

> Recently I stumbled over a problem in pfstat(8) where a Bl had no
> matching El; the mandoc version at that time wasn't even complaining
> about it, just the error code returned was 1.
> 
> I've tried to file a proper bug report about this and reproduce the
> problem first.
> 
> mandoc-1.10.1 is complaining about the man page with the error:
> 
> test.1:14:2: scope broken, syntax violated:
> multi-line scope breaks multi-line of It
> 
> I must confess, I wouldn't have a clue how to find the root cause of
> this from the description.
> 
> groff-1.19.2 complains about the same problem this way:
> 
> mdoc warning: A .Bl directive has no matching .El (#14)
> 
> Perhaps the error message can be improved?

In general, yes, we plan to make error messages more specific.
There is still much work to do in that area, so bear with us.
Currently, i'm still focussing on formatting errors,
but i'm already starting to improve some messages as well.

By mere chance, i committed an improvement for the message you are
talking about just yesterday:

http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/mandoc/mdoc_macro.c?sortby=date#rev1.47

http://mdocml.bsd.lv/cgi-bin/cvsweb/mdoc_macro.c?cvsroot=mdocml#rev1.83

The current state is:

  $ mandoc test.1       
  test.1:14:2: FATAL: blocks badly nested: Sh cannot break It

Note that the message gives the exact line numer (14)
and column number (2) of the problem.

Yours,
  Ingo

> .Dd June 30, 2010
> .Dt TEST 1
> .Os
> .Sh NAME
> .Nm test
> .Nd test page
> .Sh DESCRIPTION
> .Bl -bullet
> .It
> first
> .It
> second
> .\".El
> .Sh BUGS
> The missing .El is not found.
--
 To unsubscribe send an email to discuss+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-06-30 23:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-30 22:50 Improving error messages? Thomas Klausner
2010-06-30 23:12 ` Ingo Schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).