OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of csslib.visitor; | 5 part of csslib.visitor; |
6 | 6 |
7 /** | 7 /** |
8 * Visitor that produces a formatted string representation of the CSS tree. | 8 * Visitor that produces a formatted string representation of the CSS tree. |
9 */ | 9 */ |
10 class CssPrinter extends Visitor { | 10 class CssPrinter extends Visitor { |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 visitIncludeDirective(node.include, false); | 265 visitIncludeDirective(node.include, false); |
266 } | 266 } |
267 | 267 |
268 void visitExtendDeclaration(ExtendDeclaration node) { | 268 void visitExtendDeclaration(ExtendDeclaration node) { |
269 emit("@extend "); | 269 emit("@extend "); |
270 for (var selector in node.selectors) { | 270 for (var selector in node.selectors) { |
271 selector.visit(this); | 271 selector.visit(this); |
272 } | 272 } |
273 } | 273 } |
274 | 274 |
275 | |
276 void visitSelectorGroup(SelectorGroup node) { | 275 void visitSelectorGroup(SelectorGroup node) { |
277 var selectors = node.selectors; | 276 var selectors = node.selectors; |
278 var selectorsLength = selectors.length; | 277 var selectorsLength = selectors.length; |
279 for (var i = 0; i < selectorsLength; i++) { | 278 for (var i = 0; i < selectorsLength; i++) { |
280 if (i > 0) emit(',$_sp'); | 279 if (i > 0) emit(',$_sp'); |
281 selectors[i].visit(this); | 280 selectors[i].visit(this); |
282 } | 281 } |
283 } | 282 } |
284 | 283 |
285 void visitSimpleSelectorSequence(SimpleSelectorSequence node) { | 284 void visitSimpleSelectorSequence(SimpleSelectorSequence node) { |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 | 507 |
509 void visitWildcard(Wildcard node) { | 508 void visitWildcard(Wildcard node) { |
510 emit('*'); | 509 emit('*'); |
511 } | 510 } |
512 | 511 |
513 void visitDartStyleExpression(DartStyleExpression node) { | 512 void visitDartStyleExpression(DartStyleExpression node) { |
514 // TODO(terry): TBD | 513 // TODO(terry): TBD |
515 throw UnimplementedError; | 514 throw UnimplementedError; |
516 } | 515 } |
517 } | 516 } |
OLD | NEW |