Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Toml #1439

Merged
merged 8 commits into from
Mar 25, 2023
Merged

Draft: Toml #1439

merged 8 commits into from
Mar 25, 2023

Conversation

mikefarah
Copy link
Owner

No description provided.

@mikefarah
Copy link
Owner Author

Hi @pelletier - I've got started on trying to write a decoder using your API - I'm a little confused as to how the table types work?

}

func (dec *tomlDecoder) createTable(tomlNode *toml.Node) (*yaml.Node, error) {
log.Debug("Table: %v", string(tomlNode.Data))
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here specifically - what's the toml.Node structure for the table? If you look at the test I've got in toml_test.go - I have

[owners]
blah = "X"

But I only see to get owners in the node child here 🤔

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. The parser returns top level expressions. So you should have a first node for the table header, then another one for key-value.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So in this example you need two calls to NextExpression() to parse the whole document (arguably 3 to detect that you're at the end of the document and stop).

skeet70 added a commit to IronCoreLabs/rust-toolchain that referenced this pull request Jan 31, 2023
github-actions bot pushed a commit to IronCoreLabs/rust-toolchain that referenced this pull request Jan 31, 2023
@mikefarah mikefarah merged commit 7103b78 into master Mar 25, 2023
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