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 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 void visitOperatorPlus(OperatorPlus node) { | 522 void visitOperatorPlus(OperatorPlus node) { |
523 emit('+'); | 523 emit('+'); |
524 } | 524 } |
525 | 525 |
526 void visitOperatorMinus(OperatorMinus node) { | 526 void visitOperatorMinus(OperatorMinus node) { |
527 emit('-'); | 527 emit('-'); |
528 } | 528 } |
529 | 529 |
530 void visitVarUsage(VarUsage node) { | 530 void visitVarUsage(VarUsage node) { |
531 emit('var(${node.name}'); | 531 emit('var(${node.name}'); |
532 if (!node.defaultValues.isEmpty) { | 532 if (node.defaultValues.isNotEmpty) { |
533 emit(','); | 533 emit(','); |
534 for (var defaultValue in node.defaultValues) { | 534 for (var defaultValue in node.defaultValues) { |
535 emit(' '); | 535 emit(' '); |
536 defaultValue.visit(this); | 536 defaultValue.visit(this); |
537 } | 537 } |
538 } | 538 } |
539 emit(')'); | 539 emit(')'); |
540 } | 540 } |
541 | 541 |
542 void visitExpressions(Expressions node) { | 542 void visitExpressions(Expressions node) { |
(...skipping 27 matching lines...) Expand all Loading... |
570 | 570 |
571 void visitWildcard(Wildcard node) { | 571 void visitWildcard(Wildcard node) { |
572 emit('*'); | 572 emit('*'); |
573 } | 573 } |
574 | 574 |
575 void visitDartStyleExpression(DartStyleExpression node) { | 575 void visitDartStyleExpression(DartStyleExpression node) { |
576 // TODO(terry): TBD | 576 // TODO(terry): TBD |
577 throw UnimplementedError; | 577 throw UnimplementedError; |
578 } | 578 } |
579 } | 579 } |
OLD | NEW |