matches {type} if possible and sets it on @current_tag Also checks for {optionality=} in type definition.
169146
function maybe_type() {
  skip_horiz_white();
  if (look(/\{/)) {
    var tdf = typedef();
    current_tag["type"] = tdf["type"];
    current_tag["optional"] = tdf["optional"] ? true : false;
  }
}
213246
function isType(type, input) {
	if (input === null) {
		return type.toLowerCase() === 'null';
	}

	return typeof input === type.toLowerCase() || Type.is(type, input);
}
47254
def match_const(self, tokens, item):
        """"""
        match, = tokens
        if match in const_vars:
            self.add_check(item + " is " + match)
        else:
            self.add_check(item + " == " + match)
1022477
function unlessHelper(params, hash, options) {
    return ifUnless(params, hash, options, !_emberViewsStreamsShould_display.default(params[0]));
  }
838742
def match_content_types_for(content_types, type)
      content_types.detect do |content_type, _|
        content_type.is_a?(Regexp) ? type.match(content_type) : type == content_type
      end
    end
359509
private void checkValueType(TemplateParam param, SoyValue value, TemplateNode node) {
    if (!TofuTypeChecks.isInstance(param.type(), value, node.getSourceLocation())) {
      // should this be a soydataexception?
      throw RenderException.createWithSource(
          "Parameter type mismatch: attempt to bind value '"
              + (value instanceof UndefinedData ? "(undefined)" : value)
              + "' (a "
              + value.getClass().getSimpleName()
              + ") to parameter '"
              + param.name()
              + "' which has a declared type of '"
              + param.type()
              + "'.",
          node);
    }
  }
1179004
def has_tag?(name)
      tags.any? {|tag| tag.tag_name.to_s == name.to_s }
    end
21081
def matches_criteria?(element)
      @criteria.all? do |method|
        case method
        when Symbol
          send(method, element)
        when Proc
          method.call(element)
        end
      end
    end
641138
public boolean match(ParserTokenType expected) {
      ParserToken next = lookAhead(0);
      if (next == null || !next.type.isInstance(expected)) {
         return false;
      }
      consume();
      return true;
   }
459981
function it_should_parse_flashes_tag_with_no_specified_types(
        $parser, $exprParser, $stream, $body, $nodeFactory, $node, $token, $catalog
    )
    {
        $stream->test(\Twig_Token::NAME_TYPE, 'using')->willReturn(true, true);
        $stream->expect(\Twig_Token::NAME_TYPE, 'using')->will(function() {});
        $stream->expect(\Twig_Token::NAME_TYPE, 'catalog')->will(function() {});
        $stream->expect(\Twig_Token::BLOCK_END_TYPE)->will(function() {});

        $exprParser->parseExpression()->willReturn($catalog);

        $parser->subparse(array($this, 'isEndTag'), true)->willReturn($body);

        $nodeFactory->createFlashesNode(null, $catalog, $body, 123)->willReturn($node);

        $this->parse($token)->shouldReturn($node);
    }
490621
private void ensureTyped(Node n, JSType type) {
    // Make sure FUNCTION nodes always get function type.
    checkState(!n.isFunction() || type.isFunctionType() || type.isUnknownType());
    if (n.getJSType() == null) {
      n.setJSType(type);
    }
  }
1050388
function Tag() {
        Model.apply(this, arguments);

        /** @member {TagKind} */
        this.kind = TK_STRING;

        /** @member {*} */
        this.value = '';

        /** @member {Model} */
        this.reference = null;

        /** @member {boolean} */
        this.checked = false;

        /** @member {number} */
        this.number = 0;

    }
110590
def it_should_have_tag_with(type, attribute_value_hash)
      attribute_value_hash.each do |attribute, value|
        it "should have a #{type} box with #{attribute} '#{value}'" do
          expect(output_buffer).to have_tag("form li #{type}[@#{attribute}=\"#{value}\"]")
        end
      end
    end
612432
def matching(type, list)
      list.map do |plugin|
        (plugins_map(type) || {})[string2class(plugin)]
      end
    end
810640
function isType(type, val) {
  if (Struct.typeChecker[type]) {
    return Struct.typeChecker[type](val);
  }
  return false;
}
1149562
def validate(self):
        """"""
        validate_marked_location(self.location)
        if not isinstance(self.optional, bool):
            raise TypeError(u'Expected bool optional, got: {} {}'.format(
                type(self.optional).__name__, self.optional))
480859
def _fix_tagging(value, params):
    

    _tag_type_to_explicit_implicit(params)

    retag = False
    if 'implicit' not in params:
        if value.implicit is not False:
            retag = True
    else:
        if isinstance(params['implicit'], tuple):
            class_, tag = params['implicit']
        else:
            tag = params['implicit']
            class_ = 'context'
        if value.implicit is False:
            retag = True
        elif value.class_ != CLASS_NAME_TO_NUM_MAP[class_] or value.tag != tag:
            retag = True

    if params.get('explicit') != value.explicit:
        retag = True

    if retag:
        return value.retag(params)
    return value