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

Readme specification of keys is ambiguous #464

Closed
vmchale opened this issue May 29, 2017 · 3 comments · Fixed by #491
Closed

Readme specification of keys is ambiguous #464

vmchale opened this issue May 29, 2017 · 3 comments · Fixed by #491

Comments

@vmchale
Copy link

vmchale commented May 29, 2017

In the readme, it specifies bare keys as follows:

Bare keys may only contain letters, numbers, underscores, and dashes `(A-Za-z0-9_-)`

This can be confusing, because, for example,

çe = "value"

is not considered valid TOML though I expected it to be.

If possible, you should either:

  1. Avoid specifying letters as (A-Za-z) and instead specify letters as "unicode letters and unicode nonspacing marks (to include dependent vowels such as བོ) and numbers as "unicode decimal digists".
  2. Specify that letters and numerals should be valid ASCII and that they may not be letters or numerals from utf8.

Thanks!

@dtolnay
Copy link

dtolnay commented May 29, 2017

Based on #283 and #337 it seems like the restriction to A-Za-z0-9_- is very intentional. I agree that "letter" is not the clearest way to specify A-Za-z, "number" is not the clearest way to specify 0-9, and "dash" is not the clearest way to specify -.

Relevant PR on the Rust side: toml-rs/toml-rs#177

@ChristianSi
Copy link
Contributor

Yes, the restriction is intentional. It would probably be better to rewrite the above as:

Bare keys may only contain ASCII letters, ASCII digits, underscores, and hyphens (A-Za-z0-9_-).

This was referenced Oct 14, 2017
@mk-pmb
Copy link

mk-pmb commented Nov 5, 2017

Yes, "ASCII letter" is a better wording, especially considering that

letters and numerals should be valid ASCII and that they may not be letters or numerals from utf8.

is useless because there would be no letters left, as ASCII is a proper subset of UTF-8.

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 a pull request may close this issue.

4 participants