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

vlib: add toml module + tests #11964

Merged
merged 65 commits into from
Sep 24, 2021
Merged

vlib: add toml module + tests #11964

merged 65 commits into from
Sep 24, 2021

Conversation

larpon
Copy link
Contributor

@larpon larpon commented Sep 24, 2021

V + TOML = ❤️

toml module with ~99.9% TOML 1.0 format compatibility written in pure V.

I'll work on ironing out more checker errors to make it pass all (or most) of the invalid test suite TOML docs from here https://github.com/BurntSushi/toml-test/). The parser currently pass almost all of the valid tests which is why I think it's a good time to contribute it to vlib. To check against the test suite I've added a small CI job to make sure we can catch regressions.

In the future it'd be nice to make the value retrieval tests pass by testing against the json files - but there's still a little way to go.

It can currently parse TOML files and retrieve values correctly, except for >2 level array-table-array constructs looking like this:

[[a]]
    [[a.b]]
        [a.b.c]
            d = "val0"
    [[a.b]]
        [a.b.c]
            d = "val1"

It can be fixed over time along with the rest of the test suite files.

Happy TOMLing 🙂

vlib/toml/toml.v Outdated Show resolved Hide resolved
vlib/toml/toml.v Outdated Show resolved Hide resolved
Copy link
Member

@spytheman spytheman left a comment

Choose a reason for hiding this comment

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

Excellent work, @larpon !

@larpon
Copy link
Contributor Author

larpon commented Sep 24, 2021

Excellent work, @larpon !

Thanks a lot!

@spytheman spytheman merged commit 5541ec8 into vlang:master Sep 24, 2021
@larpon larpon deleted the feature/toml branch September 24, 2021 19:26
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.

3 participants