Hi Bruce,

Bruce Korb <bruce.k...@gmail.com> writes:
> On 01/26/12 18:26, Mark H Weaver wrote:
>>> Too bad.  I do prefer clue-ful error messages and "unknown location"
>>> just wasn't the helpful clue I needed.  Perhaps just use "improper 
>>> location"?
>>> "invalid location"?  Just not "unknown location".
>>
>> That part of the error message (where "unknown location" was printed)
>> would normally contain the filename, line number, and column number.
>
> Then either it ought to have printed the location, or there are new
> wrinkles in the file/line number stuff that I need to know about.
Your code looks good to me, and should allow source locations to be
properly reported in error messages.

It turns out that this was simply a bug in Guile.  For this type of
error (definition in expression context), we would _always_ say "unknown
location", even when compiling a module from a file in the normal way.

I have produced a patch to fix these error messages, and will post it as
soon as I have thoroughly tested it (within a couple of hours), in the
hopes that it may be included in 2.0.4.

>         {
>             SCM ln = AG_SCM_INT2SCM(line);
>             scm_set_port_filename_x(port, file);
>             scm_set_port_line_x(port, ln);
>         }

Ideally, you would also call 'scm_set_port_column_x' here.  Otherwise,
the column numbers of errors on the first line will not be reported
properly.  This is not crucial, but I thought I'd mention it.

    Regards,
      Mark

Reply via email to