Skip to content
This repository has been archived by the owner on Sep 24, 2022. It is now read-only.

Support for dotted table spans #340

Merged
merged 3 commits into from
Oct 28, 2019
Merged

Conversation

est31
Copy link
Contributor

@est31 est31 commented Oct 5, 2019

This provides "support" for dotted table spans by setting them to 0. While special cases could get special case logic, in the general case toml allows for dotted tables without well defined spans.

In this document, the span for the dependencies table is for example not well-defined:

[dependencies.serde]
optional = true

[package]
name = "toml-spanned-value"

[dependencies]
toml = "0.7"

The package table for example does have a well-defined span and thus could be special-cased.

In toml you can declare maps via {} and via [name].
We can't obtain spans for [] maps but at least we
can emit fake spans to make SpannedValue work.

We also add a regression test.
@alexcrichton
Copy link
Collaborator

Looks reasonable to me, sorry for the delay in getting to this. Thanks though!

@alexcrichton alexcrichton merged commit ec21d60 into toml-rs:master Oct 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants