-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve how positions in input is managed. #62
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kaj
force-pushed
the
nom_locate
branch
3 times, most recently
from
March 1, 2020 00:42
eb99b11
to
9a22e4e
Compare
kaj
force-pushed
the
nom_locate
branch
6 times, most recently
from
March 30, 2020 14:16
f498435
to
b8729e6
Compare
kaj
force-pushed
the
nom_locate
branch
6 times, most recently
from
October 14, 2020 19:09
214af93
to
be410f1
Compare
kaj
force-pushed
the
nom_locate
branch
4 times, most recently
from
October 20, 2020 09:13
a4e583b
to
b7fd683
Compare
kaj
force-pushed
the
nom_locate
branch
2 times, most recently
from
October 22, 2020 19:26
db26ca0
to
05c0ecb
Compare
No benefit yet, only the required changes to use LocatedSpan.
Make it possible to create an ErrPos directly from a single Span (even though it curretly requires unsafe magic), and thereby make it possible to convert a ParseError directly into an Error::ParseError, simplifying error handling code a whole lot. Present parse errors to the user in a nice dart-sass-like way.
Add information about file name and impot path to both `Span` and `SourcePos` (which was previously called `ErrPos`).
Use macro `check_parse!` to make tests show a nice error message and correct file position on failure.
kaj
added a commit
that referenced
this pull request
Nov 10, 2020
Progress: 2718 of 5840 tests passed in dart-sass compatiblilty mode. ### Breaking changes * `SourceName` and `sass::Item::Import` was changed by #62. * `Use` was added to the `sass::Item` enum by #80. * Changes to `sass::Value` and `css::Vaue` by #81. ### Improvements * PR #80: Implement `@use` for standard sass modules. All standard modules are at least partially supported, only `sass:string` is fully supported. See issue #60 for for module support status. * PR 82: Implement hwb support in `sass:color`. Also, provide `From<Rgba>` for `css::Value` and deprecate color value constructors. * Provide `From<bool>` for `css::Value` (and deprecate `Value::bool(v)`). * PR #62: Improve `ParseError`, `SourcePos`, and `SourceName` by using located spans by [nom_locate](https://lib.rs/crates/nom_locate) in the parser. A `sass::Item::Import` now handles where each file is imported from, to improve error reporting. * PR #81: Improved number handlig. Now `Value::Number` handles both machine-sized rationals, bignum rationals and floats internally and `Value::NumberBig` is removed. Also, `Value` no longer implemnts `Ord` but only `PartialOrd`, to handle f64 NaN an infinite values correctly. * Improve parsing of `@else` clauses. * Update spec to 2020-10-29. Tested with rustc 1.47.0 (18bf6b4f0 2020-10-07), 1.44.1 (c7087fe00 2020-06-17), 1.42.0 (b8cedc004 2020-03-09), 1.40.0 (73528e339 2019-12-16), 1.38.0 (625451e37 2019-09-23), 1.48.0-beta.8 (121901459 2020-11-08), and 1.49.0-nightly (25f6938da 2020-11-09),
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Use
nom-locate
to provide location of errors, improving error reporting.