From 683ee75703f9bde9ecf34ae3ec6ab2c3b68b52b2 Mon Sep 17 00:00:00 2001 From: Jeroen van Rijn Date: Fri, 28 Jul 2023 15:53:39 +0200 Subject: Fix #2684 --- core/encoding/xml/xml_reader.odin | 42 ++++++++++++++------------------------- 1 file changed, 15 insertions(+), 27 deletions(-) (limited to 'core/encoding/xml/xml_reader.odin') diff --git a/core/encoding/xml/xml_reader.odin b/core/encoding/xml/xml_reader.odin index f5523c299..f4f8a4b05 100644 --- a/core/encoding/xml/xml_reader.odin +++ b/core/encoding/xml/xml_reader.odin @@ -125,16 +125,19 @@ Document :: struct { Element :: struct { ident: string, - value: string, + value: [dynamic]Value, attribs: Attributes, kind: enum { Element = 0, Comment, }, - parent: Element_ID, - children: [dynamic]Element_ID, +} + +Value :: union { + string, + Element_ID, } Attribute :: struct { @@ -247,9 +250,6 @@ parse_bytes :: proc(data: []u8, options := DEFAULT_OPTIONS, path := "", error_ha err = .Unexpected_Token element, parent: Element_ID - - tag_is_open := false - first_element := true open: Token /* @@ -275,16 +275,10 @@ parse_bytes :: proc(data: []u8, options := DEFAULT_OPTIONS, path := "", error_ha e.g. (id: Element_ID) { cur := doc.element_count doc.element_count += 1 - return cur } \ No newline at end of file -- cgit v1.2.3