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 source span for calculation deprecation warnings #2084

Merged
merged 3 commits into from
Sep 15, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.67.1

* Fix the source spans associated with the `abs-percent` deprecation.

## 1.67.0

* All functions defined in CSS Values and Units 4 are now once again parsed as
Expand Down
5 changes: 5 additions & 0 deletions lib/src/visitor/async_evaluate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2431,6 +2431,9 @@ final class _EvaluateVisitor
return SassCalculation.unsimplified(node.name, arguments);
}

var oldCallableNode = _callableNode;
_callableNode = node;

try {
return switch (node.name.toLowerCase()) {
"calc" => SassCalculation.calc(arguments[0]),
Expand Down Expand Up @@ -2471,6 +2474,8 @@ final class _EvaluateVisitor
_verifyCompatibleNumbers(arguments, node.arguments.positional);
}
throwWithTrace(_exception(error.message, node.span), error, stackTrace);
} finally {
_callableNode = oldCallableNode;
}
}

Expand Down
7 changes: 6 additions & 1 deletion lib/src/visitor/evaluate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// DO NOT EDIT. This file was generated from async_evaluate.dart.
// See tool/grind/synchronize.dart for details.
//
// Checksum: ccd4ec1a65cfc2487fccd30481d427086f5c76cc
// Checksum: 7669de19668af665d1a9a60cf67e53e071bf415e
//
// ignore_for_file: unused_import

Expand Down Expand Up @@ -2411,6 +2411,9 @@ final class _EvaluateVisitor
return SassCalculation.unsimplified(node.name, arguments);
}

var oldCallableNode = _callableNode;
_callableNode = node;

try {
return switch (node.name.toLowerCase()) {
"calc" => SassCalculation.calc(arguments[0]),
Expand Down Expand Up @@ -2451,6 +2454,8 @@ final class _EvaluateVisitor
_verifyCompatibleNumbers(arguments, node.arguments.positional);
}
throwWithTrace(_exception(error.message, node.span), error, stackTrace);
} finally {
_callableNode = oldCallableNode;
}
}

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: sass
version: 1.67.0
version: 1.67.1-dev
description: A Sass implementation in Dart.
homepage: https://github.com/sass/dart-sass

Expand Down