Instantiates all descendants of JsDuck::Tag::Tag
13038
def instantiate_tags(tag_classes)
      tag_classes.each do |cls|
        tag = cls.new()

        Array(tag.pattern).each do |pattern|
          @patterns[pattern] = tag
        end

        if tag.tagname
          @tagnames[tag.tagname] = tag
        end

        if tag.signature
          tag.signature[:tagname] = tag.tagname
          @signatures << tag.signature
        end

        @tags << tag
      end
    end
1169837
private void initCustomTaglets() {

        moduleTags = new ArrayList<>();
        packageTags = new ArrayList<>();
        typeTags = new ArrayList<>();
        fieldTags = new ArrayList<>();
        constructorTags = new ArrayList<>();
        methodTags = new ArrayList<>();
        inlineTags = new ArrayList<>();
        overviewTags = new ArrayList<>();

        for (Taglet current : customTags.values()) {
            if (current.inModule() && !current.isInlineTag()) {
                moduleTags.add(current);
            }
            if (current.inPackage() && !current.isInlineTag()) {
                packageTags.add(current);
            }
            if (current.inType() && !current.isInlineTag()) {
                typeTags.add(current);
            }
            if (current.inField() && !current.isInlineTag()) {
                fieldTags.add(current);
            }
            if (current.inConstructor() && !current.isInlineTag()) {
                constructorTags.add(current);
            }
            if (current.inMethod() && !current.isInlineTag()) {
                methodTags.add(current);
            }
            if (current.isInlineTag()) {
                inlineTags.add(current);
            }
            if (current.inOverview() && !current.isInlineTag()) {
                overviewTags.add(current);
            }
        }

        //Init the serialized form tags
        serializedFormTags = new ArrayList<>();
        serializedFormTags.add(customTags.get(SERIAL_DATA.tagName));
        serializedFormTags.add(customTags.get(THROWS.tagName));
        if (!nosince)
            serializedFormTags.add(customTags.get(SINCE.tagName));
        serializedFormTags.add(customTags.get(SEE.tagName));
    }
382659
function handleTagName(schema, tagName, node, stack) {
    // debugger
    var name = typeof tagName === 'string' ? tagName : null
    var ancestors = schema.ancestors
    var length
    var index

    if (!name || name === '*' || schema.tagNames.indexOf(name) === -1) {
        return false
    }

    ancestors = own.call(ancestors, name) ? ancestors[name] : []

    /* Some nodes can break out of their context if they
     * don’t have a certain ancestor. */
    if (ancestors.length !== 0) {
        length = ancestors.length + 1
        index = -1

        while (++index < length) {
            if (!ancestors[index]) {
                return false
            }

            if (stack.indexOf(ancestors[index]) !== -1) {
                break
            }
        }
    }

    return name
}
1222440
def html_factory(tag, **defaults):
    '''

    '''
    def html_input(*children, **params):
        p = defaults.copy()
        p.update(params)
        return Html(tag, *children, **p)
    return html_input
742513
def multi_constructor(loader, tag_suffix, node):
    

    if tag_suffix not in UNCONVERTED_SUFFIXES:
        tag_suffix = "{}{}".format(FN_PREFIX, tag_suffix)

    constructor = None

    if tag_suffix == "Fn::GetAtt":
        constructor = construct_getatt
    elif isinstance(node, yaml.ScalarNode):
        constructor = loader.construct_scalar
    elif isinstance(node, yaml.SequenceNode):
        constructor = loader.construct_sequence
    elif isinstance(node, yaml.MappingNode):
        constructor = loader.construct_mapping
    else:
        raise Exception("Bad tag: !{}".format(tag_suffix))

    return ODict((
        (tag_suffix, constructor(node)),
    ))
507350
function Tag(tagDict){
  if(!(this instanceof Tag))
    return new Tag(tagDict)

  // Check tagDict has the required fields
  checkType('String', 'tagDict.key', tagDict.key, {required: true});
  checkType('String', 'tagDict.value', tagDict.value, {required: true});

  // Init parent class
  Tag.super_.call(this, tagDict)

  // Set object properties
  Object.defineProperties(this, {
    key: {
      writable: true,
      enumerable: true,
      value: tagDict.key
    },
    value: {
      writable: true,
      enumerable: true,
      value: tagDict.value
    }
  })
}
1251539
function baseGetTag(value) {
  if (value == null) {
    return value === undefined ? undefinedTag : nullTag;
  }
  return symToStringTag && symToStringTag in Object(value) ? (0, _getRawTag2.default)(value) : (0, _objectToString2.default)(value);
}
1310707
function overrideTags (parent, child, telegraf) {
  const childCopy = {};
  const toAppend = [];
  formatTags(child, telegraf).forEach(tag => {
    const idx = typeof tag === 'string' ? tag.indexOf(':') : -1;
    if (idx < 1) { // Not found or first character
      toAppend.push(tag);
    } else {
      childCopy[tag.substring(0, idx)] = tag.substring(idx + 1);
    }
  });
  const result = parent.map(tag => {
    const idx = typeof tag === 'string' ? tag.indexOf(':') : -1;
    if (idx < 1) { // Not found or first character
      return tag;
    }
    const key = tag.substring(0, idx);
    if (childCopy.hasOwnProperty(key)) {
      const value = childCopy[key];
      delete childCopy[key];
      return `${key}:${value}`;
    }
    return tag;
  });
  Object.keys(childCopy).forEach(key => {
    result.push(`${key}:${childCopy[key]}`);
  });
  return result.concat(toAppend);
}
783110
def tag!(sym, *args, &block)
      text = nil
      attrs = nil
      sym = "#{sym}:#{args.shift}" if args.first.kind_of?(::Symbol)
      sym = sym.to_sym unless sym.class == ::Symbol
      args.each do |arg|
        case arg
        when ::Hash
          attrs ||= {}
          attrs.merge!(arg)
        when nil
          attrs ||= {}
          attrs.merge!({:nil => true}) if explicit_nil_handling?
        else
          text ||= ''
          text << arg.to_s
        end
      end
      if block
        unless text.nil?
          ::Kernel::raise ::ArgumentError,
            "XmlMarkup cannot mix a text argument with a block"
        end
        _indent
        _start_tag(sym, attrs)
        _newline
        begin
          _nested_structures(block)
        ensure
          _indent
          _end_tag(sym)
          _newline
        end
      elsif text.nil?
        _indent
        _start_tag(sym, attrs, true)
        _newline
      else
        _indent
        _start_tag(sym, attrs)
        text! text
        _end_tag(sym)
        _newline
      end
      @target
    end
902162
function mount(selector, tagName, opts) {
      var tags = [];
      var elem, allTags;

      function pushTagsTo(root) {
        if (root.tagName) {
          var riotTag = getAttribute(root, IS_DIRECTIVE), tag;

          // have tagName? force riot-tag to be the same
          if (tagName && riotTag !== tagName) {
            riotTag = tagName;
            setAttribute(root, IS_DIRECTIVE, tagName);
          }

          tag = mount$1(root, riotTag || root.tagName.toLowerCase(), opts);

          if (tag)
            { tags.push(tag); }
        } else if (root.length)
          { each(root, pushTagsTo); } // assume nodeList
      }

      // inject styles into DOM
      styleManager.inject();

      if (isObject$1(tagName)) {
        opts = tagName;
        tagName = 0;
      }

      // crawl the DOM to find the tag
      if (isString(selector)) {
        selector = selector === '*' ?
          // select all registered tags
          // & tags found with the riot-tag attribute set
          allTags = query() :
          // or just the ones named like the selector
          selector + query(selector.split(/, */));

        // make sure to pass always a selector
        // to the querySelectorAll function
        elem = selector ? $$(selector) : [];
      }
      else
        // probably you have passed already a tag or a NodeList
        { elem = selector; }

      // select all the registered and mount them inside their root elements
      if (tagName === '*') {
        // get all custom tags
        tagName = allTags || query();
        // if the root els it's just a single tag
        if (elem.tagName)
          { elem = $$(tagName, elem); }
        else {
          // select all the children for all the different root elements
          var nodeList = [];

          each(elem, function (_el) { return nodeList.push($$(tagName, _el)); });

          elem = nodeList;
        }
        // get rid of the tagName
        tagName = 0;
      }

      pushTagsTo(elem);

      return tags
    }
799426
public static function loadTags() {
		
		// load defaults
		$tagDir = Config::getOption("sourceDir").DIRECTORY_SEPARATOR."_twig-components/tags";
		$tagExt = Config::getOption("twigTagExt");
		$tagExt = $tagExt ? $tagExt : "tag.php";
		
		if (is_dir($tagDir)) {
			
			// loop through the tags and instantiate the class...
			$finder = new Finder();
			$finder->files()->name("*\.".$tagExt)->in($tagDir);
			$finder->sortByName();
			foreach ($finder as $file) {
				
				// see if the file should be ignored or not
				$baseName = $file->getBasename();
				if ($baseName[0] != "_") {
					
					include($file->getPathname());
					
					// Project_{filenameBase}_TokenParser should be defined in the include
					$className = "Project_".$file->getBasename(".".$tagExt)."_TokenParser";
					self::$instance->addTokenParser(new $className());
					
				}
				
			}
			
		}
		
	}
867243
function createTag(impl, conf, innerHTML) {
      if ( impl === void 0 ) impl = {};
      if ( conf === void 0 ) conf = {};

      var tag = conf.context || {};
      var opts = extend({}, conf.opts);
      var parent = conf.parent;
      var isLoop = conf.isLoop;
      var isAnonymous = !!conf.isAnonymous;
      var skipAnonymous = settings.skipAnonymousTags && isAnonymous;
      var item = conf.item;
      // available only for the looped nodes
      var index = conf.index;
      // All attributes on the Tag when it's first parsed
      var instAttrs = [];
      // expressions on this type of Tag
      var implAttrs = [];
      var expressions = [];
      var root = conf.root;
      var tagName = conf.tagName || getName(root);
      var isVirtual = tagName === 'virtual';
      var isInline = !isVirtual && !impl.tmpl;
      var dom;

      // make this tag observable
      if (!skipAnonymous) { observable(tag); }
      // only call unmount if we have a valid __TAG_IMPL (has name property)
      if (impl.name && root._tag) { root._tag.unmount(true); }

      // not yet mounted
      define(tag, 'isMounted', false);

      define(tag, '__', {
        impl: impl,
        root: root,
        skipAnonymous: skipAnonymous,
        implAttrs: implAttrs,
        isAnonymous: isAnonymous,
        instAttrs: instAttrs,
        innerHTML: innerHTML,
        tagName: tagName,
        index: index,
        isLoop: isLoop,
        isInline: isInline,
        item: item,
        parent: parent,
        // tags having event listeners
        // it would be better to use weak maps here but we can not introduce breaking changes now
        listeners: [],
        // these vars will be needed only for the virtual tags
        virts: [],
        wasCreated: false,
        tail: null,
        head: null
      });

      // create a unique id to this tag
      // it could be handy to use it also to improve the virtual dom rendering speed
      define(tag, '_riot_id', uid()); // base 1 allows test !t._riot_id
      define(tag, 'root', root);
      extend(tag, { opts: opts }, item);
      // protect the "tags" and "refs" property from being overridden
      define(tag, 'parent', parent || null);
      define(tag, 'tags', {});
      define(tag, 'refs', {});

      if (isInline || isLoop && isAnonymous) {
        dom = root;
      } else {
        if (!isVirtual) { root.innerHTML = ''; }
        dom = mkdom(impl.tmpl, innerHTML, isSvg(root));
      }

      define(tag, 'update', function (data) { return componentUpdate(tag, data, expressions); });
      define(tag, 'mixin', function () {
        var mixins = [], len = arguments.length;
        while ( len-- ) mixins[ len ] = arguments[ len ];

        return componentMixin.apply(void 0, [ tag ].concat( mixins ));
      });
      define(tag, 'mount', function () { return componentMount(tag, dom, expressions, opts); });
      define(tag, 'unmount', function (mustKeepRoot) { return tagUnmount(tag, mustKeepRoot, expressions); });

      return tag
    }
450182
function h(tag, props, ...children) {
    const overrideProps = get(options.overrides, `${tag}.props`, {});

    return createElementFn(
      getTag(tag, options.overrides),
      {
        ...props,
        ...overrideProps,
        className:
          cx(props && props.className, overrideProps.className) || undefined,
      },
      ...children
    );
  }
973158
def add_tags(new_tags)
      case new_tags
      when Array # Called with an array
        # Call recursively for each entry
        new_tags.each do |tag_hash|
          add_tags(tag_hash)
        end
      when Hash # Called with a hash
        #check if it is weird {'k' => 'key', 'v' => 'value'} syntax
        if (new_tags.size == 2 && new_tags.keys.include?('k') && new_tags.keys.include?('v'))
          # call recursively with values from k and v keys.
          add_tags({new_tags['k'] => new_tags['v']})
        else
          # OK, this seems to be a proper ruby hash with a single entry
          new_tags.each do |k,v|
            self.tags[k] = v
          end
        end
      end
      self    # return self so calls can be chained
    end
32907
function Tag(tagName, config, children) {
  this.tagName = tagName || 'div';
  config = config || {};
  this.children = children || [];
  this.props = config.props;
  this.attrs = config.attrs;
  this.attrsNS = config.attrsNS;
  this.events = config.events;
  this.hooks = config.hooks;
  this.data = config.data;
  this.params = config.params;
  this.element = undefined;
  this.parent = undefined;

  this.key = config.key != null ? config.key : undefined;

  this.namespace = config.attrs && config.attrs.xmlns || null;
  this.is = config.attrs && config.attrs.is || null;
}
822948
def tag_present
      ptr = ::FFI::MemoryPointer.new(:int)
      Klass.getTagStatus(@handle, ptr)
      (ptr.get_int(0) == 0) ? false : true
    end
726938
function sh_insertTags(tags, text) {
  var doc = document;

  var result = document.createDocumentFragment();
  var tagIndex = 0;
  var numTags = tags.length;
  var textPos = 0;
  var textLength = text.length;
  var currentNode = result;

  // output one tag or text node every iteration
  while (textPos < textLength || tagIndex < numTags) {
    var tag;
    var tagPos;
    if (tagIndex < numTags) {
      tag = tags[tagIndex];
      tagPos = tag.pos;
    }
    else {
      tagPos = textLength;
    }

    if (tagPos <= textPos) {
      // output the tag
      if (tag.node) {
        // start tag
        var newNode = tag.node;
        currentNode.appendChild(newNode);
        currentNode = newNode;
      }
      else {
        // end tag
        currentNode = currentNode.parentNode;
      }
      tagIndex++;
    }
    else {
      // output text
      currentNode.appendChild(doc.createTextNode(text.substring(textPos, tagPos)));
      textPos = tagPos;
    }
  }

  return result;
}