~icefox/garnetc#2: 
Refactor errors some

Basically everything should return errors with lists of codespan Diagnostics, which then get output at the top level. Handling of the Files structure might be kinda squirrelly, but I think it's doable.

There's two parts to this currently, which are kinda hilariously opposite:

  • The parser produces nice-ish error messages with codespan, but only ever panics on error, not returns Results.
  • The rest of the compiler has pretty nice Result's with a fair amount of work put into making them informative, but the HIR contains no span info.

So we need to do both: Parser needs to give Result's, and the HIR needs to contain span info for something resembling the expression it corresponds to.

Status
REPORTED
Submitter
~icefox
Assigned to
No-one
Submitted
2 years ago
Updated
1 year, 2 months ago
Labels
T-TODO

~icefox referenced this from ~icefox/garnet#15 2 years ago

~icefox 1 year, 2 months ago*

Probably time to actually do something about this. :-P I need a good low-level design task that isn't giant tree transforms anyway.

~icefox 1 year, 2 months ago

Ok it's now better, at least. The AST and HIR contain origin code span info (mostly), though admittedly not source file info. I don't think I am interested enough in the problem to BRAIN my way through tracking origin info in the loop part of the pratt parser right now, so it's just left absent. That's fine for now.

Nothing actually uses this code span info yet, but that's a Small Matter Of Programming.

~icefox referenced this from #16 1 year, 8 days ago

Register here or Log in to comment, or comment via email.