uiri/toml

Add support for quoted keys

Closed this issue · 2 comments

Please add support for quoted keys as described in spec ver 0.3.1 table quoted keys

uiri commented

What issue are you running into exactly with quoted keys? As far as I can tell, you can put basically anything you want in your keys except an equals sign.

Version 0.3.1 doesn't mention quoted keys. Since toml is a work in progress, I wait for new versions to be tagged before implementing new features. Right now I'm more concerned with implementing the changes which are in 0.3.1 than changes which might make it into a newer version.

On Sat, Jan 17, 2015 at 09:14:34AM -0800, Jiachen Yang wrote:

Please add support for quoted keys as described in spec ver 0.3.1 table quoted keys


Reply to this email directly or view it on GitHub:
#26

Sorry that I read the master/README.md and thought it was v0.3.1 .

The issue we are running into is when we have quoted keys, the quotation marks are remained in the key name:

>>> import toml
>>> toml.loads('["hello"]\nworld=0')
{'"hello"': {'world': 0}}

We are expecting {'hello': {'world': 0}} in this case, as other implementation we use (rust version) have this result.

Currently we are applying ast.literal_eval on the key names to workaround this feature.
Maybe we should wait for the next tagged version of toml language spec.

Sorry again for raising this.