Skip to content

TOML Include - #171

Open
harrymkt wants to merge 12 commits into
samtupy:mainfrom
harrymkt:toml
Open

TOML Include#171
harrymkt wants to merge 12 commits into
samtupy:mainfrom
harrymkt:toml

Conversation

@harrymkt

@harrymkt harrymkt commented Mar 13, 2025

Copy link
Copy Markdown
Contributor

This TOML include still has no support for backslash escapes, of course

@Lucas18503

Copy link
Copy Markdown
Collaborator

How does this meaningfully differ from the existing ini include? As ini and TOML are so similar, I think that would be useful to know.

@harrymkt

Copy link
Copy Markdown
Contributor Author

@Lucas18503

They are similar, but no in many areas. A few examples:

INI:

test=Hello there

Goes to TOML

test = "Hello there"

Notice using quotes.

Also, this has a very reliable indentation support for subsections compared to INI include.

Because some may want to use because some API uses TOML.

The current downsides are:

  1. It needs tables, and lists support, including inline lists.
  2. Backslash escape support is needed.

The reason I've created this was because the API I used to fetch the data isn't useful with the INI include, so I created for myself. But then I've decided that just like me, NVGT community might need it so I've just made a pull request.

Of course, this current version and INI isn't that much different; However future features of TOML would make both the differents, including inline lists and inline tables.

player = [
	{name = "Jon", feet = 5.6},
	{name = "Alex", feet = 5.4}
]

That's just a table with inline lists.

The same result but different writing style:

[[players]]
	name = "Jon"
	feet = 5.6
[[players]]
	name = "Alex"
	feet = 5.4

@ethindp

ethindp commented Mar 25, 2025

Copy link
Copy Markdown
Collaborator

Are you hoping to have this merged once it's passed the TOML test suite or before?

@harrymkt

Copy link
Copy Markdown
Contributor Author

@ethindp I think this PR can be merged even though without inline tables and lists, because we have the properly working basic values that users will be using with. Strings, intagers, floatingpoints, boolians.

All datastream objects (provided that they are readable) can now pass to `toml::load(datastream@)` function instead of 1 strict file object.
@alexoloopios

Copy link
Copy Markdown

This could be useful in the future, but I don't see why we would need this now, but then again I'm a newb so this is new to me.

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

Successfully merging this pull request may close these issues.

4 participants