Skip to content

Conversation

@StormLord07
Copy link
Contributor

@StormLord07 StormLord07 commented Sep 21, 2025

TOML writing/reading more spec-conformant:

  • Basic (scalar) types are emitted before tables/structs.

  • Partial support added for [[array-of-tables]] on read.

  • Multi dimensional array of tables support

  • dotted keys support for AoT (not tested)

  • Write ordering. Emit key/value scalars first to avoid interleaving tables and scalars that can confuse TOML readers; tables/structs follow.

  • [[array-of-tables]] (read). Introduces a minimal pass that recognizes and aggregates repeated table headers into arrays. Dotted keys inside these arrays are not yet expanded/tested correctly.

  • N-dim arrays. In case of AoT is not yet supported currently i see two approaches.

  1. Append "items" to a key
[[vector.items.items....]]
key = "value"

But i see confusion might arise, if we have a vector called items inside of the struct itself.

  1. just inline it.

I want a review or direction of how i could approach this better, currently i put functionality where it seemed best fit, but i dont exactly like it, repetition of code, and it seems logical to put AoT handling for reading in the reflectable || glz_object_t op to avoid introducing, completely separate constexpr loop in the vector reading, but you might have a different idea. Also read.hpp line 794-822 behaves completely differently from 892-943 and I completely dont understand why...

Also coud you please point me to a place where I can see how to itroduce meta specifier so I can mark table as inline.

@StormLord07 StormLord07 changed the title TOML Specification conformance for writing, reading arrays [[key]] TOML Specification conformance for writing, reading [[AoT]] Sep 21, 2025
@nickdademo
Copy link

Looking forward to this! 👍

@StormLord07
Copy link
Contributor Author

Looking forward to this! 👍

I'm sorry I'm currently busy with my job, I intent to return to this as soon as I can. possibly need a bit of rewrite of what i already did, I think i jumbled responsibilities of reads/writes quite a lot... So a little bit of a push into right direction would be appreciated

I also really need that in my project. :)

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.

2 participants