Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tables that are not loaded inline as write inline #40

Open
HUD-Software opened this issue Jun 12, 2023 · 0 comments
Open

Tables that are not loaded inline as write inline #40

HUD-Software opened this issue Jun 12, 2023 · 0 comments

Comments

@HUD-Software
Copy link

HUD-Software commented Jun 12, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant