Skip to content

Should Parser Validate the Entire TOML File Before Returning the Found Queried Value? #1035

Closed Answered by eksortso
hollowaykeanho asked this question in Q&A
Discussion options

You must be logged in to vote

We never took text streams into account when defining the standard, which wasn't intended to be a data serialization format. That would be nice, but we never considered it. It's not a common configuration use case.

There's a remote possibility that a table or key will be defined more than once on a stream, which would invalidate the complete TOML text. Like so:

[example]
item = "value"
# Imagine the stream is cut off at this point.
item = "other value"  # INVALID, since the key example.item was defined already.

Or like so:

[example]
item = "value"
# Imagine the stream is cut off at this point.

[example]  # INVALID, since the table "example" was defined already.

Since the stream parser co…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@hollowaykeanho
Comment options

@eksortso
Comment options

Answer selected by hollowaykeanho
@hollowaykeanho
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants