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 // TODO(terry): Enable class for debug only; when conditional imports enabled. | 7 // TODO(terry): Enable class for debug only; when conditional imports enabled. |
8 | 8 |
9 /** Helper function to dump the CSS AST. */ | 9 /** Helper function to dump the CSS AST. */ |
10 String treeToDebugString(styleSheet, [bool useSpan = false]) { | 10 String treeToDebugString(styleSheet, [bool useSpan = false]) { |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 void visitNamespaceDirective(NamespaceDirective node) { | 134 void visitNamespaceDirective(NamespaceDirective node) { |
135 heading('NamespaceDirective', node); | 135 heading('NamespaceDirective', node); |
136 output.depth++; | 136 output.depth++; |
137 output.writeValue('prefix', node._prefix); | 137 output.writeValue('prefix', node._prefix); |
138 output.writeValue('uri', node._uri); | 138 output.writeValue('uri', node._uri); |
139 output.depth--; | 139 output.depth--; |
140 } | 140 } |
141 | 141 |
142 void visitVarDefinitionDirective(VarDefinitionDirective node) { | 142 void visitVarDefinitionDirective(VarDefinitionDirective node) { |
143 heading('Less variable definition', node); | 143 heading('Less variable definition', node); |
| 144 output.depth++; |
144 visitVarDefinition(node.def); | 145 visitVarDefinition(node.def); |
| 146 output.depth--; |
| 147 } |
| 148 |
| 149 void visitMixinRulesetDirective(MixinRulesetDirective node) { |
| 150 heading('Mixin top-level ${node.name}', node); |
| 151 output.depth++; |
| 152 _visitNodeList(node.rulesets); |
| 153 output.depth--; |
| 154 } |
| 155 |
| 156 void visitMixinDeclarationDirective(MixinDeclarationDirective node) { |
| 157 heading('Mixin declaration ${node.name}', node); |
| 158 output.depth++; |
| 159 visitDeclarationGroup(node.declarations); |
| 160 output.depth--; |
| 161 } |
| 162 |
| 163 /** |
| 164 * Added optional newLine for handling @include at top-level vs/ inside of |
| 165 * a declaration group. |
| 166 */ |
| 167 void visitIncludeDirective(IncludeDirective node) { |
| 168 heading('IncludeDirective ${node.name}', node); |
| 169 } |
| 170 |
| 171 void visitIncludeMixinAtDeclaration(IncludeMixinAtDeclaration node) { |
| 172 heading('IncludeMixinAtDeclaration ${node.include.name}', node); |
| 173 output.depth++; |
| 174 visitIncludeDirective(node.include); |
| 175 output.depth--; |
145 } | 176 } |
146 | 177 |
147 void visitRuleSet(RuleSet node) { | 178 void visitRuleSet(RuleSet node) { |
148 heading('Ruleset', node); | 179 heading('Ruleset', node); |
149 output.depth++; | 180 output.depth++; |
150 super.visitRuleSet(node); | 181 super.visitRuleSet(node); |
151 output.depth--; | 182 output.depth--; |
152 } | 183 } |
153 | 184 |
154 void visitDeclarationGroup(DeclarationGroup node) { | 185 void visitDeclarationGroup(DeclarationGroup node) { |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 } | 534 } |
504 | 535 |
505 void visitPaddingExpression(PaddingExpression node) { | 536 void visitPaddingExpression(PaddingExpression node) { |
506 heading('Dart Style PaddingExpression', node); | 537 heading('Dart Style PaddingExpression', node); |
507 } | 538 } |
508 | 539 |
509 void visitWidthExpression(WidthExpression node) { | 540 void visitWidthExpression(WidthExpression node) { |
510 heading('Dart Style WidthExpression', node); | 541 heading('Dart Style WidthExpression', node); |
511 } | 542 } |
512 } | 543 } |
OLD | NEW |