From 8eda59eff8f6f4fd1b76e1869eaf673bdc9be474 Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Mon, 19 Apr 2021 12:19:17 -0700 Subject: [PATCH] Properly reset variables in the loop in _peekIndentation() Closes #1287 --- CHANGELOG.md | 5 +++++ lib/src/parse/sass.dart | 10 +++++++--- pubspec.yaml | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 93bb667f1..95994bc6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 1.32.10 + +* Fix a bug where bogus indented syntax errors were reported for lines that + contained only whitespace. + ## 1.32.9 * Fix a typo in a deprecation warning. diff --git a/lib/src/parse/sass.dart b/lib/src/parse/sass.dart index 006554553..db03e8949 100644 --- a/lib/src/parse/sass.dart +++ b/lib/src/parse/sass.dart @@ -408,10 +408,14 @@ class SassParser extends StylesheetParser { scanner.error("Expected newline.", position: scanner.position); } - var containsTab = false; - var containsSpace = false; - var nextIndentation = 0; + late bool containsTab; + late bool containsSpace; + late int nextIndentation; do { + containsTab = false; + containsSpace = false; + nextIndentation = 0; + while (true) { var next = scanner.peekChar(); if (next == $space) { diff --git a/pubspec.yaml b/pubspec.yaml index 39dae0591..1b317c8c2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: sass -version: 1.32.9 +version: 1.32.10 description: A Sass implementation in Dart. author: Sass Team homepage: https://github.com/sass/dart-sass