Fix inline comments in the indented syntax (#881)

Closes #880
This commit is contained in:
Natalie Weizenbaum 2019-11-15 15:45:11 -08:00 committed by GitHub
parent 07b5c84b7d
commit 0d782fbccf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 6 deletions

View File

@ -1,5 +1,7 @@
## 1.23.5
* Support inline comments in the indented syntax.
* When an overloaded function receives the wrong number of arguments, guess
which overload the user actually meant to invoke, and display the invalid
argument error for that overload.

View File

@ -309,17 +309,29 @@ class SassParser extends StylesheetParser {
return LoudComment(buffer.interpolation(scanner.spanFrom(start)));
}
void whitespace() {
// This overrides whitespace consumption so that it doesn't consume newlines
// or loud comments.
void whitespaceWithoutComments() {
// This overrides whitespace consumption so that it doesn't consume
// newlines.
while (!scanner.isDone) {
var next = scanner.peekChar();
if (next != $tab && next != $space) break;
scanner.readChar();
}
}
if (scanner.peekChar() == $slash && scanner.peekChar(1) == $slash) {
silentComment();
void loudComment() {
// This overrides loud comment consumption so that it doesn't consume
// multi-line comments.
scanner.expect("/*");
while (true) {
var next = scanner.readChar();
if (isNewline(next)) scanner.error("expected */.");
if (next != $asterisk) continue;
do {
next = scanner.readChar();
} while (next == $asterisk);
if (next == $slash) break;
}
}

View File

@ -1,5 +1,5 @@
name: sass
version: 1.23.5-dev
version: 1.23.5
description: A Sass implementation in Dart.
author: Sass Team
homepage: https://github.com/sass/dart-sass