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

The spec does not specify whether spaces must seperate the '=' in a key value pair. #180

Closed
keyneston opened this issue Mar 21, 2013 · 7 comments

Comments

@keyneston
Copy link

The spec makes it clear that key = "value" is legitimate but it doesn't make any claims if key="value" is legitimate.

At the very least the python library doesn't handle this case cleanly.

@laurent22
Copy link
Contributor

I think white spaces before and after = should be ignored by parsers. It's a user-edited file, so it's easy to accidentally add or remove a space.

@hit9
Copy link
Contributor

hit9 commented Mar 30, 2013

the whitespaces should be ignored , NOT only in this case ,but also everywhere. well ,my py parser toml.py noticed this.

@bootstraponline
Copy link

key="value" produces an error using the toml ruby gem. I think it should be valid.

@88Alex
Copy link

88Alex commented Apr 13, 2013

I think it should be valid.

It really should. Many languages (i.e. C++, C, Python, Java, among others) don't really care about whether you type key="value" or key = "value". TOML should be like that.

@88Alex
Copy link

88Alex commented Jun 27, 2013

@bootstraponline I submitted a pull request fixing that.

@parkr
Copy link

parkr commented Aug 1, 2013

I agree: it shouldn't matter how many spaces there are in between the keys/values and the equals sign.

@BurntSushi
Copy link
Member

I think the spec is clear on this. key=1 is valid TOML. Here's the relevant section:

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

In key=1, y is the last non-whitespace character before the equals sign. This implies that key names (but not table names) cannot have = in them. It is worded in this way so that, e.g., key =1 is also valid.

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

7 participants