This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Request for feedback | Implementation strategy for error linkage


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thank you for your response Helmut.

On 15/04/11 00:32, Helmut Eller wrote:
> I'd say, signaling a &lexical condition at the position of the second
> dot would be the most appropriate action.  Throwing a SyntaxException as
> Kawa currently does is also reasonable.

Yeah, the SyntaxException keeps the SouceMessages, so with modification
it will be fairly easy (I hope) to pick up the end of error mark
information.

> Most of those exceptions carry stacktraces; the stacktrace is filled in
> at the point where the exception is created.  From the stacktrace you
> can extract: the JVM-level class name, JVM-level method name, source
> filename and source line number.  That should be enough to highlight the
> source line.  

IIUC, that would allow one to highlight where in the Kawa source code
the error was raised, not where in the input the error occurred. This
wouldn't allow me to highlight the representative portion of the input
forms.

> Your REPL could in principle do something like
> 
> while (true)
>   try { 
>      print(eval(read()))
>   } catch (Expression e) {
>     <highlight error using e>
>   }

I'll look into this approach, but I'm not certain I'll be able to get
much useful information about the input at all.

> If you split up the eval step in a compile+execute sequence then you can
> also look at the SourceMessages quite directly, which might be easier
> than to figure out the info from the exception.

This is sort of what I was thinking, though I haven't gone too far into
how exactly I should do this "at the high level", at the moment I'm
considering how to add more information into Kawa, since I'm not
convinced I'll get all the information I need from exceptions.

> [Providing good source locations for errors during macro-expansion is
> IMO the interesting part, but that's a story for another day.]

Probably need to learn more about how macro expansion works before this
day, having a graphical macro stepper would be lovely too, maybe one day :D

Thank you once again for your time, much appreciated.

Charles
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQEcBAEBAgAGBQJNqHeVAAoJEG9M6fiX7bE487AIAIdbtI89pAqm+eG9oalLQHiT
SorpiYIhMzHSeUBi7ZqSMDxOoUiAYrMer2rMGyRNwYz4YwFDv80EMCJhF4Sz97FT
Fk20i4AADBzfJ6QcjzqDAebJ0gRWe+bniKQ76tfNNrW/yVz09baQ5xolv153nuye
quh13/IyCFhtxwe1S4k6FwYYQKJFrbALmLlES7lUGdX2yBf7v9LXlGYU2EBjPHp+
7bWzTWdxIaMAvWOKsqUKTAsHZZMqwFdeAtMCsUABH2H686v/m9W9KZh0+3cWXntV
wMrh4qv9ypQVW1GhsXZczgYdA7rGAD9ULylYx4pFFtDYuUyBBT2yfT0EFxXFuPE=
=hwV7
-----END PGP SIGNATURE-----


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]