hjson / hjson-java

Hjson for Java
https://hjson.github.io/
MIT License
159 stars 24 forks source link

Option to disallow duplicate keys in input #5

Closed danielnorberg closed 8 years ago

danielnorberg commented 8 years ago

It'd be useful to be able to configure the parser to fail on duplicate keys in input in order to catch user errors in e.g. configuration files.

I.e. fail on:

some_config: {
  param1: foo
  param2: bar
  param2: baz  # Really intended to set param3 here but made a copypasta mistake
}

What do you think?

laktak commented 8 years ago

Sorry for the late response. While you are basically right, Hjson is a superset of JSON. While it does not make a lot of sense it is used by some people for comments. And we need JSON support to allow for seamless upgrades from JSON to Hjson.