Closed Mercerenies closed 3 years ago
See branch error-pos
for progress on this issue.
Steps:
AST
should keep track of source position (27f378d)GDError
types should have a SourceOffset
parameter (2a0f94b)PError
should be able to retrieve SourceOffset
from its inner error (1e9df63)SourceOffset
to SourcePos
(8572ae7)SourcePos
(496fb3c)496fb3c closes this issue.
Right now, our error messages leave a lot to be desired. They tell you, in most cases, what is wrong but not where.
When we parse the source, we have information about where in the file we are. We need to transmit this information onto
ir
, then ontogdscript
. This is going to necessitate a significant refactoring of the core data structures in both of those modules. Errors should then be able to tap into the file position information stored in those structures.