nmushegian / jams

actually minimal JSON alternative
12 stars 7 forks source link

Prohibit duplicate keys at parse time #4

Closed nmushegian closed 2 years ago

nmushegian commented 2 years ago

JSON spec does not say what to do if there are multiple keys and different parsers do different things.

In JAMS, duplicate keys are defined to be invalid JAMS files, they should not parse. Note this technically changes which kind of language/grammar JAMS is (not LL1 anymore I think) but it doesn’t matter

dmfxyz commented 2 years ago

I believe this is now handled: https://github.com/nmushegian/jams/blob/master/jams.js#L61