Produce a better error message for unclosed style rules (#586)

Closes #577
This commit is contained in:
Natalie Weizenbaum 2019-02-01 17:21:15 -08:00 committed by GitHub
parent b102dc496a
commit a81017275a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -6,6 +6,9 @@
next token that wasn't what was expected, they point *after* the previous
token. This should generally provide more context for the syntax error.
* Produce a better error message for style rules that are missing the closing
`}`.
### Command-Line Interface
* Passing a directory on the command line now compiles all Sass source files in

View File

@ -253,6 +253,8 @@ abstract class StylesheetParser extends Parser {
var wasInStyleRule = _inStyleRule;
_inStyleRule = true;
if (buffer.isEmpty) scanner.error('expected "}".');
return _withChildren(_statement, start, (children, span) {
if (indented && children.isEmpty) {
warn("This selector doesn't have any properties and won't be rendered.",