doctype method Null safety

Parser doctype()

Implementation

Parser doctype() => XmlToken.openDoctype
    .toParser()
    .seq(ref0(space))
    .seq(ref0(nameToken)
        .or(ref0(attributeValue))
        .or(XmlToken.openDoctypeBlock
            .toParser()
            .seq(any().starLazy(XmlToken.closeDoctypeBlock.toParser()))
            .seq(XmlToken.closeDoctypeBlock.toParser()))
        .separatedBy(ref0(spaceOptional))
        .flatten('Expected doctype content'))
    .seq(ref0(spaceOptional))
    .seq(XmlToken.closeDoctype.toParser());