Attribute :: struct {
key: [] u8
value: [] u8
}
Document :: struct {
elements: [..] Element
strings: StringPool
}
Document.child_with_name :: (doc: &Document, parent: u32, name: [] u8) -> ? u32
Document.children :: (doc: &Document, parent: u32) -> Iterator(u32)
Document.destroy :: (doc: &Document) -> void
Element :: struct {
name: [] u8
parent: u32
attributes: [..] Attribute
children: [..] Child
}
Token :: struct {
kind: Kind
pos: Position
}
Tokenizer :: struct {
arena: Arena
s: &Stream
r: Reader
current: i32
offset: i32
line: i32
line_offset: i32
error: Error
peeked_token: ? Token
}
Tokenizer.advance :: (self: &Tokenizer) -> void
Tokenizer.destroy :: (self: &Tokenizer) -> void
Tokenizer.make :: (a: Allocator, s: &Stream) -> Tokenizer
Tokenizer.peek :: (self: &Tokenizer) -> Token
Tokenizer.scan :: (self: &Tokenizer) -> Token
Tokenizer.scan_ident :: (self: &Tokenizer) -> Kind
Tokenizer.scan_string :: (self: &Tokenizer, end: i32, multiline: bool) -> ([] u8, bool)
Tokenizer.skip_cdata :: (self: &Tokenizer) -> bool
Tokenizer.skip_whitespace :: (self: &Tokenizer) -> void
Child :: union {
Text: [] u8
Element: u32
}
ParseError :: union {
None: void
Error: [] u8
Expected_Token: Kind.tag_enum
Invalid_Token: [] u8
Token_Error: Error
}
parse :: (s: [] u8, allocator: Allocator) -> Result(Document, ParseError)
parse :: (s: &Stream, allocator: Allocator) -> Result(Document, ParseError)