This more closely matches the categorization of other AST nodes, which
aren't broken down into fine-grained categories.
This also adds the "Parsing" category to selector classes that have
`parse()` methods.
This was overlooked in #1175, because the spec said that `hwb()`
should already be throwing an error if non-`deg` units were passed.
However, Dart Sass didn't implement the spec correctly and these units
were in fact not being checked at all.
See #1174
See sass/sass-spec#1485
- Update lib/src/visitor/serialize.dart to stop using old-style int-based for loop.
- Extend FileSpan with a .contains(targetSpan) method
Co-authored-by: Nick Behrens <nbehrens@google.com>
Co-authored-by: Carlos Israel Ortiz García <goodwine@google.com>
Co-Authored-By: Natalie Weizenbaum <nweiz@google.com>
* Fix the string representations of the Sass AST
Those are used when providing recommendations in warnings or errors, so
it is better if they produce valid code.
* Add changelog
Co-authored-by: Jennifer Thakar <jathak@google.com>
At that point, the scanner is still at the same position than the
previous check for children returning a nested declaration, so it is
impossible for it to be looking at children.
This change preserves behavior, though the current behavior has the
appearance of a bug so an author more familiar with the intention may
want to add a test.
There are no assignments to `first` so the conditional can be removed.
When building internally the analyze is surfacing a `dead_code`
diagnostic which needs to be ignored. Fixing the code will allow us to
remove the ignore.
I don't know why the diagnostic does not show up when analyzing using
the external analyzer.
https://github.com/dart-lang/sdk/issues/47837
This also changes the string representation of ParenthesizedExpression
to fix the recommendations involving them (otherwise the calc
recommendation would be an invalid one).
Co-authored-by: Natalie Weizenbaum <nweiz@google.com>
This requires a lot of manual machinery when displaying stack traces
to the user, but it should make debugging errors (especially in JS)
much easier.
Works around dart-lang/sdk#10297 using expandos.
Instead, we create a single zone-scoped object that's visible for the
entire lifespan of the visitor, and which exposes evaluation internals
which can be updated as direct field modifications.
This dramatically improves the performance of a sample app using the
Carbon design system, and should generally improve apps that have a
lot of repeated @imports of library files. It's possible we can back
this out if it's not pulling its weight once we no longer support
@import.