Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2208)

Unified Diff: pkg/csslib/lib/src/tree_printer.dart

Issue 23819036: Support for @mixin, @include and @extend (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: All changes ready to commit Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/csslib/lib/src/tree_base.dart ('k') | pkg/csslib/lib/visitor.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/csslib/lib/src/tree_printer.dart
diff --git a/pkg/csslib/lib/src/tree_printer.dart b/pkg/csslib/lib/src/tree_printer.dart
index 24cca64f1fd741c168c37853f9186d88c781a21b..3dc2afd56fbd30d530e3ed49c5c0c17cc6a51c73 100644
--- a/pkg/csslib/lib/src/tree_printer.dart
+++ b/pkg/csslib/lib/src/tree_printer.dart
@@ -103,6 +103,10 @@ class _TreePrinter extends Visitor {
output.depth--;
}
+ void visitContentDirective(ContentDirective node) {
+ print("ContentDirective not implemented");
+ }
+
void visitKeyFrameDirective(KeyFrameDirective node) {
heading('KeyFrameDirective', node);
output.depth++;
@@ -141,7 +145,48 @@ class _TreePrinter extends Visitor {
void visitVarDefinitionDirective(VarDefinitionDirective node) {
heading('Less variable definition', node);
+ output.depth++;
visitVarDefinition(node.def);
+ output.depth--;
+ }
+
+ void visitMixinRulesetDirective(MixinRulesetDirective node) {
+ heading('Mixin top-level ${node.name}', node);
+ output.writeNodeList('parameters', node.definedArgs);
+ output.depth++;
+ _visitNodeList(node.rulesets);
+ output.depth--;
+ }
+
+ void visitMixinDeclarationDirective(MixinDeclarationDirective node) {
+ heading('Mixin declaration ${node.name}', node);
+ output.writeNodeList('parameters', node.definedArgs);
+ output.depth++;
+ visitDeclarationGroup(node.declarations);
+ output.depth--;
+ }
+
+ /**
+ * Added optional newLine for handling @include at top-level vs/ inside of
+ * a declaration group.
+ */
+ void visitIncludeDirective(IncludeDirective node) {
+ heading('IncludeDirective ${node.name}', node);
+ output.writeNodeList('parameters', node.args);
+ }
+
+ void visitIncludeMixinAtDeclaration(IncludeMixinAtDeclaration node) {
+ heading('IncludeMixinAtDeclaration ${node.include.name}', node);
+ output.depth++;
+ visitIncludeDirective(node.include);
+ output.depth--;
+ }
+
+ void visitExtendDeclaration(ExtendDeclaration node) {
+ heading('ExtendDeclaration', node);
+ output.depth++;
+ _visitNodeList(node.selectors);
+ output.depth--;
}
void visitRuleSet(RuleSet node) {
« no previous file with comments | « pkg/csslib/lib/src/tree_base.dart ('k') | pkg/csslib/lib/visitor.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698