Open blerner opened 8 years ago
Related: add one more field to srcloc to indicate elided frames.
No -- that's a problem for how stack traces are displayed; that has nothing to do with where the frames come from.
Hmm, when performing TCO, I need to store this data somewhere. I think it's either srcloc or the stack frame itself. I don't know if modifying the existing stack frame is gonna be a good idea...
ABSOLUTELY in the stack frame. Source-locations are entirely static notions: they're used by error messages, parse trees, etc, and have nothing at all to do with the runtime behavior of the program. Please don't conflate the two.
Got it!
If we're taking suggestions, I've always liked the way that Clang shows compiler errors (i.e. showing the actual line in question with a pointer to the error):
(granted, this is more of a REPL display thing)
Currently we only have two outputs for srcloc: "line ##, column ##", or "file XXX: line ##, column ##". It would be nice to also show the extent of the srcloc, along the lines of "file:startLine:startCol--endLine:endCol". This can't be done with just the boolean flag we currently have, but making yet another method would be silly. Figure out how to streamline this into the existing code, while not breaking the compiler.