parseDocument method
Implementation
Document? parseDocument() {
var doctype = parseDoctype();
if (doctype == null) {
var root = parseElement();
if (root == null) return null;
return Document(null, root);
}
var root = parseElement();
if (root == null) {
errors.add(
TwigDartError(TwigDartErrorSeverity.error, 'Missing root element after !DOCTYPE declaration.', doctype.span));
return null;
}
return Document(doctype, root);
}