Skip to content

Commit

Permalink
Fix nested declarations in SCSS.
Browse files Browse the repository at this point in the history
  • Loading branch information
nex3 committed Oct 30, 2016
1 parent 845c1b8 commit 12397aa
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/src/parse/stylesheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,7 @@ abstract class StylesheetParser extends Parser {
var start = scanner.state;
var declarationOrBuffer = _declarationOrBuffer();

if (declarationOrBuffer is Declaration) {
expectStatementSeparator();
return declarationOrBuffer;
}
if (declarationOrBuffer is Declaration) return declarationOrBuffer;

var buffer = declarationOrBuffer as InterpolationBuffer;
buffer.addInterpolation(_almostAnyValue());
Expand Down Expand Up @@ -239,7 +236,7 @@ abstract class StylesheetParser extends Parser {
var postColonWhitespace = rawText(whitespace);
if (lookingAtChildren()) {
return new Declaration(name, scanner.spanFrom(start),
children: children(_declarationChild));
children: this.children(_declarationChild));
}

midBuffer.write(postColonWhitespace);
Expand Down Expand Up @@ -275,9 +272,12 @@ abstract class StylesheetParser extends Parser {
return nameBuffer;
}

var children =
lookingAtChildren() ? this.children(_declarationChild) : null;
if (children == null) expectStatementSeparator();

return new Declaration(name, scanner.spanFrom(start),
value: value,
children: lookingAtChildren() ? children(_declarationChild) : null);
value: value, children: children);
}

/// Consumes a property declaration.
Expand Down

0 comments on commit 12397aa

Please sign in to comment.