diff --git a/CHANGELOG.md b/CHANGELOG.md index ed285c3f5..201738ffe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/lib/src/parse/stylesheet.dart b/lib/src/parse/stylesheet.dart index 212a296c4..388beb888 100644 --- a/lib/src/parse/stylesheet.dart +++ b/lib/src/parse/stylesheet.dart @@ -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.",