Skip to content

Tables that are not loaded inline as write inline #40

@HUD-Software

Description

@HUD-Software

Considering a toml file like this that is valid:

[package]
authors = [ "me", "I", "myself" ]
name = "proj"
version = "0.0.1"

[profile.debug]
sanitizer = true
coverage = true

[profile.release]
sanitizer = false
coverage = false

[profile.debug-opt]

When it loaded and save, the toml is broken.
The example code :

using Tommy;

TomlTable table;

using(StreamReader reader = File.OpenText("file.toml"))
{
    table = TOML.Parse(reader);
}

using (var file = File.OpenWrite("save.toml"))
{
    using StreamWriter sw = new(file);
    table.WriteTo(sw);
}

The resulting toml file is not correct:

[package]
authors = [ "me", "I", "myself" ]
name = "proj"
version = "0.0.1"
profile = { debug = { sanitizer = true, coverage = true }, release = { sanitizer = false, coverage = false }, debug-opt = {} }

Table that are not inline in original, should not be inlined when writing it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions