Skip to content

Commit

Permalink
Fix span for not operations
Browse files Browse the repository at this point in the history
  • Loading branch information
jathak committed Sep 7, 2022
1 parent fb107bd commit be2476a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
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

0 comments on commit be2476a

Please sign in to comment.