-
Notifications
You must be signed in to change notification settings - Fork 206
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
multiple keys are not parsed #52
Comments
first idea that came to my mind is that ini could use arrays instead of objects as a parsing result |
Hrm, yeah, that is not great. You're faced with:
|
:) tuples are great! we wrote whole databases in languages which just know tuples and lists of tuples!!!!11 all we had was tuples, tuples and lists - and our bare hands! if i would bring tuples to the offering table - would you prefer it an option or a breaking change - the current format works in many cases but is also a dead end... i am in favour of killing the object mode... |
Well, in cases like many config files, where subsequent options DO override earlier ones (as in npm's, where a key can only have a single value) it's exactly what you want. And if it isn't, then what you want is tuples all the way down, most likely. It's only a couple hundred lines, so I'd recommend just writing a new module. The use case is different enough that supporting both will be annoying. Feel free to copy out whatever parsing code you want. It's all ISC licensed, so it's fine. If you take a lot, include a link in your license so the provenance is called out. |
yeah so the whole thing i built is named tulips, and i hate it :) https://github.com/robertkowalski/tulips/ it is not feature complete (misses the subsection feature, e.g. it was enough for my use case (parsing |
i just realised that ini struggles with input like
(which is taken from a valid gitconfig)
in the ini notation multiple keys with different values are valid, but when ini parses them to JSON they get lost due to the limitations of JSON.
any ideas for a workaround or should i build a custom parser on my own instead?
The text was updated successfully, but these errors were encountered: