Comments before first emlement not being captured

The xml library was not correctly detect that a comment occured
before the first element. This addresses the issue, but the comment
incorrectly includes --.
This commit is contained in:
StudebakerGuy
2026-01-07 18:44:30 -05:00
parent f9d9166ff1
commit dc37ff5036

View File

@@ -294,7 +294,7 @@ parse_bytes :: proc(data: []u8, options := DEFAULT_OPTIONS, path := "", error_ha
comment := scan_comment(t) or_return
if .Intern_Comments in opts.flags {
if len(doc.elements) == 0 {
if doc.element_count == 0 {
append(&doc.comments, comment)
} else {
el := new_element(doc)