From 55e81951b23edf5d2cd09961f7883826cdeb2d54 Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Fri, 19 Aug 2016 14:09:20 -0700 Subject: [PATCH] Stringify the parent selector normally. --- lib/src/ast/selector/parent.dart | 2 -- lib/src/visitor/serialize.dart | 6 ++++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/src/ast/selector/parent.dart b/lib/src/ast/selector/parent.dart index 8044c2e4..8ef0f208 100644 --- a/lib/src/ast/selector/parent.dart +++ b/lib/src/ast/selector/parent.dart @@ -15,6 +15,4 @@ class ParentSelector extends SimpleSelector { List unify(List compound) => throw new UnsupportedError("& doesn't support unification."); - - String toString() => "&${suffix ?? ''}"; } diff --git a/lib/src/visitor/serialize.dart b/lib/src/visitor/serialize.dart index 0f1821af..d868ac5d 100644 --- a/lib/src/visitor/serialize.dart +++ b/lib/src/visitor/serialize.dart @@ -315,8 +315,10 @@ class _SerializeCssVisitor extends CssVisitor { (complex) => visitComplexSelector(complex)); } - void visitParentSelector(ParentSelector parent) => - throw new UnsupportedError("$parent cannot be converted to CSS."); + void visitParentSelector(ParentSelector parent) { + _buffer.writeCharCode($and); + if (parent.suffix != null) _buffer.write(parent.suffix); + } void visitPseudoSelector(PseudoSelector pseudo) { _buffer.writeCharCode($colon);