Incomprehensible error message

H. S. Teoh hsteoh at quickfur.ath.cx
Tue Mar 20 23:45:20 UTC 2018


On Tue, Mar 20, 2018 at 11:05:59PM +0000, Adam D. Ruppe via Digitalmars-d-learn wrote:
> On Tuesday, 20 March 2018 at 21:18:01 UTC, H. S. Teoh wrote:
> > Which means error messages would need to be constructed as an
> > abstract object that the error message printer can then inspect to
> > determine which symbol(s) should be FQNs.
> 
> I've talked before about XML error messages. I'd actually like them to
> literally be xml, but even if they aren't the same principle works -
> pack the error messages with a lot of metadata when they are
> generated, then trim that at a higher level to make it more
> presentable (ideally, that higher level may be the ide, but for a
> console run the compiler might have to do it).

That's not a bad idea, and pretty close to what I have in mind.  The
tricky part is, who's going to do the work of going through *all* of
dmd's error messages and rewriting them with said metadata.  It would
seem to me that a solution that can be implemented gradually is more
likely to be adopted.  E.g. if we can somehow work with the existing
format of error messages and extract some useful info from them, perhaps
reformat substrings that match certain known patterns, then we can
gradually migrate all error messages to a particular format that will
eventually serve as the intermediate metadata encoding.

Any proposed solution that requires a one-off rewriting of every single
error message in dmd is unlikely to fly, IMO.


T

-- 
There are 10 kinds of people in the world: those who can count in binary, and those who can't.


More information about the Digitalmars-d-learn mailing list