Skip to content

Commit

Permalink
Parse declaration children before building its span (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
srawlins authored and nex3 committed Jun 1, 2017
1 parent b02da78 commit 7677ab1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/src/parse/stylesheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@ abstract class StylesheetParser extends Parser {
/// parsing it as a declaration value. If this fails, backtrack and parse
/// it as a selector.
///
/// * If the declaration value value valid but is followed by "{", backtrack
/// and parse it as a selector anyway. This ensures that ".foo:bar {" is
/// always parsed as a selector and never as a property with nested
/// properties beneath it.
/// * If the declaration value is valid but is followed by "{", backtrack and
/// parse it as a selector anyway. This ensures that ".foo:bar {" is always
/// parsed as a selector and never as a property with nested properties
/// beneath it.
Statement _declarationOrStyleRule() {
var start = scanner.state;
var declarationOrBuffer = _declarationOrBuffer();
Expand Down Expand Up @@ -262,8 +262,8 @@ abstract class StylesheetParser extends Parser {

var postColonWhitespace = rawText(whitespace);
if (lookingAtChildren()) {
return new Declaration(name, scanner.spanFrom(start),
children: this.children(_declarationChild));
var children = this.children(_declarationChild);
return new Declaration(name, scanner.spanFrom(start), children: children);
}

midBuffer.write(postColonWhitespace);
Expand Down

0 comments on commit 7677ab1

Please sign in to comment.