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

invalid/key-no-whitespace.toml is actually valid. #3

Closed
pygy opened this issue Mar 5, 2013 · 2 comments
Closed

invalid/key-no-whitespace.toml is actually valid. #3

pygy opened this issue Mar 5, 2013 · 2 comments

Comments

@pygy
Copy link

pygy commented Mar 5, 2013

According to the spec:

Under that, and until the next key or EOF are the key/values of that key group. Keys are on the left of the equals sign and values are on the right. Keys start with the first non-whitespace character and end with the last non-whitespace character before the equals sign. Key/value pairs within key groups are unordered.

This also means that valid/key-special-chars.toml is invalid.

@BurntSushi
Copy link
Member

I think I'm going to need an interpretation or something from you, because to me

Keys start with the first non-whitespace character and end with the last non-whitespace character before the equals sign.

implies the pattern ([^ \t]+)[ \t]+=, where the key is captured in the parentheses.

If an = sign weren't allowed in the key, then I think the language would have read:

Keys start with the first non-whitespace character and end either with the last character before the = or the last non-whitespace character.

This is why specifications need formal grammars. It is too difficult to capture all of the subtleties in English.

@BurntSushi
Copy link
Member

I've re-read the sentence. I think I've more or less convinced myself to come to your side of things. Bah. I'll update the tests.

BurntSushi added a commit that referenced this issue Mar 5, 2013
After re-reading the spec, I've convinced myself that key names cannot
contain '=' characters.
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