[m-dev.] preferences for error contexts
Zoltan Somogyi
zs at csse.unimelb.edu.au
Fri May 15 17:44:30 AEST 2009
On 15-May-2009, Peter Wang <novalazy at gmail.com> wrote:
> We have some ugly error messages due to the way we use mmc -f, where
> the filename and line number context ends up taking up most of the screen
> width (don't ask). Something like this:
>
> /home/pwa/Work/gws_shorter_errors/extras/moose/lalr.m:535: In clause for
> /home/pwa/Work/gws_shorter_errors/extras/moose/lalr.m:535: predicate
> /home/pwa/Work/gws_shorter_errors/extras/moose/lalr.m:535: `propagate3'/7:
> /home/pwa/Work/gws_shorter_errors/extras/moose/lalr.m:535: in argument 3 of
> /home/pwa/Work/gws_shorter_errors/extras/moose/lalr.m:535: call to predicate
> /home/pwa/Work/gws_shorter_errors/extras/moose/lalr.m:535: `map.search'/3:
> /home/pwa/Work/gws_shorter_errors/extras/moose/lalr.m:535: type error:
> /home/pwa/Work/gws_shorter_errors/extras/moose/lalr.m:535: variable `I' has
> /home/pwa/Work/gws_shorter_errors/extras/moose/lalr.m:535: type
> /home/pwa/Work/gws_shorter_errors/extras/moose/lalr.m:535:
> `(set.set((lalr.item)))',
> /home/pwa/Work/gws_shorter_errors/extras/moose/lalr.m:535: expected type was
> /home/pwa/Work/gws_shorter_errors/extras/moose/lalr.m:535:
> `(tree234.tree234((lalr.item),
> /home/pwa/Work/gws_shorter_errors/extras/moose/lalr.m:535:
> (set.set((grammar.terminal)))))'.
>
>
> I have a change that prints the context only on the first line.
> The output ends up like:
>
> /home/pwa/Work/gws_shorter_errors/extras/moose/lalr.m:535: In clause for
> predicate `propagate3'/7:
> in argument 3 of call to predicate `map.search'/3:
> type error:
> variable `I' has type `set.set(lalr.item)',
> expected type was `tree234.tree234(lalr.item, set.set(grammar.terminal))'.
> /home/pwa/Work/gws_shorter_errors/extras/moose/lalr.m:538: In clause for
> predicate `propagate3'/7:
> in argument 1 of call to predicate `map.init'/1:
> type error:
> variable `X1' has type `set.set(lalr.item)',
> expected type was `tree234.tree234(V_V_1, V_V_2)'.
The replies to this email all seem to think that the old format and this
proposed format are the only two alternatives. They are not.
At the very least, we could consider these formats and variations on them:
lalr.m:535: In clause for predicate ...
lalr.m:535: ...
lalr.m:535: This file is in /home/pwa/Work/gws_shorter_errors/extras/moose.
The following errors refer to files in
ERRORDIR /home/pwa/Work/gws_shorter_errors/extras/moose.
lalr.m:535: In clause for predicate ...
lalr.m:535: ...
Zoltan.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at csse.unimelb.edu.au
Administrative Queries: owner-mercury-developers at csse.unimelb.edu.au
Subscriptions: mercury-developers-request at csse.unimelb.edu.au
--------------------------------------------------------------------------
More information about the developers
mailing list