-
Notifications
You must be signed in to change notification settings - Fork 26
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 v0.2.0 compatibility #9
Comments
Tables are supported already (previously they were "hashes"), but not arrays of tables. I'll take a look. |
I need it for a configuration setup, where i need to declare multiple resources, so array of tables is the feature I was aiming for.
Is it hard to add it to the current implementation? |
Yeah, it's proving to be a bit tricky for me (note: I am no expert in parsers/compilers). Adding support to the grammar for matching the new syntax is easy enough, and compiling the basic case was easy, but the more advanced example from the TOML spec has proven more difficult. If you check out the [[resource]]
name = "file.ext1"
type = "video1"
path = "path/to/file1"
[[resource]]
name = "file.ext2"
type = "video2"
path = "path/to/file2" parses to {
resource: [
{ name: 'file.ext1', type: 'video1', path: 'path/to/file1' },
{ name: 'file.ext2', type: 'video2', path: 'path/to/file2' }
]
} I'll have to keep working on the more advanced case, but I don't think I'll finish this weekend. Perhaps this is enough to be usable to you for now; if so, you can point npm directly to commit 6b4dd00. You can see that all the other tests pass here: https://travis-ci.org/BinaryMuse/toml-node/jobs/19452878 |
I lied :) This works in v2.0.0, which has been published to npm. Please let me know if you have any problems. |
Works great, I really appreciate your effort, thank you! :) |
I'm trying to fiddle online with peg.js to add support for Tables
I can't quite figure out how to properly do it, if it's not much, please have a look, maybe its something easy for you.
The text was updated successfully, but these errors were encountered: