visitIncludeDirective method

  1. @override
void visitIncludeDirective(
  1. IncludeDirective node
)
override

Implementation

@override
void visitIncludeDirective(IncludeDirective node) {
  if (map.containsKey(node.name)) {
    var mixinDef = map[node.name];
    if (currDef is MixinDeclarationDirective &&
        mixinDef is MixinDeclarationDirective) {
      _IncludeReplacer.replace(
          _styleSheet!, node, mixinDef.declarations.declarations);
    } else if (currDef is MixinDeclarationDirective) {
      var decls =
          (currDef as MixinDeclarationDirective).declarations.declarations;
      var index = _findInclude(decls, node);
      if (index != -1) {
        decls.replaceRange(index, index + 1, [NoOp()]);
      }
    }
  }

  super.visitIncludeDirective(node);
}