Index: pkg/csslib/lib/src/tree.dart |
diff --git a/pkg/csslib/lib/src/tree.dart b/pkg/csslib/lib/src/tree.dart |
index e8411d31f8fabb185ab4bc46be89a65d032e4d27..370281e3b87f806b1336aa3955f7f7344ff86cb5 100644 |
--- a/pkg/csslib/lib/src/tree.dart |
+++ b/pkg/csslib/lib/src/tree.dart |
@@ -266,6 +266,12 @@ class NegationSelector extends SimpleSelector { |
visit(VisitorBase visitor) => visitor.visitNegationSelector(this); |
} |
+class NoOp extends TreeNode { |
+ NoOp() : super(null); |
+ |
+ visit(VisitorBase visitor) => visitor.visitNoOp(this); |
+} |
+ |
class StyleSheet extends TreeNode { |
/** |
* Contains charset, ruleset, directives (media, page, etc.), and selectors. |
@@ -494,6 +500,53 @@ class VarDefinitionDirective extends Directive { |
visit(VisitorBase visitor) => visitor.visitVarDefinitionDirective(this); |
} |
+class MixinDefinition extends Directive { |
+ final String name; |
+ final List definedArgs; |
+ final bool varArgs; |
nweiz
2013/09/18 22:40:54
As with @content, don't include infrastructure for
terry
2013/10/09 03:40:33
args supported.
On 2013/09/18 22:40:54, nweiz wrot
|
+ |
+ MixinDefinition(this.name, this.definedArgs, this.varArgs, Span span) |
+ : super(span); |
+ |
+ visit(VisitorBase visitor) => visitor.visitMixinDefinition(this); |
+} |
+ |
+/** To support defining a SASS @mixin. */ |
nweiz
2013/09/18 22:40:54
Only the first letter of "Sass" is capitalized.
T
terry
2013/10/09 03:40:33
Ok, referenced web site no need to explain the Sas
|
+class MixinRulesetDirective extends MixinDefinition { |
+ final List<RuleSet> rulesets; |
+ |
+ MixinRulesetDirective(String name, List args, bool varArgs, this.rulesets, |
+ Span span) : super(name, args, varArgs, span); |
+ |
+ visit(VisitorBase visitor) => visitor.visitMixinRulesetDirective(this); |
+} |
+ |
+class MixinDeclarationDirective extends MixinDefinition { |
+ final DeclarationGroup declarations; |
+ |
+ MixinDeclarationDirective(String name, List args, bool varArgs, |
+ this.declarations, Span span) : super(name, args, varArgs, span); |
+ |
+ visit(VisitorBase visitor) => visitor.visitMixinDeclarationDirective(this); |
+} |
+ |
+/** To support consuming a SASS mixin @include. */ |
+class IncludeDirective extends Directive { |
+ final String name; |
+ final List args; |
+ |
+ IncludeDirective(this.name, this.args, Span span) : super(span); |
+ |
+ visit(VisitorBase visitor) => visitor.visitIncludeDirective(this); |
+} |
+ |
+/** To support SASS @content. */ |
+class ContentDirective extends Directive { |
+ ContentDirective(Span span) : super(span); |
+ |
+ visit(VisitorBase visitor) => visitor.visitContentDirective(this); |
+} |
+ |
class Declaration extends TreeNode { |
final Identifier _property; |
final Expression _expression; |
@@ -544,6 +597,22 @@ class VarDefinition extends Declaration { |
visit(VisitorBase visitor) => visitor.visitVarDefinition(this); |
} |
+/** |
+ * Node for usage of @include mixin[(args,...)] found in a declaration group |
+ * instead of at a ruleset (toplevel) e.g., |
+ * div { |
+ * @include mixin1; |
+ * } |
+ */ |
+class IncludeMixinAtDeclaration extends Declaration { |
+ final IncludeDirective include; |
+ |
+ IncludeMixinAtDeclaration(this.include, Span span) |
+ : super(null, null, null, span); |
+ |
+ visit(VisitorBase visitor) => visitor.visitIncludeMixinAtDeclaration(this); |
+} |
+ |
class DeclarationGroup extends TreeNode { |
/** Can be either Declaration or RuleSet (if nested selector). */ |
final List _declarations; |