Visit `doctype`. Sets terse mode to `true` when html 5
is used, causing self-closing tags to end with ">" vs "/>",
and boolean attributes are not mirrored.

@param {Doctype} doctype
@api public
968627
function(doctype){
    var ast = [];
    if (doctype && (doctype.val || !this.doctype)) {
      this.setDoctype(doctype.val || 'html');
    }

    if (this.doctype) push.apply(ast, this.buffer(this.doctype));
    this.hasCompiledDoctype = true;
    return ast;
  }
547011
def doctype_matches(text, regex):
    
    m = doctype_lookup_re.match(text)
    if m is None:
        return False
    doctype = m.group(2)
    return re.compile(regex, re.I).match(doctype.strip()) is not None
1208100
private ComparisonState
        compareDocTypes(DocumentType control,
                        XPathContext controlContext,
                        DocumentType test,
                        XPathContext testContext) {
        return compare(new Comparison(ComparisonType.DOCTYPE_NAME,
                                      control, getXPath(controlContext),
                                      control.getName(), getParentXPath(controlContext),
                                      test, getXPath(testContext),
                                      test.getName(), getParentXPath(testContext)))
            .andThen(new Comparison(ComparisonType.DOCTYPE_PUBLIC_ID,
                                    control, getXPath(controlContext),
                                    control.getPublicId(), getParentXPath(controlContext),
                                    test, getXPath(testContext),
                                    test.getPublicId(), getParentXPath(testContext)))
            .andThen(new Comparison(ComparisonType.DOCTYPE_SYSTEM_ID,
                                    control, null, control.getSystemId(), null,
                                    test, null, test.getSystemId(), null));
    }
124323
function setDocType($iframe, doctype){
                var win, doc;
                win = $iframe.get(0);
                win = win.contentWindow || win.contentDocument || win;
                doc = win.document || win.contentDocument || win;
                doc.open();
                doc.write(doctype);
                doc.close();
            }
1221515
public function hasDocTypes() {
    $doc_comment = $this->getFunction()->getDocComment();
    if (!$doc_comment) {
      return FALSE;
    }
    $param_tag = $doc_comment->getParameter($this->getName());
    if (!$param_tag) {
      return FALSE;
    }
    $types = $param_tag->getTypes();
    return !empty($types);
  }
1257665
function common_doc(string, status, type){
    if( ! string ){ string = ''; }
    if( ! status ){ status = 200; }
    if( ! type ){ type = 'text/html'; }
    return {
	body: [string],
	headers: {'Content-Type': type},
	status: status
    };
}
1343628
function extension (type) {
  if (!type || typeof type !== 'string') {
    return false
  }

  // TODO: use media-typer
  var match = EXTRACT_TYPE_REGEXP.exec(type)

  // get extensions
  var exts = match && exports.extensions[match[1].toLowerCase()]

  if (!exts || !exts.length) {
    return false
  }

  return exts[0]
}
739761
private void readDoctype(boolean saveDtdText) throws IOException, XmlPullParserException {
        read(START_DOCTYPE);

        int startPosition = -1;
        if (saveDtdText) {
            bufferCapture = new StringBuilder();
            startPosition = position;
        }
        try {
            skip();
            rootElementName = readName();
            readExternalId(true, true);
            skip();
            if (peekCharacter() == '[') {
                readInternalSubset();
            }
            skip();
        } finally {
            if (saveDtdText) {
                bufferCapture.append(buffer, 0, position);
                bufferCapture.delete(0, startPosition);
                text = bufferCapture.toString();
                bufferCapture = null;
            }
        }

        read('>');
        skip();
    }
670767
function(type, data) {
		var test = 'HTML' + (type || '').replace(
			/^[a-z]/,
			function(m) {
				return m.toUpperCase();
			}

		) + 'Element';

		if (!data) {
			return false;
		}

		if (window[test]) {
			return data instanceof window[test];
		}
		else if (window.Element) {
			return data instanceof window.Element && (!type || (data.tagName && data.tagName.toLowerCase() === type));
		}
		else {
			return (!(data instanceof Object || data instanceof Array || data instanceof String || data instanceof Number) && data.tagName && data.tagName.toLowerCase() === type);
		}
	}
904012
def is_docstring(tokens, previous_logical):
    
    for token_type, text, start, _, _ in tokens:
        if token_type == tokenize.STRING:
            break
        elif token_type != tokenize.INDENT:
            return False
    else:
        return False
    line = text.lstrip()
    start, start_triple = _find_first_of(line, START_DOCSTRING_TRIPLE)
    if (previous_logical.startswith("def ") or
            previous_logical.startswith("class ")):
        if start == 0:
            return text
586808
function getDoctype(name) {
  var key = cleanDoctype(name)
  return shortcodes[key] || shortcodes['h' + key] || null
}
463833
protected boolean appendDocumentType(StringBuilder sb, DocumentType type) {
        if (type == null) {
            return false;
        }
        sb.append("<!DOCTYPE ").append(type.getName());
        boolean hasNoPublicId = true;
        if (type.getPublicId() != null && type.getPublicId().length() > 0) {
            sb.append(" PUBLIC \"").append(type.getPublicId()).append('"');
            hasNoPublicId = false;
        }
        if (type.getSystemId() != null && type.getSystemId().length() > 0) {
            if (hasNoPublicId) {
                sb.append(" SYSTEM");
            }
            sb.append(" \"").append(type.getSystemId()).append("\"");
        }
        sb.append(">");
        return true;
    }
782193
protected function renderDoctype()
    {
        $doctype = $this->def->doctype;
        $ret = '';
        $ret .= $this->start('table');
        $ret .= $this->element('caption', 'Doctype');
        $ret .= $this->row('Name', $doctype->name);
        $ret .= $this->row('XML', $doctype->xml ? 'Yes' : 'No');
        $ret .= $this->row('Default Modules', implode($doctype->modules, ', '));
        $ret .= $this->row('Default Tidy Modules', implode($doctype->tidyModules, ', '));
        $ret .= $this->end('table');
        return $ret;
    }
81972
function( doc, text, textFormat ){
		   this.textFormat = (textFormat)? textFormat : this.textFormat;
		   if(text){
			  var out = text
			  if(this.textFormat === 'whitespacetrimmed') {
				 out = modules.utils.trimWhitespace( out );
			  }
			  return out;
		   }else{
			  return '';
		   }
		}
47444
function isDocumentElement(element) {
	if (   element == document.body
		|| element.nodeType === 9
		|| (element.nodeType == 1 && element.nodeName == 'HTML')) {
		return true;
	}

	return false;
}
834458
function at_type() {
  match(/@type/);
  add_tag("type");
  skip_horiz_white();
  if (look(/\{/)) {
    var tdf = typedef();
    current_tag["type"] = tdf["type"];
    current_tag["optional"] = tdf["optional"] ? true : false;
  }
  else if (look(/\S/)) {
    current_tag["type"] = match(/\S+/);
  }
  skip_white();
}
989062
function isPropTypesDeclaration(context, node) {
  // Special case for class properties
  // (babel-eslint does not expose property name so we have to rely on tokens)
  if (node.type === 'ClassProperty') {
    const tokens = context.getFirstTokens(node, 2);
    if (isTypesDecl(tokens[0].value) || isTypesDecl(tokens[1].value)) {
      return true;
    }
    return false;
  }

  return Boolean(node && isTypesDecl(node.name));
}