Import with #import "std/toml_document".
TomlKind :: enum { Missing = 0; String = 1; Integer = 2; Float = 3; Bool = 4; DateTime = 5; Array = 6; Table = 7; }TomlNode :: struct { kind: TomlKind; key: string; text: string; first: s32; last: s32; next: s32; count: s32; defined: bool; dotted: bool; sealed: bool; table_array: bool; }TomlDocument :: struct { nodes: Vec(TomlNode); root: s32; error: string; error_at: s64; }TomlKindOf :: (document: *TomlDocument, node: s32) -> TomlKindTomlFirst :: (document: *TomlDocument, node: s32) -> s32TomlNext :: (document: *TomlDocument, node: s32) -> s32TomlCount :: (document: *TomlDocument, node: s32) -> s32TomlMember :: (document: *TomlDocument, table: s32, key: string) -> s32TomlKey :: (document: *TomlDocument, node: s32) -> stringTomlString :: (document: *TomlDocument, node: s32) -> stringTomlScalarText :: (document: *TomlDocument, node: s32) -> stringValidated source spelling of a numeric, boolean, or date/time scalar.
TomlBool :: (document: *TomlDocument, node: s32) -> (bool, bool)TomlRead :: (document: *TomlDocument, text: string, max_bytes: s64) -> boolParse the complete UTF-8 document, bounded before allocation. On failure no partial tree is exposed (root = -1); error/error_at describe the first error. Increase max_bytes explicitly for larger documents. Depth is bounded at 128.