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 Version Declaration #860

Closed
jeff-hykin opened this issue Nov 28, 2021 · 2 comments
Closed

Toml Version Declaration #860

jeff-hykin opened this issue Nov 28, 2021 · 2 comments

Comments

@jeff-hykin
Copy link

jeff-hykin commented Nov 28, 2021

I haven't seen anywhere in the spec, or in the issues, discussing how to specify the toml version (which I find very surpising).
In the case that there really is no previous dicussion on this, I'd like to request that there be some way to tell the parser the minium or exact version of toml the document is supposed to use.

For example, with most parsers currenly being at the v0.4 spec, it would be nice to tell them that a document follows the v1.0 spec and they shouldn't be throwing errors about key.subkey = 10.

I do not have a propsal on the exact syntax, as I think the current contributor would do a better job of choosing than myself. An example implmentation would be the (not particularly elegant) implmentation that YAML chose with declarations using a percent sign: %YAML 1.1 or %YAML 1.2.

@marzer
Copy link
Contributor

marzer commented Nov 28, 2021

I haven't seen anywhere in the spec, or in the issues,

with most parsers currenly being at the v0.4 spec,

How do you figure that? A cursory look at the list of parsers on the wiki suggests that "most" being 0.4 is generous at best. Quite a few still, sure, but "most" suggests an outright majority and that's not nearly the case. The actual counts are thus (at the time of writing):

  • v1.0: 28
  • various v1.0 RCs: 7
  • v0.5: 19
  • v0.4: 29
  • v0.3 and earlier: I didn't bother counting since they're pretty much all abandonware at this point

(also FWIW a new v1.0 implementation is still popping up every few weeks or so)

it would be nice to tell them that a document follows the v1.0 spec and they shouldn't be throwing errors about ...

So, given this feature, a v0.4 parser should have awareness that v1.0 exists, and know what special casing to apply when given a v1.0 document? If the developer of a v0.4 parser is still maintaining it to add such a feature we should be encouraging them to implement 1.0 support instead, IMO.

@jeff-hykin
Copy link
Author

jeff-hykin commented Nov 29, 2021

Thanks for the issue links, I guess I should've searched for pragma instead of declaration.

That link to the wiki is also much appreciated, I will be making great use of that. My numbers were just from skimming package managers, like npm and pypi, and the top 5 or so advertised being "up to v0.4".

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

No branches or pull requests

2 participants