Now error messages highlight the error location #225
Merged
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.
A work on error reporting, as promised in #5 .
First of all, I must genuinely apologize for this long delay, the summer had happened to be more busy and eventful than I'd expected. I don't think something like that will happen this month, although you never know what's going to happen, don't you? Sorry again.
About PR:
It seems like the current (old) implementation drops Spans as soon as possible which was quite sensible: there was no way to use it so there was no need to carry needless stuff around. Worse yet: most of data structures are
enum
s and one doesn't simply attach a piece of data to anenum
. Basically, we have two ways:first is to attach this data to every variant, like
Easy to see, this is extremely cumbersome. Despite this, I had to use this approach for some
enum
s(or just one... can't remember), mostly because I was forced to by a
trait
interface.second is to separate the kind and the metadata:
The drawback here is there are a quite a lot of
enum
s out here. I chose this approach, but slightly modified. There isstruct Sp<T>
inspanned
module. It's essentially a wrapper aroundT
which carries the span needed. For the sake of convince it implementsDeref
and someFrom
traits.Besides the
Span
problem mentioned, I've performed some refactoring, typically simplifying the code .Most relevant changes are in
src/*.rs
files.