Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #27 , closes #35
In the old debug system, the error messages were directly dumped to the log stream and then the procedure would just exit the program with an error code. This meant that the error messages were somewhat simple and not very helpful.
In the new system, the error information is RETURNED from the called procedure to the caller procedure. This allows the caller procedure to improve the error messages by adding new layers of information about the error.
This is accomplished by creating a
log-item
structure. Any log item has a log type which contains information about what this log item represents, and log arguments which explain the log entry further. Procedures and macros for creating, managing and handling these log entries are defined inside compiler/debug.corth file.These improvements also has a lovely side effect: The compiler now compiles itself much faster than it did before. The compiler used to take ~3 seconds to compile itself. It now takes ~1.15 seconds.
However, some of the error messages are not as useful as they could. These require future updates to make them more informative.