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

Toml support #300

Merged
merged 15 commits into from Mar 28, 2019

Conversation

3 participants
@zekth
Copy link
Contributor

commented Mar 23, 2019

As told in #232 here is a draft of the TOML parser.

Added the documentation for the module.
Also the handling of Array Of Tables is not finished yet.

Questions:

  • If a declaration is invalid do we skip it or we throw an Exception? Also an option strict could be added to handle both cases.

Note: @GrosSacASac deepAssign function has been added to util/deep_assign.ts

TOML specs

Show resolved Hide resolved toml/parser.ts Outdated
Show resolved Hide resolved toml/parser_test.ts Outdated
Show resolved Hide resolved toml/parser.ts Outdated
@zekth

This comment has been minimized.

Copy link
Contributor Author

commented Mar 24, 2019

Does someone have opinion about questions?

cc @hayd @ry @j-f1 ?

@bartlomieju

This comment has been minimized.

Copy link
Contributor

commented Mar 26, 2019

@zekth re: strict option, AFAIK TOML has no strict/non-strict mode, so IMHO it should throw exception when declaration is invalid.

@ry

This comment has been minimized.

Copy link
Contributor

commented Mar 26, 2019

@zekth regarding your question - are there any existing libraries we can examine to copy behavior from?

@zekth

This comment has been minimized.

Copy link
Contributor Author

commented Mar 26, 2019

@zekth are there any existing libraries we can examine to copy behavior from?

There are some in the TOML wiki, like:

@ry

This comment has been minimized.

Copy link
Contributor

commented Mar 26, 2019

@zekth And how do they act on invalid declaration?

@zekth

This comment has been minimized.

Copy link
Contributor Author

commented Mar 26, 2019

@ry directly throws exception. It was just an idea i had.

@zekth zekth force-pushed the zekth:toml_support branch from 04544f3 to 3770006 Mar 26, 2019

Show resolved Hide resolved toml/README.md Outdated
Show resolved Hide resolved toml/parser.ts
Show resolved Hide resolved toml/test/arrays.toml Outdated
Show resolved Hide resolved util/deep_assign.ts

@ry ry marked this pull request as ready for review Mar 28, 2019

@zekth

This comment has been minimized.

Copy link
Contributor Author

commented Mar 28, 2019

@ry you put it as ready for review, there is still a remaining type handling left. I'm working on it and on some speed optimisations. Do you want to merge it in this state or wait for the last type to be handled? No problem for me in both cases.

@ry

This comment has been minimized.

Copy link
Contributor

commented Mar 28, 2019

@zekth I'm ok with merging now - looks useful as it is - but please complete that in follow up PRs

@zekth

This comment has been minimized.

Copy link
Contributor Author

commented Mar 28, 2019

@ry ready to ship. Array of tables is handled now, also updated the doc for the warning. I'll do some optimisation in future PRs to fix the speed and remaining cases.

@ry

This comment has been minimized.

Copy link
Contributor

commented Mar 28, 2019

Can you copy https://github.com/denoland/deno/blob/master/Cargo.toml to toml/testdata/deno_cargo.toml and check that this can parse it?

zekth added some commits Mar 28, 2019

@zekth

This comment has been minimized.

Copy link
Contributor Author

commented Mar 28, 2019

@ry Ready to merge.

@ry

ry approved these changes Mar 28, 2019

Copy link
Contributor

left a comment

Nice work! This is great to have.
LGTM

@ry ry merged commit fa1664e into denoland:master Mar 28, 2019

2 checks passed

denoland.deno_std #20190328.9 succeeded
Details
license/cla Contributor License Agreement is signed.
Details

@zekth zekth deleted the zekth:toml_support branch Mar 28, 2019

@zekth zekth referenced this pull request Mar 29, 2019

Closed

TOML support #232

@bartlomieju bartlomieju referenced this pull request Apr 1, 2019

Merged

v0.3.5 #2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.