diff options
| author | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2023-07-28 15:53:39 +0200 |
|---|---|---|
| committer | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2023-07-28 15:53:39 +0200 |
| commit | 683ee75703f9bde9ecf34ae3ec6ab2c3b68b52b2 (patch) | |
| tree | 4ba4cf55ff7d99b0e5910df2f4e0c6ef4fb4088d /core/encoding/xml/debug_print.odin | |
| parent | 5ac7fe453f5fbf0995c24f0c1c12ed439ae3aee9 (diff) | |
Fix #2684
Diffstat (limited to 'core/encoding/xml/debug_print.odin')
| -rw-r--r-- | core/encoding/xml/debug_print.odin | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/core/encoding/xml/debug_print.odin b/core/encoding/xml/debug_print.odin index e9a1cb160..0736e8893 100644 --- a/core/encoding/xml/debug_print.odin +++ b/core/encoding/xml/debug_print.odin @@ -65,19 +65,21 @@ print_element :: proc(writer: io.Writer, doc: ^Document, element_id: Element_ID, if element.kind == .Element { wprintf(writer, "<%v>\n", element.ident) - if len(element.value) > 0 { - tab(writer, indent + 1) - wprintf(writer, "[Value] %v\n", element.value) + + for value in element.value { + switch v in value { + case string: + tab(writer, indent + 1) + wprintf(writer, "[Value] %v\n", v) + case Element_ID: + print_element(writer, doc, v, indent + 1) + } } for attr in element.attribs { tab(writer, indent + 1) wprintf(writer, "[Attr] %v: %v\n", attr.key, attr.val) } - - for child in element.children { - print_element(writer, doc, child, indent + 1) - } } else if element.kind == .Comment { wprintf(writer, "[COMMENT] %v\n", element.value) } |