Skip to content
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

Fix span for not operations #1797

Merged
merged 1 commit into from Sep 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,7 @@
## 1.54.9

* Fix an incorrect span in certain `@media` query deprecation warnings.

## 1.54.8

* No user-visible changes.
Expand Down
5 changes: 3 additions & 2 deletions lib/src/parse/stylesheet.dart
Expand Up @@ -2713,8 +2713,9 @@ abstract class StylesheetParser extends Parser {
invocation, identifier.span.expand(invocation.span));
} else if (plain == "not") {
whitespace();
return UnaryOperationExpression(
UnaryOperator.not, _singleExpression(), identifier.span);
var expression = _singleExpression();
return UnaryOperationExpression(UnaryOperator.not, expression,
identifier.span.expand(expression.span));
}

lower = plain.toLowerCase();
Expand Down
5 changes: 5 additions & 0 deletions pkg/sass_api/CHANGELOG.md
@@ -1,3 +1,8 @@
## 3.0.4

* `UnaryOperationExpression`s with operator `not` now include a correct span,
covering the expression itself instead of just the operator.

## 3.0.3

* No user-visible changes.
Expand Down
4 changes: 2 additions & 2 deletions pkg/sass_api/pubspec.yaml
Expand Up @@ -2,15 +2,15 @@ name: sass_api
# Note: Every time we add a new Sass AST node, we need to bump the *major*
# version because it's a breaking change for anyone who's implementing the
# visitor interface(s).
version: 3.0.3
version: 3.0.4
description: Additional APIs for Dart Sass.
homepage: https://github.com/sass/dart-sass

environment:
sdk: ">=2.17.0 <3.0.0"

dependencies:
sass: 1.54.8
sass: 1.54.9

dev_dependencies:
dartdoc: ^5.0.0
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
@@ -1,5 +1,5 @@
name: sass
version: 1.54.8
version: 1.54.9
description: A Sass implementation in Dart.
homepage: https://github.com/sass/dart-sass

Expand Down