Coder Social home page Coder Social logo

Comments (2)

ToruNiina avatar ToruNiina commented on May 24, 2024

Sorry, but I could not reproduce it with a simple toml file that includes Body only. It works with both files.

The internal representation of an inline table is the same as that of multiline table. So the same operation should be able to be applied.

If you have encountered this behavior in a toml file containing other tables, it may be explained by the difference of inline tables and (multiline) tables in the toml specification.

Multiline tables create a new table, so the table value is placed below root. But an inline table is defined as a key-value pair, so they are placed under the table to which the row belongs.

That means that the following toml file

[foo]
bar = "baz"
[Body.1]
nodes=[1, 2]

corresponds to the following JSON.

{
  "foo": {"bar": "baz"},
  "Body": {"1": {"nodes": [1, 2]}}
}

On the other hand, the following toml file

[foo]
bar = "baz"

Body = {1={nodes=[1,2]},2={nodes=[2,3]}} 

corresponds to the following JSON.

{
  "foo": { "bar": "baz", "Body": { "1": {"nodes": [1, 2]}, "2": {"nodes": [2, 3]} } }
}

It makes Body "not found".

from toml11.

tsadowski avatar tsadowski commented on May 24, 2024

Dear ToruNiina,

thanks for the explanation.

That is probably the case. The table is swallowed by the previous table when it is inlined. So std::setw(xx) is a much more important parameter than I expected.

Cheers,
Torsten

from toml11.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.