diff --git a/lib/src/parser.dart b/lib/src/parser.dart index be290451..84095451 100644 --- a/lib/src/parser.dart +++ b/lib/src/parser.dart @@ -280,6 +280,7 @@ class Parser { var couldBeSelector = postColonWhitespace.isEmpty && _lookingAtInterpolatedIdentifier(); + var beforeDeclaration = _scanner.state; Expression value; try { value = _declarationExpression(); @@ -298,6 +299,7 @@ class Parser { // If the value would be followed by a semicolon, it's definitely supposed // to be a property, not a selector. + _scanner.state = beforeDeclaration; var additional = _almostAnyValue(); if (_scanner.peekChar() == $semicolon) rethrow; diff --git a/lib/src/visitor/serialize.dart b/lib/src/visitor/serialize.dart index 6a7edbde..0f1821af 100644 --- a/lib/src/visitor/serialize.dart +++ b/lib/src/visitor/serialize.dart @@ -319,8 +319,8 @@ class _SerializeCssVisitor extends CssVisitor { throw new UnsupportedError("$parent cannot be converted to CSS."); void visitPseudoSelector(PseudoSelector pseudo) { - _buffer.write($colon); - if (pseudo.type == PseudoType.element) _buffer.write($colon); + _buffer.writeCharCode($colon); + if (pseudo.type == PseudoType.element) _buffer.writeCharCode($colon); _buffer.write(pseudo.name); if (pseudo.argument == null && pseudo.selector == null) return;