more strictdef fixes for stdlibs (#24535)

This commit is contained in:
ringabout
2024-12-14 02:06:43 +08:00
committed by GitHub
parent be4d19e562
commit d31cce557b
21 changed files with 140 additions and 97 deletions

View File

@@ -49,6 +49,7 @@ proc untilElementEnd(x: var XmlParser, result: XmlNode,
result.addNode(parse(x, errors))
proc parse(x: var XmlParser, errors: var seq[string]): XmlNode =
result = nil
case x.kind
of xmlComment:
result = newComment(x.charData)
@@ -105,7 +106,8 @@ proc parseXml*(s: Stream, filename: string,
errors: var seq[string], options: set[XmlParseOption] = {reportComments}): XmlNode =
## Parses the XML from stream ``s`` and returns a ``XmlNode``. Every
## occurred parsing error is added to the ``errors`` sequence.
var x: XmlParser
result = nil
var x: XmlParser = default(XmlParser)
open(x, s, filename, options)
while true:
x.next()